From a0d85520fb0669d5eec4475f5e255adb1e2a0159 Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Fri, 5 Feb 2021 19:37:35 +0100 Subject: [PATCH] feat(UI): enanched file upload input --- src/renderer/components/BaseUploadInput.vue | 111 ++++++++++++++++++ .../components/ModalEditConnection.vue | 31 +++-- .../components/ModalNewConnection.vue | 31 +++-- 3 files changed, 147 insertions(+), 26 deletions(-) create mode 100644 src/renderer/components/BaseUploadInput.vue diff --git a/src/renderer/components/BaseUploadInput.vue b/src/renderer/components/BaseUploadInput.vue new file mode 100644 index 00000000..387fddbb --- /dev/null +++ b/src/renderer/components/BaseUploadInput.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/renderer/components/ModalEditConnection.vue b/src/renderer/components/ModalEditConnection.vue index bb5356da..870e37cc 100644 --- a/src/renderer/components/ModalEditConnection.vue +++ b/src/renderer/components/ModalEditConnection.vue @@ -162,11 +162,11 @@
- + />
@@ -174,11 +174,11 @@
- + />
@@ -186,11 +186,11 @@
- + />
@@ -247,12 +247,14 @@ import { mapActions } from 'vuex'; import Connection from '@/ipc-api/Connection'; import ModalAskCredentials from '@/components/ModalAskCredentials'; import BaseToast from '@/components/BaseToast'; +import BaseUploadInput from '@/components/BaseUploadInput'; export default { name: 'ModalEditConnection', components: { ModalAskCredentials, - BaseToast + BaseToast, + BaseUploadInput }, props: { connection: Object @@ -351,6 +353,9 @@ export default { if (!files.length) return; this.localConnection[name] = files[0].path; + }, + pathClear (name) { + this.localConnection[name] = ''; } } }; diff --git a/src/renderer/components/ModalNewConnection.vue b/src/renderer/components/ModalNewConnection.vue index cd27a417..42293cd3 100644 --- a/src/renderer/components/ModalNewConnection.vue +++ b/src/renderer/components/ModalNewConnection.vue @@ -166,11 +166,11 @@
- + />
@@ -178,11 +178,11 @@
- + />
@@ -190,11 +190,11 @@
- + />
@@ -252,12 +252,14 @@ import Connection from '@/ipc-api/Connection'; import { uidGen } from 'common/libs/uidGen'; import ModalAskCredentials from '@/components/ModalAskCredentials'; import BaseToast from '@/components/BaseToast'; +import BaseUploadInput from '@/components/BaseUploadInput'; export default { name: 'ModalNewConnection', components: { ModalAskCredentials, - BaseToast + BaseToast, + BaseUploadInput }, data () { return { @@ -382,6 +384,9 @@ export default { if (!files.length) return; this.connection[name] = files[0].path; + }, + pathClear (name) { + this.connection[name] = ''; } } };