binary1ne commited on
Commit
a400047
·
verified ·
1 Parent(s): db2f289

Update webui_with_vnc.py

Browse files
Files changed (1) hide show
  1. webui_with_vnc.py +3 -2
webui_with_vnc.py CHANGED
@@ -1,5 +1,6 @@
1
  import os
2
  import socket
 
3
  import argparse
4
  import gradio as gr
5
  from src.webui.interface import theme_map, create_ui
@@ -33,9 +34,9 @@ def get_vnc_iframe():
33
  # get hostname + IP
34
  hostname = socket.gethostname()
35
  ip = socket.gethostbyname(hostname)
36
-
37
  # build iframe URL
38
- url = f"http://{ip}:6080/vnc.html?host={ip}&port=6080"
39
  print("############## URL :",url)
40
  # return HTML iframe
41
  return f"""
 
1
  import os
2
  import socket
3
+ import subprocess
4
  import argparse
5
  import gradio as gr
6
  from src.webui.interface import theme_map, create_ui
 
34
  # get hostname + IP
35
  hostname = socket.gethostname()
36
  ip = socket.gethostbyname(hostname)
37
+ hostname = subprocess.check_output("hostname", shell=True).decode().strip()
38
  # build iframe URL
39
+ url = f"http://{hostname}:6080/vnc.html?host={hostname}&port=6080"
40
  print("############## URL :",url)
41
  # return HTML iframe
42
  return f"""