@chenkai114/dsh-team-admin 0.1.0 → 0.1.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.
- package/package.json +1 -1
- package/src/client.js +57 -1
- package/src/index.js +1 -1
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
|
-
// dsh-team-admin client
|
|
2
|
+
// dsh-team-admin client 半区:全局面板入口(sidebar.panellist「团队管理」+ main 中央页面),
|
|
3
|
+
// 同时保留插件管理页(plugins.bundle.config)与设置页(settings.plugin.item)的配置卡片。
|
|
3
4
|
// 经典 script:IIFE 书挡、零 import/export、无构建;按宿主模块表约定以包名注册 factory。
|
|
4
5
|
//
|
|
5
6
|
// 渲染只有一份实现:createPanelController 用原生 DOM 建树(测试/e2e 可直接 mount),
|
|
@@ -18,6 +19,10 @@
|
|
|
18
19
|
const DAY_MS = 24 * HOUR_MS
|
|
19
20
|
const COPIED_RESET_MS = 1600
|
|
20
21
|
|
|
22
|
+
const PANEL_ID = 'team-admin'
|
|
23
|
+
const PANEL_LABEL = '团队管理'
|
|
24
|
+
const PANEL_ORDER = 20
|
|
25
|
+
|
|
21
26
|
const CARD_TITLE = '智能体团队管理'
|
|
22
27
|
const CARD_SUMMARY = '选择任意会话,查看团队成员并删除角色。'
|
|
23
28
|
const CARD_DESC = '内置 roster 只增不删;这里的删除 = 停会话 + 会话目录进回收站 + 写入墓碑记录(可随时从回收站恢复)。'
|
|
@@ -99,6 +104,8 @@
|
|
|
99
104
|
.ta-confirm__actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
|
|
100
105
|
.ta-summary{font-size:12px;color:var(--ta-text-sub);line-height:1.5}
|
|
101
106
|
.ta-host{display:block;min-width:0}
|
|
107
|
+
.ta-main{flex:1;min-height:0;overflow:auto;padding:18px;background:var(--dsw-alias-bg-base)}
|
|
108
|
+
.ta-main__inner{max-width:1080px;margin:0 auto;min-width:0}
|
|
102
109
|
@media (max-width:760px){.ta-body{grid-template-columns:1fr}.ta-col--list{padding-right:0;padding-bottom:10px;border-right:0;border-bottom:1px solid var(--ta-border)}.ta-sessions{max-height:220px}}
|
|
103
110
|
@media (prefers-reduced-motion:reduce){.ta-btn{transition:none}}
|
|
104
111
|
`
|
|
@@ -879,6 +886,31 @@
|
|
|
879
886
|
return view === 'summary' ? h('div', { className: 'ta-summary' }, CARD_SUMMARY) : h(TeamAdminPanel, null)
|
|
880
887
|
}
|
|
881
888
|
|
|
889
|
+
// 侧栏入口图标:sidebar.panellist 渲染契约组件,宿主传 { size, active }
|
|
890
|
+
function TeamAdminIcon(props) {
|
|
891
|
+
const size = props !== null && props !== undefined && typeof props.size === 'number' ? props.size : 16
|
|
892
|
+
return h('svg', {
|
|
893
|
+
viewBox: '0 0 16 16',
|
|
894
|
+
width: size,
|
|
895
|
+
height: size,
|
|
896
|
+
fill: 'none',
|
|
897
|
+
stroke: 'currentColor',
|
|
898
|
+
strokeWidth: 1.3,
|
|
899
|
+
strokeLinecap: 'round',
|
|
900
|
+
strokeLinejoin: 'round',
|
|
901
|
+
'aria-hidden': 'true',
|
|
902
|
+
},
|
|
903
|
+
h('circle', { cx: 5.6, cy: 5.4, r: 2.2 }),
|
|
904
|
+
h('path', { d: 'M1.9 13.2c0-2 1.6-3.3 3.7-3.3s3.7 1.3 3.7 3.3' }),
|
|
905
|
+
h('circle', { cx: 11.3, cy: 6.2, r: 1.8 }),
|
|
906
|
+
h('path', { d: 'M9.7 12.4c.3-1.5 1.3-2.3 2.6-2.3 1.4 0 2.4 1 2.6 2.5' }))
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// 中央面板页:整页壳 + 与配置卡同一份 controller(不复制 UI)
|
|
910
|
+
function TeamAdminPage() {
|
|
911
|
+
return h('div', { className: 'ta-main' }, h('div', { className: 'ta-main__inner' }, h(TeamAdminPanel, null)))
|
|
912
|
+
}
|
|
913
|
+
|
|
882
914
|
return {
|
|
883
915
|
inject: ['slots'],
|
|
884
916
|
apply(ctx) {
|
|
@@ -894,6 +926,27 @@
|
|
|
894
926
|
const disposer = fn()
|
|
895
927
|
return typeof disposer === 'function' ? disposer : () => {}
|
|
896
928
|
}
|
|
929
|
+
// 全局面板入口:main keyed 条目出中央页面,sidebar.panellist 条目出侧栏入口行;
|
|
930
|
+
// 两者用同一个 id 配对,点击入口由宿主 layout.selectPanel 切换。先注册 main,
|
|
931
|
+
// 侧栏行一旦可点就有页面可切(selectPanel 对未注册 key 会抛错)。
|
|
932
|
+
effect(() => {
|
|
933
|
+
const disposers = []
|
|
934
|
+
disposers.push(slots.inject('main', () => slots.register({
|
|
935
|
+
name: 'main',
|
|
936
|
+
key: PANEL_ID,
|
|
937
|
+
}, TeamAdminPage)))
|
|
938
|
+
disposers.push(slots.inject('sidebar.panellist', () => slots.register({
|
|
939
|
+
name: 'sidebar.panellist',
|
|
940
|
+
id: PANEL_ID,
|
|
941
|
+
order: PANEL_ORDER,
|
|
942
|
+
label: PANEL_LABEL,
|
|
943
|
+
}, TeamAdminIcon)))
|
|
944
|
+
return () => {
|
|
945
|
+
for (const dispose of disposers) {
|
|
946
|
+
if (typeof dispose === 'function') dispose()
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
}, 'team-admin: main + sidebar.panellist')
|
|
897
950
|
effect(() => slots.inject('plugins.bundle.config', () => slots.register({
|
|
898
951
|
name: 'plugins.bundle.config',
|
|
899
952
|
key: PKG_ID,
|
|
@@ -914,6 +967,9 @@
|
|
|
914
967
|
helpers: {
|
|
915
968
|
PKG_ID: PKG_ID,
|
|
916
969
|
SETTINGS_KEY: SETTINGS_KEY,
|
|
970
|
+
PANEL_ID: PANEL_ID,
|
|
971
|
+
PANEL_LABEL: PANEL_LABEL,
|
|
972
|
+
PANEL_ORDER: PANEL_ORDER,
|
|
917
973
|
API_BASE: API_BASE,
|
|
918
974
|
DEBOUNCE_MS: DEBOUNCE_MS,
|
|
919
975
|
CARD_TITLE: CARD_TITLE,
|
package/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const DATA_DIR_ENV = 'DSH_TEAM_ADMIN_DATA_DIR'
|
|
|
17
17
|
/** 路由前缀:webServer 只支持 exact/prefix 注册。 */
|
|
18
18
|
const ROUTE_PREFIX = '/api/team-admin'
|
|
19
19
|
/** 与 package.json 版本保持一致(发布前由测试校验)。 */
|
|
20
|
-
const PLUGIN_VERSION = '0.1.
|
|
20
|
+
const PLUGIN_VERSION = '0.1.1'
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* 解析插件数据目录。
|