some more tweaks

This commit is contained in:
Craig
2020-01-14 09:39:47 +00:00
parent 6c815b019d
commit 6f1a2bb77a
14 changed files with 255 additions and 86 deletions

View File

@ -1 +1 @@
NEKO_DEV=localhost:3000
VUE_APP_SERVER=localhost:3000

View File

@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Client for neko streaming server",
"scripts": {
"serve": "vue-cli-service serve",
"serve": "vue-cli-service serve --mode development",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},

View File

@ -66,13 +66,13 @@
<img src="@/assets/logo.svg" alt="n.eko" />
<span><b>n</b>.eko</span>
</div>
<div class="message" v-if="!connecting">
<form class="message" v-if="!connecting" @submit.stop.prevent="connect">
<span>Please enter the password:</span>
<input type="password" v-model="password" />
<span class="button" @click.stop.prevent="connect">
<button type="submit" class="button" @click.stop.prevent="connect">
Connect
</span>
</div>
</button>
</form>
<div class="spinner" v-if="connecting">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
@ -471,7 +471,9 @@
connect() {
this.ws = new WebSocket(
process.env.NODE_ENV === 'development' ? `ws://${process.env.NEKO_DEV}/ws?password=${this.password}` : `${/https/gi.test(location.protocol) ? 'wss' : 'ws'}://${location.host}/ws?password=${this.password}` ,
process.env.NODE_ENV === 'development'
? `ws://${process.env.VUE_APP_SERVER}/ws?password=${this.password}`
: `${/https/gi.test(location.protocol) ? 'wss' : 'ws'}://${location.host}/ws?password=${this.password}`,
)
this.ws.onmessage = this.onMessage.bind(this)