Merge branch 'dev-3.5' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.6
# Conflicts: # nezha-fronted/src/assets/css/components/common/bottomBox/bottomBox.scss # nezha-fronted/src/components/common/mixin/routerPathParams.js
This commit is contained in:
@@ -114,6 +114,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
chartTypeList: chartConstant.type,
|
||||
qsArr: [],
|
||||
tableTitle: [
|
||||
{
|
||||
label: 'ID',
|
||||
@@ -185,17 +186,56 @@ export default {
|
||||
case 'logs':
|
||||
str += 'nz-icon-logs'
|
||||
break
|
||||
case 'log':
|
||||
str += 'nz-icon-logs'
|
||||
break
|
||||
case 'bubble':
|
||||
str += 'nz-icon-bubble'
|
||||
break
|
||||
case 'area':
|
||||
str += 'nz-icon-stack-area'
|
||||
break
|
||||
case 'point':
|
||||
str += 'nz-icon-bubble'
|
||||
break
|
||||
case 'stat':
|
||||
str += 'nz-icon-single-value'
|
||||
break
|
||||
case 'hexagon':
|
||||
str += 'nz-icon-duobianxing'
|
||||
break
|
||||
case 'gauge':
|
||||
str += 'nz-icon-menu-dashboard'
|
||||
break
|
||||
case 'treemap':
|
||||
str += 'nz-icon-Firewall'
|
||||
break
|
||||
case 'sankey':
|
||||
str += 'nz-icon-sankey'
|
||||
break
|
||||
case 'rank':
|
||||
str += 'nz-icon-rank'
|
||||
break
|
||||
case 'diagram':
|
||||
str += 'nz-icon-diagram'
|
||||
break
|
||||
case 'map':
|
||||
str += 'nz-icon-map'
|
||||
break
|
||||
case 'clock':
|
||||
str += 'nz-icon-clock'
|
||||
break
|
||||
case 'topology':
|
||||
str += 'nz-icon-projectTopology'
|
||||
break
|
||||
default :
|
||||
str += 'nz-icon-table1'
|
||||
// str += 'nz-icon-table1'
|
||||
break
|
||||
}
|
||||
return str
|
||||
},
|
||||
findTypeLabel (row) {
|
||||
const typeItem = this.chartTypeList.find(title => title.value === row.type)
|
||||
const typeItem = this.chartTypeList.find(title => title.value == row.type)
|
||||
return typeItem ? this.$t(typeItem.label) : '-'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,15 +312,18 @@ export default {
|
||||
methods: {
|
||||
copyValue (item) {
|
||||
const str = item
|
||||
const domUrl = document.createElement('input')
|
||||
domUrl.value = JSON.stringify(str)
|
||||
domUrl.id = 'creatDom'
|
||||
document.body.appendChild(domUrl)
|
||||
domUrl.select() // 选择对象
|
||||
document.execCommand('Copy') // 执行浏览器复制命令
|
||||
const creatDom = document.getElementById('creatDom')
|
||||
creatDom.parentNode.removeChild(creatDom)
|
||||
this.$message.success(this.$t('overall.copySuccess'))
|
||||
// const domUrl = document.createElement('input')
|
||||
// domUrl.value = JSON.stringify(str)
|
||||
// domUrl.id = 'creatDom'
|
||||
// document.body.appendChild(domUrl)
|
||||
// domUrl.select() // 选择对象
|
||||
// document.execCommand('Copy') // 执行浏览器复制命令
|
||||
// const creatDom = document.getElementById('creatDom')
|
||||
// creatDom.parentNode.removeChild(creatDom)
|
||||
// this.$message.success(this.$t('overall.copySuccess'))
|
||||
this.$copyText(JSON.stringify(str)).then(() => {
|
||||
this.$message.success({ message: this.$t('overall.copySuccess') })
|
||||
})
|
||||
},
|
||||
suspendedStr (status) { // 10进制转为2进制 分别给对应的状态
|
||||
if (!status || status === 1 || status == 0) { return '' }
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<el-table
|
||||
id="recordRuleEvalLogTable"
|
||||
ref="dataTable"
|
||||
:data="tableData"
|
||||
:height="height"
|
||||
tooltip-effect="light"
|
||||
border
|
||||
@header-dragend="dragend"
|
||||
@sort-change="tableDataSort"
|
||||
@selection-change="selectionChange"
|
||||
@row-dblclick="(row)=>{queryMessage(row)}"
|
||||
>
|
||||
<!-- <el-table-column
|
||||
:resizable="false"
|
||||
align="center"
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
v-for="(item, index) in customTableTitle"
|
||||
v-if="item.show"
|
||||
:key="`col-${index}`"
|
||||
:fixed="item.fixed"
|
||||
:label="item.label"
|
||||
:min-width="`${item.minWidth}`"
|
||||
:prop="item.prop"
|
||||
:resizable="true"
|
||||
:sort-orders="['ascending', 'descending']"
|
||||
:sortable="item.sortable"
|
||||
:width="`${item.width}`"
|
||||
:show-overflow-tooltip="item.prop === 'description'"
|
||||
class="data-column"
|
||||
>
|
||||
<template slot="header">
|
||||
<span class="data-column__span">{{item.label}}</span>
|
||||
<div class="col-resize-area"></div>
|
||||
</template>
|
||||
<template slot-scope="scope" :column="item">
|
||||
<template v-if="item.prop === 'state'">
|
||||
<div>
|
||||
<div :class="{'active-icon green-bg':scope.row.state == 200,'active-icon red-bg':scope.row.state != 200}" style="position: relative">
|
||||
</div>
|
||||
<span>{{scope.row.state == 200?'Ok':'Error'}}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'duration'">
|
||||
<el-tooltip :disabled="!scope.row.etts" effect="light" placement="right">
|
||||
<div slot="content">
|
||||
{{$t('overall.endTime')}}<br/>
|
||||
{{utcTimeToTimezoneStr(scope.row.etts)}}
|
||||
</div>
|
||||
<span>{{getDuration(scope.row)}}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'stts'">
|
||||
{{utcTimeToTimezoneStr(scope.row[item.prop])}}
|
||||
</template>
|
||||
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
|
||||
<template v-else>-</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template slot="empty">
|
||||
<div v-if="!loading" class="table-no-data">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#nz-icon-no-data-list"></use>
|
||||
</svg>
|
||||
<div class="table-no-data__title">No results found</div>
|
||||
</div>
|
||||
<div v-else> </div>
|
||||
</template>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import table from '@/components/common/mixin/table'
|
||||
import { calcDurationByStringTimeMs } from '@/components/common/js/tools'
|
||||
export default {
|
||||
name: 'recordRuleEvalLogTable',
|
||||
mixins: [table],
|
||||
props: {
|
||||
loading: Boolean,
|
||||
nowTime: {}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
tableTitle: [
|
||||
{
|
||||
label: this.$t('overall.startTime'),
|
||||
prop: 'stts',
|
||||
show: true,
|
||||
minWidth: 120
|
||||
}, {
|
||||
label: this.$t('config.terminallog.duration'),
|
||||
prop: 'duration',
|
||||
show: true,
|
||||
minWidth: 120
|
||||
}, {
|
||||
label: this.$t('overall.state'),
|
||||
prop: 'state',
|
||||
show: true,
|
||||
minWidth: 120
|
||||
}, {
|
||||
label: this.$t('alert.alertRuleMessage'),
|
||||
prop: 'msg',
|
||||
show: true,
|
||||
minWidth: 120
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
methods: {
|
||||
getDuration (record) {
|
||||
if (record.etts) {
|
||||
return calcDurationByStringTimeMs(record.stts, record.etts)
|
||||
}
|
||||
return calcDurationByStringTimeMs(record.stts, this.utcTimeToTimezoneStr(this.nowTime))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.colorEF7458{
|
||||
color: #EF7458;
|
||||
}
|
||||
.color23BF9A{
|
||||
color: #23BF9A;
|
||||
}
|
||||
/deep/ .active-icon {
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.severity .P1{
|
||||
background: #F5846A;
|
||||
border-radius: 2px;
|
||||
font-size: 12px;
|
||||
color: #FFFFFF;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
.severity .P2{
|
||||
background: #F7A54A;
|
||||
border-radius: 2px;
|
||||
font-size: 12px;
|
||||
color: #FFFFFF;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
.severity .P3{
|
||||
background: #F1C13D;
|
||||
border-radius: 2px;
|
||||
font-size: 12px;
|
||||
color: #FFFFFF;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
.schedEnableTitle{
|
||||
padding: 20px 15px;
|
||||
margin-right: 0;
|
||||
left: 1995px !important;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid rgba(119,131,145,0.60);
|
||||
box-shadow: 0 6px 16px 0 rgba(0,0,0,0.08);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.schedEnableTitle .nz-icon-a-rilizhou, .schedEnableTitle .nz-icon-dingshishijian{
|
||||
font-size: 14px;
|
||||
color: #666666;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.schedEnableTitle .week-item{
|
||||
width: 32px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
opacity: 0.9;
|
||||
background: #F6F6FA;
|
||||
border-radius: 2px;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
letter-spacing: 0;
|
||||
font-weight: 400;
|
||||
padding-left: 3px;
|
||||
margin-right: 12px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user