moved to bootstrap-vue, there is a bug in vee-validate and bootstrap-vue >rc15
This commit is contained in:
@@ -5,14 +5,15 @@
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
<h3 class="title">Manage users</h3>
|
||||
<div>{{users}}</div>
|
||||
<div>{{users}}</div>
|
||||
|
||||
<div id="userTable">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="col in columns" v-on:click="sortTable(col)">{{col}}
|
||||
<div class="arrow" v-if="col == sortColumn" v-bind:class="[ascending ? 'arrow_up' : 'arrow_down']"></div>
|
||||
<div class="arrow" v-if="col == sortColumn"
|
||||
v-bind:class="[ascending ? 'arrow_up' : 'arrow_down']"></div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -26,7 +27,8 @@
|
||||
<div class="number"
|
||||
v-for="i in num_pages()"
|
||||
v-bind:class="[i === currentPage ? 'active' : '']"
|
||||
v-on:click="change_page(i)">{{i}}</div>
|
||||
v-on:click="change_page(i)">{{i}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -47,14 +49,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { EventBus } from '@/utils';
|
||||
import {EventBus} from '@/utils';
|
||||
import {getRemainingJwtValiditySeconds} from '../utils';
|
||||
import { RepositoryFactory} from '@/api/RepositoryFactory';
|
||||
const UserRepository = RepositoryFactory.get('user');
|
||||
import getRepository from '@/api/RepositoryFactory';
|
||||
|
||||
const UserRepository = getRepository('user');
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
user: {},
|
||||
users: [],
|
||||
errorMsg: '',
|
||||
@@ -68,7 +72,7 @@
|
||||
this.isLoading = true;
|
||||
// const { data } = await GroupRepository.get();
|
||||
UserRepository.getUsers()
|
||||
.then( (response) => {
|
||||
.then((response) => {
|
||||
this.users = response.data;
|
||||
this.isLoading = false;
|
||||
this.$log.debug(response);
|
||||
@@ -76,8 +80,8 @@
|
||||
|
||||
},
|
||||
get_rows() {
|
||||
let start = (this.currentPage-1) * this.elementsPerPage;
|
||||
let end = start + this.elementsPerPage;
|
||||
const start = (this.currentPage - 1) * this.elementsPerPage;
|
||||
const end = start + this.elementsPerPage;
|
||||
return this.users.slice(start, end);
|
||||
},
|
||||
num_pages() {
|
||||
@@ -94,19 +98,19 @@
|
||||
this.sortColumn = col;
|
||||
}
|
||||
|
||||
let ascending = this.ascending;
|
||||
const ascending = this.ascending;
|
||||
|
||||
this.users.sort(function(a, b) {
|
||||
this.users.sort((a, b) => {
|
||||
if (a[col] > b[col]) {
|
||||
return ascending ? 1 : -1
|
||||
return ascending ? 1 : -1;
|
||||
} else if (a[col] < b[col]) {
|
||||
return ascending ? -1 : 1
|
||||
return ascending ? -1 : 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
});
|
||||
},
|
||||
createUser(){
|
||||
this.$log.info("Creating new user...");
|
||||
createUser() {
|
||||
this.$log.info('Creating new user...');
|
||||
UserRepository.createUser(this.user);
|
||||
this.fetch();
|
||||
},
|
||||
@@ -115,6 +119,7 @@
|
||||
this.fetch();
|
||||
},
|
||||
beforeDestroy() {
|
||||
// todo
|
||||
},
|
||||
computed: {
|
||||
columns() {
|
||||
@@ -124,7 +129,7 @@
|
||||
return Object.keys(this.users[0]);
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user