diff --git a/.umirc.ts b/.umirc.ts index 8b7a6352..63e9c411 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -7,7 +7,6 @@ export default defineConfig({ nodeModulesTransform: { type: 'none', }, - mfsu: {}, fastRefresh: {}, favicon: '/images/g5.ico', proxy: { diff --git a/back/loaders/initData.ts b/back/loaders/initData.ts index 015f8260..cdd07d17 100644 --- a/back/loaders/initData.ts +++ b/back/loaders/initData.ts @@ -32,7 +32,7 @@ export default async () => { for (const key in groups) { if (Object.prototype.hasOwnProperty.call(groups, key)) { const group = groups[key]; - dependenceService.installOrUninstallDependencies(group); + dependenceService.reInstall(group.map((x) => x._id)); } } }); diff --git a/back/services/dependence.ts b/back/services/dependence.ts index c6d8e2fe..e005c41c 100644 --- a/back/services/dependence.ts +++ b/back/services/dependence.ts @@ -191,12 +191,20 @@ export default class DependenceService { )[dependencies[0].type as any]; const depIds = dependencies.map((x) => x._id) as string[]; const cp = spawn(`${depRunCommand} ${depNames}`, { shell: '/bin/bash' }); + const startTime = Date.now(); this.sockService.sendMessage({ type: 'installDependence', - message: `开始安装依赖 ${depNames}`, + message: `开始安装依赖 ${depNames},开始时间 ${new Date( + startTime, + ).toLocaleString()}`, references: depIds, }); - this.updateLog(depIds, `开始安装依赖 ${depNames}\n`); + this.updateLog( + depIds, + `开始安装依赖 ${depNames},开始时间 ${new Date( + startTime, + ).toLocaleString()}\n`, + ); cp.stdout.on('data', (data) => { this.sockService.sendMessage({ type: 'installDependence', @@ -225,12 +233,21 @@ export default class DependenceService { }); cp.on('close', (code) => { + const endTime = Date.now(); this.sockService.sendMessage({ type: 'installDependence', - message: '依赖安装结束', + message: `依赖安装结束,结束时间 ${new Date( + endTime, + ).toLocaleString()},耗时 ${(endTime - startTime) / 1000} 秒`, references: depIds, }); - isInstall && this.updateLog(depIds, '依赖安装结束'); + isInstall && + this.updateLog( + depIds, + `依赖安装结束,结束时间 ${new Date(endTime).toLocaleString()},耗时 ${ + (endTime - startTime) / 1000 + } 秒`, + ); isInstall && this.dependenceDb.update( { _id: { $in: depIds } },