diff --git a/topology/web/package.json b/topology/web/package.json index 7cc93f8aa6bb83fe68069561312d04c9c71b1963..8d7286859985e9ae191e7714c9d79a1864afa3dc 100644 --- a/topology/web/package.json +++ b/topology/web/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@antv/g6": "^4.8.21", + "@element-plus/icons-vue": "^2.1.0", "@vue/reactivity": "^3.3.4", "@vue/shared": "^3.3.4", "axios": "^1.5.0", diff --git a/topology/web/src/main.ts b/topology/web/src/main.ts index 59e06568019a6038ffaef5c26358c52d1c7bb1cb..b0a599a5fd09951e92c34abe4f83d108c2bf7a95 100644 --- a/topology/web/src/main.ts +++ b/topology/web/src/main.ts @@ -4,6 +4,7 @@ import { createApp } from 'vue' import { createPinia } from 'pinia' import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' +import * as ElementPlusIconsVue from '@element-plus/icons-vue' import App from './App.vue' import router from './router' @@ -12,5 +13,8 @@ const app = createApp(App) app.use(createPinia()) app.use(router) app.use(ElementPlus) +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component) +} app.mount('#app') diff --git a/topology/web/src/request/api.ts b/topology/web/src/request/api.ts index e61e89191c8006729624b5b63618d7a486c01fcd..229568509b437c525230a75920ae671cd8acd973 100644 --- a/topology/web/src/request/api.ts +++ b/topology/web/src/request/api.ts @@ -26,6 +26,15 @@ export const topo = { throw error; } }, + + async host_list() { + try { + const response = await request.get('/agentlist'); + return response.data; + } catch (error) { + throw error; + } + }, // 添加其他API请求方法 }; diff --git a/topology/web/src/views/NodeView.vue b/topology/web/src/views/NodeView.vue index d71741a66197f64c098c94cae1f022f965b2e333..412f48dfe44f24ee5db99df66faaebb96c573b85 100644 --- a/topology/web/src/views/NodeView.vue +++ b/topology/web/src/views/NodeView.vue @@ -1,21 +1,38 @@