π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
:sparkles: Make homepage render users chosen start page
Alicia Sykes02fcc5a059e4
diff --git a/src/router.js b/src/router.jsindex 72d3ebac..9331226f 100644--- a/src/router.js+++ b/src/router.js@@ -1,16 +1,24 @@+/**+ * This is the router config, which defined the location for+ * each page within the app, and how they should be loaded+ * Note that the page paths are defined in @/utils/defaults.js+ */+// Import Vue.js and vue routerimport Vue from 'vue';import Router from 'vue-router';+// Import viewsimport Home from '@/views/Home.vue';import Login from '@/views/Login.vue';import Workspace from '@/views/Workspace.vue';import Minimal from '@/views/Minimal.vue';import DownloadConfig from '@/views/DownloadConfig.vue';+// Import helper functions, config data and defaultsimport { isLoggedIn } from '@/utils/Auth';import { config } from '@/utils/ConfigHelpers';-import { metaTagData } from '@/utils/defaults';+import { metaTagData, startingView, routePaths } from '@/utils/defaults';Vue.use(Router);@@ -25,7 +33,7 @@ const isAuthenticated = () => {};/* Get the users chosen starting view from app config, or return default */-const getStartingView = () => config.appConfig.startingView || 'default';+const getStartingView = () => config.appConfig.startingView || startingView;/*** Returns the component that should be rendered at the base path,@@ -58,28 +66,28 @@ const router = new Router({meta: makeMetaTags('Home Page'),},{ // Default home page- path: '/home',+ path: routePaths.home,name: 'home',component: Home,props: config,meta: makeMetaTags('Home Page'),},{ // Workspace view page- path: '/workspace',+ path: routePaths.workspace,name: 'workspace',component: Workspace,props: config,meta: makeMetaTags('Workspace'),},{ // Minimal view page- path: '/minimal',+ path: routePaths.minimal,name: 'minimal',component: Minimal,props: config,meta: makeMetaTags('Start Page'),},{ // The login page- path: '/login',+ path: routePaths.login,name: 'login',component: Login,props: {@@ -91,13 +99,13 @@ const router = new Router({},},{ // The about app page- path: '/about',+ path: routePaths.about,name: 'about',component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),meta: makeMetaTags('About Dashy'),},{ // The export config page- path: '/download',+ path: routePaths.download,name: 'download',component: DownloadConfig,props: config,diff --git a/src/utils/defaults.js b/src/utils/defaults.jsindex 78ce5623..080a43f8 100644--- a/src/utils/defaults.js+++ b/src/utils/defaults.js@@ -13,6 +13,8 @@ module.exports = {appConfig: {},/* Default language code */language: 'en',+ /* The page to use as the starting homepage */+ startingView: 'default',/* Default icon size to be applied on initial load */iconSize: 'medium',/* Default layout to be applied on initial load */@@ -23,6 +25,15 @@ module.exports = {fontAwesomeKey: '0821c65656',/* Default API to use for fetching of user service favicon icons (if enabled) */faviconApi: 'faviconkit',+ /* The page paths for each route within the app for the router */+ routePaths: {+ home: '/home',+ minimal: '/minimal',+ workspace: '/workspace',+ about: '/about',+ login: '/login',+ download: '/download',+ },/* List of built-in themes, to be displayed within the theme-switcher dropdown */builtInThemes: ['callisto',@@ -62,6 +73,8 @@ module.exports = {hideFurnitureOn: ['minimal','login',+ 'download',+ 'landing-page-minimal',],/* Key names for local storage identifiers */localStorageKeys: {