From dd92af68d7a735368c2e62a70700f610d9197e56 Mon Sep 17 00:00:00 2001 From: Peter Olu Date: Sat, 9 Jul 2022 10:48:09 -0700 Subject: [PATCH] created trace store --- src/store/modules/jbTrace.ts | 32 +++++++++++++++++++++++++++++--- src/store/modules/trace.ts | 1 - 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/store/modules/jbTrace.ts b/src/store/modules/jbTrace.ts index d03c3614..522b8c59 100644 --- a/src/store/modules/jbTrace.ts +++ b/src/store/modules/jbTrace.ts @@ -17,9 +17,35 @@ import { defineStore } from "pinia"; import { store } from "@/store"; -import { Trace, Span } from "@/types/trace"; - +// import { Trace, Span } from "@/types/trace"; interface jbTraceStates { + activeFilter: string; + displayMode: string; + currentView: string; +} -} \ No newline at end of file +export const jbTraceStore = defineStore({ + id: "jb-trace", + state: (): jbTraceStates => ({ + displayMode: "List", + currentView: "traceList", + activeFilter: "", + }), + actions: { + setDisplayMode(data: string) { + this.displayMode = data; + }, + setCurrentView(data: string) { + this.currentView = data; + }, + setActiveFilter(data: string) { + if (!data) this.activeFilter = ""; + this.activeFilter = data; + }, + }, +}); + +export function useJbTraceStore(): any { + return jbTraceStore(store); +} diff --git a/src/store/modules/trace.ts b/src/store/modules/trace.ts index cee364e6..9fc5979a 100644 --- a/src/store/modules/trace.ts +++ b/src/store/modules/trace.ts @@ -23,7 +23,6 @@ import graphql from "@/graphql"; import { AxiosResponse } from "axios"; import { useAppStoreWithOut } from "@/store/modules/app"; import { useSelectorStore } from "@/store/modules/selectors"; - interface TraceState { services: Service[]; instances: Instance[];