From 9b1fa8298127b05c71c4de04bd6f64b72540ef5a Mon Sep 17 00:00:00 2001 From: space-nuko <24979496+space-nuko@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:55:57 -0500 Subject: [PATCH] Add filename to UI and config name to filename --- modules/ui_extensions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py index b94b3a3ac..b1ef38e22 100644 --- a/modules/ui_extensions.py +++ b/modules/ui_extensions.py @@ -61,7 +61,7 @@ def save_config_state(name): if not name: name = "Config" current_config_state["name"] = name - filename = os.path.join(config_states_dir, datetime.now().strftime("%Y_%m_%d-%H_%M_%S") + ".json") + filename = os.path.join(config_states_dir, datetime.now().strftime("%Y_%m_%d-%H_%M_%S") + "_" + name + ".json") print(f"Saving backup of webui/extension state to {filename}.") with open(filename, "w", encoding="utf-8") as f: json.dump(current_config_state, f) @@ -175,6 +175,7 @@ def update_config_states_table(state_name): config_name = config_state.get("name", "Config") created_date = time.asctime(time.gmtime(config_state["created_at"])) + filepath = config_state.get("filepath", "") code = f"""""" @@ -200,6 +201,7 @@ def update_config_states_table(state_name): style_commit = STYLE_PRIMARY code += f"""

Config Backup: {config_name}

+ Filepath: {filepath} Created at: {created_date}""" code += f"""

WebUI State