mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
feat: Implement the eBPF profile widget on dashboard (#72)
This commit is contained in:
@@ -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,8 @@ import { AxiosResponse } from "axios";
|
||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
|
||||
interface ProfileState {
|
||||
services: Service[];
|
||||
endpoints: Endpoint[];
|
||||
taskEndpoints: Endpoint[];
|
||||
durationTime: Duration;
|
||||
condition: { serviceId: string; endpointName: string };
|
||||
taskList: TaskListItem[];
|
||||
@@ -47,7 +48,8 @@ interface ProfileState {
|
||||
export const profileStore = defineStore({
|
||||
id: "profile",
|
||||
state: (): ProfileState => ({
|
||||
services: [{ value: "0", label: "All" }],
|
||||
endpoints: [{ value: "", label: "All" }],
|
||||
taskEndpoints: [{ value: "", label: "All" }],
|
||||
durationTime: useAppStoreWithOut().durationTime,
|
||||
condition: { serviceId: "", endpointName: "" },
|
||||
taskList: [],
|
||||
@@ -75,14 +77,28 @@ 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 getTaskEndpoints(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.taskEndpoints = [{ value: "", label: "All" }, ...res.data.data.pods];
|
||||
return res.data;
|
||||
},
|
||||
async getTaskList() {
|
||||
|
Reference in New Issue
Block a user