Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

Adds w raw config view

Alicia Sykes6d30b54612f6
diff --git a/src/App.vue b/src/App.vue
index 7a438946..dff0e355 100644
--- a/src/App.vue
+++ b/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();
diff --git a/src/router.js b/src/router.js
index 7921c7ef..84627d02 100644
--- a/src/router.js
+++ b/src/router.js
@@ -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,
+ },
+ },
],
});
diff --git a/src/views/DownloadConfig.vue b/src/views/DownloadConfig.vue
new file mode 100644
index 00000000..9a695052
--- /dev/null
+++ b/src/views/DownloadConfig.vue
@@ -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>