Properly handle new connection clicks

This commit is contained in:
Joel Collins 2019-09-19 15:28:15 +01:00
parent cceaa645be
commit f8bb26b130
5 changed files with 36 additions and 17 deletions

View file

@ -65,7 +65,7 @@
:name="host.name"
:hostname="host.hostname"
:port="host.port"
v-on:connect="connectToHost(host)"
v-on:connect="handleConnectButton(host)"
v-on:delete="delSavedHost(host)"
></hostCard>
</div>
@ -87,7 +87,7 @@
:hostname="host.hostname"
:port="host.port"
:deletable="false"
v-on:connect="connectToHost(host)"
v-on:connect="handleConnectButton(host)"
></hostCard>
</div>
@ -196,7 +196,10 @@ export default {
this.$store.dispatch('firstConnect')
.then (() => {
console.log("Connected!")
// Check client and server match
this.checkServerVersion()
// Switch to live view tab
this.$root.$emit('globalTogglePanelRightTab', 'preview')
})
.catch(error => {
this.modalError(error) // Let mixin handle error
@ -226,6 +229,11 @@ export default {
this.connectToHost(selectedHost)
},
handleConnectButton: function(host) {
this.computedLocalMode = false
this.connectToHost(host)
},
checkServerVersion: function () {
this.$store.dispatch('updateState')
.then (() => {

View file

@ -29,9 +29,10 @@
</div>
<div class="uk-card-footer uk-padding-small">
<span v-if="temporary" class="uk-label uk-label-danger uk-margin-small-right" uk-tooltip="title: Capture will be removed automatically; delay: 500">Temporary</span>
<span v-for="tag in tags" :key="tag" v-on:click="delTagConfirm(tag)" class="uk-label uk-margin-small-right deletable-label"> {{ tag }} </span>
<div v-for="tag in tags" :key="tag">
<span v-if="tag==='temporary'" class="uk-label uk-label-danger uk-margin-small-right" uk-tooltip="title: Capture will be removed automatically; delay: 500">Temporary</span>
<span v-else v-on:click="delTagConfirm(tag)" class="uk-label uk-margin-small-right deletable-label"> {{ tag }} </span>
</div>
<a v-bind:href="tagModalTarget" uk-toggle>
<span class="uk-label uk-label-success uk-margin-small-right">Add</span>
@ -84,10 +85,6 @@ export default {
name: 'captureCard',
props: {
temporary: {
type: Boolean,
required: true
},
metadata: {
type: Object,
required: true