2019-07-19 16:07:26 +02:00
|
|
|
<template>
|
2021-06-11 18:18:07 +02:00
|
|
|
<div id="dashy">
|
|
|
|
<LoadingScreen :isLoading="isLoading" v-if="shouldShowSplash()" />
|
2021-05-18 16:22:11 +02:00
|
|
|
<Header :pageInfo="pageInfo" />
|
2021-04-05 15:06:39 +02:00
|
|
|
<router-view />
|
2021-05-04 20:43:42 +02:00
|
|
|
<Footer v-if="showFooter" :text="getFooterText()" />
|
2019-07-19 16:07:26 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
2019-07-20 22:50:29 +02:00
|
|
|
<script>
|
|
|
|
|
2021-04-13 13:36:31 +02:00
|
|
|
import Header from '@/components/PageStrcture/Header.vue';
|
|
|
|
import Footer from '@/components/PageStrcture/Footer.vue';
|
2021-06-11 18:18:07 +02:00
|
|
|
import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue';
|
|
|
|
import Defaults, { localStorageKeys, splashScreenTime } from '@/utils/defaults';
|
2021-06-14 21:44:07 +02:00
|
|
|
import { config, appConfig, pageInfo } from '@/utils/ConfigAccumalator';
|
2019-07-20 22:50:29 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'app',
|
|
|
|
components: {
|
2021-04-05 15:06:39 +02:00
|
|
|
Header,
|
2019-09-01 14:38:13 +02:00
|
|
|
Footer,
|
2021-06-11 18:18:07 +02:00
|
|
|
LoadingScreen,
|
|
|
|
},
|
2021-06-14 21:44:07 +02:00
|
|
|
provide: {
|
|
|
|
config,
|
|
|
|
},
|
2021-06-11 18:18:07 +02:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showFooter: Defaults.visibleComponents.footer,
|
|
|
|
isLoading: true,
|
2021-06-14 21:44:07 +02:00
|
|
|
appConfig,
|
|
|
|
pageInfo,
|
2021-06-11 18:18:07 +02:00
|
|
|
};
|
2019-09-01 14:38:13 +02:00
|
|
|
},
|
2021-04-05 15:06:39 +02:00
|
|
|
methods: {
|
2021-05-04 20:43:42 +02:00
|
|
|
getFooterText() {
|
|
|
|
if (this.pageInfo && this.pageInfo.footerText) {
|
|
|
|
return this.pageInfo.footerText;
|
|
|
|
}
|
|
|
|
return '';
|
|
|
|
},
|
2021-05-31 16:17:54 +02:00
|
|
|
injectCustomStyles(usersCss) {
|
|
|
|
const style = document.createElement('style');
|
|
|
|
style.textContent = usersCss;
|
|
|
|
document.head.append(style);
|
|
|
|
},
|
2021-06-11 18:18:07 +02:00
|
|
|
shouldShowSplash() {
|
|
|
|
return this.appConfig.showSplashScreen || !localStorage[localStorageKeys.HIDE_WELCOME_BANNER];
|
|
|
|
},
|
|
|
|
hideSplash() {
|
|
|
|
if (this.shouldShowSplash()) {
|
|
|
|
setTimeout(() => { this.isLoading = false; }, splashScreenTime || 2000);
|
|
|
|
} else {
|
|
|
|
this.isLoading = false;
|
|
|
|
}
|
|
|
|
},
|
2021-05-31 16:17:54 +02:00
|
|
|
},
|
|
|
|
mounted() {
|
2021-06-11 18:18:07 +02:00
|
|
|
this.hideSplash();
|
2021-05-31 16:17:54 +02:00
|
|
|
if (this.appConfig.customCss) {
|
|
|
|
const cleanedCss = this.appConfig.customCss.replace(/<\/?[^>]+(>|$)/g, '');
|
|
|
|
this.injectCustomStyles(cleanedCss);
|
|
|
|
}
|
2021-04-05 15:06:39 +02:00
|
|
|
},
|
2019-09-01 14:38:13 +02:00
|
|
|
};
|
2019-07-20 22:50:29 +02:00
|
|
|
</script>
|
2019-07-19 16:07:26 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
2021-04-15 20:30:30 +02:00
|
|
|
@import '@/styles/global-styles.scss';
|
|
|
|
@import '@/styles/color-palette.scss';
|
2021-06-17 23:59:56 +02:00
|
|
|
@import '@/styles/dimensions.scss';
|
2021-04-15 20:30:30 +02:00
|
|
|
@import '@/styles/color-themes.scss';
|
2021-06-01 23:44:59 +02:00
|
|
|
@import '@/styles/typography.scss';
|
2019-07-20 22:50:29 +02:00
|
|
|
|
2021-03-01 19:44:57 +01:00
|
|
|
body {
|
2021-04-08 21:12:35 +02:00
|
|
|
background: var(--background);
|
2021-03-01 19:44:57 +01:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
2019-07-19 16:07:26 +02:00
|
|
|
#app {
|
2019-07-20 22:50:29 +02:00
|
|
|
.footer {
|
|
|
|
text-align: center;
|
2019-07-19 16:07:26 +02:00
|
|
|
}
|
|
|
|
}
|
2019-07-20 22:50:29 +02:00
|
|
|
|
2019-07-19 16:07:26 +02:00
|
|
|
</style>
|