feat: possibilità di ingrandire gli elenchi delle pagine dashbaord, ticket e ticket a mio carico
This commit is contained in:
@@ -88,7 +88,19 @@ const DashboardView = {
|
||||
|
||||
<!-- Recent Tickets -->
|
||||
<div class="card">
|
||||
<div class="card-title">Ticket Recenti</div>
|
||||
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:var(--space-md); flex-wrap:wrap; gap:var(--space-xs);">
|
||||
<div class="card-title" style="margin-bottom:0;">Ticket Recenti</div>
|
||||
<div style="display:flex; align-items:center; gap:var(--space-xs); font-size:0.85rem; color:var(--text-secondary);">
|
||||
<span>Mostra:</span>
|
||||
<select id="dashboard-preview-limit" class="form-select" style="padding: 4px 28px 4px 8px; font-size: 0.8rem; height: 28px; min-width: 70px; margin: 0; background-position: right 8px center; border-color: var(--border-light);">
|
||||
<option value="5" ${stats.preview_limit === 5 ? 'selected' : ''}>5</option>
|
||||
<option value="10" ${stats.preview_limit === 10 ? 'selected' : ''}>10</option>
|
||||
<option value="20" ${stats.preview_limit === 20 ? 'selected' : ''}>20</option>
|
||||
<option value="50" ${stats.preview_limit === 50 ? 'selected' : ''}>50</option>
|
||||
<option value="100" ${stats.preview_limit === 100 ? 'selected' : ''}>100</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
${(stats.recent_tickets || []).length > 0 ? `
|
||||
<table class="recent-tickets-table">
|
||||
<thead>
|
||||
@@ -132,6 +144,24 @@ const DashboardView = {
|
||||
});
|
||||
});
|
||||
|
||||
// Bind preview limit change event
|
||||
const limitSelect = document.getElementById('dashboard-preview-limit');
|
||||
if (limitSelect) {
|
||||
limitSelect.addEventListener('change', async () => {
|
||||
const newLimit = parseInt(limitSelect.value, 10);
|
||||
try {
|
||||
await App.api('/api/dashboard/settings', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ preview_limit: newLimit }),
|
||||
});
|
||||
Toast.success(`Limite anteprima aggiornato a ${newLimit} ticket!`);
|
||||
this.render();
|
||||
} catch (err) {
|
||||
Toast.error('Errore durante il salvataggio dell\'impostazione: ' + err.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update open ticket count in sidebar badge
|
||||
const badge = document.getElementById('open-ticket-count');
|
||||
if (badge) {
|
||||
|
||||
Reference in New Issue
Block a user