diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-16 16:53:08 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-16 16:53:08 +0300 |
commit | a72c39d39f2c2fa127139c9e161bacaecbcb5a07 (patch) | |
tree | 2efa43295d0da364f2c23c3286f68dc55f94d0dd /src/views | |
parent | 2cb62b657f9e806bdbeadd50ba932d204f696393 (diff) | |
download | webui-vue-a72c39d39f2c2fa127139c9e161bacaecbcb5a07.tar.xz |
add timeZone select
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/_sila/Overview/DateTime/DateTime.vue | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/views/_sila/Overview/DateTime/DateTime.vue b/src/views/_sila/Overview/DateTime/DateTime.vue index 3437a324..55193d64 100644 --- a/src/views/_sila/Overview/DateTime/DateTime.vue +++ b/src/views/_sila/Overview/DateTime/DateTime.vue @@ -38,6 +38,21 @@ :disabled="loading" label-sr-only > + <b-row class="mt-3 ml-3"> + <b-col sm="6" lg="4" xl="3"> + <b-form-group + :label="$t('pageDateTime.timezone')" + label-for="time-zone-select" + > + <b-form-select + id="time-zone-select" + v-model="timeZone" + :options="timeZones()" + > + </b-form-select> + </b-form-group> + </b-col> + </b-row> <b-form-radio v-model="form.configurationSelected" value="manual" @@ -252,6 +267,8 @@ export default { }, data() { return { + timeZone: null, + timeZoneOptions: null, locale: this.$store.getters['global/languagePreference'], form: { configurationSelected: '', @@ -312,6 +329,9 @@ export default { bmcTime() { return this.$store.getters['global/bmcTime']; }, + storeTimeZone() { + return this.$store.getters['global/timeZone']; + }, ntpOptionSelected() { return this.form.configurationSelected === 'ntp'; }, @@ -344,6 +364,7 @@ export default { this.$store.dispatch('dateTime/getNtpData').finally(() => { this.getNtpValues(); this.getBmcTime(); + this.getTimeZone(); this.endLoader(); this.isBusy = false; }); @@ -356,6 +377,9 @@ export default { manualDate: this.manualDate ? new Date(this.manualDate) : null, }); }, + getTimeZone() { + this.timeZone = this.storeTimeZone; + }, getNtpValues() { this.form.configurationSelected = this.isNtpProtocolEnabled ? 'ntp' @@ -377,6 +401,7 @@ export default { submitForm() { this.$v.$touch(); if (this.$v.$invalid) return; + this.startLoader(); let dateTimeForm = {}; @@ -428,6 +453,7 @@ export default { this.successToast(success); }); } + this.$store.dispatch('global/changeTimeZone', this.timeZone); }) .catch(({ message }) => this.errorToast(message)) .finally(() => { |