Skip to content

Commit 8b515f6

Browse files
committed
added status page (WIP)
1 parent c118a1e commit 8b515f6

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

src/router.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ export const routes = [
1717
meta: { icon: 'code' },
1818
component: () => import(/* webpackChunkName: "editor" */ './views/Editor.vue'),
1919
},
20+
{
21+
path: '/status',
22+
name: 'status',
23+
meta: { icon: 'show_chart' },
24+
component: () => import(/* webpackChunkName: "status" */ './views/Status.vue')
25+
},
2026
{
2127
path: '*',
2228
component: () =>

src/views/Status.vue

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<template>
2+
<v-layout row wrap>
3+
<v-flex>
4+
<v-card>
5+
<v-card-title>
6+
<v-label>Packets per Second</v-label>
7+
</v-card-title>
8+
<v-sheet color="transparent">
9+
<v-sparkline
10+
:value="packetsPerSecond"
11+
:labels="time"
12+
auto-draw
13+
></v-sparkline>
14+
</v-sheet>
15+
</v-card>
16+
</v-flex>
17+
</v-layout>
18+
</template>
19+
20+
<script lang="ts">
21+
import { Component, Vue, Mixins, Watch } from 'vue-property-decorator';
22+
import AlertMixin from '@/mixins/Alert.vue';
23+
import { Action, State, Mutation } from 'vuex-class';
24+
import { StoreState } from '@/store';
25+
import { State as DMXState } from '@/store/dmx';
26+
27+
@Component
28+
export default class Status extends Mixins(AlertMixin) {
29+
@State((store: StoreState) => store.dmx)
30+
private dmx!: DMXState;
31+
32+
private time: number[] = [];
33+
34+
private packetsPerSecond: number[] = [];
35+
36+
private samplingRates: number[] = [];
37+
38+
private currentTime: number = 0;
39+
40+
private mounted() {
41+
setInterval(() => {
42+
this.time.push(this.currentTime);
43+
this.packetsPerSecond.push(this.dmx.packetsPerSecond + 20 * this.time[this.currentTime]);
44+
this.samplingRates.push(this.dmx.samplingRate);
45+
this.currentTime += 1;
46+
}, 1000);
47+
}
48+
}
49+
</script>

0 commit comments

Comments
 (0)