dsh-plugin-opc 0.1.21 → 0.1.22
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/lib/client.js +5 -33
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -56524,7 +56524,6 @@ function AppsPanel({
|
|
|
56524
56524
|
const [appName, setAppName] = (0, import_react8.useState)("");
|
|
56525
56525
|
const [appSlug, setAppSlug] = (0, import_react8.useState)("");
|
|
56526
56526
|
const [slugManual, setSlugManual] = (0, import_react8.useState)(false);
|
|
56527
|
-
const [containerPort, setContainerPort] = (0, import_react8.useState)("8080");
|
|
56528
56527
|
const [appDescription, setAppDescription] = (0, import_react8.useState)("");
|
|
56529
56528
|
const [zipFile, setZipFile] = (0, import_react8.useState)(null);
|
|
56530
56529
|
const [sourcePath, setSourcePath] = (0, import_react8.useState)("");
|
|
@@ -56626,11 +56625,6 @@ function AppsPanel({
|
|
|
56626
56625
|
(0, import_react8.useEffect)(() => {
|
|
56627
56626
|
void loadWorkspaceData(false);
|
|
56628
56627
|
}, [loadWorkspaceData, refreshSignal]);
|
|
56629
|
-
(0, import_react8.useEffect)(() => {
|
|
56630
|
-
if (viewMode === "wizard" && wizardStep === 1 && !wizardJob && !upgradeTarget) {
|
|
56631
|
-
setContainerPort(String(opcConfig.defaultPort));
|
|
56632
|
-
}
|
|
56633
|
-
}, [opcConfig.defaultPort, upgradeTarget, viewMode, wizardJob, wizardStep]);
|
|
56634
56628
|
(0, import_react8.useEffect)(() => {
|
|
56635
56629
|
if (modelGroups.length === 0) return;
|
|
56636
56630
|
const currentGroup = modelGroups.find((g) => g.id === selectedProvider) ?? modelGroups[0];
|
|
@@ -56911,7 +56905,6 @@ function AppsPanel({
|
|
|
56911
56905
|
setAppName(upgradeApp?.name ?? prevJob?.name ?? "");
|
|
56912
56906
|
setAppSlug(upgradeApp?.slug ?? prevJob?.slug ?? "");
|
|
56913
56907
|
setSlugManual(Boolean(upgradeApp || prevJob));
|
|
56914
|
-
setContainerPort(String(upgradeApp?.container_port ?? prevJob?.port ?? opcConfig.defaultPort));
|
|
56915
56908
|
setAppDescription(upgradeApp?.description ?? prevJob?.description ?? "");
|
|
56916
56909
|
sourceSelection.current++;
|
|
56917
56910
|
setDragActive(false);
|
|
@@ -56921,7 +56914,7 @@ function AppsPanel({
|
|
|
56921
56914
|
setVerifyCredentials({});
|
|
56922
56915
|
setRememberCredentials(false);
|
|
56923
56916
|
},
|
|
56924
|
-
[
|
|
56917
|
+
[]
|
|
56925
56918
|
);
|
|
56926
56919
|
const resumeWizardJob = (0, import_react8.useCallback)(
|
|
56927
56920
|
async (job, overrideStep, useSnapshot = false) => {
|
|
@@ -56941,13 +56934,12 @@ function AppsPanel({
|
|
|
56941
56934
|
setAppName(fresh.name);
|
|
56942
56935
|
setAppSlug(fresh.slug);
|
|
56943
56936
|
setSlugManual(true);
|
|
56944
|
-
setContainerPort(String(fresh.port ?? opcConfig.defaultPort));
|
|
56945
56937
|
setAppDescription(fresh.description ?? "");
|
|
56946
56938
|
} else if (targetStep === 3) {
|
|
56947
56939
|
await syncStep3Drafts(fresh);
|
|
56948
56940
|
}
|
|
56949
56941
|
},
|
|
56950
|
-
[apps,
|
|
56942
|
+
[apps, refreshWizardJob, syncStep3Drafts]
|
|
56951
56943
|
);
|
|
56952
56944
|
const openLinkedJob = (0, import_react8.useCallback)(async (job, refresh = true) => {
|
|
56953
56945
|
const fresh = refresh ? await refreshWizardJob(job.id) ?? job : job;
|
|
@@ -56997,11 +56989,6 @@ function AppsPanel({
|
|
|
56997
56989
|
setWizardError("\u8BE5\u5E94\u7528\u6807\u8BC6\u5DF2\u88AB\u5360\u7528\uFF0C\u8BF7\u66F4\u6362\u5176\u4ED6\u6807\u8BC6");
|
|
56998
56990
|
return;
|
|
56999
56991
|
}
|
|
57000
|
-
const parsedPort = Number.parseInt(containerPort, 10);
|
|
57001
|
-
if (!Number.isInteger(parsedPort) || parsedPort < 1 || parsedPort > 65535) {
|
|
57002
|
-
setWizardError("\u5BB9\u5668\u7AEF\u53E3\u5FC5\u987B\u4E3A 1 \u81F3 65535 \u4E4B\u95F4\u7684\u6574\u6570");
|
|
57003
|
-
return;
|
|
57004
|
-
}
|
|
57005
56992
|
if (!zipFile && !sourcePath.trim()) {
|
|
57006
56993
|
setWizardError("\u8BF7\u9009\u62E9\u6E90\u7801\u6587\u4EF6\u5939\u6216 ZIP\uFF0C\u6216\u8005\u586B\u5199\u5B8C\u6574\u8DEF\u5F84");
|
|
57007
56994
|
return;
|
|
@@ -57012,7 +56999,6 @@ function AppsPanel({
|
|
|
57012
56999
|
const payload = {
|
|
57013
57000
|
name: cleanName,
|
|
57014
57001
|
slug: cleanSlug,
|
|
57015
|
-
container_port: parsedPort,
|
|
57016
57002
|
description: appDescription.trim(),
|
|
57017
57003
|
upgrade: upgradingStep1,
|
|
57018
57004
|
previousJobId: previousJobId || void 0,
|
|
@@ -57531,9 +57517,9 @@ function AppsPanel({
|
|
|
57531
57517
|
{ id: 4, label: "\u90E8\u7F72\u4E0E\u4F7F\u7528" }
|
|
57532
57518
|
];
|
|
57533
57519
|
const upgrading = Boolean(upgradeTarget || wizardJob?.upgrade || wizardJob?.published);
|
|
57534
|
-
const
|
|
57520
|
+
const effectiveStep1Port = upgradeTarget?.container_port ?? wizardJob?.port ?? opcConfig.defaultPort;
|
|
57535
57521
|
const slugValid = SLUG_RE.test(toAppSlug(appSlug, { allowTrailingDash: false }));
|
|
57536
|
-
const canSubmitStep1 = !wizardBusy && appName.trim().length > 0 && slugValid && (upgradingStep1 || slugCheck.available !== false) &&
|
|
57522
|
+
const canSubmitStep1 = !wizardBusy && appName.trim().length > 0 && slugValid && (upgradingStep1 || slugCheck.available !== false) && Boolean(zipFile || sourcePath.trim());
|
|
57537
57523
|
const missingConfigAlert = wizardJob ? validateConfigsForPublish(configDrafts, wizardJob.port ?? opcConfig.defaultPort) || (Object.values(storageSelections).some((id) => !id) ? "\u65B0\u589E\u6301\u4E45\u5316\u76EE\u5F55\u9700\u8981\u5DF2\u542F\u7528\u7684 Platform \u5377\u8D44\u6E90" : null) : null;
|
|
57538
57524
|
return /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-overlay-view" }, /* @__PURE__ */ import_react8.default.createElement("header", { className: "oa-overlay-header oa-wizard-header" }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-wizard-heading" }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-wizard-identity" }, /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-wizard-icon" }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: upgrading ? "refresh" : "plus", size: 16 })), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-wizard-title" }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-wizard-title-line" }, /* @__PURE__ */ import_react8.default.createElement("h2", null, upgrading ? "\u5347\u7EA7\u5E94\u7528\u5E76\u90E8\u7F72\u65B0\u7248\u672C" : "\u65B0\u5EFA\u5E76\u90E8\u7F72\u5E94\u7528"), (wizardJob?.slug || appSlug) && /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-code", title: wizardJob?.slug || appSlug }, wizardJob?.slug || appSlug)), /* @__PURE__ */ import_react8.default.createElement("p", null, upgrading ? "\u9009\u62E9\u65B0\u7248\u6E90\u7801\uFF0C\u7531 AI \u68C0\u67E5\u6539\u9020\u65B9\u6848\uFF0C\u518D\u6838\u5BF9\u5E76\u90E8\u7F72\u3002" : "\u9009\u62E9\u5E94\u7528\uFF0CAI \u5B8C\u6210\u6280\u672F\u51C6\u5907\uFF0C\u4F60\u53EA\u9700\u5904\u7406\u5FC5\u8981\u95EE\u9898\u5E76\u786E\u8BA4\u90E8\u7F72\u3002"))), /* @__PURE__ */ import_react8.default.createElement(
|
|
57539
57525
|
"button",
|
|
@@ -57619,19 +57605,7 @@ function AppsPanel({
|
|
|
57619
57605
|
appSlug.trim() || "your-app",
|
|
57620
57606
|
".",
|
|
57621
57607
|
opcConfig.appDomainRoot
|
|
57622
|
-
), !upgradingStep1 && slugCheck.checking && /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-pill" }, "\u6B63\u5728\u6821\u9A8C\u2026"), !upgradingStep1 && !slugCheck.checking && !slugCheck.error && slugCheck.available && /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-pill oa-pill-ok" }, "\u6807\u8BC6\u53EF\u7528")), /* @__PURE__ */ import_react8.default.createElement("span", { style: { fontSize: 11.5, color: "#64748b", flexShrink: 0 } }, "(\u5BB9\u5668\u7AEF\u53E3: ",
|
|
57623
|
-
"input",
|
|
57624
|
-
{
|
|
57625
|
-
id: `${formId}-container-port`,
|
|
57626
|
-
className: "oa-input oa-mono",
|
|
57627
|
-
type: "number",
|
|
57628
|
-
min: 1,
|
|
57629
|
-
max: 65535,
|
|
57630
|
-
value: containerPort,
|
|
57631
|
-
placeholder: String(opcConfig.defaultPort),
|
|
57632
|
-
onChange: (e) => setContainerPort(e.target.value)
|
|
57633
|
-
}
|
|
57634
|
-
), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-hint" }, "\u9ED8\u8BA4 ", opcConfig.defaultPort, "\uFF1B\u82E5\u6E90\u7801\u6216 Dockerfile \u76D1\u542C\u5176\u4ED6\u7AEF\u53E3\u53EF\u5728\u6B64\u8C03\u6574\u3002")), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-field" }, /* @__PURE__ */ import_react8.default.createElement("label", { className: "oa-label", htmlFor: `${formId}-description` }, "\u5E94\u7528\u63CF\u8FF0"), /* @__PURE__ */ import_react8.default.createElement(
|
|
57608
|
+
), !upgradingStep1 && slugCheck.checking && /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-pill" }, "\u6B63\u5728\u6821\u9A8C\u2026"), !upgradingStep1 && !slugCheck.checking && !slugCheck.error && slugCheck.available && /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-pill oa-pill-ok" }, "\u6807\u8BC6\u53EF\u7528")), /* @__PURE__ */ import_react8.default.createElement("span", { style: { fontSize: 11.5, color: "#64748b", flexShrink: 0 } }, "(\u5BB9\u5668\u7AEF\u53E3: ", effectiveStep1Port, ")")), !upgradingStep1 && slugCheck.error && /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-hint", style: { color: "#dc2626", marginTop: 4 } }, slugCheck.error)), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-field" }, /* @__PURE__ */ import_react8.default.createElement("label", { className: "oa-label", htmlFor: `${formId}-description` }, "\u5E94\u7528\u63CF\u8FF0"), /* @__PURE__ */ import_react8.default.createElement(
|
|
57635
57609
|
"textarea",
|
|
57636
57610
|
{
|
|
57637
57611
|
id: `${formId}-description`,
|
|
@@ -57718,7 +57692,6 @@ function AppsPanel({
|
|
|
57718
57692
|
setAppName(wizardJob.name);
|
|
57719
57693
|
setAppSlug(wizardJob.slug);
|
|
57720
57694
|
setSlugManual(true);
|
|
57721
|
-
setContainerPort(String(wizardJob.port ?? opcConfig.defaultPort));
|
|
57722
57695
|
setAppDescription(wizardJob.description ?? "");
|
|
57723
57696
|
if (wizardJob.upgrade || wizardJob.published) {
|
|
57724
57697
|
const target = apps.find((a) => a.slug === wizardJob.slug && a.can_manage === true);
|
|
@@ -57892,7 +57865,6 @@ function AppsPanel({
|
|
|
57892
57865
|
setAppName(wizardJob.name);
|
|
57893
57866
|
setAppSlug(wizardJob.slug);
|
|
57894
57867
|
setSlugManual(true);
|
|
57895
|
-
setContainerPort(String(wizardJob.port ?? opcConfig.defaultPort));
|
|
57896
57868
|
setAppDescription(wizardJob.description ?? "");
|
|
57897
57869
|
if (wizardJob.upgrade || wizardJob.published) {
|
|
57898
57870
|
const target = apps.find((a) => a.slug === wizardJob.slug && a.can_manage === true);
|