File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change
1
+ import click
2
+
3
+
4
+ @click .command ()
5
+ def dashboard ():
6
+ """Open the Warnet dashboard in default browser"""
7
+ import webbrowser
8
+
9
+ url = "http://localhost:2019"
10
+ webbrowser .open (url )
11
+ click .echo ("warnet dashboard opened in default browser" )
Original file line number Diff line number Diff line change @@ -254,11 +254,11 @@ def run_detached_process(command):
254
254
255
255
256
256
def _port_start_internal (name , namespace ):
257
+ click .echo ("Starting port-forwarding to warnet dashboard" )
257
258
command = f"kubectl port-forward -n { namespace } service/{ name } 2019:80"
258
259
run_detached_process (command )
259
- click .echo (
260
- "Port forwarding on port 2019 started in the background. To access landing page visit localhost:2019."
261
- )
260
+ click .echo ("Port forwarding on port 2019 started in the background." )
261
+ click .echo ("\n To access the warnet dashboard visit localhost:2019 or run:\n warnet dashboard" )
262
262
263
263
264
264
def _port_stop_internal (name , namespace ):
Original file line number Diff line number Diff line change 17
17
from .admin import admin
18
18
from .bitcoin import bitcoin
19
19
from .control import down , run , stop
20
+ from .dashboard import dashboard
20
21
from .deploy import deploy as deploy_command
21
22
from .graph import graph
22
23
from .image import image
@@ -33,6 +34,7 @@ def cli():
33
34
34
35
35
36
cli .add_command (bitcoin )
37
+ cli .add_command (dashboard )
36
38
cli .add_command (deploy_command )
37
39
cli .add_command (graph )
38
40
cli .add_command (image )
You can’t perform that action at this time.
0 commit comments