11<template >
2- <b-container class =" mx-0" fluid >
3- <b-row >
4- <b-col >
5- <h5 >Character Groups</h5 >
6- <b-table
7- id =" character-group-table"
8- :items =" CHARACTER_GROUP_LIST"
9- :fields =" characterGroupFields"
10- :per-page =" rowsPerPage"
11- :current-page =" currentPage"
12- show-empty
13- >
14- <template #head (btn)="data">
15- <b-button v-if =" IS_SHOW_EDITOR" v-b-modal.new-character-group variant =" outline-success" >
16- New Character Group
17- </b-button >
18- </template >
19- <template #cell (characters)="data">
20- <div style =" overflow-wrap : break-word " >
21- <p >
22- {{
23- CHARACTER_LIST.filter((c) => data.item.characters.includes(c.id))
24- .map((c) => c.name)
25- .join(', ')
26- }}
27- </p >
28- </div >
29- </template >
30- <template #cell (btn)="data">
31- <b-button-group v-if =" IS_SHOW_EDITOR" >
32- <b-button
33- variant =" warning"
34- :disabled =" submittingEditGroup || deletingGroup"
35- @click =" openEditForm(data)"
36- >
37- Edit
38- </b-button >
39- <b-button
40- variant =" danger"
41- :disabled =" submittingEditGroup || deletingGroup"
42- @click =" deleteCharacterGroup(data)"
43- >
44- Delete
45- </b-button >
46- </b-button-group >
47- </template >
48- </b-table >
49- <b-pagination
50- v-show =" CHARACTER_GROUP_LIST.length > rowsPerPage"
51- v-model =" currentPage"
52- :total-rows =" CHARACTER_GROUP_LIST.length"
53- :per-page =" rowsPerPage"
54- aria-controls =" character-group-table"
55- class =" justify-content-center"
56- />
57- </b-col >
58- </b-row >
2+ <span v-if =" !loading" >
3+ <b-table
4+ id =" character-group-table"
5+ :items =" CHARACTER_GROUP_LIST"
6+ :fields =" characterGroupFields"
7+ :per-page =" rowsPerPage"
8+ :current-page =" currentPage"
9+ show-empty
10+ >
11+ <template #head (btn)="data">
12+ <b-button v-if =" IS_SHOW_EDITOR" v-b-modal.new-character-group variant =" outline-success" >
13+ New Character Group
14+ </b-button >
15+ </template >
16+ <template #cell (characters)="data">
17+ <div style =" overflow-wrap : break-word " >
18+ <p >
19+ {{
20+ CHARACTER_LIST.filter((c) => data.item.characters.includes(c.id))
21+ .map((c) => c.name)
22+ .join(', ')
23+ }}
24+ </p >
25+ </div >
26+ </template >
27+ <template #cell (btn)="data">
28+ <b-button-group v-if =" IS_SHOW_EDITOR" >
29+ <b-button
30+ variant =" warning"
31+ :disabled =" submittingEditGroup || deletingGroup"
32+ @click =" openEditForm(data)"
33+ >
34+ Edit
35+ </b-button >
36+ <b-button
37+ variant =" danger"
38+ :disabled =" submittingEditGroup || deletingGroup"
39+ @click =" deleteCharacterGroup(data)"
40+ >
41+ Delete
42+ </b-button >
43+ </b-button-group >
44+ </template >
45+ </b-table >
46+ <b-pagination
47+ v-show =" CHARACTER_GROUP_LIST.length > rowsPerPage"
48+ v-model =" currentPage"
49+ :total-rows =" CHARACTER_GROUP_LIST.length"
50+ :per-page =" rowsPerPage"
51+ aria-controls =" character-group-table"
52+ class =" justify-content-center"
53+ />
5954 <b-modal
6055 id =" new-character-group"
6156 ref =" new-character"
155150 </b-form-group >
156151 </b-form >
157152 </b-modal >
158- </b-container >
153+ </span >
154+ <div v-else class =" text-center py-5" >
155+ <b-spinner label =" Loading" />
156+ </div >
159157</template >
160158
161159<script >
@@ -164,9 +162,10 @@ import { required } from 'vuelidate/lib/validators';
164162import log from ' loglevel' ;
165163
166164export default {
167- name: ' ConfigCharacterGroups ' ,
165+ name: ' CharacterGroups ' ,
168166 data () {
169167 return {
168+ loading: true ,
170169 characterGroupFields: [' name' , ' description' , ' characters' , { key: ' btn' , label: ' ' }],
171170 rowsPerPage: 15 ,
172171 currentPage: 1 ,
@@ -210,6 +209,7 @@ export default {
210209 async mounted () {
211210 await this .GET_CHARACTER_LIST ();
212211 await this .GET_CHARACTER_GROUP_LIST ();
212+ this .loading = false ;
213213 },
214214 methods: {
215215 newSelectChanged (value , id ) {
0 commit comments