From 93d8a7c85292b00fc0db65baef0c031de512f390 Mon Sep 17 00:00:00 2001 From: QCQCQC <1220204124@zust.edu.cn> Date: Thu, 8 May 2025 16:15:07 +0800 Subject: [PATCH] =?UTF-8?q?disable=E6=97=B6=E4=B8=8D=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/server/start.js | 26 +++++++++++++++----------- src/server/start.ts | 24 ++++++++++++++---------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/lib/server/start.js b/lib/server/start.js index c130558..f42550e 100644 --- a/lib/server/start.js +++ b/lib/server/start.js @@ -315,7 +315,9 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) { ctx.response.body = endpoints; }); // 注册静态资源 - koa.use((0, koa_mount_1.default)('/socket-admin', (0, koa_static_1.default)(socketAdminUI))); + if (!ui?.disable) { + koa.use((0, koa_mount_1.default)('/socket-admin', (0, koa_static_1.default)(socketAdminUI))); + } koa.use(router.routes()); koa.on('error', (err) => { console.error(err); @@ -330,16 +332,18 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) { console.log(chalk_1.default.greenBright.bold('\n🚀 Server started successfully!\n')); console.log(`🔗 ${chalk_1.default.cyan('Server URL')}: ${chalk_1.default.underline(baseUrl)}`); // socketio地址 - console.log(`🔗 ${chalk_1.default.cyan('Socket URL')}: ${chalk_1.default.underline(concat(url, socketPath))}`); - console.log(`🛠️ ${chalk_1.default.magenta('Socket Admin UI')}: ${chalk_1.default.underline(adminUIUrl)}`); - // 账号密码 - // 是否设置密码 - if (isPasswordSet) { - console.log(`🔑 ${chalk_1.default.yellow('Socket Admin UI Password has been set, check the config file\n')}`); - } - else { - console.log(chalk_1.default.yellow('Socket Admin UI Password Generated: ') + chalk_1.default.red(passwordForAdminUI)); - console.log(chalk_1.default.yellow('Please set the password when running prod env.\n')); + console.log(`🔗 ${chalk_1.default.cyan('Socket URL')}: ${chalk_1.default.underline(concat(url, socketPath))}\n`); + if (!ui?.disable) { + console.log(`🛠️ ${chalk_1.default.magenta('Socket Admin UI')}: ${chalk_1.default.underline(adminUIUrl)}`); + // 账号密码 + // 是否设置密码 + if (isPasswordSet) { + console.log(`🔑 ${chalk_1.default.yellow('Socket Admin UI Password has been set, check the config file\n')}`); + } + else { + console.log(chalk_1.default.yellow('Socket Admin UI Password Generated: ') + chalk_1.default.red(passwordForAdminUI)); + console.log(chalk_1.default.yellow('Please set the password when running prod env.\n')); + } } }); if (!omitWatchers) { diff --git a/src/server/start.ts b/src/server/start.ts index d1b2224..d6ef224 100644 --- a/src/server/start.ts +++ b/src/server/start.ts @@ -394,7 +394,9 @@ export async function startup