collabdocchat 2.3.0 → 2.4.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/scripts/check-syntax.js +54 -0
- package/scripts/find-duplicate.js +35 -0
- package/scripts/fix-help.js +274 -0
- package/scripts/fix-issues-step1.js +73 -0
- package/scripts/fix-issues-step2.js +93 -0
- package/scripts/fix-issues-step3.js +155 -0
- package/scripts/fix-issues-step4.js +150 -0
- package/scripts/fix-settings.js +258 -0
- package/scripts/fix-workflow.js +110 -0
- package/src/pages/admin-dashboard.js +546 -116
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
const filePath = path.join(__dirname, '../src/pages/admin-dashboard.js');
|
|
9
|
+
|
|
10
|
+
console.log('读取文件...');
|
|
11
|
+
let content = fs.readFileSync(filePath, 'utf8');
|
|
12
|
+
|
|
13
|
+
// 1. 替换工作流模态框,添加更多选项
|
|
14
|
+
console.log('丰富工作流功能...');
|
|
15
|
+
const oldWorkflowModal = ` <div id="workflowModal" class="modal hidden">
|
|
16
|
+
<div class="modal-content">
|
|
17
|
+
<h3>创建工作流</h3>
|
|
18
|
+
<form id="workflowForm">
|
|
19
|
+
<div class="form-group">
|
|
20
|
+
<label>⚙️ 工作流名称</label>
|
|
21
|
+
<input type="text" name="name" required style="width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px;">
|
|
22
|
+
</div>
|
|
23
|
+
<div class="form-group">
|
|
24
|
+
<label>📝 描述</label>
|
|
25
|
+
<textarea name="description" rows="3" style="width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px;"></textarea>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="form-group">
|
|
28
|
+
<label>🔔 触发条件</label>
|
|
29
|
+
<select name="trigger" style="width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px;">
|
|
30
|
+
<option value="document_create">文档创建时</option>
|
|
31
|
+
<option value="document_update">文档更新时</option>
|
|
32
|
+
<option value="task_complete">任务完成时</option>
|
|
33
|
+
<option value="manual">手动触发</option>
|
|
34
|
+
</select>
|
|
35
|
+
</div>
|
|
36
|
+
<div style="display: flex; gap: 10px; margin-top: 20px;">
|
|
37
|
+
<button type="submit" class="btn-primary" style="flex: 1;">创建</button>
|
|
38
|
+
<button type="button" class="btn-secondary" id="closeWorkflowModal" style="flex: 1;">取消</button>
|
|
39
|
+
</div>
|
|
40
|
+
</form>
|
|
41
|
+
</div>
|
|
42
|
+
</div>`;
|
|
43
|
+
|
|
44
|
+
const newWorkflowModal = ` <div id="workflowModal" class="modal hidden">
|
|
45
|
+
<div class="modal-content" style="max-width: 700px;">
|
|
46
|
+
<div class="modal-header" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; padding: 20px; border-radius: 12px 12px 0 0; margin: -20px -20px 20px -20px;">
|
|
47
|
+
<h3 style="margin: 0; display: flex; align-items: center; gap: 10px;">
|
|
48
|
+
<span style="font-size: 24px;">⚙️</span>
|
|
49
|
+
<span>创建工作流</span>
|
|
50
|
+
</h3>
|
|
51
|
+
</div>
|
|
52
|
+
<form id="workflowForm">
|
|
53
|
+
<div class="form-group" style="margin-bottom: 20px;">
|
|
54
|
+
<label style="display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-secondary);">⚙️ 工作流名称</label>
|
|
55
|
+
<input type="text" name="name" required placeholder="例如:文档审批流程" style="width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; transition: border-color 0.2s;">
|
|
56
|
+
</div>
|
|
57
|
+
<div class="form-group" style="margin-bottom: 20px;">
|
|
58
|
+
<label style="display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-secondary);">📝 描述</label>
|
|
59
|
+
<textarea name="description" rows="3" placeholder="描述这个工作流的用途..." style="width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; resize: vertical; transition: border-color 0.2s;"></textarea>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="form-group" style="margin-bottom: 20px;">
|
|
62
|
+
<label style="display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-secondary);">⚡ 触发条件</label>
|
|
63
|
+
<select name="trigger" style="width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; cursor: pointer; transition: border-color 0.2s;">
|
|
64
|
+
<option value="document_create">📄 文档创建时</option>
|
|
65
|
+
<option value="document_update">✏️ 文档更新时</option>
|
|
66
|
+
<option value="document_delete">🗑️ 文档删除时</option>
|
|
67
|
+
<option value="task_create">📋 任务创建时</option>
|
|
68
|
+
<option value="task_complete">✅ 任务完成时</option>
|
|
69
|
+
<option value="task_overdue">⏰ 任务逾期时</option>
|
|
70
|
+
<option value="member_join">👥 成员加入时</option>
|
|
71
|
+
<option value="group_create">🏢 群组创建时</option>
|
|
72
|
+
<option value="scheduled">⏱️ 定时触发</option>
|
|
73
|
+
<option value="manual">🖱️ 手动触发</option>
|
|
74
|
+
</select>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="form-group" style="margin-bottom: 20px;">
|
|
77
|
+
<label style="display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-secondary);">🎯 执行操作</label>
|
|
78
|
+
<select name="action" style="width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; cursor: pointer; transition: border-color 0.2s;">
|
|
79
|
+
<option value="send_notification">📧 发送通知</option>
|
|
80
|
+
<option value="send_email">✉️ 发送邮件</option>
|
|
81
|
+
<option value="create_task">📋 创建任务</option>
|
|
82
|
+
<option value="update_status">🔄 更新状态</option>
|
|
83
|
+
<option value="assign_permission">🔐 分配权限</option>
|
|
84
|
+
<option value="backup_data">💾 备份数据</option>
|
|
85
|
+
<option value="generate_report">📊 生成报告</option>
|
|
86
|
+
<option value="call_api">🔗 调用外部API</option>
|
|
87
|
+
</select>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="form-group" style="margin-bottom: 20px;">
|
|
90
|
+
<label style="display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-secondary);">⚙️ 操作参数 (JSON格式)</label>
|
|
91
|
+
<textarea name="actionParams" rows="4" placeholder='{"message": "任务已完成", "recipients": ["user1"]}' style="width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 13px; font-family: monospace; resize: vertical; transition: border-color 0.2s;"></textarea>
|
|
92
|
+
<div style="margin-top: 8px; font-size: 12px; color: var(--text-tertiary);">
|
|
93
|
+
💡 提示:使用 JSON 格式配置操作参数
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div style="display: flex; gap: 12px; margin-top: 25px;">
|
|
97
|
+
<button type="submit" class="btn-primary" style="flex: 1; padding: 12px; border-radius: 8px; font-weight: 600; background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); border: none; cursor: pointer; transition: transform 0.2s;">创建</button>
|
|
98
|
+
<button type="button" class="btn-secondary" id="closeWorkflowModal" style="flex: 1; padding: 12px; border-radius: 8px; font-weight: 600;">取消</button>
|
|
99
|
+
</div>
|
|
100
|
+
</form>
|
|
101
|
+
</div>
|
|
102
|
+
</div>`;
|
|
103
|
+
|
|
104
|
+
content = content.replace(oldWorkflowModal, newWorkflowModal);
|
|
105
|
+
|
|
106
|
+
console.log('写入文件...');
|
|
107
|
+
fs.writeFileSync(filePath, content, 'utf8');
|
|
108
|
+
|
|
109
|
+
console.log('✅ 工作流功能已丰富!');
|
|
110
|
+
|