✨ refactor(ui): Improve usage log filter responsiveness and mobile UX
Refactor the usage log filter toolbar into a shared reusable component for common, drawing, and task logs. Optimize desktop filters with a responsive grid, move secondary filters into a mobile drawer, standardize filter typography, remove redundant filter icons, and add the missing i18n translations for the new drawer description.
This commit is contained in:
+17
-4
@@ -60,6 +60,12 @@ export const LOG_TYPE_ENUM = {
|
||||
REFUND: 6,
|
||||
} as const
|
||||
|
||||
/**
|
||||
* The log list/stat backend uses type=0 as the "all types" sentinel.
|
||||
* Row rendering still displays records with type=0 as "Unknown".
|
||||
*/
|
||||
export const LOG_TYPE_ALL_VALUE = '0' as const
|
||||
|
||||
// ============================================================================
|
||||
// Time Range Presets
|
||||
// ============================================================================
|
||||
@@ -93,11 +99,18 @@ export const LOG_TYPES = [
|
||||
|
||||
/**
|
||||
* Log types for DataTableToolbar filters (single select mode)
|
||||
* Backend treats type=0 as "all logs" in list/stat endpoints, so the filter
|
||||
* must not expose the display-only "Unknown" label for that value.
|
||||
*/
|
||||
export const LOG_TYPE_FILTERS = LOG_TYPES.map((type) => ({
|
||||
label: type.label,
|
||||
value: String(type.value),
|
||||
}))
|
||||
export const LOG_TYPE_FILTERS = [
|
||||
{ label: 'All Types', value: LOG_TYPE_ALL_VALUE },
|
||||
...LOG_TYPES.filter((type) => type.value !== LOG_TYPE_ENUM.UNKNOWN).map(
|
||||
(type) => ({
|
||||
label: type.label,
|
||||
value: String(type.value),
|
||||
})
|
||||
),
|
||||
] as const
|
||||
|
||||
// ============================================================================
|
||||
// Drawing Logs (Midjourney) Constants
|
||||
|
||||
Reference in New Issue
Block a user