Skip to content
This repository was archived by the owner on Dec 21, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ you can also use the web ui instead of commandline interface::
$ storm web
$ storm web 3333
$ storm web --debug
$ storm web --host 0.0.0.0

.. versionchanged:: 0.7
*--port* option was removed. *--debug* option is now defaults to ``False``.
*--host* option was added.
5 changes: 3 additions & 2 deletions storm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,13 @@ def backup(target_file, config=None):

@command('web')
@arg('port', nargs='?', default=9002, type=int)
@arg('host', nargs='?', default="127.0.0.1", type=str)
@arg('theme', nargs='?', default="modern", choices=['modern', 'black', 'storm'])
@arg('debug', action='store_true', default=False)
def web(port, debug=False, theme="modern", ssh_config=None):
def web(port, host="127.0.0.1", debug=False, theme="modern", ssh_config=None):
"""Starts the web UI."""
from storm import web as _web
_web.run(port, debug, theme, ssh_config)
_web.run(host, port, debug, theme, ssh_config)


if __name__ == '__main__':
Expand Down
5 changes: 3 additions & 2 deletions storm/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,16 @@ def favicon():
mimetype='image/vnd.microsoft.icon')


def run(port, debug, theme, ssh_config=None):
def run(host, port, debug, theme, ssh_config=None):
global __THEME__
port = int(port)
debug = bool(debug)
host = str(host)
__THEME__ = theme

def get_storm():
return Storm(ssh_config)

app.get_storm = get_storm

app.run(port=port, debug=debug)
app.run(host=host, port=port, debug=debug)