diff --git a/client/src/store/index.ts b/client/src/store/index.ts index d0c1f55..78bde02 100644 --- a/client/src/store/index.ts +++ b/client/src/store/index.ts @@ -37,6 +37,11 @@ const store = createStore({ } }, actions: { + async initData() { + this.dispatch('fetchConfig'); + this.dispatch('_runStatusGenerator'); + }, + async _runStatusGenerator({commit, state}) { // notify({ // title: "Authorization", @@ -49,11 +54,10 @@ const store = createStore({ const g = getStatusGenerator(); commit(_SET_STATUS_GENERATOR, g); for await (const data of state._statusGenerator) { - const st = data.toLocaleLowerCase(); - if(state.analyticStatus.toLocaleLowerCase() != 'ready' && st == 'ready') { - this.dispatch('fetchConfig'); + // const st = data.toLocaleLowerCase(); + // if(state.analyticStatus.toLocaleLowerCase() != 'ready' && st == 'ready') { // TODO: update segments from here - } + // } // this.status = data.toLowerCase(); commit(SET_ANALYTICS_STATUS, data); } @@ -68,6 +72,6 @@ const store = createStore({ } }) -store.dispatch('_runStatusGenerator'); +store.dispatch('initData'); export default store; diff --git a/client/src/views/Home.vue b/client/src/views/Home.vue index bfa4564..5b97e43 100644 --- a/client/src/views/Home.vue +++ b/client/src/views/Home.vue @@ -4,6 +4,9 @@ +
+ +
Hold
S
to label patterns
@@ -13,7 +16,6 @@
- @@ -33,17 +35,25 @@ export default defineComponent({ methods: { clearAllLabeling() { this.$refs.graph.deleteAllSegments(); + }, + changeAnalyticUnitType(e) { + console.log(e); } }, data: function () { return { - analyticUnitTypes: [AnalyticUnitType.THRESHOLD, AnalyticUnitType.PATTERN, AnalyticUnitType.ANOMALY], + analyticUnitTypes: [ + AnalyticUnitType.THRESHOLD, + AnalyticUnitType.PATTERN, + AnalyticUnitType.ANOMALY, + ], + analyticUnitType: AnalyticUnitType.PATTERN } }, computed: { - analyticUnitType() { - return this.$store.state.analyticUnitType; - } + // analyticUnitType() { + // return { id: 1, name: this.$store.state.analyticUnitType } + // } } });