Auto-open browser after server start
This commit is contained in:
+7
-6
@@ -12,20 +12,21 @@ Dim oExec, sOut
|
|||||||
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5010 | findstr LISTENING")
|
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5010 | findstr LISTENING")
|
||||||
sOut = oExec.StdOut.ReadAll()
|
sOut = oExec.StdOut.ReadAll()
|
||||||
If Len(Trim(sOut)) > 0 Then
|
If Len(Trim(sOut)) > 0 Then
|
||||||
MsgBox "Fleet Management ya esta corriendo en el puerto 5010.", 64, "Fleet Management"
|
' Ya esta corriendo — solo abrir el browser
|
||||||
|
oShell.Run "http://localhost:5010", 1, False
|
||||||
WScript.Quit
|
WScript.Quit
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' Iniciar servidor oculto
|
||||||
oShell.Run "cmd /c cd /d """ & sDir & """ && """ & sPython & """ run.py >> """ & sLog & """ 2>&1", 0, False
|
oShell.Run "cmd /c cd /d """ & sDir & """ && """ & sPython & """ run.py >> """ & sLog & """ 2>&1", 0, False
|
||||||
|
|
||||||
WScript.Sleep 1500
|
WScript.Sleep 2000
|
||||||
|
|
||||||
|
' Verificar y abrir browser
|
||||||
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5010 | findstr LISTENING")
|
Set oExec = oShell.Exec("cmd /c netstat -aon | findstr :5010 | findstr LISTENING")
|
||||||
sOut = oExec.StdOut.ReadAll()
|
sOut = oExec.StdOut.ReadAll()
|
||||||
If Len(Trim(sOut)) > 0 Then
|
If Len(Trim(sOut)) > 0 Then
|
||||||
MsgBox "Fleet Management iniciado correctamente." & vbCrLf & vbCrLf & _
|
oShell.Run "http://localhost:5010", 1, False
|
||||||
"URL: http://localhost:5010" & vbCrLf & _
|
|
||||||
"Tailscale: http://100.96.43.86:5010", 64, "Fleet Management"
|
|
||||||
Else
|
Else
|
||||||
MsgBox "El servidor tardo en iniciar. Revisa logs\server.log si hay errores.", 48, "Fleet Management"
|
MsgBox "El servidor no respondio. Revisa logs\server.log", 48, "Fleet Management"
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user