summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSurya Venkatesan <suryav@ami.com>2024-09-12 10:30:05 +0300
committerEd Tanous <ed@tanous.net>2024-10-03 21:34:06 +0300
commit00355b6511b2a5bb2928b5a1f9298be991a2ab70 (patch)
tree5474db4ea6dc23a10a5fb51060c73fcd60457c91
parent6923c46d9ab0c55531e674ec1d8ceef6671b55d9 (diff)
downloadwebui-vue-00355b6511b2a5bb2928b5a1f9298be991a2ab70.tar.xz
Firmware page vuelidate and form file error fix
While add a file in the form file vuelidate error occurs and global component form file not return a file, by emit the $event in form file fix the issue. Change-Id: Icbeddc7a3faa262f12e85268206ae70950f37905 Signed-off-by: Surya Venkatesan <suryav@ami.com>
-rw-r--r--src/components/Global/FormFile.vue2
-rw-r--r--src/views/Operations/Firmware/FirmwareFormUpdate.vue20
2 files changed, 10 insertions, 12 deletions
diff --git a/src/components/Global/FormFile.vue b/src/components/Global/FormFile.vue
index ccdc038e..bb3b46fe 100644
--- a/src/components/Global/FormFile.vue
+++ b/src/components/Global/FormFile.vue
@@ -8,7 +8,7 @@
:disabled="disabled"
:state="state"
plain
- @input="$emit('input', file)"
+ @input="$emit('input', $event)"
>
</b-form-file>
<span
diff --git a/src/views/Operations/Firmware/FirmwareFormUpdate.vue b/src/views/Operations/Firmware/FirmwareFormUpdate.vue
index dfb5c689..43467474 100644
--- a/src/views/Operations/Firmware/FirmwareFormUpdate.vue
+++ b/src/views/Operations/Firmware/FirmwareFormUpdate.vue
@@ -11,7 +11,7 @@
<form-file
id="image-file"
:disabled="isPageDisabled"
- :state="getValidationState($v.file)"
+ :state="getValidationState(v$.file)"
aria-describedby="image-file-help-block"
@input="onFileUpload($event)"
>
@@ -69,7 +69,7 @@ export default {
},
setup() {
return {
- $v: useVuelidate(),
+ v$: useVuelidate(),
};
},
data() {
@@ -81,12 +81,10 @@ export default {
process.env.VUE_APP_SERVER_OFF_REQUIRED === 'true',
};
},
- validations() {
- return {
- file: {
- required,
- },
- };
+ validations: {
+ file: {
+ required,
+ },
},
created() {
this.$store.dispatch('firmware/getUpdateServiceSettings');
@@ -122,13 +120,13 @@ export default {
});
},
onSubmitUpload() {
- this.$v.$touch();
- if (this.$v.$invalid) return;
+ this.v$.$touch();
+ if (this.v$.$invalid) return;
this.$bvModal.show('modal-update-firmware');
},
onFileUpload(file) {
this.file = file;
- this.$v.file.$touch();
+ this.v$.file.$touch();
},
},
};