fix: config saving and config loading
Build Release EXE / build-windows-exe (release) Successful in 50s

This commit is contained in:
2026-05-06 15:18:51 -04:00
parent 11adcc160a
commit 58a57ddc6a
9 changed files with 38 additions and 13 deletions
+5 -4
View File
@@ -416,9 +416,6 @@ function fetchErrorMessage(error) {
}
const configFieldIds = {
ollama_base_url: "config-ollama-base-url",
ollama_model: "config-ollama-model",
ollama_num_ctx: "config-ollama-num-ctx",
uex_base_url: "config-uex-base-url",
uex_secret_key: "config-uex-secret-key",
uex_bearer_token: "config-uex-bearer-token",
@@ -446,11 +443,15 @@ async function refreshConfig() {
function renderConfig(config) {
const values = config.values || {};
const secretsConfigured = config.secrets_configured || {};
for (const [key, id] of Object.entries(configFieldIds)) {
const field = document.getElementById(id);
if (!field) continue;
if (field.type === "checkbox") {
field.checked = Boolean(values[key]);
} else if (field.type === "password") {
field.value = "";
field.placeholder = secretsConfigured[key] ? "Configured" : "";
} else {
field.value = values[key] ?? "";
}
@@ -572,7 +573,7 @@ async function postOllamaAction(endpoint, options = {}) {
}
function configuredOllamaModel() {
return document.getElementById("ollama-model")?.value || document.getElementById("config-ollama-model")?.value || "";
return document.getElementById("ollama-model")?.value || "";
}
async function checkForUpdate() {
-3
View File
@@ -59,9 +59,6 @@
<button class="secondary small-button" id="config-refresh" type="button">Refresh</button>
</div>
<form class="config-form" id="config-form">
<label>Ollama URL<input id="config-ollama-base-url" name="ollama_base_url" type="text"></label>
<label>Ollama Model<input id="config-ollama-model" name="ollama_model" type="text"></label>
<label>Context Tokens<input id="config-ollama-num-ctx" name="ollama_num_ctx" type="number" min="1024" step="1024"></label>
<label>UEX API URL<input id="config-uex-base-url" name="uex_base_url" type="text"></label>
<label>UEX Secret Key<input id="config-uex-secret-key" name="uex_secret_key" type="password" autocomplete="off"></label>
<label>UEX Bearer Token<input id="config-uex-bearer-token" name="uex_bearer_token" type="password" autocomplete="off"></label>