Skip to content

Modern Docker Management, Designed for Everyone

feat: bulk actions for containers and projects (#1466)

Kyle Mendell31b89675cd80
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index bd9f67b6b..afe23bfc4 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -367,6 +367,26 @@
"containers_remove_failed": "Failed to remove container",
"containers_remove_success": "Container removed successfully",
"containers_action_error": "An error occurred while performing the action",
+ "containers_bulk_start": "Start ({count})",
+ "containers_bulk_stop": "Stop ({count})",
+ "containers_bulk_restart": "Restart ({count})",
+ "containers_bulk_remove": "Remove ({count})",
+ "containers_bulk_start_confirm_title": "Start {count} Container(s)",
+ "containers_bulk_start_confirm_message": "Are you sure you want to start {count} container(s)?",
+ "containers_bulk_stop_confirm_title": "Stop {count} Container(s)",
+ "containers_bulk_stop_confirm_message": "Are you sure you want to stop {count} container(s)?",
+ "containers_bulk_restart_confirm_title": "Restart {count} Container(s)",
+ "containers_bulk_restart_confirm_message": "Are you sure you want to restart {count} container(s)?",
+ "containers_bulk_remove_confirm_title": "Remove {count} Container(s)",
+ "containers_bulk_remove_confirm_message": "Are you sure you want to remove {count} container(s)? This action cannot be undone.",
+ "containers_bulk_start_success": "Successfully started {count} container(s)",
+ "containers_bulk_start_partial": "Started {success} of {total} container(s). {failed} failed.",
+ "containers_bulk_stop_success": "Successfully stopped {count} container(s)",
+ "containers_bulk_stop_partial": "Stopped {success} of {total} container(s). {failed} failed.",
+ "containers_bulk_restart_success": "Successfully restarted {count} container(s)",
+ "containers_bulk_restart_partial": "Restarted {success} of {total} container(s). {failed} failed.",
+ "containers_bulk_remove_success": "Successfully removed {count} container(s)",
+ "containers_bulk_remove_partial": "Removed {success} of {total} container(s). {failed} failed.",
"containers_group_by_project": "Group by Project",
"containers_nav_metrics": "Metrics",
"containers_nav_logs": "Logs",
@@ -649,6 +669,21 @@
"compose_destroy_failed": "Failed to remove project",
"compose_destroy_success": "Project removed successfully.",
"compose_destroy": "Destroy",
+ "projects_bulk_up": "Up ({count})",
+ "projects_bulk_down": "Down ({count})",
+ "projects_bulk_redeploy": "Redeploy ({count})",
+ "projects_bulk_up_confirm_title": "Start {count} Project(s)",
+ "projects_bulk_up_confirm_message": "Are you sure you want to start {count} project(s)?",
+ "projects_bulk_down_confirm_title": "Stop {count} Project(s)",
+ "projects_bulk_down_confirm_message": "Are you sure you want to stop {count} project(s)?",
+ "projects_bulk_redeploy_confirm_title": "Redeploy {count} Project(s)",
+ "projects_bulk_redeploy_confirm_message": "Are you sure you want to redeploy {count} project(s)? This will pull the latest images and recreate containers.",
+ "projects_bulk_up_success": "Successfully started {count} project(s)",
+ "projects_bulk_up_partial": "Started {success} of {total} project(s). {failed} failed.",
+ "projects_bulk_down_success": "Successfully stopped {count} project(s)",
+ "projects_bulk_down_partial": "Stopped {success} of {total} project(s). {failed} failed.",
+ "projects_bulk_redeploy_success": "Successfully redeployed {count} project(s)",
+ "projects_bulk_redeploy_partial": "Redeployed {success} of {total} project(s). {failed} failed.",
"compose_converter_title": "Docker Run to Compose Converter",
"compose_converter_description": "Convert existing docker run commands to Docker Compose format",
"compose_docker_run_command_label": "Docker Run Command",
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte b/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
index d3ace33be..49b0a046b 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
@@ -9,12 +9,13 @@
import type { Snippet } from 'svelte';
import { cn } from '$lib/utils';
import { ResetIcon } from '$lib/icons';
+ import type { BulkAction } from './arcane-table.types.svelte';
let {
table,
selectedIds = [],
selectionDisabled = false,
- onRemoveSelected,
+ bulkActions = [],
mobileFields = [],
onToggleMobileField,
customViewOptions,
@@ -23,7 +24,7 @@
table: Table<TData>;
selectedIds?: string[];
selectionDisabled?: boolean;
- onRemoveSelected?: (ids: string[]) => void;
+ bulkActions?: BulkAction[];
mobileFields?: { id: string; label: string; visible: boolean }[];
onToggleMobileField?: (fieldId: string) => void;
customViewOptions?: Snippet;
@@ -42,6 +43,7 @@
const debouncedSetGlobal = debounced((v: string) => table.setGlobalFilter(v), 300);
const hasSelection = $derived(!selectionDisabled && (selectedIds?.length ?? 0) > 0);
+ const hasBulkActions = $derived(bulkActions && bulkActions.length > 0);
</script>
<div class={cn('flex flex-col gap-2 px-2 py-2 sm:flex-row sm:items-center sm:justify-between', className)}>
@@ -98,21 +100,31 @@
{/if}
</div>
</div>
+ </div>
+
+ <!-- Bulk actions and View options -->
+ <div class="flex items-center gap-2">
+ {#if hasSelection}
+ {#if hasBulkActions}
+ <div class="flex flex-wrap items-center gap-2">
+ {#each bulkActions as bulkAction}
+ {@const actionType = bulkAction.action === 'up' ? 'start' : bulkAction.action === 'down' ? 'stop' : bulkAction.action}
+ <ArcaneButton
+ action={actionType}
+ icon={bulkAction.icon}
+ customLabel={bulkAction.label}
+ onclick={() => bulkAction.onClick(selectedIds!)}
+ disabled={bulkAction.disabled || bulkAction.loading}
+ loading={bulkAction.loading}
+ />
+ {/each}
+ </div>
+ {/if}
+ {/if}
- <!-- View options - desktop only, end aligned -->
+ <!-- View options - desktop only, always on the right -->
<div class="hidden md:block">
<DataTableViewOptions {table} {customViewOptions} />
</div>
</div>
-
- <!-- Actions on the right (wraps on mobile) -->
- {#if hasSelection && onRemoveSelected}
- <ArcaneButton
- action="remove"
- size="sm"
- hoverEffect="none"
- customLabel={m.common_remove_selected_count({ count: selectedIds?.length ?? 0 })}
- onclick={() => onRemoveSelected?.(selectedIds!)}
- />
- {/if}
</div>
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte b/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte
index 702222ed8..b48c5ecf0 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte
@@ -26,10 +26,9 @@
{...props}
action="base"
tone="ghost"
- size="sm"
icon={ViewOptionsIcon}
customLabel={m.common_view()}
- class="border-input hover:bg-card/60 h-8 border hover:text-inherit"
+ class="border-input hover:bg-card/60 border hover:text-inherit"
/>
{/snippet}
</DropdownMenu.Trigger>
diff --git a/frontend/src/lib/components/arcane-table/arcane-table.svelte b/frontend/src/lib/components/arcane-table/arcane-table.svelte
index fdacd5f07..4044d4d0e 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table.svelte
@@ -29,7 +29,8 @@
applyHiddenPatch,
encodeFilters,
encodeMobileVisibility,
- buildMobileVisibility
+ buildMobileVisibility,
+ type BulkAction
} from './arcane-table.types.svelte';
import { extractPersistedPreferences, filterMapsEqual, toFilterMap } from './arcane-table.utils';
import ArcaneTablePagination from './arcane-table-pagination.svelte';
@@ -52,7 +53,7 @@
mobileFields = [],
mobileFieldVisibility = $bindable<Record<string, boolean>>({}),
selectedIds = $bindable<string[]>([]),
- onRemoveSelected,
+ bulkActions = [],
persistKey,
customViewOptions,
customTableView,
@@ -72,7 +73,7 @@
mobileFields?: FieldSpec[];
mobileFieldVisibility?: Record<string, boolean>;
selectedIds?: string[];
- onRemoveSelected?: (ids: string[]) => void;
+ bulkActions?: BulkAction[];
persistKey?: string;
customViewOptions?: Snippet;
customTableView?: Snippet<
@@ -522,7 +523,7 @@
{table}
{selectedIds}
{selectionDisabled}
- {onRemoveSelected}
+ {bulkActions}
mobileFields={mobileFieldsForOptions}
{onToggleMobileField}
{customViewOptions}
@@ -556,7 +557,7 @@
{table}
{selectedIds}
{selectionDisabled}
- {onRemoveSelected}
+ {bulkActions}
mobileFields={mobileFieldsForOptions}
{onToggleMobileField}
{customViewOptions}
diff --git a/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts b/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts
index e8c60300f..fb0e00d2c 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts
+++ b/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts
@@ -93,3 +93,13 @@ export function buildMobileVisibility(fields: FieldSpec[], persisted?: string[])
}
return visibility;
}
+
+export type BulkAction = {
+ id: string;
+ label: string;
+ action: 'start' | 'stop' | 'restart' | 'remove' | 'deploy' | 'redeploy' | 'up' | 'down';
+ onClick: (ids: string[]) => void;
+ disabled?: boolean;
+ loading?: boolean;
+ icon?: any;
+};
diff --git a/frontend/src/lib/components/arcane-table/index.ts b/frontend/src/lib/components/arcane-table/index.ts
index 56c9f1a3b..2cd391a1d 100644
--- a/frontend/src/lib/components/arcane-table/index.ts
+++ b/frontend/src/lib/components/arcane-table/index.ts
@@ -1,6 +1,6 @@
export { default as DataTableToolbar } from './arcane-table-toolbar.svelte';
export { default as DataTableViewOptions } from './arcane-table-view-options.svelte';
export { default as DataTableFacetedFilter } from './arcane-table-filter.svelte';
-export type { ColumnSpec, FieldSpec, MobileFieldVisibility } from './arcane-table.types.svelte';
+export type { ColumnSpec, FieldSpec, MobileFieldVisibility, BulkAction } from './arcane-table.types.svelte';
export { default as UniversalMobileCard } from './cards/universal-mobile-card.svelte';
export { usageFilters, imageUpdateFilters, severityFilters } from './data.js';
diff --git a/frontend/src/lib/components/logs/log-viewer.svelte b/frontend/src/lib/components/logs/log-viewer.svelte
index a74bd6721..acacbd986 100644
--- a/frontend/src/lib/components/logs/log-viewer.svelte
+++ b/frontend/src/lib/components/logs/log-viewer.svelte
@@ -344,7 +344,7 @@
return colors[Math.abs(hash) % colors.length];
}
- function tryParseJson(message: string) : {isJson: boolean; parsed?: any } {
+ function tryParseJson(message: string): { isJson: boolean; parsed?: any } {
const trimmed = message.trim();
if (!trimmed.startsWith('{') && !trimmed.startsWith('[')) {
return { isJson: false };
@@ -353,7 +353,7 @@
const parsed = JSON.parse(trimmed);
return { isJson: true, parsed };
} catch {
- return {isJson: false};
+ return { isJson: false };
}
}
diff --git a/frontend/src/lib/components/logs/structured-log-entry.svelte b/frontend/src/lib/components/logs/structured-log-entry.svelte
index beedb3d2e..f61899bd9 100644
--- a/frontend/src/lib/components/logs/structured-log-entry.svelte
+++ b/frontend/src/lib/components/logs/structured-log-entry.svelte
@@ -21,7 +21,7 @@
const TARGET_KEYS = ['target', 'logger', 'name', 'source', 'component', 'module', 'log.logger', 'logger_name', 'category'];
const ERROR_KEYS = ['error', 'err', 'exception', 'stack', 'stacktrace', 'error.message'];
const TRACE_KEYS = ['trace_id', 'traceId', 'correlation_id', 'correlationId', 'request_id', 'requestId', 'spanId', 'span_id'];
-
+
// Nested message location (e.g., tracing-subscriber in Rust uses fields.message)
const NESTED_MESSAGE_PATHS = [
['fields', 'message'],
@@ -128,7 +128,8 @@
function getLevelColor(level: string | undefined): string {
if (!level) return 'text-gray-400';
const l = level.toLowerCase();
- if (l === 'error' || l === 'err' || l === 'fatal' || l === 'critical' || l === 'panic' || l === 'emergency') return 'text-red-400';
+ if (l === 'error' || l === 'err' || l === 'fatal' || l === 'critical' || l === 'panic' || l === 'emergency')
+ return 'text-red-400';
if (l === 'warn' || l === 'warning' || l === 'alert') return 'text-yellow-400';
if (l === 'info' || l === 'information' || l === 'notice') return 'text-green-400';
if (l === 'debug' || l === 'dbg') return 'text-blue-400';
@@ -139,7 +140,8 @@
function getLevelBgColor(level: string | undefined): string {
if (!level) return 'bg-gray-800';
const l = level.toLowerCase();
- if (l === 'error' || l === 'err' || l === 'fatal' || l === 'critical' || l === 'panic' || l === 'emergency') return 'bg-red-900/30';
+ if (l === 'error' || l === 'err' || l === 'fatal' || l === 'critical' || l === 'panic' || l === 'emergency')
+ return 'bg-red-900/30';
if (l === 'warn' || l === 'warning' || l === 'alert') return 'bg-yellow-900/30';
if (l === 'info' || l === 'information' || l === 'notice') return 'bg-green-900/30';
if (l === 'debug' || l === 'dbg') return 'bg-blue-900/30';
@@ -168,7 +170,7 @@
const formattedTime = $derived(formatTimestamp(extracted.timestamp));
const levelDisplay = $derived(extracted.level?.toUpperCase() ?? 'LOG');
const jsonString = $derived(rawJson ?? JSON.stringify(data, null, 2));
-
+
// For unstructured JSON, create a compact string representation
const compactJson = $derived(JSON.stringify(data));
@@ -190,7 +192,9 @@
<div class="flex items-start gap-2">
<!-- Level badge -->
<span
- class="shrink-0 rounded px-1.5 py-0.5 text-xs font-semibold {getLevelColor(extracted.level)} {getLevelBgColor(extracted.level)}"
+ class="shrink-0 rounded px-1.5 py-0.5 text-xs font-semibold {getLevelColor(extracted.level)} {getLevelBgColor(
+ extracted.level
+ )}"
>
{levelDisplay}
</span>
@@ -204,7 +208,7 @@
<!-- Target/Logger name -->
{#if extracted.target}
- <span class="shrink-0 text-xs text-cyan-400 font-medium" title={extracted.target}>
+ <span class="shrink-0 text-xs font-medium text-cyan-400" title={extracted.target}>
[{extracted.target}]
</span>
{/if}
@@ -225,7 +229,7 @@
<button
type="button"
onclick={copyToClipboard}
- class="shrink-0 rounded p-1 text-gray-500 hover:text-gray-200 hover:bg-gray-700 transition-colors"
+ class="shrink-0 rounded p-1 text-gray-500 transition-colors hover:bg-gray-700 hover:text-gray-200"
title={copied ? 'Copied!' : 'Copy JSON'}
>
{#if copied}
@@ -239,7 +243,7 @@
<button
type="button"
onclick={() => (showDetails = !showDetails)}
- class="shrink-0 rounded px-1.5 py-0.5 text-xs text-gray-400 hover:text-gray-200 hover:bg-gray-700 transition-colors"
+ class="shrink-0 rounded px-1.5 py-0.5 text-xs text-gray-400 transition-colors hover:bg-gray-700 hover:text-gray-200"
title={showDetails ? 'Hide JSON' : 'Show full JSON'}
>
{showDetails ? '▼' : '▶'}
@@ -248,8 +252,8 @@
<!-- Collapsible full JSON section -->
{#if showDetails}
- <div class="mt-1 ml-4 pl-2 border-l border-gray-700">
- <pre class="text-xs text-gray-300 whitespace-pre-wrap break-all">{JSON.stringify(data, null, 2)}</pre>
+ <div class="mt-1 ml-4 border-l border-gray-700 pl-2">
+ <pre class="text-xs break-all whitespace-pre-wrap text-gray-300">{JSON.stringify(data, null, 2)}</pre>
</div>
{/if}
</div>
diff --git a/frontend/src/routes/(app)/containers/container-table.svelte b/frontend/src/routes/(app)/containers/container-table.svelte
index ae390506f..16f4f6624 100644
--- a/frontend/src/routes/(app)/containers/container-table.svelte
+++ b/frontend/src/routes/(app)/containers/container-table.svelte
@@ -13,7 +13,7 @@
import { format } from 'date-fns';
import { capitalizeFirstLetter } from '$lib/utils/string.utils';
import type { ContainerSummaryDto } from '$lib/types/container.type';
- import type { ColumnSpec } from '$lib/components/arcane-table';
+ import type { ColumnSpec, BulkAction } from '$lib/components/arcane-table';
import { m } from '$lib/paraglide/messages';
import { PortBadge } from '$lib/components/badges/index.js';
import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';
@@ -63,6 +63,13 @@
type ActionStatus = 'starting' | 'stopping' | 'restarting' | 'updating' | 'removing' | '';
let actionStatus = $state<Record<string, ActionStatus>>({});
+ let isBulkLoading = $state({
+ start: false,
+ stop: false,
+ restart: false,
+ remove: false
+ });
+
let statsManager = $state<ContainerStatsManager | null>(null);
// Parse image reference into repo and tag
@@ -241,7 +248,159 @@
});
}
- const isAnyLoading = $derived(Object.values(actionStatus).some((status) => status !== ''));
+ async function handleBulkStart(ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: m.containers_bulk_start_confirm_title({ count: ids.length }),
+ message: m.containers_bulk_start_confirm_message({ count: ids.length }),
+ confirm: {
+ label: m.common_start(),
+ destructive: false,
+ action: async () => {
+ isBulkLoading.start = true;
+
+ const results = await Promise.allSettled(ids.map((id) => containerService.startContainer(id)));
+
+ const successCount = results.filter((r) => r.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading.start = false;
+
+ if (successCount === ids.length) {
+ toast.success(m.containers_bulk_start_success({ count: successCount }));
+ } else if (successCount > 0) {
+ toast.warning(m.containers_bulk_start_partial({ success: successCount, total: ids.length, failed: failureCount }));
+ } else {
+ toast.error(m.containers_start_failed());
+ }
+
+ containers = await containerService.getContainers(requestOptions);
+ selectedIds = [];
+ }
+ }
+ });
+ }
+
+ async function handleBulkStop(ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: m.containers_bulk_stop_confirm_title({ count: ids.length }),
+ message: m.containers_bulk_stop_confirm_message({ count: ids.length }),
+ confirm: {
+ label: m.common_stop(),
+ destructive: false,
+ action: async () => {
+ isBulkLoading.stop = true;
+
+ const results = await Promise.allSettled(ids.map((id) => containerService.stopContainer(id)));
+
+ const successCount = results.filter((r) => r.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading.stop = false;
+
+ if (successCount === ids.length) {
+ toast.success(m.containers_bulk_stop_success({ count: successCount }));
+ } else if (successCount > 0) {
+ toast.warning(m.containers_bulk_stop_partial({ success: successCount, total: ids.length, failed: failureCount }));
+ } else {
+ toast.error(m.containers_stop_failed());
+ }
+
+ containers = await containerService.getContainers(requestOptions);
+ selectedIds = [];
+ }
+ }
+ });
+ }
+
+ async function handleBulkRestart(ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: m.containers_bulk_restart_confirm_title({ count: ids.length }),
+ message: m.containers_bulk_restart_confirm_message({ count: ids.length }),
+ confirm: {
+ label: m.common_restart(),
+ destructive: false,
+ action: async () => {
+ isBulkLoading.restart = true;
+
+ const results = await Promise.allSettled(ids.map((id) => containerService.restartContainer(id)));
+
+ const successCount = results.filter((r) => r.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading.restart = false;
+
+ if (successCount === ids.length) {
+ toast.success(m.containers_bulk_restart_success({ count: successCount }));
+ } else if (successCount > 0) {
+ toast.warning(m.containers_bulk_restart_partial({ success: successCount, total: ids.length, failed: failureCount }));
+ } else {
+ toast.error(m.containers_restart_failed());
+ }
+
+ containers = await containerService.getContainers(requestOptions);
+ selectedIds = [];
+ }
+ }
+ });
+ }
+
+ async function handleBulkRemove(ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: m.containers_bulk_remove_confirm_title({ count: ids.length }),
+ message: m.containers_bulk_remove_confirm_message({ count: ids.length }),
+ checkboxes: [
+ {
+ id: 'force',
+ label: m.containers_remove_force_label(),
+ initialState: false
+ },
+ {
+ id: 'volumes',
+ label: m.containers_remove_volumes_label(),
+ initialState: false
+ }
+ ],
+ confirm: {
+ label: m.common_remove(),
+ destructive: true,
+ action: async (checkboxStates) => {
+ const force = !!checkboxStates.force;
+ const volumes = !!checkboxStates.volumes;
+ isBulkLoading.remove = true;
+
+ const results = await Promise.allSettled(ids.map((id) => containerService.deleteContainer(id, { force, volumes })));
+
+ const successCount = results.filter((r) => r.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading.remove = false;
+
+ if (successCount === ids.length) {
+ toast.success(m.containers_bulk_remove_success({ count: successCount }));
+ } else if (successCount > 0) {
+ toast.warning(m.containers_bulk_remove_partial({ success: successCount, total: ids.length, failed: failureCount }));
+ } else {
+ toast.error(m.containers_remove_failed());
+ }
+
+ containers = await containerService.getContainers(requestOptions);
+ selectedIds = [];
+ }
+ }
+ });
+ }
+
+ const isAnyLoading = $derived(
+ Object.values(actionStatus).some((status) => status !== '') || Object.values(isBulkLoading).some((loading) => loading)
+ );
let mobileFieldVisibility = $state<Record<string, boolean>>({});
let customSettings = $state<Record<string, unknown>>({});
@@ -254,59 +413,43 @@
statsManager = new ContainerStatsManager();
- // Check if stats columns are visible
- const areStatsColumnsVisible = () => {
+ // Derive which containers should be connected based on current state
+ const shouldConnect = $derived.by(() => {
const cpuVisible = columnVisibility.cpuUsage !== false;
const memoryVisible = columnVisibility.memoryUsage !== false;
- return cpuVisible || memoryVisible;
- };
-
- // Function to sync connections with running containers
- const syncConnections = () => {
- if (!statsManager) return;
+ const statsVisible = cpuVisible || memoryVisible;
- // Only connect if stats columns are visible
- if (!areStatsColumnsVisible()) {
- // Disconnect all if columns are hidden
- const connectedIds = statsManager.getConnectedIds();
- for (const id of connectedIds) {
- statsManager.disconnect(id);
- }
- return;
+ if (!statsVisible) {
+ return new Set<string>();
}
const runningContainers = containers.data?.filter((c) => c.state === 'running') ?? [];
- const runningIds = new Set(runningContainers.map((c) => c.id));
+ return new Set(runningContainers.map((c) => c.id));
+ });
- const envId = environmentStore.selected?.id || '0';
+ const currentEnvId = $derived(environmentStore.selected?.id || '0');
- // Connect new running containers
- for (const container of runningContainers) {
- if (!statsManager.hasConnection(container.id)) {
- statsManager.connect(container.id, envId);
- }
- }
+ // Effect ONLY for side effects - connecting/disconnecting websockets
+ const unsubscribe = $effect.root(() => {
+ $effect(() => {
+ if (!statsManager) return;
- // Disconnect stopped containers
- const connectedIds = statsManager.getConnectedIds();
- for (const id of connectedIds) {
- if (!runningIds.has(id)) {
- statsManager.disconnect(id);
+ const targetIds = shouldConnect;
+ const connectedIds = new Set(statsManager.getConnectedIds());
+
+ // Connect new containers
+ for (const id of targetIds) {
+ if (!connectedIds.has(id)) {
+ statsManager.connect(id, currentEnvId);
+ }
}
- }
- };
- // Sync connections when containers or column visibility changes
- const unsubscribe = $effect.root(() => {
- $effect(() => {
- // Track containers.data changes
- containers.data;
- // Track environment changes
- environmentStore.selected?.id;
- // Track column visibility changes
- columnVisibility;
-
- syncConnections();
+ // Disconnect removed containers
+ for (const id of connectedIds) {
+ if (!targetIds.has(id)) {
+ statsManager.disconnect(id);
+ }
+ }
});
return () => {};
@@ -382,6 +525,45 @@
{ id: 'created', label: m.common_created(), defaultVisible: true }
];
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'start',
+ label: m.containers_bulk_start({ count: selectedIds?.length ?? 0 }),
+ action: 'start',
+ onClick: handleBulkStart,
+ loading: isBulkLoading.start,
+ disabled: isAnyLoading,
+ icon: StartIcon
+ },
+ {
+ id: 'stop',
+ label: m.containers_bulk_stop({ count: selectedIds?.length ?? 0 }),
+ action: 'stop',
+ onClick: handleBulkStop,
+ loading: isBulkLoading.stop,
+ disabled: isAnyLoading,
+ icon: StopIcon
+ },
+ {
+ id: 'restart',
+ label: m.containers_bulk_restart({ count: selectedIds?.length ?? 0 }),
+ action: 'restart',
+ onClick: handleBulkRestart,
+ loading: isBulkLoading.restart,
+ disabled: isAnyLoading,
+ icon: RefreshIcon
+ },
+ {
+ id: 'remove',
+ label: m.containers_bulk_remove({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleBulkRemove,
+ loading: isBulkLoading.remove,
+ disabled: isAnyLoading,
+ icon: TrashIcon
+ }
+ ]);
+
function getProjectName(container: ContainerSummaryDto): string {
const projectLabel = container.labels?.['com.docker.compose.project'];
return projectLabel || 'No Project';
@@ -714,9 +896,9 @@
onRefresh={async (options) => (containers = await containerService.getContainers(options))}
{columns}
{mobileFields}
+ {bulkActions}
rowActions={RowActions}
mobileCard={ContainerMobileCardSnippet}
- selectionDisabled
customViewOptions={CustomViewOptions}
customTableView={groupByProject && groupedContainers() ? GroupedTableView : undefined}
/>
@@ -743,7 +925,7 @@
<DataTableToolbar
{table}
{selectedIds}
- selectionDisabled={true}
+ {bulkActions}
mobileFields={mobileFieldsForOptions}
{onToggleMobileField}
customViewOptions={CustomViewOptions}
diff --git a/frontend/src/routes/(app)/customize/git-repositories/repository-table.svelte b/frontend/src/routes/(app)/customize/git-repositories/repository-table.svelte
index 11ba3060a..6d043eaf6 100644
--- a/frontend/src/routes/(app)/customize/git-repositories/repository-table.svelte
+++ b/frontend/src/routes/(app)/customize/git-repositories/repository-table.svelte
@@ -9,7 +9,7 @@
import { tryCatch } from '$lib/utils/try-catch';
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { GitRepository } from '$lib/types/gitops.type';
- import type { ColumnSpec } from '$lib/components/arcane-table';
+ import type { ColumnSpec, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';
import { format } from 'date-fns';
import { m } from '$lib/paraglide/messages';
@@ -42,6 +42,19 @@
removing: false,
testing: false
});
+
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelected,
+ loading: isLoading.removing,
+ disabled: isLoading.removing,
+ icon: Trash2Icon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
async function handleDeleteSelected(ids: string[]) {
@@ -273,7 +286,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelected(ids)}
+ {bulkActions}
onRefresh={async (options) => (repositories = await gitRepositoryService.getRepositories(options))}
{columns}
{mobileFields}
diff --git a/frontend/src/routes/(app)/customize/registries/registry-table.svelte b/frontend/src/routes/(app)/customize/registries/registry-table.svelte
index 95e4469af..fa87026ef 100644
--- a/frontend/src/routes/(app)/customize/registries/registry-table.svelte
+++ b/frontend/src/routes/(app)/customize/registries/registry-table.svelte
@@ -10,7 +10,7 @@
import { tryCatch } from '$lib/utils/try-catch';
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { ContainerRegistry } from '$lib/types/container-registry.type';
- import type { ColumnSpec, MobileFieldVisibility } from '$lib/components/arcane-table';
+ import type { ColumnSpec, MobileFieldVisibility, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';
import { format } from 'date-fns';
import { m } from '$lib/paraglide/messages';
@@ -162,6 +162,22 @@
{ id: 'createdAt', label: m.common_created(), defaultVisible: true }
];
+ let isLoading = $state({
+ removing: false
+ });
+
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelected,
+ loading: isLoading.removing,
+ disabled: isLoading.removing,
+ icon: TrashIcon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
</script>
@@ -271,7 +287,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelected(ids)}
+ {bulkActions}
onRefresh={async (options) => (registries = await containerRegistryService.getRegistries(options))}
{columns}
{mobileFields}
diff --git a/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte b/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte
index ae8ccb0ea..e23104a9a 100644
--- a/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte
@@ -10,7 +10,7 @@
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { GitOpsSync } from '$lib/types/gitops.type';
import type { Row } from '@tanstack/table-core';
- import type { ColumnSpec } from '$lib/components/arcane-table';
+ import type { ColumnSpec, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';
import { format } from 'date-fns';
import { m } from '$lib/paraglide/messages';
@@ -189,6 +189,18 @@
{ id: 'lastSyncCommit', label: 'Commit', defaultVisible: false },
{ id: 'lastSyncAt', label: m.git_sync_last_sync(), defaultVisible: true }
];
+
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelected,
+ loading: isLoading.removing,
+ disabled: isLoading.removing,
+ icon: Trash2Icon
+ }
+ ]);
</script>
{#snippet NameCell({ item, value }: { item: GitOpsSync; value: any; row: Row<GitOpsSync> })}
@@ -328,7 +340,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelected(ids)}
+ {bulkActions}
onRefresh={async (options) => (syncs = await gitOpsSyncService.getSyncs(environmentId, options))}
{columns}
{mobileFields}
diff --git a/frontend/src/routes/(app)/environments/environment-table.svelte b/frontend/src/routes/(app)/environments/environment-table.svelte
index 5d95e7709..91bf2c1fe 100644
--- a/frontend/src/routes/(app)/environments/environment-table.svelte
+++ b/frontend/src/routes/(app)/environments/environment-table.svelte
@@ -11,7 +11,7 @@
import { toast } from 'svelte-sonner';
import { extractApiErrorMessage } from '$lib/utils/api.util';
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
- import type { ColumnSpec, MobileFieldVisibility } from '$lib/components/arcane-table';
+ import type { ColumnSpec, MobileFieldVisibility, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table';
import type { Environment } from '$lib/types/environment.type';
import { m } from '$lib/paraglide/messages';
@@ -231,6 +231,18 @@
{ id: 'apiUrl', label: m.environments_api_url(), defaultVisible: true }
];
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelected,
+ loading: isLoading.removing,
+ disabled: isLoading.removing,
+ icon: TrashIcon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
</script>
@@ -393,7 +405,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelected(ids)}
+ {bulkActions}
onRefresh={async (options) => (environments = await environmentManagementService.getEnvironments(options))}
{columns}
{mobileFields}
diff --git a/frontend/src/routes/(app)/images/image-table.svelte b/frontend/src/routes/(app)/images/image-table.svelte
index 02d93d209..657e3ff23 100644
--- a/frontend/src/routes/(app)/images/image-table.svelte
+++ b/frontend/src/routes/(app)/images/image-table.svelte
@@ -16,7 +16,7 @@
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { ImageSummaryDto, ImageUpdateInfoDto } from '$lib/types/image.type';
import { format } from 'date-fns';
- import type { ColumnSpec, MobileFieldVisibility } from '$lib/components/arcane-table';
+ import type { ColumnSpec, MobileFieldVisibility, BulkAction } from '$lib/components/arcane-table';
import { m } from '$lib/paraglide/messages';
import { imageService } from '$lib/services/image-service';
import { DownloadIcon, TrashIcon, EllipsisIcon, InspectIcon, ImagesIcon, VolumesIcon, ClockIcon } from '$lib/icons';
@@ -172,6 +172,18 @@
{ id: 'created', label: m.common_created(), defaultVisible: true }
];
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelected,
+ loading: isLoading.removing,
+ disabled: isLoading.removing,
+ icon: TrashIcon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
</script>
@@ -361,7 +373,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelected(ids)}
+ {bulkActions}
onRefresh={async (options) => (images = await imageService.getImages(options))}
{columns}
{mobileFields}
diff --git a/frontend/src/routes/(app)/networks/network-table.svelte b/frontend/src/routes/(app)/networks/network-table.svelte
index 13d3f274c..f1f17daa2 100644
--- a/frontend/src/routes/(app)/networks/network-table.svelte
+++ b/frontend/src/routes/(app)/networks/network-table.svelte
@@ -12,7 +12,7 @@
import { DEFAULT_NETWORK_NAMES } from '$lib/constants';
import type { SearchPaginationSortRequest, Paginated } from '$lib/types/pagination.type';
import { capitalizeFirstLetter } from '$lib/utils/string.utils';
- import type { ColumnSpec } from '$lib/components/arcane-table';
+ import type { ColumnSpec, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table';
import { m } from '$lib/paraglide/messages';
import { networkService } from '$lib/services/network-service';
@@ -145,6 +145,18 @@
{ id: 'scope', label: m.common_scope(), defaultVisible: true }
];
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelectedNetworks,
+ loading: isLoading.remove,
+ disabled: isLoading.remove,
+ icon: TrashIcon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
</script>
@@ -273,7 +285,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelectedNetworks(ids)}
+ {bulkActions}
onRefresh={async (options) => (networks = await networkService.getNetworks(options))}
{columns}
{mobileFields}
diff --git a/frontend/src/routes/(app)/projects/projects-table.svelte b/frontend/src/routes/(app)/projects/projects-table.svelte
index 289684d65..ead20074e 100644
--- a/frontend/src/routes/(app)/projects/projects-table.svelte
+++ b/frontend/src/routes/(app)/projects/projects-table.svelte
@@ -15,7 +15,7 @@
import { getStatusVariant } from '$lib/utils/status.utils';
import { capitalizeFirstLetter } from '$lib/utils/string.utils';
import { format } from 'date-fns';
- import type { ColumnSpec, MobileFieldVisibility } from '$lib/components/arcane-table';
+ import type { ColumnSpec, MobileFieldVisibility, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table';
import { m } from '$lib/paraglide/messages';
import { projectService } from '$lib/services/project-service';
@@ -44,6 +44,12 @@
syncing: false
});
+ let isBulkLoading = $state({
+ up: false,
+ down: false,
+ redeploy: false
+ });
+
function getStatusTooltip(project: Project): string | undefined {
return project.status.toLowerCase() === 'unknown' && project.statusReason ? project.statusReason : undefined;
}
@@ -148,7 +154,111 @@
});
}
- const isAnyLoading = $derived(Object.values(isLoading).some((loading) => loading));
+ async function handleBulkUp(ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: m.projects_bulk_up_confirm_title({ count: ids.length }),
+ message: m.projects_bulk_up_confirm_message({ count: ids.length }),
+ confirm: {
+ label: m.common_up(),
+ destructive: false,
+ action: async () => {
+ isBulkLoading.up = true;
+
+ const results = await Promise.allSettled(ids.map((id) => projectService.deployProject(id)));
+
+ const successCount = results.filter((r) => r.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading.up = false;
+
+ if (successCount === ids.length) {
+ toast.success(m.projects_bulk_up_success({ count: successCount }));
+ } else if (successCount > 0) {
+ toast.warning(m.projects_bulk_up_partial({ success: successCount, total: ids.length, failed: failureCount }));
+ } else {
+ toast.error(m.compose_start_failed());
+ }
+
+ projects = await projectService.getProjects(requestOptions);
+ selectedIds = [];
+ }
+ }
+ });
+ }
+
+ async function handleBulkDown(ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: m.projects_bulk_down_confirm_title({ count: ids.length }),
+ message: m.projects_bulk_down_confirm_message({ count: ids.length }),
+ confirm: {
+ label: m.common_down(),
+ destructive: false,
+ action: async () => {
+ isBulkLoading.down = true;
+
+ const results = await Promise.allSettled(ids.map((id) => projectService.downProject(id)));
+
+ const successCount = results.filter((r) => r.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading.down = false;
+
+ if (successCount === ids.length) {
+ toast.success(m.projects_bulk_down_success({ count: successCount }));
+ } else if (successCount > 0) {
+ toast.warning(m.projects_bulk_down_partial({ success: successCount, total: ids.length, failed: failureCount }));
+ } else {
+ toast.error(m.compose_stop_failed());
+ }
+
+ projects = await projectService.getProjects(requestOptions);
+ selectedIds = [];
+ }
+ }
+ });
+ }
+
+ async function handleBulkRedeploy(ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: m.projects_bulk_redeploy_confirm_title({ count: ids.length }),
+ message: m.projects_bulk_redeploy_confirm_message({ count: ids.length }),
+ confirm: {
+ label: m.compose_pull_redeploy(),
+ destructive: false,
+ action: async () => {
+ isBulkLoading.redeploy = true;
+
+ const results = await Promise.allSettled(ids.map((id) => projectService.redeployProject(id)));
+
+ const successCount = results.filter((r) => r.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading.redeploy = false;
+
+ if (successCount === ids.length) {
+ toast.success(m.projects_bulk_redeploy_success({ count: successCount }));
+ } else if (successCount > 0) {
+ toast.warning(m.projects_bulk_redeploy_partial({ success: successCount, total: ids.length, failed: failureCount }));
+ } else {
+ toast.error(m.compose_pull_failed());
+ }
+
+ projects = await projectService.getProjects(requestOptions);
+ selectedIds = [];
+ }
+ }
+ });
+ }
+
+ const isAnyLoading = $derived(
+ Object.values(isLoading).some((loading) => loading) || Object.values(isBulkLoading).some((loading) => loading)
+ );
const columns = [
{ accessorKey: 'id', title: m.common_id(), hidden: true },
@@ -167,6 +277,36 @@
{ id: 'createdAt', label: m.common_created(), defaultVisible: true }
];
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'up',
+ label: m.projects_bulk_up({ count: selectedIds?.length ?? 0 }),
+ action: 'up',
+ onClick: handleBulkUp,
+ loading: isBulkLoading.up,
+ disabled: isAnyLoading,
+ icon: StartIcon
+ },
+ {
+ id: 'down',
+ label: m.projects_bulk_down({ count: selectedIds?.length ?? 0 }),
+ action: 'down',
+ onClick: handleBulkDown,
+ loading: isBulkLoading.down,
+ disabled: isAnyLoading,
+ icon: StopIcon
+ },
+ {
+ id: 'redeploy',
+ label: m.projects_bulk_redeploy({ count: selectedIds?.length ?? 0 }),
+ action: 'redeploy',
+ onClick: handleBulkRedeploy,
+ loading: isBulkLoading.redeploy,
+ disabled: isAnyLoading,
+ icon: RedeployIcon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
const envId = $derived(environmentStore.selected?.id);
</script>
@@ -380,6 +520,7 @@
onRefresh={async (options) => (projects = await projectService.getProjects(options))}
{columns}
{mobileFields}
+ {bulkActions}
rowActions={RowActions}
mobileCard={ProjectMobileCardSnippet}
/>
diff --git a/frontend/src/routes/(app)/settings/api-keys/api-key-table.svelte b/frontend/src/routes/(app)/settings/api-keys/api-key-table.svelte
index 86fe9898c..83f22114a 100644
--- a/frontend/src/routes/(app)/settings/api-keys/api-key-table.svelte
+++ b/frontend/src/routes/(app)/settings/api-keys/api-key-table.svelte
@@ -10,7 +10,7 @@
import { tryCatch } from '$lib/utils/try-catch';
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { ApiKey } from '$lib/types/api-key.type';
- import type { ColumnSpec, MobileFieldVisibility } from '$lib/components/arcane-table';
+ import type { ColumnSpec, MobileFieldVisibility, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table';
import { apiKeyService } from '$lib/services/api-key-service';
import * as m from '$lib/paraglide/messages.js';
@@ -140,6 +140,18 @@
{ id: 'lastUsedAt', label: m.api_key_last_used(), defaultVisible: true }
];
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelected,
+ loading: isLoading.removing,
+ disabled: isLoading.removing,
+ icon: TrashIcon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
</script>
@@ -255,7 +267,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelected()}
+ {bulkActions}
onRefresh={async (options) => {
requestOptions = options;
await onApiKeysChanged();
diff --git a/frontend/src/routes/(app)/settings/notifications/providers/EventSubscriptions.svelte b/frontend/src/routes/(app)/settings/notifications/providers/EventSubscriptions.svelte
index 6cf7c2b14..2185696e1 100644
--- a/frontend/src/routes/(app)/settings/notifications/providers/EventSubscriptions.svelte
+++ b/frontend/src/routes/(app)/settings/notifications/providers/EventSubscriptions.svelte
@@ -10,12 +10,7 @@
disabled?: boolean;
}
- let {
- providerId,
- eventImageUpdate = $bindable(),
- eventContainerUpdate = $bindable(),
- disabled = false
- }: Props = $props();
+ let { providerId, eventImageUpdate = $bindable(), eventContainerUpdate = $bindable(), disabled = false }: Props = $props();
</script>
<div class="space-y-3 pt-2">
diff --git a/frontend/src/routes/(app)/settings/notifications/providers/SignalProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/SignalProviderForm.svelte
index 7a8d2476c..6996ca631 100644
--- a/frontend/src/routes/(app)/settings/notifications/providers/SignalProviderForm.svelte
+++ b/frontend/src/routes/(app)/settings/notifications/providers/SignalProviderForm.svelte
@@ -160,7 +160,7 @@
<div class="relative">
<div class="absolute inset-0 flex items-center">
- <span class="w-full border-t" />
+ <span class="w-full border-t"></span>
</div>
<div class="relative flex justify-center text-xs uppercase">
<span class="bg-background text-muted-foreground px-2">{m.notifications_signal_auth_or()}</span>
diff --git a/frontend/src/routes/(app)/settings/users/user-table.svelte b/frontend/src/routes/(app)/settings/users/user-table.svelte
index 70719a4d8..e9d42eb38 100644
--- a/frontend/src/routes/(app)/settings/users/user-table.svelte
+++ b/frontend/src/routes/(app)/settings/users/user-table.svelte
@@ -9,7 +9,7 @@
import { tryCatch } from '$lib/utils/try-catch';
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { User } from '$lib/types/user.type';
- import type { ColumnSpec, MobileFieldVisibility } from '$lib/components/arcane-table';
+ import type { ColumnSpec, MobileFieldVisibility, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table';
import { m } from '$lib/paraglide/messages';
import { userService } from '$lib/services/user-service';
@@ -129,6 +129,18 @@
{ id: 'roles', label: m.common_role(), defaultVisible: true }
];
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelected,
+ loading: isLoading.removing,
+ disabled: isLoading.removing,
+ icon: TrashIcon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
</script>
@@ -215,7 +227,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelected()}
+ {bulkActions}
onRefresh={async (options) => {
requestOptions = options;
await onUsersChanged();
diff --git a/frontend/src/routes/(app)/volumes/volume-table.svelte b/frontend/src/routes/(app)/volumes/volume-table.svelte
index 1856506b3..2b82cc242 100644
--- a/frontend/src/routes/(app)/volumes/volume-table.svelte
+++ b/frontend/src/routes/(app)/volumes/volume-table.svelte
@@ -12,7 +12,7 @@
import { truncateString } from '$lib/utils/string.utils';
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { VolumeSummaryDto, VolumeSizeInfo } from '$lib/types/volume.type';
- import type { ColumnSpec, MobileFieldVisibility } from '$lib/components/arcane-table';
+ import type { ColumnSpec, MobileFieldVisibility, BulkAction } from '$lib/components/arcane-table';
import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';
import { m } from '$lib/paraglide/messages';
import { volumeService } from '$lib/services/volume-service';
@@ -136,6 +136,18 @@
{ id: 'driver', label: m.common_driver(), defaultVisible: true }
];
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'remove',
+ label: m.common_remove_selected_count({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: handleDeleteSelected,
+ loading: isLoading.removing,
+ disabled: isLoading.removing,
+ icon: TrashIcon
+ }
+ ]);
+
let mobileFieldVisibility = $state<Record<string, boolean>>({});
</script>
@@ -271,7 +283,7 @@
bind:requestOptions
bind:selectedIds
bind:mobileFieldVisibility
- onRemoveSelected={(ids) => handleDeleteSelected(ids)}
+ {bulkActions}
onRefresh={async (options) => (volumes = await volumeService.getVolumes(options))}
{columns}
{mobileFields}
diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte
index 2d6c1b740..996e1e519 100644
--- a/frontend/src/routes/+layout.svelte
+++ b/frontend/src/routes/+layout.svelte
@@ -78,9 +78,7 @@
}
const pageTitle = $derived(
- environmentStore.selected
- ? `${m.layout_title()} | ${environmentStore.selected.name}`
- : m.layout_title()
+ environmentStore.selected ? `${m.layout_title()} | ${environmentStore.selected.name}` : m.layout_title()
);
</script>