Skip to content

Commit 1b04b97

Browse files
author
Daan Hoogland
committed
new tenant instead of add account
1 parent 5e5ae0c commit 1b04b97

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

ui/public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@
264264
"label.add": "Add",
265265
"label.addservices": "Add Services",
266266
"label.add.account": "Add Account",
267+
"label.add.new.tenant.account": "New Tenant Account",
267268
"label.add.acl.rule": "Add rule",
268269
"label.add.acl": "Add ACL",
269270
"label.add.affinity.group": "Add new Affinity Group",
@@ -3225,6 +3226,7 @@
32253226
"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.",
32263227
"message.action.vmsnapshot.disk-only.delete": "Please confirm that you want to delete this Instance Snapshot.",
32273228
"message.activate.project": "Are you sure you want to activate this project?",
3229+
"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.",
32283230
"message.add.custom.action.parameters": "Parameters to be made available while running the custom action.",
32293231
"message.add.egress.rule.failed": "Adding new egress rule failed.",
32303232
"message.add.egress.rule.processing": "Adding new egress rule...",

ui/src/config/section/account.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,23 @@ export default {
104104
{
105105
api: 'createAccount',
106106
icon: 'plus-outlined',
107-
label: 'label.add.account',
107+
label: 'label.add.new.tenant.account',
108108
listView: true,
109109
popup: true,
110110
component: shallowRef(defineAsyncComponent(() => import('@/views/iam/AddAccount.vue')))
111111
},
112+
{
113+
api: 'createUser',
114+
icon: 'usergroup-add-outlined',
115+
label: 'label.add.user',
116+
listView: true,
117+
dataView: true,
118+
popup: true,
119+
show: (record, store) => {
120+
return ['Admin', 'DomainAdmin'].includes(store.userInfo.roletype) && record.state === 'enabled'
121+
},
122+
component: shallowRef(defineAsyncComponent(() => import('@/views/iam/AddUser.vue')))
123+
},
112124
{
113125
api: 'ldapCreateAccount',
114126
icon: 'user-add-outlined',

ui/src/views/iam/AddAccount.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
:loading="loading"
2626
layout="vertical"
2727
@finish="handleSubmit">
28+
<div style="margin-bottom: 10px">
29+
<a-alert type="warning">
30+
<template #message>
31+
<div v-html="$t('message.add.account.warning')"></div>
32+
</template>
33+
</a-alert>
34+
</div>
2835
<a-form-item ref="roleid" name="roleid">
2936
<template #label>
3037
<tooltip-label :title="$t('label.role')" :tooltip="apiParams.roleid.description"/>

ui/src/views/iam/AddUser.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ export default {
185185
ResourceIcon,
186186
InfiniteScrollSelect
187187
},
188+
props: {
189+
resource: {
190+
type: Object,
191+
default: () => {}
192+
}
193+
},
188194
data () {
189195
this.fetchTimeZone = debounce(this.fetchTimeZone, 800)
190196
return {
@@ -247,8 +253,8 @@ export default {
247253
})
248254
},
249255
fetchData () {
250-
this.account = this.$route.query && this.$route.query.account ? this.$route.query.account : null
251-
this.domainid = this.$route.query && this.$route.query.domainid ? this.$route.query.domainid : null
256+
this.account = (this.$route.query && this.$route.query.account) || this.resource?.name || null
257+
this.domainid = (this.$route.query && this.$route.query.domainid) || this.resource?.domainid || null
252258
// Set initial domain if provided from route
253259
if (this.domainid) {
254260
this.form.domainid = this.domainid

0 commit comments

Comments
 (0)