Commit 5c915920 authored by gj4210's avatar gj4210 👁
Browse files

UPD: Accounts & Tokens page now shows account roles

parent daa3a12b
Pipeline #65924 passed with stages
in 6 minutes
<template>
<div class="main">
<h1>Accounts</h1>
<h1>Accounts & Tokens</h1>
<b-modal id="modal-create-account" size="lg" title="Subaccount erstellen"
@hidden="resetAccountData">
<b-form @submit="createAccount">
......@@ -250,13 +250,17 @@
<p class="text-muted">Beschreibung</p>
</b-col>
<b-col>
<h6>
<b-badge class="mr-1" variant="danger">Divide by 0</b-badge>
<b-badge class="mr-1" variant="primary">Less dangerous stuff</b-badge>
<b-badge class="mr-1" variant="success">Somewhat lame stuff</b-badge>
<p>+ 153 weitere</p>
<h5 class="mb-0">
<b-badge
v-for="role in roles_by_account[account.login_name].slice(0, max_role_badge_count)"
:key="'role-badge-' + role.mgr_login_name + '-' + role.role_fq_name"
class="mr-1 mb-1">{{role.system.toUpperCase()}}<br>{{role.role}}
</b-badge>
</h5>
<h6 v-if="roles_by_account[account.login_name].length > max_role_badge_count">
+ {{roles_by_account[account.login_name].length - max_role_badge_count}} Weitere
</h6>
<p class="text-muted">Berechtigungen</p>
<p class="text-muted">Rollen</p>
</b-col>
<b-col lg="1">
<template v-if="account.parent_login_name !== null">
......@@ -342,6 +346,7 @@
'Individuell'
],
tokens_by_account: null,
roles_by_account: null,
accounts: null,
new_account: {
parent_login_name: null,
......@@ -390,7 +395,8 @@
token_copied: false,
leaving_transition_properties: { // TODO: Get table animations to work
name: 'flip-list'
}
},
max_role_badge_count: 10
}
},
computed: {
......@@ -414,6 +420,7 @@
fetchData() {
AccountTokenService.list(this.$store.state.netdb_axios_config, this.$store.state.user.login_name).then((response) => {
this.tokens_by_account = ApiUtil.dict_of_lists_by_value_of_array(response.data[2].concat(response.data[3]), 'login_name')
this.roles_by_account = ApiUtil.dict_of_lists_by_value_of_array(response.data[4].concat(response.data[5]), 'mgr_login_name')
this.accounts = response.data[0].concat(response.data[1])
})
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment