mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Saving tweaks on colab
This commit is contained in:
18
aiserver.py
18
aiserver.py
@@ -6771,7 +6771,7 @@ def new_ui_index():
|
|||||||
def ui2_connect():
|
def ui2_connect():
|
||||||
#Send all variables to client
|
#Send all variables to client
|
||||||
koboldai_vars.send_to_ui()
|
koboldai_vars.send_to_ui()
|
||||||
|
UI_2_load_tweaks()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
@@ -7684,6 +7684,22 @@ def UI_2_sp_list_refresh(data):
|
|||||||
def UI_2_theme_list_refresh(data):
|
def UI_2_theme_list_refresh(data):
|
||||||
koboldai_vars.theme_list = [".".join(f.split(".")[:-1]) for f in os.listdir("./themes") if os.path.isfile(os.path.join("./themes", f))]
|
koboldai_vars.theme_list = [".".join(f.split(".")[:-1]) for f in os.listdir("./themes") if os.path.isfile(os.path.join("./themes", f))]
|
||||||
|
|
||||||
|
#==================================================================#
|
||||||
|
# Save Tweaks
|
||||||
|
#==================================================================#
|
||||||
|
@socketio.on('save_tweaks')
|
||||||
|
def UI_2_save_tweaks(data):
|
||||||
|
with open("./settings/tweaks.settings", "w") as f:
|
||||||
|
f.write(data)
|
||||||
|
|
||||||
|
#==================================================================#
|
||||||
|
# Load Tweaks
|
||||||
|
#==================================================================#
|
||||||
|
def UI_2_load_tweaks():
|
||||||
|
if os.path.exists("./settings/tweaks.settings"):
|
||||||
|
with open("./settings/tweaks.settings", "r") as f:
|
||||||
|
socketio.emit('load_tweaks', f.read(), room="UI2")
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
# Test
|
# Test
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
|
@@ -3356,6 +3356,9 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
setCookie("enabledTweaks", JSON.stringify(out));
|
setCookie("enabledTweaks", JSON.stringify(out));
|
||||||
|
if (document.getElementById("on_colab").textContent == "true") {
|
||||||
|
socket.emit("save_tweaks", JSON.stringify(out));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<span class="hidden var_sync_system_on_colab" id="on_colab">false</span>
|
||||||
<!------------ Left Flyout Menu--------------------->
|
<!------------ Left Flyout Menu--------------------->
|
||||||
<div id="SideMenu" class="SideMenu pinned">
|
<div id="SideMenu" class="SideMenu pinned">
|
||||||
<!------------ Menu Pin --------------------->
|
<!------------ Menu Pin --------------------->
|
||||||
|
@@ -65,8 +65,8 @@
|
|||||||
The story name you have entered already exists. Would you like to overwrite?
|
The story name you have entered already exists. Would you like to overwrite?
|
||||||
</div>
|
</div>
|
||||||
<div class="popup_load_cancel">
|
<div class="popup_load_cancel">
|
||||||
<button type="button" class="btn btn-primary" onclick='socket.emit("save_story", "overwrite"); document.getElementById("save-confirm").classList.add("hidden");'>Overwrite</button>
|
<button type="button" class="btn btn-primary popup_load_cancel_button" onclick='socket.emit("save_story", "overwrite"); document.getElementById("save-confirm").classList.add("hidden");'>Overwrite</button>
|
||||||
<button type="button" class="btn btn-primary" onclick="document.getElementById('save-confirm').classList.add('hidden');">Cancel</button>
|
<button type="button" class="btn btn-primary popup_load_cancel_button" onclick="document.getElementById('save-confirm').classList.add('hidden');">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!---------------- Import aidg.club Prompt ---------------------->
|
<!---------------- Import aidg.club Prompt ---------------------->
|
||||||
@@ -81,8 +81,8 @@
|
|||||||
<input autocomplete="off" class="form-control" type="text" placeholder="Prompt Number (4-digit number at the end of aetherroom.club URL)" id="aidgpromptnum">
|
<input autocomplete="off" class="form-control" type="text" placeholder="Prompt Number (4-digit number at the end of aetherroom.club URL)" id="aidgpromptnum">
|
||||||
</div>
|
</div>
|
||||||
<div class="popup_load_cancel">
|
<div class="popup_load_cancel">
|
||||||
<button type="button" class="btn btn-primary" onclick="socket.emit('load_aidg_club', document.getElementById('aidgpromptnum').value); this.parentElement.parentElement.classList.add('hidden');">Accept</button>
|
<button type="button" class="btn btn-primary popup_load_cancel_button" onclick="socket.emit('load_aidg_club', document.getElementById('aidgpromptnum').value); this.parentElement.parentElement.classList.add('hidden');">Accept</button>
|
||||||
<button type="button" class="btn btn-primary" onclick="this.parentElement.parentElement.classList.add('hidden');">Cancel</button>
|
<button type="button" class="btn btn-primary popup_load_cancel_button" onclick="this.parentElement.parentElement.classList.add('hidden');">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="popup_load_cancel">
|
<div class="popup_load_cancel">
|
||||||
<button type="button" class="btn btn-primary" onclick="document.getElementById('error_message').classList.add('hidden');">Ok</button>
|
<button type="button" class="btn btn-primary popup_load_cancel_button" onclick="document.getElementById('error_message').classList.add('hidden');">Ok</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!---------------- Advanced Theme Editor ---------------------->
|
<!---------------- Advanced Theme Editor ---------------------->
|
||||||
|
Reference in New Issue
Block a user