-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTART_MONITOR.bat
More file actions
54 lines (45 loc) · 1.54 KB
/
START_MONITOR.bat
File metadata and controls
54 lines (45 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@echo off
setlocal enabledelayedexpansion
set SESSION_ID=MONITOR_SESSION_%RANDOM%
TITLE Nexus Monitor - Orchestrator [%SESSION_ID%]
COLOR 0B
echo ===================================================
echo NEXUS MONITOR - STARTUP (Dynamic)
echo Session ID: %SESSION_ID%
echo ===================================================
echo.
:: --- STARTUP GUARD ---
node -v >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Node.js tidak ditemukan!
pause
exit /b
)
:: Resolve Ports
for /f "tokens=*" %%i in ('node "%~dp0scripts\utils\resolve-ports.cjs"') do %%i
if "%DISCO_MONITOR_PORT%"=="" set DISCO_MONITOR_PORT=4000
echo [OK] Monitor Port Resolved: %DISCO_MONITOR_PORT%
:: --- LAUNCH ---
echo Launching Nexus Monitor Local Server...
set MONITOR_PORT=%DISCO_MONITOR_PORT%
:: Launch in a separate window but with unique title for cleanup
start "%SESSION_ID%_SRV" cmd /c "set MONITOR_PORT=%DISCO_MONITOR_PORT% & node \"%~dp0scripts\debug\monitor-server.cjs\""
timeout /t 2 /nobreak > nul
echo Opening browser...
start http://localhost:%DISCO_MONITOR_PORT%
echo.
echo ===================================================
echo NEXUS MONITOR IS LIVE AT http://localhost:%DISCO_MONITOR_PORT%
echo ===================================================
echo JANGAN TUTUP JENDELA INI KECUALI INGIN BERHENTI.
echo.
echo [TEKAN TOMBOL APA SAJA UNTUK MEMATIKAN MONITOR]
echo.
pause
:: --- CLEANUP ---
echo.
echo [!] Sedang mematikan monitor (Cleanup)...
taskkill /F /FI "WINDOWTITLE eq %SESSION_ID%_SRV*" /T >nul 2>&1
echo [OK] Monitor telah ditutup.
timeout /t 2 > nul
exit