@ququ-jiaxk/dsh-plugin-center 0.1.42 → 0.1.43
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 +17 -17
- package/lib/index.js +5 -5
- package/package.json +2 -2
package/lib/client.js
CHANGED
|
@@ -30,7 +30,7 @@ __export(client_exports, {
|
|
|
30
30
|
module.exports = __toCommonJS(client_exports);
|
|
31
31
|
var import_react = require("react");
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var PLUGIN_VERSION = true ? "0.1.
|
|
33
|
+
var PLUGIN_VERSION = true ? "0.1.43" : "0.0.0";
|
|
34
34
|
var PANEL_ID = "plugin-center";
|
|
35
35
|
var inject = ["slots", "remote", "remote.pluginManager"];
|
|
36
36
|
var hostCtx = null;
|
|
@@ -145,7 +145,7 @@ function apply(ctx) {
|
|
|
145
145
|
name: "sidebar.panellist",
|
|
146
146
|
id: PANEL_ID,
|
|
147
147
|
order: 20,
|
|
148
|
-
label: () => "\u63D2\u4EF6\u4E2D\u5FC3"
|
|
148
|
+
label: () => "\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3"
|
|
149
149
|
},
|
|
150
150
|
PanelIcon
|
|
151
151
|
)
|
|
@@ -287,7 +287,7 @@ function LocalDetailView({
|
|
|
287
287
|
bundle.official ? "\u968F DSH \u5B89\u88C5" : localInstall ? "\u672C\u5730\u5305\u5B89\u88C5" : "registry \u5B89\u88C5",
|
|
288
288
|
bundle.source ? ` \xB7 ${bundle.source}` : ""
|
|
289
289
|
] }),
|
|
290
|
-
onOpenCenter ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "pcx-btn", onClick: onOpenCenter, children: "\u5728\u63D2\u4EF6\u4E2D\u5FC3\u67E5\u770B" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pcx-badge", children: "\u672A\u5728\u63D2\u4EF6\u4E2D\u5FC3\u4E0A\u67B6" }),
|
|
290
|
+
onOpenCenter ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "pcx-btn", onClick: onOpenCenter, children: "\u5728\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u67E5\u770B" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pcx-badge", children: "\u672A\u5728\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u4E0A\u67B6" }),
|
|
291
291
|
bundle.removable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "pcx-btn pcx-btn-danger", onClick: onUninstall, children: "\u5378\u8F7D" }) : null
|
|
292
292
|
] }),
|
|
293
293
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "pcx-section", children: [
|
|
@@ -444,7 +444,7 @@ function Panel() {
|
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
446
|
setSelfUpdate({ phase: "idle" });
|
|
447
|
-
if (manual) setNotice("\u63D2\u4EF6\u4E2D\u5FC3\u5DF2\u662F\u6700\u65B0\u7248\u672C");
|
|
447
|
+
if (manual) setNotice("\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u5DF2\u662F\u6700\u65B0\u7248\u672C");
|
|
448
448
|
}
|
|
449
449
|
async function pollSelfUpdate(version) {
|
|
450
450
|
if (selfUpdatePolling) return;
|
|
@@ -493,7 +493,7 @@ function Panel() {
|
|
|
493
493
|
setSelfUpdate({
|
|
494
494
|
phase: "error",
|
|
495
495
|
to: version,
|
|
496
|
-
message: "\u66F4\u65B0\u8D85\u65F6\uFF1A\u8BF7\u5230 DSH \u7684 Plugins \u9875\u9762\u786E\u8BA4\u63D2\u4EF6\u4E2D\u5FC3\u7248\u672C\uFF0C\u6216\u91CD\u542F DSH \u540E\u91CD\u8BD5"
|
|
496
|
+
message: "\u66F4\u65B0\u8D85\u65F6\uFF1A\u8BF7\u5230 DSH \u7684 Plugins \u9875\u9762\u786E\u8BA4\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u7248\u672C\uFF0C\u6216\u91CD\u542F DSH \u540E\u91CD\u8BD5"
|
|
497
497
|
});
|
|
498
498
|
} finally {
|
|
499
499
|
selfUpdatePolling = false;
|
|
@@ -514,7 +514,7 @@ function Panel() {
|
|
|
514
514
|
}
|
|
515
515
|
function confirmSelfUpdate(version) {
|
|
516
516
|
setDialog({
|
|
517
|
-
title: `\u66F4\u65B0\u63D2\u4EF6\u4E2D\u5FC3\u5230 v${version}`,
|
|
517
|
+
title: `\u66F4\u65B0\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u5230 v${version}`,
|
|
518
518
|
description: "\u66F4\u65B0\u4F1A\u5148\u5378\u8F7D\u65E7\u7248\u672C\u518D\u5B89\u88C5\u65B0\u7248\u672C\uFF0C\u9762\u677F\u5C06\u65AD\u5F00\u51E0\u79D2\uFF0C\u5B8C\u6210\u540E\u81EA\u52A8\u5237\u65B0\u3002\u5931\u8D25\u65F6 DSH \u4F1A\u81EA\u52A8\u6062\u590D\u65E7\u7248\u672C\u3002",
|
|
519
519
|
input: false,
|
|
520
520
|
confirmLabel: "\u5F00\u59CB\u66F4\u65B0",
|
|
@@ -548,7 +548,7 @@ function Panel() {
|
|
|
548
548
|
if (record.phase === "done" && record.to) {
|
|
549
549
|
selfUpdateNotified = true;
|
|
550
550
|
setNotice(
|
|
551
|
-
record.restartReason ? `\u5DF2\u5B89\u88C5 v${record.to}\uFF0C\u91CD\u542F DSH \u540E\u751F\u6548` : `\u63D2\u4EF6\u4E2D\u5FC3\u5DF2\u66F4\u65B0\u5230 v${record.to}`
|
|
551
|
+
record.restartReason ? `\u5DF2\u5B89\u88C5 v${record.to}\uFF0C\u91CD\u542F DSH \u540E\u751F\u6548` : `\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u5DF2\u66F4\u65B0\u5230 v${record.to}`
|
|
552
552
|
);
|
|
553
553
|
return;
|
|
554
554
|
}
|
|
@@ -614,7 +614,7 @@ function Panel() {
|
|
|
614
614
|
function uninstallLocal(packageName) {
|
|
615
615
|
setDialog({
|
|
616
616
|
title: `\u5378\u8F7D\u300C${packageName}\u300D\uFF1F`,
|
|
617
|
-
description: "\u53EA\u4ECE\u672C\u673A DSH \u79FB\u9664\uFF0C\u4E0D\u5F71\u54CD\u63D2\u4EF6\u4E2D\u5FC3\u91CC\u7684\u7248\u672C\u3002",
|
|
617
|
+
description: "\u53EA\u4ECE\u672C\u673A DSH \u79FB\u9664\uFF0C\u4E0D\u5F71\u54CD\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u91CC\u7684\u7248\u672C\u3002",
|
|
618
618
|
input: false,
|
|
619
619
|
confirmLabel: "\u5378\u8F7D",
|
|
620
620
|
danger: true,
|
|
@@ -891,7 +891,7 @@ function Panel() {
|
|
|
891
891
|
onYank: (releaseId) => yankRelease(releaseId),
|
|
892
892
|
onUninstall: () => setDialog({
|
|
893
893
|
title: `\u5378\u8F7D\u300C${detail.displayName}\u300D\uFF1F`,
|
|
894
|
-
description: "\u53EA\u4ECE\u672C\u673A DSH \u79FB\u9664\uFF0C\u4E0D\u5F71\u54CD\u63D2\u4EF6\u4E2D\u5FC3\u91CC\u7684\u7248\u672C\u3002",
|
|
894
|
+
description: "\u53EA\u4ECE\u672C\u673A DSH \u79FB\u9664\uFF0C\u4E0D\u5F71\u54CD\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u91CC\u7684\u7248\u672C\u3002",
|
|
895
895
|
input: false,
|
|
896
896
|
confirmLabel: "\u5378\u8F7D",
|
|
897
897
|
danger: true,
|
|
@@ -924,13 +924,13 @@ function Panel() {
|
|
|
924
924
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pcx-logo", children: "P" }),
|
|
925
925
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
926
926
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h1", { className: "pcx-title", children: [
|
|
927
|
-
"\u63D2\u4EF6\u4E2D\u5FC3",
|
|
927
|
+
"\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3",
|
|
928
928
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
929
929
|
"button",
|
|
930
930
|
{
|
|
931
931
|
type: "button",
|
|
932
932
|
className: "pcx-version-tag pcx-version-tag-btn",
|
|
933
|
-
title: state?.self?.updatable ? "\u70B9\u51FB\u68C0\u67E5\u63D2\u4EF6\u4E2D\u5FC3\u66F4\u65B0" : "\u63D2\u4EF6\u4E2D\u5FC3\u7248\u672C",
|
|
933
|
+
title: state?.self?.updatable ? "\u70B9\u51FB\u68C0\u67E5\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u66F4\u65B0" : "\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u7248\u672C",
|
|
934
934
|
onClick: () => void checkSelfUpdate(true),
|
|
935
935
|
children: [
|
|
936
936
|
"v",
|
|
@@ -987,14 +987,14 @@ function Panel() {
|
|
|
987
987
|
error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-toast pcx-toast-error", children: error }) : null,
|
|
988
988
|
installProgress ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstallProgressCard, { progress: installProgress }) : null,
|
|
989
989
|
selfUpdate.phase === "running" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-dialog", role: "dialog", "aria-modal": "true", children: [
|
|
990
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "pcx-dialog-title", children: "\u6B63\u5728\u66F4\u65B0\u63D2\u4EF6\u4E2D\u5FC3" }),
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "pcx-dialog-title", children: "\u6B63\u5728\u66F4\u65B0\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3" }),
|
|
991
991
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "pcx-sub", children: [
|
|
992
992
|
"\u6B63\u5728\u5B89\u88C5 v",
|
|
993
993
|
selfUpdate.to,
|
|
994
994
|
"\uFF0C\u9762\u677F\u4F1A\u77ED\u6682\u65AD\u5F00\uFF0C\u5B8C\u6210\u540E\u81EA\u52A8\u5237\u65B0\u3002"
|
|
995
995
|
] }),
|
|
996
996
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-progress-track pcx-progress-indeterminate", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-progress-fill" }) }),
|
|
997
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u5982\u679C\u957F\u65F6\u95F4\u6CA1\u6709\u53CD\u5E94\uFF0C\u8BF7\u5230 DSH \u7684 Plugins \u9875\u9762\u786E\u8BA4\u63D2\u4EF6\u4E2D\u5FC3\u7248\u672C\u3002" })
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u5982\u679C\u957F\u65F6\u95F4\u6CA1\u6709\u53CD\u5E94\uFF0C\u8BF7\u5230 DSH \u7684 Plugins \u9875\u9762\u786E\u8BA4\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u7248\u672C\u3002" })
|
|
998
998
|
] }) }) : null,
|
|
999
999
|
selfUpdate.phase === "done" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-dialog", role: "dialog", "aria-modal": "true", children: [
|
|
1000
1000
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h3", { className: "pcx-dialog-title", children: [
|
|
@@ -1011,7 +1011,7 @@ function Panel() {
|
|
|
1011
1011
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u5F53\u524D profile \u6CA1\u6709\u70ED\u91CD\u8F7D\uFF0C\u91CD\u542F DSH \u540E\u65B0\u7248\u672C\u624D\u4F1A\u751F\u6548\u3002" }),
|
|
1012
1012
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-dialog-actions", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "pcx-btn pcx-btn-primary", onClick: () => setSelfUpdate({ phase: "idle" }), children: "\u77E5\u9053\u4E86" }) })
|
|
1013
1013
|
] }) }) : null,
|
|
1014
|
-
!ready ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-auth-page", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-auth-column", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-empty", children: "\u6B63\u5728\u8FDE\u63A5\u63D2\u4EF6\u4E2D\u5FC3\u2026" }) }) }) : !signedIn ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-auth-page", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-auth-column", children: [
|
|
1014
|
+
!ready ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-auth-page", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-auth-column", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-empty", children: "\u6B63\u5728\u8FDE\u63A5\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u2026" }) }) }) : !signedIn ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-auth-page", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-auth-column", children: [
|
|
1015
1015
|
notice ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-alert pcx-alert-success", children: notice }) : null,
|
|
1016
1016
|
error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-alert pcx-alert-error", children: error }) : null,
|
|
1017
1017
|
authView === "reset" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1027,7 +1027,7 @@ function Panel() {
|
|
|
1027
1027
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1028
1028
|
AuthBox,
|
|
1029
1029
|
{
|
|
1030
|
-
title: "\u767B\u5F55\u63D2\u4EF6\u4E2D\u5FC3",
|
|
1030
|
+
title: "\u767B\u5F55\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3",
|
|
1031
1031
|
description: "\u767B\u5F55\u540E\u5373\u53EF\u6D4F\u89C8\u3001\u5B89\u88C5\u548C\u4E0A\u4F20\u63D2\u4EF6\u3002",
|
|
1032
1032
|
onDone: () => load(scope, category, query),
|
|
1033
1033
|
onForgot: () => setAuthView("reset")
|
|
@@ -1277,7 +1277,7 @@ function UploadView({
|
|
|
1277
1277
|
AuthBox,
|
|
1278
1278
|
{
|
|
1279
1279
|
title: "\u767B\u5F55\u540E\u4E0A\u4F20\u63D2\u4EF6",
|
|
1280
|
-
description: "\u4E0A\u4F20\u9700\u8981\u63D2\u4EF6\u4E2D\u5FC3\u8D26\u53F7\uFF1B\u767B\u5F55\u6210\u529F\u540E\u4F1A\u81EA\u52A8\u8FDB\u5165\u4E0A\u4F20\u8868\u5355\u3002",
|
|
1280
|
+
description: "\u4E0A\u4F20\u9700\u8981\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\u8D26\u53F7\uFF1B\u767B\u5F55\u6210\u529F\u540E\u4F1A\u81EA\u52A8\u8FDB\u5165\u4E0A\u4F20\u8868\u5355\u3002",
|
|
1281
1281
|
onDone: onLogin
|
|
1282
1282
|
}
|
|
1283
1283
|
) }) })
|
|
@@ -2543,7 +2543,7 @@ function BindOps({ onDone, onCancel }) {
|
|
|
2543
2543
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-auth", children: [
|
|
2544
2544
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-auth-head", children: [
|
|
2545
2545
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "pcx-auth-title", children: "\u7ED1\u5B9A\u8FD0\u8425\u52A9\u624B\u8D26\u53F7" }),
|
|
2546
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u7ED1\u5B9A\u540E\u53EF\u4EE5\u7528\u8FD0\u8425\u52A9\u624B\u8D26\u53F7\u767B\u5F55\u63D2\u4EF6\u4E2D\u5FC3\uFF1B\u9700\u8981\u8BE5\u624B\u673A\u53F7\u5728\u8FD0\u8425\u52A9\u624B\u91CC\u5DF2\u6CE8\u518C\u3002" })
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u7ED1\u5B9A\u540E\u53EF\u4EE5\u7528\u8FD0\u8425\u52A9\u624B\u8D26\u53F7\u767B\u5F55\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3\uFF1B\u9700\u8981\u8BE5\u624B\u673A\u53F7\u5728\u8FD0\u8425\u52A9\u624B\u91CC\u5DF2\u6CE8\u518C\u3002" })
|
|
2547
2547
|
] }),
|
|
2548
2548
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { className: "pcx-auth-form pcx-auth-form-bind", onSubmit: submit, children: [
|
|
2549
2549
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-field", children: [
|
package/lib/index.js
CHANGED
|
@@ -143,7 +143,7 @@ function selfUpdateBlockedInfo(own) {
|
|
|
143
143
|
if (local) {
|
|
144
144
|
return {
|
|
145
145
|
reason: 'local',
|
|
146
|
-
hint:
|
|
146
|
+
hint: `当前小趣插件中心是按本地包安装的(${source ?? 'file:'}),DSH 无法原地升级。执行一次迁移后即可自动更新:${reinstall},然后重启 DSH。`,
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -256,7 +256,7 @@ async function centerFetch(config, path, init = {}) {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
if (!response.ok) {
|
|
259
|
-
const error = new Error(data.error ??
|
|
259
|
+
const error = new Error(data.error ?? `小趣插件中心返回 ${response.status}`)
|
|
260
260
|
error.status = response.status
|
|
261
261
|
throw error
|
|
262
262
|
}
|
|
@@ -825,7 +825,7 @@ export function apply(ctx) {
|
|
|
825
825
|
const version = url.searchParams.get('version')
|
|
826
826
|
const contentType = req.headers['content-type'] ?? ''
|
|
827
827
|
|
|
828
|
-
//
|
|
828
|
+
// 面板直传:文件不经过小趣插件中心,先换预签名地址,再由本机 PUT 到 OSS。
|
|
829
829
|
if (version && !contentType.includes('multipart')) {
|
|
830
830
|
let presign
|
|
831
831
|
try {
|
|
@@ -1128,9 +1128,9 @@ export function apply(ctx) {
|
|
|
1128
1128
|
const isNetwork = raw === 'fetch failed' || error.name === 'TypeError'
|
|
1129
1129
|
if (installTarget) failInstallProgress(installTarget)
|
|
1130
1130
|
const message = isNetwork
|
|
1131
|
-
?
|
|
1131
|
+
? `无法连接小趣插件中心(${config.baseUrl}),请确认服务已启动`
|
|
1132
1132
|
: error.name === 'AbortError' || raw.includes('timeout')
|
|
1133
|
-
? '
|
|
1133
|
+
? '连接小趣插件中心超时,请稍后重试'
|
|
1134
1134
|
: raw
|
|
1135
1135
|
return send(res, status, {
|
|
1136
1136
|
error: message,
|
package/package.json
CHANGED