dshmarket 1.28.0 → 1.28.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/client/client.js +37 -13
- package/client/client.js.map +1 -1
- package/lib/routes.js +6 -1
- package/package.json +1 -1
- package/src/client/MarketSection.tsx +40 -15
- package/src/client/OperationsPanel.tsx +8 -1
- package/src/client/operations.ts +7 -0
- package/src/routes.ts +6 -1
package/client/client.js
CHANGED
|
@@ -2367,7 +2367,13 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
2367
2367
|
onClick: props.onRefresh,
|
|
2368
2368
|
children: t("refresh")
|
|
2369
2369
|
}),
|
|
2370
|
-
record.state === "failed" && props.
|
|
2370
|
+
record.state === "failed" && (record.blockedBuilds ?? []).length > 0 && props.onApproveBuilds !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
2371
|
+
variant: "primary",
|
|
2372
|
+
size: "sm",
|
|
2373
|
+
onClick: () => props.onApproveBuilds?.(record),
|
|
2374
|
+
children: t("approveBuilds")
|
|
2375
|
+
}),
|
|
2376
|
+
record.state === "failed" && (record.blockedBuilds ?? []).length === 0 && props.onRetry !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
2371
2377
|
variant: "outline",
|
|
2372
2378
|
size: "sm",
|
|
2373
2379
|
onClick: () => props.onRetry?.(record),
|
|
@@ -5671,15 +5677,17 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
5671
5677
|
setOperationsOpen(true);
|
|
5672
5678
|
return;
|
|
5673
5679
|
}
|
|
5674
|
-
|
|
5680
|
+
const blocked = Array.isArray(body.ignoredBuilds) ? body.ignoredBuilds.map(String) : [];
|
|
5681
|
+
if (blocked.length > 0) setBuildsSkipped({
|
|
5675
5682
|
plugin,
|
|
5676
|
-
names:
|
|
5683
|
+
names: blocked
|
|
5677
5684
|
});
|
|
5678
5685
|
const text = (v) => typeof v === "string" ? v : v && typeof v.text === "string" ? v.text : v == null ? "" : JSON.stringify(v);
|
|
5679
5686
|
const detail = text(body.error) || humanOutput([text(body.stderr), text(body.stdout)].filter(Boolean).join("\n")) || "exit " + body.exitCode;
|
|
5680
5687
|
setRecords((list) => patch(list, recordId, {
|
|
5681
5688
|
state: "failed",
|
|
5682
|
-
reason: detail.trim().slice(-600)
|
|
5689
|
+
reason: detail.trim().slice(-600),
|
|
5690
|
+
...blocked.length > 0 ? { blockedBuilds: blocked } : {}
|
|
5683
5691
|
}));
|
|
5684
5692
|
setOperationsOpen(true);
|
|
5685
5693
|
}
|
|
@@ -6054,6 +6062,17 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
6054
6062
|
setGroupPayload,
|
|
6055
6063
|
t
|
|
6056
6064
|
]);
|
|
6065
|
+
/** Approve the build scripts pnpm refused, then rerun what was blocked. */
|
|
6066
|
+
const approveAndRetry = (0, react.useCallback)((names, resume) => {
|
|
6067
|
+
fetch("/dsh-market/approve-builds", {
|
|
6068
|
+
method: "POST",
|
|
6069
|
+
headers: { "content-type": "application/json" },
|
|
6070
|
+
body: JSON.stringify({ packages: names })
|
|
6071
|
+
}).then((res) => res.json()).then((body) => {
|
|
6072
|
+
if (!body.ok) setInstallError(String(body.error || "approve failed"));
|
|
6073
|
+
else resume();
|
|
6074
|
+
}).catch((error) => setInstallError(String(error)));
|
|
6075
|
+
}, []);
|
|
6057
6076
|
const doGroupToggle = (0, react.useCallback)((name, enabled) => {
|
|
6058
6077
|
return doGroupAction({
|
|
6059
6078
|
action: "toggle",
|
|
@@ -6985,7 +7004,17 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
6985
7004
|
onCancel: () => doCancel(),
|
|
6986
7005
|
onDismiss: (record) => setRecords((list) => drop(list, record.id)),
|
|
6987
7006
|
onRefresh: () => location.reload(),
|
|
6988
|
-
onResolveConflict: resolveConflict
|
|
7007
|
+
onResolveConflict: resolveConflict,
|
|
7008
|
+
onApproveBuilds: (record) => {
|
|
7009
|
+
const names = record.blockedBuilds ?? [];
|
|
7010
|
+
if (names.length === 0) return;
|
|
7011
|
+
setRecords((list) => drop(list, record.id));
|
|
7012
|
+
const plugin = record.url === void 0 ? void 0 : data?.plugins.find((p) => p.url === record.url);
|
|
7013
|
+
approveAndRetry(names, () => {
|
|
7014
|
+
if (plugin !== void 0) doInstall(plugin);
|
|
7015
|
+
else doUpdate(record.name, false, false);
|
|
7016
|
+
});
|
|
7017
|
+
}
|
|
6989
7018
|
})
|
|
6990
7019
|
]
|
|
6991
7020
|
}),
|
|
@@ -7182,15 +7211,10 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
7182
7211
|
onClick: () => {
|
|
7183
7212
|
const { plugin, updateName, names, restore } = buildsSkipped;
|
|
7184
7213
|
setBuildsSkipped(null);
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
headers: { "content-type": "application/json" },
|
|
7188
|
-
body: JSON.stringify({ packages: names })
|
|
7189
|
-
}).then((res) => res.json()).then((body) => {
|
|
7190
|
-
if (!body.ok) setInstallError(String(body.error || "approve failed"));
|
|
7191
|
-
else if (plugin !== void 0) doInstall(plugin);
|
|
7214
|
+
approveAndRetry(names, () => {
|
|
7215
|
+
if (plugin !== void 0) doInstall(plugin);
|
|
7192
7216
|
else if (updateName !== void 0) doUpdate(updateName, false, restore === true);
|
|
7193
|
-
})
|
|
7217
|
+
});
|
|
7194
7218
|
},
|
|
7195
7219
|
children: t("approveBuilds")
|
|
7196
7220
|
})
|