update cluster metrics
This commit is contained in:
parent
34d780973c
commit
7311274061
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
import { queryNotices } from '@/services/api';
|
import { queryNotices } from '@/services/api';
|
||||||
import {message} from "antd";
|
import {message} from "antd";
|
||||||
import {searchClusterConfig} from "@/services/clusterConfig";
|
import {searchClusterConfig} from "@/services/cluster";
|
||||||
import {formatESSearchResult} from '@/lib/elasticsearch/util';
|
import {formatESSearchResult} from '@/lib/elasticsearch/util';
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,5 @@
|
||||||
import {getClusterOverview, getClusterNodeStats, getClusterList} from "@/services/dashboard";
|
import {getClusterOverview, getClusterNodeStats, getClusterList} from "@/services/dashboard";
|
||||||
|
import {getClusterMetrics} from "@/services/cluster";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
namespace: 'clusterMonitor',
|
namespace: 'clusterMonitor',
|
||||||
|
@ -13,6 +14,13 @@ export default {
|
||||||
callback(clusterData);
|
callback(clusterData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
*fetchClusterMetrics({payload, callback}, {call, put}){
|
||||||
|
let clusterMetrics = yield call(getClusterMetrics, payload);
|
||||||
|
yield put({type: 'saveData', payload: clusterMetrics})
|
||||||
|
if(callback && typeof callback == 'function'){
|
||||||
|
callback(clusterMetrics);
|
||||||
|
}
|
||||||
|
},
|
||||||
*fetchClusterNodeStats({callback}, {call, put}){
|
*fetchClusterNodeStats({callback}, {call, put}){
|
||||||
let nodesStats = yield call(getClusterNodeStats);
|
let nodesStats = yield call(getClusterNodeStats);
|
||||||
//yield put({type: 'saveData', payload: nodesStats})
|
//yield put({type: 'saveData', payload: nodesStats})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {createClusterConfig,searchClusterConfig, updateClusterConfig,deleteClusterConfig} from "@/services/clusterConfig";
|
import {createClusterConfig, searchClusterConfig, updateClusterConfig,deleteClusterConfig} from "@/services/cluster";
|
||||||
import {message} from "antd";
|
import {message} from "antd";
|
||||||
import {formatESSearchResult} from '@/lib/elasticsearch/util';
|
import {formatESSearchResult} from '@/lib/elasticsearch/util';
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,53 @@
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import {pathPrefix} from './common';
|
import {buildQueryArgs, pathPrefix} from './common';
|
||||||
|
|
||||||
export async function getClusterVersion(params) {
|
export async function getClusterVersion(params) {
|
||||||
return request(`${pathPrefix}/cluster/${params.cluster}/version`, {
|
return request(`${pathPrefix}/cluster/${params.cluster}/version`, {
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getClusterMetrics(params) {
|
||||||
|
let id = params.id;
|
||||||
|
delete(params['id']);
|
||||||
|
return request(`${pathPrefix}/cluster/${id}/metrics`, {
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function createClusterConfig(params) {
|
||||||
|
return request(`${pathPrefix}/cluster`, {
|
||||||
|
method: 'POST',
|
||||||
|
body: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateClusterConfig(params) {
|
||||||
|
let id = params.id;
|
||||||
|
delete(params['id']);
|
||||||
|
return request(`${pathPrefix}/cluster/${id}`, {
|
||||||
|
method: 'PUT',
|
||||||
|
body: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteClusterConfig(params) {
|
||||||
|
return request(`${pathPrefix}/cluster/${params.id}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
body: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function searchClusterConfig(params) {
|
||||||
|
let url = `${pathPrefix}/cluster/_search`;
|
||||||
|
let args = buildQueryArgs({
|
||||||
|
name: params.name,
|
||||||
|
enabled: params.enabled
|
||||||
|
});
|
||||||
|
if(args.length > 0){
|
||||||
|
url += args;
|
||||||
|
}
|
||||||
|
return request(url, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
import {pathPrefix, buildQueryArgs} from "./common";
|
|
||||||
import request from '@/utils/request';
|
|
||||||
|
|
||||||
export async function createClusterConfig(params) {
|
|
||||||
return request(`${pathPrefix}/system/cluster`, {
|
|
||||||
method: 'POST',
|
|
||||||
body: params,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function updateClusterConfig(params) {
|
|
||||||
let id = params.id;
|
|
||||||
delete(params['id']);
|
|
||||||
return request(`${pathPrefix}/cluster/${id}`, {
|
|
||||||
method: 'PUT',
|
|
||||||
body: params,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function deleteClusterConfig(params) {
|
|
||||||
return request(`${pathPrefix}/cluster/${params.id}`, {
|
|
||||||
method: 'DELETE',
|
|
||||||
body: params,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function searchClusterConfig(params) {
|
|
||||||
let url = `${pathPrefix}/cluster/_search`;
|
|
||||||
let args = buildQueryArgs({
|
|
||||||
name: params.name,
|
|
||||||
enabled: params.enabled
|
|
||||||
});
|
|
||||||
if(args.length > 0){
|
|
||||||
url += args;
|
|
||||||
}
|
|
||||||
return request(url, {
|
|
||||||
method: 'GET',
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Reference in New Issue