in src/store/modules/event.ts [76:105]
async getEvents() {
this.loading = true;
const res: AxiosResponse = await graphql.query("queryEvents").params({
condition: {
...this.condition,
time: useAppStoreWithOut().durationTime,
},
});
this.loading = false;
if (res.data.errors) {
return res.data;
}
if (res.data.data.fetchEvents) {
this.events = (res.data.data.fetchEvents.events || []).map((item: Event) => {
let scope = "Service";
if (item.source.serviceInstance) {
scope = "ServiceInstance";
}
if (item.source.endpoint) {
scope = "Endpoint";
}
item.scope = scope;
if (!item.endTime || item.endTime === item.startTime) {
item.endTime = Number(item.startTime) + 60000;
}
return item;
});
}
return res.data;
},