forked from gaia-pipeline/gaia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vue
102 lines (90 loc) · 2.16 KB
/
index.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<template>
<div class="tile is-ancestor">
<div class="tile is-vertical">
<tabs type="boxed" :is-fullwidth="false" alignment="centered" size="large">
<tab-pane label="User Roles" icon="fa fa-user">
<manage-permissions :users="users" :permission-options="permissionOptions"/>
</tab-pane>
<tab-pane label="User Groups" icon="fa fa-users">
<manage-groups :groups="groups" :permission-options="permissionOptions"/>
</tab-pane>
</tabs>
</div>
</div>
</template>
<script>
import { TabPane, Tabs } from 'vue-bulma-tabs'
import ManagePermissions from './permissions/manage-permissions'
import ManageGroups from './permissions/manage-groups'
import { EventBus } from '../../main'
export default {
components: {
ManagePermissions,
ManageGroups,
Tabs,
TabPane
},
data () {
return {
groups: [],
users: [],
permissionOptions: []
}
},
mounted () {
this.fetchData()
EventBus.$on('refreshGroups', this.fetchData)
},
watch: {
'$route': 'fetchData'
},
methods: {
fetchData () {
this.$http.get('/api/v1/permission')
.then(response => {
if (response.data) {
this.permissionOptions = response.data
}
})
.catch((error) => {
this.$onError(error)
})
this.$http
.get('/api/v1/permission/group', { showProgressBar: false })
.then(response => {
if (response.data) {
this.groups = response.data
}
})
.catch((error) => {
this.$onError(error)
})
this.$http
.get('/api/v1/users', { showProgressBar: false })
.then(response => {
if (response.data) {
this.users = response.data
}
})
.catch((error) => {
this.$onError(error)
})
},
close () {
}
}
}
</script>
<style lang="scss">
.tabs {
margin: 10px;
.tab-content {
min-height: 50px;
}
}
.tabs.is-boxed li.is-active a {
background-color: transparent;
border-color: transparent;
border-bottom-color: #4da2fc !important;
}
</style>