dont automatically reconnect, add dc layer with option to reconnect
This commit is contained in:
parent
9f7ac8d111
commit
6d59a713a3
8 changed files with 179 additions and 191 deletions
34
public/components/ConnectionOverlay.vue.js
Normal file
34
public/components/ConnectionOverlay.vue.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"use strict"
|
||||
|
||||
import Communication from './../Communication.js'
|
||||
|
||||
export default {
|
||||
name: 'connection-overlay',
|
||||
template: `
|
||||
<div class="overlay connection-lost" v-if="show">
|
||||
<div class="overlay-content" v-if="lostConnection">
|
||||
<div>⁉️ LOST CONNECTION ⁉️</div>
|
||||
<span class="btn" @click="$emit('reconnect')">Reconnect</span>
|
||||
</div>
|
||||
<div class="overlay-content" v-if="connectionState === 3">
|
||||
<div>Connecting...</div>
|
||||
</div>
|
||||
</div>`,
|
||||
emits: {
|
||||
reconnect: null,
|
||||
},
|
||||
props: {
|
||||
connectionState: Number,
|
||||
},
|
||||
computed: {
|
||||
lostConnection () {
|
||||
return this.connectionState === Communication.CONN_STATE_DISCONNECTED
|
||||
},
|
||||
connecting () {
|
||||
return this.connectionState === Communication.CONN_STATE_CONNECTING
|
||||
},
|
||||
show () {
|
||||
return this.lostConnection || this.connecting
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
export default {
|
||||
name: 'help-overlay',
|
||||
template: `<div class="overlay transparent" @click="$emit('bgclick')">
|
||||
<table class="help" @click.stop="">
|
||||
<table class="overlay-content help" @click.stop="">
|
||||
<tr><td>⬆️ Move up:</td><td><div><kbd>W</kbd>/<kbd>↑</kbd>/🖱️</div></td></tr>
|
||||
<tr><td>⬇️ Move down:</td><td><div><kbd>S</kbd>/<kbd>↓</kbd>/🖱️</div></td></tr>
|
||||
<tr><td>⬅️ Move left:</td><td><div><kbd>A</kbd>/<kbd>←</kbd>/🖱️</div></td></tr>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export default {
|
|||
name: 'settings-overlay',
|
||||
template: `
|
||||
<div class="overlay transparent" @click="$emit('bgclick')">
|
||||
<table class="settings" @click.stop="">
|
||||
<table class="overlay-content settings" @click.stop="">
|
||||
<tr>
|
||||
<td><label>Background: </label></td>
|
||||
<td><input type="color" v-model="modelValue.background" /></td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue