ui tweaks
This commit is contained in:
+1
-1
@@ -117,7 +117,7 @@ export const UI_STYLES = {
|
||||
|
||||
export const TIMEOUTS = {
|
||||
DEFAULT_FETCH: 5000, // ms for general API calls
|
||||
STATUS_CHECK: 500, // ms for status checks
|
||||
STATUS_CHECK: 1200, // ms for status checks
|
||||
LAUNCH: 90000, // ms for worker launch (longer for model loading)
|
||||
RETRY_DELAY: 1000, // initial delay for exponential backoff
|
||||
MAX_RETRIES: 3, // max retry attempts
|
||||
|
||||
@@ -173,7 +173,7 @@ export async function renderSidebarContent(extension, el) {
|
||||
|
||||
// Collapsible settings content
|
||||
const settingsContent = document.createElement("div");
|
||||
settingsContent.style.cssText = "max-height: 0; overflow: hidden; transition: max-height 0.3s ease;";
|
||||
settingsContent.style.cssText = "max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s ease, opacity 0.3s ease;";
|
||||
|
||||
const settingsDiv = document.createElement("div");
|
||||
settingsDiv.style.cssText = "display: flex; flex-direction: column; gap: 8px; padding-top: 10px;";
|
||||
@@ -184,9 +184,11 @@ export async function renderSidebarContent(extension, el) {
|
||||
settingsExpanded = !settingsExpanded;
|
||||
if (settingsExpanded) {
|
||||
settingsContent.style.maxHeight = "200px";
|
||||
settingsContent.style.opacity = "1";
|
||||
workerSettingsToggle.style.transform = "rotate(90deg)";
|
||||
} else {
|
||||
settingsContent.style.maxHeight = "0";
|
||||
settingsContent.style.opacity = "0";
|
||||
workerSettingsToggle.style.transform = "rotate(0deg)";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -821,17 +821,42 @@ export class DistributedUI {
|
||||
if (!extension.config.master) extension.config.master = {};
|
||||
extension.config.master.name = nameInput.value.trim() || "Master";
|
||||
|
||||
const hostValue = hostInput.value.trim();
|
||||
|
||||
await extension.api.updateMaster({
|
||||
host: hostInput.value.trim(),
|
||||
host: hostValue,
|
||||
name: extension.config.master.name
|
||||
});
|
||||
|
||||
// Reload config to refresh any updated values
|
||||
await extension.loadConfig();
|
||||
|
||||
// If host was emptied, trigger auto-detection
|
||||
if (!hostValue) {
|
||||
extension.log("Host field cleared, triggering IP auto-detection", "debug");
|
||||
await extension.detectMasterIP();
|
||||
// Reload config again to get the auto-detected IP
|
||||
await extension.loadConfig();
|
||||
// Update the input field with the detected IP
|
||||
document.getElementById('master-host').value = extension.config?.master?.host || "";
|
||||
}
|
||||
|
||||
document.getElementById('master-name-display').textContent = extension.config.master.name;
|
||||
this.updateMasterDisplay(extension);
|
||||
|
||||
// Show toast notification
|
||||
if (extension.app?.extensionManager?.toast) {
|
||||
const message = !hostValue ?
|
||||
"Master settings saved and IP auto-detected" :
|
||||
"Master settings saved successfully";
|
||||
extension.app.extensionManager.toast.add({
|
||||
severity: "success",
|
||||
summary: "Master Updated",
|
||||
detail: message,
|
||||
life: 3000
|
||||
});
|
||||
}
|
||||
|
||||
saveBtn.textContent = "Saved!";
|
||||
setTimeout(() => { saveBtn.textContent = "Save"; }, TIMEOUTS.FLASH_LONG);
|
||||
}, "background-color: #4a7c4a;");
|
||||
|
||||
Reference in New Issue
Block a user