dsh-team-bots 0.2.395 → 0.2.460
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 +4 -1
- package/scripts/doctor.mjs +14 -3
- package/src/api.js +30 -3
- package/src/config.js +108 -0
- package/src/db-migrations.js +24 -0
- package/src/db.js +5 -0
- package/src/feishu/channel.js +702 -0
- package/src/feishu/commands.js +20 -0
- package/src/feishu/format.js +56 -0
- package/src/feishu/index.js +19 -0
- package/src/feishu/store.js +205 -0
- package/src/http.js +11 -5
- package/src/service.js +7 -0
- package/src/services/bots.js +42 -0
- package/src/services/chat.js +19 -10
- package/src/services/core.js +153 -8
- package/src/services/external-trigger-schema.js +61 -0
- package/src/services/feishu.js +181 -0
- package/src/services/github-source.js +157 -0
- package/src/services/memory.js +122 -34
- package/src/services/projects.js +2 -0
- package/src/services/reason-codes.js +63 -0
- package/src/services/review-watchdog.js +30 -8
- package/src/services/run-finish.js +33 -9
- package/src/services/runs.js +48 -7
- package/src/services/runtime/context-window.js +53 -0
- package/src/services/runtime/prompt.js +165 -139
- package/src/services/runtime/sandbox-policy.js +65 -0
- package/src/services/runtime/session-continuity.js +38 -0
- package/src/services/runtime/session.js +148 -4
- package/src/services/scheduler.js +9 -2
- package/src/services/system.js +51 -3
- package/src/services/task-dispatch.js +43 -4
- package/src/services/task-notify.js +13 -8
- package/src/services/tasks.js +12 -4
- package/src/services/wechat-trigger-schema.js +62 -0
- package/src/services/wechat.js +129 -19
- package/src/services/write-scopes.js +38 -0
- package/src/tools.js +13 -3
- package/src/wechat/channel.js +130 -26
- package/src/wechat/commands.js +13 -1
- package/src/wechat/store.js +69 -18
- package/ui/app.js +8 -3
- package/ui/i18n/en/chat.js +1 -0
- package/ui/i18n/en/nav.js +5 -0
- package/ui/i18n/en/settings.js +25 -5
- package/ui/i18n/en/tasks.js +12 -0
- package/ui/i18n/en/wechat.js +25 -3
- package/ui/i18n/zh/chat.js +1 -0
- package/ui/i18n/zh/nav.js +5 -0
- package/ui/i18n/zh/settings.js +25 -5
- package/ui/i18n/zh/tasks.js +12 -0
- package/ui/i18n/zh/wechat.js +25 -3
- package/ui/modules/api.js +23 -1
- package/ui/modules/cards.js +15 -0
- package/ui/modules/chat.js +43 -2
- package/ui/modules/dom-morph.js +14 -7
- package/ui/modules/events-board.js +73 -23
- package/ui/modules/events-click.js +16 -0
- package/ui/modules/file-preview.js +89 -0
- package/ui/modules/global-pages.js +138 -10
- package/ui/modules/modal-forms.js +8 -9
- package/ui/modules/modal-layer.js +2 -0
- package/ui/modules/settings.js +51 -9
- package/ui/modules/state.js +2 -0
- package/ui/modules/tasks.js +20 -0
- package/ui/modules/util.js +39 -0
- package/ui/styles/base.css +13 -13
- package/ui/styles/chat-cards.css +28 -0
- package/ui/styles/frame.css +27 -3
- package/ui/styles/global-config.css +28 -3
- package/ui/styles/surfaces.css +2 -0
package/ui/modules/chat.js
CHANGED
|
@@ -120,6 +120,47 @@ async function loadOlderMessages() {
|
|
|
120
120
|
}
|
|
121
121
|
// chat-pagination:end
|
|
122
122
|
|
|
123
|
+
// ===== auto-collapse:start =====
|
|
124
|
+
// 连续系统通知折叠(B8/DSHBOTS-336):≥ COLLAPSE_MIN 条连续 sender_type='system' 消息
|
|
125
|
+
// 折叠为一行(Quiet by default,与 A1 通信纪律同向——发了的也能被折叠;「N 条系统通知 +
|
|
126
|
+
// 末条摘要」不丢入口)。展开态按组键(首条消息 id,跨轮询稳定)存 state.expandedCollapses,
|
|
127
|
+
// 2.8s 轮询不会重开已展开的组;bot/user 消息不折叠(内容消息无折叠价值)。
|
|
128
|
+
// 深链兼容:折叠行只是渲染层,消息 id 引用(m_ 引用/team_recall)不受影响。
|
|
129
|
+
const COLLAPSE_MIN = 3
|
|
130
|
+
|
|
131
|
+
function collapseAutoMessages(messages) {
|
|
132
|
+
const out = []
|
|
133
|
+
let group = null
|
|
134
|
+
const flush = () => {
|
|
135
|
+
if (!group) return
|
|
136
|
+
if (group.items.length >= COLLAPSE_MIN && !state.expandedCollapses.has(group.key)) {
|
|
137
|
+
out.push({ collapsed: true, key: group.key, count: group.items.length, last: group.items[group.items.length - 1] })
|
|
138
|
+
} else {
|
|
139
|
+
for (const item of group.items) out.push(item)
|
|
140
|
+
}
|
|
141
|
+
group = null
|
|
142
|
+
}
|
|
143
|
+
for (const message of messages) {
|
|
144
|
+
if (message?.sender_type === 'system') {
|
|
145
|
+
if (!group) group = { key: `collapse:${message.id}`, items: [] }
|
|
146
|
+
group.items.push(message)
|
|
147
|
+
continue
|
|
148
|
+
}
|
|
149
|
+
flush()
|
|
150
|
+
out.push(message)
|
|
151
|
+
}
|
|
152
|
+
flush()
|
|
153
|
+
return out
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function collapseRowView(group) {
|
|
157
|
+
return `<button class="msg-collapse-row" data-action="toggle-collapse" data-group="${attr(group.key)}" aria-expanded="false">
|
|
158
|
+
${icon('chevron')}<span>${t('chat.collapseLabel', { count: group.count })}</span>
|
|
159
|
+
<span class="msg-collapse-last">${esc(mdPlainSummary(group.last?.body ?? '', 80))}</span>
|
|
160
|
+
</button>`
|
|
161
|
+
}
|
|
162
|
+
// ===== auto-collapse:end =====
|
|
163
|
+
|
|
123
164
|
// 群聊右栏「项目成员」概览卡(只读):DSHBOTS-49 恢复 D-5 信息架构收敛时删掉的面板,
|
|
124
165
|
// DSHBOTS-55 按 232f1c8 的双行方案修正——①位置在「项目总监」卡正下方(活跃任务之前);
|
|
125
166
|
// ②成员行剔除总监(总监独占上方自己的 panel),计数同口径;
|
|
@@ -191,7 +232,7 @@ function renderChat() {
|
|
|
191
232
|
<div class="empty-symbol">${icon('message')}</div>
|
|
192
233
|
<h3>${t('chat.emptyTitle')}</h3>
|
|
193
234
|
<p>${t('chat.emptyBody')}</p>
|
|
194
|
-
</div>` : messages.map(renderMessage).join('')}
|
|
235
|
+
</div>` : collapseAutoMessages(messages).map(item => item.collapsed ? collapseRowView(item) : renderMessage(item)).join('')}
|
|
195
236
|
${typingRows(state.data.runs, 'chat')}
|
|
196
237
|
${typingLingerRowsHtml('chat', state.data.runs)}
|
|
197
238
|
</div>
|
|
@@ -450,7 +491,7 @@ function renderSoloConfig() {
|
|
|
450
491
|
<div class="divider"></div>
|
|
451
492
|
<div class="eyebrow" style="margin-bottom:9px">${t("版本历史")}</div>
|
|
452
493
|
${revisions.length === 0 ? '<div class="faint">' + (state.soloDetail ? t("暂无版本") : t("加载中…")) + '</div>' : revisions.map(revision => `<div class="revision-row"><span class="mono">v${revision.version}</span><span class="faint">${esc(timeAgo(revision.created_at))}</span>${revision.version === bot.current_revision ? '' : `<button class="btn small" data-action="rollback-bot" data-bot-id="${attr(bot.id)}" data-revision-id="${attr(revision.id)}">${t("回滚")}</button>`}</div>`).join('')}
|
|
453
|
-
<div class="usage-note">${t("模型或强度变更会在下一次运行时生效,不会中断当前运行。")}</div>
|
|
494
|
+
<div class="usage-note">${t("模型或强度变更会在下一次运行时生效,不会中断当前运行。")}${t("仅保留最近 10 个版本,更早版本已归档至文件。")}</div>
|
|
454
495
|
</aside>
|
|
455
496
|
</div>`
|
|
456
497
|
}
|
package/ui/modules/dom-morph.js
CHANGED
|
@@ -49,19 +49,26 @@ function morphDescriptor(el) {
|
|
|
49
49
|
// entries 按 fresh 顺序给出落位方案(live=null 即需要插入新节点);removals 是没人认领的 live 节点。
|
|
50
50
|
function planChildren(liveItems, freshItems) {
|
|
51
51
|
const free = liveItems.map(item => ({ ...item, taken: false }))
|
|
52
|
+
// 同键可能落在多个节点上(记忆卡的 approve/reject/edit/delete 四个按钮共用
|
|
53
|
+
// data-memory-id):按键分桶、配对时逐个认领,而不是只认第一个把其余当陌生人。
|
|
52
54
|
const byKey = new Map()
|
|
53
55
|
for (const item of free) {
|
|
54
|
-
if (!item.key
|
|
55
|
-
byKey.
|
|
56
|
+
if (!item.key) continue
|
|
57
|
+
const bucket = byKey.get(item.key)
|
|
58
|
+
if (bucket) bucket.push(item)
|
|
59
|
+
else byKey.set(item.key, [item])
|
|
56
60
|
}
|
|
57
61
|
const entries = freshItems.map(fresh => ({ live: null, fresh }))
|
|
58
|
-
//
|
|
62
|
+
// 第一轮:身份键配对,同键按出现顺序一对一认领(标签不一致即不是同一身份,交给插入 + 删除)
|
|
59
63
|
for (const entry of entries) {
|
|
60
64
|
if (!entry.fresh.key) continue
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
const bucket = byKey.get(entry.fresh.key)
|
|
66
|
+
if (!bucket) continue
|
|
67
|
+
const index = bucket.findIndex(item => !item.taken && item.tag === entry.fresh.tag)
|
|
68
|
+
if (index >= 0) {
|
|
69
|
+
bucket[index].taken = true
|
|
70
|
+
entry.live = bucket[index]
|
|
71
|
+
bucket.splice(index, 1)
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
// 第二轮:无键节点按同位置配对(模板结构没变即整树原位复用)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { state } from './state.js'
|
|
2
2
|
import { t } from './i18n.js'
|
|
3
3
|
import { activeProject, applyUiScale, applyUiTheme, toast } from './util.js'
|
|
4
|
-
import { api, loadState } from './api.js'
|
|
4
|
+
import { api, loadState, mergeSettingsDraft } from './api.js'
|
|
5
5
|
import { sendMessage } from './composer.js'
|
|
6
6
|
import { closeModal, openBot, openModal, openTask, openTrajectory } from './modal-forms.js'
|
|
7
7
|
import { loadOlderMessages, loadSoloDetail } from './chat.js'
|
|
@@ -10,6 +10,39 @@ import { toggleDesktopNotify } from './cards.js'
|
|
|
10
10
|
import { usageMode } from './usage.js'
|
|
11
11
|
import { UI_SCALE_KEY, UI_THEME_KEY, syncLanguage, refresh, startWechatPoll, stopWechatPoll, bootError, render, chatContextPending, beginChatPending, endChatPending, init } from '../app.js'
|
|
12
12
|
|
|
13
|
+
// 设置保存 + 409 冲突三方合并(B2/DSHBOTS-325):key→inputId 映射驱动 patch 采集。
|
|
14
|
+
// 冲突时静默接管 api 错误:重取最新设置后,对方未动字段的用户草稿贴回表单(编辑不丢),
|
|
15
|
+
// 双改字段以服务端为准并点名提示复核;无用户改动即纯刷新提示。
|
|
16
|
+
async function saveSettingsWithMerge(inputIds, successToast) {
|
|
17
|
+
const value = id => (document.getElementById(id) )?.value ?? ''
|
|
18
|
+
const patch = {}
|
|
19
|
+
for (const [key, id] of Object.entries(inputIds)) patch[key] = value(id)
|
|
20
|
+
const baseSettings = state.data?.settings ?? {}
|
|
21
|
+
try {
|
|
22
|
+
await api('update_settings', { ...patch, revision: state.data?.settingsRevision }, { quiet: true })
|
|
23
|
+
await loadState(state.projectId)
|
|
24
|
+
toast(successToast, 'success')
|
|
25
|
+
} catch (error ) {
|
|
26
|
+
if (error?.code !== 'CONFLICT') {
|
|
27
|
+
toast(error?.message || String(error), 'error')
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
await loadState(state.projectId)
|
|
31
|
+
const { merged, conflicts } = mergeSettingsDraft(baseSettings, patch, state.data?.settings ?? {})
|
|
32
|
+
for (const [key, value] of Object.entries(merged)) {
|
|
33
|
+
const input = document.getElementById(inputIds[key])
|
|
34
|
+
if (input) input.value = String(value)
|
|
35
|
+
}
|
|
36
|
+
if (conflicts.length) {
|
|
37
|
+
toast(`${t("配置已被他人修改,以下字段双方都改过、以最新保存为准,请复核:")}${conflicts.join('、')}`, 'error')
|
|
38
|
+
} else if (Object.keys(merged).length) {
|
|
39
|
+
toast(t("配置已被他人修改:你的改动未与对方冲突,已合并回表单,请重新保存"), 'error')
|
|
40
|
+
} else {
|
|
41
|
+
toast(t("配置已被他人修改,本次没有待保存的改动"), 'error')
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
13
46
|
export async function handleBoardAction(action, target) {
|
|
14
47
|
switch (action) {
|
|
15
48
|
case 'retry-boot':
|
|
@@ -85,26 +118,28 @@ export async function handleBoardAction(action, target) {
|
|
|
85
118
|
break
|
|
86
119
|
}
|
|
87
120
|
case 'save-settings': {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
toast(t("系统设置已保存"), 'success')
|
|
121
|
+
await saveSettingsWithMerge(
|
|
122
|
+
{
|
|
123
|
+
budget_currency: 'settings-currency',
|
|
124
|
+
memory_review: 'settings-memory-review',
|
|
125
|
+
global_token_budget: 'settings-global-token-budget',
|
|
126
|
+
global_cost_budget: 'settings-global-cost-budget',
|
|
127
|
+
retention_usage_days: 'settings-retention-usage',
|
|
128
|
+
retention_run_event_days: 'settings-retention-run',
|
|
129
|
+
retention_message_days: 'settings-retention-message',
|
|
130
|
+
},
|
|
131
|
+
t("系统设置已保存"),
|
|
132
|
+
)
|
|
101
133
|
break
|
|
102
134
|
}
|
|
103
135
|
// 界面语言(DSHBOTS-162):保存后 loadState 拿回新的 state.language,
|
|
104
136
|
// 由既有 syncLanguage 热切换(换字典 + toast.languageSwitched + render),无需重启。
|
|
105
137
|
case 'save-ui-language': {
|
|
106
138
|
const value = (document.getElementById('settings-ui-language') )?.value ?? 'auto'
|
|
107
|
-
|
|
139
|
+
// revision 仅在有值时携带(无 state 数据的旧环境回退无令牌形态)。
|
|
140
|
+
const languagePatch = { ui_language: value }
|
|
141
|
+
if (Number.isFinite(Number(state.data?.settingsRevision))) languagePatch.revision = state.data?.settingsRevision
|
|
142
|
+
await api('update_settings', languagePatch)
|
|
108
143
|
await loadState(state.projectId)
|
|
109
144
|
// poll() 只取数不切语言(ui/app.js:620-642),热切换必须由保存动作自己触发(DSHBOTS-162 R1)。
|
|
110
145
|
syncLanguage()
|
|
@@ -112,15 +147,30 @@ export async function handleBoardAction(action, target) {
|
|
|
112
147
|
break
|
|
113
148
|
}
|
|
114
149
|
case 'save-run-limits': {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
150
|
+
await saveSettingsWithMerge(
|
|
151
|
+
{
|
|
152
|
+
run_timeout_minutes: 'settings-run-timeout',
|
|
153
|
+
stall_watchdog_minutes: 'settings-stall-watchdog',
|
|
154
|
+
review_idle_minutes: 'settings-review-idle',
|
|
155
|
+
review_auto_close: 'settings-review-auto-close',
|
|
156
|
+
},
|
|
157
|
+
t("运行时效已保存"),
|
|
158
|
+
)
|
|
159
|
+
break
|
|
160
|
+
}
|
|
161
|
+
// 团队指令段(B1/DSHBOTS-324):保存/恢复默认;预算校验在后端,失败经 api 报错 toast。
|
|
162
|
+
case 'save-prompt-segment': {
|
|
163
|
+
const segment = target.dataset.segment
|
|
164
|
+
const text = (document.getElementById(`prompt-seg-${segment}`) )?.value ?? ''
|
|
165
|
+
await api('update_prompt_segment', { segment, text })
|
|
166
|
+
await loadState(state.projectId)
|
|
167
|
+
toast(t("团队指令已保存,新会话生效"), 'success')
|
|
168
|
+
break
|
|
169
|
+
}
|
|
170
|
+
case 'reset-prompt-segment': {
|
|
171
|
+
await api('update_prompt_segment', { segment: target.dataset.segment, text: '' })
|
|
122
172
|
await loadState(state.projectId)
|
|
123
|
-
toast(t("
|
|
173
|
+
toast(t("已恢复默认指令"), 'success')
|
|
124
174
|
break
|
|
125
175
|
}
|
|
126
176
|
case 'reconcile-usage': {
|
|
@@ -9,6 +9,7 @@ import { exportUsageCsv, switchUsageWindow, usageMode } from './usage.js'
|
|
|
9
9
|
import { focusApprovalCard, focusQuestionCard, questionDraftSelection, questionSelectOption } from './cards.js'
|
|
10
10
|
import { loadSoloDetail } from './chat.js'
|
|
11
11
|
import { searchMemories } from './tasks.js'
|
|
12
|
+
import { openFilePreview } from './file-preview.js'
|
|
12
13
|
import { handleBoardAction } from './events-board.js'
|
|
13
14
|
import { refresh, renderKeepingChatScroll, render, beginChatPending, endChatPending } from '../app.js'
|
|
14
15
|
|
|
@@ -85,6 +86,17 @@ document.addEventListener('click', async (event) => {
|
|
|
85
86
|
state.approvalPanelOpen = !state.approvalPanelOpen
|
|
86
87
|
render()
|
|
87
88
|
break
|
|
89
|
+
case 'toggle-collapse':
|
|
90
|
+
// 连续系统通知折叠行(B8/DSHBOTS-336):展开态按组键进 state.expandedCollapses(跨轮询持久)。
|
|
91
|
+
{
|
|
92
|
+
const key = target.dataset.group
|
|
93
|
+
if (key) {
|
|
94
|
+
if (state.expandedCollapses.has(key)) state.expandedCollapses.delete(key)
|
|
95
|
+
else state.expandedCollapses.add(key)
|
|
96
|
+
render()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
break
|
|
88
100
|
case 'focus-approval': {
|
|
89
101
|
// 点明细跳到对应项目群聊并滚动到该审批卡(复用 focusApprovalCard)。
|
|
90
102
|
const item = (state.data?.pendingApprovals?.items ?? []).find(entry => entry.id === target.dataset.approvalId)
|
|
@@ -496,6 +508,10 @@ document.addEventListener('click', async (event) => {
|
|
|
496
508
|
window.open(target.dataset.url, '_blank', 'noopener')
|
|
497
509
|
break
|
|
498
510
|
}
|
|
511
|
+
case 'preview-file': {
|
|
512
|
+
await openFilePreview(target.dataset.url, target.dataset.path)
|
|
513
|
+
break
|
|
514
|
+
}
|
|
499
515
|
case 'delete-secret': {
|
|
500
516
|
const name = target.dataset.secretName || t("该密钥")
|
|
501
517
|
// DSHBOTS-106 起明文只在批准时一次性物化到数据目录,项目工作区不再有明文密钥文件;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { state } from './state.js'
|
|
2
|
+
import { attr, esc } from './util.js'
|
|
3
|
+
import { t } from './i18n.js'
|
|
4
|
+
import { modalShell, renderModalLayer } from './modal-layer.js'
|
|
5
|
+
|
|
6
|
+
// file-preview-logic:start —— 文本预览纯逻辑(tests/file-preview.test.js 抽取此块断言)。
|
|
7
|
+
// 白名单与后端 chatFile 的文本扩展同口径;SVG 可执行脚本、.env 常带密钥,永不入列。
|
|
8
|
+
const FILE_TEXT_EXT = /\.(md|markdown|txt|log|json|csv|ini|toml|yaml|yml|ts|tsx|js|mjs|cjs|jsx|css|html|htm|sh|xml|py|sql)$/i
|
|
9
|
+
const PREVIEW_MAX_CHARS = 256 * 1024
|
|
10
|
+
const PREVIEW_MAX_LINES = 2000
|
|
11
|
+
function isPreviewableText(path) {
|
|
12
|
+
return FILE_TEXT_EXT.test(String(path ?? ''))
|
|
13
|
+
}
|
|
14
|
+
// 超限截断:256KB 与 2000 行先到先裁;弹层只提示,不改写内容本身。
|
|
15
|
+
function clipPreviewText(text) {
|
|
16
|
+
const source = String(text ?? '')
|
|
17
|
+
let body = source.length > PREVIEW_MAX_CHARS ? source.slice(0, PREVIEW_MAX_CHARS) : source
|
|
18
|
+
const lines = body.split('\n')
|
|
19
|
+
if (lines.length > PREVIEW_MAX_LINES) body = lines.slice(0, PREVIEW_MAX_LINES).join('\n')
|
|
20
|
+
return { body, truncated: body.length < source.length }
|
|
21
|
+
}
|
|
22
|
+
// 交付产物 chip → /api/dsh-team/file(拼法与 markdown.ts mdImageFileUrl 同口径);
|
|
23
|
+
// 绝对路径或含 .. 段不生成链接,越界交给服务端防穿越兜底。
|
|
24
|
+
function deliverableFileUrl(projectId, path) {
|
|
25
|
+
const rel = String(path ?? '')
|
|
26
|
+
if (!projectId || !rel || rel.startsWith('/') || rel.split('/').includes('..')) return null
|
|
27
|
+
const params = new URLSearchParams()
|
|
28
|
+
params.set('projectId', String(projectId))
|
|
29
|
+
params.set('path', rel)
|
|
30
|
+
return `/api/dsh-team/file?${params.toString()}`
|
|
31
|
+
}
|
|
32
|
+
// file-preview-logic:end
|
|
33
|
+
|
|
34
|
+
// 交付产物文件链接基建:图片走原 artifact-file 内联缩略,文本扩展改应用内预览。
|
|
35
|
+
const ARTIFACT_IMAGE = /\.(png|jpe?g|gif|webp)$/i
|
|
36
|
+
const artifactFileUrl = (runId, path) =>
|
|
37
|
+
`/api/dsh-team/artifact-file?runId=${encodeURIComponent(runId)}&path=${encodeURIComponent(path)}`
|
|
38
|
+
const artifactExt = (path) =>
|
|
39
|
+
(String(path).match(/\.([a-z0-9]+)$/i)?.[1] ?? 'file').toUpperCase().slice(0, 6)
|
|
40
|
+
|
|
41
|
+
// 文本预览弹层:正文绝不进 HTML 模板,hydrateFilePreview 只走 textContent 通道;
|
|
42
|
+
// footer 保留「新窗口打开」(复用 open-artifact 的开窗行为)。
|
|
43
|
+
function modalFilePreview(modal) {
|
|
44
|
+
const path = String(modal?.path ?? '')
|
|
45
|
+
if (modal?.error) {
|
|
46
|
+
return modalShell({
|
|
47
|
+
title: path || t("文件预览"),
|
|
48
|
+
body: `<div class="note">${t("加载文件失败:")}${esc(modal.error)}</div>`,
|
|
49
|
+
footer: `<button class="btn" data-action="close-modal">${t("关闭")}</button>`,
|
|
50
|
+
size: 'wide',
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
return modalShell({
|
|
54
|
+
title: path || t("文件预览"),
|
|
55
|
+
subtitle: modal?.truncated ? t("文件较大,已截断,仅显示开头部分。") : '',
|
|
56
|
+
body: `<pre class="detail-pre" id="dsh-file-preview-pre"></pre>`,
|
|
57
|
+
footer: `<button class="btn" data-action="close-modal">${t("关闭")}</button><button class="btn" data-action="open-artifact" data-url="${attr(modal?.url ?? '')}">${t("新窗口打开")}</button>`,
|
|
58
|
+
size: 'wide',
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 正文水合:把已取回的文本写进占位 pre。滚动守卫可能把补拍延后约 120ms,
|
|
63
|
+
// 首拍未命中节点时短重试,避免补拍后弹层空白。
|
|
64
|
+
function hydrateFilePreview(retry = 3) {
|
|
65
|
+
const pre = document.getElementById('dsh-file-preview-pre')
|
|
66
|
+
if (!pre) {
|
|
67
|
+
if (retry > 0) setTimeout(() => hydrateFilePreview(retry - 1), 150)
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
if (state.modal?.type === 'file-preview') pre.textContent = state.modal.content ?? ''
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function openFilePreview(url, path) {
|
|
74
|
+
if (!url) return
|
|
75
|
+
state.modal = { type: 'file-preview', loading: true, title: String(path ?? '').split('/').pop() || t("文件预览"), url, path }
|
|
76
|
+
renderModalLayer()
|
|
77
|
+
try {
|
|
78
|
+
const res = await fetch(url)
|
|
79
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
80
|
+
const { body, truncated } = clipPreviewText(await res.text())
|
|
81
|
+
state.modal = { type: 'file-preview', url, path, content: body, truncated }
|
|
82
|
+
} catch (error ) {
|
|
83
|
+
state.modal = { type: 'file-preview', url, path, error: String(error?.message ?? error) }
|
|
84
|
+
}
|
|
85
|
+
renderModalLayer()
|
|
86
|
+
hydrateFilePreview()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { FILE_TEXT_EXT, isPreviewableText, clipPreviewText, deliverableFileUrl, ARTIFACT_IMAGE, artifactFileUrl, artifactExt, modalFilePreview, hydrateFilePreview, openFilePreview }
|
|
@@ -1,26 +1,39 @@
|
|
|
1
1
|
import { state } from './state.js'
|
|
2
2
|
import { icon } from './icons.js'
|
|
3
3
|
import { t } from './i18n.js'
|
|
4
|
-
import { attr, esc, formatTime } from './util.js'
|
|
4
|
+
import { attr, esc, formatTime, toast } from './util.js'
|
|
5
5
|
import { pageHead, pageNav, pageSection, pageShell, refreshAction, slot } from './page-shell.js'
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// 微信通道卡(自配置页迁入):绑定状态、扫码授权、验证码与退出;
|
|
8
|
+
// DSHBOTS-334 加启停开关——停用态渲染开关卡(不再靠服务端注入才能启用)。
|
|
8
9
|
function wechatCard() {
|
|
9
10
|
const wechat = state.data.wechat ?? { enabled: false, phase: 'disabled' }
|
|
10
|
-
if (!wechat.enabled) return ''
|
|
11
11
|
const phaseText = {
|
|
12
12
|
disabled: t("未启用"), unbound: t("未绑定"), connecting: t("连接中"), connected: t("已连接"),
|
|
13
13
|
reconnecting: t("重连中"), needs_reauth: t("凭证失效"), scanning: t("待扫码"),
|
|
14
14
|
verification: t("待输验证码"),
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
// 停用态:只渲染开关卡(无绑定交互),恢复入口常驻。
|
|
17
|
+
if (!wechat.enabled) {
|
|
18
|
+
return `
|
|
19
|
+
<div class="card form-card g-card wechat-card" id="wechat-card">
|
|
20
|
+
<div class="wechat-status">
|
|
21
|
+
<span class="pill">${phaseText.disabled}</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="hint">${t("通道已停用,启用后可扫码绑定管理员微信接收推送。")}</div>
|
|
24
|
+
<div class="btn-row" style="margin-top:12px">
|
|
25
|
+
<button class="btn small" type="button" data-action="wechat-toggle" data-next="1">${t("启用通道")}</button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>`
|
|
28
|
+
}
|
|
17
29
|
const pillClass = wechat.phase === 'connected' ? 'green' : ['needs_reauth'].includes(wechat.phase) ? 'amber' : ''
|
|
30
|
+
const auth = state.wechatAuth
|
|
18
31
|
return `
|
|
19
32
|
<div class="card form-card g-card wechat-card" id="wechat-card">
|
|
20
33
|
<div class="wechat-card-main">
|
|
21
34
|
<div class="wechat-status">
|
|
22
35
|
<span class="pill ${pillClass}">${phaseText[wechat.phase] ?? wechat.phase}</span>
|
|
23
|
-
${wechat.adminPeerId ? `<span class="wechat-admin">${t("管理员")} <strong>${esc(String(wechat.adminPeerId)
|
|
36
|
+
${wechat.adminPeerId ? `<span class="wechat-admin" title="${attr(wechat.adminPeerId)}">${t("管理员")} <strong>${esc(String(wechat.adminPeerId))}</strong></span>` : ''}
|
|
24
37
|
</div>
|
|
25
38
|
${wechat.error ? `<div class="hint" style="color:var(--coral,#e5484d)">${esc(wechat.error)}</div>` : ''}
|
|
26
39
|
${wechat.phase === 'verification' || auth?.verification ? `
|
|
@@ -32,13 +45,65 @@ function wechatCard() {
|
|
|
32
45
|
${['connected', 'reconnecting', 'connecting'].includes(wechat.phase)
|
|
33
46
|
? `<button class="btn small danger" type="button" data-action="wechat-logout">${t("退出绑定")}</button>`
|
|
34
47
|
: `<button class="btn small" type="button" data-action="wechat-login">${t("扫码绑定")}</button>`}
|
|
48
|
+
<button class="btn small danger" type="button" data-action="wechat-toggle" data-next="0">${t("停用通道")}</button>
|
|
35
49
|
</div>
|
|
36
|
-
<div class="hint">${t("微信扫码授权 ClawBot;确认后自动绑定授权者为管理员,任务完成主动推送。")}</div>
|
|
37
50
|
</div>
|
|
38
51
|
${auth?.qrSvg ? `<div class="wechat-qr">${auth.qrSvg}</div>` : ''}
|
|
39
52
|
</div>`
|
|
40
53
|
}
|
|
41
54
|
|
|
55
|
+
// 飞书通道卡(DSHBOTS-334 改可交互):未绑定态给 AppID/AppSecret 输入 + 保存即连;
|
|
56
|
+
// 已配置态显示脱敏 AppID(前 8 位+…)与清除按钮(服务端注入来源无清除)。
|
|
57
|
+
// 飞书无扫码流程:绑定只认应用凭据,生效优先级 = 通道页保存 > 服务端注入。
|
|
58
|
+
const maskAppId = (value) => {
|
|
59
|
+
const raw = String(value ?? '')
|
|
60
|
+
return raw.length > 8 ? `${raw.slice(0, 8)}…` : raw
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function feishuCard() {
|
|
64
|
+
const feishu = state.data?.feishu ?? { enabled: false, phase: 'disabled' }
|
|
65
|
+
if (!feishu.enabled) return ''
|
|
66
|
+
// 相位口径与 src/feishu/channel.ts 一致:ready=已连接、unbound=未绑定、conflict=连接冲突。
|
|
67
|
+
// 'connected' 是同义别名(对齐 cindy 口径),两者都渲染「已连接」。
|
|
68
|
+
const phaseText = {
|
|
69
|
+
disabled: t("未启用"), unbound: t("未绑定"), ready: t("已连接"), connected: t("已连接"),
|
|
70
|
+
reconnecting: t("重连中"), conflict: t("连接冲突"),
|
|
71
|
+
}
|
|
72
|
+
const pillClass = ['ready', 'connected'].includes(feishu.phase) ? 'green' : feishu.phase === 'conflict' ? 'amber' : ''
|
|
73
|
+
const creds = feishu.credentials ?? { source: 'none', appIdMasked: null }
|
|
74
|
+
return `
|
|
75
|
+
<div class="card form-card g-card feishu-card" id="feishu-card">
|
|
76
|
+
<div class="feishu-status">
|
|
77
|
+
<span class="pill ${pillClass}">${phaseText[feishu.phase] ?? feishu.phase}</span>
|
|
78
|
+
${feishu.adminOuId ? `<span class="feishu-admin" title="${attr(feishu.adminOuId)}">${t("管理员")} <strong>${esc(String(feishu.adminOuId))}</strong></span>` : ''}
|
|
79
|
+
</div>
|
|
80
|
+
${feishu.phase === 'conflict' ? `<div class="hint feishu-conflict">${t("检测到连接冲突:同一 App ID 在多处登录(exceed_conn_limit),请先退出其他实例。")}</div>` : ''}
|
|
81
|
+
${feishu.error ? `<div class="hint feishu-error">${esc(feishu.error)}</div>` : ''}
|
|
82
|
+
${feishu.phase === 'unbound' ? `
|
|
83
|
+
<form data-form="feishu-credentials">
|
|
84
|
+
<div class="field-row">
|
|
85
|
+
<div class="field"><label for="feishu-app-id">${t("App ID")}</label><input class="input mono" id="feishu-app-id" name="appId" autocomplete="off" placeholder="${t("飞书应用的 App ID")}"></div>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="field-row">
|
|
88
|
+
<div class="field"><label for="feishu-app-secret">${t("App Secret")}</label><input class="input mono" id="feishu-app-secret" name="appSecret" type="password" autocomplete="new-password" placeholder="${t("保存后不再回显")}"></div>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="btn-row"><button class="btn small" type="submit">${t("保存并连接")}</button></div>
|
|
91
|
+
</form>` : ''}
|
|
92
|
+
${feishu.phase !== 'unbound' && creds.source !== 'none' ? `
|
|
93
|
+
<div class="feishu-status feishu-cred">
|
|
94
|
+
<span class="pill">${t("凭据已配置")}</span>
|
|
95
|
+
<span class="mono">${esc(String(creds.appIdMasked ?? ''))}</span>
|
|
96
|
+
${creds.source === 'saved'
|
|
97
|
+
? `<button class="btn small danger" type="button" data-action="feishu-clear-credentials">${t("清除凭据")}</button>`
|
|
98
|
+
: `<span class="faint">${t("服务端注入")}</span>`}
|
|
99
|
+
</div>` : ''}
|
|
100
|
+
<div class="feishu-meta">
|
|
101
|
+
${feishu.botId ? `<span>${t("机器人 ID")} <span class="mono">${esc(String(feishu.botId))}</span></span>` : ''}
|
|
102
|
+
${feishu.appId ? `<span>${t("App ID")} <span class="mono">${esc(maskAppId(feishu.appId))}</span></span>` : ''}
|
|
103
|
+
</div>
|
|
104
|
+
</div>`
|
|
105
|
+
}
|
|
106
|
+
|
|
42
107
|
// 密钥待审请求卡:Bot 发起的密钥请求,批准时填写密钥值。
|
|
43
108
|
function secretRequestsCard(requests) {
|
|
44
109
|
if (requests.length === 0) return `<div class="faint">${t("暂无待审请求。")}</div>`
|
|
@@ -113,13 +178,22 @@ function secretAddCard(projects) {
|
|
|
113
178
|
// 通道页:微信等外部消息通道的绑定与状态。
|
|
114
179
|
export function renderChannel() {
|
|
115
180
|
const card = wechatCard()
|
|
181
|
+
const feishu = feishuCard()
|
|
116
182
|
return pageShell(
|
|
117
183
|
pageHead('CHANNELS', t('viewTitle.channel'), t('channel.desc'), refreshAction()),
|
|
118
184
|
'',
|
|
119
|
-
[
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
185
|
+
[
|
|
186
|
+
pageSection({
|
|
187
|
+
index: '01', id: 'c-wechat', title: t('channel.sectionWechat'), desc: t('channel.sectionWechatDesc'),
|
|
188
|
+
// 停用态也渲染开关卡(DSHBOTS-334):启停入口常驻,不再依赖服务端注入。
|
|
189
|
+
body: slot('full', card),
|
|
190
|
+
}),
|
|
191
|
+
// 飞书未启用时整段不渲染(不显示死卡);启用后凭据可在卡内配置(DSHBOTS-334)。
|
|
192
|
+
...(feishu ? [pageSection({
|
|
193
|
+
index: '02', id: 'c-feishu', title: t('channel.sectionFeishu'), desc: t('channel.sectionFeishuDesc'),
|
|
194
|
+
body: slot('full', feishu),
|
|
195
|
+
})] : []),
|
|
196
|
+
],
|
|
123
197
|
)
|
|
124
198
|
}
|
|
125
199
|
|
|
@@ -153,3 +227,57 @@ export function renderSecretsPage() {
|
|
|
153
227
|
],
|
|
154
228
|
)
|
|
155
229
|
}
|
|
230
|
+
|
|
231
|
+
// 飞书凭据交互(DSHBOTS-334):卡模块内自注册监听(同 events-board 委托先例,不经
|
|
232
|
+
// events-submit/events-click 的通用 switch)。app/api 走动态 import 的命名空间调用——
|
|
233
|
+
// 本模块被单测直接加载时不必拉起整个应用模块图(app.js 含启动副作用)。
|
|
234
|
+
document.addEventListener('submit', async (event) => {
|
|
235
|
+
const form = (event.target ).closest?.('form[data-form="feishu-credentials"]')
|
|
236
|
+
if (!form) return
|
|
237
|
+
event.preventDefault()
|
|
238
|
+
const appId = String(form.querySelector?.('[name="appId"]')?.value ?? '').trim()
|
|
239
|
+
const appSecret = String(form.querySelector?.('[name="appSecret"]')?.value ?? '').trim()
|
|
240
|
+
try {
|
|
241
|
+
if (!appId || !appSecret) throw new Error(t("请输入 App ID 与 App Secret"))
|
|
242
|
+
const apiMod = await import('./api.js')
|
|
243
|
+
await apiMod.api('save_feishu_credentials', { appId, appSecret }, { quiet: true })
|
|
244
|
+
const appMod = await import('../app.js')
|
|
245
|
+
await appMod.refresh({ quiet: true })
|
|
246
|
+
toast(t("飞书凭据已保存,正在重连"), 'success')
|
|
247
|
+
} catch (error) {
|
|
248
|
+
toast((error )?.message || String(error), 'error')
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
document.addEventListener('click', async (event) => {
|
|
253
|
+
const target = (event.target ).closest?.('[data-action="feishu-clear-credentials"]')
|
|
254
|
+
if (!target) return
|
|
255
|
+
if (!globalThis.confirm?.(t("清除后飞书通道将断开并回到未绑定。确认清除?"))) return
|
|
256
|
+
try {
|
|
257
|
+
const apiMod = await import('./api.js')
|
|
258
|
+
await apiMod.api('clear_feishu_credentials', {}, { quiet: true })
|
|
259
|
+
const appMod = await import('../app.js')
|
|
260
|
+
await appMod.refresh({ quiet: true })
|
|
261
|
+
toast(t("已清除飞书凭据,通道回到未绑定"), 'success')
|
|
262
|
+
} catch (error) {
|
|
263
|
+
toast((error )?.message || String(error), 'error')
|
|
264
|
+
}
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
// 微信通道启停开关(DSHBOTS-334):切换即调 set_wechat_channel_enabled(服务端
|
|
268
|
+
// 即时 mount/unmount),停用前确认。
|
|
269
|
+
document.addEventListener('click', async (event) => {
|
|
270
|
+
const target = (event.target ).closest?.('[data-action="wechat-toggle"]')
|
|
271
|
+
if (!target) return
|
|
272
|
+
const next = target.dataset?.next === '1'
|
|
273
|
+
if (!next && !globalThis.confirm?.(t("停用后微信通道立即断开且不再推送。确认停用?"))) return
|
|
274
|
+
try {
|
|
275
|
+
const apiMod = await import('./api.js')
|
|
276
|
+
await apiMod.api('set_wechat_channel_enabled', { enabled: next }, { quiet: true })
|
|
277
|
+
const appMod = await import('../app.js')
|
|
278
|
+
await appMod.refresh({ quiet: true })
|
|
279
|
+
toast(next ? t("微信通道已启用") : t("微信通道已停用"), 'success')
|
|
280
|
+
} catch (error) {
|
|
281
|
+
toast((error )?.message || String(error), 'error')
|
|
282
|
+
}
|
|
283
|
+
})
|
|
@@ -4,11 +4,12 @@ import { activeBots, activeProject, attr, avatar, botById, duration, esc, filePo
|
|
|
4
4
|
import { api } from './api.js'
|
|
5
5
|
import { mdChatScope, richText } from './markdown.js'
|
|
6
6
|
import { t, tMaybe } from './i18n.js'
|
|
7
|
-
import { currentSkillVersion, skillVersions, taskUsageBlock } from './tasks.js'
|
|
7
|
+
import { currentSkillVersion, skillVersions, taskDeliverablesBlock, taskUsageBlock } from './tasks.js'
|
|
8
8
|
import { ensureComposerImageInput, ensureImageViewer } from './composer.js'
|
|
9
9
|
import { app, refresh, panelAttrs, render, updateRunClocks } from '../app.js'
|
|
10
10
|
import { modalShell, modalLoading, renderModalLayer } from './modal-layer.js'
|
|
11
11
|
import { botQuotaBlock } from './bot-quota.js'
|
|
12
|
+
import { ARTIFACT_IMAGE, FILE_TEXT_EXT, artifactFileUrl, artifactExt } from './file-preview.js'
|
|
12
13
|
|
|
13
14
|
function modelOptions(provider, model) {
|
|
14
15
|
const models = state.data?.models ?? []
|
|
@@ -320,11 +321,8 @@ function modalSkill(detail) {
|
|
|
320
321
|
})
|
|
321
322
|
}
|
|
322
323
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
`/api/dsh-team/artifact-file?runId=${encodeURIComponent(runId)}&path=${encodeURIComponent(path)}`
|
|
326
|
-
|
|
327
|
-
// 已完成写运行的交付产物:默认收起(与「查看输出」同一折叠口径),展开后图片内联预览(点击新窗口打开),其余文件列出路径与扩展名徽标。
|
|
324
|
+
// 已完成写运行的交付产物:默认收起(与「查看输出」同一折叠口径),展开后图片内联预览,
|
|
325
|
+
// 文本型文件应用内预览(DSHBOTS-347),其余文件列路径与扩展名徽标、新窗口打开。
|
|
328
326
|
function runArtifacts(state, run) {
|
|
329
327
|
const list = Array.isArray(run.artifacts) ? run.artifacts : []
|
|
330
328
|
if (run.status !== 'succeeded' || list.length === 0) return ''
|
|
@@ -335,9 +333,10 @@ function runArtifacts(state, run) {
|
|
|
335
333
|
const url = artifactFileUrl(run.id, path)
|
|
336
334
|
if (ARTIFACT_IMAGE.test(path)) {
|
|
337
335
|
rows.push(`<button type="button" class="artifact-thumb" data-action="open-artifact" data-url="${attr(url)}" title="${attr(path)}"><img src="${attr(url)}" alt="${attr(path)}" loading="lazy"></button>`)
|
|
336
|
+
} else if (FILE_TEXT_EXT.test(path)) {
|
|
337
|
+
rows.push(`<button type="button" class="artifact-file" data-action="preview-file" data-url="${attr(url)}" data-path="${attr(path)}" title="${attr(path)}"><span class="artifact-path">${esc(path)}</span><span class="artifact-ext mono">${esc(artifactExt(path))}</span></button>`)
|
|
338
338
|
} else {
|
|
339
|
-
|
|
340
|
-
rows.push(`<a class="artifact-file" href="${attr(url)}" target="_blank" rel="noopener"><span class="artifact-path">${esc(path)}</span><span class="artifact-ext mono">${esc(ext)}</span></a>`)
|
|
339
|
+
rows.push(`<a class="artifact-file" href="${attr(url)}" target="_blank" rel="noopener"><span class="artifact-path">${esc(path)}</span><span class="artifact-ext mono">${esc(artifactExt(path))}</span></a>`)
|
|
341
340
|
}
|
|
342
341
|
}
|
|
343
342
|
if (!rows.length) return ''
|
|
@@ -460,7 +459,7 @@ function modalTask(task) {
|
|
|
460
459
|
${editingScopes ? scopesEdit : `${scopesEditable ? `<div class="btn-row" style="margin-bottom:6px"><button class="btn small" type="button" data-action="edit-scopes" data-task-id="${attr(task.id)}">${icon('edit')}${t("编辑")}</button></div>` : ''}${scopesView}
|
|
461
460
|
<div class="hint" style="margin-top:6px">${t("写范围是并行调度依据:同项目内路径互不重叠的任务才会并行。")}</div>`}
|
|
462
461
|
</div>
|
|
463
|
-
${task.timeBudgetMinutes ? `<div class="scope-block">
|
|
462
|
+
${taskDeliverablesBlock(task)}${task.timeBudgetMinutes ? `<div class="scope-block">
|
|
464
463
|
<div class="eyebrow" style="margin-bottom:6px">${t('taskForm.timeBudgetLabel')}</div>
|
|
465
464
|
<div class="note" style="color:var(--ink)">${t('task.timeBudgetValue', { minutes: Number(task.timeBudgetMinutes) })}</div>
|
|
466
465
|
<div class="hint" style="margin-top:6px">${t('task.timeBudgetNote')}</div>
|
|
@@ -2,6 +2,7 @@ import { state } from './state.js'
|
|
|
2
2
|
import { attr, esc } from './util.js'
|
|
3
3
|
import { render, updateRunClocks } from '../app.js'
|
|
4
4
|
import { modalNewProject, modalRemoveTracking, modalRemoveBotTracking, modalBot, modalInviteMember, modalNewTask, modalTask, modalSkill, modalMemory, modalProposal, modalPrice, modalTrajectory } from './modal-forms.js'
|
|
5
|
+
import { modalFilePreview } from './file-preview.js'
|
|
5
6
|
import { t } from './i18n.js'
|
|
6
7
|
|
|
7
8
|
function modalShell({ title, subtitle = '', body = '', footer = '', size = '', badge = '' }) {
|
|
@@ -44,6 +45,7 @@ function renderModal() {
|
|
|
44
45
|
case 'proposal': return modalProposal(modal.kind)
|
|
45
46
|
case 'price': return modalPrice(modal.price ?? {})
|
|
46
47
|
case 'trajectory': return modalTrajectory(modal.detail, modal.runId)
|
|
48
|
+
case 'file-preview': return modalFilePreview(modal)
|
|
47
49
|
default: return ''
|
|
48
50
|
}
|
|
49
51
|
}
|