Dashboard updates

Former-commit-id: e6c96075892397f2033dc54edbe51b218e515e79 [formerly 842b38286f4cffdabd36c8a09f135dea50d8a750] [formerly 6db6ef19b576adc616b8209ec5ad0ef52705effa [formerly af369cdea115cf56e4f10d39fd75ca4455ff0145]]
Former-commit-id: 1cd150a4e4d4846772e460778fca006ea1105fe4 [formerly 6137ec696244fe7230db1d8c29a6eede7dee6926]
Former-commit-id: 2b82b1b5a2b3f7ff39448501089cd9860cb4707c
This commit is contained in:
Henrique Dias
2017-07-07 20:00:32 +01:00
parent c9ddf10aba
commit ee55b9fd9c
10 changed files with 536 additions and 127 deletions

View File

@@ -1,11 +1,43 @@
<template>
<div>
<h1>Users</h1>
<div class="dashboard">
<h1>Users <router-link to="/users/new"><button>New</button></router-link></h1>
<table>
<tr>
<th>Username</th>
<th>Admin</th>
<th>Scope</th>
<th></th>
</tr>
<tr v-for="user in users">
<td>{{ user.username }}</td>
<td><i v-if="user.admin" class="material-icons">done</i><i v-else class="material-icons">close</i></td>
<td>{{ user.filesystem }}</td>
<td><router-link :to="'/users/' + user.ID"><i class="material-icons">mode_edit</i></router-link></td>
</tr>
</table>
</div>
</template>
<script>
import api from '@/utils/api'
export default {
name: 'users'
name: 'users',
data: function () {
return {
users: []
}
},
created () {
api.getUsers().then(users => {
this.users = users
console.log(users)
}).catch(error => {
console.log(error)
})
}
}
</script>