diff --git a/src/api/overview.js b/src/api/overview.js
index 826b675..976551f 100644
--- a/src/api/overview.js
+++ b/src/api/overview.js
@@ -23,7 +23,7 @@ export function getClusterResource() {
export function getNodeBriefMessage() {
return request({
- url: 'kapis/monitoring.kubesphere.io/v1alpha3/nodes?type=rank&metrics_filter=node_cpu_utilisation%7Cnode_cpu_usage%7Cnode_cpu_total%7Cnode_memory_utilisation%7Cnode_memory_usage_wo_cache%7Cnode_memory_total%7Cnode_disk_size_utilisation%7Cnode_disk_size_usage%7Cnode_disk_size_capacity%7Cnode_pod_utilisation%7Cnode_pod_running_count%7Cnode_pod_quota%7Cnode_disk_inode_utilisation%7Cnode_disk_inode_total%7Cnode_disk_inode_usage%7Cnode_load1%24&page=1&limit=10&sort_type=desc&sort_metric=node_cpu_utilisation',
+ url: 'kapis/monitoring.kubesphere.io/v1alpha3/nodes?type=rank&metrics_filter=node_cpu_utilisation%7Cnode_cpu_usage%7Cnode_cpu_total%7Cnode_memory_utilisation%7Cnode_memory_usage_wo_cache%7Cnode_memory_total%7Cnode_disk_size_utilisation%7Cnode_disk_size_usage%7Cnode_disk_size_capacity%7Cnode_pod_utilisation%7Cnode_pod_running_count%7Cnode_pod_quota%7Cnode_disk_inode_utilisation%7Cnode_disk_inode_total%7Cnode_disk_inode_usage%7Cnode_load1%24&page=1&limit=5&sort_type=desc&sort_metric=node_cpu_utilisation',
method: 'get'
})
}
diff --git a/src/api/storageManagement.js b/src/api/storageManagement.js
index bf236a1..5e409ab 100644
--- a/src/api/storageManagement.js
+++ b/src/api/storageManagement.js
@@ -1,8 +1,8 @@
import request from '@/utils/request'
-export function getVolume() {
+export function getVolume(page) {
return request({
- url: 'kapis/resources.kubesphere.io/v1alpha3/persistentvolumeclaims?sortBy=createTime&limit=10',
+ url: 'kapis/resources.kubesphere.io/v1alpha3/persistentvolumeclaims?sortBy=createTime&limit=10&page=' + page,
method: 'get'
})
}
diff --git a/src/api/workloadManagement.js b/src/api/workloadManagement.js
index bfc4496..85c1bad 100644
--- a/src/api/workloadManagement.js
+++ b/src/api/workloadManagement.js
@@ -1,36 +1,36 @@
import request from '@/utils/request'
-export function getDeployments() {
+export function getDeployments(page) {
return request({
- url: 'kapis/resources.kubesphere.io/v1alpha3/deployments?sortBy=updateTime&limit=10',
+ url: 'kapis/resources.kubesphere.io/v1alpha3/deployments?sortBy=updateTime&limit=10&page=' + page,
method: 'get'
})
}
-export function getStatefulSets() {
+export function getStatefulSets(page) {
return request({
- url: 'kapis/resources.kubesphere.io/v1alpha3/statefulsets?sortBy=createTime&limit=10',
+ url: 'kapis/resources.kubesphere.io/v1alpha3/statefulsets?sortBy=createTime&limit=10&page=' + page,
method: 'get'
})
}
-export function getDaemonSets() {
+export function getDaemonSets(page) {
return request({
- url: 'kapis/resources.kubesphere.io/v1alpha3/daemonsets?sortBy=createTime&limit=10',
+ url: 'kapis/resources.kubesphere.io/v1alpha3/daemonsets?sortBy=createTime&limit=10&page=' + page,
method: 'get'
})
}
-export function getPods() {
+export function getPods(page) {
return request({
- url: 'kapis/resources.kubesphere.io/v1alpha3/pods?sortBy=startTime&limit=10',
+ url: 'kapis/resources.kubesphere.io/v1alpha3/pods?sortBy=startTime&limit=10&page=' + page,
method: 'get'
})
}
-export function getServices() {
+export function getServices(page) {
return request({
- url: 'kapis/resources.kubesphere.io/v1alpha3/services?sortBy=createTime&limit=10',
+ url: 'kapis/resources.kubesphere.io/v1alpha3/services?sortBy=createTime&limit=10&page=' + page,
method: 'get'
})
}
diff --git a/src/components/ClusterManagement/componentStatus.vue b/src/components/ClusterManagement/componentStatus.vue
index 8589ea2..b27ffab 100644
--- a/src/components/ClusterManagement/componentStatus.vue
+++ b/src/components/ClusterManagement/componentStatus.vue
@@ -35,17 +35,17 @@ export default {
getSchedulerState().then(response => {
let schedulerSchedulingTimes, schedulingFailedPods, temp1, temp2
- console.log(response['results'][0]['data'])
+ // console.log(response['results'][0]['data'])
if (response['results'][0]['data']['result'] != null) {
for (let l = 0; l < response['results'][0]['data']['result'].length; l++) {
- console.log(1)
+ // console.log(1)
if (response['results'][0]['data']['result'][l]['metric']['result'] === 'scheduled') { schedulerSchedulingTimes = parseInt(response['results'][0]['data']['result'][l]['value'][1]) }
if (response['results'][0]['data']['result'][l]['metric']['result'] === 'error') { temp1 = parseInt(response['results'][0]['data']['result'][l]['value'][1]) }
if (response['results'][0]['data']['result'][l]['metric']['result'] === 'unschedulable') { temp2 = parseInt(response['results'][0]['data']['result'][l]['value'][1]) }
}
schedulingFailedPods = temp1 + temp2
} else {
- console.log(0)
+ // console.log(0)
schedulerSchedulingTimes = '-'
schedulingFailedPods = '-'
}
diff --git a/src/components/ClusterManagement/nodeMessage.vue b/src/components/ClusterManagement/nodeMessage.vue
index 8644e63..29d04ba 100644
--- a/src/components/ClusterManagement/nodeMessage.vue
+++ b/src/components/ClusterManagement/nodeMessage.vue
@@ -23,22 +23,24 @@ export default {
const data = []
getNodeBriefMessage().then(response => {
- const LENGTH = response['results'].length
+ const LENGTH = response.total_item
+ // console.log(response.items.length)
console.log(LENGTH)
let index = 0
+
for (let item = 0; item < LENGTH; item++) {
if (response['results'][item]['metric_name'] === 'node_cpu_utilisation') {
index = item
- break
+ continue
}
}
- console.log('ITEM' + index)
- console.log(response['results'][index]['data']['result'].length)
+ console.log('index : ' + index)
+ // console.log(response['results'][index]['data']['result'].length)
let name, ip, role, cpu
for (let l = 0; l < response['results'][index]['data']['result'].length; l++) {
if (JSON.stringify(response['results'][index]['data']['result'][l]) === '{}') { continue }
const obj = {}
- console.log(response['results'][index]['data']['result'][l])
+ // console.log(response['results'][index]['data']['result'][l])
name = response['results'][index]['data']['result'][l]['metric']['node']
ip = response['results'][index]['data']['result'][l]['metric']['host_ip']
role = response['results'][index]['data']['result'][l]['metric']['role']
@@ -46,7 +48,7 @@ export default {
obj.node = name + ' (' + ip + ')'
if (role === 'master') { obj.role = role } else { obj.role = 'node' }
obj.cpu = cpu + '%'
- console.log(l + ',' + obj)
+ // console.log(l + ',' + obj)
data[l] = obj
}
this.nodeMessage = data
diff --git a/src/components/ClusterManagement/nodeStatus.vue b/src/components/ClusterManagement/nodeStatus.vue
index 1c2723e..7ebd430 100644
--- a/src/components/ClusterManagement/nodeStatus.vue
+++ b/src/components/ClusterManagement/nodeStatus.vue
@@ -1,6 +1,6 @@
节点详细信息