diff --git a/src/main.ts b/src/main.ts index 1216605..473f31c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,10 +20,16 @@ interface Statistics { "port": number, "ssl_cert_path": string, "ssl_key_path": string, - "node_list": [] + "node_list": nodeList[], } } +interface nodeList { + "endpoint": string, + "name": string, + "type": string, +} + const app = createApp(App); app.use(router); app.mount('#app'); diff --git a/src/utils/util.ts b/src/utils/util.ts index f25a72b..9c80b03 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -128,4 +128,19 @@ export function getCoreType(name: string) { default: return '未知'; } +} + +export function formatNodeClientType(type: string) { + switch (type) { + case 'nodeside': + case 'Nodeside': + case 'nodeclient': + case 'Nodeclient': + return 'NodeClient'; + case 'alist': + case 'Alist': + return 'AList'; + default: + return '未知'; + } } \ No newline at end of file diff --git a/src/views/NodeList.vue b/src/views/NodeList.vue index d1a305e..6f907eb 100644 --- a/src/views/NodeList.vue +++ b/src/views/NodeList.vue @@ -1,14 +1,17 @@