mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
fix: params
This commit is contained in:
parent
e0bc912e12
commit
0be1e6d26c
@ -544,11 +544,13 @@ 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 }) {
|
async getHierarchyServiceTopology() {
|
||||||
if (!(params.serviceId && params.layer)) {
|
if (!(this.node.id && this.node.layer)) {
|
||||||
return new Promise((resolve) => resolve({}));
|
return new Promise((resolve) => resolve({}));
|
||||||
}
|
}
|
||||||
const res: AxiosResponse = await graphql.query("getHierarchyServiceTopology").params(params);
|
const res: AxiosResponse = await graphql
|
||||||
|
.query("getHierarchyServiceTopology")
|
||||||
|
.params({ serviceId: this.node.id, layer: this.node.layer });
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,6 @@ limitations under the License. -->
|
|||||||
const graph = ref<Nullable<any>>(null);
|
const graph = ref<Nullable<any>>(null);
|
||||||
const settings = ref<any>(props.config);
|
const settings = ref<any>(props.config);
|
||||||
const graphConfig = computed(() => props.config.graph || {});
|
const graphConfig = computed(() => props.config.graph || {});
|
||||||
const depth = ref<number>(graphConfig.value.depth || 2);
|
|
||||||
const topologyLayout = ref<any>({});
|
const topologyLayout = ref<any>({});
|
||||||
const popover = ref<Nullable<any>>(null);
|
const popover = ref<Nullable<any>>(null);
|
||||||
const graphWidth = ref<number>(100);
|
const graphWidth = ref<number>(100);
|
||||||
@ -154,7 +153,7 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
async function freshNodes() {
|
async function freshNodes() {
|
||||||
topologyStore.setHierarchyServiceNode(null);
|
topologyStore.setHierarchyServiceNode(null);
|
||||||
const resp = await getTopology();
|
const resp = await topologyStore.getHierarchyServiceTopology();
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|
||||||
if (resp && resp.errors) {
|
if (resp && resp.errors) {
|
||||||
@ -164,7 +163,6 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function update() {
|
async function update() {
|
||||||
window.addEventListener("resize", resize);
|
|
||||||
await initLegendMetrics();
|
await initLegendMetrics();
|
||||||
draw();
|
draw();
|
||||||
popover.value = d3.select("#popover");
|
popover.value = d3.select("#popover");
|
||||||
@ -287,9 +285,10 @@ limitations under the License. -->
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
hideTip();
|
hideTip();
|
||||||
topologyStore.setHierarchyServiceNode(d);
|
topologyStore.setHierarchyServiceNode(d);
|
||||||
// handleGoDashboard(d.name);
|
handleGoDashboard();
|
||||||
}
|
}
|
||||||
function handleGoDashboard(name: string) {
|
function handleGoDashboard() {
|
||||||
|
const name = ""; // todo
|
||||||
const path = `/dashboard/${dashboardStore.layerId}/${EntityType[0].value}/${topologyStore.node.id}/${name}`;
|
const path = `/dashboard/${dashboardStore.layerId}/${EntityType[0].value}/${topologyStore.node.id}/${name}`;
|
||||||
const routeUrl = router.resolve({ path });
|
const routeUrl = router.resolve({ path });
|
||||||
|
|
||||||
@ -297,28 +296,11 @@ limitations under the License. -->
|
|||||||
dashboardStore.setEntity(origin);
|
dashboardStore.setEntity(origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTopology() {
|
|
||||||
const ids = selectorStore.services.map((d: Service) => d.id);
|
|
||||||
const serviceIds = dashboardStore.entity === EntityType[0].value ? [selectorStore.currentService.id] : ids;
|
|
||||||
const resp = await topologyStore.getDepthServiceTopology(serviceIds, Number(depth.value));
|
|
||||||
return resp;
|
|
||||||
}
|
|
||||||
function resize() {
|
|
||||||
const dom = document.querySelector(".hierarchy-related")?.getBoundingClientRect() || {
|
|
||||||
height: 40,
|
|
||||||
width: 0,
|
|
||||||
};
|
|
||||||
height.value = dom.height - 80;
|
|
||||||
width.value = dom.width;
|
|
||||||
}
|
|
||||||
function svgEvent() {
|
function svgEvent() {
|
||||||
topologyStore.setHierarchyServiceNode(null);
|
topologyStore.setHierarchyServiceNode(null);
|
||||||
dashboardStore.selectWidget(props.config);
|
dashboardStore.selectWidget(props.config);
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
|
||||||
window.removeEventListener("resize", resize);
|
|
||||||
});
|
|
||||||
watch(
|
watch(
|
||||||
() => appStore.durationTime,
|
() => appStore.durationTime,
|
||||||
() => {
|
() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user