Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/CompanionappList.vue
- This file was added.
<template> | |||||
<div> | |||||
<table class="table table-sm m-0 entries"> | |||||
<thead> | |||||
<tr> | |||||
<th scope="col">{{ $t('form.date') }}</th> | |||||
<th scope="col">Device ID</th> | |||||
<th scope="col"></th> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
<tr v-for="entry in entries" :id="'entry' + entry.id" :key="entry.id"> | |||||
<td class="datetime">{{ entry.created_at }}</td> | |||||
<td class="description">{{ entry.device_id }}</td> | |||||
machniak: I'm not sure it make sense to display the creation date here. And I would not display it as a… | |||||
<td class="selection"> | |||||
<button class="btn btn-lg btn-link btn-action" title="Forget Device" type="button" | |||||
@click="remove(entry.id)" | |||||
> | |||||
<svg-icon icon="minus-circle"></svg-icon> | |||||
</button> | |||||
Done Inline ActionsWhy not just the "usual" red trash-alt icon? machniak: Why not just the "usual" red trash-alt icon? | |||||
</td> | |||||
</tr> | |||||
</tbody> | |||||
<list-foot text="There are currently no devices" :colspan="3"></list-foot> | |||||
</table> | |||||
<list-more v-if="hasMore" :on-click="loadMore"></list-more> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import ListTools from './ListTools' | |||||
export default { | |||||
mixins: [ ListTools ], | |||||
props: { | |||||
}, | |||||
data() { | |||||
return { | |||||
entries: [] | |||||
} | |||||
}, | |||||
mounted() { | |||||
this.loadMore({ reset: true }) | |||||
}, | |||||
methods: { | |||||
loadMore(params) { | |||||
this.listSearch('entries', '/api/v4/companion/', params) | |||||
}, | |||||
remove(id) { | |||||
axios.delete('/api/v4/companion/' + id) | |||||
.catch(this.$root.errorHandler) | |||||
Done Inline ActionsI guess we should refresh the list, and display the usual confirmation message. machniak: I guess we should refresh the list, and display the usual confirmation message. | |||||
}, | |||||
} | |||||
} | |||||
</script> |
I'm not sure it make sense to display the creation date here. And I would not display it as a first column. Shouldn't we display a name?