mirror of
https://github.com/jumpserver/lina.git
synced 2025-07-19 17:49:04 +00:00
perf: Update status action to handle multiple accounts
This commit is contained in:
parent
ef063898ca
commit
ac40823319
@ -1,5 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<RemoveAccount
|
||||
v-if="showDeleteAccountDialog"
|
||||
:accounts="gatherAccounts"
|
||||
:visible.sync="showDeleteAccountDialog"
|
||||
/>
|
||||
<DeleteDialog
|
||||
v-if="deleteDialog.visible"
|
||||
:account="deleteDialog.account"
|
||||
@ -22,12 +27,14 @@ import AssetTreeTable from '@/components/Apps/AssetTreeTable/index.vue'
|
||||
import DeleteDialog from '@/views/accounts/AccountDiscover/DeleteDialog.vue'
|
||||
import { gatherAccountHeaderActions, gatherAccountTableConfig } from '@/views/accounts/const'
|
||||
import AccountDiscoverDialog from '@/views/assets/Asset/AssetList/components/AccountDiscoverDialog.vue'
|
||||
import RemoveAccount from '@/components/Apps/AccountListTable/RemoveAccount.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
AssetTreeTable,
|
||||
DeleteDialog,
|
||||
AccountDiscoverDialog
|
||||
AccountDiscoverDialog,
|
||||
RemoveAccount
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -64,8 +64,8 @@ export const gatherAccountTableConfig = (vm, url) => {
|
||||
formatterArgs: {
|
||||
confirm: ({ row }) => {
|
||||
vm.$axios.put(
|
||||
`/api/v1/accounts/gathered-accounts/${row.id}/status/`,
|
||||
{ status: 'confirmed' }
|
||||
`/api/v1/accounts/gathered-accounts/status/`,
|
||||
{ status: 'confirmed', ids: [row.id] }
|
||||
).then(res => {
|
||||
row.status = 'confirmed'
|
||||
}).catch(() => {
|
||||
@ -74,8 +74,8 @@ export const gatherAccountTableConfig = (vm, url) => {
|
||||
},
|
||||
ignore: ({ row }) => {
|
||||
vm.$axios.put(
|
||||
`/api/v1/accounts/gathered-accounts/${row.id}/status/`,
|
||||
{ status: 'ignored' }
|
||||
`/api/v1/accounts/gathered-accounts/status/`,
|
||||
{ status: 'ignored', ids: [row.id] }
|
||||
).then(res => {
|
||||
row.status = 'ignored'
|
||||
}).catch(() => {
|
||||
@ -121,7 +121,7 @@ export const gatherAccountHeaderActions = (vm) => {
|
||||
extraMoreActions: [
|
||||
{
|
||||
name: 'SyncSelected',
|
||||
title: vm.$t('ConfirmSelected'),
|
||||
title: vm.$t('SyncSelected'),
|
||||
type: 'primary',
|
||||
icon: 'fa fa-check',
|
||||
can: ({ selectedRows }) => {
|
||||
@ -131,9 +131,9 @@ export const gatherAccountHeaderActions = (vm) => {
|
||||
const ids = selectedRows.map(v => {
|
||||
return v.id
|
||||
})
|
||||
vm.$axios.post(
|
||||
`/api/v1/accounts/gathered-accounts/sync-accounts/`,
|
||||
{ gathered_account_ids: ids }
|
||||
vm.$axios.put(
|
||||
`/api/v1/accounts/gathered-accounts/status/`,
|
||||
{ ids: ids, status: 'confirmed' }
|
||||
).then(() => {
|
||||
vm.$message.success(vm.$tc('SyncSuccessMsg'))
|
||||
}).catch(err => {
|
||||
|
Loading…
Reference in New Issue
Block a user