mirror of
https://github.com/soxoj/maigret.git
synced 2026-05-06 22:19:01 +00:00
webinterface: minor changes
This commit is contained in:
+9
-6
@@ -326,13 +326,15 @@ def setup_arguments_parser(settings: Settings):
|
|||||||
)
|
)
|
||||||
modes_group.add_argument(
|
modes_group.add_argument(
|
||||||
"--web",
|
"--web",
|
||||||
action="store",
|
|
||||||
metavar='PORT',
|
metavar='PORT',
|
||||||
type=int,
|
type=int,
|
||||||
default=settings.web_interface_port,
|
nargs='?',
|
||||||
help="Launches the web interface on the specified port (Default: 5000).",
|
const=5000, # default if --web is provided without a port
|
||||||
|
default=None,
|
||||||
|
help="Launches the web interface on the specified port (default: 5000 if no PORT is provided).",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
output_group = parser.add_argument_group(
|
output_group = parser.add_argument_group(
|
||||||
'Output options', 'Options to change verbosity and view of the console output'
|
'Output options', 'Options to change verbosity and view of the console output'
|
||||||
)
|
)
|
||||||
@@ -493,10 +495,11 @@ async def main():
|
|||||||
log_level = logging.WARNING
|
log_level = logging.WARNING
|
||||||
logger.setLevel(log_level)
|
logger.setLevel(log_level)
|
||||||
|
|
||||||
if args.web:
|
if args.web is not None:
|
||||||
from maigret.web.app import app
|
from maigret.web.app import app
|
||||||
port = args.web if isinstance(args.web, int) else 5000
|
port = args.web if args.web else 5000 # args.web is either the specified port or 5000 by const
|
||||||
app.run(port=port) # Use the port from arguments
|
app.run(port=port)
|
||||||
|
|
||||||
|
|
||||||
# Usernames initial list
|
# Usernames initial list
|
||||||
usernames = {
|
usernames = {
|
||||||
|
|||||||
Reference in New Issue
Block a user