diff --git a/src/components/hostInput.vue b/src/components/hostInput.vue index 3fbfe311..cd3011cb 100644 --- a/src/components/hostInput.vue +++ b/src/components/hostInput.vue @@ -1,10 +1,11 @@ @@ -30,19 +30,13 @@ export default { name: 'hostInput', methods: { - IpChanged: function(event) { - if (!(event.target.value == this.$store.state.host)) { - this.hostname = event.target.value - } - }, - portChanged: function(event) { - this.port = event.target.value - }, handleSubmit: function(event) { + // Commit the hostname and port to store this.$store.commit('changeHost', [ this.hostname, this.port ]); + // Try to get config JSON from the newly submitted host this.$store.dispatch('updateConfig'); } }, @@ -55,6 +49,7 @@ export default { }, computed: { + // Stylises the hostname input box based on connection status IpFormClasses: function () { return { 'uk-form-danger': !this.$store.state.available,