Save/restore working webui/extension configs

This commit is contained in:
space-nuko
2023-03-29 16:46:03 -05:00
parent 22bcc7be42
commit ad5afcaae0
6 changed files with 243 additions and 9 deletions

View File

@@ -47,3 +47,19 @@ function install_extension_from_index(button, url){
gradioApp().querySelector('#install_extension_button').click()
}
function config_state_confirm_restore(_, config_state_name, config_restore_type) {
if (config_state_name == "Current") {
return [false, config_state_name];
}
let restored = "";
if (config_restore_type == "extensions") {
restored = "all saved extension versions";
} else if (config_restore_type == "webui") {
restored = "the webui version";
} else {
restored = "the webui version and all saved extension versions";
}
let confirmed = confirm("Are you sure you want to restore from this state?\nThis will reset " + restored + ".\n(A backup of the current state will be made.)");
return [confirmed, config_state_name, config_restore_type];
}