summaryrefslogtreecommitdiff
path: root/src/views/_sila/Overview/DateTime/DateTime.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/_sila/Overview/DateTime/DateTime.vue')
-rw-r--r--src/views/_sila/Overview/DateTime/DateTime.vue39
1 files changed, 12 insertions, 27 deletions
diff --git a/src/views/_sila/Overview/DateTime/DateTime.vue b/src/views/_sila/Overview/DateTime/DateTime.vue
index 4440cd4a..e4bc89b7 100644
--- a/src/views/_sila/Overview/DateTime/DateTime.vue
+++ b/src/views/_sila/Overview/DateTime/DateTime.vue
@@ -42,7 +42,7 @@
v-model="form.configurationSelected"
value="manual"
data-test-id="dateTime-radio-configureManual"
- :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
+ :disabled="isNotAdmin"
>
{{ $t('pageDateTime.form.manual') }}
</b-form-radio>
@@ -57,10 +57,7 @@
id="input-manual-date"
v-model="form.manual.date"
:state="getValidationState($v.form.manual.date)"
- :disabled="
- ntpOptionSelected ||
- $store.getters['authentication/role'] === 'ReadOnly'
- "
+ :disabled="ntpOptionSelected || isNotAdmin"
placeholder="YYYY-MM-DD"
data-test-id="dateTime-input-manualDate"
class="form-control-with-button"
@@ -85,10 +82,7 @@
$t('global.calendar.useCursorKeysToNavigateCalendarDates')
"
:title="$t('global.calendar.selectDate')"
- :disabled="
- ntpOptionSelected ||
- $store.getters['authentication/role'] === 'ReadOnly'
- "
+ :disabled="ntpOptionSelected || isNotAdmin"
button-variant="link"
aria-controls="input-manual-date"
>
@@ -112,10 +106,7 @@
id="input-manual-time"
v-model="form.manual.time"
:state="getValidationState($v.form.manual.time)"
- :disabled="
- ntpOptionSelected ||
- $store.getters['authentication/role'] === 'ReadOnly'
- "
+ :disabled="ntpOptionSelected || isNotAdmin"
placeholder="HH:MM"
data-test-id="dateTime-input-manualTime"
@blur="$v.form.manual.time.$touch()"
@@ -136,7 +127,7 @@
v-model="form.configurationSelected"
value="ntp"
data-test-id="dateTime-radio-configureNTP"
- :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
+ :disabled="isNotAdmin"
>
NTP
</b-form-radio>
@@ -151,10 +142,7 @@
id="input-ntp-1"
v-model="form.ntp.firstAddress"
:state="getValidationState($v.form.ntp.firstAddress)"
- :disabled="
- manualOptionSelected ||
- $store.getters['authentication/role'] === 'ReadOnly'
- "
+ :disabled="manualOptionSelected || isNotAdmin"
data-test-id="dateTime-input-ntpServer1"
@blur="$v.form.ntp.firstAddress.$touch()"
/>
@@ -179,10 +167,7 @@
id="input-ntp-2"
v-model="form.ntp.secondAddress"
:state="getValidationState($v.form.ntp.secondAddress)"
- :disabled="
- manualOptionSelected ||
- $store.getters['authentication/role'] === 'ReadOnly'
- "
+ :disabled="manualOptionSelected || isNotAdmin"
data-test-id="dateTime-input-ntpServer2"
@blur="$v.form.ntp.secondAddress.$touch()"
/>
@@ -204,10 +189,7 @@
id="input-ntp-3"
v-model="form.ntp.thirdAddress"
:state="getValidationState($v.form.ntp.thirdAddress)"
- :disabled="
- manualOptionSelected ||
- $store.getters['authentication/role'] === 'ReadOnly'
- "
+ :disabled="manualOptionSelected || isNotAdmin"
data-test-id="dateTime-input-ntpServer3"
@blur="$v.form.ntp.thirdAddress.$touch()"
/>
@@ -224,7 +206,7 @@
variant="primary"
type="submit"
data-test-id="dateTime-button-saveSettings"
- :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
+ :disabled="isNotAdmin"
>
{{ $t('global.action.saveSettings') }}
</b-button>
@@ -318,6 +300,9 @@ export default {
},
computed: {
...mapState('dateTime', ['ntpServers', 'isNtpProtocolEnabled']),
+ isNotAdmin() {
+ return this.$store.getters['authentication/role'] === 'ReadOnly';
+ },
bmcTime() {
return this.$store.getters['global/bmcTime'];
},