-
-
-
-
-
-
+
+
+
+
+
+
+
+ {{ scope.row.status }}
+
+
@@ -44,7 +30,7 @@ export default {
},
methods: {
fetchTableData() {
- fetch('http://localhost:5090/dashboard/nodes', {
+ fetch('http://localhost:5000/dashboard/nodes', {
method: 'Get',
headers: {
'Content-Type': 'application/json'
@@ -52,10 +38,33 @@ export default {
})
.then(response => response.json())
.then(data => {
- console.log('looking handsome', data)
+ // 转换数据为json
+ const parseClusterData = (clusterString, clusterName) => {
+ const rows = clusterString.trim().split('\n').slice(1)
+ return rows.map(row => {
+ const columns = row.trim().split(/\s{2,}/)
+ return {
+ cluster: clusterName,
+ name: columns[0],
+ status: columns[1],
+ role: columns[2],
+ age: columns[3],
+ version: columns[4],
+ ip: columns[5],
+ externalIp: columns[6] || '