Skip to content

Commit

Permalink
enable topo show
Browse files Browse the repository at this point in the history
Signed-off-by: Jianwei Mao <[email protected]>
  • Loading branch information
MaoJianwei committed Sep 18, 2024
1 parent 1a39c6e commit 0d9cb59
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
5 changes: 5 additions & 0 deletions webui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
服务配置
</el-menu-item>

<el-menu-item index="/topo">
<el-icon><Menu /></el-icon>
数字地图
</el-menu-item>

<el-menu-item index="/apiListOldApi">
<el-icon><Menu /></el-icon>
API列表、老版WebUI
Expand Down
34 changes: 31 additions & 3 deletions webui/src/components/ONOS.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
<template>
<iframe src="https://dev.maojianwei.com:4433/onos/ui" width="100%" height="100%"></iframe>
<!-- <div id="onosOrTips" style="height: 100%; width: 100%;"></div>-->

<el-text id="onosTips" :type="tipsType" size="large"></el-text>

<!--<iframe src="https://dev.maojianwei.com:4433/onos/ui" width="100%" height="100%"></iframe>-->
</template>



<script>
export default {
name: "DeviceControl",
name: "ONOS",
data() {
return {}
return {
tipsType:"danger",
};
},
mounted() {
this.queryOnosPage();
},
methods: {
queryOnosPage() {
var vueThis = this;
this.$http.get("/api/getOnosInfo")
.then(function (res) {
var addrPort = res.data["addrPort"];
if (addrPort != null && addrPort !== "") {
vueThis.tipsType = "success";
document.getElementById("onosTips").innerText = "在新窗口中查看拓扑";
window.open("http://" + addrPort + "/onos/ui", "_blank");
} else {
vueThis.tipsType = "warning";
document.getElementById("onosTips").innerText = "拓扑接口暂未配置";
}
})
.catch(function (err) {
console.log("errMao: " + err);
vueThis.tipsType = "danger";
document.getElementById("onosTips").innerText = "拓扑接口获取异常:" + err;
});
},
}
}
</script>
2 changes: 1 addition & 1 deletion webui/src/mao-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default createRouter({
}
},
{
path: '/onos',
path: '/topo',
components: {
maoMain: ONOS
}
Expand Down

0 comments on commit 0d9cb59

Please sign in to comment.