feat(client): add routes for version, time, system info, and restart functionality
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { checkFileExists, AssistantConfig } from '@/module/assistant/index.ts';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import inquirer from 'inquirer';
|
||||
import { confirm } from '@inquirer/prompts';
|
||||
|
||||
import { spawnSync } from 'child_process';
|
||||
export const runCommand = (command: string, args: string[]) => {
|
||||
@@ -91,15 +91,10 @@ export class AppDownload {
|
||||
return runCommand(command, args);
|
||||
}
|
||||
async confirm(message?: string) {
|
||||
const { confirm } = await inquirer.prompt([
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'confirm',
|
||||
message: message || '是否继续删除应用?',
|
||||
default: false,
|
||||
},
|
||||
]);
|
||||
return confirm;
|
||||
return await confirm({
|
||||
message: message || '是否继续删除应用?',
|
||||
default: false,
|
||||
});
|
||||
}
|
||||
async deleteApp(opts: DeleteAppOptions) {
|
||||
const { id, type = 'web', yes = false } = opts;
|
||||
|
||||
@@ -136,11 +136,11 @@ export class AssistantInit extends AssistantConfig {
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.975.0",
|
||||
"@aws-sdk/client-s3": "^3.978.0",
|
||||
"@kevisual/oss": "^0.0.16",
|
||||
"@kevisual/query": "^0.0.38",
|
||||
"eventemitter3": "^5.0.4",
|
||||
"@kevisual/router": "^0.0.62",
|
||||
"@kevisual/router": "^0.0.64",
|
||||
"@kevisual/use-config": "^1.0.28",
|
||||
"ioredis": "^5.9.2",
|
||||
"minio": "^8.0.6",
|
||||
@@ -157,16 +157,18 @@ export class AssistantInit extends AssistantConfig {
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kevisual/types": "^0.0.12",
|
||||
"@types/bun": "^1.3.6",
|
||||
"@types/bun": "^1.3.8",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/node": "^25.0.10"
|
||||
"@types/node": "^25.1.0"
|
||||
}
|
||||
}
|
||||
`,
|
||||
);
|
||||
console.log(chalk.green('助手 package.json 文件创建成功, 正在安装依赖...'));
|
||||
installDeps({ appPath: path.dirname(packagePath), isProduction: true }).then(() => {
|
||||
console.log('------------------------------------------------');
|
||||
console.log(chalk.green('助手依赖安装完成'));
|
||||
console.log('------------------------------------------------');
|
||||
});
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.975.0",
|
||||
"@aws-sdk/client-s3": "^3.978.0",
|
||||
"@kevisual/oss": "^0.0.16",
|
||||
"@kevisual/query": "^0.0.38",
|
||||
"eventemitter3": "^5.0.4",
|
||||
"@kevisual/router": "^0.0.62",
|
||||
"@kevisual/router": "^0.0.64",
|
||||
"@kevisual/use-config": "^1.0.28",
|
||||
"ioredis": "^5.9.2",
|
||||
"minio": "^8.0.6",
|
||||
@@ -33,8 +33,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kevisual/types": "^0.0.12",
|
||||
"@types/bun": "^1.3.6",
|
||||
"@types/bun": "^1.3.8",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/node": "^25.0.10"
|
||||
"@types/node": "^25.1.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user