Merge pull request #4312 from jumpserver/pr@dev@fix_quick_job

fixed: Fixed the issue that the shortcut command could not get the account
This commit is contained in:
ZhaoJiSen
2024-08-15 11:06:21 +08:00
committed by GitHub
3 changed files with 21 additions and 14 deletions

View File

@@ -32,6 +32,7 @@
:placeholder="item.placeholder"
class="inline-input"
size="mini"
clearable
@change="handleInputChange(item)"
@select="handleInputChange(item)"
/>

View File

@@ -120,20 +120,26 @@ export default {
autoComplete: true,
query: (query, cb) => {
const { hosts, nodes } = this.getSelectedNodesAndHosts()
if (hosts.length > 0 && nodes.length > 0) {
this.$axios.post('/api/v1/ops/username-hints/', {
nodes: nodes,
assets: hosts,
query: query
}).then(data => {
const ns = data.map(item => {
return { value: item.username }
})
cb(ns)
})
} else {
cb([])
if (hosts.length === 0) {
this.$message.warning(`${this.$t('RequiredAssetOrNode')}`)
return cb([])
}
this.$axios.post('/api/v1/ops/username-hints/', {
nodes: nodes,
assets: hosts,
query: query
}).then(data => {
if (Array.isArray(data) && data.length === 0) {
this.$message.info(`${this.$t('NoAccountFound')}`)
return cb([])
}
const ns = data.map(item => {
return { value: item.username }
})
cb(ns)
})
}
},
options: [],

View File

@@ -105,7 +105,7 @@ export default {
activated() {
setTimeout(() => {
this.$refs.AssetTreeTable.$refs.TreeList.reloadTable()
}, 300)
}, 500)
},
methods: {
handlePermBulkUpdate() {