File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ export const routes = [
17
17
meta : { icon : 'code' } ,
18
18
component : ( ) => import ( /* webpackChunkName: "editor" */ './views/Editor.vue' ) ,
19
19
} ,
20
+ {
21
+ path : '/status' ,
22
+ name : 'status' ,
23
+ meta : { icon : 'show_chart' } ,
24
+ component : ( ) => import ( /* webpackChunkName: "status" */ './views/Status.vue' )
25
+ } ,
20
26
{
21
27
path : '*' ,
22
28
component : ( ) =>
Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments