]> acesimba.cloud Git - StationBuilder.git/commitdiff
后端sites增加app_name/app_icon/app_icon_filename字段支持
authorroot <root@localhost.localdomain>
Mon, 14 Sep 2026 06:44:42 +0000 (14:44 +0800)
committerroot <root@localhost.localdomain>
Mon, 14 Sep 2026 06:44:42 +0000 (14:44 +0800)
db-sidecar.mjs

index f8732e269a08b18abfa2380808333a4873bfa148..8ae8bff35d87d8660791c0014a2cd45679c48814 100644 (file)
@@ -386,6 +386,9 @@ function ensureColumn(table, column, def) {
 ensureColumn("cubes", "prompt", "TEXT");
 ensureColumn("sites", "style_id", "INTEGER");
 ensureColumn("sites", "parent_id", "INTEGER");
+ensureColumn("sites", "app_name", "TEXT");
+ensureColumn("sites", "app_icon", "TEXT");
+ensureColumn("sites", "app_icon_filename", "TEXT");
 ensureColumn("domain_templates", "supplement", "TEXT");
 ensureColumn("domain_templates", "style_id", "INTEGER");
 ensureColumn("domain_pages", "status", "TEXT DEFAULT 'pending'");
@@ -2648,10 +2651,12 @@ async function route(req, res) {
       }
       if (req.method === "PUT") {
         const body = await parseBody(req);
-        db.prepare("UPDATE sites SET name=?, domain=?, description=?, supplement=?, style_id=?, parent_id=?, updated_at=CURRENT_TIMESTAMP WHERE id=?").run(
+        db.prepare("UPDATE sites SET name=?, domain=?, description=?, supplement=?, style_id=?, parent_id=?, app_name=?, app_icon=?, app_icon_filename=?, updated_at=CURRENT_TIMESTAMP WHERE id=?").run(
           body.name ?? "", body.domain ?? "", body.description ?? "", body.supplement ?? "",
           body.style_id != null ? Number(body.style_id) : null,
-          body.parent_id != null ? Number(body.parent_id) : null, siteId
+          body.parent_id != null ? Number(body.parent_id) : null,
+          body.app_name ?? null, body.app_icon ?? null, body.app_icon_filename ?? null,
+          siteId
         );
         return respondJson(res, 200, hydrateSite(siteId));
       }