diff --git a/public/app.js b/public/app.js index 471cba7..5c1719d 100644 --- a/public/app.js +++ b/public/app.js @@ -1,12 +1,17 @@ -const states = ["Backlog", "In Progress", "Review", "Done"]; -const priorities = ["Low", "Normal", "Medium", "High", "Urgent"]; +const columns = [ + { key: "offen", state: "Backlog", label: "Offen", color: "var(--st-queue)" }, + { key: "inProgress", state: "In progress", label: "In Bearbeitung", color: "var(--st-work)" }, + { key: "review", state: "Review", label: "Review", color: "#fb923c" }, + { key: "done", state: "Done", label: "Erledigt", color: "var(--st-work)" }, + { key: "blocked", state: "Blocked", label: "Blockiert", color: "var(--st-block)", blocked: true } +]; +const states = columns.map((column) => column.state); +const priorities = ["High", "Medium", "Low"]; const assignees = [ { value: "bao", label: "Bao" }, - { value: "maxi", label: "Maxi" }, - { value: "luna", label: "Luna" }, - { value: "iris", label: "Iris" } + { value: "iris", label: "Iris" }, + { value: "maxi", label: "Maxi" } ]; -const createTaskDefaultAssignee = "bao"; const app = document.querySelector("#app"); const state = { @@ -15,6 +20,10 @@ const state = { settings: null, openClaw: null, view: "board", + dialogMode: null, + selectedTaskId: null, + draggedTaskId: null, + dragOverKey: null, error: "" }; @@ -43,17 +52,21 @@ async function init() { function renderLogin() { app.innerHTML = ` - - Maxi Mission Control - Schlanke Kommandozentrale fuer Aufgaben und OpenClaw-Status. - E-Mail - - - Passwort - - - Anmelden - + + + MC + MAXIMission Control + + + AUTHENTIFIZIERUNG + Anmelden + Maxis geschuetzte Kommandozentrale fuer Aufgaben und OpenClaw-Status. + + E-Mail + Passwort + Anmelden + + `; @@ -76,7 +89,7 @@ function renderLogin() { async function loadTasks() { const result = await api("/api/tasks"); - state.tasks = result.tasks; + state.tasks = result.tasks.map(normalizeTask); } async function loadSettings() { @@ -85,28 +98,49 @@ async function loadSettings() { state.openClaw = result.openClaw; } +function normalizeTask(task) { + return { + ...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" + }; +} + function renderApp() { app.innerHTML = ` - +
Schlanke Kommandozentrale fuer Aufgaben und OpenClaw-Status.
Maxis geschuetzte Kommandozentrale fuer Aufgaben und OpenClaw-Status.