diff --git a/flinventory_gui/search.py b/flinventory_gui/search.py index a75f814..17dd2cc 100644 --- a/flinventory_gui/search.py +++ b/flinventory_gui/search.py @@ -2,6 +2,7 @@ import argparse import asyncio import itertools +import json import re import time 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__"}: nicegui.app.add_static_files('/images_landscape', 'images_landscape') 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", favicon="website_resources/favicon.ico", language="de", - # host="192.168.178.133", - port=11111) + host=options.get("host", "0.0.0.0"), + port=options.get("port", 11111))