diff --git a/server/routers/api-router.js b/server/routers/api-router.js index ed7480d52..9c4240cac 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -1,8 +1,14 @@ let express = require("express"); const { allowDevAllOrigin, getSettings, setting } = require("../util-server"); const { R } = require("redbean-node"); +const server = require("../server"); let router = express.Router(); +router.get("/api/entry-page", async (_, response) => { + allowDevAllOrigin(response); + response.json(server.entryPage); +}); + // Status Page Config router.get("/api/status-page/config", async (_request, response) => { allowDevAllOrigin(response); diff --git a/server/server.js b/server/server.js index 3eb73111f..1b423736a 100644 --- a/server/server.js +++ b/server/server.js @@ -131,10 +131,14 @@ let needSetup = false; */ let indexHTML = fs.readFileSync("./dist/index.html").toString(); +exports.entryPage = "dashboard"; + (async () => { await initDatabase(); - console.log("Adding route") + exports.entryPage = await setting("entryPage"); + + console.log("Adding route"); // *************************** // Normal Router here @@ -846,7 +850,8 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); try { checkLogin(socket) - await setSettings("general", data) + await setSettings("general", data); + exports.entryPage = data.entryPage; callback({ ok: true, diff --git a/src/components/GroupList.vue b/src/components/GroupList.vue index d44aa0761..753a6492a 100644 --- a/src/components/GroupList.vue +++ b/src/components/GroupList.vue @@ -35,7 +35,7 @@