@fefeding/aicmd 0.1.7 → 0.1.12
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/dist/public/.vite/manifest.json +17 -17
- package/dist/public/favicon.ico +0 -0
- package/dist/public/index.css +80 -0
- package/dist/public/index.js +149 -23
- package/dist/public/views.css +309 -221
- package/dist/public/views.js +1733 -1595
- package/dist/public/vue.js +5120 -5120
- package/dist/server/model/connection.entity.d.ts +4 -0
- package/dist/server/model/connection.entity.d.ts.map +1 -1
- package/dist/server/model/connection.entity.js +4 -0
- package/dist/server/model/connection.entity.js.map +1 -1
- package/dist/server/model/connection.entity.ts +6 -0
- package/dist/server/service/ai.service.d.ts +17 -1
- package/dist/server/service/ai.service.d.ts.map +1 -1
- package/dist/server/service/ai.service.js +189 -106
- package/dist/server/service/ai.service.js.map +1 -1
- package/dist/server/service/ai.service.ts +198 -114
- package/dist/server/service/connection.service.d.ts +13 -2
- package/dist/server/service/connection.service.d.ts.map +1 -1
- package/dist/server/service/connection.service.js +114 -14
- package/dist/server/service/connection.service.js.map +1 -1
- package/dist/server/service/connection.service.ts +125 -15
- package/dist/server/service/ssh.service.d.ts +18 -0
- package/dist/server/service/ssh.service.d.ts.map +1 -1
- package/dist/server/service/ssh.service.js +344 -7
- package/dist/server/service/ssh.service.js.map +1 -1
- package/dist/server/service/ssh.service.ts +345 -7
- package/dist/server/utils/data-dir.d.ts +7 -0
- package/dist/server/utils/data-dir.d.ts.map +1 -1
- package/dist/server/utils/data-dir.js +29 -0
- package/dist/server/utils/data-dir.js.map +1 -1
- package/dist/server/utils/data-dir.ts +24 -0
- package/dist/view/index.html +19 -21
- package/electron/main.js +10 -0
- package/electron/preload.js +29 -0
- package/electron/updater.js +181 -0
- package/package.json +6 -5
- package/server.js +128 -3
- package/view/index.html +0 -9
- package/view/modules/header.tpl +0 -14
- package/view/modules/initial_state.tpl +0 -20
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Electron 自动更新模块
|
|
3
|
+
* @description 使用 electron-updater 检测、下载和安装应用更新
|
|
4
|
+
*
|
|
5
|
+
* 更新流程:
|
|
6
|
+
* 1. 应用启动时自动检查更新
|
|
7
|
+
* 2. 发现新版本 → 通知渲染进程显示提示
|
|
8
|
+
* 3. 后台下载更新(利用 blockmap 增量下载)
|
|
9
|
+
* 4. 下载完成 → 通知渲染进程显示"重启安装"按钮
|
|
10
|
+
* 5. 用户确认后重启并安装
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const { autoUpdater } = require('electron-updater');
|
|
14
|
+
const { BrowserWindow, ipcMain, app } = require('electron');
|
|
15
|
+
|
|
16
|
+
// 更新状态
|
|
17
|
+
let updateAvailable = null;
|
|
18
|
+
let updateDownloaded = false;
|
|
19
|
+
let downloadProgress = null;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 向所有窗口广播更新事件
|
|
23
|
+
*/
|
|
24
|
+
function broadcastUpdate(event, data) {
|
|
25
|
+
BrowserWindow.getAllWindows().forEach((win) => {
|
|
26
|
+
if (!win.isDestroyed()) {
|
|
27
|
+
win.webContents.send('update:event', { event, data });
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 初始化自动更新
|
|
34
|
+
* @param {object} options - 配置选项
|
|
35
|
+
* @param {boolean} options.isDev - 是否开发模式
|
|
36
|
+
*/
|
|
37
|
+
function initAutoUpdater(options = {}) {
|
|
38
|
+
// 开发模式下禁用自动更新
|
|
39
|
+
if (options.isDev) {
|
|
40
|
+
console.log('[Updater] Disabled in dev mode');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 未打包时禁用(如通过 npm start 运行的 Web 模式)
|
|
45
|
+
if (!app.isPackaged) {
|
|
46
|
+
console.log('[Updater] Disabled: app is not packaged');
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 配置 autoUpdater
|
|
51
|
+
autoUpdater.autoDownload = true;
|
|
52
|
+
autoUpdater.autoInstallOnAppQuit = true;
|
|
53
|
+
|
|
54
|
+
// 事件监听
|
|
55
|
+
autoUpdater.on('checking-for-update', () => {
|
|
56
|
+
console.log('[Updater] Checking for updates...');
|
|
57
|
+
broadcastUpdate('checking', null);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
autoUpdater.on('update-available', (info) => {
|
|
61
|
+
console.log(`[Updater] Update available: v${info.version}`);
|
|
62
|
+
updateAvailable = info;
|
|
63
|
+
updateDownloaded = false;
|
|
64
|
+
broadcastUpdate('available', {
|
|
65
|
+
version: info.version,
|
|
66
|
+
releaseDate: info.releaseDate,
|
|
67
|
+
releaseNotes: info.releaseNotes,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
autoUpdater.on('update-not-available', (info) => {
|
|
72
|
+
console.log(`[Updater] Already up to date: v${info.version}`);
|
|
73
|
+
updateAvailable = null;
|
|
74
|
+
updateDownloaded = false;
|
|
75
|
+
broadcastUpdate('not-available', { version: info.version });
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
autoUpdater.on('download-progress', (progress) => {
|
|
79
|
+
downloadProgress = {
|
|
80
|
+
percent: Math.round(progress.percent),
|
|
81
|
+
bytesPerSecond: progress.bytesPerSecond,
|
|
82
|
+
transferred: progress.transferred,
|
|
83
|
+
total: progress.total,
|
|
84
|
+
};
|
|
85
|
+
// 每 10% 广播一次,避免过于频繁
|
|
86
|
+
if (downloadProgress.percent % 10 === 0) {
|
|
87
|
+
broadcastUpdate('progress', downloadProgress);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
autoUpdater.on('update-downloaded', (info) => {
|
|
92
|
+
console.log(`[Updater] Update downloaded: v${info.version}`);
|
|
93
|
+
updateDownloaded = true;
|
|
94
|
+
broadcastUpdate('downloaded', {
|
|
95
|
+
version: info.version,
|
|
96
|
+
releaseDate: info.releaseDate,
|
|
97
|
+
releaseNotes: info.releaseNotes,
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
autoUpdater.on('error', (error) => {
|
|
102
|
+
console.error('[Updater] Error:', error.message);
|
|
103
|
+
updateAvailable = null;
|
|
104
|
+
updateDownloaded = false;
|
|
105
|
+
downloadProgress = null;
|
|
106
|
+
// 静默处理网络错误,不打扰用户
|
|
107
|
+
if (!error.message.includes('net::') && !error.message.includes('ENOTFOUND')) {
|
|
108
|
+
broadcastUpdate('error', { message: error.message });
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// 注册 IPC 处理器
|
|
113
|
+
setupUpdateIPC();
|
|
114
|
+
|
|
115
|
+
// 延迟 3 秒后检查更新(避免启动时太卡)
|
|
116
|
+
setTimeout(() => {
|
|
117
|
+
checkForUpdates();
|
|
118
|
+
}, 3000);
|
|
119
|
+
|
|
120
|
+
// 每小时检查一次更新
|
|
121
|
+
setInterval(() => {
|
|
122
|
+
checkForUpdates();
|
|
123
|
+
}, 60 * 60 * 1000);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 检查更新
|
|
128
|
+
*/
|
|
129
|
+
async function checkForUpdates() {
|
|
130
|
+
try {
|
|
131
|
+
await autoUpdater.checkForUpdates();
|
|
132
|
+
} catch (err) {
|
|
133
|
+
console.error('[Updater] Check failed:', err.message);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 安装更新并重启
|
|
139
|
+
*/
|
|
140
|
+
function quitAndInstall() {
|
|
141
|
+
if (updateDownloaded) {
|
|
142
|
+
autoUpdater.quitAndInstall();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* 注册更新相关的 IPC 通道
|
|
148
|
+
*/
|
|
149
|
+
function setupUpdateIPC() {
|
|
150
|
+
// 渲染进程请求检查更新
|
|
151
|
+
ipcMain.handle('update:check', async () => {
|
|
152
|
+
await checkForUpdates();
|
|
153
|
+
return { checking: true };
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// 渲染进程请求获取当前更新状态
|
|
157
|
+
ipcMain.handle('update:status', () => {
|
|
158
|
+
return {
|
|
159
|
+
updateAvailable: updateAvailable
|
|
160
|
+
? {
|
|
161
|
+
version: updateAvailable.version,
|
|
162
|
+
releaseDate: updateAvailable.releaseDate,
|
|
163
|
+
}
|
|
164
|
+
: null,
|
|
165
|
+
updateDownloaded,
|
|
166
|
+
downloadProgress,
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// 渲染进程请求安装更新
|
|
171
|
+
ipcMain.handle('update:install', () => {
|
|
172
|
+
quitAndInstall();
|
|
173
|
+
return { installing: true };
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
module.exports = {
|
|
178
|
+
initAutoUpdater,
|
|
179
|
+
checkForUpdates,
|
|
180
|
+
quitAndInstall,
|
|
181
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fefeding/aicmd",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "AI-powered web SSH terminal with autonomous agent, skills, and file transfer",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"bin/",
|
|
14
14
|
"public/",
|
|
15
|
-
"view/",
|
|
16
15
|
"dist/",
|
|
17
16
|
"electron/",
|
|
18
17
|
"data/skills",
|
|
@@ -47,7 +46,8 @@
|
|
|
47
46
|
"ssh2": "^1.17.0",
|
|
48
47
|
"uuid": "^13.0.2",
|
|
49
48
|
"vue-i18n": "^11.4.4",
|
|
50
|
-
"ws": "^8.21.0"
|
|
49
|
+
"ws": "^8.21.0",
|
|
50
|
+
"electron-updater": "^6.8.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@codemirror/commands": "^6.10.3",
|
|
@@ -74,11 +74,12 @@
|
|
|
74
74
|
"autoprefixer": "^10.5.0",
|
|
75
75
|
"bootstrap": "^5.3.8",
|
|
76
76
|
"bootstrap-icons": "^1.13.1",
|
|
77
|
+
"electron": "^35.5.1",
|
|
78
|
+
"electron-builder": "^26.0.12",
|
|
79
|
+
"electron-updater": "^6.8.3",
|
|
77
80
|
"jimp": "^1.6.1",
|
|
78
81
|
"js-cookie": "^3.0.7",
|
|
79
82
|
"jsdom": "^26.1.0",
|
|
80
|
-
"electron": "^35.5.1",
|
|
81
|
-
"electron-builder": "^26.0.12",
|
|
82
83
|
"pinia": "^3.0.4",
|
|
83
84
|
"pinia-plugin-persistedstate": "^4.7.1",
|
|
84
85
|
"postcss": "^8.5.15",
|
package/server.js
CHANGED
|
@@ -56,10 +56,39 @@ if (!fs.existsSync(serverIndexPath)) {
|
|
|
56
56
|
app.use((req, res, next) => {
|
|
57
57
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
58
58
|
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
|
59
|
-
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
|
|
59
|
+
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, X-Session-Id, X-File-Name');
|
|
60
|
+
if (req.method === 'OPTIONS') { res.writeHead(204); res.end(); return; }
|
|
60
61
|
next();
|
|
61
62
|
});
|
|
62
63
|
|
|
64
|
+
// HTTP 文件上传端点(绕过 WebSocket,支持大文件)
|
|
65
|
+
app.post('/api/file-upload', async (req, res) => {
|
|
66
|
+
const sessionId = req.headers['x-session-id'];
|
|
67
|
+
const fileName = req.headers['x-file-name'];
|
|
68
|
+
if (!sessionId || !fileName) {
|
|
69
|
+
res.status(400).json({ success: false, error: 'Missing X-Session-Id or X-File-Name header' });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const serverModule = require('./dist/server/index.js');
|
|
74
|
+
const { sshService } = serverModule;
|
|
75
|
+
// 收集原始请求体(文件二进制数据)
|
|
76
|
+
console.log(`[HTTP-Upload] Receiving file: session=${sessionId}, file=${fileName}`);
|
|
77
|
+
const chunks = [];
|
|
78
|
+
for await (const chunk of req) {
|
|
79
|
+
chunks.push(chunk);
|
|
80
|
+
}
|
|
81
|
+
const fileBuffer = Buffer.concat(chunks);
|
|
82
|
+
console.log(`[HTTP-Upload] Received ${fileBuffer.length} bytes, calling SFTP...`);
|
|
83
|
+
const bytes = await sshService.uploadFileViaSftp(sessionId, fileName, fileBuffer);
|
|
84
|
+
console.log(`[HTTP-Upload] SFTP done: ${fileName}, ${bytes} bytes`);
|
|
85
|
+
res.json({ success: true, bytes, fileName });
|
|
86
|
+
} catch (err) {
|
|
87
|
+
console.error(`[HTTP-Upload] Error: ${err.message}`);
|
|
88
|
+
res.status(500).json({ success: false, error: err.message, fileName });
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
63
92
|
// 处理 API 请求
|
|
64
93
|
app.use('/api/', async (req, res, next) => {
|
|
65
94
|
if (req.method === 'POST') {
|
|
@@ -90,8 +119,12 @@ app.use((req, res) => {
|
|
|
90
119
|
});
|
|
91
120
|
|
|
92
121
|
// ========== WebSocket 服务 ==========
|
|
93
|
-
|
|
94
|
-
|
|
122
|
+
// maxPayload 设为 500MB,支持较大文件的 base64 传输(base64 比原文件大 ~33%)
|
|
123
|
+
const wss = new WebSocket.Server({ server, path: '/ws/terminal', maxPayload: 500 * 1024 * 1024 });
|
|
124
|
+
console.log(`[WS] WebSocket server created on path /ws/terminal (maxPayload: 500MB)`);
|
|
125
|
+
|
|
126
|
+
// 分块上传缓冲区: uploadId -> { chunks: string[], totalChunks: number, fileName: string, sessionId: string }
|
|
127
|
+
const pendingUploads = new Map();
|
|
95
128
|
|
|
96
129
|
// 跟踪 sessionId -> WebSocket 映射(用于推送监控事件)
|
|
97
130
|
const wsBySessionId = new Map();
|
|
@@ -280,6 +313,98 @@ wss.on('connection', async (ws, req) => {
|
|
|
280
313
|
break;
|
|
281
314
|
}
|
|
282
315
|
|
|
316
|
+
case 'file-upload': {
|
|
317
|
+
// SFTP 文件上传 - 单消息模式(小文件,<50MB base64)
|
|
318
|
+
const { fileName, data: fileData } = data || {};
|
|
319
|
+
if (!sid || !fileName || !fileData) {
|
|
320
|
+
console.error(`[WS] file-upload missing params: sid=${sid}, fileName=${fileName}, hasData=${!!fileData}`);
|
|
321
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: false, error: 'Missing params', fileName }));
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
try {
|
|
325
|
+
console.log(`[WS] SFTP upload START: session=${sid}, file=${fileName}, b64len=${fileData.length}, wsReady=${ws.readyState}`);
|
|
326
|
+
const bytes = await sshService.uploadFileViaSftp(sid, fileName, Buffer.from(fileData, 'base64'));
|
|
327
|
+
console.log(`[WS] SFTP upload DONE: ${fileName}, ${bytes} bytes, wsReady=${ws.readyState}`);
|
|
328
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
329
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: true, bytes, fileName }));
|
|
330
|
+
} else {
|
|
331
|
+
console.error(`[WS] Cannot send result, WS not open: state=${ws.readyState}`);
|
|
332
|
+
}
|
|
333
|
+
} catch (err) {
|
|
334
|
+
console.error(`[WS] SFTP upload ERROR: ${err.message}`, err.stack);
|
|
335
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
336
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: false, error: err.message, fileName }));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
case 'file-upload-start': {
|
|
343
|
+
// 分块上传 - 开始(大文件)
|
|
344
|
+
const { uploadId, fileName: startFileName, totalChunks } = data || {};
|
|
345
|
+
if (!uploadId || !startFileName || !totalChunks) {
|
|
346
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: false, error: 'Missing params', fileName: startFileName }));
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
console.log(`[WS] Chunked upload start: id=${uploadId}, file=${startFileName}, chunks=${totalChunks}`);
|
|
350
|
+
pendingUploads.set(uploadId, { chunks: new Array(totalChunks), totalChunks, fileName: startFileName, sessionId: sid, receivedChunks: 0 });
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
case 'file-upload-chunk': {
|
|
355
|
+
// 分块上传 - 数据块
|
|
356
|
+
const { uploadId: chunkId, chunkIndex, data: chunkData } = data || {};
|
|
357
|
+
const upload = chunkId ? pendingUploads.get(chunkId) : null;
|
|
358
|
+
if (!upload) {
|
|
359
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: false, error: 'Upload session not found' }));
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
upload.chunks[chunkIndex] = chunkData;
|
|
363
|
+
upload.receivedChunks++;
|
|
364
|
+
// 每 10 个 chunk 反馈一次进度
|
|
365
|
+
if (upload.receivedChunks % 10 === 0 || upload.receivedChunks === upload.totalChunks) {
|
|
366
|
+
ws.send(JSON.stringify({ type: 'file-upload-progress', uploadId: chunkId, received: upload.receivedChunks, total: upload.totalChunks }));
|
|
367
|
+
}
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
case 'file-upload-end': {
|
|
372
|
+
// 分块上传 - 结束,拼接并 SFTP 写入
|
|
373
|
+
const { uploadId: endId } = data || {};
|
|
374
|
+
const endUpload = endId ? pendingUploads.get(endId) : null;
|
|
375
|
+
if (!endUpload) {
|
|
376
|
+
console.error(`[WS] file-upload-end: upload session not found: ${endId}`);
|
|
377
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: false, error: 'Upload session not found' }));
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
try {
|
|
381
|
+
console.log(`[WS] Chunked upload end: id=${endId}, file=${endUpload.fileName}, received=${endUpload.receivedChunks}/${endUpload.totalChunks}`);
|
|
382
|
+
// 检查是否收到所有 chunk
|
|
383
|
+
const missingChunks = endUpload.chunks.reduce((acc, c, i) => c === undefined ? [...acc, i] : acc, []);
|
|
384
|
+
if (missingChunks.length > 0) {
|
|
385
|
+
console.error(`[WS] Missing chunks: ${missingChunks.join(',')}`);
|
|
386
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: false, error: `Missing ${missingChunks.length} chunks`, fileName: endUpload.fileName }));
|
|
387
|
+
pendingUploads.delete(endId);
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
const fullB64 = endUpload.chunks.join('');
|
|
391
|
+
console.log(`[WS] Joined ${endUpload.totalChunks} chunks -> b64len=${fullB64.length}, calling SFTP upload...`);
|
|
392
|
+
const bytes = await sshService.uploadFileViaSftp(endUpload.sessionId, endUpload.fileName, Buffer.from(fullB64, 'base64'));
|
|
393
|
+
console.log(`[WS] Chunked upload SFTP DONE: ${endUpload.fileName}, ${bytes} bytes, wsReady=${ws.readyState}`);
|
|
394
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
395
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: true, bytes, fileName: endUpload.fileName }));
|
|
396
|
+
}
|
|
397
|
+
} catch (err) {
|
|
398
|
+
console.error(`[WS] Chunked upload ERROR: ${err.message}`, err.stack);
|
|
399
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
400
|
+
ws.send(JSON.stringify({ type: 'file-upload-result', success: false, error: err.message, fileName: endUpload.fileName }));
|
|
401
|
+
}
|
|
402
|
+
} finally {
|
|
403
|
+
pendingUploads.delete(endId);
|
|
404
|
+
}
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
|
|
283
408
|
case 'ai-agent-stop': {
|
|
284
409
|
// 停止 AI Agent
|
|
285
410
|
const { aiSessionId: stopSid } = data || {};
|
package/view/index.html
DELETED
package/view/modules/header.tpl
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<head>
|
|
2
|
-
<meta charset="UTF-8" />
|
|
3
|
-
<base href="{{viteTarget}}" />
|
|
4
|
-
{% include "./initial_state.tpl" %}
|
|
5
|
-
<link rel="icon" href="{{prefix}}/public/favicon.ico" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>AICmd - AI Terminal</title>
|
|
8
|
-
<meta name="description" content="{{description}}">
|
|
9
|
-
<script>
|
|
10
|
-
window.addEventListener('vite:preloadError', function (event) {
|
|
11
|
-
console.error(event);
|
|
12
|
-
});
|
|
13
|
-
</script>
|
|
14
|
-
</head>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script type="text/template" id="__INITIAL_STATE__">
|
|
2
|
-
{{ data | dump | safe }}
|
|
3
|
-
</script>
|
|
4
|
-
<script type="text/template" id="__DEFAULTINITIAL_STATE__">
|
|
5
|
-
{{ __DEFAULTINITIAL_STATE__ }}
|
|
6
|
-
</script>
|
|
7
|
-
<script>
|
|
8
|
-
function __get_templateJson(id) {
|
|
9
|
-
try {
|
|
10
|
-
var tag = document.getElementById(id);
|
|
11
|
-
var obj = JSON.parse(tag.innerHTML);
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
var __INITIAL_STATE__ = __get_templateJson('__INITIAL_STATE__');
|
|
19
|
-
if(!__INITIAL_STATE__) __INITIAL_STATE__ = __get_templateJson('__DEFAULTINITIAL_STATE__');
|
|
20
|
-
</script>
|