Interval on pingchecks
This commit is contained in:
parent
0fb303cecc
commit
4c8af5a316
|
@ -705,7 +705,9 @@ video.vjs-tech,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.thick--text {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.clientLogo {
|
.clientLogo {
|
||||||
|
|
|
@ -58,8 +58,13 @@
|
||||||
<v-btn color="primary" :disabled="connectionPending" @click="serverSelected(server)"> Connect</v-btn>
|
<v-btn color="primary" :disabled="connectionPending" @click="serverSelected(server)"> Connect</v-btn>
|
||||||
<div v-if="server.value !== 'custom'">
|
<div v-if="server.value !== 'custom'">
|
||||||
<div v-if="results[server.value]">
|
<div v-if="results[server.value]">
|
||||||
<div>Ping: <span :class="connectionQualityClass(results[server.value].latency)">{{ results[server.value].latency }}ms </span></div>
|
<div v-if="results[server.value].alive">
|
||||||
<div>Load: <span :class="loadQualityClass(results[server.value].result)">{{ results[server.value].result || 'Unknown' }} </span></div>
|
<div>Ping: <span class="thick--text" :class="connectionQualityClass(results[server.value].latency)">{{ results[server.value].latency }}ms </span></div>
|
||||||
|
<div>Load: <span class="thick--text" :class="loadQualityClass(results[server.value].result)">{{ results[server.value].result || 'Unknown' }} </span></div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="text-xs-center red--text">
|
||||||
|
Unable to connect to server
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
Testing connection quality...
|
Testing connection quality...
|
||||||
|
@ -156,6 +161,8 @@ export default {
|
||||||
|
|
||||||
results: {},
|
results: {},
|
||||||
|
|
||||||
|
destroyed: false,
|
||||||
|
|
||||||
ptservers: [
|
ptservers: [
|
||||||
{
|
{
|
||||||
location: 'Sydney, Australia',
|
location: 'Sydney, Australia',
|
||||||
|
@ -187,7 +194,16 @@ export default {
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.testConnections()
|
this.testConnections()
|
||||||
}, 500)
|
let ticker = setInterval(() => {
|
||||||
|
if (this.destroyed) {
|
||||||
|
return clearInterval(ticker)
|
||||||
|
}
|
||||||
|
this.testConnections()
|
||||||
|
}, 5000)
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
beforeDestroy: function () {
|
||||||
|
this.destroyed = true
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
if (this.slRoom && this.slConnected && this.slServer) {
|
if (this.slRoom && this.slConnected && this.slServer) {
|
||||||
|
@ -197,8 +213,11 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
connectionQualityClass: function (value) {
|
connectionQualityClass: function (value) {
|
||||||
if (value < 125) {
|
if (value < 50) {
|
||||||
return ['green--text']
|
return ['green--text', 'text--lighten-1']
|
||||||
|
}
|
||||||
|
if (value < 150) {
|
||||||
|
return ['lime--text']
|
||||||
}
|
}
|
||||||
if (value < 250) {
|
if (value < 250) {
|
||||||
return ['orange--text']
|
return ['orange--text']
|
||||||
|
@ -207,7 +226,7 @@ export default {
|
||||||
},
|
},
|
||||||
loadQualityClass: function (value) {
|
loadQualityClass: function (value) {
|
||||||
if (value === 'low') {
|
if (value === 'low') {
|
||||||
return ['green--text']
|
return ['green--text', 'text--lighten-1']
|
||||||
}
|
}
|
||||||
if (value === 'medium') {
|
if (value === 'medium') {
|
||||||
return ['orange--text']
|
return ['orange--text']
|
||||||
|
|
Loading…
Reference in New Issue