fix: config saving and config loading
Build Release EXE / build-windows-exe (release) Successful in 50s
Build Release EXE / build-windows-exe (release) Successful in 50s
This commit is contained in:
+5
-4
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user