dsh-plugin-admin 0.5.1 → 0.5.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 +17 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -73,6 +73,21 @@ var CSS_TEXT = [
73
73
  '[data-dsh-admin-section] .group-header .btn.sm + .btn.sm { margin-left: 0; }',
74
74
  '[data-dsh-admin-section] .group-path { font-family: monospace; font-size: 10px; color: var(--dsw-alias-label-tertiary, #888); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; text-align: right; }',
75
75
  '[data-dsh-admin-section] .card { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 12px; border: 1px solid var(--dsw-alias-border-subtle, rgba(200,200,210,0.4)); background: var(--dsw-alias-bg-elevated, var(--dsw-alias-bg-base, transparent)); box-shadow: 0 1px 2px rgba(0,0,0,0.02); transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }',
76
+ // MCP editor: the whole section is `overflow:hidden` with a bounded height, so
77
+ // a tall editor form (e.g. with reconnect fields expanded) would get its
78
+ // bottom action row — including the 保存 button — clipped out of reach.
79
+ // Give the editor its own scroll viewport so the buttons stay visible/clickable.
80
+ '[data-dsh-admin-section] .mcp-editor { flex: 1 1 auto; min-height: 0; max-height: calc(100vh - 200px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-border-subtle, rgba(200,200,210,0.4)) transparent; }',
81
+ '[data-dsh-admin-section] .mcp-editor::-webkit-scrollbar { width: 6px; }',
82
+ '[data-dsh-admin-section] .mcp-editor::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--dsw-alias-border-subtle, rgba(200,200,210,0.4)); }',
83
+ // Keep the action row (取消 / 保存) pinned at the bottom of the editor card
84
+ // and always within the scroll viewport, even on short windows.
85
+ '[data-dsh-admin-section] .mcp-editor .card-actions { position: sticky; bottom: 0; background: var(--dsw-alias-bg-elevated, var(--dsw-alias-bg-base, #fff)); padding-top: 10px; margin-top: 4px; }',
86
+ // When the editor is open alongside the list (editing an existing entry), the
87
+ // list must not compete for the bounded section height or the editor's 保存
88
+ // button gets pushed below the clipped region. Let the list shrink to its
89
+ // content instead of claiming flex space.
90
+ '[data-dsh-admin-section].mcp-editor-open .list { flex: 0 1 auto; max-height: 140px; }',
76
91
  '[data-dsh-admin-section] .card:hover { transform: translateY(-1px); border-color: var(--dsw-alias-label-tertiary, rgba(180,180,195,0.6)); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }',
77
92
  '[data-dsh-admin-section] .card-header { display: flex; align-items: center; gap: 8px; min-width: 0; }',
78
93
  '[data-dsh-admin-section] .card-title { font-size: 13px; font-weight: 600; color: var(--dsw-alias-label-primary); display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; }',
@@ -1361,7 +1376,7 @@ function McpSection(props) {
1361
1376
  return function () { alive.current = false }
1362
1377
  }, [])
1363
1378
 
1364
- return createElement('div', { 'data-dsh-admin-section': '' },
1379
+ return createElement('div', { 'data-dsh-admin-section': '', className: mView.mcpEditorOpen ? 'mcp-editor-open' : '' },
1365
1380
  renderMcpSection(mView, patchDraft, reloadMcp, openMcpEditor, closeMcpEditor, saveMcpDraft, removeMcpEntry, testMcpEntry))
1366
1381
  }
1367
1382
 
@@ -1639,7 +1654,7 @@ function renderMcpSection(view, patchDraft, reloadMcp, openMcpEditor, closeMcpEd
1639
1654
  }
1640
1655
  rows.push(createElement('div', { className: 'card', key: 'mcp-' + entry.id }, rowChildren))
1641
1656
  }
1642
- if (rows.length === 0) {
1657
+ if (rows.length === 0 && !view.mcpEditorOpen) {
1643
1658
  rows.push(createElement('div', { className: 'empty', key: 'mcp-empty' },
1644
1659
  createElement('div', null, '🔌 暂无 MCP 服务器配置')
1645
1660
  ))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-admin",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "description": "dsh web UI admin plugin: extension-plugin marketplace tab, MCP server & session-history settings pages, and subagent management (named delegation-tool instances with persona/tool-filter/model config, plus external CLI backend mounting) — all persisted as profile cordis.patch.yml rows that Cordis HMR hot-reloads",
6
6
  "main": "lib/index.js",