dsh-plugin-admin 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/lib/client.js +27 -35
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -30,14 +30,15 @@ var CSS_TEXT = [
30
30
  '[data-dsh-admin-section] .tab-count { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; background: var(--dsw-alias-interactive-bg-hover, #e5e7eb); color: var(--dsw-alias-label-secondary, #555); }',
31
31
  '[data-dsh-admin-section] .tab.active .tab-count { background: var(--dsw-alias-button-primary-fill, #1677ff); color: var(--dsw-alias-label-primary-foreground, #fff); }',
32
32
  '[data-dsh-admin-section] .toolbar { display: flex; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--dsw-alias-border-subtle, rgba(0,0,0,0.08)); border-radius: 12px; background: var(--dsw-alias-bg-base, #fff); box-shadow: 0 1px 2px rgba(0,0,0,0.02); }',
33
- '[data-dsh-admin-section] .input-wrap { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }',
33
+ '[data-dsh-admin-section] .search-wrap { flex: 1.6; min-width: 0; position: relative; display: flex; align-items: center; }',
34
+ '[data-dsh-admin-section] .search-wrap .input { flex: 1; min-width: 0; padding-left: 30px; }',
35
+ '[data-dsh-admin-section] .install-wrap { flex: 1; min-width: 0; display: flex; align-items: center; }',
36
+ '[data-dsh-admin-section] .install-wrap .input { flex: 1; min-width: 0; }',
37
+ '[data-dsh-admin-section] .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: 0.7; pointer-events: none; z-index: 1; }',
34
38
  '[data-dsh-admin-section] .input { width: 100%; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--dsw-alias-border-subtle, rgba(0,0,0,0.12)); background: var(--dsw-alias-bg-base, #fff); color: inherit; font: inherit; outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }',
35
39
  '[data-dsh-admin-section] .input:hover { border-color: var(--dsw-alias-label-tertiary, rgba(0,0,0,0.28)); }',
36
40
  '[data-dsh-admin-section] .input:focus { border-color: var(--dsw-alias-button-primary-fill, #1677ff); box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14); }',
37
41
  '[data-dsh-admin-section] .filter-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }',
38
- '[data-dsh-admin-section] .search-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--dsw-alias-border-subtle, rgba(0,0,0,0.08)); border-radius: 10px; background: var(--dsw-alias-interactive-bg-hover, rgba(0,0,0,0.02)); flex: none; }',
39
- '[data-dsh-admin-section] .search-icon { font-size: 12px; opacity: 0.7; flex: none; }',
40
- '[data-dsh-admin-section] .search-bar .input { padding: 6px 10px; }',
41
42
  '[data-dsh-admin-section] .pill { font-size: 11px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--dsw-alias-border-subtle, rgba(0,0,0,0.1)); background: transparent; cursor: pointer; color: var(--dsw-alias-label-secondary, #666); transition: all 0.12s; font-family: inherit; }',
42
43
  '[data-dsh-admin-section] .pill:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(0,0,0,0.04)); }',
43
44
  '[data-dsh-admin-section] .pill.active { background: var(--dsw-alias-interactive-bg-hover, rgba(0,0,0,0.06)); color: var(--dsw-alias-button-primary-fill, #1677ff); font-weight: 600; border-color: currentColor; }',
@@ -654,7 +655,7 @@ function PluginsSection(props) {
654
655
  }, [])
655
656
 
656
657
  return createElement('div', { 'data-dsh-admin-section': '' },
657
- renderPluginsView(pView, patchPlugin, reloadPlugins, installPlugin, removePlugin, checkUpdates, upgradePlugin))
658
+ renderPluginsView(pView, patchPlugin, installPlugin, removePlugin, checkUpdates, upgradePlugin))
658
659
  }
659
660
 
660
661
  /**
@@ -998,15 +999,32 @@ function AdminCenterSection(props) {
998
999
  /* Render Plugins View */
999
1000
  /* ========================================================================== */
1000
1001
 
1001
- function renderPluginsView(view, patch, reload, install, remove, checkUpdates, upgrade) {
1002
+ function renderPluginsView(view, patch, install, remove, checkUpdates, upgrade) {
1002
1003
  var elements = []
1003
1004
 
1004
- // Toolbar
1005
+ // Toolbar: search (primary, wide) + install input + actions in one row.
1005
1006
  elements.push(createElement('div', { className: 'toolbar', key: 'toolbar' },
1006
- createElement('div', { className: 'input-wrap', key: 'wrap' },
1007
+ createElement('div', { className: 'search-wrap', key: 'search-wrap' },
1008
+ createElement('span', { className: 'search-icon', key: 'icon' }, '🔍'),
1009
+ createElement('input', {
1010
+ className: 'input',
1011
+ key: 'search-input',
1012
+ placeholder: '搜索插件(名称/版本/路径)...',
1013
+ value: view.needle,
1014
+ onChange: function (e) { patch({ needle: e.target.value }) },
1015
+ }),
1016
+ view.needle !== '' ? createElement('button', {
1017
+ type: 'button',
1018
+ key: 'btn-clear-search',
1019
+ className: 'btn sm',
1020
+ title: '清空搜索',
1021
+ onClick: function () { patch({ needle: '' }) },
1022
+ }, '✕') : null
1023
+ ),
1024
+ createElement('div', { className: 'input-wrap install-wrap', key: 'install-wrap' },
1007
1025
  createElement('input', {
1008
1026
  className: 'input',
1009
- placeholder: '输入 npm 包名或本地绝对路径...',
1027
+ placeholder: '安装包名/路径...',
1010
1028
  value: view.spec,
1011
1029
  disabled: view.busy,
1012
1030
  onChange: function (e) { patch({ spec: e.target.value }) },
@@ -1033,32 +1051,6 @@ function renderPluginsView(view, patch, reload, install, remove, checkUpdates, u
1033
1051
  view.checkingUpdates ? createElement('span', { className: 'spinner', key: 'spin' }) : null,
1034
1052
  view.checkingUpdates ? '检查中...' : '⬆ 检查更新'
1035
1053
  ),
1036
- createElement('button', {
1037
- type: 'button',
1038
- key: 'btn-refresh',
1039
- className: 'btn',
1040
- disabled: view.busy,
1041
- onClick: reload,
1042
- }, '刷新')
1043
- ))
1044
-
1045
- // Search bar: fuzzy filter by plugin name / version / local path.
1046
- elements.push(createElement('div', { className: 'search-bar', key: 'search' },
1047
- createElement('span', { className: 'search-icon', key: 'icon' }, '🔍'),
1048
- createElement('input', {
1049
- className: 'input',
1050
- key: 'search-input',
1051
- placeholder: '按名称/版本/路径模糊搜索插件...',
1052
- value: view.needle,
1053
- onChange: function (e) { patch({ needle: e.target.value }) },
1054
- }),
1055
- view.needle !== '' ? createElement('button', {
1056
- type: 'button',
1057
- key: 'btn-clear-search',
1058
- className: 'btn sm',
1059
- title: '清空搜索',
1060
- onClick: function () { patch({ needle: '' }) },
1061
- }, '✕') : null
1062
1054
  ))
1063
1055
 
1064
1056
  // Filter Pills
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-admin",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "dsh web UI plugin: unified administration panel — plugin and session management with modern tabbed Web UI (host remote + browser panel)",
6
6
  "main": "lib/index.js",