Skip to content

Commit

Permalink
gotoreplay
Browse files Browse the repository at this point in the history
  • Loading branch information
Halo1236 committed Aug 31, 2023
1 parent d5aa439 commit c2f87a5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/components/Table/TableFormatters/DetailFormatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
routeQuery: null,
can: true,
openInNewPage: false,
openLink: null,
getTitle({ col, row, cellValue }) {
return cellValue
},
Expand Down Expand Up @@ -100,7 +101,15 @@ export default {
methods: {
goDetail() {
if (this.formatterArgs.openInNewPage) {
const { href } = this.$router.resolve(this.detailRoute)
console.log(this.detailRoute)
let { href } = this.$router.resolve(this.detailRoute)
if (this.formatterArgs.openLink && typeof this.formatterArgs.openLink === 'function') {
href = this.formatterArgs.openLink({
row: this.row,
col: this.col,
cellValue: this.cellValue
})
}
window.open(href, '_blank')
} else {
this.$router.push(this.detailRoute)
Expand Down
1 change: 1 addition & 0 deletions src/i18n/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@
"riskLevels": {
"common": "common"
},
"position": "Position",
"SessionID": "Session ID",
"TargetResources": "Target resources",
"UseProtocol": "Use protocol",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/langs/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@
"riskLevels": {
"common": "普通"
},
"position": "位置",
"SessionID": "セッションID",
"TargetResources": "ターゲットリソース",
"UseProtocol": "使用契約",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/langs/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,7 @@
"riskLevels": {
"common": "普通"
},
"position": "定位",
"SessionID": "会话ID",
"TargetResources": "目标资源",
"UseProtocol": "使用协议",
Expand Down
2 changes: 1 addition & 1 deletion src/layout/components/NavHeader/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
},
{
label: this.$t('common.Version'),
value: 'version-dev'
value: 'v3.6.2'
},
{
label: this.$t('common.PermissionCompany'),
Expand Down
17 changes: 15 additions & 2 deletions src/views/sessions/CommandList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default {
},
columns: [
'expandCol', 'input', 'risk_level', 'user', 'remote_addr',
'asset', 'account', 'session', 'timestamp'
'asset', 'account', 'session', 'replay', 'timestamp'
],
extraQuery: {
date_to: dateTo,
Expand Down Expand Up @@ -86,7 +86,6 @@ export default {
session: {
label: this.$t('sessions.session'),
formatter: DetailFormatter,
width: '80px',
formatterArgs: {
openInNewPage: true,
can: this.$hasPerm('terminal.view_session'),
Expand All @@ -101,6 +100,20 @@ export default {
}
}
},
replay: {
label: this.$t('sessions.replay'),
formatter: DetailFormatter,
formatterArgs: {
openInNewPage: true,
can: this.$hasPerm('terminal.view_session'),
getTitle() {
return vm.$t('sessions.position')
},
openLink({ row }) {
return '/luna/replay/' + row.session + '?start_at=' + row.timestamp
}
}
},
timestamp: {
label: this.$t('sessions.date'),
width: '150px',
Expand Down

0 comments on commit c2f87a5

Please sign in to comment.