feat(system): ajouter filtre par statut dans la page Logs
All checks were successful
Deploy / deploy (push) Successful in 2m30s
All checks were successful
Deploy / deploy (push) Successful in 2m30s
- Filtre toolbar : Échecs / Terminés / Tous (défaut : Échecs) - Badge statut sur chaque LogItem (vert Terminé / rouge Échec) - deleteAllLogs respecte le filtre actif
This commit is contained in:
parent
8443120c2f
commit
ec4a8be934
@@ -82,6 +82,7 @@ const {
|
||||
hasPreviousPage,
|
||||
sortBy,
|
||||
sortOrder,
|
||||
statusFilter,
|
||||
} = storeToRefs(logsStore);
|
||||
|
||||
const hasError = computed(() => !!error.value);
|
||||
@@ -100,12 +101,25 @@ function getSource(log) {
|
||||
|
||||
const isSortSelected = (by, order) => sortBy.value === by && sortOrder.value === order;
|
||||
|
||||
const STATUS_FILTERS = [
|
||||
{ key: 'failed', label: 'Échecs' },
|
||||
{ key: 'completed', label: 'Terminés' },
|
||||
{ key: 'all', label: 'Tous' },
|
||||
];
|
||||
|
||||
const toolbarConfig = computed(() => ({
|
||||
leftSection: [
|
||||
{ type: 'label', text: 'Logs', class: 'text-sm font-medium' },
|
||||
{ type: 'label', text: `(${total.value})`, class: 'text-sm text-gray-400' },
|
||||
],
|
||||
rightSection: [
|
||||
...STATUS_FILTERS.map(f => ({
|
||||
type: 'button',
|
||||
label: f.label,
|
||||
active: statusFilter.value === f.key,
|
||||
onClick: () => logsStore.setStatusFilter(f.key),
|
||||
})),
|
||||
{ type: 'divider' },
|
||||
{
|
||||
type: 'dropdown',
|
||||
icon: BarsArrowDownIcon,
|
||||
|
||||
Reference in New Issue
Block a user