update style

This commit is contained in:
Qiuxia Fan 2022-03-22 15:59:01 +08:00
parent 01d8157099
commit 02157848b6
2 changed files with 15 additions and 1 deletions

View File

@ -163,6 +163,10 @@ function clickEndpoint(scope: any) {
layer: dashboardStore.layerId,
entity: EntityType[2].value,
});
if (!d) {
ElMessage.error("No this dashboard");
return;
}
dashboardStore.setEntity(EntityType[2].value);
dashboardStore.setCurrentDashboard(d);
router.push(

View File

@ -49,7 +49,7 @@ limitations under the License. -->
</div>
<div
class="sankey"
:style="`height:${height}px;width:${width}px;`"
:style="`height:${height - 30}px;width:${width}px;`"
v-loading="loading"
element-loading-background="rgba(0, 0, 0, 0)"
@click="handleClick"
@ -120,6 +120,7 @@ const items = [
onMounted(() => {
loadTopology(selectorStore.currentPod && selectorStore.currentPod.id);
window.addEventListener("resize", resize);
});
async function loadTopology(id: string) {
@ -140,6 +141,15 @@ async function loadTopology(id: string) {
topologyStore.queryNodeMetrics(settings.value.nodeMetrics || []);
}
function resize() {
const dom = document.querySelector(".topology")?.getBoundingClientRect() || {
height: 40,
width: 0,
};
height.value = dom.height - 40;
width.value = dom.width;
}
function inspect() {
const id = topologyStore.node.id;
topologyStore.setNode(null);