diff --git a/src/store/modules/ebpf.ts b/src/store/modules/ebpf.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/store/modules/profile.ts b/src/store/modules/profile.ts index 10f9e308..7020adc0 100644 --- a/src/store/modules/profile.ts +++ b/src/store/modules/profile.ts @@ -16,7 +16,7 @@ */ import { defineStore } from "pinia"; import { Duration } from "@/types/app"; -import { Service } from "@/types/selector"; +import { Endpoint } from "@/types/selector"; import { TaskListItem, SegmentSpan, @@ -31,7 +31,7 @@ import { AxiosResponse } from "axios"; import { useAppStoreWithOut } from "@/store/modules/app"; interface ProfileState { - services: Service[]; + endpoints: Endpoint[]; durationTime: Duration; condition: { serviceId: string; endpointName: string }; taskList: TaskListItem[]; @@ -47,7 +47,7 @@ interface ProfileState { export const profileStore = defineStore({ id: "profile", state: (): ProfileState => ({ - services: [{ value: "0", label: "All" }], + endpoints: [{ value: "", label: "All" }], durationTime: useAppStoreWithOut().durationTime, condition: { serviceId: "", endpointName: "" }, taskList: [], @@ -75,14 +75,16 @@ export const profileStore = defineStore({ setHighlightTop() { this.highlightTop = !this.highlightTop; }, - async getServices(layer: string) { - const res: AxiosResponse = await graphql.query("queryServices").params({ - layer, + async getEndpoints(serviceId: string, keyword?: string) { + const res: AxiosResponse = await graphql.query("queryEndpoints").params({ + serviceId, + duration: this.durationTime, + keyword: keyword || "", }); if (res.data.errors) { return res.data; } - this.services = res.data.data.services; + this.endpoints = [{ value: "", label: "All" }, ...res.data.data.pods]; return res.data; }, async getTaskList() { diff --git a/src/store/modules/trace.ts b/src/store/modules/trace.ts index a7178a0d..794cdffa 100644 --- a/src/store/modules/trace.ts +++ b/src/store/modules/trace.ts @@ -95,10 +95,7 @@ export const traceStore = defineStore({ if (res.data.errors) { return res.data; } - this.instances = [ - { value: "0", label: "All" }, - ...res.data.data.pods, - ] || [{ value: " 0", label: "All" }]; + this.instances = [{ value: "0", label: "All" }, ...res.data.data.pods]; return res.data; }, async getEndpoints(id: string, keyword?: string) { @@ -113,10 +110,7 @@ export const traceStore = defineStore({ if (res.data.errors) { return res.data; } - this.endpoints = [ - { value: "0", label: "All" }, - ...res.data.data.pods, - ] || [{ value: "0", label: "All" }]; + this.endpoints = [{ value: "0", label: "All" }, ...res.data.data.pods]; return res.data; }, async getTraces() { diff --git a/src/views/dashboard/panel/Tool.vue b/src/views/dashboard/panel/Tool.vue index 0752485e..6d0339b0 100644 --- a/src/views/dashboard/panel/Tool.vue +++ b/src/views/dashboard/panel/Tool.vue @@ -465,7 +465,7 @@ function setControls(id: string) { dashboardStore.addControl("Profile"); break; case "addEbpf": - dashboardStore.addTabControls("Ebpf"); + dashboardStore.addControl("Ebpf"); break; case "addLog": dashboardStore.addControl("Log"); diff --git a/src/views/dashboard/related/profile/Header.vue b/src/views/dashboard/related/profile/Header.vue index e2215391..2d683606 100644 --- a/src/views/dashboard/related/profile/Header.vue +++ b/src/views/dashboard/related/profile/Header.vue @@ -14,19 +14,18 @@ See the License for the specific language governing permissions and limitations under the License. -->