2
2
<b-container class =" ml-0" >
3
3
<PageTitle />
4
4
<b-row >
5
- <b-col lg =" 10" >
6
- <b-button @click = " initModalSettings " variant = " link " >
5
+ <b-col lg =" 10" class = " text-right " >
6
+ <b-button variant = " link " @click = " initModalSettings " >
7
7
Account policy settings
8
8
<icon-settings />
9
9
</b-button >
15
15
</b-row >
16
16
<b-row >
17
17
<b-col lg =" 10" >
18
- <b-table bordered show-empty head-variant =" dark" :items =" tableItems" >
19
- <template v-slot :head (actions)="data"></template >
18
+ <b-table show-empty :fields =" fields" :items =" tableItems" >
20
19
<template v-slot :cell (actions)="data">
21
20
<b-button
22
21
aria-label =" Edit user"
22
+ title =" Edit user"
23
23
variant =" link"
24
24
:disabled =" !data.value.edit"
25
25
@click =" initModalUser(data.item)"
28
28
</b-button >
29
29
<b-button
30
30
aria-label =" Delete user"
31
+ title =" Delete user"
31
32
variant =" link"
32
33
:disabled =" !data.value.delete"
33
34
@click =" initModalDelete(data.item)"
42
43
<b-col lg =" 8" >
43
44
<b-button v-b-toggle.collapse-role-table variant =" link" class =" mt-3" >
44
45
View privilege role descriptions
46
+ <icon-chevron />
45
47
</b-button >
46
48
<b-collapse id =" collapse-role-table" class =" mt-3" >
47
49
<table-roles />
48
50
</b-collapse >
49
51
</b-col >
50
52
</b-row >
51
53
<!-- Modals -->
52
- <modal-settings v-bind:settings =" settings" ></modal-settings >
53
- <modal-user
54
- v-bind:user =" activeUser"
55
- @ok =" saveUser"
56
- @hidden =" clearActiveUser"
57
- ></modal-user >
54
+ <modal-settings :settings =" settings" ></modal-settings >
55
+ <modal-user :user =" activeUser" @ok =" saveUser" ></modal-user >
58
56
</b-container >
59
57
</template >
60
58
@@ -63,6 +61,7 @@ import IconTrashcan from '@carbon/icons-vue/es/trash-can/20';
63
61
import IconEdit from ' @carbon/icons-vue/es/edit/20' ;
64
62
import IconAdd from ' @carbon/icons-vue/es/add--alt/20' ;
65
63
import IconSettings from ' @carbon/icons-vue/es/settings/20' ;
64
+ import IconChevron from ' @carbon/icons-vue/es/chevron--up/20' ;
66
65
67
66
import TableRoles from ' ./TableRoles' ;
68
67
import ModalUser from ' ./ModalUser' ;
@@ -73,6 +72,7 @@ export default {
73
72
name: ' local-users' ,
74
73
components: {
75
74
IconAdd,
75
+ IconChevron,
76
76
IconEdit,
77
77
IconSettings,
78
78
IconTrashcan,
@@ -84,7 +84,17 @@ export default {
84
84
data () {
85
85
return {
86
86
activeUser: null ,
87
- settings: null
87
+ settings: null ,
88
+ fields: [
89
+ ' username' ,
90
+ ' privilege' ,
91
+ ' status' ,
92
+ {
93
+ key: ' actions' ,
94
+ label: ' ' ,
95
+ tdClass: ' table-cell__actions'
96
+ }
97
+ ]
88
98
};
89
99
},
90
100
created () {
@@ -108,7 +118,8 @@ export default {
108
118
actions: {
109
119
edit: true ,
110
120
delete: user .UserName === ' root' ? false : true
111
- }
121
+ },
122
+ ... user
112
123
};
113
124
});
114
125
}
@@ -143,18 +154,15 @@ export default {
143
154
// fetch settings then show modal
144
155
}
145
156
},
146
- saveUser ({ newUser, form }) {
147
- if (newUser ) {
148
- this .$store .dispatch (' localUsers/createUser' , form );
157
+ saveUser ({ isNewUser, userData }) {
158
+ if (isNewUser ) {
159
+ this .$store .dispatch (' localUsers/createUser' , userData );
149
160
} else {
150
- this .$store .dispatch (' localUsers/updateUser' , form );
161
+ this .$store .dispatch (' localUsers/updateUser' , userData );
151
162
}
152
163
},
153
164
deleteUser ({ username }) {
154
165
this .$store .dispatch (' localUsers/deleteUser' , username);
155
- },
156
- clearActiveUser () {
157
- this .activeUser = null ;
158
166
}
159
167
}
160
168
};
@@ -164,4 +172,9 @@ export default {
164
172
h1 {
165
173
margin-bottom : 2rem ;
166
174
}
175
+ .btn.collapsed {
176
+ svg {
177
+ transform : rotate (180deg );
178
+ }
179
+ }
167
180
</style >
0 commit comments