diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss
index a0f02466f..0dea33179 100644
--- a/nezha-fronted/src/assets/stylus/main.scss
+++ b/nezha-fronted/src/assets/stylus/main.scss
@@ -514,6 +514,7 @@ li{
.top-tool-right {
display: flex;
align-content: center;
+ height: 26px;
}
.top-tool-main-right {
position: absolute;
@@ -571,6 +572,63 @@ li{
.has-sub-popper {
color: red;
}
+.main-list {
+ height: 100%;
+ transition: .4s height, .4s transform;
+ position: relative;
+}
+.main-list.main-list-with-sub {
+ transform: translate3d(0,0,0);
+ height: calc(50% - 4px);
+}
+.sub-list {
+ height: calc(50% - 4px);
+ transition: .4s height;
+ position: relative;
+}
+.sub-list-resize {
+ margin: 0 -6px;
+ border-top: 1px solid #aaa;
+ background-color: #eaeaea;
+ height: 9px;
+ box-sizing: border-box;
+ user-select: none;
+ color: #5f6368;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding-top: 3px;
+ cursor: ns-resize;
+}
+.sub-list-window-control {
+ display: flex;
+ align-items: center;
+ margin-left: 14px;
+}
+.window-control-btn {
+ cursor: pointer;
+ width: 29px;
+ text-align: center;
+}
+.window-control-btn:last-of-type {
+ margin-right: 4px;
+}
+.window-control-btn>i {
+ color: #909399;
+ font-size: 17px;
+}
+.window-control-btn>i:hover {
+ color: $global-text-color-active;
+}
+.pagination-top {
+ transition: .2s transform;
+}
+.pagination-top-show {
+ transform: translateX(0);
+}
+.pagination-top-hide {
+ transform: translateX(150%);
+}
/* end--二级顶部工具栏*/
/* start--内容*/
diff --git a/nezha-fronted/src/components/common/bottomBox/alertMessageBox.vue b/nezha-fronted/src/components/common/bottomBox/alertMessageBox.vue
new file mode 100644
index 000000000..aacfaa226
--- /dev/null
+++ b/nezha-fronted/src/components/common/bottomBox/alertMessageBox.vue
@@ -0,0 +1,369 @@
+
+
+
+ 一
+
+
+
+
+
+
+ {{scope.row[item.prop].alertName}}
+ -
+
+
+ Project
+ Module
+ Device
+
+
+ {{scope.row[item.prop]}}
+ -
+
+
+ {{scope.row[item.prop]}}
+ -
+
+
+ {{severityData[1].value}}
+ {{severityData[0].value}}
+ {{severityData[2].value}}
+
+
+ {{scope.row[item.prop].name}}
+ {{scope.row[item.prop].host}}
+ -
+
+
+
+ {{scope.row['state'] == 1 ? "Pending" : ""}}
+ {{scope.row['state'] == 2 ? "Expired" : ""}}
+
+
+ {{scope.row[item.prop]}}
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js
index 5031939c1..cc6cecc26 100644
--- a/nezha-fronted/src/components/common/language/en.js
+++ b/nezha-fronted/src/components/common/language/en.js
@@ -564,7 +564,7 @@ const en = {
port: 'Port',//"端口"
param: 'Parameter',//"参数"
path: 'Path',//"路径"
- asset: 'Device',//"设备"
+ asset: 'Asset',//"设备"
lastUpdate: 'Last Reply',//"最后更新时间"
moduleParameter: 'Module',//"组件参数"
addGraph: 'View Graph', //添加图标
diff --git a/nezha-fronted/src/components/page/alert/config.vue b/nezha-fronted/src/components/page/alert/config.vue
index 5f2857415..6717885a0 100644
--- a/nezha-fronted/src/components/page/alert/config.vue
+++ b/nezha-fronted/src/components/page/alert/config.vue
@@ -15,79 +15,90 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{severityData[1].value}}
+ {{severityData[0].value}}
+ {{severityData[2].value}}
+
+
+ {{type.value}}
+
+
+
+ {{scope.row[item.prop].name}}
+ {{scope.row[item.prop].host}}
+ -
+
+ {{scope.row.alertName}}
+ {{scope.row.id}}
+ {{scope.row[item.prop]}}
+ -
- {{scope.row.alertName}}
- {{scope.row[item.prop]}}
- -
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
{
+ e.preventDefault();
+ //得到鼠标拖动的距离
+ let mouseMoveY = Math.abs(e.clientY - mouseInitialY);
+
+ //往上方拖动:
+ if (e.clientY < mouseInitialY) {
+ mainListDom.style.height = mainInitialHeight-mouseMoveY+'px';
+ subListDom.style.height = subInitialHeight+mouseMoveY+'px';
+ }
+ //往下方拖动:
+ if (e.clientY > mouseInitialY) {
+ mainListDom.style.height = mainInitialHeight+mouseMoveY+'px';
+ subListDom.style.height = subInitialHeight-mouseMoveY+'px';
+ }
+
+ // 主、副列表最小高度限制为15px
+ if(parseInt(mainListDom.style.height) >= contentRightHeight-15){
+ mainListDom.style.height = contentRightHeight-15+'px';
+ }
+ if(parseInt(mainListDom.style.height) <= 15){
+ mainListDom.style.height = 15+'px';
+ }
+ if(parseInt(subListDom.style.height) >= contentRightHeight-15){
+ subListDom.style.height = contentRightHeight-15+'px';
+ }
+ if(parseInt(subListDom.style.height) <= 15){
+ subListDom.style.height = 15+'px';
+ }
+ //当主副列表可视区域小于一定值时,不展示内容
+ if(parseInt(mainListDom.style.height) <= 100){
+ if (_this.mainResizeShow) {
+ _this.mainResizeShow = false;
+ }
+ } else {
+ if (!_this.mainResizeShow) {
+ _this.mainResizeShow = true;
+ }
+ }
+ if(parseInt(subListDom.offsetHeight) <= 100){
+ if (_this.subResizeShow) {
+ _this.subResizeShow = false;
+ }
+ } else {
+ if (!_this.subResizeShow) {
+ _this.subResizeShow = true;
+ }
+ }
+ };
+ document.onmouseup = () => {
+ document.onmousemove = null;
+ }
+ },
elementsetShow(s, e) {
var eventfixed = {
shezhi: 0,
@@ -365,6 +452,35 @@
}
this.getTableData();
},
+ exitFullScreen() {
+ let contentRightDom = document.querySelector(".content-right"); //右侧内容区
+ let contentRightHeight = contentRightDom.offsetHeight;//可视高度
+ //主列表
+ document.querySelector(".main-list-with-sub").style.height = this.mainListHeight ? this.mainListHeight + 'px' : 'calc(50% - 4px)';
+
+ //副列表
+ document.querySelector(".sub-list").style.height = this.mainListHeight ? contentRightHeight-this.mainListHeight-9 + 'px' : 'calc(50% - 4px)';
+ setTimeout(() => {
+ this.isFullScreen = false;
+ if (document.querySelector(".main-list-with-sub").offsetHeight >= 100) {
+ this.mainResizeShow = true;
+ }
+ if (document.querySelector(".sub-list").offsetHeight >= 100) {
+ this.subResizeShow = true;
+ }
+ }, 210);
+ },
+ fullScreen() {
+ let contentRightDom = document.querySelector(".content-right"); //右侧内容区
+ let contentRightHeight = contentRightDom.offsetHeight;//可视高度
+ this.isFullScreen = true;
+ //主列表
+ this.mainListHeight = document.querySelector(".main-list-with-sub").offsetHeight; //记录全屏前主列表的高度
+ document.querySelector(".main-list-with-sub").style.height = '0';
+ this.mainResizeShow = false;
+ //副列表
+ document.querySelector(".sub-list").style.height = contentRightHeight + 'px';
+ },
viewAlertType: function (type, typeObj) {
this.closeViews();
switch (type) {
@@ -405,6 +521,55 @@
this.viewAsset = false;
}
},
+ watch: {
+ showSubList(n) {
+ if (!n) {
+ this.mainTableHeight = this.$tableHeight.normal; //重置table的高度
+ this.isFullScreen = false;
+ //重置二级列表数据
+ this.selectedEndpoints=[];
+ this.showTableData = [];
+ //移动分页组件的位置
+ let paginationTop = document.querySelector(".pagination-top");
+ let paginationBottom = document.querySelector(".pagination-bottom");
+ paginationTop.classList.remove("display-none");
+ if (paginationTop.classList.contains("pagination-top-show")) {
+ paginationTop.classList.remove("pagination-top-show");
+ }
+ if (!paginationTop.classList.contains("pagination-top-hide")) {
+ paginationTop.classList.add("pagination-top-hide");
+ }
+ setTimeout(() => {
+ paginationTop.classList.add("display-none");
+ paginationBottom.appendChild(paginationTop.removeChild(document.querySelector(".pagination")));
+ }, 210);
+
+ this.showTopBtn1 = false;
+ // 主列表恢复全屏
+ this.mainResizeShow = this.subResizeShow = true;
+ document.querySelector('.main-list').style.height = "";
+ //副列表高度清空
+ document.querySelector(".sub-list").style.height = '';
+ } else {
+ this.mainTableHeight = this.$tableHeight.openSubList.mainList; //重置table高度
+ //移动分页组件的位置
+ let paginationTop = document.querySelector(".pagination-top");
+ paginationTop.appendChild(document.querySelector(".pagination-bottom").removeChild(document.querySelector(".pagination")));
+ paginationTop.classList.remove("display-none");
+ setTimeout(() => {
+ if (paginationTop.classList.contains("pagination-top-hide")) {
+ paginationTop.classList.remove("pagination-top-hide");
+ }
+ if (!paginationTop.classList.contains("pagination-top-show")) {
+ paginationTop.classList.add("pagination-top-show");
+ }
+ }, 210);
+ }
+ }
+ },
+ destroyed() {
+ window.onresize = null;
+ },
mounted() {
//是否存在分页缓存
let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId);
diff --git a/nezha-fronted/src/components/page/alert/list.vue b/nezha-fronted/src/components/page/alert/list.vue
index 404d07070..eb92f0bce 100644
--- a/nezha-fronted/src/components/page/alert/list.vue
+++ b/nezha-fronted/src/components/page/alert/list.vue
@@ -99,8 +99,10 @@
-
+
+
i {
- color: #909399;
- font-size: 17px;
- }
- .window-control-btn>i:hover {
- color: $global-text-color-active;
- }
- .pagination-top {
- transition: .2s transform;
- }
- .pagination-top-show {
- transform: translateX(0);
- }
- .pagination-top-hide {
- transform: translateX(150%);
- }