4 <p class="title is-4">{{ item.name }}</p>
5 <p class="subtitle is-6">
6 <template v-if="speedtest">
7 <i class="fas fa-arrow-down"></i> {{ download }} Mbit/s |
8 <i class="fas fa-arrow-up"></i> {{ upload }} Mbit/s |
9 <i class="fas fa-stopwatch"></i> {{ ping }} ms
17 import service from "@/mixins/service.js";
18 import Generic from "./Generic.vue";
21 name: "SpeedtestTracker",
33 download: function () {
34 return this.format(this.speedtest?.download);
37 return this.format(this.speedtest?.upload);
40 return this.format(this.speedtest?.ping);
47 fetchStatus: async function () {
48 this.fetch("/api/speedtest/latest")
50 this.speedtest = response.data;
52 .catch((e) => console.log(e));
54 format: function (value) {
55 return value ? parseFloat(value).toFixed(2) : "n/a";