Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ui/public/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "Account ID",
"label.account.name": "Account Name",
"label.account.specific": "Account-Specific",
"label.account.type.domain.admin": "مسؤول النطاق",
"label.account.type.normal": "عادي (مستخدم)",
"label.accounts": "Accounts",
"label.accounttype": "Account Type",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "Account ID",
"label.account.name": "Account Name",
"label.account.specific": "Account-Specific",
"label.account.type.domain.admin": "Administrador de domini",
"label.account.type.normal": "Normal (Usuari)",
"label.accounts": "Accounts",
"label.accounttype": "Account Type",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"label.account.id": "Benutzerkonto-ID",
"label.account.name": "Benutzerkonto-Name",
"label.account.specific": "Besonderheiten des Benutzerkontos",
"label.account.type.domain.admin": "Domänen-Administrator",
"label.account.type.normal": "Normal (Benutzer)",
"label.accounts": "Benutzerkonten",
"label.accounttype": "Benutzerkontotyp",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/el_GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"label.account.id": "Αναγνωριστικό λογαριασμού",
"label.account.name": "Όνομα λογαριασμού",
"label.account.specific": "Συγκεκριμένα χαρακτηριστικά του λογαριασμού",
"label.account.type.domain.admin": "Διαχειριστής Τομέα",
"label.account.type.normal": "Κανονικός (Χρήστης)",
"label.accounts": "Λογαριασμοί",
"label.accounttype": "Τύπος λογαριασμού",
"label.access.kubernetes.nodes": "Πρόσβαση στους κόμβους Κυβερνητών",
Expand Down
3 changes: 3 additions & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"label.account.id": "Account ID",
"label.account.name": "Account name",
"label.account.specific": "Account-specific",
"label.account.type.domain.admin": "Domain Admin",
"label.account.type.normal": "Normal (User)",
"label.accounts": "Accounts",
"label.accountstate": "Account state",
"label.accounttype": "Account type",
Expand Down Expand Up @@ -1597,6 +1599,7 @@
"label.limits": "Limits",
"label.limits.configure": "Configure limits",
"label.link": "Link",
"label.link.account.to.ldap": "Link account to LDAP",
"label.link.domain.to.ldap": "Link domain to LDAP",
"label.linklocalip": "Link-local/Control IP address",
"label.linux": "Linux",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "ID de la cuenta",
"label.account.name": "Nombre de cuenta",
"label.account.specific": "espec\u00edficas de la cuenta",
"label.account.type.domain.admin": "Administrador de dominio",
"label.account.type.normal": "Normal (Usuario)",
"label.accounts": "Cuentas",
"label.accounttype": "Tipo de Cuenta",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "ID de compte",
"label.account.name": "Nom de compte",
"label.account.specific": "Sp\u00e9cifique au compte",
"label.account.type.domain.admin": "Administrateur de domaine",
"label.account.type.normal": "Normal (Utilisateur)",
"label.accounts": "Comptes",
"label.accounttype": "Type Compte",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"label.access": "एक्सेस",
"label.accesskey": "एक्सेस की",
"label.account": "खाता",
"label.account.type.domain.admin": "डोमेन व्यवस्थापक",
"label.account.type.normal": "सामान्य (उपयोगकर्ता)",
"label.accounts": "लेखा",
"label.accounttype": "खाता प्रकार",
"label.aclid": "ACL",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "Sz\u00e1mla azonos\u00edt\u00f3",
"label.account.name": "Sz\u00e1mla n\u00e9v",
"label.account.specific": "Sz\u00e1mla-specifikus",
"label.account.type.domain.admin": "Tartomány rendszergazda",
"label.account.type.normal": "Normál (Felhasználó)",
"label.accounts": "Sz\u00e1ml\u00e1k",
"label.accounttype": "Sz\u00e1mla t\u00edpus",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "ID dell'Account",
"label.account.name": "Nome Account",
"label.account.specific": "Specifico dell'Account",
"label.account.type.domain.admin": "Amministratore di dominio",
"label.account.type.normal": "Normale (Utente)",
"label.accounts": "Utenti",
"label.accounttype": "Account Type",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
"label.account.id": "アカウントID",
"label.account.name": "アカウント名",
"label.account.specific": "アカウント固有",
"label.account.type.domain.admin": "ドメイン管理者",
"label.account.type.normal": "通常 (ユーザー)",
"label.accounts": "アカウント",
"label.accounttype": "アカウントタイプ",
"label.access.kubernetes.nodes": "Kubernetesノードに接続",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"label.account.id": "\uacc4\uc815 ID",
"label.account.name": "\uacc4\uc815 \uc774\ub984",
"label.account.specific": "\uace0\uc720 \uacc4\uc815",
"label.account.type.domain.admin": "도메인 관리자",
"label.account.type.normal": "일반 (사용자)",
"label.accounts": "\uacc4\uc815",
"label.accounttype": "\uacc4\uc815 \uc720\ud615",
"label.acl.export": "ACL \ub0b4\ubcf4\ub0b4\uae30",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/nb_NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "Konto ID",
"label.account.name": "Kontonavn",
"label.account.specific": "Kontospesifikk",
"label.account.type.domain.admin": "Domeneadministrator",
"label.account.type.normal": "Normal (Bruker)",
"label.accounts": "Kontoer",
"label.accounttype": "Kontotype",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/nl_NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "Account ID",
"label.account.name": "Account Naam",
"label.account.specific": "Account-specifiek",
"label.account.type.domain.admin": "Domeinbeheerder",
"label.account.type.normal": "Normaal (Gebruiker)",
"label.accounts": "Accounts",
"label.accounttype": "Account type",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "ID konta",
"label.account.name": "Nazwa konta",
"label.account.specific": "Account-Specific",
"label.account.type.domain.admin": "Administrator domeny",
"label.account.type.normal": "Zwykły (Użytkownik)",
"label.accounts": "Konta",
"label.accounttype": "Account Type",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"label.account.id": "ID da conta",
"label.account.name": "Nome da conta",
"label.account.specific": "Espec\u00edfico da conta",
"label.account.type.domain.admin": "Administrador de domínio",
"label.account.type.normal": "Normal (Usuário)",
"label.accounts": "Contas",
"label.accountstate": "Estado da conta",
"label.accounttype": "Tipo de conta",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"label.account.id": "ID \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438",
"label.account.name": "\u0418\u043c\u044f \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438",
"label.account.specific": "\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430 \u0430\u043a\u043a\u0430\u0443\u043d\u043d\u0442\u0430",
"label.account.type.domain.admin": "Администратор домена",
"label.account.type.normal": "Обычный (Пользователь)",
"label.accounts": "\u0423\u0447\u0451\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438",
"label.accounttype": "Account Type",
"label.acl.export": "Export ACL rules",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/te.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"label.account.id": "ఖాతా ID",
"label.account.name": "ఖాతా పేరు",
"label.account.specific": "ఖాతా-నిర్దిష్ట",
"label.account.type.domain.admin": "డొమైన్ నిర్వాహకుడు",
"label.account.type.normal": "సాధారణ (వినియోగదారు)",
"label.accounts": "ఖాతాలు",
"label.accountstate": "ఖాతా స్థితి",
"label.accounttype": "ఖాతా రకం",
Expand Down
2 changes: 2 additions & 0 deletions ui/public/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"label.account.id": "\u5E10\u6237\u6807\u8BC6\u7801",
"label.account.name": "\u5E10\u6237\u540D\u79F0",
"label.account.specific": "\u5E10\u6237\u4E13\u7528",
"label.account.type.domain.admin": "域管理员",
"label.account.type.normal": "普通(用户)",
"label.accounts": "\u5E10\u6237",
"label.accounttype": "\u5E10\u53F7\u7C7B\u578B",

