mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: add topology query
This commit is contained in:
parent
26d0a8d681
commit
0523a04c51
@ -99,3 +99,39 @@ export const ProcessTopology = {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
|
export const HierarchyServiceTopology = {
|
||||||
|
variable: "$serviceId: ID!, $layer: String!",
|
||||||
|
query: `
|
||||||
|
hierarchyServiceTopology: getServiceHierarchy(serviceId: $serviceId, layer: $layer) {
|
||||||
|
relations {
|
||||||
|
upperService {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
layer
|
||||||
|
}
|
||||||
|
lowerService {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
layer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`,
|
||||||
|
};
|
||||||
|
export const HierarchyInstanceTopology = {
|
||||||
|
variable: "$instanceId: ID!, $layer: String!",
|
||||||
|
query: `
|
||||||
|
HierarchyInstanceTopology: getInstanceHierarchy(instanceId: $instanceId, layer: $layer) {
|
||||||
|
relations {
|
||||||
|
upperInstance {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
layer
|
||||||
|
}
|
||||||
|
lowerInstance {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
layer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`,
|
||||||
|
};
|
||||||
|
@ -14,9 +14,18 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { InstanceTopology, EndpointTopology, ServicesTopology, ProcessTopology } from "../fragments/topology";
|
import {
|
||||||
|
InstanceTopology,
|
||||||
|
EndpointTopology,
|
||||||
|
ServicesTopology,
|
||||||
|
ProcessTopology,
|
||||||
|
HierarchyServiceTopology,
|
||||||
|
HierarchyInstanceTopology,
|
||||||
|
} from "../fragments/topology";
|
||||||
|
|
||||||
export const getInstanceTopology = `query queryData(${InstanceTopology.variable}) {${InstanceTopology.query}}`;
|
export const getInstanceTopology = `query queryData(${InstanceTopology.variable}) {${InstanceTopology.query}}`;
|
||||||
export const getEndpointTopology = `query queryData(${EndpointTopology.variable}) {${EndpointTopology.query}}`;
|
export const getEndpointTopology = `query queryData(${EndpointTopology.variable}) {${EndpointTopology.query}}`;
|
||||||
export const getServicesTopology = `query queryData(${ServicesTopology.variable}) {${ServicesTopology.query}}`;
|
export const getServicesTopology = `query queryData(${ServicesTopology.variable}) {${ServicesTopology.query}}`;
|
||||||
export const getProcessTopology = `query queryData(${ProcessTopology.variable}) {${ProcessTopology.query}}`;
|
export const getProcessTopology = `query queryData(${ProcessTopology.variable}) {${ProcessTopology.query}}`;
|
||||||
|
export const getHierarchyInstanceTopology = `query queryData(${HierarchyInstanceTopology.variable}) {${HierarchyInstanceTopology.query}}`;
|
||||||
|
export const getHierarchyServiceTopology = `query queryData(${HierarchyServiceTopology.variable}) {${HierarchyServiceTopology.query}}`;
|
||||||
|
@ -481,6 +481,26 @@ export const topologyStore = defineStore({
|
|||||||
this.setLinkClientMetrics(res.data.data);
|
this.setLinkClientMetrics(res.data.data);
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
|
async getHierarchyServiceTopology(params: { serviceId: string; layer: string }) {
|
||||||
|
if (!params.serviceId || !params.layer) {
|
||||||
|
return new Promise((resolve) => resolve({}));
|
||||||
|
}
|
||||||
|
const res: AxiosResponse = await graphql.query("getHierarchyServiceTopology").params(params);
|
||||||
|
if (res.data.errors) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return res.data;
|
||||||
|
},
|
||||||
|
async getHierarchyInstanceTopology(params: { instanceId: string; layer: string }) {
|
||||||
|
if (!params.instanceId || !params.layer) {
|
||||||
|
return new Promise((resolve) => resolve({}));
|
||||||
|
}
|
||||||
|
const res: AxiosResponse = await graphql.query("getHierarchyServiceTopology").params(params);
|
||||||
|
if (res.data.errors) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return res.data;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user