changeset 1953:3ccdd635d4fd

import schedule: password field instead of plaintext
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 22 Jan 2019 16:14:35 +0100
parents bafe68178528
children 15af36e41f27 984bec1f315b
files client/src/components/importschedule/Importscheduledetail.vue
diffstat 1 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importschedule/Importscheduledetail.vue	Tue Jan 22 16:12:20 2019 +0100
+++ b/client/src/components/importschedule/Importscheduledetail.vue	Tue Jan 22 16:14:35 2019 +0100
@@ -138,8 +138,20 @@
                     <translate>Password</translate>
                   </small>
                 </div>
-                <div class="w-100">
-                  <input v-model="password" class="form-control" type="text" />
+                <div class="w-100 d-flex flex-row">
+                  <input
+                    v-model="password"
+                    class="form-control"
+                    :type="showPassword"
+                  />
+                  <span
+                    class="input-group-text ml-2"
+                    @click="passwordVisible = !passwordVisible"
+                  >
+                    <font-awesome-icon
+                      :icon="passwordVisible ? 'eye-slash' : 'eye'"
+                    ></font-awesome-icon>
+                  </span>
                 </div>
                 <div v-if="!password" class="d-flex flex-row">
                   <small
@@ -552,7 +564,10 @@
 export default {
   name: "importscheduledetail",
   data() {
-    return initializeCurrentSchedule();
+    return {
+      passwordVisible: false,
+      ...initializeCurrentSchedule()
+    };
   },
   IMPORTTYPES: IMPORTTYPES,
   EVERY: app.$gettext("Every"),
@@ -628,6 +643,10 @@
   },
   computed: {
     ...mapState("imports", ["importScheduleDetailVisible", "currentSchedule"]),
+    showPassword() {
+      if (this.passwordVisible) return "text";
+      return "password";
+    },
     dialogLabel() {
       if (this.id) return this.$gettext("Import") + " " + this.id;
       return this.$gettext("New Import");