2929
3030 hr
3131
32- div.form-group
33- select.form-control ( v-model ="vis_method" )
34- option( value ="eventlist" ) Event List
35- option( value ="timeline" ) Timeline
36- option( value ="summary" ) Summary
37- option( value ="raw" ) Raw JSON
38-
39- div( v-if ="vis_method == 'timeline'" )
40- aw-timeline( type ="simple" , :event_type ="event_type" , :events ="events" )
41- div( v-if ="vis_method == 'eventlist'" )
42- aw-eventlist( :events ="events" )
43- div( v-if ="vis_method == 'summary'" )
44- input.form-control ( type ="text" v-model.lazy.trim ="summaryKey" placeholder ="data key" style ="margin-bottom: 1em;" )
45- aw-summary( :fields ="events" , :colorfunc ="colorfunc" , :namefunc ="namefunc" )
46- div( v-if ="vis_method == 'raw'" )
47- pre {{ events }}
48-
32+ aw-selectable-eventview( :events ="events" , :event_type ="event_type" )
4933</template >
5034
5135<style scoped lang="scss"></style >
@@ -65,19 +49,13 @@ window_events = query_bucket(find_bucket("aw-watcher-window_"));
6549window_events = filter_period_intersect(window_events, filter_keyvals(afk_events, "status", ["not-afk"]));
6650merged_events = merge_events_by_keys(window_events, ["app", "title"]);
6751RETURN = sort_by_duration(merged_events);` ,
68- vis_method: ' eventlist' ,
6952 event_type: ' currentwindow' ,
7053 events: [],
7154 today: today .format (),
7255 tomorrow: tomorrow .format (),
7356 error: ' ' ,
7457 startdate: today .format (' YYYY-MM-DD' ),
7558 enddate: tomorrow .format (' YYYY-MM-DD' ),
76-
77- /* Summary props */
78- summaryKey: ' ' ,
79- colorfunc: null ,
80- namefunc: null ,
8159 };
8260 },
8361 computed: {
@@ -86,10 +64,6 @@ RETURN = sort_by_duration(merged_events);`,
8664 else return ' ' ;
8765 },
8866 },
89- mounted : function () {
90- this .colorfunc = this .summaryKeyFunc ;
91- this .namefunc = this .summaryKeyFunc ;
92- },
9367 methods: {
9468 query : async function () {
9569 const query = this .query_code .split (' ;' ).map (s => s .trim () + ' ;' );
@@ -102,9 +76,6 @@ RETURN = sort_by_duration(merged_events);`,
10276 this .error = e .response .data .message ;
10377 }
10478 },
105- summaryKeyFunc : function (e ) {
106- return e .data [this .summaryKey ];
107- },
10879 },
10980};
11081 </script >
0 commit comments