diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index 9c01af841..2590367fa 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -766,7 +766,7 @@ li{ position: absolute; right: 0; } -.config-dropdown, .chart-box-dropdown, .metric-dropdown { +.config-dropdown, .chart-box-dropdown, .chart-box-dropdown-mini, .metric-dropdown { z-index: 2950 !important; } .dc-dropdown { @@ -775,6 +775,9 @@ li{ .chart-box-dropdown { width: 519px; } +.chart-box-dropdown-mini{ + width: 110px; +} .config-dropdown-btn i { font-size: 12px; } @@ -1089,7 +1092,7 @@ li{ } /*列表中状态字段 的小圆点*/ .active-icon{ - margin-top:20px; + margin-top:15px; width:10px; height:10px; border-radius:50%; @@ -1101,6 +1104,13 @@ li{ background-color:lightGreen; } +.clickable:hover{ + cursor:pointer; +} +.unclickable:hover{ + cursor: not-allowed; +} + /* panel-tool-tip列表搜索框 样式重写*/ .relative-position{ position: relative; diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 0abf694ac..2ee04efa7 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -427,7 +427,7 @@ const en = { path: 'Path',//"路径" asset: 'Device',//"设备" lastUpdate: 'Last update time',//"最后更新时间" - moduleParameter: 'Module parameter',//"组件参数" + moduleParameter: 'Module',//"组件参数" addGraph: 'View Graph', //添加图标 element: 'Element', value: 'Value', diff --git a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue index f9f05fbf4..233204b09 100644 --- a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue @@ -129,7 +129,7 @@ - + diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index d4d4f4293..77ed45473 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -58,6 +58,7 @@ :width="item.width" :key="`col_${index}`" :label="item.label" + :fixed="item.fixed" :show-overflow-tooltip="item.prop != 'Alert' || item.prop != 'Module'" min-width="110px" :class-name="item.prop == 'option' ? 'content-right-options' : ''" @@ -92,7 +93,7 @@ placement="right" width="50" trigger="hover" - :content="scope.row.pingRtt ? scope.row.pingRtt+'ms':'unreachable'"> + :content="scope.row.pingRtt ? (scope.row.pingLastUpdate&&scope.row.pingLastUpdate!=''?(new Date(scope.row.pingLastUpdate).getHours()+':'+new Date(scope.row.pingLastUpdate).getMinutes()):'--')+'['+ scope.row.pingRtt+'ms'+']':(scope.row.pingLastUpdate&&scope.row.pingLastUpdate!=''?(new Date(scope.row.pingLastUpdate).getHours()+':'+new Date(scope.row.pingLastUpdate).getMinutes()):'--')+'[unreachable]'">
@@ -102,28 +103,34 @@ - + + {{scope.row.moduleNum}}
@@ -133,7 +140,7 @@ {{scope.row.model.vendor.value}}
- {{scope.row.purchaseDate}} + {{returnData(scope.row.purchaseDate)}}
{{getPrincipalName(scope.row.idc.principal)}} @@ -142,17 +149,20 @@ {{scope.row.idc.tel}}
@@ -221,6 +231,13 @@ tablelable: [], dropCol: [], tableTitle: [ + { + label: this.$t("asset.tableTitle.host"), + prop: 'HOST', + show: true, + width: 130, + fixed:'left' + }, { label: this.$t("asset.tableTitle.id"), prop: 'ID', @@ -235,12 +252,7 @@ prop: 'SN', show: true, width: 130 - }, { - label: this.$t("asset.tableTitle.host"), - prop: 'HOST', - show: true, - width: 130 - }, { + }, { label: this.$t("asset.tableTitle.assetState"), prop: 'state', show: true, @@ -291,7 +303,8 @@ label: this.$t('config.account.option'), prop: 'option', show: true, - width: 280 + width: 280, + fixed:'right' }], tableData: [], checkListData: [], @@ -657,11 +670,11 @@ }, returnData(data) { if (data && data !== '--') { - return data.name; + return data; } else if (data === '--') { - return '-'; + return '--'; } else { - return "-"; + return "--"; } }, flushData() { diff --git a/nezha-fronted/src/components/page/config/promServer.vue b/nezha-fronted/src/components/page/config/promServer.vue index 7b1d751e3..6d768f2e2 100644 --- a/nezha-fronted/src/components/page/config/promServer.vue +++ b/nezha-fronted/src/components/page/config/promServer.vue @@ -64,7 +64,7 @@ {{scope.row[item.prop] == '2' ? 'Per-Datacenter' : ''}} - +
diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index 896d6d2bc..6da83149c 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -119,7 +119,7 @@
- + span-{{item}} @@ -132,7 +132,18 @@
- + + + + px
@@ -198,7 +209,7 @@ title: '', type:'line', span:12, - height:400, + height:'400', elements:{ id: '', expression: '', @@ -247,6 +258,7 @@ id: '', name: '' }, + heightSuggestions:['300','400','500','600'] } }, components:{ @@ -623,7 +635,7 @@ this.chart.title = ''; this.chart.type = 'line'; this.chart.span = 12; - this.chart.height = 400; + this.chart.height = 400+''; this.elements = [1]; this.elementTarget = []; bus.chartAddInfo.metricTarget = []; @@ -640,7 +652,22 @@ }, /*metric部分相关方法--end*/ - + querySearch(queryString, cb) { + console.log(queryString) + var suggestions = this.heightSuggestions; + var results = queryString ? suggestions.filter(this.createFilter(queryString)) : suggestions; + console.log(results) + // 调用 callback 返回建议列表的数据 + cb(results); + }, + createFilter(queryString) { + return (suggestion) => { + return (suggestion.toLowerCase().indexOf(queryString.toLowerCase()) === 0); + }; + }, + handleSelect:function(item){ + this.chart.height=item; + } }, created() { @@ -665,4 +692,9 @@ } } + diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue index 11b4ce0ab..ac55077c5 100644 --- a/nezha-fronted/src/components/page/project/project.vue +++ b/nezha-fronted/src/components/page/project/project.vue @@ -46,7 +46,7 @@ {{item.name}}
- + @@ -136,23 +136,24 @@ @@ -221,6 +222,21 @@ + { + return item.metric===temp; + }))[0]; delete result.metric.__name__; temp+="{"; for (let key in result.metric){ @@ -940,7 +961,7 @@ } temp=temp.charAt(temp.length-1) == ","?temp.substr(0,temp.length-1):temp; temp+="}"; - let edpQueryData={element:temp,value:result.value[1],type:(result.metric.type?result.metric.type:'2')}; + let edpQueryData={element:temp,value:result.value[1],type:(result.metric.type?result.metric.type:'2'),metricTip:metricTip}; this.showTableData.push(edpQueryData); this.labelList=Array.from(this.labelSet).map((item,index)=>{ return {key:item,type:'label'} @@ -1219,6 +1240,14 @@ }, clearInput:function(){ this.$refs.elementQuery.foucs(); + }, + queryElementTips:function(){ + this.elementMetricDatas=[]; + this.$get("/metric/metadata?endpointId="+this.curEndpoint.id).then(response=> { + if (response.status === "success") { + this.elementMetricDatas=response.data.list; + } + }) } }, created() { @@ -1523,4 +1552,23 @@ } /* end--覆盖分页组件样式*/ + /* 列表搜索框 样式重写*/ + .relative-position{ + position: relative; + } + .query-input-inactive{ + left:213px; + width: 18%; + } + .query-input-inactive .el-input__inner{ + height: 26px; + line-height: 26px; + } +/* 左侧列表dc 编辑按钮影藏样式*/ + .hid-div{ + visibility: hidden; + } + .sidebar-info-item:hover .hid-div{ + visibility: visible; + }