Avg. Ping and Avg. Response translation keys

This commit is contained in:
Adam Stachowicz
2021-09-19 15:15:12 +02:00
parent 7665bae927
commit 7dc1e84e44
19 changed files with 401 additions and 28 deletions

View File

@@ -49,7 +49,7 @@
<div class="shadow-box big-padding text-center stats">
<div class="row">
<div class="col">
<h4>{{ pingTitle }}</h4>
<h4>{{ pingTitle() }}</h4>
<p>({{ $t("Current") }})</p>
<span class="num">
<a href="#" @click.prevent="showPingChartBox = !showPingChartBox">
@@ -58,7 +58,7 @@
</span>
</div>
<div class="col">
<h4>{{ $t("Avg.") }} {{ pingTitle }}</h4>
<h4>{{ pingTitle(true) }}</h4>
<p>(24{{ $t("-hour") }})</p>
<span class="num"><CountUp :value="avgPing" /></span>
</div>
@@ -240,14 +240,6 @@ export default {
}
},
computed: {
pingTitle() {
if (this.monitor.type === "http") {
return this.$t("Response");
}
return this.$t("Ping");
},
monitor() {
let id = this.$route.params.id
return this.$root.monitorList[id];
@@ -378,6 +370,19 @@ export default {
}
})
},
pingTitle(average = false) {
let translationPrefix = ""
if (average) {
translationPrefix = "Avg. "
}
if (this.monitor.type === "http") {
return this.$t(translationPrefix + "Response");
}
return this.$t(translationPrefix + "Ping");
},
},
}
</script>