Commit 80a40e82 authored by janis.streib's avatar janis.streib 🦉
Browse files

ADD: unassign mgr2group

parent 222a5806
Pipeline #112457 passed with stages
in 10 minutes and 52 seconds
......@@ -38,7 +38,8 @@ import {
faUsersCog,
faBuilding,
faUsers,
faDumpsterFire
faDumpsterFire,
faUnlink
} from '@fortawesome/free-solid-svg-icons'
import {
......@@ -97,5 +98,6 @@ library.add(
faUsersCog,
faBuilding,
faUsers,
faDumpsterFire
faDumpsterFire,
faUnlink
)
......@@ -19,7 +19,13 @@
<font-awesome-icon class="collapse-icon" :icon="['fas','chevron-down']"/>
</b-button>
<b-collapse :id="group.name + '-collapse-bcds'">
<b-table :items="bcds2grp[group.name]">
<b-table :items="bcds2grp[group.name]" :fields="bcd_list_fields">
<template v-slot:cell(bcd_name)="data">
<b-link :to="'/dnsvs/bcds/'+data.item.bcd_name">{{ data.item.bcd_name }}</b-link>
</template>
<template v-slot:cell(bcd_description)="data">
{{ bcds[data.item.bcd_name].description }}
</template>
</b-table>
</b-collapse>
<b-button block squared variant="outline-secondary" v-b-toggle="group.name + '-collapse-domains'">
......@@ -47,6 +53,25 @@
{{ mgrs[data.item.mgr_login_name].email }}
</b-link>
</template>
<template v-slot:head(actions)>
<b-button block variant="outline-success"
:id="'button-assign-mgr-' + group.name">
<font-awesome-icon :icon="['fas', 'plus']"/>
</b-button>
<b-tooltip :target="'button-assign-mgr-' + group.name" triggers="hover"
variant="success" placement="left">
Neuen Account zuordnen
</b-tooltip>
</template>
<template v-slot:cell(actions)="data">
<b-button @click="deleteItem(data.item)" variant="danger" :id="'button-unassign-mgr-' + data.item.mgr_login_name">
<font-awesome-icon :icon="['fas', 'unlink']"></font-awesome-icon>
</b-button>
<b-tooltip :target="'button-unassign-mgr-' + data.item.mgr_login_name" triggers="hover"
variant="danger" placement="left">
Zuweisung aufheben
</b-tooltip>
</template>
</b-table>
</b-collapse>
<b-button block squared variant="outline-secondary" v-b-toggle="group.name + '-collapse-subgroups'">
......@@ -67,6 +92,8 @@
import GroupService from '@/api-services/groups.service'
import Loading from '@/components/Loading'
import apiutil from '@/util/apiutil'
import transactionutil from '@/util/transactionutil'
import Mgr2GroupService from '@/api-services.gen/cntl.mgr2group'
export default {
name: 'Groups',
......@@ -80,6 +107,23 @@ export default {
groups: null,
ous: null,
groups_by_parent: null,
bcd_list_fields: [
{
key: 'bcd_name',
label: 'BCD',
sortable: true
},
{
key: 'bcd_description',
label: 'Beschreibung',
sortable: false
},
{
key: 'actions',
label: 'Aktionen',
sortable: false
}
],
mgr_list_fields: [
{
key: 'mgr_login_name',
......@@ -113,13 +157,22 @@ export default {
async refresh() {
this.groups = this.mgrs2ou = this.ous = null
const res = (await GroupService.list(this.$store.state.netdb_axios_config, true)).data
this.groups = res[0]
this.groups = res[0].filter(group => !group.is_sub_group)
this.bcds2grp = apiutil.dict_of_lists_by_value_of_array(res[2], 'group_name')
this.mgrs2grp = apiutil.dict_of_lists_by_value_of_array(res[1], 'group_name')
this.fqdn2grp = apiutil.dict_of_lists_by_value_of_array(res[3], 'group_name')
this.mgrs = apiutil.dict_by_value_of_array(res[4], 'login_name')
const subgroups = res[0].filter(group => group.is_sub_group)
this.groups_by_parent = apiutil.dict_of_lists_by_value_of_array(subgroups, 'parent_name')
this.bcds = apiutil.dict_by_value_of_array(res[5], 'name')
},
deleteItem: function (item) {
const ta = transactionutil.generateDeleteElement('cntl.mgr2group', Mgr2GroupService.deleteParamsList(), item, item.mgr_login_name + ' aus Gruppe ' + item.group_name)
this.$store.commit('addTransactionElement', ta)
this.$emit('commited', ta)
if (!this.isMobile() && !this.$store.state.show_sidebar) {
this.$store.state.show_sidebar = true
}
}
},
async mounted() {
......
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