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

ADD: show groups of ou

parent 250e49fb
......@@ -8,7 +8,8 @@ export default {
{ name: 'cntl.mgr.list', join: { 1: 'default' } },
{ name: 'dns.fqdn2ou.list', join: { 0: 'default' } },
{ name: 'nd.bcd2ou.list', join: { 0: 'default' } },
{ name: 'nd.bcd.list', join: { 4: 'default' } }
{ name: 'nd.bcd.list', join: { 4: 'default' } },
{ name: 'cntl.group.list', join: { 0: 'default' } }
]
return TransactionService.execute(config, ta)
},
......@@ -21,7 +22,7 @@ export default {
{ name: 'dns.fqdn2ou.list', join: { 1: 'default' } },
{ name: 'nd.bcd2ou.list', join: { 1: 'default' } },
{ name: 'nd.bcd.list', join: { 5: 'default' } },
{ name: 'org.unit.list', join: { 0: 'api_fkey_cntl_mgr2ou_ou' }}
{ name: 'org.unit.list', join: { 0: 'api_fkey_cntl_mgr2ou_ou' } }
]
return TransactionService.execute(config, ta)
},
......
......@@ -201,6 +201,40 @@
</div>
</b-collapse>
</b-card>
<b-card header-class="p-0" body-class="p-0" class="mb-3 shadow-sm">
<template v-slot:header>
<b-button block variant="outline-secondary"
v-b-toggle="ou.short_name + '-collapse-groups'">
Gruppen
<b-badge pill v-if="fqdns2ou[ou.short_name]">{{
groups2ou[ou.short_name].length
}}
</b-badge>
<b-badge pill v-else>0</b-badge>
<br/>
<font-awesome-icon class="collapse-icon" :icon="['fas','chevron-down']"/>
</b-button>
</template>
<b-collapse :id="ou.short_name + '-collapse-groups'">
<b-pagination :per-page="per_page" v-model="fqdn_list_page"
v-if="groups2ou[ou.short_name] && groups2ou[ou.short_name].length> per_page"
:total-rows="groups2ou[ou.short_name].length || 0" align="center" class="mt-3"/>
<b-table :items="groups2ou[ou.short_name]" :fields="group_list_fields" class="m-0" per-page="25">
<template v-slot:head(actions)>
</template>
<template v-slot:cell(actions)="">
</template>
<template v-slot:cell(name)="data">
<b-link :to="'/cntl/groups/'+data.item.name">{{data.item.name}}</b-link>
</template>
</b-table>
<div v-if="!groups2ou[ou.short_name] || groups2ou[ou.short_name].length === 0"
class="font-italic text-center my-3">
<span class="font-italic">Keine Gruppen zugewiesen</span><br/>
</div>
</b-collapse>
</b-card>
</Loading>
</template>
<hr>
......@@ -264,6 +298,7 @@ export default {
components: { OUTreeEntry, EVLogViewer, DBEditor, Loading },
data() {
return {
groups2ou: {},
bcds_by_name: null,
root_ous: null,
ou: null,
......@@ -307,6 +342,18 @@ export default {
sortable: false
}
],
group_list_fields: [
{
key: 'name',
label: 'Name',
sortable: true
},
{
key: 'actions',
label: 'Aktionen',
sortable: false
}
],
ou_list_fields: [
{
key: 'mgr_login_name',
......@@ -337,6 +384,7 @@ export default {
mgrs_list_page: 0,
fqdn_list_page: 0,
bcd_list_page: 0,
group_list_page: 0,
per_page: 50
}
},
......@@ -366,9 +414,9 @@ export default {
EventBus.$emit('overwrite_breadcrumbs', function () {
return ['/org/ou']
})
const ou_types = (await OUTypeService.list(this.$store.state.netdb_axios_config, {sorting_params_list: ['position']})).data[0]
const ou_types = (await OUTypeService.list(this.$store.state.netdb_axios_config, { sorting_params_list: ['position'] })).data[0]
for (const t of ou_types) {
this.ou_type_reducer[t.short_name] = {display_name: t.name}
this.ou_type_reducer[t.short_name] = { display_name: t.name }
}
ou_name_req = ou_name_req.toUpperCase()
res = (await OUService.getOU(this.$store.state.netdb_axios_config, ou_name_req)).data
......@@ -379,6 +427,8 @@ export default {
this.ous = res[0]
this.ous_by_name = apiutil.dict_by_value_of_array(res[0], 'short_name')
this.ou = this.ous_by_name[ou_name_req]
this.groups2ou[ou_name_req] = res[6]
window.console.debug(this.groups2ou)
this.bcds_by_name = apiutil.dict_by_value_of_array(res[5], 'name')
const rootpath = (await NativeOUService.list(this.$store.state.netdb_axios_config, {
do_rootpath: true,
......
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