@exagone313/dsh-podman 1.0.4 → 1.1.1
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 +1 -0
- package/README.zh.md +1 -0
- package/dist/approval-reasons.d.ts +12 -0
- package/dist/approval-reasons.js +15 -0
- package/dist/approval.js +21 -0
- package/dist/card-route.js +83 -1
- package/dist/client/ContainerCard.js +14 -2
- package/dist/client/card-protocol.d.ts +16 -1
- package/dist/client/container-card-controller.d.ts +8 -2
- package/dist/client/container-card-controller.js +21 -0
- package/dist/client/container-card-ports.d.ts +13 -0
- package/dist/client/container-card-ports.js +74 -0
- package/dist/client/container-card-row.d.ts +3 -0
- package/dist/client/container-card-row.js +12 -2
- package/dist/client/container-card-workspace.d.ts +3 -0
- package/dist/client/container-card-workspace.js +2 -2
- package/dist/client/index.js +653 -386
- package/dist/client/locales.d.ts +1 -1
- package/dist/client/locales.js +30 -0
- package/dist/client/tool-presentations.d.ts +167 -0
- package/dist/client/tool-presentations.js +167 -0
- package/dist/client/tool-views.d.ts +1 -2
- package/dist/client/tool-views.js +54 -190
- package/dist/generated/version.d.ts +2 -2
- package/dist/generated/version.js +2 -2
- package/dist/grpc/proto/dshctl/v1/control.proto +47 -1
- package/dist/grpc/proto/dshgateway/v1/gateway.proto +89 -0
- package/dist/grpc/proto/dshguest/v1/guest.proto +17 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/public.d.ts +1 -0
- package/dist/public.js +14 -0
- package/dist/publish-port.d.ts +6 -0
- package/dist/publish-port.js +37 -0
- package/dist/tool-defs.js +15 -1
- package/dist/tool-handlers.js +31 -1
- package/dist/tool-params.d.ts +48 -0
- package/dist/tool-params.js +42 -0
- package/docs/architecture.md +44 -7
- package/docs/architecture.zh.md +38 -6
- package/docs/configuration.md +25 -0
- package/docs/configuration.zh.md +23 -0
- package/docs/development.md +9 -2
- package/docs/development.zh.md +9 -2
- package/docs/install-dsh-and-dsh-podman.md +10 -4
- package/docs/install-dsh-and-dsh-podman.zh.md +9 -3
- package/docs/uninstall.md +4 -3
- package/docs/uninstall.zh.md +3 -2
- package/docs/update.md +23 -6
- package/docs/update.zh.md +23 -6
- package/docs/usage.md +48 -13
- package/docs/usage.zh.md +31 -2
- package/package.json +1 -1
- package/quadlet/dsh-podman-gateway.container +23 -0
- package/quadlet/dsh-podman-orchestrator.container +1 -1
- package/quadlet/dsh.container +1 -1
package/dist/client/index.js
CHANGED
|
@@ -29,7 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
name: () => name
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(index_exports);
|
|
32
|
-
var
|
|
32
|
+
var import_dsh_client_ui_primitives18 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
33
33
|
|
|
34
34
|
// src/client/directory-picker.ts
|
|
35
35
|
var DirectoryPickerError = class extends Error {
|
|
@@ -2514,14 +2514,145 @@ function PathsEditor(props) {
|
|
|
2514
2514
|
] });
|
|
2515
2515
|
}
|
|
2516
2516
|
|
|
2517
|
-
// src/client/container-card-
|
|
2518
|
-
var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
2519
|
-
var import_react10 = require("react");
|
|
2520
|
-
|
|
2521
|
-
// src/client/container-card-create-modal.tsx
|
|
2517
|
+
// src/client/container-card-ports.tsx
|
|
2522
2518
|
var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
2523
2519
|
var import_react9 = require("react");
|
|
2524
2520
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2521
|
+
var MIN_PORT = 1;
|
|
2522
|
+
var MAX_PORT = 65535;
|
|
2523
|
+
var MIN_HOST_PORT = 1024;
|
|
2524
|
+
var MAX_HOST_PORT = 65535;
|
|
2525
|
+
function parsePort(value) {
|
|
2526
|
+
if (!/^[0-9]+$/.test(value)) return void 0;
|
|
2527
|
+
const port = Number(value);
|
|
2528
|
+
return port >= MIN_PORT && port <= MAX_PORT ? port : void 0;
|
|
2529
|
+
}
|
|
2530
|
+
function parseHostPort(value) {
|
|
2531
|
+
if (!/^[0-9]+$/.test(value)) return void 0;
|
|
2532
|
+
const port = Number(value);
|
|
2533
|
+
return port >= MIN_HOST_PORT && port <= MAX_HOST_PORT ? port : void 0;
|
|
2534
|
+
}
|
|
2535
|
+
function PortsEditor(props) {
|
|
2536
|
+
const {
|
|
2537
|
+
t,
|
|
2538
|
+
ports,
|
|
2539
|
+
enabled,
|
|
2540
|
+
canPublish,
|
|
2541
|
+
gatewayUnavailable,
|
|
2542
|
+
onPublish,
|
|
2543
|
+
onUnpublish
|
|
2544
|
+
} = props;
|
|
2545
|
+
const [port, setPort] = (0, import_react9.useState)("");
|
|
2546
|
+
const [hostPort, setHostPort] = (0, import_react9.useState)("");
|
|
2547
|
+
const podPort = parsePort(port);
|
|
2548
|
+
const suggested = hostPort === "" ? void 0 : parseHostPort(hostPort);
|
|
2549
|
+
const hostPortInvalid = hostPort !== "" && suggested === void 0;
|
|
2550
|
+
const submit = () => {
|
|
2551
|
+
if (podPort === void 0 || !canPublish || hostPortInvalid) return;
|
|
2552
|
+
onPublish(podPort, suggested);
|
|
2553
|
+
setPort("");
|
|
2554
|
+
setHostPort("");
|
|
2555
|
+
};
|
|
2556
|
+
const rowStyle = {
|
|
2557
|
+
display: "flex",
|
|
2558
|
+
flexWrap: "wrap",
|
|
2559
|
+
alignItems: "center",
|
|
2560
|
+
gap: "8px"
|
|
2561
|
+
};
|
|
2562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2563
|
+
ports.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { style: hint, children: t("none") }) : ports.map((published) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2564
|
+
"div",
|
|
2565
|
+
{
|
|
2566
|
+
style: rowStyle,
|
|
2567
|
+
children: [
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2569
|
+
"code",
|
|
2570
|
+
{
|
|
2571
|
+
style: {
|
|
2572
|
+
...greyId,
|
|
2573
|
+
flex: 1,
|
|
2574
|
+
fontSize: "13px",
|
|
2575
|
+
color: "var(--dsw-alias-label-primary)"
|
|
2576
|
+
},
|
|
2577
|
+
children: published.endpoint
|
|
2578
|
+
}
|
|
2579
|
+
),
|
|
2580
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2581
|
+
ConfirmButton,
|
|
2582
|
+
{
|
|
2583
|
+
t,
|
|
2584
|
+
label: t("unpublishPort"),
|
|
2585
|
+
title: t("confirmTitle"),
|
|
2586
|
+
description: t("confirmUnpublishPort", {
|
|
2587
|
+
port: String(published.port),
|
|
2588
|
+
protocol: published.protocol
|
|
2589
|
+
}),
|
|
2590
|
+
disabled: !enabled,
|
|
2591
|
+
onConfirm: () => onUnpublish(published.port, published.protocol)
|
|
2592
|
+
}
|
|
2593
|
+
)
|
|
2594
|
+
]
|
|
2595
|
+
},
|
|
2596
|
+
`${published.protocol}/${published.port}`
|
|
2597
|
+
)),
|
|
2598
|
+
canPublish || !enabled ? null : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { style: { ...hint, paddingTop: "8px" }, children: gatewayUnavailable ? t("publishNeedsGateway") : t("containerNotRunning") }),
|
|
2599
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { ...rowStyle, paddingTop: "8px" }, children: [
|
|
2600
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2601
|
+
import_dsh_client_ui_primitives9.Input,
|
|
2602
|
+
{
|
|
2603
|
+
type: "number",
|
|
2604
|
+
min: MIN_PORT,
|
|
2605
|
+
max: MAX_PORT,
|
|
2606
|
+
value: port,
|
|
2607
|
+
disabled: !canPublish,
|
|
2608
|
+
placeholder: t("podPort"),
|
|
2609
|
+
onChange: (event) => setPort(event.target.value),
|
|
2610
|
+
onKeyDown: (event) => {
|
|
2611
|
+
if (event.key === "Enter") submit();
|
|
2612
|
+
},
|
|
2613
|
+
style: { width: "140px" }
|
|
2614
|
+
}
|
|
2615
|
+
),
|
|
2616
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2617
|
+
import_dsh_client_ui_primitives9.Input,
|
|
2618
|
+
{
|
|
2619
|
+
type: "number",
|
|
2620
|
+
min: MIN_HOST_PORT,
|
|
2621
|
+
max: MAX_HOST_PORT,
|
|
2622
|
+
value: hostPort,
|
|
2623
|
+
disabled: !canPublish,
|
|
2624
|
+
placeholder: t("hostPortOptional"),
|
|
2625
|
+
onChange: (event) => setHostPort(event.target.value),
|
|
2626
|
+
onKeyDown: (event) => {
|
|
2627
|
+
if (event.key === "Enter") submit();
|
|
2628
|
+
},
|
|
2629
|
+
style: { width: "200px" }
|
|
2630
|
+
}
|
|
2631
|
+
),
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2633
|
+
import_dsh_client_ui_primitives9.Button,
|
|
2634
|
+
{
|
|
2635
|
+
variant: "outline",
|
|
2636
|
+
size: "sm",
|
|
2637
|
+
disabled: !canPublish || podPort === void 0 || hostPortInvalid,
|
|
2638
|
+
onClick: submit,
|
|
2639
|
+
children: t("publishPort")
|
|
2640
|
+
}
|
|
2641
|
+
)
|
|
2642
|
+
] }),
|
|
2643
|
+
port !== "" && podPort === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { style: { ...hint, margin: 0 }, children: t("invalidPort") }) : null,
|
|
2644
|
+
hostPortInvalid ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { style: { ...hint, margin: 0 }, children: t("invalidHostPort") }) : null
|
|
2645
|
+
] });
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
// src/client/container-card-row.tsx
|
|
2649
|
+
var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
2650
|
+
var import_react11 = require("react");
|
|
2651
|
+
|
|
2652
|
+
// src/client/container-card-create-modal.tsx
|
|
2653
|
+
var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
2654
|
+
var import_react10 = require("react");
|
|
2655
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2525
2656
|
function CreateContainerModal(props) {
|
|
2526
2657
|
const {
|
|
2527
2658
|
t,
|
|
@@ -2539,10 +2670,10 @@ function CreateContainerModal(props) {
|
|
|
2539
2670
|
onClose,
|
|
2540
2671
|
onCreate
|
|
2541
2672
|
} = props;
|
|
2542
|
-
const [image, setImage] = (0,
|
|
2543
|
-
const [name2, setName] = (0,
|
|
2544
|
-
const [env, setEnv] = (0,
|
|
2545
|
-
const [mounts, setMounts] = (0,
|
|
2673
|
+
const [image, setImage] = (0, import_react10.useState)(workspace.imageId || defaultImage);
|
|
2674
|
+
const [name2, setName] = (0, import_react10.useState)("");
|
|
2675
|
+
const [env, setEnv] = (0, import_react10.useState)({});
|
|
2676
|
+
const [mounts, setMounts] = (0, import_react10.useState)(() => [
|
|
2546
2677
|
{
|
|
2547
2678
|
kind: "project",
|
|
2548
2679
|
project: workspace.projectName,
|
|
@@ -2552,14 +2683,14 @@ function CreateContainerModal(props) {
|
|
|
2552
2683
|
secret: ""
|
|
2553
2684
|
}
|
|
2554
2685
|
]);
|
|
2555
|
-
const [secretEnv, setSecretEnv] = (0,
|
|
2556
|
-
const [paths, setPaths] = (0,
|
|
2557
|
-
const [attachSecret, setAttachSecret] = (0,
|
|
2558
|
-
const [attachVar, setAttachVar] = (0,
|
|
2559
|
-
const [submitting, setSubmitting] = (0,
|
|
2560
|
-
const imageLabel = (0,
|
|
2561
|
-
const nameLabel = (0,
|
|
2562
|
-
(0,
|
|
2686
|
+
const [secretEnv, setSecretEnv] = (0, import_react10.useState)({});
|
|
2687
|
+
const [paths, setPaths] = (0, import_react10.useState)([]);
|
|
2688
|
+
const [attachSecret, setAttachSecret] = (0, import_react10.useState)("");
|
|
2689
|
+
const [attachVar, setAttachVar] = (0, import_react10.useState)("");
|
|
2690
|
+
const [submitting, setSubmitting] = (0, import_react10.useState)(false);
|
|
2691
|
+
const imageLabel = (0, import_react10.useId)();
|
|
2692
|
+
const nameLabel = (0, import_react10.useId)();
|
|
2693
|
+
(0, import_react10.useEffect)(() => {
|
|
2563
2694
|
if (!open) return;
|
|
2564
2695
|
setImage(workspace.imageId || defaultImage);
|
|
2565
2696
|
setName("");
|
|
@@ -2606,16 +2737,16 @@ function CreateContainerModal(props) {
|
|
|
2606
2737
|
setSecretEnv({ ...secretEnv, [envVar]: attachSecret });
|
|
2607
2738
|
setAttachVar("");
|
|
2608
2739
|
};
|
|
2609
|
-
return /* @__PURE__ */ (0,
|
|
2610
|
-
|
|
2740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2741
|
+
import_dsh_client_ui_primitives10.Modal,
|
|
2611
2742
|
{
|
|
2612
2743
|
open,
|
|
2613
2744
|
onClose,
|
|
2614
2745
|
title: named ? t("addContainer") : t("createContainer"),
|
|
2615
2746
|
closeLabel: t("cancel"),
|
|
2616
|
-
footer: /* @__PURE__ */ (0,
|
|
2617
|
-
/* @__PURE__ */ (0,
|
|
2618
|
-
|
|
2747
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2749
|
+
import_dsh_client_ui_primitives10.Button,
|
|
2619
2750
|
{
|
|
2620
2751
|
variant: "outline",
|
|
2621
2752
|
size: "sm",
|
|
@@ -2623,8 +2754,8 @@ function CreateContainerModal(props) {
|
|
|
2623
2754
|
children: t("cancel")
|
|
2624
2755
|
}
|
|
2625
2756
|
),
|
|
2626
|
-
/* @__PURE__ */ (0,
|
|
2627
|
-
|
|
2757
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2758
|
+
import_dsh_client_ui_primitives10.Button,
|
|
2628
2759
|
{
|
|
2629
2760
|
variant: "primary",
|
|
2630
2761
|
size: "sm",
|
|
@@ -2634,7 +2765,7 @@ function CreateContainerModal(props) {
|
|
|
2634
2765
|
}
|
|
2635
2766
|
)
|
|
2636
2767
|
] }),
|
|
2637
|
-
children: /* @__PURE__ */ (0,
|
|
2768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2638
2769
|
"div",
|
|
2639
2770
|
{
|
|
2640
2771
|
style: {
|
|
@@ -2643,7 +2774,7 @@ function CreateContainerModal(props) {
|
|
|
2643
2774
|
gap: "12px"
|
|
2644
2775
|
},
|
|
2645
2776
|
children: [
|
|
2646
|
-
/* @__PURE__ */ (0,
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Field, { label: t("image"), htmlFor: imageLabel, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2647
2778
|
"select",
|
|
2648
2779
|
{
|
|
2649
2780
|
id: imageLabel,
|
|
@@ -2652,14 +2783,14 @@ function CreateContainerModal(props) {
|
|
|
2652
2783
|
disabled: busy,
|
|
2653
2784
|
onChange: (event) => setImage(event.target.value),
|
|
2654
2785
|
children: [
|
|
2655
|
-
candidates.length === 0 ? /* @__PURE__ */ (0,
|
|
2656
|
-
candidates.map((imageId) => /* @__PURE__ */ (0,
|
|
2786
|
+
candidates.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", children: t("none") }) : null,
|
|
2787
|
+
candidates.map((imageId) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: imageId, children: imageId }, imageId))
|
|
2657
2788
|
]
|
|
2658
2789
|
}
|
|
2659
2790
|
) }),
|
|
2660
|
-
named ? /* @__PURE__ */ (0,
|
|
2661
|
-
/* @__PURE__ */ (0,
|
|
2662
|
-
|
|
2791
|
+
named ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Field, { label: t("containerName"), htmlFor: nameLabel, children: [
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2793
|
+
import_dsh_client_ui_primitives10.Input,
|
|
2663
2794
|
{
|
|
2664
2795
|
id: nameLabel,
|
|
2665
2796
|
value: name2,
|
|
@@ -2667,12 +2798,12 @@ function CreateContainerModal(props) {
|
|
|
2667
2798
|
onChange: (event) => setName(sanitizeName(event.target.value))
|
|
2668
2799
|
}
|
|
2669
2800
|
),
|
|
2670
|
-
name2 !== "" && !validName ? /* @__PURE__ */ (0,
|
|
2801
|
+
name2 !== "" && !validName ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: { ...hint, margin: 0 }, children: nameTaken ? t("containerNameTaken") : t("invalidContainerName") }) : null
|
|
2671
2802
|
] }) : null,
|
|
2672
|
-
/* @__PURE__ */ (0,
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2675
|
-
/* @__PURE__ */ (0,
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: sectionTitle, children: t("envTitle") }),
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(EnvEditor, { t, env, busy, onChange: setEnv }),
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: sectionTitle, children: t("mountsTitle") }),
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2676
2807
|
MountsEditor,
|
|
2677
2808
|
{
|
|
2678
2809
|
t,
|
|
@@ -2691,10 +2822,10 @@ function CreateContainerModal(props) {
|
|
|
2691
2822
|
)
|
|
2692
2823
|
}
|
|
2693
2824
|
),
|
|
2694
|
-
/* @__PURE__ */ (0,
|
|
2695
|
-
/* @__PURE__ */ (0,
|
|
2696
|
-
/* @__PURE__ */ (0,
|
|
2697
|
-
Object.entries(secretEnv).map(([envVar, secretName]) => /* @__PURE__ */ (0,
|
|
2825
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: sectionTitle, children: t("pathsTitle") }),
|
|
2826
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PathsList, { t, entries: paths, busy, onChange: setPaths }),
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: sectionTitle, children: t("containerSecretsTitle") }),
|
|
2828
|
+
Object.entries(secretEnv).map(([envVar, secretName]) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2698
2829
|
"div",
|
|
2699
2830
|
{
|
|
2700
2831
|
style: {
|
|
@@ -2704,7 +2835,7 @@ function CreateContainerModal(props) {
|
|
|
2704
2835
|
gap: "8px"
|
|
2705
2836
|
},
|
|
2706
2837
|
children: [
|
|
2707
|
-
/* @__PURE__ */ (0,
|
|
2838
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2708
2839
|
"code",
|
|
2709
2840
|
{
|
|
2710
2841
|
style: {
|
|
@@ -2720,8 +2851,8 @@ function CreateContainerModal(props) {
|
|
|
2720
2851
|
]
|
|
2721
2852
|
}
|
|
2722
2853
|
),
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
2724
|
-
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2855
|
+
import_dsh_client_ui_primitives10.Button,
|
|
2725
2856
|
{
|
|
2726
2857
|
variant: "outline",
|
|
2727
2858
|
size: "sm",
|
|
@@ -2738,7 +2869,7 @@ function CreateContainerModal(props) {
|
|
|
2738
2869
|
},
|
|
2739
2870
|
envVar
|
|
2740
2871
|
)),
|
|
2741
|
-
/* @__PURE__ */ (0,
|
|
2872
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2742
2873
|
"div",
|
|
2743
2874
|
{
|
|
2744
2875
|
style: {
|
|
@@ -2748,7 +2879,7 @@ function CreateContainerModal(props) {
|
|
|
2748
2879
|
gap: "8px"
|
|
2749
2880
|
},
|
|
2750
2881
|
children: [
|
|
2751
|
-
/* @__PURE__ */ (0,
|
|
2882
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2752
2883
|
"select",
|
|
2753
2884
|
{
|
|
2754
2885
|
style: imageSelect,
|
|
@@ -2757,13 +2888,13 @@ function CreateContainerModal(props) {
|
|
|
2757
2888
|
onChange: (event) => setAttachSecret(event.target.value),
|
|
2758
2889
|
"aria-label": t("attachSecret"),
|
|
2759
2890
|
children: [
|
|
2760
|
-
secrets.length === 0 ? /* @__PURE__ */ (0,
|
|
2761
|
-
secrets.map((secret) => /* @__PURE__ */ (0,
|
|
2891
|
+
secrets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", children: t("none") }) : null,
|
|
2892
|
+
secrets.map((secret) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: secret.name, children: secret.name }, secret.name))
|
|
2762
2893
|
]
|
|
2763
2894
|
}
|
|
2764
2895
|
),
|
|
2765
|
-
/* @__PURE__ */ (0,
|
|
2766
|
-
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2897
|
+
import_dsh_client_ui_primitives10.Input,
|
|
2767
2898
|
{
|
|
2768
2899
|
value: attachVar,
|
|
2769
2900
|
disabled: busy,
|
|
@@ -2775,8 +2906,8 @@ function CreateContainerModal(props) {
|
|
|
2775
2906
|
style: { width: "200px" }
|
|
2776
2907
|
}
|
|
2777
2908
|
),
|
|
2778
|
-
/* @__PURE__ */ (0,
|
|
2779
|
-
|
|
2909
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2910
|
+
import_dsh_client_ui_primitives10.Button,
|
|
2780
2911
|
{
|
|
2781
2912
|
variant: "outline",
|
|
2782
2913
|
size: "sm",
|
|
@@ -2796,7 +2927,7 @@ function CreateContainerModal(props) {
|
|
|
2796
2927
|
}
|
|
2797
2928
|
|
|
2798
2929
|
// src/client/container-card-row.tsx
|
|
2799
|
-
var
|
|
2930
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2800
2931
|
var MOUNT_ROWS = [
|
|
2801
2932
|
{ key: "projects", kind: "project" },
|
|
2802
2933
|
{ key: "volumesTitle", kind: "volume" },
|
|
@@ -2838,26 +2969,31 @@ function ContainerRow(props) {
|
|
|
2838
2969
|
onSetContainerPaths,
|
|
2839
2970
|
onAddContainerSecret,
|
|
2840
2971
|
onRemoveContainerSecret,
|
|
2972
|
+
onPublishContainerPort,
|
|
2973
|
+
onUnpublishContainerPort,
|
|
2974
|
+
gatewayUnavailable,
|
|
2841
2975
|
projectName,
|
|
2842
2976
|
projectsRoot,
|
|
2843
2977
|
directoryPicker
|
|
2844
2978
|
} = props;
|
|
2845
|
-
const [selected, setSelected] = (0,
|
|
2846
|
-
const [env, setEnv] = (0,
|
|
2847
|
-
(0,
|
|
2979
|
+
const [selected, setSelected] = (0, import_react11.useState)(container.imageId);
|
|
2980
|
+
const [env, setEnv] = (0, import_react11.useState)(container.env);
|
|
2981
|
+
(0, import_react11.useEffect)(() => {
|
|
2848
2982
|
setSelected(container.imageId);
|
|
2849
2983
|
}, [container.imageId]);
|
|
2850
2984
|
const serverEnv = JSON.stringify(container.env);
|
|
2851
|
-
(0,
|
|
2985
|
+
(0, import_react11.useEffect)(() => {
|
|
2852
2986
|
setEnv(container.env);
|
|
2853
2987
|
}, [serverEnv]);
|
|
2854
|
-
const [envOpen, setEnvOpen] = (0,
|
|
2855
|
-
const [mountOpen, setMountOpen] = (0,
|
|
2856
|
-
const [pathOpen, setPathOpen] = (0,
|
|
2857
|
-
const [secretOpen, setSecretOpen] = (0,
|
|
2858
|
-
const [
|
|
2859
|
-
const [
|
|
2988
|
+
const [envOpen, setEnvOpen] = (0, import_react11.useState)(false);
|
|
2989
|
+
const [mountOpen, setMountOpen] = (0, import_react11.useState)(false);
|
|
2990
|
+
const [pathOpen, setPathOpen] = (0, import_react11.useState)(false);
|
|
2991
|
+
const [secretOpen, setSecretOpen] = (0, import_react11.useState)(false);
|
|
2992
|
+
const [portOpen, setPortOpen] = (0, import_react11.useState)(false);
|
|
2993
|
+
const [attachSecret, setAttachSecret] = (0, import_react11.useState)("");
|
|
2994
|
+
const [attachVar, setAttachVar] = (0, import_react11.useState)("");
|
|
2860
2995
|
const enabled = container.workspaceSlug !== "" && !busy;
|
|
2996
|
+
const canPublish = enabled && container.status === "running" && !gatewayUnavailable;
|
|
2861
2997
|
const mountRows = mountSummaries(container.mounts);
|
|
2862
2998
|
const envEntries = Object.entries(container.env);
|
|
2863
2999
|
const secretEntries = Object.entries(container.secretEnv);
|
|
@@ -2872,35 +3008,41 @@ function ContainerRow(props) {
|
|
|
2872
3008
|
);
|
|
2873
3009
|
setAttachVar("");
|
|
2874
3010
|
};
|
|
2875
|
-
return /* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2878
|
-
/* @__PURE__ */ (0,
|
|
3011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: containerRow, children: [
|
|
3012
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: containerHeader, children: [
|
|
3013
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { style: { color: "var(--dsw-alias-label-primary)" }, children: container.containerName }),
|
|
3014
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives11.Pill, { children: container.status })
|
|
2879
3015
|
] }),
|
|
2880
|
-
/* @__PURE__ */ (0,
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2883
|
-
/* @__PURE__ */ (0,
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("table", { style: tableStyle, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tbody", { children: [
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { style: thStyle, scope: "row", children: t("image") }),
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { style: tdStyle, children: container.imageId })
|
|
2884
3020
|
] }),
|
|
2885
|
-
/* @__PURE__ */ (0,
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
3021
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
3022
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { style: thStyle, scope: "row", children: t("created") }),
|
|
3023
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { style: tdStyle, children: container.createdAt })
|
|
2888
3024
|
] }),
|
|
2889
|
-
mountRows.map(({ key, values }) => /* @__PURE__ */ (0,
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
2891
|
-
/* @__PURE__ */ (0,
|
|
3025
|
+
mountRows.map(({ key, values }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
3026
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { style: thStyle, scope: "row", children: t(key) }),
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { style: tdStyle, children: values.join(", ") })
|
|
2892
3028
|
] }, key)),
|
|
2893
|
-
envEntries.length > 0 ? /* @__PURE__ */ (0,
|
|
2894
|
-
/* @__PURE__ */ (0,
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
3029
|
+
envEntries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
3030
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { style: thStyle, scope: "row", children: t("env") }),
|
|
3031
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { style: tdStyle, children: envEntries.map(([key]) => key).join(", ") })
|
|
2896
3032
|
] }) : null,
|
|
2897
|
-
secretEntries.length > 0 ? /* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2899
|
-
/* @__PURE__ */ (0,
|
|
3033
|
+
secretEntries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
3034
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { style: thStyle, scope: "row", children: t("secretEnv") }),
|
|
3035
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { style: tdStyle, children: secretEntries.map(([envVar, secretName]) => `${envVar}=${secretName}`).join(", ") })
|
|
3036
|
+
] }) : null,
|
|
3037
|
+
container.publishedPorts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
3038
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { style: thStyle, scope: "row", children: t("portsTitle") }),
|
|
3039
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { style: tdStyle, children: container.publishedPorts.map(
|
|
3040
|
+
(published) => `${published.port}/${published.protocol} \u2192 ${published.endpoint}`
|
|
3041
|
+
).join(", ") })
|
|
2900
3042
|
] }) : null
|
|
2901
3043
|
] }) }),
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
2903
|
-
/* @__PURE__ */ (0,
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: actions, children: [
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2904
3046
|
ConfirmButton,
|
|
2905
3047
|
{
|
|
2906
3048
|
t,
|
|
@@ -2914,7 +3056,7 @@ function ContainerRow(props) {
|
|
|
2914
3056
|
onConfirm: () => onRemove(container.workspaceSlug, container.containerName)
|
|
2915
3057
|
}
|
|
2916
3058
|
),
|
|
2917
|
-
/* @__PURE__ */ (0,
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2918
3060
|
ConfirmButton,
|
|
2919
3061
|
{
|
|
2920
3062
|
t,
|
|
@@ -2933,7 +3075,7 @@ function ContainerRow(props) {
|
|
|
2933
3075
|
)
|
|
2934
3076
|
}
|
|
2935
3077
|
),
|
|
2936
|
-
/* @__PURE__ */ (0,
|
|
3078
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2937
3079
|
"select",
|
|
2938
3080
|
{
|
|
2939
3081
|
style: imageSelect,
|
|
@@ -2942,12 +3084,12 @@ function ContainerRow(props) {
|
|
|
2942
3084
|
onChange: (event) => setSelected(event.target.value),
|
|
2943
3085
|
"aria-label": t("recreateWithImage"),
|
|
2944
3086
|
children: [
|
|
2945
|
-
container.imageId === "" ? /* @__PURE__ */ (0,
|
|
2946
|
-
images.map((image) => /* @__PURE__ */ (0,
|
|
3087
|
+
container.imageId === "" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: t("none") }) : null,
|
|
3088
|
+
images.map((image) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: image.imageId, children: image.imageId }, image.imageId))
|
|
2947
3089
|
]
|
|
2948
3090
|
}
|
|
2949
3091
|
),
|
|
2950
|
-
/* @__PURE__ */ (0,
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2951
3093
|
ConfirmButton,
|
|
2952
3094
|
{
|
|
2953
3095
|
t,
|
|
@@ -2967,26 +3109,26 @@ function ContainerRow(props) {
|
|
|
2967
3109
|
}
|
|
2968
3110
|
)
|
|
2969
3111
|
] }),
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
2971
|
-
|
|
3112
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3113
|
+
import_dsh_client_ui_primitives11.DisclosureRow,
|
|
2972
3114
|
{
|
|
2973
|
-
icon: /* @__PURE__ */ (0,
|
|
3115
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", {}),
|
|
2974
3116
|
title: t("envTitle"),
|
|
2975
3117
|
open: envOpen,
|
|
2976
3118
|
expandable: true,
|
|
2977
3119
|
onToggle: () => setEnvOpen(!envOpen),
|
|
2978
|
-
children: /* @__PURE__ */ (0,
|
|
3120
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: wsBody, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EnvEditor, { t, env, busy, onChange: setEnv }) })
|
|
2979
3121
|
}
|
|
2980
3122
|
),
|
|
2981
|
-
/* @__PURE__ */ (0,
|
|
2982
|
-
|
|
3123
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3124
|
+
import_dsh_client_ui_primitives11.DisclosureRow,
|
|
2983
3125
|
{
|
|
2984
|
-
icon: /* @__PURE__ */ (0,
|
|
3126
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", {}),
|
|
2985
3127
|
title: t("mountsTitle"),
|
|
2986
3128
|
open: mountOpen,
|
|
2987
3129
|
expandable: true,
|
|
2988
3130
|
onToggle: () => setMountOpen(!mountOpen),
|
|
2989
|
-
children: /* @__PURE__ */ (0,
|
|
3131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: wsBody, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2990
3132
|
MountsEditor,
|
|
2991
3133
|
{
|
|
2992
3134
|
t,
|
|
@@ -3018,15 +3160,15 @@ function ContainerRow(props) {
|
|
|
3018
3160
|
) })
|
|
3019
3161
|
}
|
|
3020
3162
|
),
|
|
3021
|
-
/* @__PURE__ */ (0,
|
|
3022
|
-
|
|
3163
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3164
|
+
import_dsh_client_ui_primitives11.DisclosureRow,
|
|
3023
3165
|
{
|
|
3024
|
-
icon: /* @__PURE__ */ (0,
|
|
3166
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", {}),
|
|
3025
3167
|
title: t("pathsTitle"),
|
|
3026
3168
|
open: pathOpen,
|
|
3027
3169
|
expandable: true,
|
|
3028
3170
|
onToggle: () => setPathOpen(!pathOpen),
|
|
3029
|
-
children: /* @__PURE__ */ (0,
|
|
3171
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: wsBody, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3030
3172
|
PathsEditor,
|
|
3031
3173
|
{
|
|
3032
3174
|
t,
|
|
@@ -3042,16 +3184,16 @@ function ContainerRow(props) {
|
|
|
3042
3184
|
) })
|
|
3043
3185
|
}
|
|
3044
3186
|
),
|
|
3045
|
-
/* @__PURE__ */ (0,
|
|
3046
|
-
|
|
3187
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3188
|
+
import_dsh_client_ui_primitives11.DisclosureRow,
|
|
3047
3189
|
{
|
|
3048
|
-
icon: /* @__PURE__ */ (0,
|
|
3190
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", {}),
|
|
3049
3191
|
title: t("containerSecretsTitle"),
|
|
3050
3192
|
open: secretOpen,
|
|
3051
3193
|
expandable: true,
|
|
3052
3194
|
onToggle: () => setSecretOpen(!secretOpen),
|
|
3053
|
-
children: /* @__PURE__ */ (0,
|
|
3054
|
-
secretEntries.map(([envVar, secretName]) => /* @__PURE__ */ (0,
|
|
3195
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: wsBody, children: [
|
|
3196
|
+
secretEntries.map(([envVar, secretName]) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3055
3197
|
"div",
|
|
3056
3198
|
{
|
|
3057
3199
|
style: {
|
|
@@ -3061,7 +3203,7 @@ function ContainerRow(props) {
|
|
|
3061
3203
|
gap: "8px"
|
|
3062
3204
|
},
|
|
3063
3205
|
children: [
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
3206
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3065
3207
|
"code",
|
|
3066
3208
|
{
|
|
3067
3209
|
style: {
|
|
@@ -3077,7 +3219,7 @@ function ContainerRow(props) {
|
|
|
3077
3219
|
]
|
|
3078
3220
|
}
|
|
3079
3221
|
),
|
|
3080
|
-
/* @__PURE__ */ (0,
|
|
3222
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3081
3223
|
ConfirmButton,
|
|
3082
3224
|
{
|
|
3083
3225
|
t,
|
|
@@ -3099,7 +3241,7 @@ function ContainerRow(props) {
|
|
|
3099
3241
|
},
|
|
3100
3242
|
envVar
|
|
3101
3243
|
)),
|
|
3102
|
-
/* @__PURE__ */ (0,
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3103
3245
|
"div",
|
|
3104
3246
|
{
|
|
3105
3247
|
style: {
|
|
@@ -3110,7 +3252,7 @@ function ContainerRow(props) {
|
|
|
3110
3252
|
paddingTop: "8px"
|
|
3111
3253
|
},
|
|
3112
3254
|
children: [
|
|
3113
|
-
/* @__PURE__ */ (0,
|
|
3255
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3114
3256
|
"select",
|
|
3115
3257
|
{
|
|
3116
3258
|
style: imageSelect,
|
|
@@ -3119,13 +3261,13 @@ function ContainerRow(props) {
|
|
|
3119
3261
|
onChange: (event) => setAttachSecret(event.target.value),
|
|
3120
3262
|
"aria-label": t("attachSecret"),
|
|
3121
3263
|
children: [
|
|
3122
|
-
secrets.length === 0 ? /* @__PURE__ */ (0,
|
|
3123
|
-
secrets.map((secret) => /* @__PURE__ */ (0,
|
|
3264
|
+
secrets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: t("none") }) : null,
|
|
3265
|
+
secrets.map((secret) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: secret.name, children: secret.name }, secret.name))
|
|
3124
3266
|
]
|
|
3125
3267
|
}
|
|
3126
3268
|
),
|
|
3127
|
-
/* @__PURE__ */ (0,
|
|
3128
|
-
|
|
3269
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3270
|
+
import_dsh_client_ui_primitives11.Input,
|
|
3129
3271
|
{
|
|
3130
3272
|
value: attachVar,
|
|
3131
3273
|
disabled: !enabled,
|
|
@@ -3137,8 +3279,8 @@ function ContainerRow(props) {
|
|
|
3137
3279
|
style: { width: "200px" }
|
|
3138
3280
|
}
|
|
3139
3281
|
),
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3141
|
-
|
|
3282
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3283
|
+
import_dsh_client_ui_primitives11.Button,
|
|
3142
3284
|
{
|
|
3143
3285
|
variant: "outline",
|
|
3144
3286
|
size: "sm",
|
|
@@ -3152,14 +3294,47 @@ function ContainerRow(props) {
|
|
|
3152
3294
|
)
|
|
3153
3295
|
] })
|
|
3154
3296
|
}
|
|
3297
|
+
),
|
|
3298
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3299
|
+
import_dsh_client_ui_primitives11.DisclosureRow,
|
|
3300
|
+
{
|
|
3301
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", {}),
|
|
3302
|
+
title: t("portsTitle"),
|
|
3303
|
+
open: portOpen,
|
|
3304
|
+
expandable: true,
|
|
3305
|
+
onToggle: () => setPortOpen(!portOpen),
|
|
3306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: wsBody, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3307
|
+
PortsEditor,
|
|
3308
|
+
{
|
|
3309
|
+
t,
|
|
3310
|
+
ports: container.publishedPorts,
|
|
3311
|
+
busy,
|
|
3312
|
+
enabled,
|
|
3313
|
+
canPublish,
|
|
3314
|
+
gatewayUnavailable,
|
|
3315
|
+
onPublish: (port, suggestedHostPort) => onPublishContainerPort(
|
|
3316
|
+
container.workspaceSlug,
|
|
3317
|
+
container.containerName,
|
|
3318
|
+
port,
|
|
3319
|
+
suggestedHostPort
|
|
3320
|
+
),
|
|
3321
|
+
onUnpublish: (port, protocol) => onUnpublishContainerPort(
|
|
3322
|
+
container.workspaceSlug,
|
|
3323
|
+
container.containerName,
|
|
3324
|
+
port,
|
|
3325
|
+
protocol
|
|
3326
|
+
)
|
|
3327
|
+
}
|
|
3328
|
+
) })
|
|
3329
|
+
}
|
|
3155
3330
|
)
|
|
3156
3331
|
] });
|
|
3157
3332
|
}
|
|
3158
3333
|
|
|
3159
3334
|
// src/client/container-card-workspace.tsx
|
|
3160
|
-
var
|
|
3161
|
-
var
|
|
3162
|
-
var
|
|
3335
|
+
var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
3336
|
+
var import_react12 = require("react");
|
|
3337
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3163
3338
|
function WorkspaceSection(props) {
|
|
3164
3339
|
const {
|
|
3165
3340
|
t,
|
|
@@ -3183,33 +3358,36 @@ function WorkspaceSection(props) {
|
|
|
3183
3358
|
onSetContainerPaths,
|
|
3184
3359
|
onAddContainerSecret,
|
|
3185
3360
|
onRemoveContainerSecret,
|
|
3361
|
+
onPublishContainerPort,
|
|
3362
|
+
onUnpublishContainerPort,
|
|
3363
|
+
gatewayUnavailable,
|
|
3186
3364
|
onSyncDefaults,
|
|
3187
3365
|
defaultEnvCount
|
|
3188
3366
|
} = props;
|
|
3189
|
-
const [open, setOpen] = (0,
|
|
3190
|
-
const [createOpen, setCreateOpen] = (0,
|
|
3367
|
+
const [open, setOpen] = (0, import_react12.useState)(false);
|
|
3368
|
+
const [createOpen, setCreateOpen] = (0, import_react12.useState)(
|
|
3191
3369
|
null
|
|
3192
3370
|
);
|
|
3193
3371
|
const hasContainer = containers.length > 0;
|
|
3194
|
-
return /* @__PURE__ */ (0,
|
|
3195
|
-
|
|
3372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
3373
|
+
import_dsh_client_ui_primitives12.DisclosureRow,
|
|
3196
3374
|
{
|
|
3197
|
-
icon: hasContainer ? /* @__PURE__ */ (0,
|
|
3375
|
+
icon: hasContainer ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives12.StateDot, { state: containerStateDot(containers[0]?.status ?? "") }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {}),
|
|
3198
3376
|
title: workspace.projectName,
|
|
3199
3377
|
open,
|
|
3200
3378
|
expandable: true,
|
|
3201
3379
|
onToggle: () => setOpen(!open),
|
|
3202
3380
|
children: [
|
|
3203
|
-
/* @__PURE__ */ (0,
|
|
3204
|
-
/* @__PURE__ */ (0,
|
|
3205
|
-
!hasContainer ? /* @__PURE__ */ (0,
|
|
3381
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: wsBody, children: [
|
|
3382
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("code", { style: greyId, children: workspace.workspaceSlug }),
|
|
3383
|
+
!hasContainer ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
3206
3384
|
"div",
|
|
3207
3385
|
{
|
|
3208
3386
|
style: { display: "flex", flexDirection: "column", gap: "8px" },
|
|
3209
3387
|
children: [
|
|
3210
|
-
/* @__PURE__ */ (0,
|
|
3211
|
-
/* @__PURE__ */ (0,
|
|
3212
|
-
|
|
3388
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { style: { ...hint, margin: 0 }, children: t("noContainers") }),
|
|
3389
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3390
|
+
import_dsh_client_ui_primitives12.Button,
|
|
3213
3391
|
{
|
|
3214
3392
|
variant: "outline",
|
|
3215
3393
|
size: "sm",
|
|
@@ -3220,8 +3398,8 @@ function WorkspaceSection(props) {
|
|
|
3220
3398
|
) })
|
|
3221
3399
|
]
|
|
3222
3400
|
}
|
|
3223
|
-
) : /* @__PURE__ */ (0,
|
|
3224
|
-
containers.map((container) => /* @__PURE__ */ (0,
|
|
3401
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
3402
|
+
containers.map((container) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3225
3403
|
ContainerRow,
|
|
3226
3404
|
{
|
|
3227
3405
|
t,
|
|
@@ -3240,12 +3418,15 @@ function WorkspaceSection(props) {
|
|
|
3240
3418
|
projectsRoot,
|
|
3241
3419
|
directoryPicker,
|
|
3242
3420
|
onAddContainerSecret,
|
|
3243
|
-
onRemoveContainerSecret
|
|
3421
|
+
onRemoveContainerSecret,
|
|
3422
|
+
onPublishContainerPort,
|
|
3423
|
+
onUnpublishContainerPort,
|
|
3424
|
+
gatewayUnavailable
|
|
3244
3425
|
},
|
|
3245
3426
|
container.containerName
|
|
3246
3427
|
)),
|
|
3247
|
-
/* @__PURE__ */ (0,
|
|
3248
|
-
|
|
3428
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3429
|
+
import_dsh_client_ui_primitives12.Button,
|
|
3249
3430
|
{
|
|
3250
3431
|
variant: "outline",
|
|
3251
3432
|
size: "sm",
|
|
@@ -3255,8 +3436,8 @@ function WorkspaceSection(props) {
|
|
|
3255
3436
|
}
|
|
3256
3437
|
) })
|
|
3257
3438
|
] }),
|
|
3258
|
-
/* @__PURE__ */ (0,
|
|
3259
|
-
/* @__PURE__ */ (0,
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: [
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3260
3441
|
ConfirmButton,
|
|
3261
3442
|
{
|
|
3262
3443
|
t,
|
|
@@ -3267,7 +3448,7 @@ function WorkspaceSection(props) {
|
|
|
3267
3448
|
onConfirm: () => onSyncDefaults(workspace.workspaceSlug)
|
|
3268
3449
|
}
|
|
3269
3450
|
),
|
|
3270
|
-
/* @__PURE__ */ (0,
|
|
3451
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3271
3452
|
ConfirmButton,
|
|
3272
3453
|
{
|
|
3273
3454
|
t,
|
|
@@ -3282,7 +3463,7 @@ function WorkspaceSection(props) {
|
|
|
3282
3463
|
)
|
|
3283
3464
|
] })
|
|
3284
3465
|
] }),
|
|
3285
|
-
/* @__PURE__ */ (0,
|
|
3466
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3286
3467
|
CreateContainerModal,
|
|
3287
3468
|
{
|
|
3288
3469
|
t,
|
|
@@ -3314,38 +3495,39 @@ function WorkspaceSection(props) {
|
|
|
3314
3495
|
}
|
|
3315
3496
|
|
|
3316
3497
|
// src/client/ContainerCard.tsx
|
|
3317
|
-
var
|
|
3318
|
-
var
|
|
3319
|
-
var
|
|
3498
|
+
var import_dsh_client_ui_primitives13 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
3499
|
+
var import_react13 = require("react");
|
|
3500
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3320
3501
|
var versionLabel = { fontWeight: 600 };
|
|
3321
3502
|
function ContainerCard(props) {
|
|
3322
3503
|
const { t } = props;
|
|
3323
3504
|
const state = props.useContainerCard((snapshot) => snapshot);
|
|
3324
|
-
const [buildOpen, setBuildOpen] = (0,
|
|
3325
|
-
const [imageId, setImageId] = (0,
|
|
3326
|
-
const [parent, setParent] = (0,
|
|
3327
|
-
const [packages, setPackages] = (0,
|
|
3328
|
-
const [defaultOpen, setDefaultOpen] = (0,
|
|
3329
|
-
const [defaultImage, setDefaultImage] = (0,
|
|
3330
|
-
const [copyState, setCopyState] = (0,
|
|
3505
|
+
const [buildOpen, setBuildOpen] = (0, import_react13.useState)(false);
|
|
3506
|
+
const [imageId, setImageId] = (0, import_react13.useState)("");
|
|
3507
|
+
const [parent, setParent] = (0, import_react13.useState)("");
|
|
3508
|
+
const [packages, setPackages] = (0, import_react13.useState)([]);
|
|
3509
|
+
const [defaultOpen, setDefaultOpen] = (0, import_react13.useState)(false);
|
|
3510
|
+
const [defaultImage, setDefaultImage] = (0, import_react13.useState)(state.defaultImage);
|
|
3511
|
+
const [copyState, setCopyState] = (0, import_react13.useState)(
|
|
3331
3512
|
"idle"
|
|
3332
3513
|
);
|
|
3333
|
-
const copyResetTimer = (0,
|
|
3514
|
+
const copyResetTimer = (0, import_react13.useRef)();
|
|
3334
3515
|
const copyVersions = async () => {
|
|
3335
3516
|
const lines = [
|
|
3336
3517
|
`${t("dsh")} ${state.dshVersion || t("versionUnknown")}`,
|
|
3337
3518
|
`${t("cardTitle")} ${state.version}${state.commit ? ` \xB7 ${state.commit}` : ""}`,
|
|
3338
|
-
`${t("orchestrator")} ${state.orchestratorVersion || t("versionUnknown")}
|
|
3519
|
+
`${t("orchestrator")} ${state.orchestratorVersion || t("versionUnknown")}`,
|
|
3520
|
+
`${t("gateway")} ${state.gatewayState === "running" ? `${state.gatewayVersion}${state.gatewayCommit ? ` \xB7 ${state.gatewayCommit}` : ""}` : state.gatewayState === "incompatible" ? t("gatewayIncompatible") : t("gatewayNotRunning")}`
|
|
3339
3521
|
];
|
|
3340
3522
|
setCopyState(
|
|
3341
|
-
await (0,
|
|
3523
|
+
await (0, import_dsh_client_ui_primitives13.writeClipboard)(lines.join("\n")) ? "copied" : "failed"
|
|
3342
3524
|
);
|
|
3343
3525
|
if (copyResetTimer.current !== void 0) {
|
|
3344
3526
|
clearTimeout(copyResetTimer.current);
|
|
3345
3527
|
}
|
|
3346
3528
|
copyResetTimer.current = setTimeout(() => setCopyState("idle"), 1500);
|
|
3347
3529
|
};
|
|
3348
|
-
(0,
|
|
3530
|
+
(0, import_react13.useEffect)(
|
|
3349
3531
|
() => () => {
|
|
3350
3532
|
if (copyResetTimer.current !== void 0) {
|
|
3351
3533
|
clearTimeout(copyResetTimer.current);
|
|
@@ -3353,7 +3535,7 @@ function ContainerCard(props) {
|
|
|
3353
3535
|
},
|
|
3354
3536
|
[]
|
|
3355
3537
|
);
|
|
3356
|
-
(0,
|
|
3538
|
+
(0, import_react13.useEffect)(() => {
|
|
3357
3539
|
if (props.view === "page") props.reload();
|
|
3358
3540
|
}, [props.view]);
|
|
3359
3541
|
if (props.view === "summary") return t("cardDescription");
|
|
@@ -3364,15 +3546,15 @@ function ContainerCard(props) {
|
|
|
3364
3546
|
...customImages.map((image) => image.imageId)
|
|
3365
3547
|
];
|
|
3366
3548
|
if (!state.available) {
|
|
3367
|
-
return /* @__PURE__ */ (0,
|
|
3368
|
-
/* @__PURE__ */ (0,
|
|
3369
|
-
state.notice === "" ? null : /* @__PURE__ */ (0,
|
|
3549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: "8px 0", fontSize: "13px", opacity: 0.8 }, children: [
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: { margin: 0 }, children: t("unavailable") }),
|
|
3551
|
+
state.notice === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { style: { margin: "4px 0 0" }, role: "status", children: [
|
|
3370
3552
|
t("notice"),
|
|
3371
3553
|
": ",
|
|
3372
3554
|
state.notice
|
|
3373
3555
|
] }),
|
|
3374
|
-
/* @__PURE__ */ (0,
|
|
3375
|
-
|
|
3556
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { marginTop: "8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3557
|
+
import_dsh_client_ui_primitives13.Button,
|
|
3376
3558
|
{
|
|
3377
3559
|
variant: "outline",
|
|
3378
3560
|
size: "sm",
|
|
@@ -3383,13 +3565,13 @@ function ContainerCard(props) {
|
|
|
3383
3565
|
) })
|
|
3384
3566
|
] });
|
|
3385
3567
|
}
|
|
3386
|
-
return /* @__PURE__ */ (0,
|
|
3387
|
-
state.notice === "" ? null : /* @__PURE__ */ (0,
|
|
3568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
3569
|
+
state.notice === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: banner, role: "status", children: [
|
|
3388
3570
|
t("notice"),
|
|
3389
3571
|
": ",
|
|
3390
3572
|
state.notice
|
|
3391
3573
|
] }),
|
|
3392
|
-
state.versionState === "ok" ? null : /* @__PURE__ */ (0,
|
|
3574
|
+
state.versionState === "ok" ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3393
3575
|
"div",
|
|
3394
3576
|
{
|
|
3395
3577
|
style: state.versionState === "major-mismatch" ? { ...banner, borderColor: "var(--dsw-alias-state-error-primary)" } : banner,
|
|
@@ -3399,8 +3581,8 @@ function ContainerCard(props) {
|
|
|
3399
3581
|
)
|
|
3400
3582
|
}
|
|
3401
3583
|
),
|
|
3402
|
-
/* @__PURE__ */ (0,
|
|
3403
|
-
state.workspaces.length === 0 ? /* @__PURE__ */ (0,
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: sectionTitle, children: t("workspacesTitle") }),
|
|
3585
|
+
state.workspaces.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: hint, children: t("none") }) : state.workspaces.map((workspace) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3404
3586
|
WorkspaceSection,
|
|
3405
3587
|
{
|
|
3406
3588
|
t,
|
|
@@ -3426,12 +3608,15 @@ function ContainerCard(props) {
|
|
|
3426
3608
|
onSetContainerPaths: props.setContainerPaths,
|
|
3427
3609
|
onAddContainerSecret: props.addContainerSecret,
|
|
3428
3610
|
onRemoveContainerSecret: props.removeContainerSecret,
|
|
3611
|
+
onPublishContainerPort: props.publishContainerPort,
|
|
3612
|
+
onUnpublishContainerPort: props.unpublishContainerPort,
|
|
3613
|
+
gatewayUnavailable: state.gatewayState === "absent" || state.gatewayState === "incompatible",
|
|
3429
3614
|
onSyncDefaults: props.syncDefaultEnv,
|
|
3430
3615
|
defaultEnvCount: Object.keys(state.containerEnv).length
|
|
3431
3616
|
},
|
|
3432
3617
|
workspace.workspaceSlug
|
|
3433
3618
|
)),
|
|
3434
|
-
/* @__PURE__ */ (0,
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3435
3620
|
"div",
|
|
3436
3621
|
{
|
|
3437
3622
|
style: {
|
|
@@ -3441,9 +3626,9 @@ function ContainerCard(props) {
|
|
|
3441
3626
|
gap: "8px"
|
|
3442
3627
|
},
|
|
3443
3628
|
children: [
|
|
3444
|
-
/* @__PURE__ */ (0,
|
|
3445
|
-
/* @__PURE__ */ (0,
|
|
3446
|
-
|
|
3629
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { ...sectionTitle, flex: 1 }, children: t("imagesTitle") }),
|
|
3630
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3631
|
+
import_dsh_client_ui_primitives13.Button,
|
|
3447
3632
|
{
|
|
3448
3633
|
variant: "outline",
|
|
3449
3634
|
size: "sm",
|
|
@@ -3455,8 +3640,8 @@ function ContainerCard(props) {
|
|
|
3455
3640
|
children: t("setDefaultImage")
|
|
3456
3641
|
}
|
|
3457
3642
|
),
|
|
3458
|
-
/* @__PURE__ */ (0,
|
|
3459
|
-
|
|
3643
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3644
|
+
import_dsh_client_ui_primitives13.Button,
|
|
3460
3645
|
{
|
|
3461
3646
|
variant: "outline",
|
|
3462
3647
|
size: "sm",
|
|
@@ -3470,7 +3655,7 @@ function ContainerCard(props) {
|
|
|
3470
3655
|
children: t("buildImage")
|
|
3471
3656
|
}
|
|
3472
3657
|
),
|
|
3473
|
-
/* @__PURE__ */ (0,
|
|
3658
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3474
3659
|
ConfirmButton,
|
|
3475
3660
|
{
|
|
3476
3661
|
t,
|
|
@@ -3484,8 +3669,8 @@ function ContainerCard(props) {
|
|
|
3484
3669
|
]
|
|
3485
3670
|
}
|
|
3486
3671
|
),
|
|
3487
|
-
/* @__PURE__ */ (0,
|
|
3488
|
-
baseImages.length === 0 ? /* @__PURE__ */ (0,
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: sectionTitle, children: t("baseImagesTitle") }),
|
|
3673
|
+
baseImages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: hint, children: t("none") }) : baseImages.map((image) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3489
3674
|
BaseImageRow,
|
|
3490
3675
|
{
|
|
3491
3676
|
t,
|
|
@@ -3498,8 +3683,8 @@ function ContainerCard(props) {
|
|
|
3498
3683
|
},
|
|
3499
3684
|
image.imageId
|
|
3500
3685
|
)),
|
|
3501
|
-
/* @__PURE__ */ (0,
|
|
3502
|
-
customImages.length === 0 ? /* @__PURE__ */ (0,
|
|
3686
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: sectionTitle, children: t("customImagesTitle") }),
|
|
3687
|
+
customImages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: hint, children: t("none") }) : customImages.map((image) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3503
3688
|
ImageItem,
|
|
3504
3689
|
{
|
|
3505
3690
|
t,
|
|
@@ -3512,7 +3697,7 @@ function ContainerCard(props) {
|
|
|
3512
3697
|
},
|
|
3513
3698
|
image.imageId
|
|
3514
3699
|
)),
|
|
3515
|
-
/* @__PURE__ */ (0,
|
|
3700
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3516
3701
|
ImageBuildModal,
|
|
3517
3702
|
{
|
|
3518
3703
|
t,
|
|
@@ -3534,16 +3719,16 @@ function ContainerCard(props) {
|
|
|
3534
3719
|
}
|
|
3535
3720
|
}
|
|
3536
3721
|
),
|
|
3537
|
-
/* @__PURE__ */ (0,
|
|
3538
|
-
|
|
3722
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3723
|
+
import_dsh_client_ui_primitives13.Modal,
|
|
3539
3724
|
{
|
|
3540
3725
|
open: defaultOpen,
|
|
3541
3726
|
onClose: () => setDefaultOpen(false),
|
|
3542
3727
|
title: t("setDefaultImageTitle"),
|
|
3543
3728
|
closeLabel: t("cancel"),
|
|
3544
|
-
footer: /* @__PURE__ */ (0,
|
|
3545
|
-
/* @__PURE__ */ (0,
|
|
3546
|
-
|
|
3729
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
3730
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3731
|
+
import_dsh_client_ui_primitives13.Button,
|
|
3547
3732
|
{
|
|
3548
3733
|
variant: "outline",
|
|
3549
3734
|
size: "sm",
|
|
@@ -3551,8 +3736,8 @@ function ContainerCard(props) {
|
|
|
3551
3736
|
children: t("cancel")
|
|
3552
3737
|
}
|
|
3553
3738
|
),
|
|
3554
|
-
/* @__PURE__ */ (0,
|
|
3555
|
-
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3740
|
+
import_dsh_client_ui_primitives13.Button,
|
|
3556
3741
|
{
|
|
3557
3742
|
variant: "primary",
|
|
3558
3743
|
size: "sm",
|
|
@@ -3566,23 +3751,23 @@ function ContainerCard(props) {
|
|
|
3566
3751
|
)
|
|
3567
3752
|
] }),
|
|
3568
3753
|
children: [
|
|
3569
|
-
/* @__PURE__ */ (0,
|
|
3754
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3570
3755
|
"select",
|
|
3571
3756
|
{
|
|
3572
3757
|
style: imageSelect,
|
|
3573
3758
|
value: defaultImage,
|
|
3574
3759
|
onChange: (event) => setDefaultImage(event.target.value),
|
|
3575
3760
|
children: [
|
|
3576
|
-
defaultCandidates.length === 0 ? /* @__PURE__ */ (0,
|
|
3577
|
-
defaultCandidates.map((name2) => /* @__PURE__ */ (0,
|
|
3761
|
+
defaultCandidates.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: t("none") }) : null,
|
|
3762
|
+
defaultCandidates.map((name2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: name2, children: name2 }, name2))
|
|
3578
3763
|
]
|
|
3579
3764
|
}
|
|
3580
3765
|
),
|
|
3581
|
-
/* @__PURE__ */ (0,
|
|
3766
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: hint, children: t("defaultImageHint") })
|
|
3582
3767
|
]
|
|
3583
3768
|
}
|
|
3584
3769
|
),
|
|
3585
|
-
/* @__PURE__ */ (0,
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3586
3771
|
CachesSection,
|
|
3587
3772
|
{
|
|
3588
3773
|
t,
|
|
@@ -3591,7 +3776,7 @@ function ContainerCard(props) {
|
|
|
3591
3776
|
onClean: props.cleanCaches
|
|
3592
3777
|
}
|
|
3593
3778
|
),
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3779
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3595
3780
|
VolumesSection,
|
|
3596
3781
|
{
|
|
3597
3782
|
t,
|
|
@@ -3602,7 +3787,7 @@ function ContainerCard(props) {
|
|
|
3602
3787
|
onRemove: props.removeVolume
|
|
3603
3788
|
}
|
|
3604
3789
|
),
|
|
3605
|
-
/* @__PURE__ */ (0,
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3606
3791
|
SecretsSection,
|
|
3607
3792
|
{
|
|
3608
3793
|
t,
|
|
@@ -3614,7 +3799,7 @@ function ContainerCard(props) {
|
|
|
3614
3799
|
onSet: props.setSecret
|
|
3615
3800
|
}
|
|
3616
3801
|
),
|
|
3617
|
-
/* @__PURE__ */ (0,
|
|
3802
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3618
3803
|
DefaultEnvironmentSection,
|
|
3619
3804
|
{
|
|
3620
3805
|
t,
|
|
@@ -3625,7 +3810,7 @@ function ContainerCard(props) {
|
|
|
3625
3810
|
onSync: props.syncDefaultEnv
|
|
3626
3811
|
}
|
|
3627
3812
|
),
|
|
3628
|
-
/* @__PURE__ */ (0,
|
|
3813
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3629
3814
|
"div",
|
|
3630
3815
|
{
|
|
3631
3816
|
style: {
|
|
@@ -3635,9 +3820,9 @@ function ContainerCard(props) {
|
|
|
3635
3820
|
gap: "8px"
|
|
3636
3821
|
},
|
|
3637
3822
|
children: [
|
|
3638
|
-
/* @__PURE__ */ (0,
|
|
3639
|
-
/* @__PURE__ */ (0,
|
|
3640
|
-
|
|
3823
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { ...sectionTitle, flex: 1 }, children: t("versionsTitle") }),
|
|
3824
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3825
|
+
import_dsh_client_ui_primitives13.Button,
|
|
3641
3826
|
{
|
|
3642
3827
|
variant: "outline",
|
|
3643
3828
|
size: "sm",
|
|
@@ -3648,7 +3833,7 @@ function ContainerCard(props) {
|
|
|
3648
3833
|
]
|
|
3649
3834
|
}
|
|
3650
3835
|
),
|
|
3651
|
-
/* @__PURE__ */ (0,
|
|
3836
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3652
3837
|
"div",
|
|
3653
3838
|
{
|
|
3654
3839
|
style: {
|
|
@@ -3659,11 +3844,11 @@ function ContainerCard(props) {
|
|
|
3659
3844
|
margin: 0
|
|
3660
3845
|
},
|
|
3661
3846
|
children: [
|
|
3662
|
-
/* @__PURE__ */ (0,
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
3664
|
-
state.dshVersion ? ` ${state.dshVersion}` : /* @__PURE__ */ (0,
|
|
3847
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
3848
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: versionLabel, children: t("dsh") }),
|
|
3849
|
+
state.dshVersion ? ` ${state.dshVersion}` : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
3665
3850
|
" ",
|
|
3666
|
-
/* @__PURE__ */ (0,
|
|
3851
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3667
3852
|
"span",
|
|
3668
3853
|
{
|
|
3669
3854
|
style: { color: "var(--dsw-alias-state-error-primary)" },
|
|
@@ -3672,16 +3857,16 @@ function ContainerCard(props) {
|
|
|
3672
3857
|
)
|
|
3673
3858
|
] })
|
|
3674
3859
|
] }),
|
|
3675
|
-
/* @__PURE__ */ (0,
|
|
3676
|
-
/* @__PURE__ */ (0,
|
|
3860
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
3861
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: versionLabel, children: t("cardTitle") }),
|
|
3677
3862
|
state.version ? ` ${state.version}` : "",
|
|
3678
3863
|
state.commit ? ` \xB7 ${state.commit}` : ""
|
|
3679
3864
|
] }),
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3682
|
-
state.orchestratorVersion ? ` ${state.orchestratorVersion}` : /* @__PURE__ */ (0,
|
|
3865
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
3866
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: versionLabel, children: t("orchestrator") }),
|
|
3867
|
+
state.orchestratorVersion ? ` ${state.orchestratorVersion}` : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
3683
3868
|
" ",
|
|
3684
|
-
/* @__PURE__ */ (0,
|
|
3869
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3685
3870
|
"span",
|
|
3686
3871
|
{
|
|
3687
3872
|
style: { color: "var(--dsw-alias-state-error-primary)" },
|
|
@@ -3689,12 +3874,25 @@ function ContainerCard(props) {
|
|
|
3689
3874
|
}
|
|
3690
3875
|
)
|
|
3691
3876
|
] })
|
|
3877
|
+
] }),
|
|
3878
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
3879
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: versionLabel, children: t("gateway") }),
|
|
3880
|
+
state.gatewayState === "running" ? ` ${state.gatewayVersion}${state.gatewayCommit ? ` \xB7 ${state.gatewayCommit}` : ""}` : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
3881
|
+
" ",
|
|
3882
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3883
|
+
"span",
|
|
3884
|
+
{
|
|
3885
|
+
style: state.gatewayState === "incompatible" ? { color: "var(--dsw-alias-state-error-primary)" } : void 0,
|
|
3886
|
+
children: state.gatewayState === "incompatible" ? t("gatewayIncompatible") : t("gatewayNotRunning")
|
|
3887
|
+
}
|
|
3888
|
+
)
|
|
3889
|
+
] })
|
|
3692
3890
|
] })
|
|
3693
3891
|
]
|
|
3694
3892
|
}
|
|
3695
3893
|
),
|
|
3696
|
-
/* @__PURE__ */ (0,
|
|
3697
|
-
|
|
3894
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: footerRow, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3895
|
+
import_dsh_client_ui_primitives13.Button,
|
|
3698
3896
|
{
|
|
3699
3897
|
variant: "outline",
|
|
3700
3898
|
size: "sm",
|
|
@@ -13133,8 +13331,8 @@ var xterm_default = `/**
|
|
|
13133
13331
|
`;
|
|
13134
13332
|
|
|
13135
13333
|
// src/client/podman-terminal.tsx
|
|
13136
|
-
var
|
|
13137
|
-
var
|
|
13334
|
+
var import_dsh_client_ui_primitives14 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
13335
|
+
var import_react14 = require("react");
|
|
13138
13336
|
|
|
13139
13337
|
// src/client/terminal-targets.ts
|
|
13140
13338
|
function containerOptions(containers, workspaceSlug) {
|
|
@@ -13307,7 +13505,7 @@ function base64ToBytes(data) {
|
|
|
13307
13505
|
}
|
|
13308
13506
|
|
|
13309
13507
|
// src/client/podman-terminal.tsx
|
|
13310
|
-
var
|
|
13508
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
13311
13509
|
var TEXT_ENCODER = new TextEncoder();
|
|
13312
13510
|
var XTERM_STYLE_ATTRIBUTE = "data-dsh-podman-xterm";
|
|
13313
13511
|
var XTERM_CLASS = "dsh-podman-xterm";
|
|
@@ -13346,9 +13544,9 @@ function readTerminalTheme() {
|
|
|
13346
13544
|
};
|
|
13347
13545
|
}
|
|
13348
13546
|
function ContainerField(props) {
|
|
13349
|
-
return /* @__PURE__ */ (0,
|
|
13350
|
-
/* @__PURE__ */ (0,
|
|
13351
|
-
/* @__PURE__ */ (0,
|
|
13547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
13548
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: fieldLabel, children: props.label }),
|
|
13549
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
13352
13550
|
"select",
|
|
13353
13551
|
{
|
|
13354
13552
|
style: props.selectStyle ?? imageSelect,
|
|
@@ -13359,8 +13557,8 @@ function ContainerField(props) {
|
|
|
13359
13557
|
props.onContainer(event.target.value);
|
|
13360
13558
|
},
|
|
13361
13559
|
children: [
|
|
13362
|
-
/* @__PURE__ */ (0,
|
|
13363
|
-
containerOptions(props.containers, props.workspaceSlug).map((name2) => /* @__PURE__ */ (0,
|
|
13560
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: props.defaultLabel }),
|
|
13561
|
+
containerOptions(props.containers, props.workspaceSlug).map((name2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: name2, children: name2 }, name2))
|
|
13364
13562
|
]
|
|
13365
13563
|
}
|
|
13366
13564
|
)
|
|
@@ -13372,28 +13570,28 @@ function PodmanTerminal(props) {
|
|
|
13372
13570
|
const tabId = `${sessionId}:${info.tab.id}`;
|
|
13373
13571
|
const state = props.useContainerCard((snapshot) => snapshot);
|
|
13374
13572
|
const params = info.tab.navigation.params;
|
|
13375
|
-
const [target, setTarget] = (0,
|
|
13573
|
+
const [target, setTarget] = (0, import_react14.useState)({ phase: "loading" });
|
|
13376
13574
|
const workspace = target.phase === "ready" ? target.target.workspace : void 0;
|
|
13377
13575
|
const workspaceSlug = target.phase === "ready" ? target.target.workspaceSlug : void 0;
|
|
13378
13576
|
const unknownWorkspace = target.phase === "failed";
|
|
13379
|
-
const [container, setContainer] = (0,
|
|
13577
|
+
const [container, setContainer] = (0, import_react14.useState)(
|
|
13380
13578
|
params?.container
|
|
13381
13579
|
);
|
|
13382
|
-
const [shell, setShell] = (0,
|
|
13383
|
-
const [shells, setShells] = (0,
|
|
13384
|
-
const [status, setStatus] = (0,
|
|
13385
|
-
const [title, setTitle] = (0,
|
|
13386
|
-
const [attempt, setAttempt] = (0,
|
|
13387
|
-
const node = (0,
|
|
13388
|
-
const terminal = (0,
|
|
13389
|
-
const stream = (0,
|
|
13390
|
-
const terminalId = (0,
|
|
13391
|
-
const alive = (0,
|
|
13392
|
-
const reopen = (0,
|
|
13393
|
-
(0,
|
|
13580
|
+
const [shell, setShell] = (0, import_react14.useState)(params?.shell);
|
|
13581
|
+
const [shells, setShells] = (0, import_react14.useState)({ phase: "loading" });
|
|
13582
|
+
const [status, setStatus] = (0, import_react14.useState)({ kind: "idle" });
|
|
13583
|
+
const [title, setTitle] = (0, import_react14.useState)("");
|
|
13584
|
+
const [attempt, setAttempt] = (0, import_react14.useState)(0);
|
|
13585
|
+
const node = (0, import_react14.useRef)(null);
|
|
13586
|
+
const terminal = (0, import_react14.useRef)();
|
|
13587
|
+
const stream = (0, import_react14.useRef)();
|
|
13588
|
+
const terminalId = (0, import_react14.useRef)();
|
|
13589
|
+
const alive = (0, import_react14.useRef)(true);
|
|
13590
|
+
const reopen = (0, import_react14.useRef)(false);
|
|
13591
|
+
(0, import_react14.useEffect)(() => {
|
|
13394
13592
|
props.reload();
|
|
13395
13593
|
}, [props.reload]);
|
|
13396
|
-
(0,
|
|
13594
|
+
(0, import_react14.useEffect)(() => {
|
|
13397
13595
|
const controller = new AbortController();
|
|
13398
13596
|
setTarget({ phase: "loading" });
|
|
13399
13597
|
void fetchTerminalTarget(sessionId, controller.signal).then(
|
|
@@ -13414,11 +13612,11 @@ function PodmanTerminal(props) {
|
|
|
13414
13612
|
controller.abort();
|
|
13415
13613
|
};
|
|
13416
13614
|
}, [sessionId]);
|
|
13417
|
-
(0,
|
|
13615
|
+
(0, import_react14.useEffect)(() => {
|
|
13418
13616
|
if (workspace === void 0 || container !== void 0) return;
|
|
13419
13617
|
setContainer("");
|
|
13420
13618
|
}, [workspace, container]);
|
|
13421
|
-
(0,
|
|
13619
|
+
(0, import_react14.useEffect)(() => {
|
|
13422
13620
|
if (workspace === void 0 || workspace === "" || container === void 0) {
|
|
13423
13621
|
return;
|
|
13424
13622
|
}
|
|
@@ -13447,7 +13645,7 @@ function PodmanTerminal(props) {
|
|
|
13447
13645
|
controller.abort();
|
|
13448
13646
|
};
|
|
13449
13647
|
}, [workspace, container, sessionId]);
|
|
13450
|
-
(0,
|
|
13648
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
13451
13649
|
const element = node.current;
|
|
13452
13650
|
if (element === null) return;
|
|
13453
13651
|
alive.current = true;
|
|
@@ -13501,7 +13699,7 @@ function PodmanTerminal(props) {
|
|
|
13501
13699
|
terminal.current = void 0;
|
|
13502
13700
|
};
|
|
13503
13701
|
}, []);
|
|
13504
|
-
(0,
|
|
13702
|
+
(0, import_react14.useEffect)(() => {
|
|
13505
13703
|
const term = terminal.current;
|
|
13506
13704
|
if (term === void 0) return;
|
|
13507
13705
|
if (workspace === void 0 || workspace === "" || container === void 0 || shell === void 0 || shell === "") {
|
|
@@ -13583,7 +13781,7 @@ function PodmanTerminal(props) {
|
|
|
13583
13781
|
}
|
|
13584
13782
|
};
|
|
13585
13783
|
}, [sessionId, tabId, workspace, container, shell, attempt]);
|
|
13586
|
-
(0,
|
|
13784
|
+
(0, import_react14.useEffect)(() => {
|
|
13587
13785
|
if (info.tab.visible) terminal.current?.focus();
|
|
13588
13786
|
}, [info.tab.visible]);
|
|
13589
13787
|
const canConnect = workspace !== void 0 && workspace !== "" && shell !== void 0 && shell !== "";
|
|
@@ -13628,9 +13826,9 @@ function PodmanTerminal(props) {
|
|
|
13628
13826
|
}
|
|
13629
13827
|
const idle = status.kind === "idle";
|
|
13630
13828
|
const ended = status.kind === "exited" || status.kind === "error";
|
|
13631
|
-
return /* @__PURE__ */ (0,
|
|
13632
|
-
/* @__PURE__ */ (0,
|
|
13633
|
-
/* @__PURE__ */ (0,
|
|
13829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { style: ROOT_STYLE, "data-dsh-podman-terminal": true, children: [
|
|
13830
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: TOOLBAR_STYLE, children: [
|
|
13831
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
13634
13832
|
ContainerField,
|
|
13635
13833
|
{
|
|
13636
13834
|
containers: state.containers,
|
|
@@ -13645,8 +13843,8 @@ function PodmanTerminal(props) {
|
|
|
13645
13843
|
}
|
|
13646
13844
|
}
|
|
13647
13845
|
),
|
|
13648
|
-
/* @__PURE__ */ (0,
|
|
13649
|
-
/* @__PURE__ */ (0,
|
|
13846
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: fieldLabel, children: t("terminalShell") }),
|
|
13847
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
13650
13848
|
"select",
|
|
13651
13849
|
{
|
|
13652
13850
|
style: imageSelect,
|
|
@@ -13656,11 +13854,11 @@ function PodmanTerminal(props) {
|
|
|
13656
13854
|
onChange: (event) => {
|
|
13657
13855
|
setShell(event.target.value);
|
|
13658
13856
|
},
|
|
13659
|
-
children: shellList.length === 0 ? /* @__PURE__ */ (0,
|
|
13857
|
+
children: shellList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: unknownWorkspace ? "" : shells.phase === "loading" ? t("terminalLoading") : t("terminalNoShells") }) : shellList.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: entry.path, children: entry.name }, entry.path))
|
|
13660
13858
|
}
|
|
13661
13859
|
),
|
|
13662
|
-
(idle || ended) && /* @__PURE__ */ (0,
|
|
13663
|
-
|
|
13860
|
+
(idle || ended) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
13861
|
+
import_dsh_client_ui_primitives14.Button,
|
|
13664
13862
|
{
|
|
13665
13863
|
variant: "outline",
|
|
13666
13864
|
size: "sm",
|
|
@@ -13671,13 +13869,13 @@ function PodmanTerminal(props) {
|
|
|
13671
13869
|
children: idle ? t("terminalConnect") : t("terminalReconnect")
|
|
13672
13870
|
}
|
|
13673
13871
|
),
|
|
13674
|
-
statusLabel === void 0 ? null : /* @__PURE__ */ (0,
|
|
13675
|
-
title === "" ? null : /* @__PURE__ */ (0,
|
|
13872
|
+
statusLabel === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: STATUS_STYLE, role: "status", children: statusLabel }),
|
|
13873
|
+
title === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: TITLE_STYLE, children: title })
|
|
13676
13874
|
] }),
|
|
13677
|
-
state.workspaces.length === 0 && /* @__PURE__ */ (0,
|
|
13678
|
-
target.phase === "failed" && /* @__PURE__ */ (0,
|
|
13679
|
-
shells.phase === "failed" && /* @__PURE__ */ (0,
|
|
13680
|
-
/* @__PURE__ */ (0,
|
|
13875
|
+
state.workspaces.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: ERROR_STYLE, role: "status", children: state.busy ? t("terminalLoading") : t("unavailable") }),
|
|
13876
|
+
target.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: ERROR_STYLE, role: "alert", children: target.message }),
|
|
13877
|
+
shells.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: ERROR_STYLE, role: "alert", children: t("terminalShellsFailed", { message: shells.message }) }),
|
|
13878
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref: node, className: XTERM_CLASS, style: SCREEN_STYLE })
|
|
13681
13879
|
] });
|
|
13682
13880
|
}
|
|
13683
13881
|
var ROOT_STYLE = {
|
|
@@ -13727,8 +13925,8 @@ var SCREEN_STYLE = {
|
|
|
13727
13925
|
};
|
|
13728
13926
|
|
|
13729
13927
|
// src/client/podman-terminal-guide.tsx
|
|
13730
|
-
var
|
|
13731
|
-
var
|
|
13928
|
+
var import_dsh_client_ui_primitives15 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
13929
|
+
var import_react15 = require("react");
|
|
13732
13930
|
|
|
13733
13931
|
// src/client/terminal-tab.ts
|
|
13734
13932
|
var PODMAN_TERMINAL_KIND = "podman-terminal";
|
|
@@ -13789,23 +13987,23 @@ function writeTerminalTarget(target, storage) {
|
|
|
13789
13987
|
}
|
|
13790
13988
|
|
|
13791
13989
|
// src/client/podman-terminal-guide.tsx
|
|
13792
|
-
var
|
|
13990
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
13793
13991
|
function PodmanTerminalGuide(props) {
|
|
13794
13992
|
const { t, sessionId } = props;
|
|
13795
13993
|
const { tab } = props.useTabInfo();
|
|
13796
13994
|
const state = props.useContainerCard((snapshot) => snapshot);
|
|
13797
|
-
const [target, setTarget] = (0,
|
|
13995
|
+
const [target, setTarget] = (0, import_react15.useState)({ phase: "loading" });
|
|
13798
13996
|
const workspace = target.phase === "ready" ? target.target.workspace : void 0;
|
|
13799
13997
|
const workspaceSlug = target.phase === "ready" ? target.target.workspaceSlug : void 0;
|
|
13800
13998
|
const unknownWorkspace = target.phase === "failed";
|
|
13801
|
-
const [container, setContainer] = (0,
|
|
13802
|
-
const [shells, setShells] = (0,
|
|
13803
|
-
const [shell, setShell] = (0,
|
|
13804
|
-
const [stored] = (0,
|
|
13805
|
-
(0,
|
|
13999
|
+
const [container, setContainer] = (0, import_react15.useState)(void 0);
|
|
14000
|
+
const [shells, setShells] = (0, import_react15.useState)({ phase: "loading" });
|
|
14001
|
+
const [shell, setShell] = (0, import_react15.useState)(void 0);
|
|
14002
|
+
const [stored] = (0, import_react15.useState)(() => readTerminalTarget());
|
|
14003
|
+
(0, import_react15.useEffect)(() => {
|
|
13806
14004
|
props.reload();
|
|
13807
14005
|
}, [props.reload]);
|
|
13808
|
-
(0,
|
|
14006
|
+
(0, import_react15.useEffect)(() => {
|
|
13809
14007
|
const controller = new AbortController();
|
|
13810
14008
|
setTarget({ phase: "loading" });
|
|
13811
14009
|
void fetchTerminalTarget(sessionId, controller.signal).then(
|
|
@@ -13826,7 +14024,7 @@ function PodmanTerminalGuide(props) {
|
|
|
13826
14024
|
controller.abort();
|
|
13827
14025
|
};
|
|
13828
14026
|
}, [sessionId]);
|
|
13829
|
-
(0,
|
|
14027
|
+
(0, import_react15.useEffect)(() => {
|
|
13830
14028
|
if (unknownWorkspace || workspace === void 0 || container !== void 0) {
|
|
13831
14029
|
return;
|
|
13832
14030
|
}
|
|
@@ -13846,7 +14044,7 @@ function PodmanTerminalGuide(props) {
|
|
|
13846
14044
|
workspaceSlug,
|
|
13847
14045
|
stored
|
|
13848
14046
|
]);
|
|
13849
|
-
(0,
|
|
14047
|
+
(0, import_react15.useEffect)(() => {
|
|
13850
14048
|
if (workspace === void 0 || workspace === "" || container === void 0) {
|
|
13851
14049
|
return;
|
|
13852
14050
|
}
|
|
@@ -13879,18 +14077,18 @@ function PodmanTerminalGuide(props) {
|
|
|
13879
14077
|
}, [workspace, container, sessionId]);
|
|
13880
14078
|
const shellList = shells.phase === "ready" ? shells.shells : [];
|
|
13881
14079
|
const ready = !unknownWorkspace && container !== void 0 && shell !== void 0 && shellList.length > 0;
|
|
13882
|
-
return /* @__PURE__ */ (0,
|
|
13883
|
-
/* @__PURE__ */ (0,
|
|
13884
|
-
/* @__PURE__ */ (0,
|
|
13885
|
-
/* @__PURE__ */ (0,
|
|
13886
|
-
/* @__PURE__ */ (0,
|
|
13887
|
-
props.description === void 0 ? null : /* @__PURE__ */ (0,
|
|
14080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: CARD_STYLE, "data-sidebar-right-guide-entry": props.kind, children: [
|
|
14081
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: HEADER_STYLE, children: [
|
|
14082
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: ICON_STYLE, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_dsh_client_ui_primitives15.PluginArtworkTerminal, { size: 22 }) }),
|
|
14083
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: TEXT_STYLE, children: [
|
|
14084
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: TITLE_STYLE2, children: props.title }),
|
|
14085
|
+
props.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: DESCRIPTION_STYLE, children: props.description })
|
|
13888
14086
|
] })
|
|
13889
14087
|
] }),
|
|
13890
|
-
state.workspaces.length === 0 ? /* @__PURE__ */ (0,
|
|
13891
|
-
target.phase === "failed" && /* @__PURE__ */ (0,
|
|
13892
|
-
/* @__PURE__ */ (0,
|
|
13893
|
-
/* @__PURE__ */ (0,
|
|
14088
|
+
state.workspaces.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: hint, role: "status", children: state.busy ? t("terminalLoading") : t("unavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
14089
|
+
target.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: hint, role: "alert", children: target.message }),
|
|
14090
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: FIELDS_STYLE, children: [
|
|
14091
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
13894
14092
|
ContainerField,
|
|
13895
14093
|
{
|
|
13896
14094
|
containers: state.containers,
|
|
@@ -13906,8 +14104,8 @@ function PodmanTerminalGuide(props) {
|
|
|
13906
14104
|
}
|
|
13907
14105
|
}
|
|
13908
14106
|
),
|
|
13909
|
-
/* @__PURE__ */ (0,
|
|
13910
|
-
/* @__PURE__ */ (0,
|
|
14107
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: fieldLabel, children: t("terminalShell") }),
|
|
14108
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
13911
14109
|
"select",
|
|
13912
14110
|
{
|
|
13913
14111
|
style: fieldSelect,
|
|
@@ -13917,15 +14115,15 @@ function PodmanTerminalGuide(props) {
|
|
|
13917
14115
|
onChange: (event) => {
|
|
13918
14116
|
setShell(event.target.value);
|
|
13919
14117
|
},
|
|
13920
|
-
children: shellList.length === 0 ? /* @__PURE__ */ (0,
|
|
14118
|
+
children: shellList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "", children: unknownWorkspace ? "" : shells.phase === "loading" ? t("terminalLoading") : t("terminalNoShells") }) : shellList.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: entry.path, children: entry.name }, entry.path))
|
|
13921
14119
|
}
|
|
13922
14120
|
)
|
|
13923
14121
|
] }),
|
|
13924
|
-
!unknownWorkspace && shells.phase === "failed" && /* @__PURE__ */ (0,
|
|
13925
|
-
!unknownWorkspace && shells.phase === "loading" && /* @__PURE__ */ (0,
|
|
13926
|
-
!unknownWorkspace && shells.phase === "ready" && shellList.length === 0 && /* @__PURE__ */ (0,
|
|
13927
|
-
/* @__PURE__ */ (0,
|
|
13928
|
-
|
|
14122
|
+
!unknownWorkspace && shells.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: hint, role: "alert", children: t("terminalShellsFailed", { message: shells.message }) }),
|
|
14123
|
+
!unknownWorkspace && shells.phase === "loading" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: hint, role: "status", children: t("terminalLoading") }),
|
|
14124
|
+
!unknownWorkspace && shells.phase === "ready" && shellList.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: hint, role: "status", children: t("terminalNoShells") }),
|
|
14125
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: ACTIONS_STYLE, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14126
|
+
import_dsh_client_ui_primitives15.Button,
|
|
13929
14127
|
{
|
|
13930
14128
|
variant: "primary",
|
|
13931
14129
|
size: "sm",
|
|
@@ -14010,24 +14208,24 @@ var ACTIONS_STYLE = {
|
|
|
14010
14208
|
};
|
|
14011
14209
|
|
|
14012
14210
|
// src/client/podman-terminal-title.tsx
|
|
14013
|
-
var
|
|
14014
|
-
var
|
|
14211
|
+
var import_react16 = require("react");
|
|
14212
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
14015
14213
|
function PodmanTerminalTitle(props) {
|
|
14016
14214
|
const { tab } = props.useTabInfo();
|
|
14017
14215
|
const params = tab.navigation.params;
|
|
14018
14216
|
const key = `${props.sessionId}:${tab.id}`;
|
|
14019
14217
|
const fallback = shellName(params?.shell) ?? tab.title;
|
|
14020
|
-
const title = (0,
|
|
14218
|
+
const title = (0, import_react16.useSyncExternalStore)(
|
|
14021
14219
|
subscribeTerminalTitles,
|
|
14022
14220
|
() => terminalTitle(key) ?? fallback
|
|
14023
14221
|
);
|
|
14024
|
-
return /* @__PURE__ */ (0,
|
|
14025
|
-
/* @__PURE__ */ (0,
|
|
14026
|
-
/* @__PURE__ */ (0,
|
|
14222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { style: CHIP_STYLE, children: [
|
|
14223
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TerminalGlyph, {}),
|
|
14224
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: TITLE_STYLE3, children: title })
|
|
14027
14225
|
] });
|
|
14028
14226
|
}
|
|
14029
14227
|
function TerminalGlyph() {
|
|
14030
|
-
return /* @__PURE__ */ (0,
|
|
14228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
14031
14229
|
"svg",
|
|
14032
14230
|
{
|
|
14033
14231
|
width: "16",
|
|
@@ -14036,8 +14234,8 @@ function TerminalGlyph() {
|
|
|
14036
14234
|
fill: "none",
|
|
14037
14235
|
"aria-hidden": "true",
|
|
14038
14236
|
children: [
|
|
14039
|
-
/* @__PURE__ */ (0,
|
|
14040
|
-
/* @__PURE__ */ (0,
|
|
14237
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M3 4L7 8L3 12", stroke: "currentColor" }),
|
|
14238
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M9 12H13", stroke: "currentColor" })
|
|
14041
14239
|
]
|
|
14042
14240
|
}
|
|
14043
14241
|
);
|
|
@@ -14055,19 +14253,19 @@ var TITLE_STYLE3 = {
|
|
|
14055
14253
|
};
|
|
14056
14254
|
|
|
14057
14255
|
// src/client/read-only-approval.tsx
|
|
14058
|
-
var
|
|
14059
|
-
var
|
|
14060
|
-
var
|
|
14256
|
+
var import_dsh_client_ui_primitives16 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
14257
|
+
var import_react17 = require("react");
|
|
14258
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14061
14259
|
var BUILTIN_PROMPT_PREFIX = "dsh_podman_builtin_";
|
|
14062
14260
|
function ReadOnlyApprovalPanel(props) {
|
|
14063
|
-
return /* @__PURE__ */ (0,
|
|
14261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ReadOnlyApprovalFlow, { ...props }, props.matched.key);
|
|
14064
14262
|
}
|
|
14065
14263
|
function ReadOnlyApprovalFlow({
|
|
14066
14264
|
t,
|
|
14067
14265
|
matched
|
|
14068
14266
|
}) {
|
|
14069
|
-
const [answered, setAnswered] = (0,
|
|
14070
|
-
const [error, setError] = (0,
|
|
14267
|
+
const [answered, setAnswered] = (0, import_react17.useState)(false);
|
|
14268
|
+
const [error, setError] = (0, import_react17.useState)("");
|
|
14071
14269
|
const answer = (outcome) => {
|
|
14072
14270
|
setAnswered(true);
|
|
14073
14271
|
setError("");
|
|
@@ -14076,7 +14274,7 @@ function ReadOnlyApprovalFlow({
|
|
|
14076
14274
|
setError(failure3 instanceof Error ? failure3.message : String(failure3));
|
|
14077
14275
|
});
|
|
14078
14276
|
};
|
|
14079
|
-
return /* @__PURE__ */ (0,
|
|
14277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14080
14278
|
"div",
|
|
14081
14279
|
{
|
|
14082
14280
|
style: {
|
|
@@ -14085,7 +14283,7 @@ function ReadOnlyApprovalFlow({
|
|
|
14085
14283
|
alignItems: "center",
|
|
14086
14284
|
padding: "8px calc(var(--dsh-composer-side-clearance) + 16px) 12px"
|
|
14087
14285
|
},
|
|
14088
|
-
children: /* @__PURE__ */ (0,
|
|
14286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14089
14287
|
"div",
|
|
14090
14288
|
{
|
|
14091
14289
|
style: {
|
|
@@ -14098,7 +14296,7 @@ function ReadOnlyApprovalFlow({
|
|
|
14098
14296
|
boxShadow: "var(--dsw-shadow-lv2)"
|
|
14099
14297
|
},
|
|
14100
14298
|
children: [
|
|
14101
|
-
/* @__PURE__ */ (0,
|
|
14299
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14102
14300
|
"div",
|
|
14103
14301
|
{
|
|
14104
14302
|
role: "status",
|
|
@@ -14114,7 +14312,7 @@ function ReadOnlyApprovalFlow({
|
|
|
14114
14312
|
lineHeight: "18px"
|
|
14115
14313
|
},
|
|
14116
14314
|
children: [
|
|
14117
|
-
/* @__PURE__ */ (0,
|
|
14315
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14118
14316
|
"span",
|
|
14119
14317
|
{
|
|
14120
14318
|
style: {
|
|
@@ -14129,7 +14327,7 @@ function ReadOnlyApprovalFlow({
|
|
|
14129
14327
|
]
|
|
14130
14328
|
}
|
|
14131
14329
|
),
|
|
14132
|
-
/* @__PURE__ */ (0,
|
|
14330
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14133
14331
|
"div",
|
|
14134
14332
|
{
|
|
14135
14333
|
style: {
|
|
@@ -14138,7 +14336,7 @@ function ReadOnlyApprovalFlow({
|
|
|
14138
14336
|
overflowY: "auto",
|
|
14139
14337
|
padding: "12px 16px 0"
|
|
14140
14338
|
},
|
|
14141
|
-
children: /* @__PURE__ */ (0,
|
|
14339
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14142
14340
|
"div",
|
|
14143
14341
|
{
|
|
14144
14342
|
style: {
|
|
@@ -14153,7 +14351,7 @@ function ReadOnlyApprovalFlow({
|
|
|
14153
14351
|
)
|
|
14154
14352
|
}
|
|
14155
14353
|
),
|
|
14156
|
-
error === "" ? null : /* @__PURE__ */ (0,
|
|
14354
|
+
error === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14157
14355
|
"p",
|
|
14158
14356
|
{
|
|
14159
14357
|
role: "alert",
|
|
@@ -14166,7 +14364,7 @@ function ReadOnlyApprovalFlow({
|
|
|
14166
14364
|
children: error
|
|
14167
14365
|
}
|
|
14168
14366
|
),
|
|
14169
|
-
/* @__PURE__ */ (0,
|
|
14367
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14170
14368
|
"div",
|
|
14171
14369
|
{
|
|
14172
14370
|
style: {
|
|
@@ -14176,8 +14374,8 @@ function ReadOnlyApprovalFlow({
|
|
|
14176
14374
|
padding: "14px 16px"
|
|
14177
14375
|
},
|
|
14178
14376
|
children: [
|
|
14179
|
-
/* @__PURE__ */ (0,
|
|
14180
|
-
|
|
14377
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14378
|
+
import_dsh_client_ui_primitives16.Button,
|
|
14181
14379
|
{
|
|
14182
14380
|
variant: "outline",
|
|
14183
14381
|
size: "sm",
|
|
@@ -14186,8 +14384,8 @@ function ReadOnlyApprovalFlow({
|
|
|
14186
14384
|
children: t("remountReject")
|
|
14187
14385
|
}
|
|
14188
14386
|
),
|
|
14189
|
-
/* @__PURE__ */ (0,
|
|
14190
|
-
|
|
14387
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14388
|
+
import_dsh_client_ui_primitives16.Button,
|
|
14191
14389
|
{
|
|
14192
14390
|
variant: "primary",
|
|
14193
14391
|
size: "sm",
|
|
@@ -14207,223 +14405,240 @@ function ReadOnlyApprovalFlow({
|
|
|
14207
14405
|
}
|
|
14208
14406
|
|
|
14209
14407
|
// src/client/tool-views.tsx
|
|
14210
|
-
var
|
|
14211
|
-
var
|
|
14212
|
-
|
|
14213
|
-
// src/client/terminal-styles.ts
|
|
14214
|
-
var TERMINAL_CLASS = "dsh-podman-terminal";
|
|
14215
|
-
var TERMINAL_STYLES = `
|
|
14216
|
-
.dsh-podman-terminal {
|
|
14217
|
-
--dsl-terminal-font: var(--dsw-font-markdown-code-block-small);
|
|
14218
|
-
--dsl-terminal-line-height: 18px;
|
|
14219
|
-
--dsl-terminal-output-max-height: 224px;
|
|
14220
|
-
margin: 4px 0 4px 4px;
|
|
14221
|
-
border: 1px solid var(--dsw-alias-border-l1);
|
|
14222
|
-
}
|
|
14223
|
-
`;
|
|
14224
|
-
function installTerminalStyles(ctx) {
|
|
14225
|
-
if (typeof document === "undefined") return;
|
|
14226
|
-
ctx.effect(() => {
|
|
14227
|
-
const tag = document.createElement("style");
|
|
14228
|
-
tag.dataset.plugin = "@exagone313/dsh-podman";
|
|
14229
|
-
tag.textContent = TERMINAL_STYLES;
|
|
14230
|
-
document.head.appendChild(tag);
|
|
14231
|
-
return () => {
|
|
14232
|
-
tag.remove();
|
|
14233
|
-
};
|
|
14234
|
-
}, "podman: terminal styles");
|
|
14235
|
-
}
|
|
14408
|
+
var import_react18 = require("react");
|
|
14409
|
+
var import_dsh_client_ui_primitives17 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
14236
14410
|
|
|
14237
|
-
// src/client/tool-
|
|
14238
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14411
|
+
// src/client/tool-presentations.ts
|
|
14239
14412
|
var TOOL_PRESENTATION = {
|
|
14240
14413
|
container_bash: {
|
|
14241
14414
|
titleKey: "toolTitle_container_bash",
|
|
14242
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconApiOutlineRegular, { size: 14 }),
|
|
14243
14415
|
summaryKeys: ["description", "command"]
|
|
14244
14416
|
},
|
|
14245
14417
|
container_exec: {
|
|
14246
14418
|
titleKey: "toolTitle_container_exec",
|
|
14247
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconApiOutlineRegular, { size: 14 }),
|
|
14248
14419
|
summaryKeys: ["description", "argv"]
|
|
14249
14420
|
},
|
|
14250
14421
|
container_read: {
|
|
14251
14422
|
titleKey: "toolTitle_container_read",
|
|
14252
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconBrowseOutlineRegular, { size: 14 }),
|
|
14253
14423
|
summaryKeys: ["file_path"]
|
|
14254
14424
|
},
|
|
14255
14425
|
container_write: {
|
|
14256
14426
|
titleKey: "toolTitle_container_write",
|
|
14257
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconEditOutlineRegular, { size: 14 }),
|
|
14258
14427
|
summaryKeys: ["file_path"]
|
|
14259
14428
|
},
|
|
14260
14429
|
container_edit: {
|
|
14261
14430
|
titleKey: "toolTitle_container_edit",
|
|
14262
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconEditOutlineRegular, { size: 14 }),
|
|
14263
14431
|
summaryKeys: ["file_path"]
|
|
14264
14432
|
},
|
|
14265
14433
|
container_glob: {
|
|
14266
14434
|
titleKey: "toolTitle_container_glob",
|
|
14267
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconSearchOutlineRegular, { size: 14 }),
|
|
14268
14435
|
summaryKeys: ["pattern"]
|
|
14269
14436
|
},
|
|
14270
14437
|
container_grep: {
|
|
14271
14438
|
titleKey: "toolTitle_container_grep",
|
|
14272
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconSearchOutlineRegular, { size: 14 }),
|
|
14273
14439
|
summaryKeys: ["pattern"]
|
|
14274
14440
|
},
|
|
14275
14441
|
container_list: {
|
|
14276
14442
|
titleKey: "toolTitle_container_list",
|
|
14277
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconDataOutlineRegular, { size: 14 }),
|
|
14278
14443
|
summaryKeys: []
|
|
14279
14444
|
},
|
|
14280
14445
|
container_start: {
|
|
14281
14446
|
titleKey: "toolTitle_container_start",
|
|
14282
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconPlayOutlineRegular, { size: 14 }),
|
|
14283
14447
|
summaryKeys: ["container", "image"]
|
|
14284
14448
|
},
|
|
14285
14449
|
container_recreate: {
|
|
14286
14450
|
titleKey: "toolTitle_container_recreate",
|
|
14287
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutlineRegular, { size: 14 }),
|
|
14288
14451
|
summaryKeys: ["container", "image"]
|
|
14289
14452
|
},
|
|
14290
14453
|
container_remove: {
|
|
14291
14454
|
titleKey: "toolTitle_container_remove",
|
|
14292
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconTrashOutlineRegular, { size: 14 }),
|
|
14293
14455
|
summaryKeys: ["container"]
|
|
14294
14456
|
},
|
|
14295
14457
|
container_mount_list: {
|
|
14296
14458
|
titleKey: "toolTitle_container_mount_list",
|
|
14297
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconFolderOpenOutlineRegular, { size: 14 }),
|
|
14298
14459
|
summaryKeys: ["container"]
|
|
14299
14460
|
},
|
|
14300
14461
|
container_mount_add: {
|
|
14301
14462
|
titleKey: "toolTitle_container_mount_add",
|
|
14302
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconFolderOpenOutlineRegular, { size: 14 }),
|
|
14303
14463
|
summaryKeys: ["container", "kind"]
|
|
14304
14464
|
},
|
|
14305
14465
|
container_mount_remove: {
|
|
14306
14466
|
titleKey: "toolTitle_container_mount_remove",
|
|
14307
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconTrashOutlineRegular, { size: 14 }),
|
|
14308
14467
|
summaryKeys: ["container"]
|
|
14309
14468
|
},
|
|
14310
14469
|
container_mount_update: {
|
|
14311
14470
|
titleKey: "toolTitle_container_mount_update",
|
|
14312
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutlineRegular, { size: 14 }),
|
|
14313
14471
|
summaryKeys: ["container", "mode"]
|
|
14314
14472
|
},
|
|
14473
|
+
container_publish_port: {
|
|
14474
|
+
titleKey: "toolTitle_container_publish_port",
|
|
14475
|
+
summaryKeys: ["port", "container"]
|
|
14476
|
+
},
|
|
14477
|
+
container_unpublish_port: {
|
|
14478
|
+
titleKey: "toolTitle_container_unpublish_port",
|
|
14479
|
+
summaryKeys: ["port", "container"]
|
|
14480
|
+
},
|
|
14315
14481
|
container_path_set: {
|
|
14316
14482
|
titleKey: "toolTitle_container_path_set",
|
|
14317
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconEditOutlineRegular, { size: 14 }),
|
|
14318
14483
|
summaryKeys: ["container"]
|
|
14319
14484
|
},
|
|
14320
14485
|
container_path_add: {
|
|
14321
14486
|
titleKey: "toolTitle_container_path_add",
|
|
14322
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconPlusOutlineRegular, { size: 14 }),
|
|
14323
14487
|
summaryKeys: ["container", "path"]
|
|
14324
14488
|
},
|
|
14325
14489
|
container_path_remove: {
|
|
14326
14490
|
titleKey: "toolTitle_container_path_remove",
|
|
14327
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconTrashOutlineRegular, { size: 14 }),
|
|
14328
14491
|
summaryKeys: ["container", "path"]
|
|
14329
14492
|
},
|
|
14330
14493
|
container_secret_add: {
|
|
14331
14494
|
titleKey: "toolTitle_container_secret_add",
|
|
14332
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconLinkOutlineRegular, { size: 14 }),
|
|
14333
14495
|
summaryKeys: ["container", "env"]
|
|
14334
14496
|
},
|
|
14335
14497
|
container_secret_remove: {
|
|
14336
14498
|
titleKey: "toolTitle_container_secret_remove",
|
|
14337
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconLinkOutlineRegular, { size: 14 }),
|
|
14338
14499
|
summaryKeys: ["container", "env"]
|
|
14339
14500
|
},
|
|
14340
14501
|
image_list: {
|
|
14341
14502
|
titleKey: "toolTitle_image_list",
|
|
14342
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconArchiveOutlineRegular, { size: 14 }),
|
|
14343
14503
|
summaryKeys: []
|
|
14344
14504
|
},
|
|
14345
14505
|
image_get: {
|
|
14346
14506
|
titleKey: "toolTitle_image_get",
|
|
14347
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconArchiveOutlineRegular, { size: 14 }),
|
|
14348
14507
|
summaryKeys: ["imageId"]
|
|
14349
14508
|
},
|
|
14350
14509
|
image_build: {
|
|
14351
14510
|
titleKey: "toolTitle_image_build",
|
|
14352
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconPlusOutlineRegular, { size: 14 }),
|
|
14353
14511
|
summaryKeys: ["imageId", "parent"]
|
|
14354
14512
|
},
|
|
14355
14513
|
image_rebuild: {
|
|
14356
14514
|
titleKey: "toolTitle_image_rebuild",
|
|
14357
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutlineRegular, { size: 14 }),
|
|
14358
14515
|
summaryKeys: ["imageId"]
|
|
14359
14516
|
},
|
|
14360
14517
|
image_rebuild_all: {
|
|
14361
14518
|
titleKey: "toolTitle_image_rebuild_all",
|
|
14362
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutlineRegular, { size: 14 }),
|
|
14363
14519
|
summaryKeys: []
|
|
14364
14520
|
},
|
|
14365
14521
|
image_remove: {
|
|
14366
14522
|
titleKey: "toolTitle_image_remove",
|
|
14367
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconTrashOutlineRegular, { size: 14 }),
|
|
14368
14523
|
summaryKeys: ["imageId"]
|
|
14369
14524
|
},
|
|
14370
14525
|
volume_list: {
|
|
14371
14526
|
titleKey: "toolTitle_volume_list",
|
|
14372
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconDataOutlineRegular, { size: 14 }),
|
|
14373
14527
|
summaryKeys: []
|
|
14374
14528
|
},
|
|
14375
14529
|
volume_create: {
|
|
14376
14530
|
titleKey: "toolTitle_volume_create",
|
|
14377
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconPlusOutlineRegular, { size: 14 }),
|
|
14378
14531
|
summaryKeys: ["name"]
|
|
14379
14532
|
},
|
|
14380
14533
|
volume_remove: {
|
|
14381
14534
|
titleKey: "toolTitle_volume_remove",
|
|
14382
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconTrashOutlineRegular, { size: 14 }),
|
|
14383
14535
|
summaryKeys: ["name"]
|
|
14384
14536
|
},
|
|
14385
14537
|
secret_list: {
|
|
14386
14538
|
titleKey: "toolTitle_secret_list",
|
|
14387
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconLinkOutlineRegular, { size: 14 }),
|
|
14388
14539
|
summaryKeys: []
|
|
14389
14540
|
},
|
|
14390
14541
|
secret_create: {
|
|
14391
14542
|
titleKey: "toolTitle_secret_create",
|
|
14392
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconPlusOutlineRegular, { size: 14 }),
|
|
14393
14543
|
summaryKeys: ["name"]
|
|
14394
14544
|
},
|
|
14395
14545
|
secret_remove: {
|
|
14396
14546
|
titleKey: "toolTitle_secret_remove",
|
|
14397
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconTrashOutlineRegular, { size: 14 }),
|
|
14398
14547
|
summaryKeys: ["name"]
|
|
14399
14548
|
},
|
|
14400
14549
|
daemon_start: {
|
|
14401
14550
|
titleKey: "toolTitle_daemon_start",
|
|
14402
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconPlayOutlineRegular, { size: 14 }),
|
|
14403
14551
|
summaryKeys: ["name"]
|
|
14404
14552
|
},
|
|
14405
14553
|
daemon_list: {
|
|
14406
14554
|
titleKey: "toolTitle_daemon_list",
|
|
14407
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconPlayOutlineRegular, { size: 14 }),
|
|
14408
14555
|
summaryKeys: ["container"]
|
|
14409
14556
|
},
|
|
14410
14557
|
daemon_logs: {
|
|
14411
14558
|
titleKey: "toolTitle_daemon_logs",
|
|
14412
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconBrowseOutlineRegular, { size: 14 }),
|
|
14413
14559
|
summaryKeys: ["name"]
|
|
14414
14560
|
},
|
|
14415
14561
|
daemon_restart: {
|
|
14416
14562
|
titleKey: "toolTitle_daemon_restart",
|
|
14417
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutlineRegular, { size: 14 }),
|
|
14418
14563
|
summaryKeys: ["name"]
|
|
14419
14564
|
},
|
|
14420
14565
|
daemon_stop: {
|
|
14421
14566
|
titleKey: "toolTitle_daemon_stop",
|
|
14422
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives16.IconStopFillRegular, { size: 14 }),
|
|
14423
14567
|
summaryKeys: ["name"]
|
|
14424
14568
|
}
|
|
14425
14569
|
};
|
|
14426
14570
|
var TOOL_VIEW_KEYS = Object.keys(TOOL_PRESENTATION);
|
|
14571
|
+
function toolPresentation(name2) {
|
|
14572
|
+
return TOOL_PRESENTATION[name2];
|
|
14573
|
+
}
|
|
14574
|
+
|
|
14575
|
+
// src/client/terminal-styles.ts
|
|
14576
|
+
var TERMINAL_CLASS = "dsh-podman-terminal";
|
|
14577
|
+
var TERMINAL_STYLES = `
|
|
14578
|
+
.dsh-podman-terminal {
|
|
14579
|
+
--dsl-terminal-font: var(--dsw-font-markdown-code-block-small);
|
|
14580
|
+
--dsl-terminal-line-height: 18px;
|
|
14581
|
+
--dsl-terminal-output-max-height: 224px;
|
|
14582
|
+
margin: 4px 0 4px 4px;
|
|
14583
|
+
border: 1px solid var(--dsw-alias-border-l1);
|
|
14584
|
+
}
|
|
14585
|
+
`;
|
|
14586
|
+
function installTerminalStyles(ctx) {
|
|
14587
|
+
if (typeof document === "undefined") return;
|
|
14588
|
+
ctx.effect(() => {
|
|
14589
|
+
const tag = document.createElement("style");
|
|
14590
|
+
tag.dataset.plugin = "@exagone313/dsh-podman";
|
|
14591
|
+
tag.textContent = TERMINAL_STYLES;
|
|
14592
|
+
document.head.appendChild(tag);
|
|
14593
|
+
return () => {
|
|
14594
|
+
tag.remove();
|
|
14595
|
+
};
|
|
14596
|
+
}, "podman: terminal styles");
|
|
14597
|
+
}
|
|
14598
|
+
|
|
14599
|
+
// src/client/tool-views.tsx
|
|
14600
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
14601
|
+
var TOOL_ICONS = {
|
|
14602
|
+
container_bash: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconApiOutlineRegular, { size: 14 }),
|
|
14603
|
+
container_exec: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconApiOutlineRegular, { size: 14 }),
|
|
14604
|
+
container_read: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconBrowseOutlineRegular, { size: 14 }),
|
|
14605
|
+
container_write: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconEditOutlineRegular, { size: 14 }),
|
|
14606
|
+
container_edit: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconEditOutlineRegular, { size: 14 }),
|
|
14607
|
+
container_glob: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconSearchOutlineRegular, { size: 14 }),
|
|
14608
|
+
container_grep: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconSearchOutlineRegular, { size: 14 }),
|
|
14609
|
+
container_list: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconDataOutlineRegular, { size: 14 }),
|
|
14610
|
+
container_start: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconPlayOutlineRegular, { size: 14 }),
|
|
14611
|
+
container_recreate: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconRefreshOutlineRegular, { size: 14 }),
|
|
14612
|
+
container_remove: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconTrashOutlineRegular, { size: 14 }),
|
|
14613
|
+
container_mount_list: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconFolderOpenOutlineRegular, { size: 14 }),
|
|
14614
|
+
container_mount_add: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconFolderOpenOutlineRegular, { size: 14 }),
|
|
14615
|
+
container_mount_remove: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconTrashOutlineRegular, { size: 14 }),
|
|
14616
|
+
container_mount_update: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconRefreshOutlineRegular, { size: 14 }),
|
|
14617
|
+
container_publish_port: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconLinkOutlineRegular, { size: 14 }),
|
|
14618
|
+
container_unpublish_port: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconTrashOutlineRegular, { size: 14 }),
|
|
14619
|
+
container_path_set: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconEditOutlineRegular, { size: 14 }),
|
|
14620
|
+
container_path_add: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconPlusOutlineRegular, { size: 14 }),
|
|
14621
|
+
container_path_remove: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconTrashOutlineRegular, { size: 14 }),
|
|
14622
|
+
container_secret_add: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconLinkOutlineRegular, { size: 14 }),
|
|
14623
|
+
container_secret_remove: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconLinkOutlineRegular, { size: 14 }),
|
|
14624
|
+
image_list: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconArchiveOutlineRegular, { size: 14 }),
|
|
14625
|
+
image_get: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconArchiveOutlineRegular, { size: 14 }),
|
|
14626
|
+
image_build: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconPlusOutlineRegular, { size: 14 }),
|
|
14627
|
+
image_rebuild: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconRefreshOutlineRegular, { size: 14 }),
|
|
14628
|
+
image_rebuild_all: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconRefreshOutlineRegular, { size: 14 }),
|
|
14629
|
+
image_remove: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconTrashOutlineRegular, { size: 14 }),
|
|
14630
|
+
volume_list: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconDataOutlineRegular, { size: 14 }),
|
|
14631
|
+
volume_create: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconPlusOutlineRegular, { size: 14 }),
|
|
14632
|
+
volume_remove: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconTrashOutlineRegular, { size: 14 }),
|
|
14633
|
+
secret_list: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconLinkOutlineRegular, { size: 14 }),
|
|
14634
|
+
secret_create: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconPlusOutlineRegular, { size: 14 }),
|
|
14635
|
+
secret_remove: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconTrashOutlineRegular, { size: 14 }),
|
|
14636
|
+
daemon_start: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconPlayOutlineRegular, { size: 14 }),
|
|
14637
|
+
daemon_list: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconPlayOutlineRegular, { size: 14 }),
|
|
14638
|
+
daemon_logs: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconBrowseOutlineRegular, { size: 14 }),
|
|
14639
|
+
daemon_restart: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconRefreshOutlineRegular, { size: 14 }),
|
|
14640
|
+
daemon_stop: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconStopFillRegular, { size: 14 })
|
|
14641
|
+
};
|
|
14427
14642
|
var sepStyle = {
|
|
14428
14643
|
flex: "none",
|
|
14429
14644
|
width: "2px",
|
|
@@ -14485,6 +14700,7 @@ function argSummary(args, keys, fallback) {
|
|
|
14485
14700
|
for (const key of keys) {
|
|
14486
14701
|
const value = args[key];
|
|
14487
14702
|
if (typeof value === "string" && value !== "") return firstLine(value);
|
|
14703
|
+
if (typeof value === "number") return String(value);
|
|
14488
14704
|
if (Array.isArray(value) && value.length > 0) {
|
|
14489
14705
|
return firstLine(value.map((item) => String(item)).join(" "));
|
|
14490
14706
|
}
|
|
@@ -14579,7 +14795,7 @@ function PodmanToolRow({
|
|
|
14579
14795
|
inspect,
|
|
14580
14796
|
t
|
|
14581
14797
|
}) {
|
|
14582
|
-
const presentation =
|
|
14798
|
+
const presentation = toolPresentation(toolName);
|
|
14583
14799
|
const title = presentation === void 0 ? toolName : t(presentation.titleKey);
|
|
14584
14800
|
const settled = "kind" in block;
|
|
14585
14801
|
const argsRaw = (settled ? block.call?.argsRaw : block.argsRaw) ?? "";
|
|
@@ -14593,12 +14809,12 @@ function PodmanToolRow({
|
|
|
14593
14809
|
presentation?.summaryKeys ?? [],
|
|
14594
14810
|
firstLine(argsRaw) || block.callId
|
|
14595
14811
|
);
|
|
14596
|
-
const [expanded, setExpanded] = (0,
|
|
14812
|
+
const [expanded, setExpanded] = (0, import_react18.useState)(false);
|
|
14597
14813
|
const expandable = terminal !== null || output !== null && output !== "";
|
|
14598
|
-
const leading = state === "error" ? /* @__PURE__ */ (0,
|
|
14814
|
+
const leading = state === "error" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.StateDot, { state: "error" }) : state === "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.StateDot, { state: "warning" }) : presentation === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives17.IconSparkleRegular, { size: 14 }) : TOOL_ICONS[toolName];
|
|
14599
14815
|
void inspect;
|
|
14600
|
-
return /* @__PURE__ */ (0,
|
|
14601
|
-
|
|
14816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14817
|
+
import_dsh_client_ui_primitives17.DisclosureRow,
|
|
14602
14818
|
{
|
|
14603
14819
|
icon: leading,
|
|
14604
14820
|
title,
|
|
@@ -14607,12 +14823,12 @@ function PodmanToolRow({
|
|
|
14607
14823
|
onToggle: () => setExpanded((value) => !value),
|
|
14608
14824
|
expandOnRowClick: true,
|
|
14609
14825
|
keepContentWhenOpen: true,
|
|
14610
|
-
collapsedContent: /* @__PURE__ */ (0,
|
|
14611
|
-
/* @__PURE__ */ (0,
|
|
14612
|
-
/* @__PURE__ */ (0,
|
|
14826
|
+
collapsedContent: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
14827
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { style: sepStyle, "aria-hidden": true }),
|
|
14828
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { style: failureLine !== null ? errorSummaryStyle : summaryStyle, children: summary })
|
|
14613
14829
|
] }),
|
|
14614
|
-
children: terminal !== null ? /* @__PURE__ */ (0,
|
|
14615
|
-
|
|
14830
|
+
children: terminal !== null ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14831
|
+
import_dsh_client_ui_primitives17.TerminalBlock,
|
|
14616
14832
|
{
|
|
14617
14833
|
command: terminal.command,
|
|
14618
14834
|
cwd: terminal.cwd,
|
|
@@ -14625,7 +14841,7 @@ function PodmanToolRow({
|
|
|
14625
14841
|
className: TERMINAL_CLASS,
|
|
14626
14842
|
labels: terminalLabels(t)
|
|
14627
14843
|
}
|
|
14628
|
-
) : expandable ? /* @__PURE__ */ (0,
|
|
14844
|
+
) : expandable ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("pre", { style: state === "error" ? errorBodyStyle : bodyStyle, children: capLines(output ?? "", MAX_RENDERED_LINES) }) : null
|
|
14629
14845
|
}
|
|
14630
14846
|
);
|
|
14631
14847
|
}
|
|
@@ -14680,6 +14896,10 @@ var EMPTY_SNAPSHOT = {
|
|
|
14680
14896
|
dshVersion: "",
|
|
14681
14897
|
orchestratorVersion: "",
|
|
14682
14898
|
versionState: "ok",
|
|
14899
|
+
gatewayState: "unknown",
|
|
14900
|
+
gatewayVersion: "",
|
|
14901
|
+
gatewayCommit: "",
|
|
14902
|
+
gatewayVersionState: "ok",
|
|
14683
14903
|
projectsRoot: "",
|
|
14684
14904
|
workspaces: [],
|
|
14685
14905
|
containers: [],
|
|
@@ -14724,6 +14944,10 @@ var ContainerCardController = class {
|
|
|
14724
14944
|
dshVersion: this.snapshot.dshVersion,
|
|
14725
14945
|
orchestratorVersion: this.snapshot.orchestratorVersion,
|
|
14726
14946
|
versionState: this.snapshot.versionState,
|
|
14947
|
+
gatewayState: this.snapshot.gatewayState,
|
|
14948
|
+
gatewayVersion: this.snapshot.gatewayVersion,
|
|
14949
|
+
gatewayCommit: this.snapshot.gatewayCommit,
|
|
14950
|
+
gatewayVersionState: this.snapshot.gatewayVersionState,
|
|
14727
14951
|
defaultImage: value?.defaultImage ?? "",
|
|
14728
14952
|
containerEnv: value?.containerEnv ?? {},
|
|
14729
14953
|
projectsRoot: this.snapshot.projectsRoot,
|
|
@@ -14763,7 +14987,10 @@ var ContainerCardController = class {
|
|
|
14763
14987
|
packages: extra.packages ?? [],
|
|
14764
14988
|
secretEnv: extra.secretEnv ?? {},
|
|
14765
14989
|
cacheMode: extra.cacheMode ?? "",
|
|
14766
|
-
mount: extra.mount ?? null
|
|
14990
|
+
mount: extra.mount ?? null,
|
|
14991
|
+
port: extra.port ?? 0,
|
|
14992
|
+
protocol: extra.protocol ?? "",
|
|
14993
|
+
suggestedHostPort: extra.suggestedHostPort ?? 0
|
|
14767
14994
|
});
|
|
14768
14995
|
}
|
|
14769
14996
|
async dispatch(request) {
|
|
@@ -14867,6 +15094,16 @@ var ContainerCardController = class {
|
|
|
14867
15094
|
mount
|
|
14868
15095
|
}),
|
|
14869
15096
|
setContainerPaths: (workspace, container, paths) => this.command("container_path_set", workspace, "", { container, paths }),
|
|
15097
|
+
publishContainerPort: (workspace, container, port, suggestedHostPort) => this.command("container_publish_port", workspace, "", {
|
|
15098
|
+
container,
|
|
15099
|
+
port,
|
|
15100
|
+
...suggestedHostPort ? { suggestedHostPort } : {}
|
|
15101
|
+
}),
|
|
15102
|
+
unpublishContainerPort: (workspace, container, port, protocol) => this.command("container_unpublish_port", workspace, "", {
|
|
15103
|
+
container,
|
|
15104
|
+
port,
|
|
15105
|
+
protocol
|
|
15106
|
+
}),
|
|
14870
15107
|
createVolume: (name2) => this.command("volume_create", name2, ""),
|
|
14871
15108
|
removeVolume: (name2) => this.command("volume_remove", name2, ""),
|
|
14872
15109
|
removeImage: (imageId) => this.command("image_remove", imageId, ""),
|
|
@@ -14914,6 +15151,9 @@ var en2 = {
|
|
|
14914
15151
|
versionMismatchMinor: "This plugin and the orchestrator have compatible but different versions; consider updating both images.",
|
|
14915
15152
|
versionsTitle: "Versions",
|
|
14916
15153
|
orchestrator: "dsh-podman-orchestrator",
|
|
15154
|
+
gateway: "dsh-podman-gateway",
|
|
15155
|
+
gatewayNotRunning: "not running",
|
|
15156
|
+
gatewayIncompatible: "incompatible",
|
|
14917
15157
|
versionUnknown: "unknown",
|
|
14918
15158
|
dsh: "dsh",
|
|
14919
15159
|
copyVersions: "Copy versions",
|
|
@@ -14991,6 +15231,16 @@ var en2 = {
|
|
|
14991
15231
|
attachSecret: "Attach",
|
|
14992
15232
|
secretEnvName: "Env var",
|
|
14993
15233
|
detachSecret: "Detach",
|
|
15234
|
+
portsTitle: "Ports",
|
|
15235
|
+
publishPort: "Publish",
|
|
15236
|
+
unpublishPort: "Unpublish",
|
|
15237
|
+
podPort: "Pod port",
|
|
15238
|
+
hostPortOptional: "Host port (optional)",
|
|
15239
|
+
invalidPort: "Port must be between 1 and 65535",
|
|
15240
|
+
invalidHostPort: "Host port must be between 1024 and 65535",
|
|
15241
|
+
publishNeedsGateway: "The dsh-podman gateway is not running; start the gateway Quadlet to publish ports.",
|
|
15242
|
+
containerNotRunning: "The container is not running; start it to publish a port.",
|
|
15243
|
+
confirmUnpublishPort: "Stop publishing {port}/{protocol}? The host port becomes unreachable.",
|
|
14994
15244
|
none: "None",
|
|
14995
15245
|
unavailable: "The container plugin is not available.",
|
|
14996
15246
|
busy: "Working\u2026",
|
|
@@ -15088,6 +15338,8 @@ var en2 = {
|
|
|
15088
15338
|
toolTitle_container_path_remove: "Remove PATH entry",
|
|
15089
15339
|
toolTitle_container_secret_add: "Attach secret",
|
|
15090
15340
|
toolTitle_container_secret_remove: "Detach secret",
|
|
15341
|
+
toolTitle_container_publish_port: "Publish port",
|
|
15342
|
+
toolTitle_container_unpublish_port: "Unpublish port",
|
|
15091
15343
|
toolTitle_image_list: "List images",
|
|
15092
15344
|
toolTitle_image_get: "Inspect image",
|
|
15093
15345
|
toolTitle_image_build: "Build image",
|
|
@@ -15131,6 +15383,9 @@ var zh2 = {
|
|
|
15131
15383
|
versionMismatchMinor: "\u6B64\u63D2\u4EF6\u4E0E orchestrator \u7684\u7248\u672C\u4E0D\u540C\u4F46\u517C\u5BB9\uFF1B\u5EFA\u8BAE\u540C\u65F6\u66F4\u65B0\u4E24\u4E2A\u955C\u50CF\u3002",
|
|
15132
15384
|
versionsTitle: "\u7248\u672C",
|
|
15133
15385
|
orchestrator: "dsh-podman-orchestrator",
|
|
15386
|
+
gateway: "dsh-podman-gateway",
|
|
15387
|
+
gatewayNotRunning: "\u672A\u8FD0\u884C",
|
|
15388
|
+
gatewayIncompatible: "\u7248\u672C\u4E0D\u517C\u5BB9",
|
|
15134
15389
|
versionUnknown: "\u672A\u77E5",
|
|
15135
15390
|
dsh: "dsh",
|
|
15136
15391
|
copyVersions: "\u590D\u5236\u7248\u672C",
|
|
@@ -15208,6 +15463,16 @@ var zh2 = {
|
|
|
15208
15463
|
attachSecret: "\u6CE8\u5165",
|
|
15209
15464
|
secretEnvName: "\u53D8\u91CF\u540D",
|
|
15210
15465
|
detachSecret: "\u79FB\u9664",
|
|
15466
|
+
portsTitle: "\u7AEF\u53E3",
|
|
15467
|
+
publishPort: "\u53D1\u5E03",
|
|
15468
|
+
unpublishPort: "\u53D6\u6D88\u53D1\u5E03",
|
|
15469
|
+
podPort: "pod \u7AEF\u53E3",
|
|
15470
|
+
hostPortOptional: "\u4E3B\u673A\u7AEF\u53E3\uFF08\u53EF\u9009\uFF09",
|
|
15471
|
+
invalidPort: "\u7AEF\u53E3\u5FC5\u987B\u5728 1 \u5230 65535 \u4E4B\u95F4",
|
|
15472
|
+
invalidHostPort: "\u4E3B\u673A\u7AEF\u53E3\u5FC5\u987B\u5728 1024 \u5230 65535 \u4E4B\u95F4",
|
|
15473
|
+
publishNeedsGateway: "dsh-podman gateway \u672A\u8FD0\u884C\uFF1B\u8BF7\u542F\u52A8 gateway Quadlet \u540E\u518D\u53D1\u5E03\u7AEF\u53E3\u3002",
|
|
15474
|
+
containerNotRunning: "\u5BB9\u5668\u672A\u8FD0\u884C\uFF1B\u8BF7\u5148\u542F\u52A8\u5BB9\u5668\u518D\u53D1\u5E03\u7AEF\u53E3\u3002",
|
|
15475
|
+
confirmUnpublishPort: "\u505C\u6B62\u53D1\u5E03 {port}/{protocol}\uFF1F\u8BE5\u4E3B\u673A\u7AEF\u53E3\u5C06\u4E0D\u518D\u53EF\u8BBF\u95EE\u3002",
|
|
15211
15476
|
none: "\u65E0",
|
|
15212
15477
|
unavailable: "\u5BB9\u5668\u63D2\u4EF6\u4E0D\u53EF\u7528\u3002",
|
|
15213
15478
|
busy: "\u5904\u7406\u4E2D\u2026",
|
|
@@ -15305,6 +15570,8 @@ var zh2 = {
|
|
|
15305
15570
|
toolTitle_container_path_remove: "\u79FB\u9664 PATH \u6761\u76EE",
|
|
15306
15571
|
toolTitle_container_secret_add: "\u6CE8\u5165\u673A\u5BC6",
|
|
15307
15572
|
toolTitle_container_secret_remove: "\u79FB\u9664\u673A\u5BC6\u6CE8\u5165",
|
|
15573
|
+
toolTitle_container_publish_port: "\u53D1\u5E03\u7AEF\u53E3",
|
|
15574
|
+
toolTitle_container_unpublish_port: "\u53D6\u6D88\u53D1\u5E03\u7AEF\u53E3",
|
|
15308
15575
|
toolTitle_image_list: "\u5217\u51FA\u955C\u50CF",
|
|
15309
15576
|
toolTitle_image_get: "\u67E5\u770B\u955C\u50CF",
|
|
15310
15577
|
toolTitle_image_build: "\u6784\u5EFA\u955C\u50CF",
|
|
@@ -15424,7 +15691,7 @@ function apply(ctx) {
|
|
|
15424
15691
|
order: 20,
|
|
15425
15692
|
title: () => t("terminalGuideTitle"),
|
|
15426
15693
|
description: () => t("terminalGuideDescription"),
|
|
15427
|
-
icon:
|
|
15694
|
+
icon: import_dsh_client_ui_primitives18.PluginArtworkTerminal
|
|
15428
15695
|
}]
|
|
15429
15696
|
}),
|
|
15430
15697
|
"podman: terminal type"
|