Commit 5e83ad5e authored by Janis Streib's avatar Janis Streib 🦉
Browse files

FIXUP: more cleanup

parent 8e486922
Pipeline #117243 passed with stages
in 4 minutes and 39 seconds
<template>
<div id="Tokens">
<h1 class="my-4">Unterkonten & API-Tokens</h1>
<b-modal id="modal-create-account" size="lg" title="Unterkonto erstellen"
@hidden="resetAccountData">
<b-form @submit="createAccount">
<b-form-group label="Beschreibung:" label-for="input-account-create-description">
<b-form-textarea
id="input-account-create-description"
v-model.trim="new_account.description"
placeholder="Beschreibung eingeben"
/>
</b-form-group>
<template
v-if="roles_by_account != null && roles_by_account[$store.state.user.login_name] != null && assignable_role_name_options_by_system != null">
<b-form-group label="Rollen">
<b-form-radio v-model="new_account.do_copy_roles" :value="true">von Parent-Account übernehmen
</b-form-radio>
<b-form-radio v-model="new_account.do_copy_roles" :value="false" class="mb-2">individuell zuweisen
</b-form-radio>
<template v-if="!new_account.do_copy_roles">
<b-input-group>
<b-form-select @change="updateCanAddRole" v-model="new_system"
:options="assignable_system_options"/>
<b-form-select @change="updateCanAddRole" v-model="new_role_name"
:options="assignable_role_name_options_by_system[new_system]"/>
<b-input-group-append>
<b-button variant="success" :disabled="!can_add_role" @click="addRole">
<template v-if="cant_add_role_reason === ''">Rolle hinzufügen</template>
<template v-else class="text-danger">{{ cant_add_role_reason }}</template>
</b-button>
</b-input-group-append>
</b-input-group>
<h5 class="my-1">
<template
v-for="role in new_account.roles">
<b-button
:key="'role-badge-' + role.mgr_login_name + '-' + role.fq_name"
:id="'create-account-role-badge-' + role.fq_name"
:style="{background: role.fq_name.toHSL({lit: [30, 40]}), border: 'none'}"
class="mr-1 mb-1 badge">
<div class="d-flex align-items-center">
{{ role.system.toUpperCase() }}<br>{{ role.name }}
<span @click="removeRole(role)" class="p-2">
<font-awesome-icon style="opacity: 0.7" :icon="['fas','times']"/>
</span>
</div>
</b-button>
<b-popover
:key="'role-badge-tooltip' + role.mgr_login_name + '-' + role.fq_name"
:target="'create-account-role-badge-' + role.fq_name"
triggers="focus" custom-class="popover-wide"
placement="bottom">
<b-table :fields="permission_list_fields"
:items="role.contained_permissions"
sticky-header/>
</b-popover>
</template>
<b-button v-if="new_account.roles.length > 0" variant="outline-danger" block class="mt-1"
@click="removeAllRoles">
Alle Rollen entfernen
</b-button>
</h5>
</template>
</b-form-group>
</template>
</b-form>
<template v-slot:modal-footer="{cancel}">
<b-button variant="outline-secondary" @click="cancel">
Abbrechen
</b-button>
<b-button type="submit" variant="success" :disabled="waiting" @click="createAccount">
Erstellen
</b-button>
</template>
</b-modal>
<b-row>
<b-col lg="9">
<b-input-group class="shadow">
......@@ -347,6 +274,14 @@ export default {
assignable_system_options: null,
assignable_role_name_options_by_system: null,
accounts: null,
new_account: {
parent_login_name: null,
description: '',
login_name: '',
expiration_date: null,
do_copy_roles: true,
roles: []
},
filter_text: '',
token_list_fields: [
{
......
Markdown is supported
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