mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-01 23:18:17 +00:00
feat: 添加批量测试资产可连接性功能 (#590)
* feat: 添加批量测试资产可连接性功能 * feat: 添加批量测试资产可连接性功能 Co-authored-by: Orange <orangemtony@gmail.com>
This commit is contained in:
parent
5889e20aae
commit
f58e37a76a
@ -106,6 +106,14 @@ export default {
|
|||||||
return selectedRows.length > 0 && vm.object.auto_push
|
return selectedRows.length > 0 && vm.object.auto_push
|
||||||
},
|
},
|
||||||
callback: this.bulkPushCallback.bind(this)
|
callback: this.bulkPushCallback.bind(this)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('assets.TestAssetsConnective'),
|
||||||
|
name: 'TestSelected',
|
||||||
|
can({ selectedRows }) {
|
||||||
|
return selectedRows.length > 0 && vm.object.auto_push
|
||||||
|
},
|
||||||
|
callback: this.bulkTestCallback.bind(this)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -214,7 +222,17 @@ export default {
|
|||||||
})
|
})
|
||||||
const data = { action: 'push', assets: assets }
|
const data = { action: 'push', assets: assets }
|
||||||
this.$axios.post(theUrl, data).then(resp => {
|
this.$axios.post(theUrl, data).then(resp => {
|
||||||
window.open(`/#/ops/celery/task/${resp.task}/log/`, '', 'width=900,height=600')
|
window.open(`/#/ops/task/task/${resp.task}/log/`, '', 'width=900,height=600')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
bulkTestCallback({ selectedRows }) {
|
||||||
|
const theUrl = `/api/v1/assets/system-users/${this.object.id}/tasks/`
|
||||||
|
const assets = selectedRows.map((v) => {
|
||||||
|
return v.asset
|
||||||
|
})
|
||||||
|
const data = { action: 'test', assets: assets }
|
||||||
|
this.$axios.post(theUrl, data).then(resp => {
|
||||||
|
window.open(`/#/ops/task/task/${resp.task}/log/`, '', 'width=900,height=600')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user