mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-01 21:44:57 +00:00
update selector for events (#26)
This commit is contained in:
parent
0f667d967e
commit
24f07cfdb1
@ -38,7 +38,7 @@ export const eventStore = defineStore({
|
|||||||
loading: false,
|
loading: false,
|
||||||
events: [],
|
events: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
services: [{ value: "", label: "" }],
|
services: [{ value: "", label: "All" }],
|
||||||
instances: [{ value: "", label: "All" }],
|
instances: [{ value: "", label: "All" }],
|
||||||
endpoints: [{ value: "", label: "All" }],
|
endpoints: [{ value: "", label: "All" }],
|
||||||
condition: {
|
condition: {
|
||||||
@ -51,6 +51,10 @@ export const eventStore = defineStore({
|
|||||||
this.condition = { ...this.condition, ...data };
|
this.condition = { ...this.condition, ...data };
|
||||||
},
|
},
|
||||||
async getServices(layer: string) {
|
async getServices(layer: string) {
|
||||||
|
if (!layer) {
|
||||||
|
this.services = [{ value: "", label: "All" }];
|
||||||
|
return new Promise((resolve) => resolve([]));
|
||||||
|
}
|
||||||
const res: AxiosResponse = await graphql.query("queryServices").params({
|
const res: AxiosResponse = await graphql.query("queryServices").params({
|
||||||
layer,
|
layer,
|
||||||
});
|
});
|
||||||
|
@ -124,9 +124,6 @@ getSelectors();
|
|||||||
|
|
||||||
async function getSelectors() {
|
async function getSelectors() {
|
||||||
await getLayers();
|
await getLayers();
|
||||||
if (!state.currentLayer) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
getServices();
|
getServices();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,10 +166,13 @@ async function getLayers() {
|
|||||||
ElMessage.error(resp.errors);
|
ElMessage.error(resp.errors);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.currentLayer = resp.data.layers[0] || "";
|
state.currentLayer = "";
|
||||||
state.layers = resp.data.layers.map((d: string) => {
|
state.layers = [
|
||||||
return { label: d, value: d };
|
{ label: "All", value: "" },
|
||||||
});
|
...resp.data.layers.map((d: string) => {
|
||||||
|
return { label: d, value: d };
|
||||||
|
}),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
async function queryEvents() {
|
async function queryEvents() {
|
||||||
|
Loading…
Reference in New Issue
Block a user