|
|
@ -1,28 +1,35 @@ |
|
|
|
import { auth } from "./auth.module"; |
|
|
|
import { auth } from "./auth.module"; |
|
|
|
import { createStore } from 'vuex' |
|
|
|
import { createStore } from 'vuex' |
|
|
|
import { getStatusGenerator } from "@/services/analytics.service"; |
|
|
|
import { getStatusGenerator } from "@/services/analytics.service"; |
|
|
|
|
|
|
|
import { AnalyticType } from './types' |
|
|
|
// import { notify } from "@kyvg/vue3-notification";
|
|
|
|
// import { notify } from "@kyvg/vue3-notification";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SET_ANALYTICS_STATUS = 'SET_ANALYTICS_STATUS'; |
|
|
|
const SET_ANALYTICS_STATUS = 'SET_ANALYTICS_STATUS'; |
|
|
|
|
|
|
|
const SET_ANALYTICS_TYPE = 'SET_ANALYTICS_TYPE'; |
|
|
|
const _SET_STATUS_GENERATOR = '_SET_STATUS_GENERATOR'; |
|
|
|
const _SET_STATUS_GENERATOR = '_SET_STATUS_GENERATOR'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type State = { |
|
|
|
type State = { |
|
|
|
analyticStatus: string, |
|
|
|
analyticStatus: string, |
|
|
|
|
|
|
|
analyticType?: AnalyticType, |
|
|
|
_statusGenerator: AsyncIterableIterator<string> |
|
|
|
_statusGenerator: AsyncIterableIterator<string> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const store = createStore<State>({ |
|
|
|
const store = createStore<State>({ |
|
|
|
state: { |
|
|
|
state: { |
|
|
|
analyticStatus: 'loading...', |
|
|
|
analyticStatus: 'loading...', |
|
|
|
|
|
|
|
analyticType: null, |
|
|
|
_statusGenerator: null |
|
|
|
_statusGenerator: null |
|
|
|
}, |
|
|
|
}, |
|
|
|
mutations: { |
|
|
|
mutations: { |
|
|
|
[SET_ANALYTICS_STATUS](state, status: string) { |
|
|
|
[SET_ANALYTICS_STATUS](state, status: string) { |
|
|
|
state.analyticStatus = status; |
|
|
|
state.analyticStatus = status; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
[SET_ANALYTICS_TYPE](state, atype: AnalyticType) { |
|
|
|
|
|
|
|
state.analyticType = atype; |
|
|
|
|
|
|
|
}, |
|
|
|
[_SET_STATUS_GENERATOR](state, generator: AsyncIterableIterator<string>) { |
|
|
|
[_SET_STATUS_GENERATOR](state, generator: AsyncIterableIterator<string>) { |
|
|
|
this._statusGenerator = generator; |
|
|
|
this._statusGenerator = generator; |
|
|
|
} |
|
|
|
} |
|
|
|