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('companion.name') }}</th> | |||||
<th scope="col">{{ $t('companion.deviceid') }}</th> | |||||
<th scope="col"></th> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
<tr v-for="entry in entries" :id="'entry' + entry.id" :key="entry.id"> | |||||
<td class="description">{{ entry.name }}</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="$t('companion.forget-device')" type="button" @click="remove(entry.id)"> | |||||
<svg-icon icon="trash-alt"></svg-icon> | |||||
</button> | |||||
</td> | |||||
</tr> | |||||
Done Inline ActionsWhy not just the "usual" red trash-alt icon? machniak: Why not just the "usual" red trash-alt icon? | |||||
</tbody> | |||||
<list-foot :text="$t('companion.nodevices')" :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) | |||||
.then(response => { | |||||
if (response.data.status == 'success') { | |||||
this.$toast.success(response.data.message) | |||||
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. | |||||
} | |||||
this.loadMore({ reset: true }) | |||||
}) | |||||
.catch(this.$root.errorHandler) | |||||
}, | |||||
} | |||||
} | |||||
</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?