feat(client): add routes for version, time, system info, and restart functionality

This commit is contained in:
2026-01-31 00:48:15 +08:00
parent ef891e529a
commit 51822506d7
16 changed files with 693 additions and 582 deletions

View File

@@ -28,7 +28,6 @@ const command = new Command('server')
shellCommands.push(`-e ${options.interpreter}`);
}
const basename = _interpreter.split('/').pop();
if (basename.includes('bun')) {
console.log(`Assistant server shell command: bun src/run-server.ts server ${shellCommands.join(' ')}`);
const child = spawnSync(_interpreter, ['src/run-server.ts', ...shellCommands], {

View File

@@ -2,7 +2,7 @@ import { program, Command } from '@/program.ts';
import { AssistantInit } from '@/services/init/index.ts';
import path from 'node:path';
import fs from 'node:fs';
import inquirer from 'inquirer';
import { confirm } from '@inquirer/prompts';
import chalk from 'chalk';
type InitCommandOptions = {
@@ -41,23 +41,17 @@ const removeCommand = new Command('remove')
const assistantDir = path.join(configDir, 'assistant-app');
if (fs.existsSync(assistantDir)) {
inquirer
.prompt([
{
type: 'confirm',
name: 'confirm',
message: `确定要删除助手配置文件吗?\n助手配置文件路径${assistantDir}`,
default: false,
},
])
.then((answers) => {
if (answers.confirm) {
fs.rmSync(assistantDir, { recursive: true, force: true });
console.log(chalk.green('助手配置文件已删除'));
} else {
console.log(chalk.blue('助手配置文件未删除'));
}
});
confirm({
message: `确定要删除助手配置文件吗?\n助手配置文件路径${assistantDir}`,
default: false,
}).then((confirmed) => {
if (confirmed) {
fs.rmSync(assistantDir, { recursive: true, force: true });
console.log(chalk.green('助手配置文件已删除'));
} else {
console.log(chalk.blue('助手配置文件未删除'));
}
});
} else {
console.log(chalk.blue('助手配置文件不存在'));
}