NEZ-1071 feat:terminal log state 改为图标
This commit is contained in:
@@ -87,6 +87,21 @@
|
|||||||
.orange-bg {
|
.orange-bg {
|
||||||
background-color: var(--theme-color) !important;
|
background-color: var(--theme-color) !important;
|
||||||
}
|
}
|
||||||
|
.colorffa416{
|
||||||
|
color: #ffa416;
|
||||||
|
}
|
||||||
|
.colorec7f66{
|
||||||
|
color: #ec7f66;
|
||||||
|
}
|
||||||
|
.color535b64{
|
||||||
|
color: #535b64;
|
||||||
|
}
|
||||||
|
.color999999{
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
.color23bf9a{
|
||||||
|
color: #23bf9a;
|
||||||
|
}
|
||||||
.timezone-area{
|
.timezone-area{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "nz-icon"; /* Project id 2030432 */
|
font-family: "nz-icon"; /* Project id 2030432 */
|
||||||
src: url('iconfont.woff2?t=1634288113261') format('woff2'),
|
src: url('iconfont.woff2?t=1634809124279') format('woff2'),
|
||||||
url('iconfont.woff?t=1634288113261') format('woff'),
|
url('iconfont.woff?t=1634809124279') format('woff'),
|
||||||
url('iconfont.ttf?t=1634288113261') format('truetype');
|
url('iconfont.ttf?t=1634809124279') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.nz-icon {
|
.nz-icon {
|
||||||
@@ -13,6 +13,42 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nz-icon-Panelkong:before {
|
||||||
|
content: "\e748";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-Projectkong:before {
|
||||||
|
content: "\e74f";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-Assetkong:before {
|
||||||
|
content: "\e750";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-ZD:before {
|
||||||
|
content: "\e74e";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-failed:before {
|
||||||
|
content: "\e749";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-stop:before {
|
||||||
|
content: "\e74a";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-unknown-error:before {
|
||||||
|
content: "\e74c";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-over:before {
|
||||||
|
content: "\e74b";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-connecting:before {
|
||||||
|
content: "\e74d";
|
||||||
|
}
|
||||||
|
|
||||||
.nz-icon-label:before {
|
.nz-icon-label:before {
|
||||||
content: "\e747";
|
content: "\e747";
|
||||||
}
|
}
|
||||||
@@ -397,10 +433,6 @@
|
|||||||
content: "\e6f7";
|
content: "\e6f7";
|
||||||
}
|
}
|
||||||
|
|
||||||
.nz-icon-ZD:before {
|
|
||||||
content: "\e6f9";
|
|
||||||
}
|
|
||||||
|
|
||||||
.nz-icon-revoke1:before {
|
.nz-icon-revoke1:before {
|
||||||
content: "\e6ee";
|
content: "\e6ee";
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,8 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "nz-icon"; /* Project id 2030432 */
|
font-family: "nz-icon"; /* Project id 2030432 */
|
||||||
src: url('./font/iconfont.woff2?t=1634288113261') format('woff2'),
|
src: url('./font/iconfont.woff2?t=1634809124279') format('woff2'),
|
||||||
url('./font/iconfont.woff?t=1634288113261') format('woff'),
|
url('./font/iconfont.woff?t=1634809124279') format('woff'),
|
||||||
url('./font/iconfont.ttf?t=1634288113261') format('truetype');
|
url('./font/iconfont.ttf?t=1634809124279') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.nz-icon {
|
.nz-icon {
|
||||||
@@ -13,6 +13,42 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nz-icon-Panelkong:before {
|
||||||
|
content: "\e748";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-Projectkong:before {
|
||||||
|
content: "\e74f";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-Assetkong:before {
|
||||||
|
content: "\e750";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-ZD:before {
|
||||||
|
content: "\e74e";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-failed:before {
|
||||||
|
content: "\e749";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-stop:before {
|
||||||
|
content: "\e74a";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-unknown-error:before {
|
||||||
|
content: "\e74c";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-over:before {
|
||||||
|
content: "\e74b";
|
||||||
|
}
|
||||||
|
|
||||||
|
.nz-icon-connecting:before {
|
||||||
|
content: "\e74d";
|
||||||
|
}
|
||||||
|
|
||||||
.nz-icon-label:before {
|
.nz-icon-label:before {
|
||||||
content: "\e747";
|
content: "\e747";
|
||||||
}
|
}
|
||||||
@@ -397,10 +433,6 @@
|
|||||||
content: "\e6f7";
|
content: "\e6f7";
|
||||||
}
|
}
|
||||||
|
|
||||||
.nz-icon-ZD:before {
|
|
||||||
content: "\e6f9";
|
|
||||||
}
|
|
||||||
|
|
||||||
.nz-icon-revoke1:before {
|
.nz-icon-revoke1:before {
|
||||||
content: "\e6ee";
|
content: "\e6ee";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,13 @@
|
|||||||
>
|
>
|
||||||
<div class="detail-row-info">
|
<div class="detail-row-info">
|
||||||
<div class="asset-manageIp">
|
<div class="asset-manageIp">
|
||||||
<span :class="{'active-icon green-bg':item.status === 0,'active-icon red-bg':item.status !== 0}"></span>
|
<el-tooltip effect="light" placement="right">
|
||||||
<span>{{item.remoteAddr?item.remoteAddr:'-'}}</span>
|
<div slot="content">
|
||||||
|
{{getStatusText(item.status)}}
|
||||||
|
</div>
|
||||||
|
<span><i class="nz-icon" :class="statusClass(item.status)"/></span>
|
||||||
|
</el-tooltip>
|
||||||
|
<span>{{getRemoteText(item)}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="asset-name">
|
<div class="asset-name">
|
||||||
<span>{{item.username?item.username:'-'}}</span>
|
<span>{{item.username?item.username:'-'}}</span>
|
||||||
@@ -43,12 +48,41 @@
|
|||||||
import detailViewLeftMixin from '@/components/common/mixin/detailViewLeftMixin'
|
import detailViewLeftMixin from '@/components/common/mixin/detailViewLeftMixin'
|
||||||
import alertLabel from '@/components/common/alert/alertLabel'
|
import alertLabel from '@/components/common/alert/alertLabel'
|
||||||
import { terminalLog } from '@/components/common/js/constants'
|
import { terminalLog } from '@/components/common/js/constants'
|
||||||
|
import {calcDurationByStringTimeB} from "@/components/common/js/tools";
|
||||||
export default {
|
export default {
|
||||||
name: 'terminalLogDetail',
|
name: 'terminalLogDetail',
|
||||||
mixins: [detailViewLeftMixin],
|
mixins: [detailViewLeftMixin],
|
||||||
components: {
|
components: {
|
||||||
alertLabel
|
alertLabel
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
getStatusText () {
|
||||||
|
return function (status) {
|
||||||
|
return terminalLog.status[status]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getRemoteText () {
|
||||||
|
return function (record) {
|
||||||
|
return `${record.loginUser}@${record.host}:${record.port}`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
statusClass () {
|
||||||
|
return function (status) {
|
||||||
|
switch (status) {
|
||||||
|
case 0:
|
||||||
|
return 'nz-icon-connecting color23bf9a'
|
||||||
|
case 1:
|
||||||
|
return 'nz-icon-failed colorffa416'
|
||||||
|
case 2:
|
||||||
|
return 'nz-icon-over color999999'
|
||||||
|
case 3:
|
||||||
|
return 'nz-icon-stop colorec7f66'
|
||||||
|
case 4:
|
||||||
|
return 'nz-icon-unknown-error color535b64'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
tableTitle: [
|
tableTitle: [
|
||||||
@@ -124,11 +158,6 @@ export default {
|
|||||||
this.$set(item, 'loading', loading)
|
this.$set(item, 'loading', loading)
|
||||||
// this.$set(this.tableData,index,item);// 调用父组件
|
// this.$set(this.tableData,index,item);// 调用父组件
|
||||||
},
|
},
|
||||||
getStatusText () {
|
|
||||||
return function (status) {
|
|
||||||
return terminalLog.status[status]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -835,9 +835,9 @@ const cn = {
|
|||||||
authtype: '认证方式',
|
authtype: '认证方式',
|
||||||
statusItem: {
|
statusItem: {
|
||||||
connecting: '连接中',
|
connecting: '连接中',
|
||||||
connectionFailed: '连接失败',
|
connectionFailed: '发送失败',
|
||||||
over: '已结束',
|
over: '已结束',
|
||||||
kickedOut: '被踢出',
|
kickedOut: '强制退出',
|
||||||
unknownError: '未知错误'
|
unknownError: '未知错误'
|
||||||
},
|
},
|
||||||
option: '操作',
|
option: '操作',
|
||||||
@@ -892,7 +892,8 @@ const cn = {
|
|||||||
loginUser: '登陆用户',
|
loginUser: '登陆用户',
|
||||||
sourceIp: '源 IP',
|
sourceIp: '源 IP',
|
||||||
sourceUser: '源用户',
|
sourceUser: '源用户',
|
||||||
SessionId: '会话 ID'
|
SessionId: '会话 ID',
|
||||||
|
stop: '停止'
|
||||||
},
|
},
|
||||||
dc: {
|
dc: {
|
||||||
dc: '数据中心',
|
dc: '数据中心',
|
||||||
|
|||||||
@@ -876,9 +876,9 @@ const en = {
|
|||||||
authtype: 'AuthType',
|
authtype: 'AuthType',
|
||||||
statusItem: {
|
statusItem: {
|
||||||
connecting: 'Connecting',
|
connecting: 'Connecting',
|
||||||
connectionFailed: 'Connection failed',
|
connectionFailed: 'Failed',
|
||||||
over: 'Over',
|
over: 'Close',
|
||||||
kickedOut: 'Kicked out',
|
kickedOut: 'Stopped',
|
||||||
unknownError: 'Unknown error'
|
unknownError: 'Unknown error'
|
||||||
},
|
},
|
||||||
option: 'Operation', // "操作",
|
option: 'Operation', // "操作",
|
||||||
@@ -932,7 +932,8 @@ const en = {
|
|||||||
loginUser: 'Login user',
|
loginUser: 'Login user',
|
||||||
sourceIp: 'Source IP',
|
sourceIp: 'Source IP',
|
||||||
sourceUser: 'Source user',
|
sourceUser: 'Source user',
|
||||||
SessionId: 'Session ID'
|
SessionId: 'Session ID',
|
||||||
|
stop: 'Stop'
|
||||||
},
|
},
|
||||||
operationlog: {
|
operationlog: {
|
||||||
operationlog: 'Operation log',
|
operationlog: 'Operation log',
|
||||||
|
|||||||
@@ -37,7 +37,12 @@
|
|||||||
<template slot-scope="scope" :column="item">
|
<template slot-scope="scope" :column="item">
|
||||||
<span v-if="item.prop === 'time'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
|
<span v-if="item.prop === 'time'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
|
||||||
<template v-else-if="item.prop === 'state'">
|
<template v-else-if="item.prop === 'state'">
|
||||||
<span>{{getStatusText(scope.row.status)}}</span>
|
<el-tooltip :disabled="!scope.row.status" effect="light" placement="right">
|
||||||
|
<div slot="content">
|
||||||
|
{{getStatusText(scope.row.status)}}
|
||||||
|
</div>
|
||||||
|
<span><i class="nz-icon" :class="statusClass(scope.row.status)"/></span>
|
||||||
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'uuid'">
|
<template v-else-if="item.prop === 'uuid'">
|
||||||
<el-popover
|
<el-popover
|
||||||
@@ -56,7 +61,7 @@
|
|||||||
<span> {{utcTimeToTimezoneStr(scope.row.startTime)}}</span>
|
<span> {{utcTimeToTimezoneStr(scope.row.startTime)}}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'duration'">
|
<template v-else-if="item.prop === 'duration'">
|
||||||
<el-tooltip :disabled="!scope.row.status" effect="light" placement="right">
|
<el-tooltip effect="light" placement="right">
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
{{$t('config.terminallog.endTime')}}<br/>
|
{{$t('config.terminallog.endTime')}}<br/>
|
||||||
{{utcTimeToTimezoneStr(scope.row.endTime)}}
|
{{utcTimeToTimezoneStr(scope.row.endTime)}}
|
||||||
@@ -86,7 +91,7 @@
|
|||||||
<i class="nz-icon nz-icon-more3"></i>
|
<i class="nz-icon nz-icon-more3"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown" class="right-public-box-select-top right-public-box-dropdown-top">
|
<el-dropdown-menu slot="dropdown" class="right-public-box-select-top right-public-box-dropdown-top">
|
||||||
<el-dropdown-item :command="['shutdown', scope.row]"><i class="nz-icon nz-icon-ZD"></i><span class="operation-dropdown-text">Kill</span></el-dropdown-item>
|
<el-dropdown-item :command="['shutdown', scope.row]"><i class="nz-icon nz-icon-ZD"></i><span class="operation-dropdown-text">{{$t('config.terminallog.stop')}}</span></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
@@ -200,6 +205,22 @@ export default {
|
|||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
statusClass () {
|
||||||
|
return function (status) {
|
||||||
|
switch (status) {
|
||||||
|
case 0:
|
||||||
|
return 'nz-icon-connecting color23bf9a'
|
||||||
|
case 1:
|
||||||
|
return 'nz-icon-failed colorffa416'
|
||||||
|
case 2:
|
||||||
|
return 'nz-icon-over color999999'
|
||||||
|
case 3:
|
||||||
|
return 'nz-icon-stop colorec7f66'
|
||||||
|
case 4:
|
||||||
|
return 'nz-icon-unknown-error color535b64'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user