Update.
This commit is contained in:
@@ -42,18 +42,18 @@ export class AdminDashboard extends HTMLElement {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="userModal" class="modal">
|
||||
<div id="userModal" class="modal" style="display: none;">
|
||||
<div class="modal-content">
|
||||
<span class="close-button">×</span>
|
||||
<h3>Edit User</h3>
|
||||
<form id="userForm">
|
||||
<input type="hidden" id="userId">
|
||||
<label for="username">Username:</label>
|
||||
<input type="text" id="username" required>
|
||||
<input type="text" id="username" class="input-field" required>
|
||||
<label for="email">Email:</label>
|
||||
<input type="email" id="email" required>
|
||||
<input type="email" id="email" class="input-field" required>
|
||||
<label for="password">Password (leave blank to keep current):</label>
|
||||
<input type="password" id="password">
|
||||
<input type="password" id="password" class="input-field">
|
||||
<label for="isSuperuser">Superuser:</label>
|
||||
<input type="checkbox" id="isSuperuser">
|
||||
<label for="isActive">Active:</label>
|
||||
@@ -61,9 +61,9 @@ export class AdminDashboard extends HTMLElement {
|
||||
<label for="is2faEnabled">2FA Enabled:</label>
|
||||
<input type="checkbox" id="is2faEnabled">
|
||||
<label for="storageQuotaBytes">Storage Quota (Bytes):</label>
|
||||
<input type="number" id="storageQuotaBytes">
|
||||
<input type="number" id="storageQuotaBytes" class="input-field">
|
||||
<label for="planType">Plan Type:</label>
|
||||
<input type="text" id="planType">
|
||||
<input type="text" id="planType" class="input-field">
|
||||
<button type="submit" class="button button-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -216,7 +216,7 @@ class BillingDashboard extends HTMLElement {
|
||||
|
||||
<div class="payment-methods-section">
|
||||
<h3>Payment Methods</h3>
|
||||
<button class="btn-primary" id="addPaymentMethod">Add Payment Method</button>
|
||||
<button class="button button-primary" id="addPaymentMethod">Add Payment Method</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -248,7 +248,7 @@ class BillingDashboard extends HTMLElement {
|
||||
<td><span class="invoice-status ${invoice.status}">${invoice.status}</span></td>
|
||||
<td>${invoice.due_date ? this.formatDate(invoice.due_date) : '-'}</td>
|
||||
<td>
|
||||
<button class="btn-link" data-invoice-id="${invoice.id}">View</button>
|
||||
<button class="button" data-invoice-id="${invoice.id}">View</button>
|
||||
</td>
|
||||
</tr>
|
||||
`).join('')}
|
||||
@@ -309,8 +309,8 @@ class BillingDashboard extends HTMLElement {
|
||||
<h2>Add Payment Method</h2>
|
||||
<div id="payment-element"></div>
|
||||
<div class="modal-actions">
|
||||
<button class="btn-primary" id="submitPayment">Add Card</button>
|
||||
<button class="btn-secondary" id="cancelPayment">Cancel</button>
|
||||
<button class="button button-primary" id="submitPayment">Add Card</button>
|
||||
<button class="button" id="cancelPayment">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -394,7 +394,7 @@ class BillingDashboard extends HTMLElement {
|
||||
<div><strong>Total:</strong> ${this.formatCurrency(invoice.total)}</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn-secondary" onclick="this.closest('.modal').remove()">Close</button>
|
||||
<button class="button" onclick="this.closest('.modal').remove()">Close</button>
|
||||
</div>
|
||||
`;
|
||||
document.body.appendChild(modal);
|
||||
|
||||
@@ -112,8 +112,8 @@ export class FileList extends HTMLElement {
|
||||
</div>
|
||||
` : ''}
|
||||
|
||||
${totalItems === 0 ? '<p class="empty-state">No files found.</p>' : ''}
|
||||
<div class="file-grid">
|
||||
${totalItems === 0 ? '<p class="empty-state">No files found.</p>' : ''}
|
||||
${this.folders.map(folder => this.renderFolder(folder)).join('')}
|
||||
${this.files.map(file => this.renderFile(file)).join('')}
|
||||
</div>
|
||||
|
||||
@@ -39,6 +39,9 @@ export class LoginView extends HTMLElement {
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
this.querySelector('#login-error').style.display = 'none';
|
||||
this.querySelector('#register-error').style.display = 'none';
|
||||
}
|
||||
|
||||
attachListeners() {
|
||||
@@ -76,6 +79,9 @@ export class LoginView extends HTMLElement {
|
||||
const password = formData.get('password');
|
||||
const errorDiv = this.querySelector('#login-error');
|
||||
|
||||
errorDiv.style.display = 'none';
|
||||
errorDiv.textContent = '';
|
||||
|
||||
try {
|
||||
logger.info('Login attempt started', { username });
|
||||
await api.login(username, password);
|
||||
@@ -84,6 +90,7 @@ export class LoginView extends HTMLElement {
|
||||
} catch (error) {
|
||||
logger.error('Login failed', { username, error: error.message });
|
||||
errorDiv.textContent = error.message;
|
||||
errorDiv.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +103,9 @@ export class LoginView extends HTMLElement {
|
||||
const password = formData.get('password');
|
||||
const errorDiv = this.querySelector('#register-error');
|
||||
|
||||
errorDiv.style.display = 'none';
|
||||
errorDiv.textContent = '';
|
||||
|
||||
try {
|
||||
logger.info('Registration attempt started', { username, email });
|
||||
await api.register(username, email, password);
|
||||
@@ -104,6 +114,7 @@ export class LoginView extends HTMLElement {
|
||||
} catch (error) {
|
||||
logger.error('Registration failed', { username, email, error: error.message });
|
||||
errorDiv.textContent = error.message;
|
||||
errorDiv.style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,10 +30,19 @@ class PhotoGallery extends HTMLElement {
|
||||
async renderPhotos() {
|
||||
const grid = this.querySelector('.gallery-grid');
|
||||
if (this.photos.length === 0) {
|
||||
grid.innerHTML = '<p class="empty-state">No photos found.</p>';
|
||||
grid.innerHTML = '';
|
||||
const header = this.querySelector('.gallery-header');
|
||||
const empty = document.createElement('p');
|
||||
empty.className = 'empty-state';
|
||||
empty.textContent = 'No photos found.';
|
||||
header.insertAdjacentElement('afterend', empty);
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove any existing empty-state
|
||||
const existingEmpty = this.querySelector('.empty-state');
|
||||
if (existingEmpty) existingEmpty.remove();
|
||||
|
||||
grid.innerHTML = this.photos.map(photo => `
|
||||
<div class="photo-item" data-file-id="${photo.id}">
|
||||
<img
|
||||
|
||||
@@ -32,7 +32,9 @@ export class SharedItems extends HTMLElement {
|
||||
if (this.myShares.length === 0) {
|
||||
this.innerHTML = `
|
||||
<div class="shared-items-container">
|
||||
<h2>Shared Items</h2>
|
||||
<div class="file-list-header">
|
||||
<h2>Shared Items</h2>
|
||||
</div>
|
||||
<p class="empty-state">No shared items found.</p>
|
||||
</div>
|
||||
`;
|
||||
@@ -41,7 +43,9 @@ export class SharedItems extends HTMLElement {
|
||||
|
||||
this.innerHTML = `
|
||||
<div class="shared-items-container">
|
||||
<h2>Shared Items</h2>
|
||||
<div class="file-list-header">
|
||||
<h2>Shared Items</h2>
|
||||
</div>
|
||||
<div class="share-list">
|
||||
${this.myShares.map(share => this.renderShare(share)).join('')}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user