feat: Implement creating tasks UI for network profiling widget (#193)

This commit is contained in:
Fine0830
2022-11-28 17:57:23 +08:00
committed by GitHub
parent 23e9742946
commit d8f91bbdf3
10 changed files with 344 additions and 34 deletions

View File

@@ -110,13 +110,23 @@ export const networkProfilingStore = defineStore({
this.calls = calls;
this.nodes = data.nodes;
},
async createNetworkTask(param: {
serviceId: string;
serviceInstanceId: string;
}) {
async createNetworkTask(
instanceId: string,
params: {
uriRegex: string;
when4xx: string;
when5xx: string;
minDuration: number;
}[]
) {
const res: AxiosResponse = await graphql
.query("newNetworkProfiling")
.params({ request: { instanceId: param.serviceInstanceId } });
.params({
request: {
instanceId,
samplings: params,
},
});
if (res.data.errors) {
return res.data;