2021-06-21 12:07:49 +00:00
|
|
|
<template>
|
2022-02-13 14:10:23 +00:00
|
|
|
<pre v-if="allowViewConfig"><code>{{ yamlConfig }}</code></pre>
|
|
|
|
<AccessError v-else />
|
2021-06-21 12:07:49 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-09 18:27:48 +00:00
|
|
|
import JsYaml from 'js-yaml';
|
2022-02-13 14:10:23 +00:00
|
|
|
import AccessError from '@/components/Configuration/AccessError';
|
2021-06-21 12:07:49 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'DownloadConfig',
|
2022-02-13 14:10:23 +00:00
|
|
|
components: {
|
|
|
|
AccessError,
|
|
|
|
},
|
2021-10-09 18:42:51 +00:00
|
|
|
computed: {
|
|
|
|
config() {
|
|
|
|
return this.$store.state.config;
|
|
|
|
},
|
2022-02-09 18:27:48 +00:00
|
|
|
yamlConfig() {
|
|
|
|
return JsYaml.dump(this.config);
|
|
|
|
},
|
2022-02-13 14:10:23 +00:00
|
|
|
allowViewConfig() {
|
|
|
|
return this.$store.getters.permissions.allowViewConfig;
|
|
|
|
},
|
2021-06-21 12:07:49 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
pre {
|
2022-02-09 18:27:48 +00:00
|
|
|
margin: 0;
|
2021-06-21 12:07:49 +00:00
|
|
|
padding: 1rem;
|
2022-02-09 18:27:48 +00:00
|
|
|
color: var(--code-editor-color);
|
|
|
|
background: var(--code-editor-background);
|
2021-06-21 12:07:49 +00:00
|
|
|
}
|
|
|
|
</style>
|