dsh-plugin-container 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -45
- package/README.zh-CN.md +108 -0
- package/lib/client.js +481 -310
- package/package.json +13 -5
- package/src/client/build-image.jsx +119 -0
- package/src/client/i18n.js +22 -0
- package/src/client/icons.jsx +14 -0
- package/src/client/styles.js +1 -0
- package/src/client/tabs/images.jsx +23 -2
- package/src/host/apple.js +14 -0
- package/src/host/service.js +21 -1
package/lib/client.js
CHANGED
|
@@ -223,6 +223,14 @@ var IconExec = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Svg, { ..
|
|
|
223
223
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m7.2 9.2 3 2.8-3 2.8M12.5 15h4" }),
|
|
224
224
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M17 9.2h.01" })
|
|
225
225
|
] });
|
|
226
|
+
var IconUpload = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Svg, { ...props, children: [
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 16V4M7.5 8.5 12 4l4.5 4.5" }),
|
|
228
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5 15v3.5A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5V15" })
|
|
229
|
+
] });
|
|
230
|
+
var IconBuild = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Svg, { ...props, children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M14.5 5.5 18.5 9.5M4 20l4.2-1 10.9-10.9a2.1 2.1 0 0 0-3-3L5.2 16 4 20Z" }),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m13.2 6.8 4 4" })
|
|
233
|
+
] });
|
|
226
234
|
var IconAttach = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Svg, { ...props, children: [
|
|
227
235
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9.5 14.5 14.5 9.5" }),
|
|
228
236
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M11 7.5 12.6 5.9a3.2 3.2 0 0 1 4.5 4.5L15.4 12" }),
|
|
@@ -342,6 +350,17 @@ var zh = {
|
|
|
342
350
|
removeNetwork: "\u5220\u9664\u7F51\u7EDC",
|
|
343
351
|
pull: "\u62C9\u53D6",
|
|
344
352
|
pullPlaceholder: "nginx:latest",
|
|
353
|
+
pushImage: "\u63A8\u9001\u955C\u50CF",
|
|
354
|
+
buildImage: "\u6784\u5EFA\u955C\u50CF",
|
|
355
|
+
buildImageTitle: "\u6784\u5EFA\u955C\u50CF",
|
|
356
|
+
buildTag: "\u955C\u50CF\u6807\u7B7E",
|
|
357
|
+
buildContext: "\u6784\u5EFA\u4E0A\u4E0B\u6587\uFF08\u7EDD\u5BF9\u8DEF\u5F84\uFF09",
|
|
358
|
+
buildContextHint: "\u4F8B\u5982 /Users/me/project\uFF0C\u5FC5\u987B\u5305\u542B Dockerfile\u3002",
|
|
359
|
+
buildDockerfile: "Dockerfile",
|
|
360
|
+
buildNoCache: "\u4E0D\u4F7F\u7528\u6784\u5EFA\u7F13\u5B58",
|
|
361
|
+
buildStart: "\u5F00\u59CB\u6784\u5EFA",
|
|
362
|
+
buildInvalidTag: "\u8BF7\u8F93\u5165\u5408\u6CD5\u7684\u955C\u50CF\u6807\u7B7E\uFF0C\u4F8B\u5982 my-app:latest",
|
|
363
|
+
buildInvalidContext: "\u6784\u5EFA\u4E0A\u4E0B\u6587\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84",
|
|
345
364
|
pullAction: "\u62C9\u53D6\u955C\u50CF",
|
|
346
365
|
emptyContainers: "\u6CA1\u6709\u5BB9\u5668",
|
|
347
366
|
emptyImages: "\u6CA1\u6709\u955C\u50CF",
|
|
@@ -587,6 +606,17 @@ var en = {
|
|
|
587
606
|
removeNetwork: "Remove network",
|
|
588
607
|
pull: "Pull",
|
|
589
608
|
pullPlaceholder: "nginx:latest",
|
|
609
|
+
pushImage: "Push image",
|
|
610
|
+
buildImage: "Build image",
|
|
611
|
+
buildImageTitle: "Build image",
|
|
612
|
+
buildTag: "Image tag",
|
|
613
|
+
buildContext: "Build context (absolute path)",
|
|
614
|
+
buildContextHint: "For example /Users/me/project; it must contain the Dockerfile.",
|
|
615
|
+
buildDockerfile: "Dockerfile",
|
|
616
|
+
buildNoCache: "Disable build cache",
|
|
617
|
+
buildStart: "Build",
|
|
618
|
+
buildInvalidTag: "Enter a valid image tag, for example my-app:latest",
|
|
619
|
+
buildInvalidContext: "Build context must be an absolute path",
|
|
590
620
|
pullAction: "Pull image",
|
|
591
621
|
emptyContainers: "No containers",
|
|
592
622
|
emptyImages: "No images",
|
|
@@ -726,7 +756,7 @@ var en = {
|
|
|
726
756
|
};
|
|
727
757
|
|
|
728
758
|
// src/client/page.jsx
|
|
729
|
-
var
|
|
759
|
+
var import_react14 = require("react");
|
|
730
760
|
|
|
731
761
|
// src/client/attach.jsx
|
|
732
762
|
var import_react3 = require("react");
|
|
@@ -1861,17 +1891,138 @@ function ContainersTab({ t, api, provider, context, status, refreshToken, featur
|
|
|
1861
1891
|
}
|
|
1862
1892
|
|
|
1863
1893
|
// src/client/tabs/images.jsx
|
|
1894
|
+
var import_react10 = require("react");
|
|
1895
|
+
|
|
1896
|
+
// src/client/build-image.jsx
|
|
1864
1897
|
var import_react9 = require("react");
|
|
1865
1898
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1866
1899
|
var IMAGE_REF = /^[A-Za-z0-9][A-Za-z0-9_.:/@-]*$/u;
|
|
1867
|
-
function
|
|
1900
|
+
function BuildImageDialog({ open, t, provider, cwd, onClose, onSubmit }) {
|
|
1901
|
+
const [tag, setTag] = (0, import_react9.useState)("");
|
|
1902
|
+
const [contextPath, setContextPath] = (0, import_react9.useState)("");
|
|
1903
|
+
const [dockerfile, setDockerfile] = (0, import_react9.useState)("Dockerfile");
|
|
1904
|
+
const [noCache, setNoCache] = (0, import_react9.useState)(false);
|
|
1905
|
+
const [error, setError] = (0, import_react9.useState)(null);
|
|
1906
|
+
const [busy, setBusy] = (0, import_react9.useState)(false);
|
|
1907
|
+
(0, import_react9.useEffect)(() => {
|
|
1908
|
+
if (!open) return;
|
|
1909
|
+
setTag("");
|
|
1910
|
+
setContextPath(cwd || "");
|
|
1911
|
+
setDockerfile("Dockerfile");
|
|
1912
|
+
setNoCache(false);
|
|
1913
|
+
setError(null);
|
|
1914
|
+
setBusy(false);
|
|
1915
|
+
}, [open, cwd]);
|
|
1916
|
+
const close = () => {
|
|
1917
|
+
if (busy) return;
|
|
1918
|
+
onClose();
|
|
1919
|
+
};
|
|
1920
|
+
const submit = async (event) => {
|
|
1921
|
+
event?.preventDefault();
|
|
1922
|
+
const imageTag = tag.trim();
|
|
1923
|
+
const context = contextPath.trim();
|
|
1924
|
+
if (!IMAGE_REF.test(imageTag)) {
|
|
1925
|
+
setError(t("buildInvalidTag"));
|
|
1926
|
+
return;
|
|
1927
|
+
}
|
|
1928
|
+
if (!context.startsWith("/")) {
|
|
1929
|
+
setError(t("buildInvalidContext"));
|
|
1930
|
+
return;
|
|
1931
|
+
}
|
|
1932
|
+
setBusy(true);
|
|
1933
|
+
setError(null);
|
|
1934
|
+
try {
|
|
1935
|
+
await onSubmit({
|
|
1936
|
+
kind: "image",
|
|
1937
|
+
action: "build",
|
|
1938
|
+
tag: imageTag,
|
|
1939
|
+
contextPath: context,
|
|
1940
|
+
dockerfile: dockerfile.trim() === "" ? void 0 : dockerfile.trim(),
|
|
1941
|
+
noCache
|
|
1942
|
+
});
|
|
1943
|
+
setBusy(false);
|
|
1944
|
+
onClose();
|
|
1945
|
+
} catch (submitError) {
|
|
1946
|
+
setError(submitError instanceof Error ? submitError.message : String(submitError));
|
|
1947
|
+
setBusy(false);
|
|
1948
|
+
}
|
|
1949
|
+
};
|
|
1950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1951
|
+
Modal,
|
|
1952
|
+
{
|
|
1953
|
+
open,
|
|
1954
|
+
title: t("buildImageTitle"),
|
|
1955
|
+
subtitle: provider === "apple-container" ? t("providerApple") : t("providerDocker"),
|
|
1956
|
+
onClose: close,
|
|
1957
|
+
closeLabel: t("close"),
|
|
1958
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1959
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { size: "sm", variant: "ghost", onClick: close, disabled: busy, children: t("modalCancel") }),
|
|
1960
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { size: "sm", variant: "primary", onClick: submit, disabled: busy, children: busy ? t("starting") : t("buildStart") })
|
|
1961
|
+
] }),
|
|
1962
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("form", { className: "dsh-docker-run-form", onSubmit: submit, children: [
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "dsh-docker-field", children: [
|
|
1964
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t("buildTag") }),
|
|
1965
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1966
|
+
"input",
|
|
1967
|
+
{
|
|
1968
|
+
className: "dsh-docker-input",
|
|
1969
|
+
value: tag,
|
|
1970
|
+
onChange: (event) => setTag(event.target.value),
|
|
1971
|
+
placeholder: "my-app:latest",
|
|
1972
|
+
spellCheck: "false",
|
|
1973
|
+
autoFocus: true
|
|
1974
|
+
}
|
|
1975
|
+
)
|
|
1976
|
+
] }),
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "dsh-docker-field", children: [
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t("buildContext") }),
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1980
|
+
"input",
|
|
1981
|
+
{
|
|
1982
|
+
className: "dsh-docker-input",
|
|
1983
|
+
value: contextPath,
|
|
1984
|
+
onChange: (event) => setContextPath(event.target.value),
|
|
1985
|
+
placeholder: "/Users/me/project",
|
|
1986
|
+
spellCheck: "false"
|
|
1987
|
+
}
|
|
1988
|
+
),
|
|
1989
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { className: "dsh-docker-muted", children: t("buildContextHint") })
|
|
1990
|
+
] }),
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "dsh-docker-field", children: [
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t("buildDockerfile") }),
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1994
|
+
"input",
|
|
1995
|
+
{
|
|
1996
|
+
className: "dsh-docker-input",
|
|
1997
|
+
value: dockerfile,
|
|
1998
|
+
onChange: (event) => setDockerfile(event.target.value),
|
|
1999
|
+
placeholder: "Dockerfile",
|
|
2000
|
+
spellCheck: "false"
|
|
2001
|
+
}
|
|
2002
|
+
)
|
|
2003
|
+
] }),
|
|
2004
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "dsh-docker-check", children: [
|
|
2005
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "checkbox", checked: noCache, onChange: (event) => setNoCache(event.target.checked) }),
|
|
2006
|
+
t("buildNoCache")
|
|
2007
|
+
] }),
|
|
2008
|
+
error !== null && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "dsh-docker-form-error", children: error })
|
|
2009
|
+
] })
|
|
2010
|
+
}
|
|
2011
|
+
);
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
// src/client/tabs/images.jsx
|
|
2015
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2016
|
+
var IMAGE_REF2 = /^[A-Za-z0-9][A-Za-z0-9_.:/@-]*$/u;
|
|
2017
|
+
function ImagesTab({ t, api, provider, context, status, refreshToken, features = [], cwd, onAction, onRunContainer, onInspect, onNotify }) {
|
|
1868
2018
|
const showArchitecture = features.includes("image-architecture");
|
|
1869
|
-
const [search, setSearch] = (0,
|
|
1870
|
-
const [pull, setPull] = (0,
|
|
2019
|
+
const [search, setSearch] = (0, import_react10.useState)("");
|
|
2020
|
+
const [pull, setPull] = (0, import_react10.useState)("");
|
|
2021
|
+
const [buildOpen, setBuildOpen] = (0, import_react10.useState)(false);
|
|
1871
2022
|
const enabled = status?.daemon?.state === "running";
|
|
1872
2023
|
const list = useDockerList(api, provider, "images", context, { refreshToken, enabled });
|
|
1873
2024
|
const items = list.data?.items ?? [];
|
|
1874
|
-
const filtered = (0,
|
|
2025
|
+
const filtered = (0, import_react10.useMemo)(() => {
|
|
1875
2026
|
const needle = search.trim().toLowerCase();
|
|
1876
2027
|
if (needle === "") return items;
|
|
1877
2028
|
return items.filter((item) => `${item.name} ${item.id} ${item.repository} ${item.tag}`.toLowerCase().includes(needle));
|
|
@@ -1879,19 +2030,19 @@ function ImagesTab({ t, api, provider, context, status, refreshToken, features =
|
|
|
1879
2030
|
const submitPull = (event) => {
|
|
1880
2031
|
event.preventDefault();
|
|
1881
2032
|
const reference = pull.trim();
|
|
1882
|
-
if (!
|
|
2033
|
+
if (!IMAGE_REF2.test(reference)) {
|
|
1883
2034
|
onNotify("error", t("pullInvalid"));
|
|
1884
2035
|
return;
|
|
1885
2036
|
}
|
|
1886
2037
|
setPull("");
|
|
1887
2038
|
onAction({ kind: "image", action: "pull", id: reference }, { focusConsole: true });
|
|
1888
2039
|
};
|
|
1889
|
-
return /* @__PURE__ */ (0,
|
|
1890
|
-
/* @__PURE__ */ (0,
|
|
1891
|
-
/* @__PURE__ */ (0,
|
|
1892
|
-
/* @__PURE__ */ (0,
|
|
1893
|
-
/* @__PURE__ */ (0,
|
|
1894
|
-
/* @__PURE__ */ (0,
|
|
2040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsh-docker-stack", children: [
|
|
2041
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsh-docker-toolbar", children: [
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsh-docker-toolbar-left", children: [
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: t("search"), label: t("search") }),
|
|
2044
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("form", { onSubmit: submitPull, className: "dsh-docker-toolbar-left", style: { gap: 6 }, children: [
|
|
2045
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1895
2046
|
"input",
|
|
1896
2047
|
{
|
|
1897
2048
|
className: "dsh-docker-input",
|
|
@@ -1903,109 +2054,128 @@ function ImagesTab({ t, api, provider, context, status, refreshToken, features =
|
|
|
1903
2054
|
spellCheck: "false"
|
|
1904
2055
|
}
|
|
1905
2056
|
),
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Button, { size: "sm", type: "submit", disabled: pull.trim() === "", children: [
|
|
2058
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconDownload, { size: 13 }),
|
|
1908
2059
|
" ",
|
|
1909
2060
|
t("pull")
|
|
1910
2061
|
] })
|
|
1911
2062
|
] })
|
|
1912
2063
|
] }),
|
|
1913
|
-
/* @__PURE__ */ (0,
|
|
1914
|
-
/* @__PURE__ */ (0,
|
|
2064
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsh-docker-toolbar-right", children: [
|
|
2065
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "dsh-docker-muted", children: [
|
|
1915
2066
|
filtered.length,
|
|
1916
2067
|
" / ",
|
|
1917
2068
|
items.length
|
|
1918
2069
|
] }),
|
|
1919
|
-
!showArchitecture && /* @__PURE__ */ (0,
|
|
1920
|
-
/* @__PURE__ */ (0,
|
|
2070
|
+
!showArchitecture && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "dsh-docker-muted", children: t("restartForArchitecture") }),
|
|
2071
|
+
features.includes("image-build") && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Button, { size: "sm", onClick: () => setBuildOpen(true), children: [
|
|
2072
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconBuild, { size: 13 }),
|
|
2073
|
+
" ",
|
|
2074
|
+
t("buildImage")
|
|
2075
|
+
] }),
|
|
2076
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { size: "sm", onClick: list.reload, disabled: list.loading, children: t("refresh") })
|
|
1921
2077
|
] })
|
|
1922
2078
|
] }),
|
|
1923
|
-
!enabled && items.length === 0 ? /* @__PURE__ */ (0,
|
|
1924
|
-
/* @__PURE__ */ (0,
|
|
1925
|
-
/* @__PURE__ */ (0,
|
|
1926
|
-
/* @__PURE__ */ (0,
|
|
1927
|
-
/* @__PURE__ */ (0,
|
|
1928
|
-
showArchitecture && /* @__PURE__ */ (0,
|
|
1929
|
-
/* @__PURE__ */ (0,
|
|
1930
|
-
/* @__PURE__ */ (0,
|
|
1931
|
-
/* @__PURE__ */ (0,
|
|
2079
|
+
!enabled && items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(EmptyState, { icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconAlert, { size: 20 }), title: provider === "apple-container" ? t("appleSystemStopped") : t("daemonStopped"), text: provider === "apple-container" ? t("appleSystemStoppedBody") : t("daemonStoppedBody") }) : list.loading && list.data === null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoadingSkeleton, { rows: 6 }) : list.error !== null && list.data === null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ErrorState, { title: t("listFailed"), text: list.error.message, retryLabel: t("retry"), onRetry: list.reload }) : filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(EmptyState, { icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconImage, { size: 20 }), title: search === "" ? t("emptyImages") : t("emptySearch"), text: search === "" ? t("pullPlaceholder") : search }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("section", { className: "dsh-docker-card", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "dsh-docker-table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("table", { className: "dsh-docker-table", children: [
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("tr", { children: [
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("th", { children: t("repository") }),
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("th", { children: t("tag") }),
|
|
2083
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("th", { children: t("id") }),
|
|
2084
|
+
showArchitecture && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("th", { children: t("architecture") }),
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("th", { className: "dsh-docker-col-num", children: t("size") }),
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("th", { children: t("createdSince") }),
|
|
2087
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("th", { className: "dsh-docker-col-actions", children: t("actions") })
|
|
1932
2088
|
] }) }),
|
|
1933
|
-
/* @__PURE__ */ (0,
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("tbody", { children: filtered.map((item) => {
|
|
1934
2090
|
const inspectId = provider === "apple-container" ? item.name : item.id;
|
|
1935
|
-
return /* @__PURE__ */ (0,
|
|
1936
|
-
/* @__PURE__ */ (0,
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
1939
|
-
showArchitecture && /* @__PURE__ */ (0,
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
1943
|
-
features.includes("run") && item.name !== "<none>" && /* @__PURE__ */ (0,
|
|
1944
|
-
/* @__PURE__ */ (0,
|
|
1945
|
-
/* @__PURE__ */ (0,
|
|
2091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("tr", { children: [
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { className: "dsh-docker-mono dsh-docker-truncate", title: item.repository, children: item.repository }),
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { className: "dsh-docker-mono", children: displayValue(item.tag) }),
|
|
2094
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { className: "dsh-docker-mono dsh-docker-muted", title: item.id, children: shortId(item.id) }),
|
|
2095
|
+
showArchitecture && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { className: "dsh-docker-mono", children: displayValue(item.architecture) }),
|
|
2096
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { className: "dsh-docker-col-num", children: displayValue(item.size) }),
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { className: "dsh-docker-muted", children: displayValue(item.createdSince) }),
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { className: "dsh-docker-col-actions", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "dsh-docker-row-actions", children: [
|
|
2099
|
+
features.includes("run") && item.name !== "<none>" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { size: "sm", label: t("runFromImage"), onClick: () => onRunContainer(item.name), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconPlay, { size: 14 }) }),
|
|
2100
|
+
features.includes("image-push") && item.name !== "<none>" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { size: "sm", label: t("pushImage"), onClick: () => onAction({ kind: "image", action: "push", id: item.name }, { focusConsole: true }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconUpload, { size: 14 }) }),
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { size: "sm", label: t("inspect"), onClick: () => onInspect("image", inspectId), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconInfo, { size: 14 }) }),
|
|
2102
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { size: "sm", label: t("removeImage"), onClick: () => onAction({ kind: "image", action: "delete", id: inspectId }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconTrash, { size: 14 }) })
|
|
1946
2103
|
] }) })
|
|
1947
2104
|
] }, `${item.id}-${item.name}`);
|
|
1948
2105
|
}) })
|
|
1949
|
-
] }) }) })
|
|
2106
|
+
] }) }) }),
|
|
2107
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2108
|
+
BuildImageDialog,
|
|
2109
|
+
{
|
|
2110
|
+
open: buildOpen,
|
|
2111
|
+
t,
|
|
2112
|
+
provider,
|
|
2113
|
+
cwd,
|
|
2114
|
+
onClose: () => setBuildOpen(false),
|
|
2115
|
+
onSubmit: async (input) => {
|
|
2116
|
+
await onAction(input, { focusConsole: true });
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
)
|
|
1950
2120
|
] });
|
|
1951
2121
|
}
|
|
1952
2122
|
|
|
1953
2123
|
// src/client/tabs/networks.jsx
|
|
1954
|
-
var
|
|
1955
|
-
var
|
|
2124
|
+
var import_react11 = require("react");
|
|
2125
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1956
2126
|
var BUILTIN = /* @__PURE__ */ new Set(["bridge", "host", "none"]);
|
|
1957
2127
|
function NetworksTab({ t, api, provider, context, status, refreshToken, onAction, onInspect }) {
|
|
1958
|
-
const [search, setSearch] = (0,
|
|
2128
|
+
const [search, setSearch] = (0, import_react11.useState)("");
|
|
1959
2129
|
const enabled = status?.daemon?.state === "running";
|
|
1960
2130
|
const list = useDockerList(api, provider, "networks", context, { refreshToken, enabled });
|
|
1961
2131
|
const items = list.data?.items ?? [];
|
|
1962
2132
|
const builtin = provider === "apple-container" ? /* @__PURE__ */ new Set(["default"]) : BUILTIN;
|
|
1963
|
-
const filtered = (0,
|
|
2133
|
+
const filtered = (0, import_react11.useMemo)(() => {
|
|
1964
2134
|
const needle = search.trim().toLowerCase();
|
|
1965
2135
|
return needle === "" ? items : items.filter((item) => `${item.name} ${item.driver} ${item.scope} ${item.id}`.toLowerCase().includes(needle));
|
|
1966
2136
|
}, [items, search]);
|
|
1967
|
-
return /* @__PURE__ */ (0,
|
|
1968
|
-
/* @__PURE__ */ (0,
|
|
1969
|
-
/* @__PURE__ */ (0,
|
|
1970
|
-
/* @__PURE__ */ (0,
|
|
1971
|
-
/* @__PURE__ */ (0,
|
|
2137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-docker-stack", children: [
|
|
2138
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-docker-toolbar", children: [
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-docker-toolbar-left", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: t("search"), label: t("search") }) }),
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-docker-toolbar-right", children: [
|
|
2141
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-docker-muted", children: [
|
|
1972
2142
|
filtered.length,
|
|
1973
2143
|
" / ",
|
|
1974
2144
|
items.length
|
|
1975
2145
|
] }),
|
|
1976
|
-
/* @__PURE__ */ (0,
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { size: "sm", onClick: list.reload, disabled: list.loading, children: t("refresh") })
|
|
1977
2147
|
] })
|
|
1978
2148
|
] }),
|
|
1979
|
-
!enabled && items.length === 0 ? /* @__PURE__ */ (0,
|
|
1980
|
-
/* @__PURE__ */ (0,
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
1983
|
-
/* @__PURE__ */ (0,
|
|
1984
|
-
/* @__PURE__ */ (0,
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
1986
|
-
/* @__PURE__ */ (0,
|
|
1987
|
-
/* @__PURE__ */ (0,
|
|
2149
|
+
!enabled && items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(EmptyState, { icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconAlert, { size: 20 }), title: provider === "apple-container" ? t("appleSystemStopped") : t("daemonStopped"), text: provider === "apple-container" ? t("appleSystemStoppedBody") : t("daemonStoppedBody") }) : list.loading && list.data === null ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoadingSkeleton, { rows: 5 }) : list.error !== null && list.data === null ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ErrorState, { title: t("listFailed"), text: list.error.message, retryLabel: t("retry"), onRetry: list.reload }) : filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(EmptyState, { icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconNetwork, { size: 20 }), title: search === "" ? t("emptyNetworks") : t("emptySearch"), text: search === "" ? void 0 : search }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("section", { className: "dsh-docker-card", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-docker-table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("table", { className: "dsh-docker-table", children: [
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("tr", { children: [
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("th", { children: t("name") }),
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("th", { children: t("driver") }),
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("th", { children: t("scope") }),
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("th", { children: "IPv4" }),
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("th", { children: "IPv6" }),
|
|
2156
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("th", { children: t("internal") }),
|
|
2157
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("th", { className: "dsh-docker-col-actions", children: t("actions") })
|
|
1988
2158
|
] }) }),
|
|
1989
|
-
/* @__PURE__ */ (0,
|
|
1990
|
-
/* @__PURE__ */ (0,
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tbody", { children: filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("tr", { children: [
|
|
2160
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("td", { children: [
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-docker-row-title", children: item.name }),
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-docker-mono dsh-docker-muted", children: item.id })
|
|
1993
2163
|
] }),
|
|
1994
|
-
/* @__PURE__ */ (0,
|
|
1995
|
-
/* @__PURE__ */ (0,
|
|
1996
|
-
/* @__PURE__ */ (0,
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
1998
|
-
/* @__PURE__ */ (0,
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2000
|
-
/* @__PURE__ */ (0,
|
|
2001
|
-
/* @__PURE__ */ (0,
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { children: displayValue(item.driver) }),
|
|
2165
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { children: displayValue(item.scope) }),
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { children: displayValue(item.ipv4) }),
|
|
2167
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { children: displayValue(item.ipv6) }),
|
|
2168
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { children: displayValue(item.internal) }),
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { className: "dsh-docker-col-actions", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-docker-row-actions", children: [
|
|
2170
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconButton, { size: "sm", label: t("inspect"), onClick: () => onInspect("network", item.id), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconInfo, { size: 14 }) }),
|
|
2171
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2002
2172
|
IconButton,
|
|
2003
2173
|
{
|
|
2004
2174
|
size: "sm",
|
|
2005
2175
|
label: t("removeNetwork"),
|
|
2006
2176
|
disabled: builtin.has(item.name),
|
|
2007
2177
|
onClick: () => onAction({ kind: "network", action: "delete", id: item.name }),
|
|
2008
|
-
children: /* @__PURE__ */ (0,
|
|
2178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconTrash, { size: 14 })
|
|
2009
2179
|
}
|
|
2010
2180
|
)
|
|
2011
2181
|
] }) })
|
|
@@ -2015,13 +2185,13 @@ function NetworksTab({ t, api, provider, context, status, refreshToken, onAction
|
|
|
2015
2185
|
}
|
|
2016
2186
|
|
|
2017
2187
|
// src/client/tabs/overview.jsx
|
|
2018
|
-
var
|
|
2019
|
-
var
|
|
2188
|
+
var import_react12 = require("react");
|
|
2189
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2020
2190
|
function Stat({ label, value, detail }) {
|
|
2021
|
-
return /* @__PURE__ */ (0,
|
|
2022
|
-
/* @__PURE__ */ (0,
|
|
2023
|
-
/* @__PURE__ */ (0,
|
|
2024
|
-
detail !== void 0 && /* @__PURE__ */ (0,
|
|
2191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-stat", children: [
|
|
2192
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-stat-label", children: label }),
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-stat-value", children: value }),
|
|
2194
|
+
detail !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-stat-detail", children: detail })
|
|
2025
2195
|
] });
|
|
2026
2196
|
}
|
|
2027
2197
|
function RuntimeCard({ t, provider, status, imageCount, volumeCount, networkCount, onRuntime, busy }) {
|
|
@@ -2050,92 +2220,92 @@ function RuntimeCard({ t, provider, status, imageCount, volumeCount, networkCoun
|
|
|
2050
2220
|
[t("memory"), runtime?.memory !== void 0 ? formatBytes(runtime.memory) : void 0],
|
|
2051
2221
|
[t("disk"), runtime?.disk !== void 0 ? formatBytes(runtime.disk) : void 0]
|
|
2052
2222
|
]).filter(([, value]) => value !== void 0 && value !== null && value !== "");
|
|
2053
|
-
return /* @__PURE__ */ (0,
|
|
2054
|
-
/* @__PURE__ */ (0,
|
|
2055
|
-
/* @__PURE__ */ (0,
|
|
2056
|
-
/* @__PURE__ */ (0,
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-docker-card", children: [
|
|
2224
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-card-head", children: [
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "dsh-docker-card-title", children: t("runtime") }),
|
|
2227
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsh-docker-card-sub", children: runtime?.kind ?? "" })
|
|
2058
2228
|
] }),
|
|
2059
|
-
/* @__PURE__ */ (0,
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-docker-status", "data-state": runtime?.running ? "running" : "stopped", children: [
|
|
2230
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-docker-dot" }),
|
|
2061
2231
|
runtime?.running ? t("statusRunning") : t("statusStopped")
|
|
2062
2232
|
] })
|
|
2063
2233
|
] }),
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2065
|
-
/* @__PURE__ */ (0,
|
|
2066
|
-
/* @__PURE__ */ (0,
|
|
2067
|
-
/* @__PURE__ */ (0,
|
|
2068
|
-
/* @__PURE__ */ (0,
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-card-body", children: [
|
|
2235
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-runtime-head", children: [
|
|
2236
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-docker-mark", style: { width: 34, height: 34 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconBox, { size: 19 }) }),
|
|
2237
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-runtime-name", children: runtime?.label ?? t("unknownRuntime") }),
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-muted", children: isApple ? "container \xB7 per-container VM" : runtime?.kind === "colima" ? `colima \xB7 profile ${runtime.profile ?? "default"}` : runtime?.kind ?? "" })
|
|
2070
2240
|
] })
|
|
2071
2241
|
] }),
|
|
2072
|
-
/* @__PURE__ */ (0,
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-kv", children: rows.map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-kv-row", style: { display: "contents" }, children: [
|
|
2243
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-kv-key", children: key }),
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-kv-value", children: displayValue(value) })
|
|
2075
2245
|
] }, key)) }),
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2077
|
-
runtime?.canStart === true && /* @__PURE__ */ (0,
|
|
2078
|
-
busy ? /* @__PURE__ */ (0,
|
|
2246
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-middle", style: { marginTop: 14 }, children: [
|
|
2247
|
+
runtime?.canStart === true && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Button, { size: "sm", variant: "primary", onClick: () => onRuntime("start"), disabled: busy, children: [
|
|
2248
|
+
busy ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Spinner, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconPlay, { size: 13 }),
|
|
2079
2249
|
" ",
|
|
2080
2250
|
t("start")
|
|
2081
2251
|
] }),
|
|
2082
|
-
runtime?.canStop === true && /* @__PURE__ */ (0,
|
|
2083
|
-
/* @__PURE__ */ (0,
|
|
2252
|
+
runtime?.canStop === true && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Button, { size: "sm", onClick: () => onRuntime("stop"), disabled: busy, children: [
|
|
2253
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconStop, { size: 13 }),
|
|
2084
2254
|
" ",
|
|
2085
2255
|
t("stop")
|
|
2086
2256
|
] }),
|
|
2087
|
-
runtime?.canRestart === true && /* @__PURE__ */ (0,
|
|
2088
|
-
/* @__PURE__ */ (0,
|
|
2257
|
+
runtime?.canRestart === true && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Button, { size: "sm", onClick: () => onRuntime("restart"), disabled: busy, children: [
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconRestart, { size: 13 }),
|
|
2089
2259
|
" ",
|
|
2090
2260
|
t("restart")
|
|
2091
2261
|
] }),
|
|
2092
|
-
runtime?.canStart !== true && runtime?.canStop !== true && runtime?.canRestart !== true && /* @__PURE__ */ (0,
|
|
2262
|
+
runtime?.canStart !== true && runtime?.canStop !== true && runtime?.canRestart !== true && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-docker-muted", children: status.capabilities?.enableRuntimeControl === false ? t("runtimeControlDisabled") : runtime?.error ?? t("remoteHint") })
|
|
2093
2263
|
] })
|
|
2094
2264
|
] })
|
|
2095
2265
|
] });
|
|
2096
2266
|
}
|
|
2097
2267
|
function RecentContainers({ t, list, onOpenTab, onInspect }) {
|
|
2098
|
-
if (list.loading && list.data === null) return /* @__PURE__ */ (0,
|
|
2268
|
+
if (list.loading && list.data === null) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoadingSkeleton, { rows: 4 });
|
|
2099
2269
|
if (list.error !== null && list.data === null) {
|
|
2100
|
-
return /* @__PURE__ */ (0,
|
|
2270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ErrorState, { title: t("listFailed"), text: list.error.message, retryLabel: t("retry"), onRetry: list.reload });
|
|
2101
2271
|
}
|
|
2102
2272
|
const items = (list.data?.items ?? []).slice(0, 5);
|
|
2103
2273
|
if (items.length === 0) {
|
|
2104
|
-
return /* @__PURE__ */ (0,
|
|
2274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(EmptyState, { icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconBox, { size: 19 }), title: t("emptyContainers") });
|
|
2105
2275
|
}
|
|
2106
|
-
return /* @__PURE__ */ (0,
|
|
2107
|
-
/* @__PURE__ */ (0,
|
|
2108
|
-
/* @__PURE__ */ (0,
|
|
2109
|
-
/* @__PURE__ */ (0,
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2112
|
-
/* @__PURE__ */ (0,
|
|
2276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-table-wrap", children: [
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("table", { className: "dsh-docker-table", children: [
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("tr", { children: [
|
|
2279
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("th", { children: t("name") }),
|
|
2280
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("th", { children: t("image") }),
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("th", { children: t("status") }),
|
|
2282
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("th", { children: t("ports") })
|
|
2113
2283
|
] }) }),
|
|
2114
|
-
/* @__PURE__ */ (0,
|
|
2115
|
-
/* @__PURE__ */ (0,
|
|
2116
|
-
/* @__PURE__ */ (0,
|
|
2117
|
-
/* @__PURE__ */ (0,
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("tbody", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("tr", { onClick: () => onInspect("container", item.id), style: { cursor: "pointer" }, children: [
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-docker-row-title", children: item.name || item.id }) }),
|
|
2286
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("td", { className: "dsh-docker-mono dsh-docker-truncate", children: item.image }),
|
|
2287
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(StateLabel, { state: item.state, t }) }),
|
|
2288
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Chips, { values: item.ports.slice(0, 2), mono: true }) })
|
|
2119
2289
|
] }, item.id)) })
|
|
2120
2290
|
] }),
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2291
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", justifyContent: "flex-end", padding: "8px 12px" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { size: "sm", variant: "ghost", onClick: () => onOpenTab("containers"), children: t("viewAll") }) })
|
|
2122
2292
|
] });
|
|
2123
2293
|
}
|
|
2124
2294
|
function DiskCard({ t, list }) {
|
|
2125
|
-
if (list.loading && list.data === null) return /* @__PURE__ */ (0,
|
|
2126
|
-
if (list.error !== null && list.data === null) return /* @__PURE__ */ (0,
|
|
2295
|
+
if (list.loading && list.data === null) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoadingSkeleton, { rows: 3 });
|
|
2296
|
+
if (list.error !== null && list.data === null) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-muted", style: { padding: 16 }, children: list.error.message });
|
|
2127
2297
|
const items = list.data?.items ?? [];
|
|
2128
|
-
if (items.length === 0) return /* @__PURE__ */ (0,
|
|
2129
|
-
return /* @__PURE__ */ (0,
|
|
2130
|
-
/* @__PURE__ */ (0,
|
|
2131
|
-
/* @__PURE__ */ (0,
|
|
2132
|
-
/* @__PURE__ */ (0,
|
|
2133
|
-
/* @__PURE__ */ (0,
|
|
2298
|
+
if (items.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-muted", style: { padding: 16 }, children: t("noDiskData") });
|
|
2299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("table", { className: "dsh-docker-table", children: [
|
|
2300
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("tr", { children: [
|
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("th", { children: t("status") }),
|
|
2302
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("th", { className: "dsh-docker-col-num", children: t("size") }),
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("th", { className: "dsh-docker-col-num", children: "Reclaimable" })
|
|
2134
2304
|
] }) }),
|
|
2135
|
-
/* @__PURE__ */ (0,
|
|
2136
|
-
/* @__PURE__ */ (0,
|
|
2137
|
-
/* @__PURE__ */ (0,
|
|
2138
|
-
/* @__PURE__ */ (0,
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("tbody", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("tr", { children: [
|
|
2306
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("td", { children: item.type }),
|
|
2307
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("td", { className: "dsh-docker-col-num", children: displayValue(item.size) }),
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("td", { className: "dsh-docker-col-num", children: displayValue(item.reclaimable) })
|
|
2139
2309
|
] }, item.type)) })
|
|
2140
2310
|
] }) });
|
|
2141
2311
|
}
|
|
@@ -2151,18 +2321,18 @@ function OverviewTab({ t, api, provider, context, status, refreshToken, onRuntim
|
|
|
2151
2321
|
const isApple = provider === "apple-container";
|
|
2152
2322
|
const quick = isApple ? ["ls -a", "image ls", "volume ls", "network ls", "system df", "system version"] : ["ps -a", "images", "volume ls", "network ls", "compose ls", "system df", "info", "version"];
|
|
2153
2323
|
const commandPrefix = isApple ? "container" : "docker";
|
|
2154
|
-
const recent = (0,
|
|
2324
|
+
const recent = (0, import_react12.useMemo)(() => (containers.data?.items ?? []).slice(0, 5), [containers.data]);
|
|
2155
2325
|
const volumeCount = volumes.data?.items?.length;
|
|
2156
2326
|
const networkCount = networks.data?.items?.length;
|
|
2157
2327
|
const imageCount = images.data?.items?.length ?? server?.images;
|
|
2158
|
-
return /* @__PURE__ */ (0,
|
|
2159
|
-
/* @__PURE__ */ (0,
|
|
2160
|
-
/* @__PURE__ */ (0,
|
|
2161
|
-
/* @__PURE__ */ (0,
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2163
|
-
/* @__PURE__ */ (0,
|
|
2164
|
-
/* @__PURE__ */ (0,
|
|
2165
|
-
/* @__PURE__ */ (0,
|
|
2328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-stack", children: [
|
|
2329
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-stats", children: [
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Stat, { label: t("runningContainers"), value: server?.containersRunning ?? "\u2014", detail: isApple ? t("providerApple") : context ?? t("noContext") }),
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Stat, { label: t("stoppedContainers"), value: server?.containersStopped ?? "\u2014" }),
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Stat, { label: t("imageCount"), value: imageCount ?? "\u2014" }),
|
|
2333
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Stat, { label: t("volumeCount"), value: volumeCount ?? "\u2014" }),
|
|
2334
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Stat, { label: t("networkCount"), value: networkCount ?? "\u2014" }),
|
|
2335
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2166
2336
|
Stat,
|
|
2167
2337
|
{
|
|
2168
2338
|
label: t("server"),
|
|
@@ -2171,102 +2341,102 @@ function OverviewTab({ t, api, provider, context, status, refreshToken, onRuntim
|
|
|
2171
2341
|
}
|
|
2172
2342
|
)
|
|
2173
2343
|
] }),
|
|
2174
|
-
/* @__PURE__ */ (0,
|
|
2175
|
-
/* @__PURE__ */ (0,
|
|
2176
|
-
/* @__PURE__ */ (0,
|
|
2177
|
-
/* @__PURE__ */ (0,
|
|
2178
|
-
/* @__PURE__ */ (0,
|
|
2179
|
-
/* @__PURE__ */ (0,
|
|
2180
|
-
/* @__PURE__ */ (0,
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-grid-2", children: [
|
|
2345
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RuntimeCard, { t, provider, status, imageCount, volumeCount, networkCount, onRuntime, busy }),
|
|
2346
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-docker-card", children: [
|
|
2347
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-card-head", children: [
|
|
2348
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
2349
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "dsh-docker-card-title", children: t("quickCommands") }),
|
|
2350
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsh-docker-card-sub", children: t("terminal") })
|
|
2181
2351
|
] }),
|
|
2182
|
-
/* @__PURE__ */ (0,
|
|
2352
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconTerminal, { size: 16, className: "dsh-docker-muted" })
|
|
2183
2353
|
] }),
|
|
2184
|
-
/* @__PURE__ */ (0,
|
|
2185
|
-
/* @__PURE__ */ (0,
|
|
2186
|
-
/* @__PURE__ */ (0,
|
|
2187
|
-
/* @__PURE__ */ (0,
|
|
2188
|
-
/* @__PURE__ */ (0,
|
|
2189
|
-
/* @__PURE__ */ (0,
|
|
2354
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-card-body", children: [
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-chip-row", children: quick.map((command) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "dsh-docker-quick", onClick: () => onQuickCommand(`${commandPrefix} ${command}`), children: command }, command)) }),
|
|
2356
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-divider" }),
|
|
2357
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-kv", children: [
|
|
2358
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-kv-key", children: t("client") }),
|
|
2359
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-kv-value", children: [
|
|
2190
2360
|
status?.client?.version ?? "\u2014",
|
|
2191
2361
|
" ",
|
|
2192
|
-
status?.cli?.path ? /* @__PURE__ */ (0,
|
|
2362
|
+
status?.cli?.path ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-docker-mono dsh-docker-muted", children: [
|
|
2193
2363
|
" \xB7 ",
|
|
2194
2364
|
status.cli.path
|
|
2195
2365
|
] }) : null
|
|
2196
2366
|
] }),
|
|
2197
|
-
/* @__PURE__ */ (0,
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2199
|
-
/* @__PURE__ */ (0,
|
|
2200
|
-
/* @__PURE__ */ (0,
|
|
2367
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-kv-key", children: isApple ? t("providerLabel") : t("context") }),
|
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-kv-value", children: isApple ? t("providerApple") : context ?? status?.context?.selected ?? status?.context?.current ?? t("noContext") }),
|
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-kv-key", children: t("lastUpdated") }),
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-kv-value", children: formatTime(status?.fetchedAt) })
|
|
2201
2371
|
] })
|
|
2202
2372
|
] })
|
|
2203
2373
|
] })
|
|
2204
2374
|
] }),
|
|
2205
|
-
/* @__PURE__ */ (0,
|
|
2206
|
-
/* @__PURE__ */ (0,
|
|
2207
|
-
/* @__PURE__ */ (0,
|
|
2208
|
-
/* @__PURE__ */ (0,
|
|
2209
|
-
/* @__PURE__ */ (0,
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-grid-2", children: [
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-docker-card", children: [
|
|
2377
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-card-head", children: [
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "dsh-docker-card-title", children: t("recentContainers") }) }),
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { size: "sm", variant: "ghost", onClick: () => onOpenTab("containers"), children: t("viewAll") })
|
|
2210
2380
|
] }),
|
|
2211
|
-
/* @__PURE__ */ (0,
|
|
2381
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-card-body dsh-docker-flush", style: { paddingTop: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RecentContainers, { t, list: { ...containers, data: containers.data ?? { items: recent } }, onOpenTab, onInspect }) })
|
|
2212
2382
|
] }),
|
|
2213
|
-
/* @__PURE__ */ (0,
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
2215
|
-
/* @__PURE__ */ (0,
|
|
2216
|
-
/* @__PURE__ */ (0,
|
|
2217
|
-
/* @__PURE__ */ (0,
|
|
2383
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-docker-card", children: [
|
|
2384
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-docker-card-head", children: [
|
|
2385
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "dsh-docker-card-title", children: t("disk") }),
|
|
2387
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "dsh-docker-card-sub", children: [
|
|
2218
2388
|
commandPrefix,
|
|
2219
2389
|
" system df"
|
|
2220
2390
|
] })
|
|
2221
2391
|
] }),
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconImage, { size: 16, className: "dsh-docker-muted" })
|
|
2223
2393
|
] }),
|
|
2224
|
-
/* @__PURE__ */ (0,
|
|
2394
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-docker-card-body dsh-docker-flush", style: { paddingTop: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DiskCard, { t, list: disk }) })
|
|
2225
2395
|
] })
|
|
2226
2396
|
] })
|
|
2227
2397
|
] });
|
|
2228
2398
|
}
|
|
2229
2399
|
|
|
2230
2400
|
// src/client/tabs/volumes.jsx
|
|
2231
|
-
var
|
|
2232
|
-
var
|
|
2401
|
+
var import_react13 = require("react");
|
|
2402
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2233
2403
|
function VolumesTab({ t, api, provider, context, status, refreshToken, onAction, onInspect }) {
|
|
2234
|
-
const [search, setSearch] = (0,
|
|
2404
|
+
const [search, setSearch] = (0, import_react13.useState)("");
|
|
2235
2405
|
const enabled = status?.daemon?.state === "running";
|
|
2236
2406
|
const list = useDockerList(api, provider, "volumes", context, { refreshToken, enabled });
|
|
2237
2407
|
const items = list.data?.items ?? [];
|
|
2238
|
-
const filtered = (0,
|
|
2408
|
+
const filtered = (0, import_react13.useMemo)(() => {
|
|
2239
2409
|
const needle = search.trim().toLowerCase();
|
|
2240
2410
|
return needle === "" ? items : items.filter((item) => `${item.name} ${item.driver} ${item.mountpoint}`.toLowerCase().includes(needle));
|
|
2241
2411
|
}, [items, search]);
|
|
2242
|
-
return /* @__PURE__ */ (0,
|
|
2243
|
-
/* @__PURE__ */ (0,
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2245
|
-
/* @__PURE__ */ (0,
|
|
2246
|
-
/* @__PURE__ */ (0,
|
|
2412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-docker-stack", children: [
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-docker-toolbar", children: [
|
|
2414
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-docker-toolbar-left", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: t("search"), label: t("search") }) }),
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-docker-toolbar-right", children: [
|
|
2416
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-docker-muted", children: [
|
|
2247
2417
|
filtered.length,
|
|
2248
2418
|
" / ",
|
|
2249
2419
|
items.length
|
|
2250
2420
|
] }),
|
|
2251
|
-
/* @__PURE__ */ (0,
|
|
2421
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { size: "sm", onClick: list.reload, disabled: list.loading, children: t("refresh") })
|
|
2252
2422
|
] })
|
|
2253
2423
|
] }),
|
|
2254
|
-
!enabled && items.length === 0 ? /* @__PURE__ */ (0,
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2256
|
-
/* @__PURE__ */ (0,
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2258
|
-
/* @__PURE__ */ (0,
|
|
2259
|
-
/* @__PURE__ */ (0,
|
|
2260
|
-
/* @__PURE__ */ (0,
|
|
2424
|
+
!enabled && items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EmptyState, { icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconAlert, { size: 20 }), title: provider === "apple-container" ? t("appleSystemStopped") : t("daemonStopped"), text: provider === "apple-container" ? t("appleSystemStoppedBody") : t("daemonStoppedBody") }) : list.loading && list.data === null ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LoadingSkeleton, { rows: 5 }) : list.error !== null && list.data === null ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ErrorState, { title: t("listFailed"), text: list.error.message, retryLabel: t("retry"), onRetry: list.reload }) : filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EmptyState, { icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconVolume, { size: 20 }), title: search === "" ? t("emptyVolumes") : t("emptySearch"), text: search === "" ? void 0 : search }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("section", { className: "dsh-docker-card", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-docker-table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", { className: "dsh-docker-table", children: [
|
|
2425
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
2426
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { children: t("name") }),
|
|
2427
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { children: t("driver") }),
|
|
2428
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { children: t("scope") }),
|
|
2429
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { children: t("mountpoint") }),
|
|
2430
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { className: "dsh-docker-col-actions", children: t("actions") })
|
|
2261
2431
|
] }) }),
|
|
2262
|
-
/* @__PURE__ */ (0,
|
|
2263
|
-
/* @__PURE__ */ (0,
|
|
2264
|
-
/* @__PURE__ */ (0,
|
|
2265
|
-
/* @__PURE__ */ (0,
|
|
2266
|
-
/* @__PURE__ */ (0,
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2268
|
-
/* @__PURE__ */ (0,
|
|
2269
|
-
/* @__PURE__ */ (0,
|
|
2432
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { children: filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
2433
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: "dsh-docker-mono dsh-docker-row-title", children: item.name }),
|
|
2434
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { children: displayValue(item.driver) }),
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { children: displayValue(item.scope) }),
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: "dsh-docker-mono dsh-docker-muted dsh-docker-truncate", title: item.mountpoint, children: displayValue(item.mountpoint) }),
|
|
2437
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: "dsh-docker-col-actions", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-docker-row-actions", children: [
|
|
2438
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { size: "sm", label: t("inspect"), onClick: () => onInspect("volume", item.name), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconInfo, { size: 14 }) }),
|
|
2439
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { size: "sm", label: t("removeVolume"), onClick: () => onAction({ kind: "volume", action: "delete", id: item.name }), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconTrash, { size: 14 }) })
|
|
2270
2440
|
] }) })
|
|
2271
2441
|
] }, item.name)) })
|
|
2272
2442
|
] }) }) })
|
|
@@ -2274,7 +2444,7 @@ function VolumesTab({ t, api, provider, context, status, refreshToken, onAction,
|
|
|
2274
2444
|
}
|
|
2275
2445
|
|
|
2276
2446
|
// src/client/page.jsx
|
|
2277
|
-
var
|
|
2447
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2278
2448
|
var TABS = [
|
|
2279
2449
|
["overview", "overview"],
|
|
2280
2450
|
["containers", "containers"],
|
|
@@ -2284,7 +2454,7 @@ var TABS = [
|
|
|
2284
2454
|
["compose", "compose"],
|
|
2285
2455
|
["console", "console"]
|
|
2286
2456
|
];
|
|
2287
|
-
var DockerErrorBoundary = class extends
|
|
2457
|
+
var DockerErrorBoundary = class extends import_react14.Component {
|
|
2288
2458
|
constructor(props) {
|
|
2289
2459
|
super(props);
|
|
2290
2460
|
this.state = { error: null };
|
|
@@ -2294,7 +2464,7 @@ var DockerErrorBoundary = class extends import_react13.Component {
|
|
|
2294
2464
|
}
|
|
2295
2465
|
render() {
|
|
2296
2466
|
if (this.state.error !== null) {
|
|
2297
|
-
return /* @__PURE__ */ (0,
|
|
2467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-body", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2298
2468
|
ErrorState,
|
|
2299
2469
|
{
|
|
2300
2470
|
title: this.props.t("errorTitle"),
|
|
@@ -2330,29 +2500,29 @@ function DockerPage(props) {
|
|
|
2330
2500
|
const provider = store.provider;
|
|
2331
2501
|
const context = store.context;
|
|
2332
2502
|
const cwd = store.cwd;
|
|
2333
|
-
const [refreshToken, setRefreshToken] = (0,
|
|
2334
|
-
const [draft, setDraft] = (0,
|
|
2335
|
-
const [startingAt, setStartingAt] = (0,
|
|
2336
|
-
const [runtimeBusy, setRuntimeBusy] = (0,
|
|
2337
|
-
const [inspect, setInspect] = (0,
|
|
2338
|
-
const [confirm, setConfirm] = (0,
|
|
2339
|
-
const [attach, setAttach] = (0,
|
|
2340
|
-
const [runDialog, setRunDialog] = (0,
|
|
2341
|
-
const attachRef = (0,
|
|
2342
|
-
const attachRequest = (0,
|
|
2343
|
-
const [toasts, setToasts] = (0,
|
|
2344
|
-
const toastTimers = (0,
|
|
2503
|
+
const [refreshToken, setRefreshToken] = (0, import_react14.useState)(0);
|
|
2504
|
+
const [draft, setDraft] = (0, import_react14.useState)("");
|
|
2505
|
+
const [startingAt, setStartingAt] = (0, import_react14.useState)(null);
|
|
2506
|
+
const [runtimeBusy, setRuntimeBusy] = (0, import_react14.useState)(null);
|
|
2507
|
+
const [inspect, setInspect] = (0, import_react14.useState)({ open: false, loading: false, kind: null, id: null, value: null, raw: "", error: null });
|
|
2508
|
+
const [confirm, setConfirm] = (0, import_react14.useState)(null);
|
|
2509
|
+
const [attach, setAttach] = (0, import_react14.useState)({ open: false, loading: false, mode: "attach", session: null, output: "", error: null });
|
|
2510
|
+
const [runDialog, setRunDialog] = (0, import_react14.useState)({ open: false, image: "" });
|
|
2511
|
+
const attachRef = (0, import_react14.useRef)(null);
|
|
2512
|
+
const attachRequest = (0, import_react14.useRef)(0);
|
|
2513
|
+
const [toasts, setToasts] = (0, import_react14.useState)([]);
|
|
2514
|
+
const toastTimers = (0, import_react14.useRef)(/* @__PURE__ */ new Map());
|
|
2345
2515
|
const providersState = useProviders(api);
|
|
2346
|
-
const providerOptions = (0,
|
|
2347
|
-
const features = (0,
|
|
2516
|
+
const providerOptions = (0, import_react14.useMemo)(() => (providersState.data?.providers ?? []).filter((item) => item.available), [providersState.data]);
|
|
2517
|
+
const features = (0, import_react14.useMemo)(() => providersState.data?.features ?? [], [providersState.data]);
|
|
2348
2518
|
const canAskAI = features.includes("ai-tools") && typeof startDiagnosis === "function";
|
|
2349
2519
|
const statusState = useDockerStatus(api, provider, provider === "docker" ? context : null, refreshToken);
|
|
2350
2520
|
const status = statusState.data;
|
|
2351
|
-
const runState = (0,
|
|
2521
|
+
const runState = (0, import_react14.useSyncExternalStore)(runs.subscribe, runs.getSnapshot);
|
|
2352
2522
|
const selectedContext = provider === "docker" ? context ?? status?.context?.selected ?? null : null;
|
|
2353
2523
|
const contexts = provider === "docker" ? status?.context?.contexts ?? [] : [];
|
|
2354
2524
|
const pill = runtimeStatus(status, t);
|
|
2355
|
-
const notify = (0,
|
|
2525
|
+
const notify = (0, import_react14.useCallback)((tone, message) => {
|
|
2356
2526
|
const id = `${Date.now()}_${Math.random().toString(16).slice(2)}`;
|
|
2357
2527
|
setToasts((current) => [...current.slice(-3), { id, tone, message }]);
|
|
2358
2528
|
const timer = setTimeout(() => {
|
|
@@ -2361,27 +2531,27 @@ function DockerPage(props) {
|
|
|
2361
2531
|
}, tone === "error" ? 7e3 : 4e3);
|
|
2362
2532
|
toastTimers.current.set(id, timer);
|
|
2363
2533
|
}, []);
|
|
2364
|
-
(0,
|
|
2534
|
+
(0, import_react14.useEffect)(() => () => {
|
|
2365
2535
|
for (const timer of toastTimers.current.values()) clearTimeout(timer);
|
|
2366
2536
|
toastTimers.current.clear();
|
|
2367
2537
|
}, []);
|
|
2368
|
-
(0,
|
|
2538
|
+
(0, import_react14.useEffect)(() => {
|
|
2369
2539
|
if (providersState.data === null || providerOptions.length === 0) return;
|
|
2370
2540
|
if (!providerOptions.some((item) => item.id === provider)) {
|
|
2371
2541
|
const next = providersState.data.defaultProvider ?? providerOptions[0].id;
|
|
2372
2542
|
if (next !== provider) actions.setProvider(next);
|
|
2373
2543
|
}
|
|
2374
2544
|
}, [actions, provider, providerOptions, providersState.data]);
|
|
2375
|
-
(0,
|
|
2545
|
+
(0, import_react14.useEffect)(() => {
|
|
2376
2546
|
if (provider === "apple-container" && tab === "compose") actions.setTab("overview");
|
|
2377
2547
|
}, [actions, provider, tab]);
|
|
2378
|
-
(0,
|
|
2548
|
+
(0, import_react14.useEffect)(() => {
|
|
2379
2549
|
if (provider !== "docker") return;
|
|
2380
2550
|
if (context !== null && status !== null && contexts.length > 0 && !contexts.some((item) => item.name === context)) {
|
|
2381
2551
|
actions.setContext(null);
|
|
2382
2552
|
}
|
|
2383
2553
|
}, [actions, context, contexts, provider, status]);
|
|
2384
|
-
(0,
|
|
2554
|
+
(0, import_react14.useEffect)(() => {
|
|
2385
2555
|
runs.onFinished = (finished) => {
|
|
2386
2556
|
setRefreshToken((value) => value + 1);
|
|
2387
2557
|
statusState.refresh();
|
|
@@ -2395,7 +2565,7 @@ function DockerPage(props) {
|
|
|
2395
2565
|
runs.onFinished = void 0;
|
|
2396
2566
|
};
|
|
2397
2567
|
}, [notify, runs, startingAt, statusState.refresh, t]);
|
|
2398
|
-
(0,
|
|
2568
|
+
(0, import_react14.useEffect)(() => {
|
|
2399
2569
|
if (startingAt === null) return void 0;
|
|
2400
2570
|
if (runtimeBusy === "stop" ? status?.daemon?.state !== "running" : status?.daemon?.state === "running") {
|
|
2401
2571
|
setStartingAt(null);
|
|
@@ -2410,13 +2580,13 @@ function DockerPage(props) {
|
|
|
2410
2580
|
}, provider === "apple-container" ? 45e3 : 13e4);
|
|
2411
2581
|
return () => clearTimeout(timer);
|
|
2412
2582
|
}, [notify, provider, runtimeBusy, startingAt, status?.daemon?.state, status?.runtime?.label, t]);
|
|
2413
|
-
const refreshAll = (0,
|
|
2583
|
+
const refreshAll = (0, import_react14.useCallback)(() => {
|
|
2414
2584
|
cacheClear();
|
|
2415
2585
|
setRefreshToken((value) => value + 1);
|
|
2416
2586
|
statusState.refresh();
|
|
2417
2587
|
}, [statusState.refresh]);
|
|
2418
|
-
const lastRun = (0,
|
|
2419
|
-
(0,
|
|
2588
|
+
const lastRun = (0, import_react14.useRef)(null);
|
|
2589
|
+
(0, import_react14.useEffect)(() => {
|
|
2420
2590
|
const run = runState.run;
|
|
2421
2591
|
if (run === null || run === void 0) {
|
|
2422
2592
|
lastRun.current = null;
|
|
@@ -2428,7 +2598,7 @@ function DockerPage(props) {
|
|
|
2428
2598
|
lastRun.current = signature;
|
|
2429
2599
|
refreshAll();
|
|
2430
2600
|
}, [refreshAll, runState.run?.id, runState.run?.status]);
|
|
2431
|
-
const confirmThen = (0,
|
|
2601
|
+
const confirmThen = (0, import_react14.useCallback)((config, execute) => {
|
|
2432
2602
|
setConfirm({
|
|
2433
2603
|
...config,
|
|
2434
2604
|
busy: false,
|
|
@@ -2445,7 +2615,7 @@ function DockerPage(props) {
|
|
|
2445
2615
|
}
|
|
2446
2616
|
});
|
|
2447
2617
|
}, [notify, refreshAll]);
|
|
2448
|
-
const startRun = (0,
|
|
2618
|
+
const startRun = (0, import_react14.useCallback)(async (input, { focusConsole = false } = {}) => {
|
|
2449
2619
|
const payload = { provider, ...input };
|
|
2450
2620
|
if (runs.active) {
|
|
2451
2621
|
notify("info", t("commandRunning"));
|
|
@@ -2475,7 +2645,7 @@ function DockerPage(props) {
|
|
|
2475
2645
|
return null;
|
|
2476
2646
|
}
|
|
2477
2647
|
}, [actions, confirmThen, notify, provider, runs, t]);
|
|
2478
|
-
const runRuntime = (0,
|
|
2648
|
+
const runRuntime = (0, import_react14.useCallback)(async (action) => {
|
|
2479
2649
|
const execute = async (confirmed) => {
|
|
2480
2650
|
if (runs.active) {
|
|
2481
2651
|
notify("info", t("commandRunning"));
|
|
@@ -2513,7 +2683,7 @@ function DockerPage(props) {
|
|
|
2513
2683
|
};
|
|
2514
2684
|
await execute(false);
|
|
2515
2685
|
}, [confirmThen, notify, provider, refreshAll, runs, selectedContext, t]);
|
|
2516
|
-
const openInspect = (0,
|
|
2686
|
+
const openInspect = (0, import_react14.useCallback)(async (kind, id) => {
|
|
2517
2687
|
setInspect({ open: true, loading: true, kind, id, value: null, raw: "", error: null });
|
|
2518
2688
|
try {
|
|
2519
2689
|
const value = await api.call("inspect", { provider, kind, id, context: selectedContext ?? void 0 });
|
|
@@ -2522,7 +2692,7 @@ function DockerPage(props) {
|
|
|
2522
2692
|
setInspect({ open: true, loading: false, kind, id, value: null, raw: "", error });
|
|
2523
2693
|
}
|
|
2524
2694
|
}, [api, provider, selectedContext]);
|
|
2525
|
-
const closeAttach = (0,
|
|
2695
|
+
const closeAttach = (0, import_react14.useCallback)(() => {
|
|
2526
2696
|
attachRequest.current += 1;
|
|
2527
2697
|
const session = attachRef.current;
|
|
2528
2698
|
attachRef.current = null;
|
|
@@ -2530,7 +2700,7 @@ function DockerPage(props) {
|
|
|
2530
2700
|
if (session !== null && session?.id !== void 0) api.call("attachClose", { attachId: session.id }).catch(() => {
|
|
2531
2701
|
});
|
|
2532
2702
|
}, [api]);
|
|
2533
|
-
const openAttach = (0,
|
|
2703
|
+
const openAttach = (0, import_react14.useCallback)(async (container, mode = "attach") => {
|
|
2534
2704
|
if (container?.state !== "running") {
|
|
2535
2705
|
notify("info", t("attachNotRunning"));
|
|
2536
2706
|
return;
|
|
@@ -2565,7 +2735,7 @@ function DockerPage(props) {
|
|
|
2565
2735
|
setAttach({ open: true, loading: false, mode, session: null, output: "", error });
|
|
2566
2736
|
}
|
|
2567
2737
|
}, [api, notify, provider, selectedContext, t]);
|
|
2568
|
-
const attachInput = (0,
|
|
2738
|
+
const attachInput = (0, import_react14.useCallback)(async (data) => {
|
|
2569
2739
|
const session = attachRef.current;
|
|
2570
2740
|
if (session === null || session.status !== "running") return;
|
|
2571
2741
|
try {
|
|
@@ -2574,7 +2744,7 @@ function DockerPage(props) {
|
|
|
2574
2744
|
setAttach((current) => ({ ...current, error }));
|
|
2575
2745
|
}
|
|
2576
2746
|
}, [api]);
|
|
2577
|
-
(0,
|
|
2747
|
+
(0, import_react14.useEffect)(() => {
|
|
2578
2748
|
if (!attach.open || attach.session === null || attach.session.status !== "running") return void 0;
|
|
2579
2749
|
const attachId = attach.session.id;
|
|
2580
2750
|
let cancelled = false;
|
|
@@ -2608,12 +2778,12 @@ function DockerPage(props) {
|
|
|
2608
2778
|
clearTimeout(timer);
|
|
2609
2779
|
};
|
|
2610
2780
|
}, [api, attach.open, attach.session?.id]);
|
|
2611
|
-
(0,
|
|
2781
|
+
(0, import_react14.useEffect)(() => () => {
|
|
2612
2782
|
const session = attachRef.current;
|
|
2613
2783
|
if (session !== null) api.call("attachClose", { attachId: session.id }).catch(() => {
|
|
2614
2784
|
});
|
|
2615
2785
|
}, [api]);
|
|
2616
|
-
const askAI = (0,
|
|
2786
|
+
const askAI = (0, import_react14.useCallback)(async (item, mode = "ask") => {
|
|
2617
2787
|
if (!canAskAI) {
|
|
2618
2788
|
notify("error", t("askAiUnavailable"));
|
|
2619
2789
|
return;
|
|
@@ -2638,13 +2808,13 @@ function DockerPage(props) {
|
|
|
2638
2808
|
notify("error", errorMessage(error));
|
|
2639
2809
|
}
|
|
2640
2810
|
}, [canAskAI, notify, provider, selectedContext, startDiagnosis, t]);
|
|
2641
|
-
const openRun = (0,
|
|
2642
|
-
const closeRun = (0,
|
|
2643
|
-
const scheduleListRefresh = (0,
|
|
2811
|
+
const openRun = (0, import_react14.useCallback)((image = "") => setRunDialog({ open: true, image }), []);
|
|
2812
|
+
const closeRun = (0, import_react14.useCallback)(() => setRunDialog({ open: false, image: "" }), []);
|
|
2813
|
+
const scheduleListRefresh = (0, import_react14.useCallback)(() => {
|
|
2644
2814
|
window.setTimeout(() => refreshAll(), 900);
|
|
2645
2815
|
window.setTimeout(() => refreshAll(), 2600);
|
|
2646
2816
|
}, [refreshAll]);
|
|
2647
|
-
const runAction = (0,
|
|
2817
|
+
const runAction = (0, import_react14.useCallback)(async (input, { focusConsole = false } = {}) => {
|
|
2648
2818
|
if (runs.active) {
|
|
2649
2819
|
notify("info", t("commandRunning"));
|
|
2650
2820
|
return null;
|
|
@@ -2677,7 +2847,7 @@ function DockerPage(props) {
|
|
|
2677
2847
|
return null;
|
|
2678
2848
|
}
|
|
2679
2849
|
}, [actions, confirmThen, notify, provider, runs, scheduleListRefresh, t]);
|
|
2680
|
-
const openTab = (0,
|
|
2850
|
+
const openTab = (0, import_react14.useCallback)((next) => actions.setTab(next), [actions]);
|
|
2681
2851
|
const tabProps = {
|
|
2682
2852
|
t,
|
|
2683
2853
|
api,
|
|
@@ -2715,21 +2885,21 @@ function DockerPage(props) {
|
|
|
2715
2885
|
networks: void 0,
|
|
2716
2886
|
compose: void 0
|
|
2717
2887
|
};
|
|
2718
|
-
return /* @__PURE__ */ (0,
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2720
|
-
/* @__PURE__ */ (0,
|
|
2721
|
-
/* @__PURE__ */ (0,
|
|
2722
|
-
/* @__PURE__ */ (0,
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LocaleContext.Provider, { value: t, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-page", "data-dsh-docker-page": "true", "data-docker-provider": provider, "data-docker-daemon": status?.daemon?.state ?? "unknown", children: [
|
|
2889
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: "dsh-docker-header", children: [
|
|
2890
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-brand", children: [
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-mark", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DockerMark, { size: 23 }) }),
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-heading", children: [
|
|
2893
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h1", { className: "dsh-docker-title", children: t("title") }),
|
|
2894
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsh-docker-subtitle", children: t("subtitle") })
|
|
2725
2895
|
] })
|
|
2726
2896
|
] }),
|
|
2727
|
-
/* @__PURE__ */ (0,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2729
|
-
/* @__PURE__ */ (0,
|
|
2897
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-header-actions", children: [
|
|
2898
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsh-docker-status", "data-state": startingAt === null ? pill.state : "starting", title: status?.runtime?.label, children: [
|
|
2899
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-dot" }),
|
|
2730
2900
|
startingAt === null ? pill.label : runtimeBusy === "stop" ? t("stopping") : t("statusStarting")
|
|
2731
2901
|
] }),
|
|
2732
|
-
providerOptions.length > 0 && /* @__PURE__ */ (0,
|
|
2902
|
+
providerOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-seg dsh-docker-provider-switch", role: "group", "aria-label": t("providerLabel"), children: providerOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2733
2903
|
"button",
|
|
2734
2904
|
{
|
|
2735
2905
|
type: "button",
|
|
@@ -2749,7 +2919,7 @@ function DockerPage(props) {
|
|
|
2749
2919
|
},
|
|
2750
2920
|
item.id
|
|
2751
2921
|
)) }),
|
|
2752
|
-
contexts.length > 0 && /* @__PURE__ */ (0,
|
|
2922
|
+
contexts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2753
2923
|
"select",
|
|
2754
2924
|
{
|
|
2755
2925
|
className: "dsh-docker-select",
|
|
@@ -2757,16 +2927,16 @@ function DockerPage(props) {
|
|
|
2757
2927
|
onChange: (event) => actions.setContext(event.target.value === "" ? null : event.target.value),
|
|
2758
2928
|
"aria-label": t("contextLabel"),
|
|
2759
2929
|
title: status?.context?.endpoint ?? "",
|
|
2760
|
-
children: contexts.map((item) => /* @__PURE__ */ (0,
|
|
2930
|
+
children: contexts.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: item.name, children: [
|
|
2761
2931
|
item.name,
|
|
2762
2932
|
item.current ? ` \xB7 ${t("currentSuffix")}` : ""
|
|
2763
2933
|
] }, item.name))
|
|
2764
2934
|
}
|
|
2765
2935
|
),
|
|
2766
|
-
/* @__PURE__ */ (0,
|
|
2936
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { label: t("refresh"), onClick: refreshAll, disabled: statusState.loading, children: statusState.loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Spinner, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconRefresh, { size: 16 }) })
|
|
2767
2937
|
] })
|
|
2768
2938
|
] }),
|
|
2769
|
-
/* @__PURE__ */ (0,
|
|
2939
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2770
2940
|
DockerBanner,
|
|
2771
2941
|
{
|
|
2772
2942
|
t,
|
|
@@ -2779,7 +2949,7 @@ function DockerPage(props) {
|
|
|
2779
2949
|
onRetry: refreshAll
|
|
2780
2950
|
}
|
|
2781
2951
|
),
|
|
2782
|
-
/* @__PURE__ */ (0,
|
|
2952
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { className: "dsh-docker-tabs", role: "tablist", "aria-label": t("title"), children: TABS.filter(([id]) => id !== "compose" || provider === "docker").map(([id, labelKey]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2783
2953
|
"button",
|
|
2784
2954
|
{
|
|
2785
2955
|
type: "button",
|
|
@@ -2789,12 +2959,12 @@ function DockerPage(props) {
|
|
|
2789
2959
|
onClick: () => actions.setTab(id),
|
|
2790
2960
|
children: [
|
|
2791
2961
|
t(labelKey),
|
|
2792
|
-
tabCount(id, status, counts) !== void 0 && /* @__PURE__ */ (0,
|
|
2962
|
+
tabCount(id, status, counts) !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-tab-count", children: tabCount(id, status, counts) })
|
|
2793
2963
|
]
|
|
2794
2964
|
},
|
|
2795
2965
|
id
|
|
2796
2966
|
)) }),
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DockerErrorBoundary, { t, children: statusState.loading && status === null ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-body", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoadingSkeleton, { rows: 6 }) }) : statusState.error !== null && status === null ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-body", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2798
2968
|
ErrorState,
|
|
2799
2969
|
{
|
|
2800
2970
|
title: t("statusFailed"),
|
|
@@ -2803,16 +2973,16 @@ ${t("statusErrorHint")}`,
|
|
|
2803
2973
|
retryLabel: t("retry"),
|
|
2804
2974
|
onRetry: refreshAll
|
|
2805
2975
|
}
|
|
2806
|
-
) }) : /* @__PURE__ */ (0,
|
|
2807
|
-
tab === "overview" && /* @__PURE__ */ (0,
|
|
2808
|
-
tab === "containers" && /* @__PURE__ */ (0,
|
|
2809
|
-
tab === "images" && /* @__PURE__ */ (0,
|
|
2810
|
-
tab === "volumes" && /* @__PURE__ */ (0,
|
|
2811
|
-
tab === "networks" && /* @__PURE__ */ (0,
|
|
2812
|
-
tab === "compose" && provider === "docker" && /* @__PURE__ */ (0,
|
|
2813
|
-
tab === "console" && /* @__PURE__ */ (0,
|
|
2976
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cx("dsh-docker-body", tab === "console" && "dsh-docker-body-fill"), children: [
|
|
2977
|
+
tab === "overview" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OverviewTab, { ...tabProps }),
|
|
2978
|
+
tab === "containers" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ContainersTab, { ...tabProps }),
|
|
2979
|
+
tab === "images" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ImagesTab, { ...tabProps }),
|
|
2980
|
+
tab === "volumes" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(VolumesTab, { ...tabProps }),
|
|
2981
|
+
tab === "networks" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NetworksTab, { ...tabProps }),
|
|
2982
|
+
tab === "compose" && provider === "docker" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ComposeTab, { ...tabProps }),
|
|
2983
|
+
tab === "console" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ConsoleTab, { ...tabProps })
|
|
2814
2984
|
] }) }),
|
|
2815
|
-
/* @__PURE__ */ (0,
|
|
2985
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2816
2986
|
Modal,
|
|
2817
2987
|
{
|
|
2818
2988
|
open: inspect.open,
|
|
@@ -2821,14 +2991,14 @@ ${t("statusErrorHint")}`,
|
|
|
2821
2991
|
wide: true,
|
|
2822
2992
|
onClose: () => setInspect((current) => ({ ...current, open: false })),
|
|
2823
2993
|
closeLabel: t("close"),
|
|
2824
|
-
footer: /* @__PURE__ */ (0,
|
|
2825
|
-
/* @__PURE__ */ (0,
|
|
2826
|
-
/* @__PURE__ */ (0,
|
|
2994
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
2995
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CopyButton, { text: inspect.raw, label: t("copy"), copiedLabel: t("copied") }),
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { variant: "primary", onClick: () => setInspect((current) => ({ ...current, open: false })), children: t("close") })
|
|
2827
2997
|
] }),
|
|
2828
|
-
children: inspect.loading ? /* @__PURE__ */ (0,
|
|
2998
|
+
children: inspect.loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoadingSkeleton, { rows: 5 }) : inspect.error !== null ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ErrorState, { title: t("errorTitle"), text: errorMessage(inspect.error), retryLabel: t("retry") }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("pre", { className: "dsh-docker-json", children: inspect.value === null ? inspect.raw : JSON.stringify(inspect.value, null, 2) })
|
|
2829
2999
|
}
|
|
2830
3000
|
),
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
3001
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2832
3002
|
RunContainerDialog,
|
|
2833
3003
|
{
|
|
2834
3004
|
open: runDialog.open,
|
|
@@ -2846,7 +3016,7 @@ ${t("statusErrorHint")}`,
|
|
|
2846
3016
|
}
|
|
2847
3017
|
}
|
|
2848
3018
|
),
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2850
3020
|
AttachDialog,
|
|
2851
3021
|
{
|
|
2852
3022
|
open: attach.open,
|
|
@@ -2860,7 +3030,7 @@ ${t("statusErrorHint")}`,
|
|
|
2860
3030
|
onClose: closeAttach
|
|
2861
3031
|
}
|
|
2862
3032
|
),
|
|
2863
|
-
/* @__PURE__ */ (0,
|
|
3033
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2864
3034
|
ConfirmDialog,
|
|
2865
3035
|
{
|
|
2866
3036
|
open: confirm !== null,
|
|
@@ -2876,7 +3046,7 @@ ${t("statusErrorHint")}`,
|
|
|
2876
3046
|
onCancel: () => setConfirm(null)
|
|
2877
3047
|
}
|
|
2878
3048
|
),
|
|
2879
|
-
/* @__PURE__ */ (0,
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToastStack, { toasts, onDismiss: (id) => setToasts((current) => current.filter((toast) => toast.id !== id)) })
|
|
2880
3050
|
] }) });
|
|
2881
3051
|
}
|
|
2882
3052
|
function DockerBanner({ t, provider, status, statusError, startingAt, runtimeBusy, onRuntime, onRetry }) {
|
|
@@ -2886,11 +3056,11 @@ function DockerBanner({ t, provider, status, statusError, startingAt, runtimeBus
|
|
|
2886
3056
|
const daemonStopped = status.daemon?.state === "stopped" || status.daemon?.state === "unreachable";
|
|
2887
3057
|
const cliMissing = status.cli?.installed === false;
|
|
2888
3058
|
if (startingAt !== null) {
|
|
2889
|
-
return /* @__PURE__ */ (0,
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
2891
|
-
/* @__PURE__ */ (0,
|
|
2892
|
-
/* @__PURE__ */ (0,
|
|
2893
|
-
/* @__PURE__ */ (0,
|
|
3059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner", "data-tone": "info", children: [
|
|
3060
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-banner-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconSpinner, { size: 15 }) }),
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner-main", children: [
|
|
3062
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-title", children: runtimeBusy === "stop" ? t("stopping") : t("starting") }),
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner-text", children: [
|
|
2894
3064
|
runtime?.label ?? "Docker",
|
|
2895
3065
|
provider === "docker" ? ` \xB7 ${status.context?.endpoint ?? ""}` : ` \xB7 ${status.runtime?.details?.status ?? ""}`
|
|
2896
3066
|
] })
|
|
@@ -2898,34 +3068,34 @@ function DockerBanner({ t, provider, status, statusError, startingAt, runtimeBus
|
|
|
2898
3068
|
] });
|
|
2899
3069
|
}
|
|
2900
3070
|
if (cliMissing) {
|
|
2901
|
-
return /* @__PURE__ */ (0,
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
2903
|
-
/* @__PURE__ */ (0,
|
|
2904
|
-
/* @__PURE__ */ (0,
|
|
2905
|
-
/* @__PURE__ */ (0,
|
|
3071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner", "data-tone": "error", children: [
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-banner-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconAlert, { size: 16 }) }),
|
|
3073
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner-main", children: [
|
|
3074
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-title", children: provider === "apple-container" ? t("appleCliMissing") : t("cliMissing") }),
|
|
3075
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-text", children: status.cli.error ?? t("cliMissingBody") })
|
|
2906
3076
|
] }),
|
|
2907
|
-
/* @__PURE__ */ (0,
|
|
3077
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-actions", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { size: "sm", onClick: onRetry, children: t("retry") }) })
|
|
2908
3078
|
] });
|
|
2909
3079
|
}
|
|
2910
3080
|
if (daemonStopped) {
|
|
2911
|
-
return /* @__PURE__ */ (0,
|
|
2912
|
-
/* @__PURE__ */ (0,
|
|
2913
|
-
/* @__PURE__ */ (0,
|
|
2914
|
-
/* @__PURE__ */ (0,
|
|
2915
|
-
/* @__PURE__ */ (0,
|
|
3081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner", "data-tone": "warn", children: [
|
|
3082
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-banner-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconAlert, { size: 16 }) }),
|
|
3083
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner-main", children: [
|
|
3084
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-title", children: provider === "apple-container" ? t("appleSystemStopped") : t("daemonStopped") }),
|
|
3085
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-text", children: status.daemon?.error ?? (provider === "apple-container" ? t("appleSystemStoppedBody") : t("daemonStoppedBody")) })
|
|
2916
3086
|
] }),
|
|
2917
|
-
/* @__PURE__ */ (0,
|
|
2918
|
-
runtime?.canStart === true && /* @__PURE__ */ (0,
|
|
2919
|
-
/* @__PURE__ */ (0,
|
|
3087
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner-actions", children: [
|
|
3088
|
+
runtime?.canStart === true && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { size: "sm", variant: "primary", onClick: () => onRuntime("start"), children: t("runtimeStart") }),
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { size: "sm", onClick: onRetry, children: t("refresh") })
|
|
2920
3090
|
] })
|
|
2921
3091
|
] });
|
|
2922
3092
|
}
|
|
2923
3093
|
if (runtime?.kind === "remote") {
|
|
2924
|
-
return /* @__PURE__ */ (0,
|
|
2925
|
-
/* @__PURE__ */ (0,
|
|
2926
|
-
/* @__PURE__ */ (0,
|
|
2927
|
-
/* @__PURE__ */ (0,
|
|
2928
|
-
/* @__PURE__ */ (0,
|
|
3094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner", "data-tone": "info", children: [
|
|
3095
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-banner-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconInfo, { size: 16 }) }),
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner-main", children: [
|
|
3097
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-title", children: t("remote") }),
|
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner-text", children: [
|
|
2929
3099
|
t("remoteHint"),
|
|
2930
3100
|
" \xB7 ",
|
|
2931
3101
|
status.context?.endpoint ?? ""
|
|
@@ -2934,20 +3104,20 @@ function DockerBanner({ t, provider, status, statusError, startingAt, runtimeBus
|
|
|
2934
3104
|
] });
|
|
2935
3105
|
}
|
|
2936
3106
|
if (statusError !== null) {
|
|
2937
|
-
return /* @__PURE__ */ (0,
|
|
2938
|
-
/* @__PURE__ */ (0,
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2940
|
-
/* @__PURE__ */ (0,
|
|
2941
|
-
/* @__PURE__ */ (0,
|
|
3107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner", "data-tone": "error", children: [
|
|
3108
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-banner-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconAlert, { size: 16 }) }),
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner-main", children: [
|
|
3110
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-title", children: t("refreshFailed") }),
|
|
3111
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-text", children: errorMessage(statusError) })
|
|
2942
3112
|
] }),
|
|
2943
|
-
/* @__PURE__ */ (0,
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-actions", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { size: "sm", onClick: onRetry, children: t("retry") }) })
|
|
2944
3114
|
] });
|
|
2945
3115
|
}
|
|
2946
3116
|
if (status.warnings?.length > 0) {
|
|
2947
|
-
return /* @__PURE__ */ (0,
|
|
2948
|
-
/* @__PURE__ */ (0,
|
|
2949
|
-
/* @__PURE__ */ (0,
|
|
2950
|
-
/* @__PURE__ */ (0,
|
|
3117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-docker-banner", "data-tone": "info", children: [
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-docker-banner-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconInfo, { size: 16 }) }),
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-main", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-text", children: status.warnings.join(" \xB7 ") }) }),
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-docker-banner-actions", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsh-docker-muted", children: [
|
|
2951
3121
|
t("lastUpdated"),
|
|
2952
3122
|
" ",
|
|
2953
3123
|
formatTime(status.fetchedAt)
|
|
@@ -3344,6 +3514,7 @@ var CSS = `
|
|
|
3344
3514
|
.dsh-docker-field > span { font-size: 11.5px; color: var(--dsw-alias-label-secondary, #60636c); }
|
|
3345
3515
|
.dsh-docker-textarea { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; font-family: var(--dsw-font-markdown-code-font-family, ui-monospace, Menlo, monospace); line-height: 1.5; }
|
|
3346
3516
|
.dsh-docker-form-error { color: var(--dsw-alias-label-error, #d33c3c); font-size: 12px; }
|
|
3517
|
+
.dsh-docker-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dsw-alias-label-secondary, #60636c); }
|
|
3347
3518
|
|
|
3348
3519
|
|
|
3349
3520
|
.dsh-docker-table-wrap { overflow: auto; border-radius: 0 0 11px 11px; }
|
|
@@ -3494,7 +3665,7 @@ function injectStyles() {
|
|
|
3494
3665
|
}
|
|
3495
3666
|
|
|
3496
3667
|
// src/client/index.jsx
|
|
3497
|
-
var
|
|
3668
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3498
3669
|
injectStyles();
|
|
3499
3670
|
var inject = ["slots", "layout", "locale", "connection", "sessions"];
|
|
3500
3671
|
function apply(ctx) {
|
|
@@ -3552,7 +3723,7 @@ function apply(ctx) {
|
|
|
3552
3723
|
);
|
|
3553
3724
|
}
|
|
3554
3725
|
function DockerIcon({ size = 18 }) {
|
|
3555
|
-
return /* @__PURE__ */ (0,
|
|
3726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DockerMark, { size });
|
|
3556
3727
|
}
|
|
3557
3728
|
|
|
3558
3729
|
return module.exports;
|