diff --git a/nezha-fronted/src/assets/css/common/tableCommon.scss b/nezha-fronted/src/assets/css/common/tableCommon.scss index 135493d3a..3b41b64e4 100644 --- a/nezha-fronted/src/assets/css/common/tableCommon.scss +++ b/nezha-fronted/src/assets/css/common/tableCommon.scss @@ -94,6 +94,16 @@ border: 1px solid #E7EAED; border-bottom: none; + .caret-wrapper { + height: 23px; + .sort-caret.ascending { + top: 1px; + } + .sort-caret.descending { + bottom: 0; + } + } + .el-table-column--selection { width: 55px !important; } @@ -145,15 +155,16 @@ border: none; border-radius: $--button-border-radius; background-color: $--button-primary-background-color; - opacity: .8; + opacity: 1; cursor: pointer; - + transition: all .2s; i { color: $--button-primary-color; font-size: 12px; } } >.table-operation-item:hover { + opacity: .8; } .table-operation-item.table-operation-item--more { justify-content: space-between; @@ -186,10 +197,11 @@ .el-table--border td { border-right: none !important; } - .el-table--border .el-table__body-wrapper td:nth-last-child(2) { + /* 最后一列用box-shadow模拟边框 */ + .el-table:not(.no-operation).el-table--border .el-table__body-wrapper td:nth-last-child(2) { box-shadow: 1px 0 #E7EAED; } - .el-table--border .el-table__header-wrapper th:nth-last-child(3) { + .el-table:not(.no-operation).el-table--border .el-table__header-wrapper th:nth-last-child(3) { border-right: none !important; box-shadow: 1px 0 #E7EAED; } diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index 7a41cb76e..e5e463cc9 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -133,7 +133,7 @@ import loading from '../common/loading' import axios from 'axios' import pickTime from '../common/pickTime' import chart from '../page/dashboard/overview/chart' -import alertMessageTable from '@/components/common/alert/alertMessageTable.vue' +import alertMessageTable from '@/components/common/table/alert/alertMessageTable.vue' export default { name: 'chartTable', components: { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue index 630e32521..67e8c6ac1 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue @@ -89,13 +89,13 @@ - - - - - - + + type="selection" + width="55"> - + {{scope.row.alertRule.alertName}} + @mouseenter="alertMessageHover(scope.row.alertRule, true, $event)" + @mouseleave="alertMessageHover(scope.row.alertRule, false)" + >{{scope.row.alertRule.name}} - @@ -75,15 +59,12 @@ P1 - P2 - P3 - {{utcTimeToTimezoneStr(scope.row[item.prop])}} - + {{$t('config.terminallog.endTime')}} {{scope.row.endAt}} @@ -97,10 +78,10 @@ @mouseenter="labelHover(scope.row, item.label, true, $event)" @mouseleave="labelHover(scope.row, item.label, false)"> {{item.value}} @@ -112,33 +93,6 @@ :type="item.label" > - - - {{scope.row['state'] == 1 ? "Pending" : ""}} @@ -148,141 +102,56 @@ - - + {{formatThreshold(scope.row.current[1],scope.row.alertRule.unit)}} {{$unixTimeParseToString(scope.row.current[0])}} - - - {{scope.row[item.prop]}} - - - - - - - - + + {{$t('overall.option')}} + + + - - - - - - - - {{$t('overall.exportCur')}} - - - {{$t('overall.exportAll')}} - - - - - - - - - - - - - - - - {{$t('tip.no')}} - - - {{$t('tip.yes')}} - - - - - - - - {{$t("project.endpoint.dialogTitle")}} - - - - - - + diff --git a/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue b/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue new file mode 100644 index 000000000..a660428b7 --- /dev/null +++ b/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue @@ -0,0 +1,224 @@ + + + + + + + {{item.label}} + + + + + + + {{$t('config.terminallog.endTime')}} + {{scope.row.endAt}} + + {{getDuration(scope.row)}} + + + + + + {{scope.row.type}} + {{scope.row.linkName}} + + + Alert rule + {{scope.row.ruleName}} + + + + + pending + active + expired + + + {{utcTimeToTimezoneStr(scope.row[item.prop])}} + + {{scope.row[item.prop] || '-'}} + - + + + + {{$t('overall.option')}} + + + + + … + + + {{$t('overall.edit')}} + {{$t('buttons.expire')}} + + + + + + + + + diff --git a/nezha-fronted/src/components/common/table/nzDataList.vue b/nezha-fronted/src/components/common/table/nzDataList.vue index f221ca75f..4b292332a 100644 --- a/nezha-fronted/src/components/common/table/nzDataList.vue +++ b/nezha-fronted/src/components/common/table/nzDataList.vue @@ -9,11 +9,11 @@ - + - diff --git a/nezha-fronted/src/components/common/table/settings/agentTable.vue b/nezha-fronted/src/components/common/table/settings/agentTable.vue new file mode 100644 index 000000000..afc83aaef --- /dev/null +++ b/nezha-fronted/src/components/common/table/settings/agentTable.vue @@ -0,0 +1,130 @@ + + + + + + + {{item.label}} + + + + {{scope.row[item.prop]?scope.row[item.prop].name:'-'}} + + + {{findServerType(scope.row[item.prop]).text}} + + {{utcTimeToTimezoneStr(scope.row[item.prop])}} + + + + + + + + {{scope.row[item.prop]}} + - + + + + {{$t('overall.option')}} + + + + + … + + + {{$t('overall.delete')}} + + + + + + + + diff --git a/nezha-fronted/src/components/common/table/settings/dcTable.vue b/nezha-fronted/src/components/common/table/settings/dcTable.vue new file mode 100644 index 000000000..034533a49 --- /dev/null +++ b/nezha-fronted/src/components/common/table/settings/dcTable.vue @@ -0,0 +1,163 @@ + + + + + + + {{item.label}} + + + + + + + {{item.username}} + + + - + + + {statusChange(scope.row)}" + /> + + + {{scope.row.longitude}} + - + + + {{scope.row.latitude}} + - + + + + + {{scope.row.assetStat.total}} + {{scope.row.assetStat.inStock}} + {{scope.row.assetStat.outStock}} + {{scope.row.assetStat.suspended}} + + + + + + {{scope.row[item.prop]}} + + {{scope.row[item.prop]}} + - + + + + {{$t('overall.option')}} + + + + + … + + + {{$t('overall.delete')}} + + + + + + + + diff --git a/nezha-fronted/src/components/common/table/settings/exprTmplTable.vue b/nezha-fronted/src/components/common/table/settings/exprTmplTable.vue new file mode 100644 index 000000000..76193608d --- /dev/null +++ b/nezha-fronted/src/components/common/table/settings/exprTmplTable.vue @@ -0,0 +1,95 @@ + + + + + + + {{item.label}} + + + + {{scope.row[item.prop] || '-'}} + - + + + + {{$t('overall.option')}} + + + + + … + + + {{$t('overall.edit')}} + {{$t('overall.delete')}} + + + + + + + + diff --git a/nezha-fronted/src/components/common/table/settings/mibTable.vue b/nezha-fronted/src/components/common/table/settings/mibTable.vue new file mode 100644 index 000000000..2a091e803 --- /dev/null +++ b/nezha-fronted/src/components/common/table/settings/mibTable.vue @@ -0,0 +1,163 @@ + + + + + + + {{item.label}} + + + + {{scope.row[item.prop].name}} + + {{scope.row[item.prop]}} + + + + + + + + + {{$t('overall.name')}}: + {{n.name}} + + + {{$t('config.mib.vendor')}}: + {{n.vendor}} + + + {{$t('config.mib.type')}}: + {{n.type}} + + + + {{n.name}}, + {{n.name}} + + + + + + + {{utcTimeToTimezoneStr(scope.row[item.prop])}} + {{scope.row[item.prop]}} + - + + + + {{$t('overall.option')}} + + + + + … + + + {{$t('overall.edit')}} + {{$t('overall.delete')}} + + + + + + + + diff --git a/nezha-fronted/src/components/common/table/settings/operationLogTable.vue b/nezha-fronted/src/components/common/table/settings/operationLogTable.vue new file mode 100644 index 000000000..8fa874664 --- /dev/null +++ b/nezha-fronted/src/components/common/table/settings/operationLogTable.vue @@ -0,0 +1,131 @@ + + + + + + + {{item.label}} + + + + + {{scope.row[item.prop]}} ms + + {{formatUsername(scope.row)}} + {{utcTimeToTimezoneStr(scope.row[item.prop])}} + {{scope.row[item.prop]}} + + + + + + diff --git a/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue b/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue new file mode 100644 index 000000000..858b2a7f9 --- /dev/null +++ b/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue @@ -0,0 +1,179 @@ + + + + + + + {{item.label}} + + + + {{utcTimeToTimezoneStr(scope.row[item.prop])}} + + {{getStatusText(scope.row.status)}} + + + {{scope.row.uuid.substring(0, 8).toUpperCase()}} + + + {{getRemoteText(scope.row)}} + + + + + {{$t('config.terminallog.endTime')}} + {{scope.row.endTime}} + + {{getDuration(scope.row)}} + + + + {{$t('config.terminallog.password')}} + {{$t('config.terminallog.key')}} + + {{scope.row[item.prop]}} + + + + {{$t('overall.option')}} + + + + + + … + + + Kill + + + + + + + + … + + + {{$t('config.terminallog.record.record')}} + + + + + + + + + diff --git a/nezha-fronted/src/components/common/table/settings/userTable.vue b/nezha-fronted/src/components/common/table/settings/userTable.vue index 7098b396f..a5c5ae88c 100644 --- a/nezha-fronted/src/components/common/table/settings/userTable.vue +++ b/nezha-fronted/src/components/common/table/settings/userTable.vue @@ -46,7 +46,7 @@ {statusChange(scope.row)}"> diff --git a/nezha-fronted/src/components/layout/leftMenu.vue b/nezha-fronted/src/components/layout/leftMenu.vue index 7f8a20e31..3e48f5b5b 100644 --- a/nezha-fronted/src/components/layout/leftMenu.vue +++ b/nezha-fronted/src/components/layout/leftMenu.vue @@ -8,7 +8,7 @@ - + diff --git a/nezha-fronted/src/components/page/alert/list.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue similarity index 50% rename from nezha-fronted/src/components/page/alert/list.vue rename to nezha-fronted/src/components/page/alert/alertMessage.vue index 7bbc883c5..0f3682f44 100644 --- a/nezha-fronted/src/components/page/alert/list.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -1,145 +1,120 @@ - - - - - - - - - - - - - - - - - {this.batchDeleteObjs=selection}" - :now-time="nowTime" - > - - - - - + + + + + + + + + + + { $refs.dataList.showBottomBox(targetTab, object) }" + @toDelete="toDeleteMessage"> + + + + + + - + - + {{$t('overall.exportCur')}} - + {{$t('overall.exportAll')}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + {{$t('tip.no')}} + + + {{$t('tip.yes')}} + + + + + + + + {{$t("project.endpoint.dialogTitle")}} + + + + + + - diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue new file mode 100644 index 000000000..03f9fb2e9 --- /dev/null +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + { $refs.dataList.showBottomBox(targetTab, object) }"> + + + + + + + + + + + + diff --git a/nezha-fronted/src/components/page/alert/alertSilence.vue b/nezha-fronted/src/components/page/alert/alertSilence.vue new file mode 100644 index 000000000..ef2483a82 --- /dev/null +++ b/nezha-fronted/src/components/page/alert/alertSilence.vue @@ -0,0 +1,173 @@ + + + + + + + + + + + { $refs.dataList.showBottomBox(targetTab, object) }"> + + + + + + + + + + + + + + + {{$t('overall.exportCur')}} + + + {{$t('overall.exportAll')}} + + + + + + + + + diff --git a/nezha-fronted/src/components/page/alert/config.vue b/nezha-fronted/src/components/page/alert/config.vue deleted file mode 100644 index e62dbc028..000000000 --- a/nezha-fronted/src/components/page/alert/config.vue +++ /dev/null @@ -1,552 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - {this.batchDeleteObjs=selection}" - > - - - - - - - - - - - P1 - - P2 - - P3 - - - - {{scope.row.alertNum + ' ' + $t('overall.active')}} - - - {{formatThreshold(scope.row[item.prop],scope.row.unit)}} - - - {{user.userName}} - - {{scope.row[item.prop]}} - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nezha-fronted/src/components/page/alert/silence.vue b/nezha-fronted/src/components/page/alert/silence.vue deleted file mode 100644 index 2a3a7e91d..000000000 --- a/nezha-fronted/src/components/page/alert/silence.vue +++ /dev/null @@ -1,581 +0,0 @@ - - - - - - - - - - - - - - - - - - - - {this.batchDeleteObjs=selection}" - > - - - - - - - - - - - - - - - - - - - - {{$t('config.terminallog.endTime')}} - {{scope.row.endAt}} - - {{getDuration(scope.row)}} - - - - - - {{scope.row.type}} - {{scope.row.linkName}} - - - Alert rule - {{scope.row.ruleName}} - - - - - pending - active - expired - - - {{utcTimeToTimezoneStr(scope.row[item.prop])}} - - {{scope.row[item.prop] || '-'}} - - - - - - - - - - - - - - - - - - - - - - - - - {{$t('overall.exportCur')}} - - - {{$t('overall.exportAll')}} - - - - - - - - - - - - - - diff --git a/nezha-fronted/src/components/page/config/agent.vue b/nezha-fronted/src/components/page/config/agent.vue new file mode 100644 index 000000000..4da20eefc --- /dev/null +++ b/nezha-fronted/src/components/page/config/agent.vue @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + { $refs.dataList.showBottomBox(targetTab, object) }"> + + + + + + + + + + + + + {{$t('config.agent.agent.download')}} + + + + + {{item.label}} + + + + + {{$t('config.agent.agent.download')}} + + {{$t('config.agent.agent.autoScript')}} + + + + + + {{item.name}} + + + + + + + {{item.label}} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index 666f2102c..76727a6f2 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -1,127 +1,33 @@ - + + :search-msg="searchMsg"> - - {batchDeleteObjs=selection}" - > - - - - - - {{item.label}} - - - - - - - - {{item.username}} - - - - - - - {statusChange(scope.row)}" - /> - - - {{scope.row.longitude}} - - - - - {{scope.row.latitude}} - - - - - - - {{scope.row.assetStat.total}} - {{scope.row.assetStat.inStock}} - {{scope.row.assetStat.outStock}} - {{scope.row.assetStat.suspended}} - - - - - - {{scope.row[item.prop]}} - - {{scope.row[item.prop]}} - - - - - - {{$t('overall.option')}} - - - - - … - - - {{$t('overall.edit')}} - {{$t('overall.delete')}} - - - - - - - + :table-data="tableData" + @del="del" + @edit="edit" + @orderBy="tableDataSort" + @reload="getTableData" + @selectionChange="selectionChange" + @showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"> @@ -135,7 +41,6 @@ - - diff --git a/nezha-fronted/src/components/page/config/operationLog.vue b/nezha-fronted/src/components/page/config/operationLog.vue index 021b4ed3a..3481112e7 100644 --- a/nezha-fronted/src/components/page/config/operationLog.vue +++ b/nezha-fronted/src/components/page/config/operationLog.vue @@ -1,61 +1,26 @@ - + + :search-msg="searchMsg"> - {batchDeleteObjs=selection}" - > - - - - - - {{item.label}} - - - - - - {{scope.row[item.prop]}} ms - - {{formatUsername(scope.row)}} - {{utcTimeToTimezoneStr(scope.row[item.prop])}} - {{scope.row[item.prop]}} - - - - - + :table-data="tableData" + @del="del" + @edit="edit" + @orderBy="tableDataSort" + @reload="getTableData" + @selectionChange="selectionChange" + @showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"> @@ -66,79 +31,20 @@ diff --git a/nezha-fronted/src/components/page/config/promServer.vue b/nezha-fronted/src/components/page/config/promServer.vue deleted file mode 100644 index aa2d1a916..000000000 --- a/nezha-fronted/src/components/page/config/promServer.vue +++ /dev/null @@ -1,483 +0,0 @@ - - - - - - - - - - - - - - {batchDeleteObjs=selection}" - > - - - - - - {{item.label}} - - - - - {{scope.row[item.prop]?scope.row[item.prop].name:'-'}} - - - {{findServerType(scope.row[item.prop]).text}} - - {{utcTimeToTimezoneStr(scope.row[item.prop])}} - - - - - - - - {{scope.row[item.prop]}} - - - - - - {{$t('overall.option')}} - - - - - … - - - {{$t('overall.edit')}} - {{$t('overall.delete')}} - - - - - - - - - - - - - - - - - - - - {{$t('config.promServer.agent.download')}} - - - - - {{item.label}} - - - - - {{$t('config.promServer.agent.download')}} - - {{$t('config.promServer.agent.autoScript')}} - - - - - - {{item.name}} - - - - - - - {{item.label}} - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nezha-fronted/src/components/page/config/roles.vue b/nezha-fronted/src/components/page/config/roles.vue index c10bebe98..68cff08bc 100644 --- a/nezha-fronted/src/components/page/config/roles.vue +++ b/nezha-fronted/src/components/page/config/roles.vue @@ -8,11 +8,11 @@ :from="fromRoute.role" :search-msg="searchMsg"> - - + - + + :search-msg="searchMsg"> - {batchDeleteObjs=selection}" - > - - - - - - {{item.label}} - - - - - {{utcTimeToTimezoneStr(scope.row[item.prop])}} - - {{getStatusText(scope.row.status)}} - - - {{scope.row.uuid.substring(0, 8).toUpperCase()}} - - - {{getRemoteText(scope.row)}} - - - - - {{$t('config.terminallog.endTime')}} - {{scope.row.endTime}} - - {{getDuration(scope.row)}} - - - - {{$t('config.terminallog.password')}} - {{$t('config.terminallog.key')}} - - {{scope.row[item.prop]}} - - - - {{$t('overall.option')}} - - - - - - … - - - Kill - - - - - - - - … - - - {{$t('config.terminallog.record.record')}} - - - - - - - - + :now-time="nowTime" + :table-data="tableData" + @del="del" + @edit="edit" + @orderBy="tableDataSort" + @reload="getTableData" + @selectionChange="selectionChange" + @showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"> @@ -113,73 +31,21 @@