mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-28 15:55:24 +00:00
fix: 添加WS链接类型 (#585)
* fix: 添加WS链接类型 Co-authored-by: Orange <orangemtony@gmail.com>
This commit is contained in:
@@ -45,5 +45,12 @@ export default [
|
||||
name: 'CeleryTaskLog',
|
||||
hidden: true,
|
||||
meta: { title: i18n.t('route.CeleryTaskLog'), roles: ['SuperAdmin', 'Admin', 'Auditor', 'User'] }
|
||||
},
|
||||
{
|
||||
path: '/ops/task/task/:id/log/',
|
||||
component: () => import('@/views/ops/CeleryTaskLog'),
|
||||
name: 'TaskLog',
|
||||
hidden: true,
|
||||
meta: { title: i18n.t('route.CeleryTaskLog'), roles: ['SuperAdmin', 'Admin', 'Auditor', 'User'] }
|
||||
}
|
||||
]
|
||||
|
@@ -8,11 +8,14 @@ import { Terminal } from 'xterm'
|
||||
import { FitAddon } from 'xterm-addon-fit'
|
||||
export default {
|
||||
name: 'CeleryTaskLog',
|
||||
props: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
xterm: null,
|
||||
ws: null,
|
||||
taskId: this.$route.params.id,
|
||||
type: this.$route.params.type || this.$route.query.type || 'celery',
|
||||
url: '/ws/ops/tasks/log/',
|
||||
failOverPort: process.env.VUE_APP_WS_PORT
|
||||
}
|
||||
@@ -71,7 +74,7 @@ export default {
|
||||
this.xterm.write(data.message)
|
||||
}
|
||||
this.ws.onopen = (e) => {
|
||||
const msg = { 'task': this.taskId }
|
||||
const msg = { 'task': this.taskId, 'type': this.type }
|
||||
this.ws.send(JSON.stringify(msg))
|
||||
}
|
||||
},
|
||||
|
@@ -77,7 +77,7 @@ export default {
|
||||
value: this.object.id,
|
||||
formatter: function(row, value) {
|
||||
const onClick = function() {
|
||||
window.open(`/#/ops/celery/task/${value}/log/`, '', 'width=900,height=600')
|
||||
window.open(`/#/ops/task/task/${value}/log/?type=ansible`, '', 'width=900,height=600')
|
||||
}
|
||||
const title = this.$t('common.View')
|
||||
return <a onClick={onClick} >{ title }</a>
|
||||
|
Reference in New Issue
Block a user