Match Maxi task board to Nexus design
This commit is contained in:
@@ -19,8 +19,8 @@ const adminName = process.env.ADMIN_NAME || "Maxi";
|
||||
const openClawBaseUrl = (process.env.OPENCLAW_BASE_URL || "http://openclaw-gateway-maxi:18790").replace(/\/+$/, "");
|
||||
const openClawToken = process.env.OPENCLAW_GATEWAY_TOKEN || "";
|
||||
|
||||
const states = ["Backlog", "In Progress", "Review", "Done"];
|
||||
const priorities = ["Low", "Normal", "Medium", "High", "Urgent"];
|
||||
const states = ["Backlog", "In progress", "Review", "Done", "Blocked"];
|
||||
const priorities = ["Low", "Medium", "High"];
|
||||
let db;
|
||||
|
||||
function mustEnv(name) {
|
||||
@@ -64,6 +64,14 @@ async function loadDb() {
|
||||
await mkdir(dataDir, { recursive: true });
|
||||
if (existsSync(dbPath)) {
|
||||
db = JSON.parse(await readFile(dbPath, "utf8"));
|
||||
db.settings = { openClawBaseUrl, defaultAssignee: "bao", timezone: "Europe/Berlin", ...(db.settings || {}) };
|
||||
if (!db.settings.defaultAssignee || db.settings.defaultAssignee.toLowerCase() === "luna") db.settings.defaultAssignee = "bao";
|
||||
for (const task of db.tasks || []) {
|
||||
if (task.state === "In Progress") task.state = "In progress";
|
||||
if (task.priority === "Normal" || task.priority === "Urgent") task.priority = task.priority === "Urgent" ? "High" : "Medium";
|
||||
if (!task.assignee || task.assignee.toLowerCase() === "luna") task.assignee = "bao";
|
||||
}
|
||||
await saveDb();
|
||||
} else {
|
||||
db = {
|
||||
users: [{
|
||||
@@ -77,7 +85,7 @@ async function loadDb() {
|
||||
tasks: seedTasks(),
|
||||
settings: {
|
||||
openClawBaseUrl,
|
||||
defaultAssignee: "luna",
|
||||
defaultAssignee: "bao",
|
||||
timezone: "Europe/Berlin"
|
||||
}
|
||||
};
|
||||
@@ -94,7 +102,7 @@ function seedTasks() {
|
||||
detail: "Login, Board und Einstellungen pruefen; OpenClaw-Verbindung muss auf Maxis Gateway zeigen.",
|
||||
state: "Review",
|
||||
priority: "High",
|
||||
assignee: "luna",
|
||||
assignee: "bao",
|
||||
createdAt: now,
|
||||
updatedAt: now
|
||||
},
|
||||
@@ -103,8 +111,8 @@ function seedTasks() {
|
||||
title: "Erste Maxi-Aufgaben sammeln",
|
||||
detail: "Backlog als Eingang fuer Maxis operative Aufgaben nutzen.",
|
||||
state: "Backlog",
|
||||
priority: "Normal",
|
||||
assignee: "luna",
|
||||
priority: "Medium",
|
||||
assignee: "bao",
|
||||
createdAt: now,
|
||||
updatedAt: now
|
||||
}
|
||||
@@ -243,8 +251,8 @@ async function handleApi(req, res) {
|
||||
title,
|
||||
detail: String(body.detail || "").trim(),
|
||||
state: states.includes(body.state) ? body.state : "Backlog",
|
||||
priority: priorities.includes(body.priority) ? body.priority : "Normal",
|
||||
assignee: String(body.assignee || db.settings.defaultAssignee || "luna").trim(),
|
||||
priority: priorities.includes(body.priority) ? body.priority : "Medium",
|
||||
assignee: String(body.assignee || db.settings.defaultAssignee || "bao").trim(),
|
||||
createdAt: now,
|
||||
updatedAt: now
|
||||
};
|
||||
@@ -288,7 +296,7 @@ async function handleApi(req, res) {
|
||||
|
||||
if (url.pathname === "/api/settings" && req.method === "PATCH") {
|
||||
const body = await readJson(req);
|
||||
if (typeof body.defaultAssignee === "string") db.settings.defaultAssignee = body.defaultAssignee.trim() || "luna";
|
||||
if (typeof body.defaultAssignee === "string") db.settings.defaultAssignee = body.defaultAssignee.trim() || "bao";
|
||||
if (typeof body.timezone === "string") db.settings.timezone = body.timezone.trim() || "Europe/Berlin";
|
||||
await saveDb();
|
||||
send(res, 200, { settings: db.settings, openClaw: await openClawStatus() });
|
||||
@@ -317,7 +325,7 @@ async function serveStatic(req, res) {
|
||||
const file = await readFile(filePath);
|
||||
const ext = path.extname(filePath);
|
||||
const type = ext === ".html" ? "text/html; charset=utf-8" : ext === ".css" ? "text/css; charset=utf-8" : ext === ".js" ? "text/javascript; charset=utf-8" : "application/octet-stream";
|
||||
send(res, 200, file, { "content-type": type, "cache-control": "no-store, no-cache, must-revalidate, proxy-revalidate" });
|
||||
send(res, 200, file, { "content-type": type, "cache-control": ext === ".html" ? "no-store" : "public, max-age=3600" });
|
||||
} catch {
|
||||
const file = await readFile(path.join(publicDir, "index.html"));
|
||||
send(res, 200, file, { "content-type": "text/html; charset=utf-8" });
|
||||
|
||||
Reference in New Issue
Block a user