allow port and host configuration
This commit is contained in:
parent
c64f2e4232
commit
03e1bf23e3
1 changed files with 11 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
import argparse
|
import argparse
|
||||||
import asyncio
|
import asyncio
|
||||||
import itertools
|
import itertools
|
||||||
|
import json
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
from typing import Optional, Iterable, Callable
|
from typing import Optional, Iterable, Callable
|
||||||
|
@ -277,8 +278,16 @@ def show_part_changer(ui_element: nicegui.ui.element, part: Part) -> None:
|
||||||
if __name__ in {"__main__", "__mp_main__"}:
|
if __name__ in {"__main__", "__mp_main__"}:
|
||||||
nicegui.app.add_static_files('/images_landscape', 'images_landscape')
|
nicegui.app.add_static_files('/images_landscape', 'images_landscape')
|
||||||
search_page(load_data())
|
search_page(load_data())
|
||||||
|
options = {}
|
||||||
|
try:
|
||||||
|
option_file = open('flinventory-config.json')
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
with option_file:
|
||||||
|
options = json.load(option_file)
|
||||||
ui.run(title="Fahrradteile",
|
ui.run(title="Fahrradteile",
|
||||||
favicon="website_resources/favicon.ico",
|
favicon="website_resources/favicon.ico",
|
||||||
language="de",
|
language="de",
|
||||||
# host="192.168.178.133",
|
host=options.get("host", "0.0.0.0"),
|
||||||
port=11111)
|
port=options.get("port", 11111))
|
||||||
|
|
Loading…
Reference in a new issue