diff --git a/public/app.js b/public/app.js
index a0bfbca..90a600d 100644
--- a/public/app.js
+++ b/public/app.js
@@ -8,8 +8,7 @@ const columns = [
const states = columns.map((column) => column.state);
const priorities = ["High", "Medium", "Low"];
const assignees = [
- { value: "bao", label: "Bao" },
- { value: "iris", label: "Iris" },
+ { value: "luna", label: "Luna" },
{ value: "maxi", label: "Maxi" }
];
@@ -24,6 +23,7 @@ const state = {
selectedTaskId: null,
draggedTaskId: null,
dragOverKey: null,
+ toast: null,
error: ""
};
@@ -103,7 +103,7 @@ function normalizeTask(task) {
...task,
state: task.state === "In Progress" ? "In progress" : task.state,
priority: task.priority === "Normal" ? "Medium" : task.priority === "Urgent" ? "High" : task.priority,
- assignee: task.assignee || "bao"
+ assignee: normalizeAssignee(task.assignee)
};
}
@@ -139,6 +139,7 @@ function renderApp() {
${state.view === "settings" ? settingsView() : boardView()}
+ ${toastView()}
${createModal()}
${detailModal()}
`;
@@ -153,11 +154,13 @@ function renderApp() {
document.querySelector("#logout").addEventListener("click", async () => {
await api("/api/logout", { method: "POST" });
state.user = null;
+ state.toast = null;
renderLogin();
});
document.querySelector("#refresh-board").addEventListener("click", async () => {
await Promise.all([loadTasks(), loadSettings()]);
renderApp();
+ showToast("Aktualisiert");
});
if (state.view === "board") bindBoard();
if (state.view === "settings") bindSettings();
@@ -228,7 +231,7 @@ function createModal() {
-
+
@@ -264,7 +267,7 @@ function detailModal() {
-
+
@@ -334,8 +337,10 @@ function bindCreateModal() {
closeModal();
await loadTasks();
renderApp();
+ showToast("Aufgabe erstellt");
} catch (error) {
document.querySelector("#form-error").textContent = error.message;
+ showToast(error.message, "error");
}
});
}
@@ -357,8 +362,10 @@ function bindDetailModal() {
closeModal();
await loadTasks();
renderApp();
+ showToast("Aufgabe gespeichert");
} catch (error) {
document.querySelector("#detail-error").textContent = error.message;
+ showToast(error.message, "error");
}
});
document.querySelector("#delete-detail").addEventListener("click", async () => {
@@ -366,6 +373,7 @@ function bindDetailModal() {
closeModal();
await loadTasks();
renderApp();
+ showToast("Aufgabe geloescht");
});
}
@@ -373,16 +381,18 @@ async function moveTask(id, nextState) {
await api(`/api/tasks/${id}`, { method: "PATCH", body: JSON.stringify({ state: nextState }) });
await loadTasks();
renderApp();
+ showToast(`Status: ${stateLabel(nextState)}`);
}
function settingsView() {
const openClaw = state.openClaw || {};
return `
-
-
MAXISettings
Admin-Konfiguration und Maxi-OpenClaw-Verbindung.
-
-
-
+
+
+
MAXISettings
Admin-Konfiguration und Maxi-OpenClaw-Verbindung.
+
+
+
OPENCLAW${openClaw.ok ? "Live" : "Check"}
Gateway
@@ -392,12 +402,13 @@ function settingsView() {
BOARD
-
+
+
`;
}
@@ -405,6 +416,7 @@ function bindSettings() {
document.querySelector("#refresh-settings").addEventListener("click", async () => {
await loadSettings();
renderApp();
+ showToast("Settings aktualisiert");
});
document.querySelector("#settings-form").addEventListener("submit", async (event) => {
event.preventDefault();
@@ -412,6 +424,7 @@ function bindSettings() {
await api("/api/settings", { method: "PATCH", body: JSON.stringify(data) });
await loadSettings();
renderApp();
+ showToast("Settings gespeichert");
});
}
@@ -434,15 +447,35 @@ function priorityColor(priority) {
}
function assigneeLabel(assignee) {
- const match = assignees.find((item) => item.value === String(assignee || "").toLowerCase());
- return match?.label || escapeHtml(assignee || "Bao");
+ const match = assignees.find((item) => item.value === normalizeAssignee(assignee));
+ return match?.label || "Luna";
}
function assigneeClass(assignee) {
+ return normalizeAssignee(assignee) === "maxi" ? "assignee-maxi" : "assignee-luna";
+}
+
+function normalizeAssignee(assignee) {
const lower = String(assignee || "").toLowerCase();
- if (lower === "iris") return "assignee-iris";
- if (lower === "bao") return "assignee-bao";
- return "assignee-agent";
+ return lower === "maxi" ? "maxi" : "luna";
+}
+
+function toastView() {
+ if (!state.toast) return "";
+ return `${escapeHtml(state.toast.message)}
`;
+}
+
+function showToast(message, type = "success") {
+ state.toast = { message, type, id: Date.now() };
+ const toastId = state.toast.id;
+ renderApp();
+ window.clearTimeout(showToast.timer);
+ showToast.timer = window.setTimeout(() => {
+ if (state.toast?.id === toastId) {
+ state.toast = null;
+ renderApp();
+ }
+ }, 2600);
}
function stateLabel(value) {
diff --git a/public/index.html b/public/index.html
index 08234fd..841696c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -4,10 +4,10 @@
Maxi Mission Control
-
+
-
+