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/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"label.add": "Add",
"label.addservices": "Add Services",
"label.add.account": "Add Account",
"label.add.new.tenant.account": "New Tenant Account",
"label.add.acl.rule": "Add rule",
"label.add.acl": "Add ACL",
"label.add.affinity.group": "Add new Affinity Group",
Expand Down Expand Up @@ -3225,6 +3226,7 @@
"message.action.vmsnapshot.delete": "Please confirm that you want to delete this Instance Snapshot. <br>Please notice that the Instance will be paused before the Snapshot deletion, and resumed after deletion, if it runs on KVM.",
"message.action.vmsnapshot.disk-only.delete": "Please confirm that you want to delete this Instance Snapshot.",
"message.activate.project": "Are you sure you want to activate this project?",
"message.add.account.warning": "Creating a new account creates a separate tenant with its own resource limits and isolated resources. Users in different accounts cannot share Instances or Volumes. Networks can be shared between accounts when the appropriate permissions are granted. To add a new user to an existing account instead, use the <b>Add User</b> action from the account's list or details view.",
"message.add.custom.action.parameters": "Parameters to be made available while running the custom action.",
"message.add.egress.rule.failed": "Adding new egress rule failed.",
"message.add.egress.rule.processing": "Adding new egress rule...",
Expand Down
14 changes: 13 additions & 1 deletion ui/src/config/section/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,23 @@ export default {
{
api: 'createAccount',
icon: 'plus-outlined',
label: 'label.add.account',
label: 'label.add.new.tenant.account',
listView: true,
popup: true,
component: shallowRef(defineAsyncComponent(() => import('@/views/iam/AddAccount.vue')))
},
{
api: 'createUser',
icon: 'usergroup-add-outlined',
label: 'label.add.user',
listView: true,
dataView: true,
popup: true,
show: (record, store) => {
return ['Admin', 'DomainAdmin'].includes(store.userInfo.roletype) && record.state === 'enabled'
},
component: shallowRef(defineAsyncComponent(() => import('@/views/iam/AddUser.vue')))
},
{
api: 'ldapCreateAccount',
icon: 'user-add-outlined',
Expand Down
7 changes: 7 additions & 0 deletions ui/src/views/iam/AddAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
:loading="loading"
layout="vertical"
@finish="handleSubmit">
<div style="margin-bottom: 10px">
<a-alert type="warning">
<template #message>
<div v-html="$t('message.add.account.warning')"></div>
</template>
</a-alert>
</div>
<a-form-item ref="roleid" name="roleid">
<template #label>
<tooltip-label :title="$t('label.role')" :tooltip="apiParams.roleid.description"/>
Expand Down
10 changes: 8 additions & 2 deletions ui/src/views/iam/AddUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ export default {
ResourceIcon,
InfiniteScrollSelect
},
props: {
resource: {
type: Object,
default: () => {}
}
},
data () {
this.fetchTimeZone = debounce(this.fetchTimeZone, 800)
return {
Expand Down Expand Up @@ -247,8 +253,8 @@ export default {
})
},
fetchData () {
this.account = this.$route.query && this.$route.query.account ? this.$route.query.account : null
this.domainid = this.$route.query && this.$route.query.domainid ? this.$route.query.domainid : null
this.account = (this.$route.query && this.$route.query.account) || this.resource?.name || null
this.domainid = (this.$route.query && this.$route.query.domainid) || this.resource?.domainid || null
// Set initial domain if provided from route
if (this.domainid) {
this.form.domainid = this.domainid
Expand Down
Loading