created trace store

This commit is contained in:
Peter Olu 2022-07-09 10:48:09 -07:00
parent 51a8382c77
commit dd92af68d7
2 changed files with 29 additions and 4 deletions

View File

@ -17,9 +17,35 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { store } from "@/store"; import { store } from "@/store";
import { Trace, Span } from "@/types/trace"; // import { Trace, Span } from "@/types/trace";
interface jbTraceStates { interface jbTraceStates {
activeFilter: string;
displayMode: string;
currentView: string;
}
} 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);
}

View File

@ -23,7 +23,6 @@ import graphql from "@/graphql";
import { AxiosResponse } from "axios"; import { AxiosResponse } from "axios";
import { useAppStoreWithOut } from "@/store/modules/app"; import { useAppStoreWithOut } from "@/store/modules/app";
import { useSelectorStore } from "@/store/modules/selectors"; import { useSelectorStore } from "@/store/modules/selectors";
interface TraceState { interface TraceState {
services: Service[]; services: Service[];
instances: Instance[]; instances: Instance[];