@moon16u/dsh-plugin-mcp-console 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/lib/client.js +16 -5
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -185,8 +185,8 @@ window.__ModuleLoader__.load({
185
185
  ".mcp-switch-thumb{position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:999px;background:#ffffff;transition:transform .15s ease;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,.25)}",
186
186
  ".mcp-switch input:checked ~ .mcp-switch-track{background:#10b981}",
187
187
  ".mcp-switch input:checked ~ .mcp-switch-thumb{transform:translateX(16px)}",
188
- ".mcp-switch input:disabled{cursor:wait}",
189
- ".mcp-switch input:disabled ~ .mcp-switch-track{opacity:.5}",
188
+ ".mcp-switch input:disabled{cursor:pointer}",
189
+ ".mcp-switch input:disabled ~ .mcp-switch-track{opacity:.75}",
190
190
  ".mcp-mgr-summary{display:inline-flex;align-items:center;gap:6px;background:0 0;border:0;padding:0;color:var(--dsw-alias-label-secondary,#6b7280);font-family:var(--dsw-font-family);font-size:13px;cursor:pointer;user-select:none;align-self:flex-start}",
191
191
  ".mcp-mgr-summary:hover{color:var(--dsw-alias-label-primary,#111827)}",
192
192
  ".mcp-mgr-chevron{display:inline-block;width:0;height:0;border-left:4px solid currentColor;border-top:5px solid transparent;border-bottom:5px solid transparent;transition:transform .15s ease;flex:none}",
@@ -750,6 +750,15 @@ window.__ModuleLoader__.load({
750
750
  }
751
751
 
752
752
  function toggleServer(server, next) {
753
+ setSnapshot(function (prev) {
754
+ if (!prev || !prev.servers) return prev;
755
+ return {
756
+ ...prev,
757
+ servers: prev.servers.map(function (s) {
758
+ return s.name === server.name ? { ...s, enabled: next } : s;
759
+ }),
760
+ };
761
+ });
753
762
  return withBusy(server.name, function () {
754
763
  return mcpApi("/servers/" + encodeURIComponent(server.name) + "/" + (next ? "enable" : "disable"), { method: "POST" });
755
764
  });
@@ -898,20 +907,22 @@ window.__ModuleLoader__.load({
898
907
  }, t("confirmYes")))));
899
908
  }
900
909
 
910
+ var topDisabled = refreshing || mode !== null;
911
+
901
912
  return McpH("div", { className: "mcp-mgr", "data-mcp-console-section": "" },
902
913
  McpH("div", { className: "mcp-mgr-head" },
903
914
  McpH("h2", { className: "mcp-mgr-title" }, t("title")),
904
915
  McpH("button", {
905
- type: "button", className: "mcp-mgr-iconbtn", disabled: busyAny,
916
+ type: "button", className: "mcp-mgr-iconbtn", disabled: refreshing,
906
917
  title: t("refresh"), "aria-label": t("refresh"),
907
918
  onClick: refresh,
908
919
  }, McpH(McpIcons.IconRefreshOutline16, { size: 15 })),
909
920
  McpH("button", {
910
- type: "button", className: "mcp-mgr-btn", disabled: busyAny,
921
+ type: "button", className: "mcp-mgr-btn", disabled: topDisabled,
911
922
  onClick: function () { setEditing(null); setMode("add"); },
912
923
  }, McpH(McpIcons.IconPlusOutline16, { size: 14 }), t("add")),
913
924
  McpH("button", {
914
- type: "button", className: "mcp-mgr-btn", disabled: busyAny,
925
+ type: "button", className: "mcp-mgr-btn", disabled: topDisabled,
915
926
  onClick: function () { setMode("import"); },
916
927
  }, t("importAction"))),
917
928
  snapshot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moon16u/dsh-plugin-mcp-console",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Web GUI console for MCP servers: manages the official @deepseek-ai/dsh-mcp-client at runtime — add/edit/enable/disable/reconnect/delete servers, live status, mcpServers JSON import. No MCP protocol code: connection and tool registration are 100% the official client, resolved from the running DSH profile.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",