forked from JointCloud/JCC-RIP
fix
This commit is contained in:
parent
1af8dcd90f
commit
e0e223e59f
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 集群管理页面--集群总数
|
||||
export function getClusterNum() {
|
||||
return request({
|
||||
url: 'kapis/monitoring.kubesphere.io/v1alpha3/kubesphere?start=1623358470&end=1623370470&step=600s×=20&metrics_filter=kubesphere_cluser_count%24',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis/monitoring.kubesphere.io/v1alpha3/kubesphere?start=1623358470&end=1623370470&step=600s×=20&metrics_filter=kubesphere_cluser_count%24',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ export function getClusterNum() {
|
|||
// 集群管理页面--主机群信息
|
||||
export function getHostNum() {
|
||||
return request({
|
||||
url: 'kapis/resources.kubesphere.io/v1alpha3/clusters?labelSelector=cluster-role.kubesphere.io%2Fhost%3D&limit=-1&sortBy=createTime&page=1',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis/resources.kubesphere.io/v1alpha3/clusters?labelSelector=cluster-role.kubesphere.io%2Fhost%3D&limit=-1&sortBy=createTime&page=1',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export function getHostNum() {
|
|||
// 集群管理页面--从集群信息
|
||||
export function getMemberNum() {
|
||||
return request({
|
||||
url: 'kapis/resources.kubesphere.io/v1alpha3/clusters?limit=10&labelSelector=%21cluster-role.kubesphere.io%2Fhost&sortBy=createTime',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis/resources.kubesphere.io/v1alpha3/clusters?limit=10&labelSelector=%21cluster-role.kubesphere.io%2Fhost&sortBy=createTime',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 节点管理页面--节点详细信息列表
|
||||
export function getNodeMessage(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/nodes?sortBy=createTime',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/nodes?sortBy=createTime',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -12,7 +12,7 @@ export function getNodeMessage(url, query) {
|
|||
// 节点管理页面--节点详细信息状态栏
|
||||
export function getNodeStatus(customUrl) {
|
||||
return request({
|
||||
url: customUrl,
|
||||
url: process.env.VUE_APP_BASE_API + customUrl,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export function getNodeStatus(customUrl) {
|
|||
// 节点管理页面--Master节点数量
|
||||
export function getMasterNum(url) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/nodes?labelSelector=node-role.kubernetes.io%2Fmaster%3D',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/nodes?labelSelector=node-role.kubernetes.io%2Fmaster%3D',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ export function getMasterNum(url) {
|
|||
// 节点管理页面--总节点数量
|
||||
export function getTotalNum(url) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/nodes?sortBy=createTime&limit=10',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/nodes?sortBy=createTime&limit=10',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 容器概览页面--JCCE组件状态API
|
||||
export function getAPIState(url) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/monitoring.kubesphere.io/v1alpha3/components/apiserver?metrics_filter=apiserver_request_rate%7Capiserver_request_latencies',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/monitoring.kubesphere.io/v1alpha3/components/apiserver?metrics_filter=apiserver_request_rate%7Capiserver_request_latencies',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ export function getAPIState(url) {
|
|||
// 容器概览页面--JCCE组件状态调度器
|
||||
export function getSchedulerState(url) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/monitoring.kubesphere.io/v1alpha3/components/scheduler?metrics_filter=scheduler_schedule_attempts',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/monitoring.kubesphere.io/v1alpha3/components/scheduler?metrics_filter=scheduler_schedule_attempts',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export function getSchedulerState(url) {
|
|||
// 容器概览页面--集群资源使用情况
|
||||
export function getClusterResource(url) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/monitoring.kubesphere.io/v1alpha3/cluster?metrics_filter=cluster_cpu_usage%7Ccluster_cpu_total%7Ccluster_memory_usage_wo_cache%7Ccluster_memory_total%7Ccluster_disk_size_usage%7Ccluster_disk_size_capacity%7Ccluster_pod_running_count%7Ccluster_pod_quota%24',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/monitoring.kubesphere.io/v1alpha3/cluster?metrics_filter=cluster_cpu_usage%7Ccluster_cpu_total%7Ccluster_memory_usage_wo_cache%7Ccluster_memory_total%7Ccluster_disk_size_usage%7Ccluster_disk_size_capacity%7Ccluster_pod_running_count%7Ccluster_pod_quota%24',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export function getClusterResource(url) {
|
|||
// 容器概览页面--节点用量 Top5
|
||||
export function getNodeBriefMessage(url) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/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',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/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'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 项目管理页面--用户项目列表数量
|
||||
export function getBriefUserProject(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/namespaces?sortBy=createTime&labelSelector=kubesphere.io%2Fworkspace%21%3Dsystem-workspace%2C%21kubesphere.io%2Fkubefed-host-namespace%2C%21kubesphere.io%2Fdevopsproject',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/namespaces?sortBy=createTime&labelSelector=kubesphere.io%2Fworkspace%21%3Dsystem-workspace%2C%21kubesphere.io%2Fkubefed-host-namespace%2C%21kubesphere.io%2Fdevopsproject',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -12,7 +12,7 @@ export function getBriefUserProject(url, query) {
|
|||
// 项目管理页面--用户项目列表详情
|
||||
export function getDetailUserProject(customUrl) {
|
||||
return request({
|
||||
url: customUrl,
|
||||
url: process.env.VUE_APP_BASE_API + customUrl,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export function getDetailUserProject(customUrl) {
|
|||
// 项目管理页面--系统项目列表数量
|
||||
export function getBriefSystemProject(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/namespaces?sortBy=createTime&labelSelector=kubesphere.io%2Fworkspace%3Dsystem-workspace',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/namespaces?sortBy=createTime&labelSelector=kubesphere.io%2Fworkspace%3Dsystem-workspace',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -29,7 +29,7 @@ export function getBriefSystemProject(url, query) {
|
|||
// 项目管理页面--系统项目列表详情
|
||||
export function getDetailSystemProject(customUrl) {
|
||||
return request({
|
||||
url: customUrl,
|
||||
url: process.env.VUE_APP_BASE_API + customUrl,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -2,42 +2,42 @@ import request from '@/utils/promRequest'
|
|||
|
||||
export function node_load1(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query_range?query=node_load1%7B%7D&start=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query_range?query=node_load1%7B%7D&start=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function avg_node_load1(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query_range?query=avg%28node_load1%7B%7D%29%0A%0A&start=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query_range?query=avg%28node_load1%7B%7D%29%0A%0A&start=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function process_cpu_seconds_total(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query_range?query=%281+-+avg%28rate%28node_cpu_seconds_total%7Bmode%3D%22idle%22%7D%5B1m%5D%29%29+by+%28instance%29%29*100&start=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query_range?query=%281+-+avg%28rate%28node_cpu_seconds_total%7Bmode%3D%22idle%22%7D%5B1m%5D%29%29+by+%28instance%29%29*100&start=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function avg_process_cpu_seconds_total(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query_range?query=avg(1%20-%20avg(rate(node_cpu_seconds_total%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%2Cmode%3D%22idle%22%7D%5B2m%5D))%20by%20(instance))%20*%20100&start=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query_range?query=avg(1%20-%20avg(rate(node_cpu_seconds_total%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%2Cmode%3D%22idle%22%7D%5B2m%5D))%20by%20(instance))%20*%20100&start=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function avg_process_cpu_seconds_total_instance(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query?query=avg%281+-+avg%28rate%28node_cpu_seconds_total%7Bmode%3D%22idle%22%7D%5B30s%5D%29%29+by+%28instance%29%29+*+100&time=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query?query=avg%281+-+avg%28rate%28node_cpu_seconds_total%7Bmode%3D%22idle%22%7D%5B30s%5D%29%29+by+%28instance%29%29+*+100&time=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function resource_used(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query?query=avg%281+-+avg%28rate%28node_cpu_seconds_total%7Bmode%3D%22idle%22%7D%5B30s%5D%29%29+by+%28instance%29%29+*+100+%2B+%28sum%28node_memory_MemTotal_bytes-node_memory_MemAvailable_bytes%29+%2F+sum%28node_memory_MemTotal_bytes%29%29*100+%2B+%28sum%28avg%28node_filesystem_size_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29+-+sum%28avg%28node_filesystem_free_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29%29+*100%2F%28sum%28avg%28node_filesystem_avail_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29%2B%28sum%28avg%28node_filesystem_size_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29+-+sum%28avg%28node_filesystem_free_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29%29%29&time=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query?query=avg%281+-+avg%28rate%28node_cpu_seconds_total%7Bmode%3D%22idle%22%7D%5B30s%5D%29%29+by+%28instance%29%29+*+100+%2B+%28sum%28node_memory_MemTotal_bytes-node_memory_MemAvailable_bytes%29+%2F+sum%28node_memory_MemTotal_bytes%29%29*100+%2B+%28sum%28avg%28node_filesystem_size_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29+-+sum%28avg%28node_filesystem_free_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29%29+*100%2F%28sum%28avg%28node_filesystem_avail_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29%2B%28sum%28avg%28node_filesystem_size_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29+-+sum%28avg%28node_filesystem_free_bytes%7Bfstype%3D%7E%22xfs%7Cext.*%22%7D%29by%28device%2Cinstance%29%29%29%29&time=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -2,28 +2,28 @@ import request from '@/utils/promRequest'
|
|||
|
||||
export function load_average(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query_range?query=sum(node_load5%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D)&start=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query_range?query=sum(node_load5%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D)&start=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function cpu_average(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query_range?query=avg%281+-+avg%28rate%28node_cpu_seconds_total%7Bmode%3D%22idle%22%7D%5B30s%5D%29%29+by+%28instance%29%29+*+100&start=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query_range?query=avg%281+-+avg%28rate%28node_cpu_seconds_total%7Bmode%3D%22idle%22%7D%5B30s%5D%29%29+by+%28instance%29%29+*+100&start=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function memory_total(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query_range?query=sum(node_memory_MemTotal_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D%20-%20node_memory_MemAvailable_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D)&start=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query_range?query=sum(node_memory_MemTotal_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D%20-%20node_memory_MemAvailable_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D)&start=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function memory_average(url) {
|
||||
return request({
|
||||
url: '/prom/api/v1/query_range?query=(sum(node_memory_MemTotal_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D%20-%20node_memory_MemAvailable_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D)%20%2F%20sum(node_memory_MemTotal_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D))*100&start=' + url,
|
||||
url: process.env.VUE_APP_BASE_API + '/prom/api/v1/query_range?query=(sum(node_memory_MemTotal_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D%20-%20node_memory_MemAvailable_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D)%20%2F%20sum(node_memory_MemTotal_bytes%7Borigin_prometheus%3D~%22%22%2Cjob%3D~%22node-exporter%22%7D))*100&start=' + url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 存储管理页面--存储卷列表
|
||||
export function getVolume(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/persistentvolumeclaims?sortBy=createTime',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/persistentvolumeclaims?sortBy=createTime',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 负载管理页面--部署列表
|
||||
export function getDeployments(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/deployments?sortBy=updateTime',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/deployments?sortBy=updateTime',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -12,7 +12,7 @@ export function getDeployments(url, query) {
|
|||
// 负载管理页面--有状态副本集列表
|
||||
export function getStatefulSets(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/statefulsets?sortBy=createTime',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/statefulsets?sortBy=createTime',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -21,7 +21,7 @@ export function getStatefulSets(url, query) {
|
|||
// 负载管理页面--守护进程集列表
|
||||
export function getDaemonSets(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/daemonsets?sortBy=createTime',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/daemonsets?sortBy=createTime',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -30,7 +30,7 @@ export function getDaemonSets(url, query) {
|
|||
// 容器组管理页面--容器组列表
|
||||
export function getPods(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/pods?sortBy=startTime',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/pods?sortBy=startTime',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -39,7 +39,7 @@ export function getPods(url, query) {
|
|||
// 服务管理页面--服务列表
|
||||
export function getServices(url, query) {
|
||||
return request({
|
||||
url: 'kapis' + url + '/resources.kubesphere.io/v1alpha3/services?sortBy=createTime',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url + '/resources.kubesphere.io/v1alpha3/services?sortBy=createTime',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@ export default {
|
|||
// 弹性伸缩
|
||||
getAutoscaling(clusterName, namespace, name) {
|
||||
return request({
|
||||
url: `apis${clusterName}/autoscaling/v2beta2/namespaces/${namespace}/horizontalpodautoscalers/${name}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/apis${clusterName}/autoscaling/v2beta2/namespaces/${namespace}/horizontalpodautoscalers/${name}`,
|
||||
method: 'get'
|
||||
// headers: {
|
||||
// 'x-check-exist': true,
|
||||
|
@ -17,7 +17,7 @@ export default {
|
|||
// 弹性伸缩修改 Post
|
||||
editAutoscaling(clusterName, namespace, name, method, query) {
|
||||
return request({
|
||||
url: `apis${clusterName}/autoscaling/v2beta2/namespaces/${namespace}/horizontalpodautoscalers${method === 'post' ? '' : ('/' + name)}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/apis${clusterName}/autoscaling/v2beta2/namespaces/${namespace}/horizontalpodautoscalers${method === 'post' ? '' : ('/' + name)}`,
|
||||
method: method,
|
||||
data: query,
|
||||
headers: {
|
||||
|
@ -32,7 +32,7 @@ export default {
|
|||
// 编辑标签 patch 污点管理 停止调度 spec: {unschedulable: true} 启动调度 spec: {unschedulable: null}
|
||||
patchNode(clusterName, nodeName, query) {
|
||||
return request({
|
||||
url: `api${clusterName}/v1/nodes/${nodeName}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/api${clusterName}/v1/nodes/${nodeName}`,
|
||||
method: 'patch',
|
||||
data: query
|
||||
})
|
||||
|
@ -44,7 +44,7 @@ export default {
|
|||
return request({
|
||||
// 存储管理
|
||||
// /api/clusters/bj-member2/v1/namespaces/kubesphere-monitoring-system/persistentvolumeclaims/prometheus-k8s-db-prometheus-k8s-1
|
||||
url: `api${clusterName}/v1/namespaces/${namespace}/persistentvolumeclaims/${podName}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/api${clusterName}/v1/namespaces/${namespace}/persistentvolumeclaims/${podName}`,
|
||||
method: 'patch',
|
||||
data: { metadata: { annotations: query.metadata.annotations }}
|
||||
})
|
||||
|
@ -52,7 +52,7 @@ export default {
|
|||
return request({
|
||||
// 无传namespace是项目编辑信息的接口 /api/clusters/bj-member2/v1/namespaces/kube-federation-system
|
||||
// 工作负载里 部署,有状态副本集,守护进程集
|
||||
url: `${namespace ? 'apis' + clusterName + '/apps' + '' : 'api' + clusterName}/v1/namespaces/${namespace ? namespace + '/' + (classification || 'deployments') + '/' + podName : podName}`,
|
||||
url: process.env.VUE_APP_BASE_API + `${namespace ? '/apis' + clusterName + '/apps' + '' : '/api' + clusterName}/v1/namespaces/${namespace ? namespace + '/' + (classification || 'deployments') + '/' + podName : podName}`,
|
||||
method: 'patch',
|
||||
data: query
|
||||
})
|
||||
|
@ -61,7 +61,7 @@ export default {
|
|||
editSetting(clusterName, namespace, name, query, classification) {
|
||||
return request({
|
||||
// 工作负载里 部署,有状态副本集,守护进程集
|
||||
url: `apis${clusterName}/apps/v1/namespaces/${namespace}/${classification}/${name}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/apis${clusterName}/apps/v1/namespaces/${namespace}/${classification}/${name}`,
|
||||
method: 'put',
|
||||
data: query
|
||||
// headers:{
|
||||
|
@ -71,7 +71,7 @@ export default {
|
|||
},
|
||||
rollBack(clusterName, namespace, name, query) {
|
||||
return request({
|
||||
url: `apis${clusterName}/apps/v1/namespaces/${namespace}/deployments/${name}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/apis${clusterName}/apps/v1/namespaces/${namespace}/deployments/${name}`,
|
||||
method: 'patch',
|
||||
data: query,
|
||||
headers: {
|
||||
|
@ -84,7 +84,7 @@ export default {
|
|||
// http://119.45.100.73:30880/apis/clusters/bj-member2/apps/v1/namespaces/default/replicasets?labelSelector=app=nisac-paas-webspider,release=stabel
|
||||
getVersionInfo(clusterName, namespace, selecter, classification) {
|
||||
return request({
|
||||
url: `apis${clusterName}/apps/v1/namespaces/${namespace}/${classification === 'deployments' ? 'replicasets' : 'controllerrevisions'}?${selecter}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/apis${clusterName}/apps/v1/namespaces/${namespace}/${classification === 'deployments' ? 'replicasets' : 'controllerrevisions'}?${selecter}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
|
@ -93,7 +93,7 @@ export default {
|
|||
// 重新部署
|
||||
patchRedeploy(clusterName, namespace, name, query, classification) {
|
||||
return request({
|
||||
url: `apis${clusterName}/apps/v1/namespaces/${namespace}/${classification}/${name}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/apis${clusterName}/apps/v1/namespaces/${namespace}/${classification}/${name}`,
|
||||
method: 'patch',
|
||||
data: query
|
||||
})
|
||||
|
@ -107,7 +107,7 @@ export default {
|
|||
return request({
|
||||
// 用户项目
|
||||
// /api/clusters/bj-member2/v1/namespaces/kube-federation-system
|
||||
url: `api${clusterName}/v1/namespaces/${namespace}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/api${clusterName}/v1/namespaces/${namespace}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
@ -115,12 +115,12 @@ export default {
|
|||
return request({
|
||||
// 存储管理
|
||||
// /api/clusters/bj-member2/v1/namespaces/kubesphere-monitoring-system/persistentvolumeclaims/prometheus-k8s-db-prometheus-k8s-1
|
||||
url: `api${clusterName}/v1/namespaces/${namespace}/persistentvolumeclaims/${name}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/api${clusterName}/v1/namespaces/${namespace}/persistentvolumeclaims/${name}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
return request({
|
||||
url: `${(classification === 'pods' ? 'api' : 'apis') + clusterName}/v1/namespaces/${namespace}/${classification}/${name}`,
|
||||
url: process.env.VUE_APP_BASE_API + `${(classification === 'pods' ? '/api' : '/apis') + clusterName}/v1/namespaces/${namespace}/${classification}/${name}`,
|
||||
method: 'delete',
|
||||
data: classification === 'pods' ? {} : {
|
||||
apiVersion: 'v1',
|
||||
|
@ -138,7 +138,7 @@ export default {
|
|||
// http://119.45.100.73:30880/api/clusters/bj-member2/v1/namespaces/{namespace} get
|
||||
getNamespaceCheck(clusterName, namespace) {
|
||||
return request({
|
||||
url: `api${clusterName}/v1/namespaces/${namespace}`,
|
||||
url: process.env.VUE_APP_BASE_API + `/api${clusterName}/v1/namespaces/${namespace}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 节点二级页面--节点详情
|
||||
export function getNodeDetails(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/resources.kubesphere.io/v1alpha3/nodes/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/resources.kubesphere.io/v1alpha3/nodes/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ export function getNodeDetails(url1, url2) {
|
|||
// 节点二级页面--节点资源使用状态
|
||||
export function getNodeStatus(customUrl) {
|
||||
return request({
|
||||
url: customUrl,
|
||||
url: process.env.VUE_APP_BASE_API + customUrl,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export function getNodeStatus(customUrl) {
|
|||
// 节点二级页面--资源使用状态图表
|
||||
export function getMonitorData(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/nodes?' + url2 + 'metrics_filter=node_cpu_utilisation%7Cnode_memory_utilisation%7Cnode_disk_size_utilisation%7Cnode_pod_utilisation%24',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/nodes?' + url2 + 'metrics_filter=node_cpu_utilisation%7Cnode_memory_utilisation%7Cnode_disk_size_utilisation%7Cnode_pod_utilisation%24',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export function getMonitorData(url1, url2) {
|
|||
// 节点二级页面--节点监控图表
|
||||
export function getMonitorDetailData(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/nodes?' + url2 + 'metrics_filter=node_cpu_utilisation%7Cnode_load1%7Cnode_load5%7Cnode_load15%7Cnode_memory_utilisation%7Cnode_disk_size_utilisation%7Cnode_disk_inode_utilisation%7Cnode_disk_inode_usage%7Cnode_disk_inode_total%7Cnode_disk_read_iops%7Cnode_disk_write_iops%7Cnode_disk_read_throughput%7Cnode_disk_write_throughput%7Cnode_net_bytes_transmitted%7Cnode_net_bytes_received%24',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/nodes?' + url2 + 'metrics_filter=node_cpu_utilisation%7Cnode_load1%7Cnode_load5%7Cnode_load15%7Cnode_memory_utilisation%7Cnode_disk_size_utilisation%7Cnode_disk_inode_utilisation%7Cnode_disk_inode_usage%7Cnode_disk_inode_total%7Cnode_disk_read_iops%7Cnode_disk_write_iops%7Cnode_disk_read_throughput%7Cnode_disk_write_throughput%7Cnode_net_bytes_transmitted%7Cnode_net_bytes_received%24',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ export function getMonitorDetailData(url1, url2) {
|
|||
// 节点二级页面--容器组列表
|
||||
export function getPodDetails(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/resources.kubesphere.io/v1alpha3/pods?' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/resources.kubesphere.io/v1alpha3/pods?' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 容器组二级页面--容器组详情
|
||||
export function getPodDetails(url1, url2) {
|
||||
return request({
|
||||
url: 'api' + url1 + '/v1/namespaces/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/api' + url1 + '/v1/namespaces/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ export function getPodDetails(url1, url2) {
|
|||
// 容器组二级页面--容器组监控图表
|
||||
export function getMonitorDetailData(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/namespaces/' + url2 + 'metrics_filter=pod_cpu_usage%7Cpod_memory_usage_wo_cache%7Cpod_net_bytes_transmitted%7Cpod_net_bytes_received%24',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/namespaces/' + url2 + 'metrics_filter=pod_cpu_usage%7Cpod_memory_usage_wo_cache%7Cpod_net_bytes_transmitted%7Cpod_net_bytes_received%24',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 项目二级页面--项目详情
|
||||
export function getProjectDetails(url1, url2) {
|
||||
return request({
|
||||
url: 'api' + url1 + '/v1/namespaces/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/api' + url1 + '/v1/namespaces/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -11,14 +11,14 @@ export function getProjectDetails(url1, url2) {
|
|||
// 项目二级页面--项目监控图表
|
||||
export function getProjectMonitor(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/namespaces/' + url2 + '&metrics_filter=namespace_cpu_usage%7Cnamespace_memory_usage_wo_cache%24',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/namespaces/' + url2 + '&metrics_filter=namespace_cpu_usage%7Cnamespace_memory_usage_wo_cache%24',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 项目二级页面--项目应用资源
|
||||
export function getProjectQuotas(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/resources.kubesphere.io/v1alpha2/namespaces/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/resources.kubesphere.io/v1alpha2/namespaces/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ export function getProjectQuotas(url1, url2) {
|
|||
// 项目二级页面--项目容器组列表
|
||||
export function getProjectPods(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/resources.kubesphere.io/v1alpha3/namespaces/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/resources.kubesphere.io/v1alpha3/namespaces/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 负载二级页面--负载详情
|
||||
export function getWorkloadDetails(url1, url2) {
|
||||
return request({
|
||||
url: 'apis' + url1 + '/apps/v1/namespaces/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/apis' + url1 + '/apps/v1/namespaces/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ export function getWorkloadDetails(url1, url2) {
|
|||
// 负载二级页面--负载监控容器组个数
|
||||
export function getMonitorPodsData(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/namespaces/' + url2 + '/pods?sort_metric=pod_cpu_usage&limit=5&page=1',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/namespaces/' + url2 + '/pods?sort_metric=pod_cpu_usage&limit=5&page=1',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export function getMonitorPodsData(url1, url2) {
|
|||
// 负载二级页面--负载监控详情
|
||||
export function getMonitorDetailData(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/namespaces/' + url2 + 'metrics_filter=pod_cpu_usage%7Cpod_memory_usage_wo_cache%7Cpod_net_bytes_transmitted%7Cpod_net_bytes_received%24',
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/monitoring.kubesphere.io/v1alpha3/namespaces/' + url2 + 'metrics_filter=pod_cpu_usage%7Cpod_memory_usage_wo_cache%7Cpod_net_bytes_transmitted%7Cpod_net_bytes_received%24',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export function getMonitorDetailData(url1, url2) {
|
|||
// 负载二级页面--负载副本运行状态
|
||||
export function getReplicaData(url1, url2) {
|
||||
return request({
|
||||
url: 'apis' + url1 + '/apps/v1/namespaces/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/apis' + url1 + '/apps/v1/namespaces/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ export function getReplicaData(url1, url2) {
|
|||
// 负载二级页面--负载容器组列表
|
||||
export function getWorkloadPods(url1, url2) {
|
||||
return request({
|
||||
url: 'kapis' + url1 + '/resources.kubesphere.io/v1alpha3/namespaces/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/kapis' + url1 + '/resources.kubesphere.io/v1alpha3/namespaces/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ export function getWorkloadPods(url1, url2) {
|
|||
// 负载二级页面--负载版本记录
|
||||
export function getWorkloadVersion(url1, url2) {
|
||||
return request({
|
||||
url: 'apis' + url1 + '/apps/v1/namespaces/' + url2,
|
||||
url: process.env.VUE_APP_BASE_API + '/apis' + url1 + '/apps/v1/namespaces/' + url2,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ const qs = require('qs')
|
|||
|
||||
export function login(data) {
|
||||
return request({
|
||||
url: '/oauth/token',
|
||||
url: process.env.VUE_APP_BASE_API + '/oauth/token',
|
||||
method: 'post',
|
||||
data: qs.stringify(data)
|
||||
})
|
||||
|
@ -31,18 +31,3 @@ export function blockChainLogin(query) {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function getInfo(token) {
|
||||
return request({
|
||||
url: '/vue-element-admin/user/info',
|
||||
method: 'get',
|
||||
params: { token }
|
||||
})
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return request({
|
||||
url: '/vue-element-admin/user/logout',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { login, harvesterLogin, blockChainLogin } from '@/api/user'
|
||||
// import { login, harvesterLogin, blockChainLogin } from '@/api/user'
|
||||
import { login, harvesterLogin } from '@/api/user'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import router, { resetRouter } from '@/router'
|
||||
import Cookies from 'js-cookie'
|
||||
|
@ -35,11 +36,12 @@ const actions = {
|
|||
return Promise.all([
|
||||
login({ 'grant_type': 'password', 'username': username.trim(), 'password': password }),
|
||||
harvesterLogin({ 'username': 'admin', 'password': 'Nudt@112!', 'description': 'UI Session', 'responseType': 'cookie', 'ttl': 57600000 }),
|
||||
blockChainLogin({
|
||||
'user': 'exploreradmin',
|
||||
'password': 'exploreradminpw',
|
||||
'network': 'agridepart-network'
|
||||
})]).then(response => {
|
||||
// blockChainLogin({
|
||||
// 'user': 'exploreradmin',
|
||||
// 'password': 'exploreradminpw',
|
||||
// 'network': 'agridepart-network'
|
||||
// })
|
||||
]).then(response => {
|
||||
commit('SET_TOKEN', response[0].access_token)
|
||||
setToken(response[0].access_token)
|
||||
Cookies.set('htoken', response[2].token)
|
||||
|
|
|
@ -109,9 +109,9 @@ const getNodeStatusList = (clusterName, params) => {
|
|||
const namespace = items.map((item) => { return item.metadata.name })
|
||||
let baseUrl = ''
|
||||
if (clusterName === 'default') {
|
||||
baseUrl = 'kapis/monitoring.kubesphere.io/v1alpha3/nodes?cluster=default&resources_filter='
|
||||
baseUrl = '/kapis/monitoring.kubesphere.io/v1alpha3/nodes?cluster=default&resources_filter='
|
||||
} else {
|
||||
baseUrl = 'kapis' + clusterName + '/monitoring.kubesphere.io/v1alpha3/nodes?cluster=default&resources_filter='
|
||||
baseUrl = '/kapis' + clusterName + '/monitoring.kubesphere.io/v1alpha3/nodes?cluster=default&resources_filter='
|
||||
}
|
||||
const customUrl = baseUrl + items.map(function(v) { return v.metadata.name }).join('%7C') + '%24&metrics_filter=node_cpu_usage%7Cnode_cpu_total%7Cnode_cpu_utilisation%7Cnode_memory_usage_wo_cache%7Cnode_memory_total%7Cnode_memory_utilisation%7Cnode_pod_running_count%7Cnode_pod_quota%24'
|
||||
getNodeStatus(customUrl).then(re => {
|
||||
|
@ -214,7 +214,7 @@ const getStatefulSetList = (clusterName, params) => {
|
|||
})
|
||||
}
|
||||
|
||||
const getDemoSetList = (clusterName, params) => {
|
||||
const getDaemonSetList = (clusterName, params) => {
|
||||
const listResult = []
|
||||
return new Promise(function(resolve) {
|
||||
getDaemonSets(clusterName, params).then(response => {
|
||||
|
@ -238,7 +238,7 @@ const getUserProjectList = (clusterName, params) => {
|
|||
getBriefUserProject(clusterName, params).then(res => {
|
||||
const { items } = res
|
||||
const namespace = items.map((item) => { return item.metadata.name })
|
||||
const baseUrl = 'kapis' + clusterName + '/monitoring.kubesphere.io/v1alpha3/namespaces?resources_filter='
|
||||
const baseUrl = '/kapis' + clusterName + '/monitoring.kubesphere.io/v1alpha3/namespaces?resources_filter='
|
||||
const customUrl = baseUrl + items.map(function(v) { return v.metadata.name }).join('%7C') + '%24&metrics_filter=namespace_cpu_usage%7Cnamespace_memory_usage_wo_cache%7Cnamespace_pod_count%24'
|
||||
getDetailUserProject(customUrl).then(re => {
|
||||
const { results } = re
|
||||
|
@ -256,7 +256,7 @@ const getSystemProjectList = (clusterName, params) => {
|
|||
getBriefSystemProject(clusterName, params).then(res => {
|
||||
const { items } = res
|
||||
const namespace = items.map((item) => { return item.metadata.name })
|
||||
const baseUrl = 'kapis' + clusterName + '/monitoring.kubesphere.io/v1alpha3/namespaces?resources_filter='
|
||||
const baseUrl = '/kapis' + clusterName + '/monitoring.kubesphere.io/v1alpha3/namespaces?resources_filter='
|
||||
const customUrl = baseUrl + items.map(function(v) { return v.metadata.name }).join('%7C') + '%24&metrics_filter=namespace_cpu_usage%7Cnamespace_memory_usage_wo_cache%7Cnamespace_pod_count%24'
|
||||
getDetailSystemProject(customUrl).then(re => {
|
||||
const { results } = re
|
||||
|
@ -387,4 +387,4 @@ const getImagesList = () => {
|
|||
})
|
||||
}
|
||||
|
||||
export default { getClusterHosts, getClusterMembers, getVolumeList, getNodeStatusList, getServiceList, getPodList, getDeploymentList, getStatefulSetList, getDemoSetList, getUserProjectList, getSystemProjectList, getVirtualMachineList, getVirtualHostList, getDataVolumeList, getImagesList }
|
||||
export default { getClusterHosts, getClusterMembers, getVolumeList, getNodeStatusList, getServiceList, getPodList, getDeploymentList, getStatefulSetList, getDaemonSetList, getUserProjectList, getSystemProjectList, getVirtualMachineList, getVirtualHostList, getDataVolumeList, getImagesList }
|
||||
|
|
|
@ -9,7 +9,7 @@ const service = axios.create({
|
|||
headers: {
|
||||
'Content-Type': 'application/merge-patch+json'
|
||||
},
|
||||
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
|
||||
baseURL: '/', // url = base url + request url
|
||||
withCredentials: true, // send cookies when cross-domain requests
|
||||
timeout: 15000 // request timeout
|
||||
})
|
||||
|
@ -18,24 +18,27 @@ const service = axios.create({
|
|||
service.interceptors.request.use(
|
||||
config => {
|
||||
// do something before request is sent
|
||||
if (store.getters.token && config.url.indexOf('/virtual/v1/') !== 0 && config.url.indexOf('blockChain/apiLedger') === -1) {
|
||||
|
||||
if (store.getters.token && config.url.indexOf('/virtual/v1/') === -1 && config.url.indexOf('blockChain/') === -1) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken()
|
||||
}
|
||||
if (config.url.indexOf('blockChain/apiLedger') !== -1) {
|
||||
if (config.url.indexOf('blockChain/') !== -1) {
|
||||
config.headers['Authorization'] = 'bearer ' + Cookies.get('htoken')
|
||||
}
|
||||
if (config.url.indexOf('/virtual/v3-public') !== -1) {
|
||||
if (config.url.indexOf('virtual/v3-public') !== -1) {
|
||||
const csrf = Cookies.get('CSRF')
|
||||
if (csrf) {
|
||||
config.headers['x-api-csrf'] = csrf
|
||||
} else {
|
||||
config.headers['x-api-csrf'] = '766c7a89f1'
|
||||
}
|
||||
}
|
||||
if (config.url === '/oauth/token') {
|
||||
if (config.url.indexOf('/oauth/token')> -1) {
|
||||
config.headers = {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}
|
||||
if (config.url.indexOf('/virtual/v1/') === 0) {
|
||||
if (config.url.indexOf('/virtual/v1/') > -1) {
|
||||
config.headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json'
|
||||
|
|
|
@ -39,7 +39,7 @@ module.exports = {
|
|||
proxy: {
|
||||
'/oauth': {
|
||||
ws: false,
|
||||
target: 'http://119.45.100.73:30881/'/* Host */
|
||||
target: 'http://119.45.100.73:30881/', /* Host */
|
||||
},
|
||||
// '^/v1': {
|
||||
// ws: false,
|
||||
|
@ -70,8 +70,9 @@ module.exports = {
|
|||
},
|
||||
'^/blockChain': {
|
||||
ws: false,
|
||||
target: 'http://106.53.150.192/',
|
||||
changeOrigin: true
|
||||
target: 'https://106.53.150.192/',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
'^/api/': {
|
||||
ws: false,
|
||||
|
@ -80,17 +81,18 @@ module.exports = {
|
|||
},
|
||||
'^/apis/': {
|
||||
ws: false,
|
||||
target: 'http://119.45.100.73:30881/'/* Host */
|
||||
target: 'http://119.45.100.73:30881/', /* Host */
|
||||
// changeOrigin: true,
|
||||
},
|
||||
'^/virtual': {
|
||||
ws: false,
|
||||
target: 'http://106.53.150.192/',
|
||||
changeOrigin: true
|
||||
target: 'https://106.53.150.192/',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
'^/function': {
|
||||
ws: false,
|
||||
target: 'http://106.53.150.192:8004/'
|
||||
target: 'http://106.53.150.192:8004/',
|
||||
// changeOrigin: true,
|
||||
},
|
||||
'/kapis/terminal.kubesphere.io': {
|
||||
|
|
Loading…
Reference in New Issue