Parcourir la source

Add protocol selector in host config

rigwild il y a 5 ans
Parent
commit
31bff9d352
1 fichiers modifiés avec 15 ajouts et 0 suppressions
  1. 15 0
      src/components/HostConfig.vue

+ 15 - 0
src/components/HostConfig.vue

@@ -10,6 +10,14 @@
               <v-slide-y-transition mode="out-in">
                 <loader v-if="loadingMessage" :message="loadingMessage" />
                 <v-form v-else ref="form">
+                  <v-flex xs3>
+                    <v-select
+                      v-model="config.protocol"
+                      :items="['HTTP', 'HTTPS']"
+                      label="Protocol"
+                    />
+                  </v-flex>
+
                   <v-text-field
                     v-model="config.host"
                     label="Host IP address or hostname"
@@ -25,6 +33,7 @@
                     required
                   />
 
+
                   <v-btn color="error" @click="reset">Reset Form</v-btn>
 
                   <v-btn color="success" @click="validate">Submit</v-btn>
@@ -64,6 +73,12 @@ export default {
     }
   },
 
+  watch: {
+    'config.protocol'(newValue) {
+      if (newValue === 'HTTPS') this.config.port = 443
+    }
+  },
+
   methods: {
     ...mapActions(['setHostConfig']),
     reset() {