2023-06-13 22:03:32 +02:00
|
|
|
<template>
|
|
|
|
<page-layout>
|
|
|
|
<template #toolbar>
|
|
|
|
<page-toolbar-button :href="data.meta.links.create" color="primary" icon="plus">Verteiler erstellen</page-toolbar-button>
|
|
|
|
</template>
|
2023-06-15 00:08:01 +02:00
|
|
|
<ui-popup heading="Verteiler löschen?" v-if="deleting !== null" @close="deleting.reject()">
|
|
|
|
<div>
|
|
|
|
<p class="mt-4">Den Verteiler "{{ deleting.dispatcher.name }}" löschen?</p>
|
|
|
|
<div class="grid grid-cols-2 gap-3 mt-6">
|
|
|
|
<a href="#" @click.prevent="deleting.resolve()" class="text-center btn btn-danger">Löschen</a>
|
|
|
|
<a href="#" @click.prevent="deleting.reject()" class="text-center btn btn-primary">Abbrechen</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</ui-popup>
|
2023-06-13 22:03:32 +02:00
|
|
|
<table cellspacing="0" cellpadding="0" border="0" class="custom-table custom-table-sm">
|
|
|
|
<thead>
|
|
|
|
<th>Name</th>
|
2023-06-15 00:08:01 +02:00
|
|
|
<th>Domain</th>
|
|
|
|
<th>Verbindung</th>
|
2023-06-13 22:03:32 +02:00
|
|
|
<th></th>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tr v-for="(dispatcher, index) in data.data" :key="index">
|
|
|
|
<td>
|
|
|
|
<div v-text="dispatcher.name"></div>
|
|
|
|
</td>
|
|
|
|
<td>
|
2023-06-15 00:08:01 +02:00
|
|
|
<div v-text="dispatcher.gateway.domain"></div>
|
2023-06-13 22:03:32 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
2023-06-15 00:08:01 +02:00
|
|
|
<div v-text="dispatcher.gateway.name"></div>
|
2023-06-13 22:03:32 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
2023-06-15 00:08:01 +02:00
|
|
|
<i-link :href="dispatcher.links.edit" class="mr-1 inline-flex btn btn-warning btn-sm"><svg-sprite src="pencil"></svg-sprite></i-link>
|
|
|
|
<i-link @click.prevent="remove(dispatcher)" class="inline-flex btn btn-danger btn-sm"><svg-sprite src="trash"></svg-sprite></i-link>
|
2023-06-13 22:03:32 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</page-layout>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2023-06-15 00:08:01 +02:00
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
deleting: null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async remove(dispatcher) {
|
|
|
|
new Promise((resolve, reject) => {
|
|
|
|
this.deleting = {resolve, reject, dispatcher};
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
this.$inertia.delete(dispatcher.links.delete);
|
|
|
|
this.deleting = null;
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
this.deleting = null;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
2023-06-13 22:03:32 +02:00
|
|
|
props: {
|
|
|
|
data: {},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|