mirror of
https://github.com/Lissy93/dashy.git
synced 2024-11-27 10:26:00 +03:00
✨ Make homepage render users chosen start page
This commit is contained in:
parent
c92f578bb0
commit
02fcc5a059
@ -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 router
|
// Import Vue.js and vue router
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import Router from 'vue-router';
|
import Router from 'vue-router';
|
||||||
|
|
||||||
// Import views
|
// Import views
|
||||||
import Home from '@/views/Home.vue';
|
import Home from '@/views/Home.vue';
|
||||||
import Login from '@/views/Login.vue';
|
import Login from '@/views/Login.vue';
|
||||||
import Workspace from '@/views/Workspace.vue';
|
import Workspace from '@/views/Workspace.vue';
|
||||||
import Minimal from '@/views/Minimal.vue';
|
import Minimal from '@/views/Minimal.vue';
|
||||||
import DownloadConfig from '@/views/DownloadConfig.vue';
|
import DownloadConfig from '@/views/DownloadConfig.vue';
|
||||||
|
|
||||||
// Import helper functions, config data and defaults
|
// Import helper functions, config data and defaults
|
||||||
import { isLoggedIn } from '@/utils/Auth';
|
import { isLoggedIn } from '@/utils/Auth';
|
||||||
import { config } from '@/utils/ConfigHelpers';
|
import { config } from '@/utils/ConfigHelpers';
|
||||||
import { metaTagData } from '@/utils/defaults';
|
import { metaTagData, startingView, routePaths } from '@/utils/defaults';
|
||||||
|
|
||||||
Vue.use(Router);
|
Vue.use(Router);
|
||||||
|
|
||||||
@ -25,7 +33,7 @@ const isAuthenticated = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Get the users chosen starting view from app config, or return default */
|
/* 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,
|
* Returns the component that should be rendered at the base path,
|
||||||
@ -58,28 +66,28 @@ const router = new Router({
|
|||||||
meta: makeMetaTags('Home Page'),
|
meta: makeMetaTags('Home Page'),
|
||||||
},
|
},
|
||||||
{ // Default home page
|
{ // Default home page
|
||||||
path: '/home',
|
path: routePaths.home,
|
||||||
name: 'home',
|
name: 'home',
|
||||||
component: Home,
|
component: Home,
|
||||||
props: config,
|
props: config,
|
||||||
meta: makeMetaTags('Home Page'),
|
meta: makeMetaTags('Home Page'),
|
||||||
},
|
},
|
||||||
{ // Workspace view page
|
{ // Workspace view page
|
||||||
path: '/workspace',
|
path: routePaths.workspace,
|
||||||
name: 'workspace',
|
name: 'workspace',
|
||||||
component: Workspace,
|
component: Workspace,
|
||||||
props: config,
|
props: config,
|
||||||
meta: makeMetaTags('Workspace'),
|
meta: makeMetaTags('Workspace'),
|
||||||
},
|
},
|
||||||
{ // Minimal view page
|
{ // Minimal view page
|
||||||
path: '/minimal',
|
path: routePaths.minimal,
|
||||||
name: 'minimal',
|
name: 'minimal',
|
||||||
component: Minimal,
|
component: Minimal,
|
||||||
props: config,
|
props: config,
|
||||||
meta: makeMetaTags('Start Page'),
|
meta: makeMetaTags('Start Page'),
|
||||||
},
|
},
|
||||||
{ // The login page
|
{ // The login page
|
||||||
path: '/login',
|
path: routePaths.login,
|
||||||
name: 'login',
|
name: 'login',
|
||||||
component: Login,
|
component: Login,
|
||||||
props: {
|
props: {
|
||||||
@ -91,13 +99,13 @@ const router = new Router({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ // The about app page
|
{ // The about app page
|
||||||
path: '/about',
|
path: routePaths.about,
|
||||||
name: 'about',
|
name: 'about',
|
||||||
component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
|
component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
|
||||||
meta: makeMetaTags('About Dashy'),
|
meta: makeMetaTags('About Dashy'),
|
||||||
},
|
},
|
||||||
{ // The export config page
|
{ // The export config page
|
||||||
path: '/download',
|
path: routePaths.download,
|
||||||
name: 'download',
|
name: 'download',
|
||||||
component: DownloadConfig,
|
component: DownloadConfig,
|
||||||
props: config,
|
props: config,
|
||||||
|
@ -13,6 +13,8 @@ module.exports = {
|
|||||||
appConfig: {},
|
appConfig: {},
|
||||||
/* Default language code */
|
/* Default language code */
|
||||||
language: 'en',
|
language: 'en',
|
||||||
|
/* The page to use as the starting homepage */
|
||||||
|
startingView: 'default',
|
||||||
/* Default icon size to be applied on initial load */
|
/* Default icon size to be applied on initial load */
|
||||||
iconSize: 'medium',
|
iconSize: 'medium',
|
||||||
/* Default layout to be applied on initial load */
|
/* Default layout to be applied on initial load */
|
||||||
@ -23,6 +25,15 @@ module.exports = {
|
|||||||
fontAwesomeKey: '0821c65656',
|
fontAwesomeKey: '0821c65656',
|
||||||
/* Default API to use for fetching of user service favicon icons (if enabled) */
|
/* Default API to use for fetching of user service favicon icons (if enabled) */
|
||||||
faviconApi: 'faviconkit',
|
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 */
|
/* List of built-in themes, to be displayed within the theme-switcher dropdown */
|
||||||
builtInThemes: [
|
builtInThemes: [
|
||||||
'callisto',
|
'callisto',
|
||||||
@ -62,6 +73,8 @@ module.exports = {
|
|||||||
hideFurnitureOn: [
|
hideFurnitureOn: [
|
||||||
'minimal',
|
'minimal',
|
||||||
'login',
|
'login',
|
||||||
|
'download',
|
||||||
|
'landing-page-minimal',
|
||||||
],
|
],
|
||||||
/* Key names for local storage identifiers */
|
/* Key names for local storage identifiers */
|
||||||
localStorageKeys: {
|
localStorageKeys: {
|
||||||
|
Loading…
Reference in New Issue
Block a user