mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
fix: Avoid querying data with empty parameters
This commit is contained in:
parent
6fb4f074c1
commit
66cfbd2700
@ -191,6 +191,9 @@ export const topologyStore = defineStore({
|
||||
}
|
||||
},
|
||||
async getServicesTopology(serviceIds: string[]) {
|
||||
if (!serviceIds.length) {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
}
|
||||
const duration = useAppStoreWithOut().durationTime;
|
||||
const res: AxiosResponse = await graphql.query("getServicesTopology").params({
|
||||
serviceIds,
|
||||
@ -207,7 +210,7 @@ export const topologyStore = defineStore({
|
||||
const clientServiceId = (currentDestService && currentDestService.id) || "";
|
||||
const duration = useAppStoreWithOut().durationTime;
|
||||
if (!(serverServiceId && clientServiceId)) {
|
||||
return;
|
||||
return new Promise((resolve) => resolve({}));
|
||||
}
|
||||
const res: AxiosResponse = await graphql.query("getInstanceTopology").params({
|
||||
clientServiceId,
|
||||
@ -220,6 +223,9 @@ export const topologyStore = defineStore({
|
||||
return res.data;
|
||||
},
|
||||
async updateEndpointTopology(endpointIds: string[], depth: number) {
|
||||
if (!endpointIds.length) {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
}
|
||||
const res = await this.getEndpointTopology(endpointIds);
|
||||
if (depth > 1) {
|
||||
const ids = res.nodes.map((item: Node) => item.id).filter((d: string) => !endpointIds.includes(d));
|
||||
@ -285,6 +291,9 @@ export const topologyStore = defineStore({
|
||||
}
|
||||
},
|
||||
async getEndpointTopology(endpointIds: string[]) {
|
||||
if (!endpointIds.length) {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
}
|
||||
const duration = useAppStoreWithOut().durationTime;
|
||||
const variables = ["$duration: Duration!"];
|
||||
const fragment = endpointIds.map((id: string, index: number) => {
|
||||
|
Loading…
Reference in New Issue
Block a user