dsh-multi-router 0.6.11 → 0.6.12

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 CHANGED
@@ -50,7 +50,7 @@ module.exports = __toCommonJS(client_exports);
50
50
  var import_react = require("react");
51
51
 
52
52
  // package.json
53
- var version = "0.6.11";
53
+ var version = "0.6.12";
54
54
 
55
55
  // src/client.jsx
56
56
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -2594,9 +2594,10 @@ function PluginUpdatesPanel({ data, busy, act }) {
2594
2594
  if (data?.available && !running) void act({ action: !data.checkedAt || Date.now() - data.checkedAt > 864e5 ? "plugins.check" : "plugins.list" });
2595
2595
  }, []);
2596
2596
  const chosen = available.filter((r) => selected.includes(r.name));
2597
+ const freshVersions = plan?.kind === "update" ? [...new Set(plan.rows.filter((r) => r.source.kind === "npm" && r.latestVersion).map((r) => `${r.source.package}@${r.latestVersion}`))] : [];
2597
2598
  const visibleRows = rows.filter((r) => r.name.toLowerCase().includes(pluginSearch.toLowerCase()) && (filter === "all" || (filter === "updates" ? available.includes(r) : r.source.kind === filter)));
2598
2599
  async function submitPlan() {
2599
- if (await act(plan.kind === "install" ? { action: "plugins.install", spec: plan.spec, registry: registry || void 0 } : { action: "plugins.update", names: plan.rows.map((r) => r.name), registry: registry || void 0 })) {
2600
+ if (await act(plan.kind === "install" ? { action: "plugins.install", spec: plan.spec, registry: registry || void 0 } : { action: "plugins.update", names: plan.rows.map((r) => r.name), registry: registry || void 0, allowFreshVersions: plan.allowFresh !== false ? freshVersions : [] })) {
2600
2601
  setPlan(null);
2601
2602
  setSelected([]);
2602
2603
  }
@@ -2772,6 +2773,17 @@ function PluginUpdatesPanel({ data, busy, act }) {
2772
2773
  "\u3002"
2773
2774
  ] })
2774
2775
  ] }, r.name)),
2776
+ freshVersions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "steps stack", children: [
2777
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "check", children: [
2778
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "checkbox", disabled: blocked, checked: plan.allowFresh !== false, onChange: (e) => setPlan((p) => ({ ...p, allowFresh: e.target.checked })) }),
2779
+ "\u5141\u8BB8\u672C\u6B21\u6307\u5B9A\u7248\u672C\u7ACB\u5373\u5B89\u88C5\uFF08\u4E0D\u7B49\u5F85 24 \u5C0F\u65F6\uFF09"
2780
+ ] }),
2781
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "notice", children: [
2782
+ "\u786E\u8BA4\u66F4\u65B0\u540E\uFF0C\u4EC5\u4E3A\u4EE5\u4E0B\u7248\u672C\u4FDD\u5B58\u7B49\u5F85\u671F\u4F8B\u5916\uFF1A",
2783
+ freshVersions.join("\u3001"),
2784
+ "\u3002\u65B0\u5305\u7B49\u5F85\u671F\u7528\u4E8E\u964D\u4F4E\u4F9B\u5E94\u94FE\u98CE\u9669\uFF1B\u5176\u4ED6\u7248\u672C\u3001\u4F9D\u8D56\u548C\u811A\u672C\u6388\u6743\u4ECD\u9075\u5B88 DSH \u7B56\u7565\u3002\u53EF\u53D6\u6D88\u52FE\u9009\uFF0C\u7EE7\u7EED\u9075\u5B88\u7B49\u5F85\u671F\u3002"
2785
+ ] })
2786
+ ] }),
2775
2787
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "notice", children: [
2776
2788
  "npm \u5B89\u88C5\u6E90\uFF1A",
2777
2789
  registry || "\u6CBF\u7528 DSH \u8BBE\u7F6E"