This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
import SectionHeader from '$ui/components/primitives/SectionHeader.svelte';
|
import SectionHeader from '$ui/components/primitives/SectionHeader.svelte';
|
||||||
import Badge from '$ui/components/primitives/Badge.svelte';
|
import Badge from '$ui/components/primitives/Badge.svelte';
|
||||||
import Button from '$ui/components/primitives/Button.svelte';
|
import Button from '$ui/components/primitives/Button.svelte';
|
||||||
|
import Dialog from '$ui/components/primitives/Dialog.svelte';
|
||||||
import EmptyState from '$ui/components/primitives/EmptyState.svelte';
|
import EmptyState from '$ui/components/primitives/EmptyState.svelte';
|
||||||
import FleetActionsDialog from '$ui/components/FleetActionsDialog.svelte';
|
import FleetActionsDialog from '$ui/components/FleetActionsDialog.svelte';
|
||||||
import Freshness from '$ui/components/Freshness.svelte';
|
import Freshness from '$ui/components/Freshness.svelte';
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
import { provisioningQueueStatus, provisioningWarnings } from '$ui/provisioning-queue.js';
|
import { provisioningQueueStatus, provisioningWarnings } from '$ui/provisioning-queue.js';
|
||||||
|
|
||||||
let lifecycleOpen = $state(false);
|
let lifecycleOpen = $state(false);
|
||||||
|
let filtersOpen = $state(false);
|
||||||
let active = $state<Deployment[]>([]);
|
let active = $state<Deployment[]>([]);
|
||||||
let history = $state<Deployment[]>([]);
|
let history = $state<Deployment[]>([]);
|
||||||
let needsReview = $state(0);
|
let needsReview = $state(0);
|
||||||
@@ -222,9 +224,12 @@
|
|||||||
function fmt(value: string) {
|
function fmt(value: string) {
|
||||||
return $timeFormat.dateTime(value);
|
return $timeFormat.dateTime(value);
|
||||||
}
|
}
|
||||||
const filtered = $derived(
|
const filterCount = $derived(
|
||||||
action !== 'all' || source !== 'all' || historyState !== 'all' || Boolean(search)
|
[action !== 'all', source !== 'all', historyState !== 'all', Boolean(search)].filter(
|
||||||
|
Boolean
|
||||||
|
).length
|
||||||
);
|
);
|
||||||
|
const filtered = $derived(filterCount > 0);
|
||||||
const visibleActive = $derived(
|
const visibleActive = $derived(
|
||||||
active.filter((row) => {
|
active.filter((row) => {
|
||||||
if (action !== 'all' && row.action !== action) return false;
|
if (action !== 'all' && row.action !== action) return false;
|
||||||
@@ -306,6 +311,17 @@
|
|||||||
maxlength="100"
|
maxlength="100"
|
||||||
/></label
|
/></label
|
||||||
>
|
>
|
||||||
|
<div class="desktop-filters">
|
||||||
|
{@render filterFields()}
|
||||||
|
{#if filtered}<Button variant="ghost" onclick={clearFilters}>Clear filters</Button>{/if}
|
||||||
|
</div>
|
||||||
|
<div class="mobile-filter-trigger">
|
||||||
|
<Button onclick={() => (filtersOpen = true)}
|
||||||
|
>Filters{filterCount ? ` · ${filterCount}` : ''}</Button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{#snippet filterFields()}
|
||||||
<label
|
<label
|
||||||
>Operation<select bind:value={action} onchange={() => saveContext(true)}
|
>Operation<select bind:value={action} onchange={() => saveContext(true)}
|
||||||
><option value="all">All operations</option
|
><option value="all">All operations</option
|
||||||
@@ -336,8 +352,19 @@
|
|||||||
>{/each}</select
|
>{/each}</select
|
||||||
></label
|
></label
|
||||||
>
|
>
|
||||||
{#if filtered}<Button variant="ghost" onclick={clearFilters}>Clear filters</Button>{/if}
|
{/snippet}
|
||||||
</div>
|
<Dialog
|
||||||
|
bind:open={filtersOpen}
|
||||||
|
title="Provisioning filters"
|
||||||
|
description="Choose an operation, status, and source."
|
||||||
|
drawer
|
||||||
|
>
|
||||||
|
<div class="mobile-filters">{@render filterFields()}</div>
|
||||||
|
{#snippet actions()}
|
||||||
|
<Button variant="ghost" onclick={clearFilters}>Clear filters</Button>
|
||||||
|
<Button variant="primary" onclick={() => (filtersOpen = false)}>Show results</Button>
|
||||||
|
{/snippet}
|
||||||
|
</Dialog>
|
||||||
<LifecycleDialog bind:open={lifecycleOpen} />
|
<LifecycleDialog bind:open={lifecycleOpen} />
|
||||||
<FleetActionsDialog
|
<FleetActionsDialog
|
||||||
bind:open={fleetActionsOpen}
|
bind:open={fleetActionsOpen}
|
||||||
@@ -599,6 +626,16 @@
|
|||||||
.view-tabs {
|
.view-tabs {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
.desktop-filters {
|
||||||
|
display: contents;
|
||||||
|
}
|
||||||
|
.mobile-filter-trigger {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mobile-filters {
|
||||||
|
display: grid;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
label {
|
label {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
@@ -760,4 +797,12 @@
|
|||||||
padding: 12px 8px;
|
padding: 12px 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.desktop-filters {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mobile-filter-trigger {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user