collabdocchat 2.0.7 → 2.0.9
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/fix-ports.js +7 -1
- package/scripts/remove-bom.js +69 -0
- package/src/components/knowledge-modal.js +1 -1
- package/src/components/optimized-poll-detail.js +1 -1
- package/src/main.js +1 -7
- package/src/pages/admin-dashboard.js +1492 -3654
- package/src/pages/login.js +100 -101
- package/src/pages/optimized-backup-view.js +1 -1
- package/src/pages/optimized-knowledge-view.js +1 -1
- package/src/pages/optimized-task-detail.js +1 -1
- package/src/pages/optimized-workflow-view.js +1 -1
- package/src/pages/simplified-workflows.js +1 -1
- package/src/pages/user-dashboard.js +905 -1508
- package/src/services/api.js +264 -326
- package/src/services/auth.js +53 -54
- package/src/services/websocket.js +79 -189
- package/src/styles/collaboration-modern.js +1 -1
- package/src/utils/ai-assistant.js +1 -1
- package/src/utils/chat-enhancements.js +1 -1
- package/src/utils/collaboration-enhancer.js +1 -1
- package/src/utils/feature-integrator.js +1 -1
- package/src/utils/onboarding-guide.js +1 -1
- package/src/utils/performance.js +1 -1
- package/src/utils/permission-manager.js +1 -1
- package/src/utils/responsive-handler.js +1 -1
- package/src/utils/theme-manager.js +1 -1
- package/src/utils/ui-enhancements-loader.js +1 -1
package/package.json
CHANGED
package/scripts/fix-ports.js
CHANGED
|
@@ -31,12 +31,18 @@ function replacePort(filePath) {
|
|
|
31
31
|
let content = fs.readFileSync(filePath, 'utf8');
|
|
32
32
|
const originalContent = content;
|
|
33
33
|
|
|
34
|
+
// 移除 BOM(如果存在)
|
|
35
|
+
if (content.charCodeAt(0) === 0xFEFF) {
|
|
36
|
+
content = content.slice(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
// 替换所有 8765 端口为 3000
|
|
35
40
|
content = content.replace(/http:\/\/localhost:8765/g, 'http://localhost:3000');
|
|
36
41
|
content = content.replace(/ws:\/\/localhost:8765/g, 'ws://localhost:3000');
|
|
37
42
|
|
|
38
43
|
if (content !== originalContent) {
|
|
39
|
-
|
|
44
|
+
// 写入时不添加 BOM
|
|
45
|
+
fs.writeFileSync(filePath, content, { encoding: 'utf8' });
|
|
40
46
|
console.log(`✅ 已修复: ${filePath}`);
|
|
41
47
|
return true;
|
|
42
48
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
// 递归查找所有 .js 文件
|
|
9
|
+
function findJsFiles(dir, fileList = []) {
|
|
10
|
+
const files = fs.readdirSync(dir);
|
|
11
|
+
|
|
12
|
+
files.forEach(file => {
|
|
13
|
+
const filePath = path.join(dir, file);
|
|
14
|
+
const stat = fs.statSync(filePath);
|
|
15
|
+
|
|
16
|
+
if (stat.isDirectory()) {
|
|
17
|
+
if (file !== 'node_modules' && file !== '.git') {
|
|
18
|
+
findJsFiles(filePath, fileList);
|
|
19
|
+
}
|
|
20
|
+
} else if (file.endsWith('.js')) {
|
|
21
|
+
fileList.push(filePath);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return fileList;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// 移除 BOM
|
|
29
|
+
function removeBOM(filePath) {
|
|
30
|
+
try {
|
|
31
|
+
const buffer = fs.readFileSync(filePath);
|
|
32
|
+
|
|
33
|
+
// 检查是否有 UTF-8 BOM (EF BB BF)
|
|
34
|
+
if (buffer.length >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
|
|
35
|
+
// 移除 BOM
|
|
36
|
+
const contentWithoutBOM = buffer.slice(3);
|
|
37
|
+
fs.writeFileSync(filePath, contentWithoutBOM);
|
|
38
|
+
console.log(`✅ 已移除 BOM: ${filePath}`);
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error(`❌ 处理失败: ${filePath}`, error.message);
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 主函数
|
|
49
|
+
function main() {
|
|
50
|
+
console.log('🔍 开始扫描并移除 BOM...\n');
|
|
51
|
+
|
|
52
|
+
const projectRoot = path.join(__dirname, '..');
|
|
53
|
+
const srcDir = path.join(projectRoot, 'src');
|
|
54
|
+
const jsFiles = findJsFiles(srcDir);
|
|
55
|
+
|
|
56
|
+
console.log(`📁 找到 ${jsFiles.length} 个 JavaScript 文件\n`);
|
|
57
|
+
|
|
58
|
+
let fixedCount = 0;
|
|
59
|
+
jsFiles.forEach(file => {
|
|
60
|
+
if (removeBOM(file)) {
|
|
61
|
+
fixedCount++;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
console.log(`\n✅ 处理完成!共移除 ${fixedCount} 个文件的 BOM`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
main();
|
|
69
|
+
|
package/src/main.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import './styles/main.css';
|
|
2
2
|
import { AuthService } from './services/auth.js';
|
|
3
3
|
import { WebSocketService } from './services/websocket.js';
|
|
4
4
|
import { renderLoginPage } from './pages/login.js';
|
|
5
5
|
import { renderAdminDashboard } from './pages/admin-dashboard.js';
|
|
6
6
|
import { renderUserDashboard } from './pages/user-dashboard.js';
|
|
7
|
-
import { ResponsiveHandler } from './utils/responsive-handler.js';
|
|
8
7
|
|
|
9
8
|
class App {
|
|
10
9
|
constructor() {
|
|
11
10
|
this.authService = new AuthService();
|
|
12
11
|
this.wsService = new WebSocketService();
|
|
13
12
|
this.currentUser = null;
|
|
14
|
-
|
|
15
|
-
// 初始化响应式处理�?
|
|
16
|
-
this.responsiveHandler = new ResponsiveHandler();
|
|
17
|
-
|
|
18
13
|
this.init();
|
|
19
14
|
}
|
|
20
15
|
|
|
@@ -56,4 +51,3 @@ class App {
|
|
|
56
51
|
new App();
|
|
57
52
|
|
|
58
53
|
|
|
59
|
-
|