diff --git a/src/graph/fragments/app.ts b/src/graphql/fragments/app.ts similarity index 100% rename from src/graph/fragments/app.ts rename to src/graphql/fragments/app.ts diff --git a/src/graph/fragments/dashboard.ts b/src/graphql/fragments/dashboard.ts similarity index 100% rename from src/graph/fragments/dashboard.ts rename to src/graphql/fragments/dashboard.ts diff --git a/src/graph/fragments/selector.ts b/src/graphql/fragments/selector.ts similarity index 100% rename from src/graph/fragments/selector.ts rename to src/graphql/fragments/selector.ts diff --git a/src/graph/fragments/topology.ts b/src/graphql/fragments/topology.ts similarity index 100% rename from src/graph/fragments/topology.ts rename to src/graphql/fragments/topology.ts diff --git a/src/graph/index.ts b/src/graphql/index.ts similarity index 100% rename from src/graph/index.ts rename to src/graphql/index.ts diff --git a/src/graph/query/app.ts b/src/graphql/query/app.ts similarity index 100% rename from src/graph/query/app.ts rename to src/graphql/query/app.ts diff --git a/src/graph/query/dashboard.ts b/src/graphql/query/dashboard.ts similarity index 100% rename from src/graph/query/dashboard.ts rename to src/graphql/query/dashboard.ts diff --git a/src/graph/query/selector.ts b/src/graphql/query/selector.ts similarity index 100% rename from src/graph/query/selector.ts rename to src/graphql/query/selector.ts diff --git a/src/graph/query/topology.ts b/src/graphql/query/topology.ts similarity index 100% rename from src/graph/query/topology.ts rename to src/graphql/query/topology.ts diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 236bc2ee..79f1737b 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -17,7 +17,7 @@ import { defineStore } from "pinia"; import { store } from "@/store"; import { LayoutConfig } from "@/types/dashboard"; -import graph from "@/graph"; +import graphql from "@/graphql"; import { ConfigData, ConfigData1, ConfigData2, ConfigData3 } from "../data"; import { useAppStoreWithOut } from "@/store/modules/app"; import { useSelectorStore } from "@/store/modules/selectors"; @@ -186,14 +186,14 @@ export const dashboardStore = defineStore({ this.selectedGrid = this.layout[index]; }, async fetchMetricType(item: string) { - const res: AxiosResponse = await graph + const res: AxiosResponse = await graphql .query("queryTypeOfMetrics") .params({ name: item }); return res.data; }, async fetchMetricList(regex: string) { - const res: AxiosResponse = await graph + const res: AxiosResponse = await graphql .query("queryMetrics") .params({ regex }); diff --git a/src/store/modules/selectors.ts b/src/store/modules/selectors.ts index 24d4b49b..e047f967 100644 --- a/src/store/modules/selectors.ts +++ b/src/store/modules/selectors.ts @@ -18,7 +18,7 @@ import { defineStore } from "pinia"; import { Duration } from "@/types/app"; import { Service, Instance, Endpoint } from "@/types/selector"; import { store } from "@/store"; -import graph from "@/graph"; +import graphql from "@/graphql"; import { AxiosResponse } from "axios"; import { useAppStoreWithOut } from "@/store/modules/app"; @@ -51,12 +51,12 @@ export const selectorStore = defineStore({ this.currentPod = pod; }, async fetchLayers(): Promise { - const res: AxiosResponse = await graph.query("queryLayers").params({}); + const res: AxiosResponse = await graphql.query("queryLayers").params({}); return res.data || {}; }, async fetchServices(layer: string): Promise { - const res: AxiosResponse = await graph + const res: AxiosResponse = await graphql .query("queryServices") .params({ layer }); @@ -72,7 +72,7 @@ export const selectorStore = defineStore({ if (!serviceId) { return null; } - const res: AxiosResponse = await graph.query("queryInstances").params({ + const res: AxiosResponse = await graphql.query("queryInstances").params({ serviceId, duration: this.durationTime, }); @@ -95,7 +95,7 @@ export const selectorStore = defineStore({ if (!serviceId) { return null; } - const res: AxiosResponse = await graph.query("queryEndpoints").params({ + const res: AxiosResponse = await graphql.query("queryEndpoints").params({ serviceId, duration: this.durationTime, keyword: params.keyword, @@ -109,7 +109,7 @@ export const selectorStore = defineStore({ if (!serviceId) { return; } - const res: AxiosResponse = await graph.query("queryService").params({ + const res: AxiosResponse = await graphql.query("queryService").params({ serviceId, }); if (!res.data.errors) { @@ -123,7 +123,7 @@ export const selectorStore = defineStore({ if (!instanceId) { return; } - const res: AxiosResponse = await graph.query("queryInstance").params({ + const res: AxiosResponse = await graphql.query("queryInstance").params({ instanceId, }); if (!res.data.errors) { @@ -136,7 +136,7 @@ export const selectorStore = defineStore({ if (!endpointId) { return; } - const res: AxiosResponse = await graph.query("queryEndpoint").params({ + const res: AxiosResponse = await graphql.query("queryEndpoint").params({ endpointId, }); if (!res.data.errors) { diff --git a/src/utils/localtime.ts b/src/utils/localtime.ts index e3ad7bb9..c4f336ba 100644 --- a/src/utils/localtime.ts +++ b/src/utils/localtime.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import graph from "@/graph"; +import graphql from "@/graphql"; import { AxiosResponse } from "axios"; const getLocalTime = (utc: string, time: Date): Date => { @@ -38,7 +38,9 @@ const setTimezoneOffset = () => { export const queryOAPTimeInfo = async (): Promise => { let utc = window.localStorage.getItem("utc"); if (!utc) { - const res: AxiosResponse = await graph.query("queryOAPTimeInfo").params({}); + const res: AxiosResponse = await graphql + .query("queryOAPTimeInfo") + .params({}); if ( !res.data || !res.data.data ||