Expand Down
28 changes: 28 additions & 0 deletions ui/src/config/section/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,34 @@ export default {
},
component: shallowRef(defineAsyncComponent(() => import('@/views/iam/AddLdapAccount.vue')))
},
{
api: 'linkAccountToLdap',
icon: 'LinkOutlined',
label: 'label.link.account.to.ldap',
docHelp: 'adminguide/accounts.html#using-an-ldap-server-for-user-authentication',
dataView: true,
show: (record, store) => {
return store.isLdapEnabled
},
args: ['type', 'domainid', 'ldapdomain', 'account', 'accounttype', 'roleid', 'admin'],
mapping: {
type: {
options: ['GROUP', 'OU']
},
accounttype: {
options: [
{ id: '0', description: 'label.account.type.normal' },
{ id: '2', description: 'label.account.type.domain.admin' }
]
},
domainid: {
value: (record) => { return record.domainid }
},
account: {
value: (record) => { return record.name }
}
}
},
{
api: 'updateAccount',
icon: 'edit-outlined',
Expand Down
5 changes: 4 additions & 1 deletion ui/src/config/section/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export default {
options: ['GROUP', 'OU']
},
accounttype: {
options: ['0', '2']
options: [

@sudo87 sudo87 Sep 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this breaks the "Link Domain to Ldap" form, it wont work due to this change.

Screenshot 2026-09-10 at 4 18 11 PM

{ id: '0', description: 'label.account.type.normal' },
{ id: '2', description: 'label.account.type.domain.admin' }
]
},
domainid: {
value: (record) => { return record.id }
Expand Down
7 changes: 4 additions & 3 deletions ui/src/views/AutogenView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@
<a-select-option
v-for="(opt, optIndex) in currentAction.mapping[field.name].options"
:key="optIndex"
:label="opt"
:label="opt.description ? $t(opt.description) : opt"
>
{{ opt }}
{{ opt.description ? $t(opt.description) : opt }}
</a-select-option>
</a-select>
<a-select
Expand Down Expand Up @@ -1882,7 +1882,8 @@ export default {
break
}
if (action.mapping && key in action.mapping && action.mapping[key].options) {
params[key] = action.mapping[key].options[input]
const mappedOption = action.mapping[key].options[input]
params[key] = (mappedOption && typeof mappedOption === 'object') ? mappedOption.id : mappedOption
if (['createAffinityGroup'].includes(action.api) && key === 'type') {
if (params[key] === 'host anti-affinity (Strict)') {
params[key] = 'host anti-affinity'
Expand Down
10 changes: 7 additions & 3 deletions ui/src/views/iam/DomainActionForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@
:filterOption="(input, option) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}" >
<a-select-option v-for="(opt, optIndex) in action.mapping[field.name].options" :key="optIndex" :label="opt">
{{ opt }}
<a-select-option
v-for="(opt, optIndex) in action.mapping[field.name].options"
:key="optIndex"
:label="opt.description ? $t(opt.description) : opt">
{{ opt.description ? $t(opt.description) : opt }}
</a-select-option>
</a-select>
<a-select
Expand Down Expand Up @@ -205,7 +208,8 @@ export default {
break
}
if (this.action.mapping && key in this.action.mapping && this.action.mapping[key].options) {
params[key] = this.action.mapping[key].options[input]
const mappedOption = this.action.mapping[key].options[input]
params[key] = (mappedOption && typeof mappedOption === 'object') ? mappedOption.id : mappedOption
} else if (param.type === 'uuid') {
params[key] = param.opts[input].id
} else if (param.type === 'list') {
Expand Down
45 changes: 45 additions & 0 deletions ui/tests/unit/views/AutogenView.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2609,6 +2609,51 @@ describe('Views > AutogenView.vue', () => {
done()
})

it('API should be called with the option id when currentAction.mapping option is an {id, description} object', async (done) => {
originalFunc.handleResponse = wrapper.vm.handleResponse
originalFunc.shouldNavigateBack = wrapper.vm.shouldNavigateBack
originalFunc.fetchData = wrapper.vm.fetchData
wrapper.vm.handleResponse = jest.fn(async (json, resourceName, action) => { return Promise.resolve() })
wrapper.vm.shouldNavigateBack = jest.fn((args) => { return false })
wrapper.vm.fetchData = jest.fn()
wrapper.vm.form = { column1: 1 }

const event = document.createEvent('Event')
await mockAxios.mockResolvedValue({})
await wrapper.setData({
showAction: true,
currentAction: {
api: 'testApiNameCase1',
label: 'label.name',
params: [{ name: 'column1', type: 'list' }],
paramFields: [{ name: 'column1', type: 'list' }],
mapping: {
column1: {
options: [
{ id: 'column-id-1', description: 'label.column.value.one' },
{ id: 'column-id-2', description: 'label.column.value.two' }
]
}
}
},
resource: {}
})
await wrapper.vm.execSubmit(event)
await flushPromises()

expect(mockAxios).toHaveBeenCalled()
expect(mockAxios).toHaveBeenLastCalledWith({
url: '/',
method: 'POST',
data: common.createDataParams({
command: 'testApiNameCase1',
response: 'json',
column1: 'column-id-2'
})
})
done()
})

it('API should be called when form has input key not exist in currentAction.mapping, type is list and currentAction.params[input] has id', async (done) => {
originalFunc.handleResponse = wrapper.vm.handleResponse
originalFunc.shouldNavigateBack = wrapper.vm.shouldNavigateBack
Expand Down
Loading