1.0.29
This commit is contained in:
44 files changed
+1672
-226
No files matched your search
@@ -405,7 +405,7 @@
|
||||
new RegExp(`(?<!\\$)\\$\\{${marker.name}\\?`),
|
||||
new RegExp(`(?<!\\$)\\$\\{${marker.name}:\\+`),
|
||||
new RegExp(`(?<!\\$)\\$\\{${marker.name}\\+`),
|
||||
new RegExp(`(?<!\\$)\\$${marker.name}(?![a-zA-Z0-9_])`)
|
||||
new RegExp(`(?<![A-Za-z0-9\\$])\\$${marker.name}(?![a-zA-Z0-9_])`)
|
||||
];
|
||||
|
||||
const hasVariable = varPatterns.some(p => p.test(line));
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
imageName: string;
|
||||
envId?: number | null;
|
||||
autoStart?: boolean;
|
||||
activeScanner?: 'grype' | 'trivy';
|
||||
onComplete?: (results: ScanResult[]) => void;
|
||||
onError?: (error: string) => void;
|
||||
onStatusChange?: (status: ScanStatus) => void;
|
||||
@@ -47,6 +48,7 @@
|
||||
imageName,
|
||||
envId = null,
|
||||
autoStart = false,
|
||||
activeScanner = $bindable<'grype' | 'trivy'>('grype'),
|
||||
onComplete,
|
||||
onError,
|
||||
onStatusChange
|
||||
@@ -362,7 +364,7 @@
|
||||
{:else}
|
||||
<!-- Scan Results -->
|
||||
<div class="flex-1 min-h-0 overflow-auto">
|
||||
<ScanResultsView {results} />
|
||||
<ScanResultsView {results} bind:activeScanner />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
import { licenseStore } from '$lib/stores/license';
|
||||
import { authStore, hasAnyAccess } from '$lib/stores/auth';
|
||||
import * as Avatar from '$lib/components/ui/avatar';
|
||||
import * as Tooltip from '$lib/components/ui/tooltip';
|
||||
|
||||
const appVersion = __APP_VERSION__ || 'unknown';
|
||||
const buildCommit = __BUILD_COMMIT__ ?? null;
|
||||
|
||||
import type { Permissions } from '$lib/stores/auth';
|
||||
|
||||
@@ -155,6 +159,25 @@
|
||||
</Sidebar.Group>
|
||||
</Sidebar.Content>
|
||||
|
||||
<!-- Version (expanded sidebar only) -->
|
||||
<div class="group-data-[state=collapsed]:hidden px-3 py-2 mt-auto text-center">
|
||||
<Tooltip.Root>
|
||||
<Tooltip.Trigger>
|
||||
<span class="text-[10px] text-muted-foreground/60 hover:text-muted-foreground transition-colors cursor-default">
|
||||
{appVersion}
|
||||
</span>
|
||||
</Tooltip.Trigger>
|
||||
<Tooltip.Content side="top" align="start" sideOffset={8} class="text-xs">
|
||||
<div class="space-y-0.5">
|
||||
<div class="flex items-center gap-1.5"><svg class="w-4 h-4 shrink-0" viewBox="0 0 24 18" fill="currentColor"><path d="M23.76 8.68c-.26-.18-.86-.58-1.53-.58-.24 0-.48.04-.72.12-.12-.84-.68-1.56-1.34-2.14l-.28-.22-.24.26c-.28.34-.48.72-.56 1.14-.1.42-.06.82.1 1.2-.42.22-.88.36-1.32.42-.24.04-.48.06-.72.06H.78a.77.77 0 0 0-.78.78c-.02 1.46.22 2.9.72 4.24.56 1.44 1.4 2.5 2.5 3.16 1.26.74 3.32 1.16 5.64 1.16.98 0 2-.1 2.98-.3a11.5 11.5 0 0 0 3.3-1.3 9.67 9.67 0 0 0 2.54-2.34c1.16-1.42 1.86-3.02 2.34-4.38h.2c1.22 0 1.98-.48 2.4-.9.28-.26.5-.58.64-.94l.08-.24-.28-.2zM2.74 8.84H4.7c.1 0 .18-.08.18-.18V7.02c0-.1-.08-.18-.18-.18H2.74c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18zm2.72 0h1.96c.1 0 .18-.08.18-.18V7.02c0-.1-.08-.18-.18-.18H5.46c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18zm2.76 0h1.96c.1 0 .18-.08.18-.18V7.02c0-.1-.08-.18-.18-.18H8.22c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18zm2.76 0h1.96c.1 0 .18-.08.18-.18V7.02c0-.1-.08-.18-.18-.18h-1.96c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18zM5.46 6.2h1.96c.1 0 .18-.08.18-.18V4.38c0-.1-.08-.18-.18-.18H5.46c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18zm2.76 0h1.96c.1 0 .18-.08.18-.18V4.38c0-.1-.08-.18-.18-.18H8.22c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18zm2.76 0h1.96c.1 0 .18-.08.18-.18V4.38c0-.1-.08-.18-.18-.18h-1.96c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18zm0-2.64h1.96c.1 0 .18-.08.18-.18V1.74c0-.1-.08-.18-.18-.18h-1.96c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18zm2.76 5.28h1.96c.1 0 .18-.08.18-.18V7.02c0-.1-.08-.18-.18-.18h-1.96c-.1 0-.18.08-.18.18v1.64c0 .1.08.18.18.18z"/></svg><span class="font-mono">fnsys/dockhand:{appVersion}</span></div>
|
||||
{#if buildCommit}
|
||||
<div>Commit: <span class="font-mono">{buildCommit.slice(0, 7)}</span></div>
|
||||
{/if}
|
||||
</div>
|
||||
</Tooltip.Content>
|
||||
</Tooltip.Root>
|
||||
</div>
|
||||
|
||||
<!-- User info footer (only when auth is enabled) -->
|
||||
{#if $authStore.authEnabled && $authStore.authenticated && $authStore.user}
|
||||
<Sidebar.Footer class="border-t">
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
[
|
||||
{
|
||||
"version": "1.0.29",
|
||||
"date": "2026-05-17",
|
||||
"changes": [
|
||||
{ "type": "feature", "text": "optionally display internal (exposed) container ports alongside published ports (#193)" },
|
||||
{ "type": "feature", "text": "show app version in sidebar with build info tooltip (#209)" },
|
||||
{ "type": "feature", "text": "central label management — rename or delete labels across all environments (#661)" },
|
||||
{ "type": "feature", "text": "find next available host port when creating or editing containers (#116)" },
|
||||
{ "type": "feature", "text": "theme-aware scrollbar styling — scrollbars adapt to dark/light mode and color palettes (#462)" },
|
||||
{ "type": "fix", "text": "update buttons (single, selected, and all) now respect the \"confirm dangerous actions\" setting (#638, #751)" },
|
||||
{ "type": "feature", "text": "custom URL labels - dockhand.url or dockhand.port.{port}.url to add links alongside container ports (#266)" },
|
||||
{ "type": "feature", "text": "generate and copy token for Hawser Standard mode with run command hint (#337)" },
|
||||
{ "type": "fix", "text": "environment stack directory not cleaned up when environment is deleted (#1023)" },
|
||||
{ "type": "feature", "text": "toggle to hide timestamps and container name prefix in log viewer (#124)" },
|
||||
{ "type": "fix", "text": "Podman containers health status not showing (#737)" },
|
||||
{ "type": "fix", "text": "containers with exit code 0 (init/migration) no longer cause stack \"partial\" status (#1026)" },
|
||||
{ "type": "fix", "text": "stats stream 400 on reconnect by skipping overlapping fetches (#1044)" },
|
||||
{ "type": "fix", "text": "env var validation false positive for values containing $ followed by text (#1048)" },
|
||||
{ "type": "fix", "text": "git-repos directory not cleaned up when environment is deleted (#1049)" },
|
||||
{ "type": "fix", "text": "webhook secret auto-generated when left empty despite hint saying otherwise (#1050)" },
|
||||
{ "type": "feature", "text": "scan reports — combined or individual Grype/Trivy (#1056)" }
|
||||
],
|
||||
"imageTag": "fnsys/dockhand:v1.0.29"
|
||||
},
|
||||
{
|
||||
"version": "1.0.28",
|
||||
"date": "2026-05-09",
|
||||
|
||||
@@ -5,12 +5,6 @@
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/codemirror/autocomplete"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/commands",
|
||||
"version": "6.10.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/codemirror/commands"
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/commands",
|
||||
"version": "6.10.1",
|
||||
@@ -79,7 +73,7 @@
|
||||
},
|
||||
{
|
||||
"name": "@codemirror/lint",
|
||||
"version": "6.9.2",
|
||||
"version": "6.9.5",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/codemirror/lint"
|
||||
},
|
||||
@@ -145,7 +139,7 @@
|
||||
},
|
||||
{
|
||||
"name": "@lezer/css",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.3",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/lezer-parser/css"
|
||||
},
|
||||
@@ -157,7 +151,7 @@
|
||||
},
|
||||
{
|
||||
"name": "@lezer/html",
|
||||
"version": "1.3.12",
|
||||
"version": "1.3.13",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/lezer-parser/html"
|
||||
},
|
||||
@@ -175,13 +169,13 @@
|
||||
},
|
||||
{
|
||||
"name": "@lezer/lr",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.8",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/lezer-parser/lr"
|
||||
},
|
||||
{
|
||||
"name": "@lezer/markdown",
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.3",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/lezer-parser/markdown"
|
||||
},
|
||||
@@ -199,7 +193,7 @@
|
||||
},
|
||||
{
|
||||
"name": "@lezer/yaml",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/lezer-parser/yaml"
|
||||
},
|
||||
@@ -227,9 +221,15 @@
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/simonepri/phc-format"
|
||||
},
|
||||
{
|
||||
"name": "@rollup/rollup-darwin-arm64",
|
||||
"version": "4.60.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/rollup/rollup"
|
||||
},
|
||||
{
|
||||
"name": "@sveltejs/acorn-typescript",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/sveltejs/acorn-typescript"
|
||||
},
|
||||
@@ -257,9 +257,15 @@
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped"
|
||||
},
|
||||
{
|
||||
"name": "@typescript-eslint/types",
|
||||
"version": "8.58.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/typescript-eslint/typescript-eslint"
|
||||
},
|
||||
{
|
||||
"name": "acorn",
|
||||
"version": "8.15.0",
|
||||
"version": "8.16.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/acornjs/acorn"
|
||||
},
|
||||
@@ -313,7 +319,7 @@
|
||||
},
|
||||
{
|
||||
"name": "better-sqlite3",
|
||||
"version": "11.10.0",
|
||||
"version": "11.7.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/WiseLibs/better-sqlite3"
|
||||
},
|
||||
@@ -365,12 +371,6 @@
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/lukeed/clsx"
|
||||
},
|
||||
{
|
||||
"name": "codemirror",
|
||||
"version": "6.0.2",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/codemirror/basic-setup"
|
||||
},
|
||||
{
|
||||
"name": "color-convert",
|
||||
"version": "2.0.1",
|
||||
@@ -425,12 +425,6 @@
|
||||
"license": "Apache-2.0",
|
||||
"repository": "https://github.com/lovell/detect-libc"
|
||||
},
|
||||
{
|
||||
"name": "devalue",
|
||||
"version": "5.6.3",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/sveltejs/devalue"
|
||||
},
|
||||
{
|
||||
"name": "devalue",
|
||||
"version": "5.6.4",
|
||||
@@ -445,13 +439,13 @@
|
||||
},
|
||||
{
|
||||
"name": "dockhand",
|
||||
"version": "1.0.18",
|
||||
"version": "1.0.27",
|
||||
"license": "UNLICENSED",
|
||||
"repository": null
|
||||
},
|
||||
{
|
||||
"name": "drizzle-orm",
|
||||
"version": "0.45.1",
|
||||
"version": "0.45.2",
|
||||
"license": "Apache-2.0",
|
||||
"repository": "https://github.com/drizzle-team/drizzle-orm"
|
||||
},
|
||||
@@ -475,7 +469,7 @@
|
||||
},
|
||||
{
|
||||
"name": "esrap",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.4",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/sveltejs/esrap"
|
||||
},
|
||||
@@ -485,6 +479,18 @@
|
||||
"license": "(MIT OR WTFPL)",
|
||||
"repository": "https://github.com/ralphtheninja/expand-template"
|
||||
},
|
||||
{
|
||||
"name": "fast-xml-builder",
|
||||
"version": "1.1.4",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/NaturalIntelligence/fast-xml-builder"
|
||||
},
|
||||
{
|
||||
"name": "fast-xml-parser",
|
||||
"version": "5.5.8",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/NaturalIntelligence/fast-xml-parser"
|
||||
},
|
||||
{
|
||||
"name": "file-uri-to-path",
|
||||
"version": "1.0.0",
|
||||
@@ -503,6 +509,12 @@
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/mafintosh/fs-constants"
|
||||
},
|
||||
{
|
||||
"name": "fsevents",
|
||||
"version": "2.3.3",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/fsevents/fsevents"
|
||||
},
|
||||
{
|
||||
"name": "get-caller-file",
|
||||
"version": "2.0.5",
|
||||
@@ -601,13 +613,13 @@
|
||||
},
|
||||
{
|
||||
"name": "node-abi",
|
||||
"version": "3.87.0",
|
||||
"version": "3.89.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/electron/node-abi"
|
||||
},
|
||||
{
|
||||
"name": "node-addon-api",
|
||||
"version": "8.5.0",
|
||||
"version": "8.7.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/nodejs/node-addon-api"
|
||||
},
|
||||
@@ -619,7 +631,7 @@
|
||||
},
|
||||
{
|
||||
"name": "nodemailer",
|
||||
"version": "7.0.12",
|
||||
"version": "8.0.5",
|
||||
"license": "MIT-0",
|
||||
"repository": "https://github.com/nodemailer/nodemailer"
|
||||
},
|
||||
@@ -659,6 +671,12 @@
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/sindresorhus/path-exists"
|
||||
},
|
||||
{
|
||||
"name": "path-expression-matcher",
|
||||
"version": "1.2.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/NaturalIntelligence/path-expression-matcher"
|
||||
},
|
||||
{
|
||||
"name": "pngjs",
|
||||
"version": "5.0.0",
|
||||
@@ -679,7 +697,7 @@
|
||||
},
|
||||
{
|
||||
"name": "pump",
|
||||
"version": "3.0.3",
|
||||
"version": "3.0.4",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/mafintosh/pump"
|
||||
},
|
||||
@@ -719,6 +737,12 @@
|
||||
"license": "ISC",
|
||||
"repository": "https://github.com/yargs/require-main-filename"
|
||||
},
|
||||
{
|
||||
"name": "rollup",
|
||||
"version": "4.60.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/rollup/rollup"
|
||||
},
|
||||
{
|
||||
"name": "runed",
|
||||
"version": "0.28.0",
|
||||
@@ -785,6 +809,12 @@
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/sindresorhus/strip-json-comments"
|
||||
},
|
||||
{
|
||||
"name": "strnum",
|
||||
"version": "2.2.2",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/NaturalIntelligence/strnum"
|
||||
},
|
||||
{
|
||||
"name": "style-mod",
|
||||
"version": "4.1.3",
|
||||
@@ -797,12 +827,6 @@
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/sveltejs/svelte"
|
||||
},
|
||||
{
|
||||
"name": "svelte-dnd-action",
|
||||
"version": "0.9.69",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/isaacHagoel/svelte-dnd-action"
|
||||
},
|
||||
{
|
||||
"name": "svelte-sonner",
|
||||
"version": "1.0.7",
|
||||
@@ -833,6 +857,12 @@
|
||||
"license": "Apache-2.0",
|
||||
"repository": "https://github.com/mikeal/tunnel-agent"
|
||||
},
|
||||
{
|
||||
"name": "undici",
|
||||
"version": "7.24.5",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/nodejs/undici"
|
||||
},
|
||||
{
|
||||
"name": "undici-types",
|
||||
"version": "7.16.0",
|
||||
@@ -853,7 +883,7 @@
|
||||
},
|
||||
{
|
||||
"name": "webidl-conversions",
|
||||
"version": "8.0.0",
|
||||
"version": "8.0.1",
|
||||
"license": "BSD-2-Clause",
|
||||
"repository": "https://github.com/jsdom/webidl-conversions"
|
||||
},
|
||||
@@ -883,7 +913,7 @@
|
||||
},
|
||||
{
|
||||
"name": "ws",
|
||||
"version": "8.19.0",
|
||||
"version": "8.18.0",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/websockets/ws"
|
||||
},
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
* - dockhand.update=false — Skip this container during auto-updates and batch updates
|
||||
* - dockhand.hidden=true — Hide this container from the Dockhand UI
|
||||
* - dockhand.notify=false — Suppress notifications for this container's events
|
||||
* - dockhand.url=<url> — Custom clickable URL displayed alongside container ports
|
||||
* - dockhand.port.<hostPort>.url=<url> — Override the click URL for a specific published port
|
||||
*
|
||||
* All label values are case-insensitive and accept: true/yes/1 and false/no/0.
|
||||
* The opt-out model means labels override DB settings (label wins).
|
||||
@@ -15,6 +17,7 @@ export const DOCKHAND_LABELS = {
|
||||
UPDATE: 'dockhand.update',
|
||||
HIDDEN: 'dockhand.hidden',
|
||||
NOTIFY: 'dockhand.notify',
|
||||
URL: 'dockhand.url',
|
||||
} as const;
|
||||
|
||||
const TRUTHY_VALUES = new Set(['true', 'yes', '1']);
|
||||
@@ -72,6 +75,15 @@ export function isNotifyDisabledByLabel(labels: Record<string, string> | undefin
|
||||
return value === false; // explicitly disabled
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the custom URL from dockhand.url label.
|
||||
* Returns the URL string if set, or undefined.
|
||||
*/
|
||||
export function getCustomUrl(labels: Record<string, string> | undefined | null): string | undefined {
|
||||
const value = getLabel(labels, DOCKHAND_LABELS.URL);
|
||||
return value?.trim() || undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract all Dockhand label states from a container's labels.
|
||||
* Useful for including in API responses so the frontend knows about label overrides.
|
||||
@@ -80,10 +92,12 @@ export function getDockhandLabels(labels: Record<string, string> | undefined | n
|
||||
updateDisabled: boolean;
|
||||
hidden: boolean;
|
||||
notifyDisabled: boolean;
|
||||
customUrl?: string;
|
||||
} {
|
||||
return {
|
||||
updateDisabled: isUpdateDisabledByLabel(labels),
|
||||
hidden: isHiddenByLabel(labels),
|
||||
notifyDisabled: isNotifyDisabledByLabel(labels),
|
||||
customUrl: getCustomUrl(labels),
|
||||
};
|
||||
}
|
||||
@@ -1046,6 +1046,7 @@ export interface ContainerInfo {
|
||||
networks: { [networkName: string]: { ipAddress: string } };
|
||||
health?: string;
|
||||
restartCount: number;
|
||||
exitCode?: number;
|
||||
mounts: Array<{ type: string; source: string; destination: string; mode: string; rw: boolean }>;
|
||||
labels: { [key: string]: string };
|
||||
command: string;
|
||||
@@ -1081,6 +1082,39 @@ export async function listContainers(all = true, envId?: number | null): Promise
|
||||
})
|
||||
);
|
||||
|
||||
// Fetch health status via inspect for containers with healthchecks where Status
|
||||
// string doesn't include health info (Podman compat API omits it from the list endpoint).
|
||||
// Skip entirely if any container already has health in Status (Docker includes it natively).
|
||||
const healthStatuses = new Map<string, string>();
|
||||
const healthRegex = /\((healthy|unhealthy|health:\s*starting)\)/i;
|
||||
const anyHasHealthInStatus = containers.some(c => healthRegex.test(c.Status || ''));
|
||||
if (!anyHasHealthInStatus) {
|
||||
// Single API call to find which containers have healthchecks configured
|
||||
try {
|
||||
const healthFiltered = await dockerJsonRequest<any[]>(
|
||||
'/containers/json?filters=' + encodeURIComponent(JSON.stringify({ health: ['healthy', 'unhealthy', 'starting'] })),
|
||||
{}, envId
|
||||
);
|
||||
const healthIds = new Set((healthFiltered || []).map((c: any) => c.Id));
|
||||
// Only inspect those specific containers (typically very few)
|
||||
if (healthIds.size > 0) {
|
||||
await Promise.all(
|
||||
[...healthIds].map(async (id) => {
|
||||
try {
|
||||
const inspect = await inspectContainer(id, envId);
|
||||
const h = inspect.State?.Health?.Status;
|
||||
if (h) healthStatuses.set(id, h);
|
||||
} catch {
|
||||
// Ignore errors
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
} catch {
|
||||
// Ignore - health filter may not be supported
|
||||
}
|
||||
}
|
||||
|
||||
return containers.map((container) => {
|
||||
// Extract network info with IP addresses
|
||||
const networks: { [networkName: string]: { ipAddress: string } } = {};
|
||||
@@ -1103,14 +1137,25 @@ export async function listContainers(all = true, envId?: number | null): Promise
|
||||
|
||||
// Extract health status from Status string
|
||||
// Docker formats: "(healthy)", "(unhealthy)", "(health: starting)"
|
||||
// Podman compat API omits health from Status string, so fall back to inspect data
|
||||
let health: string | undefined;
|
||||
const healthMatch = container.Status?.match(/\((healthy|unhealthy|health:\s*starting)\)/i);
|
||||
if (healthMatch) {
|
||||
const matched = healthMatch[1].toLowerCase();
|
||||
// Normalize "health: starting" to just "starting"
|
||||
health = matched.includes('starting') ? 'starting' : matched;
|
||||
} else {
|
||||
const inspectHealth = healthStatuses.get(container.Id);
|
||||
if (inspectHealth) {
|
||||
health = inspectHealth === 'health: starting' ? 'starting' : inspectHealth;
|
||||
}
|
||||
}
|
||||
|
||||
// Parse exit code from Status string (e.g., "Exited (0) 5 minutes ago")
|
||||
const exitCode = container.State === 'exited'
|
||||
? parseInt(container.Status?.match(/\((\d+)\)/)?.[1] ?? '-1')
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
id: container.Id,
|
||||
name: container.Names[0]?.replace(/^\//, '') || 'unnamed',
|
||||
@@ -1122,6 +1167,7 @@ export async function listContainers(all = true, envId?: number | null): Promise
|
||||
networks,
|
||||
health,
|
||||
restartCount: restartCounts.get(container.Id) || 0,
|
||||
exitCode,
|
||||
mounts,
|
||||
labels: container.Labels || {},
|
||||
command: container.Command || '',
|
||||
|
||||
@@ -109,6 +109,10 @@ if (!existsSync(GIT_REPOS_DIR)) {
|
||||
mkdirSync(GIT_REPOS_DIR, { recursive: true });
|
||||
}
|
||||
|
||||
export function getGitReposDir(): string {
|
||||
return GIT_REPOS_DIR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redact all env var values for safe logging. Only key names are preserved.
|
||||
*/
|
||||
|
||||
@@ -204,7 +204,7 @@ export async function runEnvUpdateCheckJob(
|
||||
.map(u => {
|
||||
const currentShort = u.currentDigest?.substring(0, 12) || 'unknown';
|
||||
const newShort = u.newDigest?.substring(0, 12) || 'unknown';
|
||||
return `- ${u.containerName} (${u.imageName})\n ${currentShort}... -> ${newShort}...`;
|
||||
return `- ${u.containerName} (${u.imageName}): ${currentShort} → ${newShort}`;
|
||||
})
|
||||
.join('\n');
|
||||
|
||||
|
||||
@@ -77,7 +77,9 @@ export interface ContainerDetail {
|
||||
networks: Array<{ name: string; ipAddress: string }>;
|
||||
volumeCount: number;
|
||||
restartCount: number;
|
||||
exitCode?: number;
|
||||
created: number;
|
||||
labels: Record<string, string>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1545,6 +1547,12 @@ export async function listComposeStacks(envId?: number | null): Promise<ComposeS
|
||||
const result: ComposeStackInfo[] = Array.from(stacks.entries()).map(([name, containerIds]) => {
|
||||
const stackContainers = containers.filter((c) => containerIds.has(c.id));
|
||||
const runningCount = stackContainers.filter((c) => c.state === 'running').length;
|
||||
// Containers that exited with code 0 are "completed" (e.g., init/migration containers)
|
||||
// and should not count against stack health
|
||||
const completedCount = stackContainers.filter((c) =>
|
||||
c.state === 'exited' && c.exitCode === 0
|
||||
).length;
|
||||
const activeTotal = stackContainers.length - completedCount;
|
||||
|
||||
const containerDetails: ContainerDetail[] = stackContainers
|
||||
.map((c) => {
|
||||
@@ -1580,7 +1588,9 @@ export async function listComposeStacks(envId?: number | null): Promise<ComposeS
|
||||
networks,
|
||||
volumeCount,
|
||||
restartCount: c.restartCount || 0,
|
||||
created: c.created
|
||||
exitCode: c.exitCode,
|
||||
created: c.created,
|
||||
labels: c.labels || {}
|
||||
};
|
||||
})
|
||||
.sort((a, b) => a.service.localeCompare(b.service));
|
||||
@@ -1590,11 +1600,13 @@ export async function listComposeStacks(envId?: number | null): Promise<ComposeS
|
||||
containers: Array.from(containerIds),
|
||||
containerDetails,
|
||||
status:
|
||||
runningCount === stackContainers.length
|
||||
? 'running'
|
||||
: runningCount === 0
|
||||
? 'stopped'
|
||||
: 'partial'
|
||||
activeTotal === 0
|
||||
? 'stopped'
|
||||
: runningCount >= activeTotal
|
||||
? 'running'
|
||||
: runningCount === 0
|
||||
? 'stopped'
|
||||
: 'partial'
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { writable, get } from 'svelte/store';
|
||||
import { browser } from '$app/environment';
|
||||
|
||||
const store = writable<Record<string, string>>({});
|
||||
let loaded = false;
|
||||
|
||||
async function load() {
|
||||
if (!browser || loaded) return;
|
||||
loaded = true;
|
||||
try {
|
||||
const res = await fetch('/api/labels');
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
store.set(data.colors || {});
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
export const labelColorOverrides = {
|
||||
subscribe: store.subscribe,
|
||||
load,
|
||||
reload: async () => {
|
||||
loaded = false;
|
||||
await load();
|
||||
}
|
||||
};
|
||||
@@ -30,6 +30,7 @@ export interface AppSettings {
|
||||
eventPollInterval: number;
|
||||
metricsCollectionInterval: number;
|
||||
compactPorts: boolean;
|
||||
showExposedPorts: boolean;
|
||||
formatLogTimestamps: boolean;
|
||||
externalStackPaths: string[];
|
||||
primaryStackLocation: string | null;
|
||||
@@ -62,6 +63,7 @@ const DEFAULT_SETTINGS: AppSettings = {
|
||||
eventPollInterval: 60000,
|
||||
metricsCollectionInterval: 30000,
|
||||
compactPorts: false,
|
||||
showExposedPorts: false,
|
||||
formatLogTimestamps: false,
|
||||
externalStackPaths: [],
|
||||
primaryStackLocation: null,
|
||||
@@ -125,6 +127,7 @@ function createSettingsStore() {
|
||||
eventPollInterval: settings.eventPollInterval ?? DEFAULT_SETTINGS.eventPollInterval,
|
||||
metricsCollectionInterval: settings.metricsCollectionInterval ?? DEFAULT_SETTINGS.metricsCollectionInterval,
|
||||
compactPorts: settings.compactPorts ?? DEFAULT_SETTINGS.compactPorts,
|
||||
showExposedPorts: settings.showExposedPorts ?? DEFAULT_SETTINGS.showExposedPorts,
|
||||
formatLogTimestamps: settings.formatLogTimestamps ?? DEFAULT_SETTINGS.formatLogTimestamps,
|
||||
externalStackPaths: settings.externalStackPaths ?? DEFAULT_SETTINGS.externalStackPaths,
|
||||
primaryStackLocation: settings.primaryStackLocation ?? DEFAULT_SETTINGS.primaryStackLocation,
|
||||
@@ -174,6 +177,7 @@ function createSettingsStore() {
|
||||
eventPollInterval: updatedSettings.eventPollInterval ?? DEFAULT_SETTINGS.eventPollInterval,
|
||||
metricsCollectionInterval: updatedSettings.metricsCollectionInterval ?? DEFAULT_SETTINGS.metricsCollectionInterval,
|
||||
compactPorts: updatedSettings.compactPorts ?? DEFAULT_SETTINGS.compactPorts,
|
||||
showExposedPorts: updatedSettings.showExposedPorts ?? DEFAULT_SETTINGS.showExposedPorts,
|
||||
formatLogTimestamps: updatedSettings.formatLogTimestamps ?? DEFAULT_SETTINGS.formatLogTimestamps,
|
||||
externalStackPaths: updatedSettings.externalStackPaths ?? DEFAULT_SETTINGS.externalStackPaths,
|
||||
primaryStackLocation: updatedSettings.primaryStackLocation ?? DEFAULT_SETTINGS.primaryStackLocation,
|
||||
@@ -361,6 +365,13 @@ function createSettingsStore() {
|
||||
return newSettings;
|
||||
});
|
||||
},
|
||||
setShowExposedPorts: (value: boolean) => {
|
||||
update((current) => {
|
||||
const newSettings = { ...current, showExposedPorts: value };
|
||||
saveSettings({ showExposedPorts: value });
|
||||
return newSettings;
|
||||
});
|
||||
},
|
||||
setFormatLogTimestamps: (value: boolean) => {
|
||||
update((current) => {
|
||||
const newSettings = { ...current, formatLogTimestamps: value };
|
||||
|
||||
@@ -36,6 +36,7 @@ export interface ContainerInfo {
|
||||
* - null/undefined: Regular container
|
||||
*/
|
||||
systemContainer?: SystemContainerType | null;
|
||||
exitCode?: number;
|
||||
}
|
||||
|
||||
export interface ImageInfo {
|
||||
@@ -128,6 +129,7 @@ export interface StackContainer {
|
||||
volumeCount: number;
|
||||
restartCount: number;
|
||||
created: number;
|
||||
labels: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ComposeStackInfo {
|
||||
|
||||
@@ -50,10 +50,21 @@ function hashString(str: string): number {
|
||||
return Math.abs(hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a hex color to rgba with alpha for backgrounds
|
||||
*/
|
||||
export function hexToRgba(hex: string, alpha: number = 0.15): string {
|
||||
const r = parseInt(hex.slice(1, 3), 16);
|
||||
const g = parseInt(hex.slice(3, 5), 16);
|
||||
const b = parseInt(hex.slice(5, 7), 16);
|
||||
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the primary color for a label (for text/borders)
|
||||
*/
|
||||
export function getLabelColor(label: string): string {
|
||||
export function getLabelColor(label: string, customColors?: Record<string, string>): string {
|
||||
if (customColors?.[label]) return customColors[label];
|
||||
const index = hashString(label) % LABEL_COLORS.length;
|
||||
return LABEL_COLORS[index];
|
||||
}
|
||||
@@ -61,7 +72,8 @@ export function getLabelColor(label: string): string {
|
||||
/**
|
||||
* Get the background color for a label (lighter, with transparency)
|
||||
*/
|
||||
export function getLabelBgColor(label: string): string {
|
||||
export function getLabelBgColor(label: string, customColors?: Record<string, string>): string {
|
||||
if (customColors?.[label]) return hexToRgba(customColors[label]);
|
||||
const index = hashString(label) % LABEL_BG_COLORS.length;
|
||||
return LABEL_BG_COLORS[index];
|
||||
}
|
||||
@@ -69,7 +81,10 @@ export function getLabelBgColor(label: string): string {
|
||||
/**
|
||||
* Get both colors for a label as an object
|
||||
*/
|
||||
export function getLabelColors(label: string): { color: string; bgColor: string } {
|
||||
export function getLabelColors(label: string, customColors?: Record<string, string>): { color: string; bgColor: string } {
|
||||
if (customColors?.[label]) {
|
||||
return { color: customColors[label], bgColor: hexToRgba(customColors[label]) };
|
||||
}
|
||||
const index = hashString(label) % LABEL_COLORS.length;
|
||||
return {
|
||||
color: LABEL_COLORS[index],
|
||||
@@ -77,6 +92,24 @@ export function getLabelColors(label: string): { color: string; bgColor: string
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The available color palette for the color picker (6 columns x 6 rows)
|
||||
*/
|
||||
export const COLOR_PALETTE = [
|
||||
// Row 1: 400 (lighter)
|
||||
'#f87171', '#fb923c', '#facc15', '#4ade80', '#2dd4bf', '#60a5fa',
|
||||
// Row 2: 500 (standard)
|
||||
'#ef4444', '#f97316', '#eab308', '#22c55e', '#14b8a6', '#3b82f6',
|
||||
// Row 3: 600 (darker)
|
||||
'#dc2626', '#ea580c', '#ca8a04', '#16a34a', '#0d9488', '#2563eb',
|
||||
// Row 4: violet/pink/cyan/lime/indigo/fuchsia 400
|
||||
'#a78bfa', '#f472b6', '#22d3ee', '#a3e635', '#818cf8', '#e879f9',
|
||||
// Row 5: violet/pink/cyan/lime/indigo/fuchsia 500
|
||||
'#8b5cf6', '#ec4899', '#06b6d4', '#84cc16', '#6366f1', '#d946ef',
|
||||
// Row 6: neutral tones
|
||||
'#78716c', '#a1a1aa', '#94a3b8', '#737373', '#57534e', '#44403c'
|
||||
];
|
||||
|
||||
/**
|
||||
* Maximum number of labels allowed per environment
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ export interface PortMapping {
|
||||
privatePort: number;
|
||||
display: string;
|
||||
isRange?: boolean;
|
||||
exposed?: boolean;
|
||||
}
|
||||
|
||||
interface PortInfo {
|
||||
@@ -62,6 +63,41 @@ export function formatPorts(ports: PortInfo[] | undefined | null): PortMapping[]
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract exposed-only (internal) ports that have no published host mapping.
|
||||
* These are ports with PrivatePort but no PublicPort in Docker's port list.
|
||||
*/
|
||||
export function formatExposedPorts(ports: PortInfo[] | undefined | null): PortMapping[] {
|
||||
if (!ports || ports.length === 0) return [];
|
||||
|
||||
// Collect published private ports to exclude them
|
||||
const publishedPrivate = new Set<number>();
|
||||
for (const p of ports) {
|
||||
if (p.PublicPort || p.publicPort) {
|
||||
publishedPrivate.add(p.PrivatePort || p.privatePort || 0);
|
||||
}
|
||||
}
|
||||
|
||||
const seen = new Set<number>();
|
||||
return ports
|
||||
.filter(p => {
|
||||
const priv = p.PrivatePort || p.privatePort;
|
||||
const pub = p.PublicPort || p.publicPort;
|
||||
// Only exposed (no public mapping) and not already shown as published
|
||||
return priv && !pub && !publishedPrivate.has(priv);
|
||||
})
|
||||
.map(p => {
|
||||
const priv = (p.PrivatePort || p.privatePort)!;
|
||||
return { publicPort: 0, privatePort: priv, display: String(priv), exposed: true };
|
||||
})
|
||||
.filter(p => {
|
||||
if (seen.has(p.privatePort)) return false;
|
||||
seen.add(p.privatePort);
|
||||
return true;
|
||||
})
|
||||
.sort((a, b) => a.privatePort - b.privatePort);
|
||||
}
|
||||
|
||||
function flushRange(items: PortMapping[], start: number, end: number, result: PortMapping[]) {
|
||||
const rangeLen = end - start + 1;
|
||||
if (rangeLen >= 3) {
|
||||
|
||||
Reference in new issue
Block a user