+
diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue
index eb9304a7a..3f722d61e 100644
--- a/nezha-fronted/src/components/common/searchInput.vue
+++ b/nezha-fronted/src/components/common/searchInput.vue
@@ -50,7 +50,12 @@
- - {{item.name}}
+ - {{item.name}}
+
+
+
@@ -125,8 +130,8 @@
return {
select_conditionsName:'',
selectInfoList: searchSelectInfo,
- select_title:this.$t('i18n.overall.searchList.select_title'),
- other:this.$t('i18n.overall.other'),
+ select_title: '',
+ other: '',
localStorage_display: true,
input_list: true,
change_sreach_show: true,
@@ -134,6 +139,7 @@
historyList: [],
actionSelect:[],
dcSelect: [], //数据中心
+ assetSelect: [], //资产
schemaTypeSelect:[], //日志检索Protocol下拉菜单
TypeSelect:[],//Protocol二层下拉菜单
secondShow:'',//二层显示控制
@@ -213,16 +219,19 @@
this.input_list = !this.input_list
},*/
//dc
- selectDc(column, selectItem, e) {
+ selectObject(column, selectItem, e) {
this.stop_click(e);
this.select_list.forEach(val=>{
- console.info(val)
- if(val.type == 'dc'){
+ if (val.type == 'dc'){
val.val = selectItem.name;
val.valnum = selectItem.id;
val.valString = '';
+ } else if (val.type == 'asset') {
+ val.val = selectItem.host;
+ val.valnum = selectItem.id;
+ val.valString = '';
}
- })
+ });
//this.select_list.push({type: 'dc', val: selectItem.name, valnum: selectItem.id});
this.input_sreach = '';
this.sreach_num = this.select_list.length;
@@ -281,6 +290,13 @@
}
});
},
+ getAssetData() {
+ this.$get('asset', {pageNo: 1, pageSize: 999}).then(response => {
+ if (response.code === 200) {
+ this.assetSelect = response.data.list;
+ }
+ });
+ },
//点击确认选择下拉内容
tr_selectInfo(selectLabel,value,label,e){
this.stop_click(e);
@@ -468,6 +484,8 @@
objectInfo[val.label] = val.valnum;
} else if (val.type == 'dc') {
objectInfo.idcId = val.valnum;
+ } else if (val.type == 'asset') {
+ objectInfo.assetId = val.valnum;
} else {
objectInfo[val.label] = val.val;
}
@@ -913,7 +931,7 @@
type:type,
label:label,
disabled:disabled
- })
+ });
this.change_sreach_show = false
this.sreach_num = this.select_list.length-1
this.input_list = !this.input_list
@@ -960,6 +978,9 @@
if (this.$route.path == '/promServer') {
this.getDcData();
}
+ if (this.$route.path == '/project') {
+ this.getAssetData();
+ }
JSON.parse(JSON.stringify(this.searchMsg.searchLabelList)).forEach(val => {
if(val.name=='Protocol'){
this.schemaTypeSelect=val.doc.data
diff --git a/nezha-fronted/src/components/page/config/account.vue b/nezha-fronted/src/components/page/config/account.vue
index d4090b93c..a3a6f05db 100644
--- a/nezha-fronted/src/components/page/config/account.vue
+++ b/nezha-fronted/src/components/page/config/account.vue
@@ -328,29 +328,15 @@ export default {
}],
searchMsg: { //给搜索框子组件传递的信息
zheze_none: true,
- searchLabelList: [/*{
- id: 1,
- name: 'ID',
- type: 'input',
- label: 'userId',
- disabled: false
- },*/{
+ searchLabelList: [{
id: 10,
name: this.$t('config.account.account'),
type: 'input',
label: 'username',
disabled: false
- }/*,{
- id: 11,
- name: 'E-mail',
- type: 'input',
- label: 'email',
- disabled: false
- }*/],
- },
- searchLabel: { //搜索参数
-
+ }],
},
+ searchLabel: {}, //搜索参数
}
},
methods: {
diff --git a/nezha-fronted/src/components/page/config/promServer.vue b/nezha-fronted/src/components/page/config/promServer.vue
index bd280c004..0ec494cb9 100644
--- a/nezha-fronted/src/components/page/config/promServer.vue
+++ b/nezha-fronted/src/components/page/config/promServer.vue
@@ -466,6 +466,7 @@ export default {
this.getTableData();
},
search: function(searchObj) {
+ console.info(searchObj);
this.searchLabel = {};
for (let item in searchObj) {
if (searchObj[item]) {
diff --git a/nezha-fronted/src/components/page/project/project2.vue b/nezha-fronted/src/components/page/project/project2.vue
index b77c5ab2f..6df2a8be7 100644
--- a/nezha-fronted/src/components/page/project/project2.vue
+++ b/nezha-fronted/src/components/page/project/project2.vue
@@ -15,21 +15,55 @@
-
+
+
+
+
+
+
+ {{scope.row[item.prop]}}
+
+
+
+
+
+
+
+
-
+
+
@@ -73,6 +108,7 @@ export default {
name: "project2",
data() {
return {
+ tableShow: 1, // 1.endpoint; 2.metrics
editEndpoint: {id: '', host: '', port: '', param: '', path: '', asset: {}, project: {}, module: {}, moduleId: '', assetId: '', paramObj: []},
endpointTableTitle: [
{
@@ -108,20 +144,76 @@ export default {
pageSize: 20,
total:0
},
+ metricsTableTitle: [
+ {
+ label: "ID",
+ prop: 'id',
+ show: true,
+ width: 100
+ },
+ {
+ label: this.$t("project.metrics.name"),
+ prop: 'metric',
+ show: true,
+ },
+ {
+ label: this.$t("project.metrics.type"),
+ prop: 'type',
+ show: true,
+ },
+ {
+ label: this.$t("project.metrics.description"),
+ prop: 'help',
+ show: true,
+ },
+ ],
+ metricsTableData: [],
+ metricPageObj: {
+ pageNo: 1,
+ pageSize: 20,
+ total: 0
+ },
moduleList: [],
projectList: [],
currentProject: {id: '', name: '', remark: ''}, //endpoint弹框、module列表用来回显project
editModule: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []}, //编辑的module
currentModule: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []}, //endpoint弹框用来回显module
- searchLabel: {moduleId: ''}, //endpoint搜索参数
+ endpointSearchLabel: {moduleId: ''}, //endpoint搜索参数
+ metricSearchLabel: {moduleId: ''}, //metrics搜索参数
+ endpointSearchMsg: { //给搜索框子组件传递的信息
+ zheze_none: true,
+ searchLabelList: [{
+ id: 1,
+ name: "ID",
+ type: 'input',
+ label: 'id',
+ disabled: false
+ }, {
+ id: 11,
+ name: this.$t('asset.asset'),
+ type: 'asset',
+ label: 'asset',
+ disabled: false
+ }],
+ },
+ metricSearchMsg: { //给搜索框子组件传递的信息
+ zheze_none: true,
+ searchLabelList: [{
+ id: 12,
+ name: 'Metric',
+ type: 'input',
+ label: 'metric',
+ disabled: false
+ }],
+ },
}
},
methods: {
- getEndPointTableData() {
- this.searchLabel.moduleId = this.currentModule.id;
- this.$set(this.searchLabel, 'pageNo', this.endpointPageObj.pageNo);
- this.$set(this.searchLabel, 'pageSize', this.endpointPageObj.pageSize);
- this.$get('endpoint', this.searchLabel).then(response => {
+ getEndpointTableData() {
+ this.endpointSearchLabel.moduleId = this.currentModule.id;
+ this.$set(this.endpointSearchLabel, 'pageNo', this.endpointPageObj.pageNo);
+ this.$set(this.endpointSearchLabel, 'pageSize', this.endpointPageObj.pageSize);
+ this.$get('endpoint', this.endpointSearchLabel).then(response => {
if (response.code === 200) {
for (let i = 0; i < response.data.list.length; i++) {
try {
@@ -139,13 +231,32 @@ export default {
}
});
},
+ getMetricsTableData() {
+ this.metricSearchLabel.moduleId = this.currentModule.id;
+ this.$set(this.metricSearchLabel, 'pageNo', this.metricPageObj.pageNo);
+ this.$set(this.metricSearchLabel, 'pageSize', this.metricPageObj.pageSize);
+ this.$get('metric', this.metricPageObj).then(response => {
+ if (response.code === 200) {
+ this.metricsTableData = response.data.list;
+ this.metricPageObj.total = response.data.total;
+ }
+ });
+ },
endpointPageNo(val) {
this.endpointPageObj.pageNo = val;
- this.getEndPointTableData();
+ this.getEndpointTableData();
},
endpointPageSize(val) {
this.endpointPageObj.pageSize = val;
- this.getEndPointTableData();
+ this.getEndpointTableData();
+ },
+ metricsPageNo(val) {
+ this.metricPageObj.pageNo = val;
+ this.getMetricsTableData();
+ },
+ metricsPageSize(val) {
+ this.metricPageObj.pageSize = val;
+ this.getMetricsTableData();
},
// 获取左侧module列表数据
@@ -201,15 +312,21 @@ export default {
this.rightBoxHandler(3);
this.$refs.editEndpointBox.toEdit(true);
this.editEndpoint = JSON.parse(JSON.stringify(endpoint));
+ if (!this.editEndpoint.paramObj) {
+ this.$set(this.editEndpoint, 'paramObj', []);
+ }
},
toCreateEndpoint() {
-
+ this.$refs.addEndpointBox.show(true);
},
//查看endpoint详情
endpointDetail(endpoint) {
this.editEndpoint = JSON.parse(JSON.stringify(endpoint));
+ if (!this.editEndpoint.paramObj) {
+ this.$set(this.editEndpoint, 'paramObj', []);
+ }
this.rightBoxHandler(3);
this.$refs.editEndpointBox.toEdit(false);
},
@@ -227,7 +344,28 @@ export default {
}
this.rightBoxHandler(2);
},
-
+
+ //搜索
+ endpointSearch: function(searchObj) {
+ this.endpointSearchLabel = {};
+ for (let item in searchObj) {
+ if (searchObj[item]) {
+ this.$set(this.endpointSearchLabel, item, searchObj[item]);
+ }
+ }
+ this.getEndpointTableData();
+ },
+ //搜索
+ metricSearch: function(searchObj) {
+ this.metricSearchLabel = {};
+ for (let item in searchObj) {
+ if (searchObj[item]) {
+ this.$set(this.metricSearchLabel, item, searchObj[item]);
+ }
+ }
+ this.getMetricsTableData();
+ },
+
//控制弹框状态 type 1:project; 2:module; 3:editEndponit; 4:addEndpoint;
rightBoxHandler(type) {
if (type == 1) {
@@ -266,10 +404,11 @@ export default {
created() {
this.currentProject = this.$store.state.currentProject;
this.getModuleList();
+ this.getMetricsTableData();
},
mounted() {
setTimeout(()=>{
- this.getEndPointTableData();
+ this.getEndpointTableData();
}, 200);
},
computed: {
@@ -285,10 +424,14 @@ export default {
this.getModuleList();
},
currentModule(n, o) {
+ this.metricPageObj.pageNo = 1;
+ this.endpointPageObj.pageNo = 1;
if (n && n.id) {
- this.getEndPointTableData();
+ this.getEndpointTableData();
+ this.getMetricsTableData();
} else {
this.endpointTableData = [];
+ this.metricsTableData = [];
}
}
}
@@ -520,7 +663,7 @@ export default {
right: 10px;
bottom: 13px;
}
- .el-input-group__append {
+ .el-input-group__append>i {
cursor: pointer;
}
diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js
index 5895d34e4..855f55c87 100644
--- a/nezha-fronted/src/main.js
+++ b/nezha-fronted/src/main.js
@@ -18,13 +18,15 @@ import Pagination from "./components/common/pagination"; //引入全局分页组
import searchInput from "./components/common/searchInput"; //搜索框组件
import projectBox from './components/common/rightBox/projectBox'; //project弹框组件
import moduleBox from './components/common/rightBox/moduleBox'; //module弹框组件
-import editEndpointBox from './components/common/rightBox/endpointBox'; //endpoint弹框组件
+import editEndpointBox from './components/common/rightBox/editEndpointBox'; //endpoint弹框组件
+import addEndpointBox from './components/common/rightBox/addEndpointBox'; //endpoint弹框组件
Vue.component("Pagination", Pagination);
Vue.component("searchInput", searchInput);
Vue.component("project-box", projectBox);
Vue.component("module-box", moduleBox);
Vue.component("edit-endpoint-box", editEndpointBox);
+Vue.component("add-endpoint-box", addEndpointBox);
Vue.prototype.$axios = axios;
Vue.prototype.$post = post;