diff options
author | Anna Tsyganova <ATSyganova@IBS.RU> | 2022-07-08 11:32:33 +0300 |
---|---|---|
committer | Anna Tsyganova <ATSyganova@IBS.RU> | 2022-07-08 11:32:33 +0300 |
commit | f12e602ab84f2a4ae28a064ed2058f57b9cf9bc3 (patch) | |
tree | 02fb24ee79bc558eebc374aa77c6aed7964a69d2 /src/views/_sila/Settings/Network/ModalMacAddress.vue | |
parent | 40c493597703305ae732b414bda83a4f00b25745 (diff) | |
download | webui-vue-f12e602ab84f2a4ae28a064ed2058f57b9cf9bc3.tar.xz |
Fix a little global components
Issue: SILABMC-191
Diffstat (limited to 'src/views/_sila/Settings/Network/ModalMacAddress.vue')
-rw-r--r-- | src/views/_sila/Settings/Network/ModalMacAddress.vue | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/src/views/_sila/Settings/Network/ModalMacAddress.vue b/src/views/_sila/Settings/Network/ModalMacAddress.vue deleted file mode 100644 index d563f4ce..00000000 --- a/src/views/_sila/Settings/Network/ModalMacAddress.vue +++ /dev/null @@ -1,109 +0,0 @@ -<template> - <b-modal - id="modal-mac-address" - ref="modal" - :title="$t('pageNetwork.modal.editMacAddressTitle')" - @hidden="resetForm" - > - <b-form id="mac-settings" @submit.prevent="handleSubmit"> - <b-row> - <b-col sm="6"> - <b-form-group - :label="$t('pageNetwork.macAddress')" - label-for="macAddress" - > - <b-form-input - id="mac-address" - v-model.trim="form.macAddress" - data-test-id="network-input-macAddress" - type="text" - :state="getValidationState($v.form.macAddress)" - @change="$v.form.macAddress.$touch()" - /> - <b-form-invalid-feedback role="alert"> - <div v-if="!$v.form.macAddress.required"> - {{ $t('global.form.fieldRequired') }} - </div> - <div v-if="!$v.form.macAddress.macAddress"> - {{ $t('global.form.invalidFormat') }} - </div> - </b-form-invalid-feedback> - </b-form-group> - </b-col> - </b-row> - </b-form> - <template #modal-footer="{ cancel }"> - <b-button variant="secondary" @click="cancel()"> - {{ $t('global.action.cancel') }} - </b-button> - <b-button - form="mac-settings" - type="submit" - variant="primary" - @click="onOk" - > - {{ $t('global.action.add') }} - </b-button> - </template> - </b-modal> -</template> - -<script> -import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js'; -import { macAddress, required } from 'vuelidate/lib/validators'; - -export default { - mixins: [VuelidateMixin], - props: { - macAddress: { - type: String, - default: '', - }, - }, - data() { - return { - form: { - macAddress: '', - }, - }; - }, - watch: { - macAddress() { - this.form.macAddress = this.macAddress; - }, - }, - validations() { - return { - form: { - macAddress: { - required, - macAddress: macAddress(), - }, - }, - }; - }, - methods: { - handleSubmit() { - this.$v.$touch(); - if (this.$v.$invalid) return; - this.$emit('ok', { MACAddress: this.form.macAddress }); - this.closeModal(); - }, - closeModal() { - this.$nextTick(() => { - this.$refs.modal.hide(); - }); - }, - resetForm() { - this.form.macAddress = this.macAddress; - this.$v.$reset(); - this.$emit('hidden'); - }, - onOk(bvModalEvt) { - // prevent modal close - bvModalEvt.preventDefault(); - this.handleSubmit(); - }, - }, -}; -</script> |