From e94ff4b952160fea9a7dee10cd35b192478801f5 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Tue, 22 Jun 2021 23:06:59 +0100 Subject: [PATCH] :lipstick: Show no-access cursor when rebuild is disallowed by admin --- .../Configuration/ConfigContainer.vue | 4 ++-- src/components/Configuration/RebuildApp.vue | 23 ++++++++++++++++++- src/components/FormElements/Button.vue | 6 ++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/components/Configuration/ConfigContainer.vue b/src/components/Configuration/ConfigContainer.vue index 634e9acf..f33151ab 100644 --- a/src/components/Configuration/ConfigContainer.vue +++ b/src/components/Configuration/ConfigContainer.vue @@ -39,7 +39,7 @@

Dashy version {{ appVersion }}

- It is recommend to make a backup of your conf.yml file, before making any changes. + It is recommend to make a backup of your conf.yml file before making changes.
@@ -129,7 +129,7 @@ export default { this.$refs.tabView.activeTabItem({ tabItem: itemToSelect, byUser: true }); }, goToCustomCss() { - const itemToSelect = this.$refs.tabView.navItems[4]; + const itemToSelect = this.$refs.tabView.navItems[3]; this.$refs.tabView.activeTabItem({ tabItem: itemToSelect, byUser: true }); }, openRebuildAppModal() { diff --git a/src/components/Configuration/RebuildApp.vue b/src/components/Configuration/RebuildApp.vue index 23b582a0..4d1ebcaa 100644 --- a/src/components/Configuration/RebuildApp.vue +++ b/src/components/Configuration/RebuildApp.vue @@ -8,10 +8,13 @@ This should happen automatically, but if it hasn't, you can manually trigger it here.
This is not required for modifications stored locally.

- +
+

You do no have permission to trigger this action

+
@@ -45,6 +48,7 @@ import LoadingAnimation from '@/assets/interface-icons/loader.svg'; export default { name: 'RebuildApp', + inject: ['config'], components: { Button, RebuildIcon, @@ -58,6 +62,7 @@ export default { error: '', output: '', message: '', + allowRebuild: true, }), methods: { startBuild() { @@ -92,6 +97,15 @@ export default { location.reload(); // eslint-disable-line no-restricted-globals }, }, + mounted() { + if (this.config) { + if (this.config.appConfig) { + if (this.config.appConfig.allowConfigEdit === false) { + this.allowRebuild = false; + } + } + } + }, }; @@ -110,6 +124,13 @@ export default { color: var(--config-settings-color); } + p.disallow-rebuild-msg { + color: var(--danger); + font-size: 1.2rem; + margin: 0.2rem auto; + text-align: center; + } + h3.rebuild-app-title { text-align: center; font-size: 2rem; diff --git a/src/components/FormElements/Button.vue b/src/components/FormElements/Button.vue index f6c498f6..2c8f6279 100644 --- a/src/components/FormElements/Button.vue +++ b/src/components/FormElements/Button.vue @@ -1,5 +1,5 @@