diff options
Diffstat (limited to 'src/views/Configuration')
4 files changed, 120 insertions, 120 deletions
diff --git a/src/views/Configuration/DateTimeSettings/DateTimeSettings.vue b/src/views/Configuration/DateTimeSettings/DateTimeSettings.vue index 33e097c4..79cdbc1e 100644 --- a/src/views/Configuration/DateTimeSettings/DateTimeSettings.vue +++ b/src/views/Configuration/DateTimeSettings/DateTimeSettings.vue @@ -84,7 +84,7 @@ button-variant="link" aria-controls="input-manual-date" > - <template v-slot:button-content> + <template #button-content> <icon-calendar :title="$t('global.calendar.openDatePicker')" aria-hidden="true" @@ -227,8 +227,12 @@ export default { BVToastMixin, LoadingBarMixin, LocalTimezoneLabelMixin, - VuelidateMixin + VuelidateMixin, ], + beforeRouteLeave(to, from, next) { + this.hideLoader(); + next(); + }, data() { return { locale: this.$store.getters['global/languagePreference'], @@ -236,10 +240,10 @@ export default { configurationSelected: '', manual: { date: '', - time: '' + time: '', }, - ntp: { firstAddress: '', secondAddress: '', thirdAddress: '' } - } + ntp: { firstAddress: '', secondAddress: '', thirdAddress: '' }, + }, }; }, validations() { @@ -247,28 +251,28 @@ export default { form: { manual: { date: { - required: requiredIf(function() { + required: requiredIf(function () { return this.form.configurationSelected === 'manual'; }), - pattern: helpers.regex('pattern', isoDateRegex) + pattern: helpers.regex('pattern', isoDateRegex), }, time: { - required: requiredIf(function() { + required: requiredIf(function () { return this.form.configurationSelected === 'manual'; }), - pattern: helpers.regex('pattern', isoTimeRegex) - } + pattern: helpers.regex('pattern', isoTimeRegex), + }, }, ntp: { firstAddress: { - required: requiredIf(function() { + required: requiredIf(function () { return this.form.configurationSelected === 'ntp'; - }) + }), }, secondAddress: {}, - thirdAddress: {} - } - } + thirdAddress: {}, + }, + }, }; }, computed: { @@ -284,7 +288,7 @@ export default { return 'UTC'; } return this.localOffset(); - } + }, }, watch: { ntpServers() { @@ -300,25 +304,21 @@ export default { this.form.manual.time = this.$options.filters .formatTime(this.$store.getters['global/bmcTime']) .slice(0, 5); - } + }, }, created() { this.startLoader(); Promise.all([ this.$store.dispatch('global/getBmcTime'), - this.$store.dispatch('dateTime/getNtpData') + this.$store.dispatch('dateTime/getNtpData'), ]).finally(() => this.endLoader()); }, - beforeRouteLeave(to, from, next) { - this.hideLoader(); - next(); - }, methods: { emitChange() { if (this.$v.$invalid) return; this.$v.$reset(); //reset to re-validate on blur this.$emit('change', { - manualDate: this.manualDate ? new Date(this.manualDate) : null + manualDate: this.manualDate ? new Date(this.manualDate) : null, }); }, setNtpValues() { @@ -367,13 +367,13 @@ export default { dateTimeForm.ntpServersArray = [ ntpFirstAddress, ntpSecondAddress, - ntpThirdAddress + ntpThirdAddress, ]; } this.$store .dispatch('dateTime/updateDateTimeSettings', dateTimeForm) - .then(success => { + .then((success) => { this.successToast(success); if (!isNTPEnabled) return; // Shift address up if second address is empty @@ -407,7 +407,7 @@ export default { timeArray[1] // User input minute ); return new Date(utcDate); - } - } + }, + }, }; </script> diff --git a/src/views/Configuration/Firmware/Firmware.vue b/src/views/Configuration/Firmware/Firmware.vue index e1f97c4e..48c29ebc 100644 --- a/src/views/Configuration/Firmware/Firmware.vue +++ b/src/views/Configuration/Firmware/Firmware.vue @@ -8,7 +8,7 @@ <b-card-group deck> <!-- Current FW --> <b-card header-bg-variant="success"> - <template v-slot:header> + <template #header> <dl class="mb-0"> <dt>{{ $t('pageFirmware.current') }}</dt> <dd class="mb-0">{{ bmcFirmwareCurrentVersion }}</dd> @@ -18,12 +18,12 @@ <dt>{{ $t('pageFirmware.state') }}:</dt> <dd>{{ bmcFirmwareCurrentState }}</dd> </dl> - <template v-slot:footer></template> + <template #footer></template> </b-card> <!-- Backup FW --> <b-card footer-class="p-0"> - <template v-slot:header> + <template #header> <dl class="mb-0"> <dt>{{ $t('pageFirmware.backup') }}</dt> <dd class="mb-0">{{ bmcFirmwareBackupVersion }}</dd> @@ -33,7 +33,7 @@ <dt>{{ $t('pageFirmware.state') }}:</dt> <dd>{{ bmcFirmwareBackupState }}</dd> </dl> - <template v-slot:footer> + <template #footer> <b-btn v-b-modal.modal-reboot-backup-bmc :disabled="!bmcFirmwareBackupVersion" @@ -53,7 +53,7 @@ <b-card-group deck> <!-- Current FW --> <b-card header-bg-variant="success"> - <template v-slot:header> + <template #header> <dl class="mb-0"> <dt>{{ $t('pageFirmware.current') }}</dt> <dd class="mb-0">{{ hostFirmwareCurrentVersion }}</dd> @@ -68,7 +68,7 @@ <!-- Backup FW --> <b-card> - <template v-slot:header> + <template #header> <dl class="mb-0"> <dt>{{ $t('pageFirmware.backup') }}</dt> <dd class="mb-0">{{ hostFirmwareBackupVersion }}</dd> @@ -212,16 +212,21 @@ export default { ModalRebootBackupBmc, ModalUpload, PageSection, - PageTitle + PageTitle, }, mixins: [BVToastMixin, LoadingBarMixin, VuelidateMixin], + beforeRouteLeave(to, from, next) { + this.hideLoader(); + this.clearRebootTimeout(); + next(); + }, data() { return { isWorkstationSelected: true, file: null, tftpIpAddress: null, tftpFileName: null, - timeoutId: null + timeoutId: null, }; }, computed: { @@ -233,16 +238,16 @@ export default { 'hostFirmwareCurrentVersion', 'hostFirmwareCurrentState', 'hostFirmwareBackupVersion', - 'hostFirmwareBackupState' - ]) + 'hostFirmwareBackupState', + ]), }, watch: { - isWorkstationSelected: function() { + isWorkstationSelected: function () { this.$v.$reset(); this.file = null; this.tftpIpAddress = null; this.tftpFileName = null; - } + }, }, created() { this.startLoader(); @@ -251,28 +256,23 @@ export default { .dispatch('firmware/getFirmwareInformation') .finally(() => this.endLoader()); }, - beforeRouteLeave(to, from, next) { - this.hideLoader(); - this.clearRebootTimeout(); - next(); - }, validations() { return { file: { - required: requiredIf(function() { + required: requiredIf(function () { return this.isWorkstationSelected; - }) + }), }, tftpIpAddress: { - required: requiredIf(function() { + required: requiredIf(function () { return !this.isWorkstationSelected; - }) + }), }, tftpFileName: { - required: requiredIf(function() { + required: requiredIf(function () { return !this.isWorkstationSelected; - }) - } + }), + }, }; }, methods: { @@ -292,7 +292,7 @@ export default { dispatchWorkstationUpload() { this.$store .dispatch('firmware/uploadFirmware', this.file) - .then(success => + .then((success) => this.infoToast( success, this.$t('pageFirmware.toast.successUploadTitle') @@ -306,11 +306,11 @@ export default { dispatchTftpUpload() { const data = { address: this.tftpIpAddress, - filename: this.tftpFileName + filename: this.tftpFileName, }; this.$store .dispatch('firmware/uploadFirmwareTFTP', data) - .then(success => + .then((success) => this.infoToast( success, this.$t('pageFirmware.toast.successUploadTitle') @@ -325,7 +325,7 @@ export default { this.setRebootTimeout(); this.$store .dispatch('firmware/switchBmcFirmware') - .then(success => + .then((success) => this.infoToast(success, this.$t('global.status.success')) ) .catch(({ message }) => { @@ -355,8 +355,8 @@ export default { this.$v.$touch(); if (this.$v.$invalid) return; this.$bvModal.show('modal-upload'); - } - } + }, + }, }; </script> diff --git a/src/views/Configuration/Firmware/FirmwareModalRebootBackupBmc.vue b/src/views/Configuration/Firmware/FirmwareModalRebootBackupBmc.vue index 06ab65d9..8f9a8f8c 100644 --- a/src/views/Configuration/Firmware/FirmwareModalRebootBackupBmc.vue +++ b/src/views/Configuration/Firmware/FirmwareModalRebootBackupBmc.vue @@ -22,12 +22,12 @@ export default { props: { current: { type: String, - required: true + required: true, }, backup: { type: String, - required: true - } - } + required: true, + }, + }, }; </script> diff --git a/src/views/Configuration/NetworkSettings/NetworkSettings.vue b/src/views/Configuration/NetworkSettings/NetworkSettings.vue index 4a181fd8..303077c5 100644 --- a/src/views/Configuration/NetworkSettings/NetworkSettings.vue +++ b/src/views/Configuration/NetworkSettings/NetworkSettings.vue @@ -109,14 +109,14 @@ :items="form.ipv4StaticTableItems" class="mb-0" > - <template v-slot:cell(Address)="{ item, index }"> + <template #cell(Address)="{ item, index }"> <b-form-input v-model.trim="item.Address" :data-test-id="`networkSettings-input-staticIpv4-${index}`" :aria-label=" $t('pageNetworkSettings.ariaLabel.staticIpv4AddressRow') + - ' ' + - (index + 1) + ' ' + + (index + 1) " :readonly="dhcpEnabled" :state=" @@ -149,14 +149,14 @@ </div> </b-form-invalid-feedback> </template> - <template v-slot:cell(SubnetMask)="{ item, index }"> + <template #cell(SubnetMask)="{ item, index }"> <b-form-input v-model.trim="item.SubnetMask" :data-test-id="`networkSettings-input-subnetMask-${index}`" :aria-label=" $t('pageNetworkSettings.ariaLabel.staticIpv4SubnetRow') + - ' ' + - (index + 1) + ' ' + + (index + 1) " :readonly="dhcpEnabled" :state=" @@ -190,7 +190,7 @@ </div> </b-form-invalid-feedback> </template> - <template v-slot:cell(actions)="{ item, index }"> + <template #cell(actions)="{ item, index }"> <table-row-action v-for="(action, actionIndex) in item.actions" :key="actionIndex" @@ -200,7 +200,7 @@ onDeleteIpv4StaticTableRow($event, index) " > - <template v-slot:icon> + <template #icon> <icon-trashcan v-if="action.value === 'delete'" /> </template> </table-row-action> @@ -223,14 +223,14 @@ :items="form.dnsStaticTableItems" class="mb-0" > - <template v-slot:cell(address)="{ item, index }"> + <template #cell(address)="{ item, index }"> <b-form-input v-model.trim="item.address" :data-test-id="`networkSettings-input-dnsAddress-${index}`" :aria-label=" $t('pageNetworkSettings.ariaLabel.staticDnsRow') + - ' ' + - (index + 1) + ' ' + + (index + 1) " :readonly="dhcpEnabled" :state=" @@ -263,7 +263,7 @@ </div> </b-form-invalid-feedback> </template> - <template v-slot:cell(actions)="{ item, index }"> + <template #cell(actions)="{ item, index }"> <table-row-action v-for="(action, actionIndex) in item.actions" :key="actionIndex" @@ -271,7 +271,7 @@ :title="action.title" @click:tableAction="onDeleteDnsTableRow($event, index)" > - <template v-slot:icon> + <template #icon> <icon-trashcan v-if="action.value === 'delete'" /> </template> </table-row-action> @@ -327,9 +327,13 @@ export default { PageSection, TableRowAction, IconTrashcan, - IconAdd + IconAdd, }, mixins: [BVToastMixin, VuelidateMixin, LoadingBarMixin], + beforeRouteLeave(to, from, next) { + this.hideLoader(); + next(); + }, data() { return { dhcpEnabled: null, @@ -337,20 +341,20 @@ export default { ipv4StaticTableFields: [ { key: 'Address', - label: this.$t('pageNetworkSettings.table.ipAddress') + label: this.$t('pageNetworkSettings.table.ipAddress'), }, { key: 'SubnetMask', - label: this.$t('pageNetworkSettings.table.subnet') + label: this.$t('pageNetworkSettings.table.subnet'), }, - { key: 'actions', label: '', tdClass: 'text-right' } + { key: 'actions', label: '', tdClass: 'text-right' }, ], dnsTableFields: [ { key: 'address', - label: this.$t('pageNetworkSettings.table.ipAddress') + label: this.$t('pageNetworkSettings.table.ipAddress'), }, - { key: 'actions', label: '', tdClass: 'text-right' } + { key: 'actions', label: '', tdClass: 'text-right' }, ], selectedInterfaceIndex: 0, selectedInterface: {}, @@ -359,8 +363,8 @@ export default { hostname: '', macAddress: '', ipv4StaticTableItems: [], - dnsStaticTableItems: [] - } + dnsStaticTableItems: [], + }, }; }, validations() { @@ -372,45 +376,45 @@ export default { $each: { Address: { required, - validateAddress + validateAddress, }, SubnetMask: { required, - validateAddress - } - } + validateAddress, + }, + }, }, macAddress: { required, validateMacAddress }, dnsStaticTableItems: { $each: { address: { required, - validateAddress - } - } - } - } + validateAddress, + }, + }, + }, + }, }; }, computed: { ...mapState('networkSettings', [ 'ethernetData', 'interfaceOptions', - 'defaultGateway' + 'defaultGateway', ]), interfaceSelectOptions() { return this.interfaceOptions.map((option, index) => { return { text: option, - value: index + value: index, }; }); - } + }, }, watch: { - ethernetData: function() { + ethernetData: function () { this.selectInterface(); - } + }, }, created() { this.startLoader(); @@ -418,10 +422,6 @@ export default { .dispatch('networkSettings/getEthernetData') .finally(() => this.endLoader()); }, - beforeRouteLeave(to, from, next) { - this.hideLoader(); - next(); - }, methods: { selectInterface() { this.selectedInterface = this.ethernetData[this.selectedInterfaceIndex]; @@ -437,16 +437,16 @@ export default { }, getDnsStaticTableItems() { const dns = this.selectedInterface.StaticNameServers || []; - this.form.dnsStaticTableItems = dns.map(server => { + this.form.dnsStaticTableItems = dns.map((server) => { return { address: server, actions: [ { value: 'delete', enabled: this.dhcpEnabled, - title: this.$t('pageNetworkSettings.table.deleteDns') - } - ] + title: this.$t('pageNetworkSettings.table.deleteDns'), + }, + ], }; }); }, @@ -458,9 +458,9 @@ export default { { value: 'delete', enabled: this.dhcpEnabled, - title: this.$t('pageNetworkSettings.table.deleteDns') - } - ] + title: this.$t('pageNetworkSettings.table.deleteDns'), + }, + ], }); }, deleteDnsTableRow(index) { @@ -472,7 +472,7 @@ export default { }, getIpv4StaticTableItems() { const addresses = this.selectedInterface.IPv4StaticAddresses || []; - this.form.ipv4StaticTableItems = addresses.map(ipv4 => { + this.form.ipv4StaticTableItems = addresses.map((ipv4) => { return { Address: ipv4.Address, SubnetMask: ipv4.SubnetMask, @@ -480,9 +480,9 @@ export default { { value: 'delete', enabled: this.dhcpEnabled, - title: this.$t('pageNetworkSettings.table.deleteStaticIpv4') - } - ] + title: this.$t('pageNetworkSettings.table.deleteStaticIpv4'), + }, + ], }; }); }, @@ -495,9 +495,9 @@ export default { { value: 'delete', enabled: this.dhcpEnabled, - title: this.$t('pageNetworkSettings.table.deleteStaticIpv4') - } - ] + title: this.$t('pageNetworkSettings.table.deleteStaticIpv4'), + }, + ], }); }, deleteIpv4StaticTableRow(index) { @@ -522,17 +522,17 @@ export default { hostname, macAddress, selectedInterfaceIndex, - isDhcpEnabled + isDhcpEnabled, }; networkSettingsForm.staticIpv4 = this.form.ipv4StaticTableItems.map( - updateIpv4 => { + (updateIpv4) => { delete updateIpv4.actions; updateIpv4.Gateway = this.form.gateway; return updateIpv4; } ); networkSettingsForm.staticNameServers = this.form.dnsStaticTableItems.map( - updateDns => { + (updateDns) => { return updateDns.address; } ); @@ -541,7 +541,7 @@ export default { 'networkSettings/updateInterfaceSettings', networkSettingsForm ) - .then(success => { + .then((success) => { this.successToast(success); }) .catch(({ message }) => this.errorToast(message)) @@ -549,7 +549,7 @@ export default { this.$v.form.$reset(); this.endLoader(); }); - } - } + }, + }, }; </script> |