mirror of https://github.com/Lissy93/dashy.git
🛂 Prevent download config when (#455)
This commit is contained in:
parent
cfe3a48405
commit
c1607cb19b
|
@ -1,12 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<pre><code>{{ yamlConfig }}</code></pre>
|
<pre v-if="allowViewConfig"><code>{{ yamlConfig }}</code></pre>
|
||||||
|
<AccessError v-else />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import JsYaml from 'js-yaml';
|
import JsYaml from 'js-yaml';
|
||||||
|
import AccessError from '@/components/Configuration/AccessError';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DownloadConfig',
|
name: 'DownloadConfig',
|
||||||
|
components: {
|
||||||
|
AccessError,
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
config() {
|
config() {
|
||||||
return this.$store.state.config;
|
return this.$store.state.config;
|
||||||
|
@ -14,6 +19,9 @@ export default {
|
||||||
yamlConfig() {
|
yamlConfig() {
|
||||||
return JsYaml.dump(this.config);
|
return JsYaml.dump(this.config);
|
||||||
},
|
},
|
||||||
|
allowViewConfig() {
|
||||||
|
return this.$store.getters.permissions.allowViewConfig;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue