rexp-web 0.1.2 → 0.1.3
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/README.md +2 -0
- package/package.json +1 -1
- package/scripts/web.mjs +9 -1
package/README.md
CHANGED
|
@@ -177,3 +177,5 @@ SSH 可连接与平台可用分别检测:未配置、未安装、未初始化
|
|
|
177
177
|
这是选中服务器上实验调度器的开关;右上角“Web 设置”管理的仍是本机网页服务登录自启动,两者独立。终端也可使用 `rexp autostart --enable/--disable`,以及 `rexp start` / `rexp stop` 手动启停。
|
|
178
178
|
|
|
179
179
|
参数搜索将控制器存活与实际执行分开展示:有尝试计算时显示“正在执行尝试”,否则提示等待调度/资源。尝试列表可筛选“等待中”,等待记录显示占用卡的其他 run;运行区计数与独立刷新的运行尝试列表保持同步。
|
|
180
|
+
|
|
181
|
+
异常退出后的恢复:`rexp-web start` 会通过本机健康接口确认服务身份,自动忽略断电或重启后遗留的 PID 记录;不会终止占用了旧 PID 的其他进程。macOS 登录启动日志保存在 `~/.cache/rexp-hub/web/service.log`,不要求后台服务打开桌面目录中的日志文件。登录启动仅在已开启时生效,可用 `rexp-web autostart status --json` 查看。
|
package/package.json
CHANGED
package/scripts/web.mjs
CHANGED
|
@@ -91,7 +91,15 @@ async function main() {
|
|
|
91
91
|
}
|
|
92
92
|
if (!['start','open'].includes(action)) throw new Error('用法:rexp-web start|open|stop|status|logs|configure|autostart|skills|version');
|
|
93
93
|
if (await matchingService(info)) { console.log(`Web 已在运行:http://127.0.0.1:${info.port}/`); if(action==='open') await openPage(info.port); return; }
|
|
94
|
-
|
|
94
|
+
// An old PID can belong to another process after a crash or reboot. It is
|
|
95
|
+
// only a hint: never signal it or block startup without HTTP identity proof.
|
|
96
|
+
const recordedService = info && Number.isInteger(info.port) ? await health(info.port) : null;
|
|
97
|
+
if (recordedService?.service === 'rexp-hub-web' && Number.isInteger(recordedService.pid)) {
|
|
98
|
+
fs.writeFileSync(pidFile, JSON.stringify({...info, pid: recordedService.pid}), {mode:0o600});
|
|
99
|
+
console.log(`Web 已在运行:http://127.0.0.1:${info.port}/`);
|
|
100
|
+
if(action==='open') await openPage(info.port);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
95
103
|
if (info) fs.rmSync(pidFile, { force: true });
|
|
96
104
|
const port = Number(process.env.REXP_WEB_PORT || 5173);
|
|
97
105
|
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("REXP_WEB_PORT 必须是有效端口");
|