From b734e1c40753586c9c957405729d6e6fb45d126f Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Mon, 11 Sep 2023 23:49:07 +0800 Subject: [PATCH] Fix: Template name at config add --- module/config/utils.py | 2 +- module/webui/app.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/config/utils.py b/module/config/utils.py index 8159fcb06..58c5dc914 100644 --- a/module/config/utils.py +++ b/module/config/utils.py @@ -166,7 +166,7 @@ def alas_template(): for file in os.listdir('./config'): name, extension = os.path.splitext(file) if name == 'template' and extension == '.json': - out.append(f'{name}-alas') + out.append(f'{name}-src') # out.extend(mod_template()) diff --git a/module/webui/app.py b/module/webui/app.py index 5d8cb993c..a33e92e1c 100644 --- a/module/webui/app.py +++ b/module/webui/app.py @@ -1020,8 +1020,8 @@ class AlasGUI(Frame): def get_unused_name(): all_name = alas_instance() for i in range(2, 100): - if f"alas{i}" not in all_name: - return f"alas{i}" + if f"src{i}" not in all_name: + return f"src{i}" else: return "" @@ -1060,7 +1060,7 @@ class AlasGUI(Frame): name="AddAlas_copyfrom", label=t("Gui.AddAlas.CopyFrom"), options=alas_template() + alas_instance(), - value=origin or "template-alas", + value=origin or "template-src", scope=s, ), put_button(label=t("Gui.AddAlas.Confirm"), onclick=add, scope=s)