mirror of
https://github.com/Lissy93/dashy.git
synced 2024-11-23 21:23:28 +03:00
Adds w raw config view
This commit is contained in:
parent
7ecb815ec3
commit
6d30b54612
14
src/App.vue
14
src/App.vue
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div id="dashy">
|
||||
<LoadingScreen :isLoading="isLoading" v-if="shouldShowSplash()" />
|
||||
<Header :pageInfo="pageInfo" />
|
||||
<Header :pageInfo="pageInfo" v-if="!shouldHidePageComponents()" />
|
||||
<router-view />
|
||||
<Footer v-if="showFooter" :text="getFooterText()" />
|
||||
<Footer v-if="showFooter && !shouldHidePageComponents()" :text="getFooterText()" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -48,12 +48,20 @@ export default {
|
||||
return this.appConfig.showSplashScreen || !localStorage[localStorageKeys.HIDE_WELCOME_BANNER];
|
||||
},
|
||||
hideSplash() {
|
||||
if (this.shouldShowSplash()) {
|
||||
if (this.shouldShowSplash() && !this.shouldHidePageComponents()) {
|
||||
setTimeout(() => { this.isLoading = false; }, splashScreenTime || 2000);
|
||||
} else {
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
shouldHidePageComponents() {
|
||||
return (['download'].includes(this.$route.name));
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
currentRouteName() {
|
||||
return this.$route.name;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.hideSplash();
|
||||
|
@ -4,6 +4,7 @@ import Router from 'vue-router';
|
||||
import Home from '@/views/Home.vue';
|
||||
import Login from '@/views/Login.vue';
|
||||
import Workspace from '@/views/Workspace.vue';
|
||||
import DownloadConfig from '@/views/DownloadConfig.vue';
|
||||
import { isLoggedIn } from '@/utils/Auth';
|
||||
import { appConfig, pageInfo, sections } from '@/utils/ConfigAccumalator';
|
||||
import { metaTagData } from '@/utils/defaults';
|
||||
@ -58,6 +59,16 @@ const router = new Router({
|
||||
name: 'about',
|
||||
component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
|
||||
},
|
||||
{
|
||||
path: '/download',
|
||||
name: 'download',
|
||||
component: DownloadConfig,
|
||||
props: { appConfig, pageInfo, sections },
|
||||
meta: {
|
||||
title: pageInfo.title || 'Download Dashy Config',
|
||||
metaTags: metaTagData,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
|
35
src/views/DownloadConfig.vue
Normal file
35
src/views/DownloadConfig.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<pre><code>{{ jsonParser(config) }}</code></pre>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JsonToYaml from '@/utils/JsonToYaml';
|
||||
|
||||
export default {
|
||||
name: 'DownloadConfig',
|
||||
props: {
|
||||
sections: Array,
|
||||
appConfig: Object,
|
||||
pageInfo: Object,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
appConfig: this.appConfig,
|
||||
pageInfo: this.pageInfo,
|
||||
sections: this.sections,
|
||||
},
|
||||
jsonParser: JsonToYaml,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
pre {
|
||||
background: var(--code-editor-background);
|
||||
color: var(--code-editor-color);
|
||||
padding: 1rem;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user