diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue
index bb66572bb..6559201e3 100644
--- a/nezha-fronted/src/components/common/header.vue
+++ b/nezha-fronted/src/components/common/header.vue
@@ -1,7 +1,6 @@
+
+
+
+
+
@@ -117,8 +121,24 @@ export default {
return {
language: localStorage.getItem("language"),
assetData: [],
- projectData: [],
- createMenu: [
+ projectData: [], //顶部菜单project列表中的数据
+ editProject: {id: '', name: '', remark: ''}, //新增/编辑的project
+ currentProject: {id: '', name: '', remark: ''}, //module/endpoint弹框用来回显project,此处固定为空对象
+ editModule: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []}, //新增/编辑的module
+ currentModule: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []}, //endpoint弹框用来回显module,此处固定为空对象
+ editEndpoint: { //新增/编辑的endpoint
+ id: '',
+ host: '',
+ port: '',
+ param: '',
+ path: '',
+ asset: {id: '', name: '', host: ''},
+ project: {id: '', name: ''},
+ module: {id: '', name: '', param: '', paramObj: {}, projectId: ''},
+ moduleId: '',
+ assetId: ''
+ },
+ createMenu: [ //新增按钮内容
{
label: this.$t('project.project.createProject'),
url: 'project',
@@ -157,7 +177,16 @@ export default {
});
},
createBox(item) {
- this.jumpTo(item.url);
+ if (item.type == 1) {
+ this.$refs.projectBox.show(true);
+ this.editProject = {id: '', name: '', remark: ''};
+ } else if (item.type == 2) {
+ this.$refs.moduleBox.show(true);
+ this.editModule = {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []};
+ } else if (item.type == 3) {
+ this.$refs.endpointBox.show(true);
+ }
+ /*this.jumpTo(item.url);
setTimeout(() =>{
if (item.type == 1) {
if (this.projectData.length > 0) {
@@ -179,7 +208,7 @@ export default {
this.$store.commit('projectRightBoxShow', false);
this.$store.commit('toCreateAlertConfig', true);
}
- }, 120);
+ }, 120);*/
},
jumpToAsset(data, id) {
this.$store.state.assetData.moduleData = data;
@@ -202,19 +231,18 @@ export default {
})
},
getProjectData() {
- this.$get('project', this.pageObj).then(response => {
+ this.$get('project', {}).then(response => {
if (response.code == 200) {
this.projectData = response.data.list;
}
})
},
toEditProject(p) {
- this.jumpTo('project');
- setTimeout(() =>{
- this.$store.commit('setProject', p);
- this.$store.commit('projectRightBoxShow', true);
- }, 50);
-
+ this.$refs.projectBox.show(true);
+ this.editProject = Object.assign({}, p);
+ },
+ projectReload() {
+ this.getProjectData();
}
},
mounted() {
@@ -257,6 +285,7 @@ export default {
padding-left: 50%;
width: 500px;
float: left;
+ font-size: 22px;
}
.header {
@@ -264,7 +293,6 @@ export default {
box-sizing: border-box;
width: 100%;
height: 60px;
- font-size: 22px;
background-color: #ffffff;
z-index: 510;
box-shadow: 0px 20px 13px -19px #5E5E5E;
diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js
index 28c62df9b..8ce9bc542 100644
--- a/nezha-fronted/src/components/common/language/en.js
+++ b/nezha-fronted/src/components/common/language/en.js
@@ -25,10 +25,12 @@ const en = {
confirmDelete: "Confirm Delete?",
yes: "Yes",
no: "No",
- deleteSuccess: "Successfully Deleted"
+ deleteSuccess: "Successfully Deleted",
+ saveSuccess: "Successfully Saved"
},
asset:{
createAsset: "Create Asset",
+ asset: 'Asset',
tableTitle: {
id: 'ID',
assetType: '资产类型',
diff --git a/nezha-fronted/src/components/common/rightBox/endpointBox.vue b/nezha-fronted/src/components/common/rightBox/endpointBox.vue
new file mode 100644
index 000000000..f4cfd9a0d
--- /dev/null
+++ b/nezha-fronted/src/components/common/rightBox/endpointBox.vue
@@ -0,0 +1,245 @@
+
+
+
+
+
+
+
+
+
+
{{$t('overall.esc')}}
+
+
+
+
+
+
{{$t('overall.save')}}
+
{{$t('overall.edit')}}
+
+
+
+
+
+
{{$t('overall.delete')}}
+
+
+
+
+
+
{{rightBox.title}}
+
+
+
+
+
+
+
+
+
{{$t('overall.cancel')}}
{{endpoint.id == '' ? $t('overall.create') : $t('overall.save')}}
+
+
+
+
+
+
+
+
+
diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue
new file mode 100644
index 000000000..6a0e6d9e3
--- /dev/null
+++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue
@@ -0,0 +1,322 @@
+
+
+
+
+
+
+
+
+
+
+
{{$t('overall.esc')}}
+
+
+
+
+
+
{{$t('overall.save')}}
+
+
+
+
+
+
{{$t('overall.delete')}}
+
+
+
+
+
+ {{rightBox.title}}
+
+
+
+
+
+
+
+
{{$t('overall.cancel')}}
{{module.id == '' ? $t('overall.create') : $t('overall.save')}}
+
+
+
+
+
+
+
+
+
+
diff --git a/nezha-fronted/src/components/common/rightBox/projectBox.vue b/nezha-fronted/src/components/common/rightBox/projectBox.vue
new file mode 100644
index 000000000..0d00034df
--- /dev/null
+++ b/nezha-fronted/src/components/common/rightBox/projectBox.vue
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+
+
{{$t('overall.esc')}}
+
+
+
+
+
+
{{$t('overall.save')}}
+
+
+
+
+
+
{{$t('overall.delete')}}
+
+
+
+
+
+
{{rightBox.title}}
+
+
+
+
+
+
+
+
{{$t('overall.cancel')}}
{{project.id == '' ? $t('overall.create') : $t('overall.save')}}
+
+
+
+
+
+
+
+
+
diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue
index 5638832d1..eb9304a7a 100644
--- a/nezha-fronted/src/components/common/searchInput.vue
+++ b/nezha-fronted/src/components/common/searchInput.vue
@@ -215,7 +215,8 @@
//dc
selectDc(column, selectItem, e) {
this.stop_click(e);
- this.searchLabelList.forEach(val=>{
+ this.select_list.forEach(val=>{
+ console.info(val)
if(val.type == 'dc'){
val.val = selectItem.name;
val.valnum = selectItem.id;
diff --git a/nezha-fronted/src/components/page/config/account.vue b/nezha-fronted/src/components/page/config/account.vue
index fb489f8ae..2117e18df 100644
--- a/nezha-fronted/src/components/page/config/account.vue
+++ b/nezha-fronted/src/components/page/config/account.vue
@@ -58,12 +58,7 @@
{{$t('overall.add')}}
-
+
{
+ this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
+ this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
+ this.$get('sys/user/list', this.searchLabel).then(response => {
if (response.code === 200) {
for (var i = 0; i < response.data.list.length; i++) {
response.data.list[i].status = response.data.list[i].status + "";
@@ -455,6 +477,15 @@ export default {
pageSize(val) {
this.pageObj.pageSize = val;
this.getTableData();
+ },
+ search: function(searchObj) {
+ this.searchLabel = {};
+ for (let item in searchObj) {
+ if (searchObj[item]) {
+ this.$set(this.searchLabel, item, searchObj[item]);
+ }
+ }
+ this.getTableData();
}
},
mounted() {
diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue
index 960363e33..f54a5fa0d 100644
--- a/nezha-fronted/src/components/page/project/project.vue
+++ b/nezha-fronted/src/components/page/project/project.vue
@@ -258,12 +258,7 @@
{{$t('project.metrics.metrics')}}
-
+
{{$t('overall.add')}}
-
+
{
+ this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
+ this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
+ this.$set(this.searchLabel, 'moduleId', this.currentModule.id);
+ this.$get('endpoint', this.searchLabel).then(response => {
if (response.code === 200) {
for (var i = 0; i < response.data.list.length; i++) {
try {
@@ -928,7 +951,7 @@ export default {
this.moduleData = response.data.list;
for (let i = 0; i < response.data.list.length; i++) {
try {
- var tempObj = JSON.parse(response.data.list[i].param);
+ let tempObj = JSON.parse(response.data.list[i].param);
} catch (err) {
console.info(response.data.list[i]);
console.info(err);
@@ -1246,6 +1269,15 @@ export default {
dropdownSelect: function(label) {
this.assetSearch.label = label;
this.assetSearch.dropdownShow = false;
+ },
+ search: function(searchObj) {
+ this.searchLabel = {};
+ for (let item in searchObj) {
+ if (searchObj[item]) {
+ this.$set(this.searchLabel, item, searchObj[item]);
+ }
+ }
+ this.getEndPointTableData();
}
},
created: function() {
diff --git a/nezha-fronted/src/components/page/project/project2.vue b/nezha-fronted/src/components/page/project/project2.vue
new file mode 100644
index 000000000..4dc4d7326
--- /dev/null
+++ b/nezha-fronted/src/components/page/project/project2.vue
@@ -0,0 +1,372 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{scope.row[item.prop].host}}
+ {{scope.row[item.prop]}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js
index af94aa536..6098dfe8d 100644
--- a/nezha-fronted/src/main.js
+++ b/nezha-fronted/src/main.js
@@ -16,9 +16,15 @@ import {post, get, put, del} from './http.js'
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 endpointBox from './components/common/rightBox/endpointBox'; //endpoint弹框组件
Vue.component("Pagination", Pagination);
Vue.component("searchInput", searchInput);
+Vue.component("project-box", projectBox);
+Vue.component("module-box", moduleBox);
+Vue.component("endpoint-box", endpointBox);
Vue.prototype.$axios = axios;
Vue.prototype.$post = post;
diff --git a/nezha-fronted/src/router/index.js b/nezha-fronted/src/router/index.js
index 768a1ec2f..376d227b0 100644
--- a/nezha-fronted/src/router/index.js
+++ b/nezha-fronted/src/router/index.js
@@ -23,7 +23,7 @@ export default new Router({
},
{
path: '/project',
- component: resolve => require(['../components/page/project/project.vue'], resolve),
+ component: resolve => require(['../components/page/project/project2.vue'], resolve),
},
{
path: '/asset',