Skip to content

Modern Docker Management, Designed for Everyone

fix: use project/container name in action toast messages

Kyle Mendell3a7ea34e272d
diff --git a/frontend/src/lib/components/action-buttons.svelte b/frontend/src/lib/components/action-buttons.svelte
index 3cbe5396d..f5255c503 100644
--- a/frontend/src/lib/components/action-buttons.svelte
+++ b/frontend/src/lib/components/action-buttons.svelte
@@ -27,6 +27,7 @@
let {
id,
+ name,
type = 'container',
itemState = 'stopped',
loading = $bindable<LoadingStates>({}),
@@ -38,6 +39,7 @@
redeployLoading = $bindable(false)
}: {
id: string;
+ name?: string;
type?: TargetType;
itemState?: string;
loading?: LoadingStates;
@@ -199,7 +201,7 @@
message: m.action_failed_generic({ action: m.action_redeploy(), type }),
setLoadingState: (value) => setLoading('redeploy', value),
onSuccess: async () => {
- toast.success(m.action_redeploy_success({ type }));
+ toast.success(m.action_redeploy_success({ type: name || type }));
onActionComplete('running');
}
});
@@ -217,7 +219,7 @@
setLoadingState: (value) => setLoading('start', value),
onSuccess: async () => {
itemState = 'running';
- toast.success(m.action_started_success({ type }));
+ toast.success(m.action_started_success({ type: name || type }));
onActionComplete('running');
}
});
@@ -294,7 +296,7 @@
// Deploy already completed successfully
itemState = 'running';
- toast.success(m.action_started_success({ type }));
+ toast.success(m.action_started_success({ type: name || type }));
onActionComplete('running');
} catch (e: any) {
const message = e?.message || m.action_failed_generic({ action: m.common_start(), type });
@@ -317,7 +319,7 @@
setLoadingState: (value) => setLoading('stop', value),
onSuccess: async () => {
itemState = 'stopped';
- toast.success(m.action_stopped_success({ type }));
+ toast.success(m.action_stopped_success({ type: name || type }));
onActionComplete('stopped');
}
});
@@ -331,7 +333,7 @@
setLoadingState: (value) => setLoading('restart', value),
onSuccess: async () => {
itemState = 'running';
- toast.success(m.action_restarted_success({ type }));
+ toast.success(m.action_restarted_success({ type: name || type }));
onActionComplete('running');
}
});
diff --git a/frontend/src/routes/containers/[containerId]/+page.svelte b/frontend/src/routes/containers/[containerId]/+page.svelte
index ec2df9867..8f0b17d67 100644
--- a/frontend/src/routes/containers/[containerId]/+page.svelte
+++ b/frontend/src/routes/containers/[containerId]/+page.svelte
@@ -292,6 +292,7 @@
{#snippet headerActions()}
<ActionButtons
id={container.id}
+ name={containerDisplayName}
type="container"
itemState={container.state?.running ? 'running' : 'stopped'}
loading={{ start: starting, stop: stopping, restart: restarting, remove: removing }}
diff --git a/frontend/src/routes/projects/[projectId]/+page.svelte b/frontend/src/routes/projects/[projectId]/+page.svelte
index 30cc231fe..c46eec6fb 100644
--- a/frontend/src/routes/projects/[projectId]/+page.svelte
+++ b/frontend/src/routes/projects/[projectId]/+page.svelte
@@ -230,6 +230,7 @@
{/if}
<ActionButtons
id={project.id}
+ name={project.name}
type="project"
itemState={project.status}
bind:startLoading={isLoading.deploying}