feat: Support searching endpoints with keyword (#43)

This commit is contained in:
Fine0830
2022-03-28 18:07:09 +08:00
committed by GitHub
parent d78ca0cd4b
commit 0a29a86c34
13 changed files with 200 additions and 151 deletions

View File

@@ -86,14 +86,14 @@ export const logStore = defineStore({
] || [{ value: " 0", label: "All" }];
return res.data;
},
async getEndpoints(id: string) {
async getEndpoints(id: string, keyword?: string) {
const serviceId = this.selectorStore.currentService
? this.selectorStore.currentService.id
: id;
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
serviceId,
duration: this.durationTime,
keyword: "",
keyword: keyword || "",
});
if (res.data.errors) {
return res.data;

View File

@@ -101,14 +101,14 @@ export const traceStore = defineStore({
] || [{ value: " 0", label: "All" }];
return res.data;
},
async getEndpoints(id: string) {
async getEndpoints(id: string, keyword?: string) {
const serviceId = this.selectorStore.currentService
? this.selectorStore.currentService.id
: id;
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
serviceId,
duration: this.durationTime,
keyword: "",
keyword: keyword || "",
});
if (res.data.errors) {
return res.data;