dsh-plugin-opc 0.1.15 → 0.1.16
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 +188 -130
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -55752,55 +55752,85 @@ var appsCss = `
|
|
|
55752
55752
|
flex-shrink: 0;
|
|
55753
55753
|
}
|
|
55754
55754
|
|
|
55755
|
-
/*
|
|
55756
|
-
.oa-
|
|
55755
|
+
/* Deployment wizard header */
|
|
55756
|
+
.oa-wizard-header {
|
|
55757
|
+
container-type: inline-size;
|
|
55758
|
+
flex-direction: column;
|
|
55759
|
+
align-items: stretch;
|
|
55760
|
+
gap: 14px;
|
|
55761
|
+
padding-block: 14px;
|
|
55762
|
+
background: var(--oa-paper);
|
|
55763
|
+
}
|
|
55764
|
+
.oa-wizard-heading,
|
|
55765
|
+
.oa-wizard-identity,
|
|
55766
|
+
.oa-wizard-title-line {
|
|
55757
55767
|
display: flex;
|
|
55758
55768
|
align-items: center;
|
|
55759
|
-
|
|
55760
|
-
gap:
|
|
55761
|
-
|
|
55762
|
-
|
|
55763
|
-
|
|
55764
|
-
|
|
55769
|
+
min-width: 0;
|
|
55770
|
+
gap: 9px;
|
|
55771
|
+
}
|
|
55772
|
+
.oa-wizard-heading { justify-content: space-between; align-items: flex-start; }
|
|
55773
|
+
.oa-wizard-identity { align-items: flex-start; flex: 1; }
|
|
55774
|
+
.oa-wizard-title { min-width: 0; }
|
|
55775
|
+
.oa-wizard-title-line { flex-wrap: wrap; gap: 4px 8px; }
|
|
55776
|
+
.oa-wizard-title-line .oa-code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
55777
|
+
.oa-wizard-title h2 { margin: 0; font-size: 14px; font-weight: 700; color: var(--oa-ink); }
|
|
55778
|
+
.oa-wizard-title p { margin: 2px 0 0; font-size: 11.5px; color: var(--oa-muted); }
|
|
55779
|
+
.oa-wizard-icon {
|
|
55780
|
+
display: grid;
|
|
55781
|
+
place-items: center;
|
|
55782
|
+
width: 30px;
|
|
55783
|
+
height: 30px;
|
|
55784
|
+
border-radius: var(--opc-control-radius, 8px);
|
|
55765
55785
|
flex-shrink: 0;
|
|
55786
|
+
background: var(--oa-accent-soft);
|
|
55787
|
+
color: var(--oa-accent);
|
|
55766
55788
|
}
|
|
55767
|
-
.oa-
|
|
55768
|
-
|
|
55769
|
-
|
|
55770
|
-
|
|
55771
|
-
|
|
55772
|
-
|
|
55773
|
-
|
|
55789
|
+
.oa-wizard-return { flex-shrink: 0; }
|
|
55790
|
+
.oa-stepper {
|
|
55791
|
+
display: grid;
|
|
55792
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
55793
|
+
gap: 8px;
|
|
55794
|
+
list-style: none;
|
|
55795
|
+
margin: 0;
|
|
55796
|
+
padding: 0;
|
|
55774
55797
|
}
|
|
55775
|
-
|
|
55776
|
-
.oa-
|
|
55777
|
-
|
|
55778
|
-
|
|
55779
|
-
|
|
55780
|
-
border-radius: 50%;
|
|
55781
|
-
display: inline-flex;
|
|
55798
|
+
@container (max-width: 400px) {
|
|
55799
|
+
.oa-stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
55800
|
+
}
|
|
55801
|
+
.oa-step-item {
|
|
55802
|
+
display: flex;
|
|
55782
55803
|
align-items: center;
|
|
55783
55804
|
justify-content: center;
|
|
55784
|
-
|
|
55785
|
-
|
|
55786
|
-
|
|
55787
|
-
border: 1px solid var(--oa-line
|
|
55805
|
+
gap: 4px;
|
|
55806
|
+
min-height: 32px;
|
|
55807
|
+
padding: 4px;
|
|
55808
|
+
border: 1px solid var(--oa-line);
|
|
55809
|
+
border-radius: var(--opc-control-radius, 8px);
|
|
55810
|
+
background: #f1f5f9;
|
|
55811
|
+
text-align: center;
|
|
55788
55812
|
color: var(--oa-muted);
|
|
55813
|
+
font-size: 11.5px;
|
|
55814
|
+
font-weight: 500;
|
|
55789
55815
|
}
|
|
55790
|
-
.oa-step-item.active
|
|
55791
|
-
background: var(--oa-accent);
|
|
55792
|
-
border-color:
|
|
55793
|
-
color:
|
|
55816
|
+
.oa-step-item.active {
|
|
55817
|
+
background: var(--oa-accent-soft);
|
|
55818
|
+
border-color: #93b5fd;
|
|
55819
|
+
color: var(--oa-accent);
|
|
55820
|
+
font-weight: 600;
|
|
55794
55821
|
}
|
|
55795
|
-
.oa-step-item.done
|
|
55822
|
+
.oa-step-item.done {
|
|
55796
55823
|
background: var(--oa-ok-soft);
|
|
55797
55824
|
border-color: var(--oa-ok-line);
|
|
55798
55825
|
color: var(--oa-ok);
|
|
55799
55826
|
}
|
|
55800
|
-
.oa-step-
|
|
55801
|
-
|
|
55827
|
+
.oa-step-accessible {
|
|
55828
|
+
position: absolute;
|
|
55829
|
+
width: 1px;
|
|
55802
55830
|
height: 1px;
|
|
55803
|
-
|
|
55831
|
+
overflow: hidden;
|
|
55832
|
+
clip-path: inset(50%);
|
|
55833
|
+
white-space: nowrap;
|
|
55804
55834
|
}
|
|
55805
55835
|
|
|
55806
55836
|
/* Form Elements */
|
|
@@ -55824,6 +55854,39 @@ var appsCss = `
|
|
|
55824
55854
|
max-width: none;
|
|
55825
55855
|
margin: 0;
|
|
55826
55856
|
}
|
|
55857
|
+
.oa-source-form {
|
|
55858
|
+
display: flex;
|
|
55859
|
+
flex-direction: column;
|
|
55860
|
+
gap: 16px;
|
|
55861
|
+
min-width: 0;
|
|
55862
|
+
}
|
|
55863
|
+
.oa-source-form > .oa-form-card { max-width: none; margin: 0; }
|
|
55864
|
+
.oa-source-label { margin: 0; font-size: 13px; font-weight: 600; }
|
|
55865
|
+
.oa-source-label > span { color: var(--oa-danger); }
|
|
55866
|
+
.oa-source-icon {
|
|
55867
|
+
display: grid;
|
|
55868
|
+
place-items: center;
|
|
55869
|
+
width: 46px;
|
|
55870
|
+
height: 46px;
|
|
55871
|
+
background: var(--oa-panel);
|
|
55872
|
+
border: 1px solid var(--oa-line);
|
|
55873
|
+
border-radius: var(--opc-card-radius, 12px);
|
|
55874
|
+
color: var(--oa-muted);
|
|
55875
|
+
}
|
|
55876
|
+
.oa-source-actions,
|
|
55877
|
+
.oa-source-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
55878
|
+
.oa-source-actions { justify-content: center; margin-top: 6px; }
|
|
55879
|
+
.oa-source-choice {
|
|
55880
|
+
padding: 8px 10px;
|
|
55881
|
+
border: 1px solid var(--oa-ok-line);
|
|
55882
|
+
border-radius: 8px;
|
|
55883
|
+
background: var(--oa-ok-soft);
|
|
55884
|
+
color: #065f46;
|
|
55885
|
+
font-size: 12px;
|
|
55886
|
+
}
|
|
55887
|
+
.oa-source-choice > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
55888
|
+
.oa-source-form .oa-dropzone { padding: 22px 14px; gap: 8px; }
|
|
55889
|
+
.oa-source-form .oa-dropzone > .oa-hint { max-width: 460px; }
|
|
55827
55890
|
.oa-field {
|
|
55828
55891
|
display: flex;
|
|
55829
55892
|
flex-direction: column;
|
|
@@ -56605,9 +56668,8 @@ function AppsPanel({
|
|
|
56605
56668
|
const [slugManual, setSlugManual] = (0, import_react8.useState)(false);
|
|
56606
56669
|
const [containerPort, setContainerPort] = (0, import_react8.useState)("8080");
|
|
56607
56670
|
const [appDescription, setAppDescription] = (0, import_react8.useState)("");
|
|
56608
|
-
const [sourceKind, setSourceKind] = (0, import_react8.useState)("zip");
|
|
56609
56671
|
const [zipFile, setZipFile] = (0, import_react8.useState)(null);
|
|
56610
|
-
const [
|
|
56672
|
+
const [sourcePath, setSourcePath] = (0, import_react8.useState)("");
|
|
56611
56673
|
const [dragActive, setDragActive] = (0, import_react8.useState)(false);
|
|
56612
56674
|
const [selectedProvider, setSelectedProvider] = (0, import_react8.useState)("");
|
|
56613
56675
|
const [selectedModel, setSelectedModel] = (0, import_react8.useState)("");
|
|
@@ -56617,6 +56679,8 @@ function AppsPanel({
|
|
|
56617
56679
|
});
|
|
56618
56680
|
const isComposingRef = (0, import_react8.useRef)(false);
|
|
56619
56681
|
const isSlugComposingRef = (0, import_react8.useRef)(false);
|
|
56682
|
+
const sourcePathInputRef = (0, import_react8.useRef)(null);
|
|
56683
|
+
const sourceSelection = (0, import_react8.useRef)(0);
|
|
56620
56684
|
const fileInputRef = (0, import_react8.useRef)(null);
|
|
56621
56685
|
const [step2State, setStep2State] = (0, import_react8.useState)({
|
|
56622
56686
|
canContinue: false,
|
|
@@ -56938,9 +57002,10 @@ function AppsPanel({
|
|
|
56938
57002
|
setSlugManual(Boolean(upgradeApp || prevJob));
|
|
56939
57003
|
setContainerPort(String(upgradeApp?.container_port ?? prevJob?.port ?? opcConfig.defaultPort));
|
|
56940
57004
|
setAppDescription(upgradeApp?.description ?? prevJob?.description ?? "");
|
|
56941
|
-
|
|
57005
|
+
sourceSelection.current++;
|
|
57006
|
+
setDragActive(false);
|
|
56942
57007
|
setZipFile(null);
|
|
56943
|
-
|
|
57008
|
+
setSourcePath("");
|
|
56944
57009
|
setReviewInitialFeedback("");
|
|
56945
57010
|
setConfigSubTab("configs");
|
|
56946
57011
|
setVerifyCredentials({});
|
|
@@ -57006,6 +57071,8 @@ function AppsPanel({
|
|
|
57006
57071
|
}, [apps, linkedJob?.id, upgradeTarget, viewMode, wizardJob]);
|
|
57007
57072
|
const handleStep1Submit = async (e) => {
|
|
57008
57073
|
e.preventDefault();
|
|
57074
|
+
if (wizardBusy) return;
|
|
57075
|
+
sourceSelection.current++;
|
|
57009
57076
|
setWizardError(null);
|
|
57010
57077
|
const cleanName = appName.trim();
|
|
57011
57078
|
const cleanSlug = toAppSlug(appSlug, { allowTrailingDash: false });
|
|
@@ -57026,16 +57093,8 @@ function AppsPanel({
|
|
|
57026
57093
|
setWizardError("\u5BB9\u5668\u7AEF\u53E3\u5FC5\u987B\u4E3A 1 \u81F3 65535 \u4E4B\u95F4\u7684\u6574\u6570");
|
|
57027
57094
|
return;
|
|
57028
57095
|
}
|
|
57029
|
-
if (
|
|
57030
|
-
setWizardError("\u8BF7\u9009\u62E9\
|
|
57031
|
-
return;
|
|
57032
|
-
}
|
|
57033
|
-
if (sourceKind === "zip" && zipFile && zipFile.size > MAX_ZIP_BYTES) {
|
|
57034
|
-
setWizardError("ZIP \u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 64 MiB");
|
|
57035
|
-
return;
|
|
57036
|
-
}
|
|
57037
|
-
if (sourceKind === "folder" && !folderPath.trim()) {
|
|
57038
|
-
setWizardError("\u8BF7\u9009\u62E9\u6216\u586B\u5199\u672C\u673A\u6E90\u7801\u76EE\u5F55\u7684\u5B8C\u6574\u8DEF\u5F84");
|
|
57096
|
+
if (!zipFile && !sourcePath.trim()) {
|
|
57097
|
+
setWizardError("\u8BF7\u9009\u62E9\u6E90\u7801\u6587\u4EF6\u5939\u6216 ZIP\uFF0C\u6216\u8005\u586B\u5199\u5B8C\u6574\u8DEF\u5F84");
|
|
57039
57098
|
return;
|
|
57040
57099
|
}
|
|
57041
57100
|
const navigate = beginAnalysisNavigation();
|
|
@@ -57054,10 +57113,10 @@ function AppsPanel({
|
|
|
57054
57113
|
reasoningEffort: selectedEffort || void 0
|
|
57055
57114
|
} : void 0
|
|
57056
57115
|
};
|
|
57057
|
-
if (
|
|
57116
|
+
if (zipFile) {
|
|
57058
57117
|
payload.zip = await readFileAsBase64(zipFile);
|
|
57059
57118
|
} else {
|
|
57060
|
-
payload.source =
|
|
57119
|
+
payload.source = sourcePath.trim();
|
|
57061
57120
|
}
|
|
57062
57121
|
const rawJob = await api.appCreate(JSON.stringify(payload), sessionId, contextId);
|
|
57063
57122
|
const created = parseJson(rawJob, {});
|
|
@@ -57086,23 +57145,44 @@ function AppsPanel({
|
|
|
57086
57145
|
setWizardBusy(false);
|
|
57087
57146
|
}
|
|
57088
57147
|
};
|
|
57148
|
+
const selectZip = (file2) => {
|
|
57149
|
+
if (wizardBusy) return;
|
|
57150
|
+
sourceSelection.current++;
|
|
57151
|
+
if (!/\.zip$/i.test(file2.name) || file2.size === 0 || file2.size > MAX_ZIP_BYTES) {
|
|
57152
|
+
setWizardError("\u8BF7\u4F7F\u7528\u6709\u6548\u7684 ZIP \u538B\u7F29\u5305\uFF0C\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 64 MiB");
|
|
57153
|
+
return;
|
|
57154
|
+
}
|
|
57155
|
+
setWizardError(null);
|
|
57156
|
+
setSourcePath("");
|
|
57157
|
+
setZipFile(file2);
|
|
57158
|
+
};
|
|
57159
|
+
const selectSourcePath = (path) => {
|
|
57160
|
+
sourceSelection.current++;
|
|
57161
|
+
setWizardError(null);
|
|
57162
|
+
setZipFile(null);
|
|
57163
|
+
setSourcePath(path);
|
|
57164
|
+
};
|
|
57089
57165
|
const handleBrowseFolder = async () => {
|
|
57090
|
-
|
|
57166
|
+
const request = ++sourceSelection.current;
|
|
57091
57167
|
setWizardError(null);
|
|
57168
|
+
if (!api.appPickSourceFolder) {
|
|
57169
|
+
sourcePathInputRef.current?.focus();
|
|
57170
|
+
return;
|
|
57171
|
+
}
|
|
57092
57172
|
try {
|
|
57093
57173
|
const res = parseJson(
|
|
57094
57174
|
await api.appPickSourceFolder(contextId),
|
|
57095
57175
|
{}
|
|
57096
57176
|
);
|
|
57177
|
+
if (request !== sourceSelection.current) return;
|
|
57097
57178
|
if (res.unsupported) {
|
|
57098
|
-
|
|
57099
|
-
|
|
57100
|
-
}
|
|
57101
|
-
|
|
57102
|
-
setFolderPath(res.path);
|
|
57179
|
+
sourcePathInputRef.current?.focus();
|
|
57180
|
+
setWizardError("\u6B64\u73AF\u5883\u4E0D\u652F\u6301\u539F\u751F\u6587\u4EF6\u5939\u9009\u62E9\uFF0C\u8BF7\u586B\u5199\u5B8C\u6574\u8DEF\u5F84\u6216\u9009\u62E9 ZIP \u538B\u7F29\u5305");
|
|
57181
|
+
} else if (!res.cancelled && res.path) {
|
|
57182
|
+
selectSourcePath(res.path);
|
|
57103
57183
|
}
|
|
57104
57184
|
} catch (error62) {
|
|
57105
|
-
setWizardError(readErrorMessage(error62, "\u6253\u5F00\u76EE\u5F55\u9009\u62E9\u5668\u5931\u8D25"));
|
|
57185
|
+
if (request === sourceSelection.current) setWizardError(readErrorMessage(error62, "\u6253\u5F00\u76EE\u5F55\u9009\u62E9\u5668\u5931\u8D25"));
|
|
57106
57186
|
}
|
|
57107
57187
|
};
|
|
57108
57188
|
const saveDraft = (0, import_react8.useCallback)((job, rows, note) => {
|
|
@@ -57135,6 +57215,7 @@ function AppsPanel({
|
|
|
57135
57215
|
};
|
|
57136
57216
|
const leaveWizard = async () => {
|
|
57137
57217
|
if (wizardBusy) return;
|
|
57218
|
+
sourceSelection.current++;
|
|
57138
57219
|
setWizardBusy(true);
|
|
57139
57220
|
try {
|
|
57140
57221
|
await flushDraft();
|
|
@@ -57508,29 +57589,30 @@ function AppsPanel({
|
|
|
57508
57589
|
})));
|
|
57509
57590
|
const renderWizardView = () => {
|
|
57510
57591
|
const steps = [
|
|
57511
|
-
{ id: 1, label: "\
|
|
57512
|
-
{ id: 2, label: "\
|
|
57513
|
-
{ id: 3, label: "\
|
|
57514
|
-
{ id: 4, label: "\
|
|
57592
|
+
{ id: 1, label: "\u9009\u62E9\u5E94\u7528" },
|
|
57593
|
+
{ id: 2, label: "\u4E0E AI \u6539\u9020\u5E94\u7528" },
|
|
57594
|
+
{ id: 3, label: "\u6838\u5BF9\u90E8\u7F72\u5185\u5BB9" },
|
|
57595
|
+
{ id: 4, label: "\u90E8\u7F72\u4E0E\u4F7F\u7528" }
|
|
57515
57596
|
];
|
|
57597
|
+
const upgrading = Boolean(upgradeTarget || wizardJob?.upgrade);
|
|
57516
57598
|
const portNum = Number.parseInt(containerPort, 10);
|
|
57517
57599
|
const slugValid = SLUG_RE.test(toAppSlug(appSlug, { allowTrailingDash: false }));
|
|
57518
|
-
const canSubmitStep1 = !wizardBusy && appName.trim().length > 0 && slugValid && (Boolean(upgradeTarget) || slugCheck.available !== false) && Number.isInteger(portNum) && portNum >= 1 && portNum <= 65535 &&
|
|
57600
|
+
const canSubmitStep1 = !wizardBusy && appName.trim().length > 0 && slugValid && (Boolean(upgradeTarget) || slugCheck.available !== false) && Number.isInteger(portNum) && portNum >= 1 && portNum <= 65535 && Boolean(zipFile || sourcePath.trim());
|
|
57519
57601
|
const missingConfigAlert = wizardJob ? validateConfigsForPublish(configDrafts, wizardJob.port ?? opcConfig.defaultPort) : null;
|
|
57520
|
-
return /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-overlay-view" }, /* @__PURE__ */ import_react8.default.createElement("
|
|
57602
|
+
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(
|
|
57521
57603
|
"button",
|
|
57522
57604
|
{
|
|
57523
57605
|
type: "button",
|
|
57524
|
-
className: "oa-btn oa-btn-sm",
|
|
57606
|
+
className: "oa-btn oa-btn-sm oa-wizard-return",
|
|
57525
57607
|
disabled: wizardBusy,
|
|
57526
57608
|
onClick: () => void leaveWizard()
|
|
57527
57609
|
},
|
|
57528
57610
|
/* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "arrowLeft", size: 13 }),
|
|
57529
57611
|
/* @__PURE__ */ import_react8.default.createElement("span", null, wizardStep === 3 ? "\u4FDD\u5B58\u8349\u7A3F\u5E76\u9000\u51FA" : "\u8FD4\u56DE\u5217\u8868")
|
|
57530
|
-
), /* @__PURE__ */ import_react8.default.createElement("
|
|
57612
|
+
)), /* @__PURE__ */ import_react8.default.createElement("ol", { className: "oa-stepper", "aria-label": "\u5E94\u7528\u90E8\u7F72\u6B65\u9AA4" }, steps.map((step) => {
|
|
57531
57613
|
const stateClass = wizardStep === step.id ? "active" : wizardStep > step.id ? "done" : "";
|
|
57532
|
-
return /* @__PURE__ */ import_react8.default.createElement(
|
|
57533
|
-
}))), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-overlay-body" }, wizardError && /* @__PURE__ */ import_react8.default.createElement("div", { role: "alert", className: "oa-alert oa-alert-danger" }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "warning", size: 16 }), /* @__PURE__ */ import_react8.default.createElement("div", { style: { flex: 1 } }, wizardError), /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "oa-btn oa-btn-xs", onClick: () => setWizardError(null) }, "\u5173\u95ED")), wizardNotice && /* @__PURE__ */ import_react8.default.createElement("div", { role: "status", className: "oa-alert oa-alert-ok" }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "check", size: 16 }), /* @__PURE__ */ import_react8.default.createElement("div", { style: { flex: 1 } }, wizardNotice), /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "oa-btn oa-btn-xs", onClick: () => setWizardNotice(null) }, "\u5173\u95ED")), wizardStep === 1 && /* @__PURE__ */ import_react8.default.createElement("form", { id: `${formId}-source-form`, onSubmit: (e) => void handleStep1Submit(e),
|
|
57614
|
+
return /* @__PURE__ */ import_react8.default.createElement("li", { key: step.id, className: `oa-step-item ${stateClass}`, "aria-current": wizardStep === step.id ? "step" : void 0 }, stateClass === "done" ? /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "check", size: 13 }), /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-step-accessible" }, "\u5DF2\u5B8C\u6210")) : /* @__PURE__ */ import_react8.default.createElement("span", { "aria-hidden": "true" }, step.id, "."), /* @__PURE__ */ import_react8.default.createElement("span", null, step.label));
|
|
57615
|
+
}))), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-overlay-body" }, wizardError && /* @__PURE__ */ import_react8.default.createElement("div", { role: "alert", className: "oa-alert oa-alert-danger" }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "warning", size: 16 }), /* @__PURE__ */ import_react8.default.createElement("div", { style: { flex: 1 } }, wizardError), /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "oa-btn oa-btn-xs", onClick: () => setWizardError(null) }, "\u5173\u95ED")), wizardNotice && /* @__PURE__ */ import_react8.default.createElement("div", { role: "status", className: "oa-alert oa-alert-ok" }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "check", size: 16 }), /* @__PURE__ */ import_react8.default.createElement("div", { style: { flex: 1 } }, wizardNotice), /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "oa-btn oa-btn-xs", onClick: () => setWizardNotice(null) }, "\u5173\u95ED")), wizardStep === 1 && /* @__PURE__ */ import_react8.default.createElement("form", { id: `${formId}-source-form`, onSubmit: (e) => void handleStep1Submit(e), className: "oa-source-form" }, upgradeTarget && /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-alert oa-alert-info" }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "sparkle", size: 16 }), /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement("strong", null, "\u5347\u7EA7\u76EE\u6807\uFF1A", upgradeTarget.name), "\uFF08", /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-mono" }, upgradeTarget.slug), "\uFF0C\u5F53\u524D\u7248\u672C v", upgradeTarget.current_version || 1, "\uFF09\u3002\u5C06\u6CBF\u7528\u539F\u5E94\u7528\u8BBF\u95EE\u5730\u5740 ", /* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-mono" }, upgradeTarget.app_url), "\u3002")), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-form-card", style: { display: "flex", flexDirection: "column", gap: 14 } }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-field" }, /* @__PURE__ */ import_react8.default.createElement("label", { className: "oa-label", htmlFor: `${formId}-app-name` }, "\u5E94\u7528\u540D\u79F0 *"), /* @__PURE__ */ import_react8.default.createElement(
|
|
57534
57616
|
"input",
|
|
57535
57617
|
{
|
|
57536
57618
|
id: `${formId}-app-name`,
|
|
@@ -57630,75 +57712,45 @@ function AppsPanel({
|
|
|
57630
57712
|
onChange: (e) => setSelectedEffort(e.target.value)
|
|
57631
57713
|
},
|
|
57632
57714
|
availableEfforts.length === 0 ? /* @__PURE__ */ import_react8.default.createElement("option", { value: "" }, "\u9ED8\u8BA4") : availableEfforts.map((ef) => /* @__PURE__ */ import_react8.default.createElement("option", { key: ef.id, value: ef.id }, ef.name || ef.id))
|
|
57633
|
-
)))), /* @__PURE__ */ import_react8.default.createElement("
|
|
57634
|
-
"button",
|
|
57635
|
-
{
|
|
57636
|
-
type: "button",
|
|
57637
|
-
className: `oa-segmented-btn ${sourceKind === "zip" ? "active" : ""}`,
|
|
57638
|
-
onClick: () => setSourceKind("zip")
|
|
57639
|
-
},
|
|
57640
|
-
"\u4E0A\u4F20\u6E90\u7801\u538B\u7F29\u5305 (.zip)"
|
|
57641
|
-
), /* @__PURE__ */ import_react8.default.createElement(
|
|
57642
|
-
"button",
|
|
57643
|
-
{
|
|
57644
|
-
type: "button",
|
|
57645
|
-
className: `oa-segmented-btn ${sourceKind === "folder" ? "active" : ""}`,
|
|
57646
|
-
onClick: () => setSourceKind("folder")
|
|
57647
|
-
},
|
|
57648
|
-
"\u9009\u62E9\u672C\u673A\u6E90\u7801\u76EE\u5F55"
|
|
57649
|
-
))), sourceKind === "zip" ? /* @__PURE__ */ import_react8.default.createElement(
|
|
57715
|
+
)))), /* @__PURE__ */ import_react8.default.createElement("section", { className: "oa-form-card", "aria-labelledby": `${formId}-source-label` }, /* @__PURE__ */ import_react8.default.createElement("h3", { id: `${formId}-source-label`, className: "oa-source-label" }, "\u9009\u62E9\u5E94\u7528\u6E90\u7801\uFF08\u6587\u4EF6\u5939\u6216 ZIP\uFF09", /* @__PURE__ */ import_react8.default.createElement("span", { "aria-hidden": "true" }, " *")), /* @__PURE__ */ import_react8.default.createElement(
|
|
57650
57716
|
"div",
|
|
57651
57717
|
{
|
|
57652
|
-
className: `oa-dropzone
|
|
57653
|
-
onDragOver: (
|
|
57654
|
-
|
|
57655
|
-
setDragActive(true);
|
|
57718
|
+
className: `oa-dropzone${dragActive ? " dragging" : ""}`,
|
|
57719
|
+
onDragOver: (event) => {
|
|
57720
|
+
event.preventDefault();
|
|
57721
|
+
if (!wizardBusy) setDragActive(true);
|
|
57656
57722
|
},
|
|
57657
|
-
onDragLeave: () =>
|
|
57658
|
-
|
|
57659
|
-
e.preventDefault();
|
|
57660
|
-
setDragActive(false);
|
|
57661
|
-
const file2 = e.dataTransfer.files?.[0];
|
|
57662
|
-
if (file2) setZipFile(file2);
|
|
57723
|
+
onDragLeave: (event) => {
|
|
57724
|
+
if (!(event.relatedTarget instanceof Node) || !event.currentTarget.contains(event.relatedTarget)) setDragActive(false);
|
|
57663
57725
|
},
|
|
57664
|
-
|
|
57665
|
-
|
|
57666
|
-
|
|
57667
|
-
|
|
57668
|
-
|
|
57669
|
-
|
|
57670
|
-
type: "file",
|
|
57671
|
-
accept: ".zip,application/zip",
|
|
57672
|
-
style: { display: "none" },
|
|
57673
|
-
onChange: (e) => {
|
|
57674
|
-
const file2 = e.target.files?.[0];
|
|
57675
|
-
if (file2) setZipFile(file2);
|
|
57676
|
-
}
|
|
57726
|
+
onDrop: (event) => {
|
|
57727
|
+
event.preventDefault();
|
|
57728
|
+
setDragActive(false);
|
|
57729
|
+
const files = event.dataTransfer.files;
|
|
57730
|
+
if (files.length === 1 && files[0]) selectZip(files[0]);
|
|
57731
|
+
else if (files.length > 1) setWizardError("\u4E00\u6B21\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A ZIP \u538B\u7F29\u5305");
|
|
57677
57732
|
}
|
|
57678
|
-
|
|
57679
|
-
/* @__PURE__ */ import_react8.default.createElement("
|
|
57680
|
-
|
|
57681
|
-
|
|
57682
|
-
|
|
57683
|
-
|
|
57684
|
-
|
|
57685
|
-
|
|
57686
|
-
|
|
57687
|
-
|
|
57688
|
-
}
|
|
57689
|
-
},
|
|
57690
|
-
"\u91CD\u65B0\u9009\u62E9"
|
|
57691
|
-
)) : /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement("div", { style: { fontWeight: 600, color: "#0f172a" } }, "\u70B9\u51FB\u6216\u62D6\u62FD .zip \u6E90\u7801\u538B\u7F29\u5305\u5230\u6B64\u533A\u57DF"), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-hint" }, "\u652F\u6301\u6700\u5927 64 MiB\uFF0C\u81EA\u52A8\u5FFD\u7565 node_modules / .git / __pycache__")))
|
|
57692
|
-
) : /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-field" }, /* @__PURE__ */ import_react8.default.createElement("label", { className: "oa-label", htmlFor: `${formId}-folder` }, "\u672C\u673A\u6E90\u7801\u6587\u4EF6\u5939\u8DEF\u5F84"), /* @__PURE__ */ import_react8.default.createElement("div", { style: { display: "flex", gap: 8 } }, /* @__PURE__ */ import_react8.default.createElement(
|
|
57733
|
+
},
|
|
57734
|
+
/* @__PURE__ */ import_react8.default.createElement("span", { className: "oa-source-icon" }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "folder", size: 22 })),
|
|
57735
|
+
/* @__PURE__ */ import_react8.default.createElement("strong", null, "\u9009\u62E9\u672C\u5730\u5E94\u7528\u6E90\u7801"),
|
|
57736
|
+
/* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-hint" }, "\u9009\u62E9\u6E90\u7801\u6587\u4EF6\u5939\uFF0C\u6216\u62D6\u62FD\u4E0A\u4F20 ZIP \u538B\u7F29\u5305\uFF08\u6700\u591A 64 MiB\uFF09\u3002\u5206\u6790\u4F1A\u4F7F\u7528\u6E90\u7801\u526F\u672C\u3002"),
|
|
57737
|
+
/* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-source-actions" }, /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "oa-btn oa-btn-primary", disabled: wizardBusy, onClick: () => void handleBrowseFolder() }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "folder", size: 15 }), " \u9009\u62E9\u6E90\u7801\u6587\u4EF6\u5939"), /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "oa-btn", disabled: wizardBusy, onClick: () => fileInputRef.current?.click() }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "archive", size: 15 }), " \u9009\u62E9 ZIP \u538B\u7F29\u5305"), /* @__PURE__ */ import_react8.default.createElement("input", { ref: fileInputRef, type: "file", accept: ".zip,application/zip", hidden: true, onChange: (event) => {
|
|
57738
|
+
const file2 = event.currentTarget.files?.[0];
|
|
57739
|
+
event.currentTarget.value = "";
|
|
57740
|
+
if (file2) selectZip(file2);
|
|
57741
|
+
} }))
|
|
57742
|
+
), (zipFile || sourcePath.trim()) && /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-source-choice", role: "status" }, /* @__PURE__ */ import_react8.default.createElement(AppIcon, { name: "check", size: 16 }), /* @__PURE__ */ import_react8.default.createElement("span", null, zipFile ? `\u5DF2\u9009\u62E9\uFF1A${zipFile.name}\uFF08${formatFileSize(zipFile.size)}\uFF09` : "\u5DF2\u586B\u5199\u672C\u673A\u6E90\u7801\u8DEF\u5F84"), /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "oa-btn oa-btn-xs", disabled: wizardBusy, onClick: () => selectSourcePath("") }, "\u6E05\u9664\u9009\u62E9")), /* @__PURE__ */ import_react8.default.createElement("div", { className: "oa-field" }, /* @__PURE__ */ import_react8.default.createElement("label", { className: "oa-label", htmlFor: `${formId}-source-path` }, "\u6216\u8F93\u5165\u6E90\u7801\u6587\u4EF6\u5939 / ZIP \u7684\u5B8C\u6574\u8DEF\u5F84"), /* @__PURE__ */ import_react8.default.createElement(
|
|
57693
57743
|
"input",
|
|
57694
57744
|
{
|
|
57695
|
-
id: `${formId}-
|
|
57745
|
+
id: `${formId}-source-path`,
|
|
57746
|
+
ref: sourcePathInputRef,
|
|
57696
57747
|
className: "oa-input oa-mono",
|
|
57697
|
-
value:
|
|
57698
|
-
placeholder: "/
|
|
57699
|
-
|
|
57748
|
+
value: sourcePath,
|
|
57749
|
+
placeholder: "/\u8DEF\u5F84/my-app \u6216 /\u8DEF\u5F84/application.zip",
|
|
57750
|
+
disabled: wizardBusy,
|
|
57751
|
+
onChange: (event) => selectSourcePath(event.currentTarget.value)
|
|
57700
57752
|
}
|
|
57701
|
-
)
|
|
57753
|
+
)))), wizardStep === 2 && wizardJob && /* @__PURE__ */ import_react8.default.createElement(
|
|
57702
57754
|
AppDeliveryReview,
|
|
57703
57755
|
{
|
|
57704
57756
|
api,
|
|
@@ -58642,6 +58694,8 @@ var workbenchStyles = faces + `
|
|
|
58642
58694
|
}
|
|
58643
58695
|
.opc-panel .s2-kb-tab:hover { color: var(--opc-ink); }
|
|
58644
58696
|
.opc-panel .s2-kb-tab.active { color: var(--opc-blue); border-bottom-color: var(--opc-blue); font-weight: 700; }
|
|
58697
|
+
.opc-panel .s2-kb-tab-catalog.active { color: #b45309; border-bottom-color: #d97706; font-weight: 600; }
|
|
58698
|
+
.opc-panel .s2-input-catalog { border-color: #fde68a; border-radius: var(--opc-card-radius); }
|
|
58645
58699
|
.opc-panel .s2-pill {
|
|
58646
58700
|
border-radius: 999px;
|
|
58647
58701
|
background: #f1f5f9;
|
|
@@ -59739,22 +59793,26 @@ function Panel({ api, sessionId, requestedPage, navigationRevision, visible = tr
|
|
|
59739
59793
|
{
|
|
59740
59794
|
type: "button",
|
|
59741
59795
|
className: `s2-kb-tab ${kbSearchMode === "doc" ? "active" : ""}`,
|
|
59796
|
+
"aria-pressed": kbSearchMode === "doc",
|
|
59742
59797
|
onClick: () => {
|
|
59743
59798
|
setKbSearchMode("doc");
|
|
59744
59799
|
setTimeout(() => docInputRef.current?.focus(), 50);
|
|
59745
59800
|
}
|
|
59746
59801
|
},
|
|
59747
|
-
/* @__PURE__ */ import_react11.default.createElement("
|
|
59802
|
+
/* @__PURE__ */ import_react11.default.createElement(AppIcon, { name: "file", size: 14 }),
|
|
59803
|
+
/* @__PURE__ */ import_react11.default.createElement("span", null, "\u6587\u6863\u5168\u6587\u68C0\u7D22\u6A21\u5F0F"),
|
|
59748
59804
|
/* @__PURE__ */ import_react11.default.createElement("span", { className: "s2-badge-rec" }, "\u63A8\u8350"),
|
|
59749
59805
|
hits.length > 0 && /* @__PURE__ */ import_react11.default.createElement("span", { className: "badge badge-ok", style: { fontSize: 10, padding: "1px 5px" } }, hits.length)
|
|
59750
59806
|
), /* @__PURE__ */ import_react11.default.createElement(
|
|
59751
59807
|
"button",
|
|
59752
59808
|
{
|
|
59753
59809
|
type: "button",
|
|
59754
|
-
className: `s2-kb-tab ${kbSearchMode === "kb" ? "active" : ""}`,
|
|
59810
|
+
className: `s2-kb-tab s2-kb-tab-catalog ${kbSearchMode === "kb" ? "active" : ""}`,
|
|
59811
|
+
"aria-pressed": kbSearchMode === "kb",
|
|
59755
59812
|
onClick: () => setKbSearchMode("kb")
|
|
59756
59813
|
},
|
|
59757
|
-
/* @__PURE__ */ import_react11.default.createElement("
|
|
59814
|
+
/* @__PURE__ */ import_react11.default.createElement(AppIcon, { name: "folder", size: 14 }),
|
|
59815
|
+
/* @__PURE__ */ import_react11.default.createElement("span", null, "\u77E5\u8BC6\u5E93\u76EE\u5F55\u7B5B\u9009\u6A21\u5F0F"),
|
|
59758
59816
|
q && /* @__PURE__ */ import_react11.default.createElement("span", { className: "badge badge-warn", style: { fontSize: 10, padding: "1px 5px" } }, "\u5DF2\u7B5B\u9009")
|
|
59759
59817
|
)), kbSearchMode === "doc" && /* @__PURE__ */ import_react11.default.createElement(
|
|
59760
59818
|
"form",
|