1
0
mirror of https://github.com/cp6/my-idlers.git synced 2024-11-16 15:33:44 +01:00

Updated confirmDeleteModal action

Updated confirmDeleteModal action
Made consistency in all the index blade files to use the component
This commit is contained in:
cp6 2022-10-20 11:56:35 +11:00
parent 9c1a853d6a
commit 7b602d3616
12 changed files with 29 additions and 79 deletions

View File

@ -8,10 +8,10 @@
showModal: false
},
methods: {
modalForm(event) {
confirmDeleteModal(event) {
this.showModal = true;
this.modal_hostname = event.target.id.replace('btn-', '');
this.modal_id = event.target.title;
this.modal_hostname = event.target.title;
this.modal_id = event.target.id;
this.delete_form_action = '{{$uri}}/' + this.modal_id;
}
}

View File

@ -42,8 +42,8 @@
<i class="fas fa-pen" title="edit"></i></a>
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$dns->hostname}}" title="{{$dns->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$dns->id}}" title="{{$dns->hostname}}"></i>
</form>
</td>
</tr>

View File

@ -48,8 +48,8 @@
<i class="fas fa-pen" title="edit"></i></a>
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$domain->domain}}" title="{{$domain->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$domain->id}}" title="{{$domain->domain}}"></i>
</form>
</td>
</tr>

View File

@ -41,8 +41,8 @@
<form action="{{ route('IPs.destroy', $ip->id) }}" method="POST">
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$ip->hostname}}" title="{{$ip->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$ip->id}}" title="{{$ip->hostname}}"></i>
</form>
</td>
</tr>

View File

@ -36,8 +36,8 @@
class="text-body mx-1">
<i class="fas fa-eye" title="view"></i></a>
@csrf
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$label->label}}" title="{{$label->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$label->id}}" title="{{$label->label}}"></i>
</form>
</td>
</tr>
@ -75,6 +75,6 @@
});
</script>
<x-modal-delete-script>
<x-slot name="uri">locations</x-slot>
<x-slot name="uri">labels</x-slot>
</x-modal-delete-script>
</x-app-layout>

View File

@ -51,8 +51,8 @@
</a>
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$m->name}}" title="{{$m->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$m->name}}" title="{{$m->id}}"></i>
</form>
</td>
</tr>

View File

@ -32,8 +32,8 @@
<td class="text-nowrap">{{ $o->name }}</td>
<td class="text-nowrap">
<form action="{{ route('locations.destroy', $o->id) }}" method="POST">
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$o->name}}" title="{{$o->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$o->id}}" title="{{$o->name}}"></i>
</form>
</td>
</tr>

View File

@ -35,8 +35,8 @@
<a href="{{ route('providers.show', $provider->id) }}"
class="text-body mx-1">
<i class="fas fa-eye" title="view"></i></a>
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$provider->name}}" title="{{$provider->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$provider->id}}" title="{{$provider->name}}"></i>
</form>
</td>
</tr>

View File

@ -80,23 +80,7 @@
</p>
@endif
</div>
<script>
let app = new Vue({
el: "#app",
data: {
"modal_hostname": '',
"modal_id": '',
"delete_form_action": '',
showModal: false
},
methods: {
confirmDeleteModal(event) {
this.showModal = true;
this.modal_hostname = event.target.title;
this.modal_id = event.target.id;
this.delete_form_action = 'reseller/' + this.modal_id;
}
}
});
</script>
<x-modal-delete-script>
<x-slot name="uri">reseller</x-slot>
</x-modal-delete-script>
</x-app-layout>

View File

@ -101,24 +101,7 @@
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
</div>
<script>
let app = new Vue({
el: "#app",
data: {
"modal_hostname": '',
"modal_id": '',
"delete_form_action": '',
showModal: false
},
methods: {
confirmDeleteModal(event) {
this.showModal = true;
this.modal_hostname = event.target.title;
this.modal_id = event.target.id;
this.delete_form_action = 'seedboxes/' + this.modal_id;
}
}
});
</script>
<x-modal-delete-script>
<x-slot name="uri">seedboxes</x-slot>
</x-modal-delete-script>
</x-app-layout>

View File

@ -79,24 +79,7 @@
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
</div>
<script>
let app = new Vue({
el: "#app",
data: {
"modal_hostname": '',
"modal_id": '',
"delete_form_action": '',
showModal: false
},
methods: {
confirmDeleteModal(event) {
this.showModal = true;
this.modal_hostname = event.target.title;
this.modal_id = event.target.id;
this.delete_form_action = 'shared/' + this.modal_id;
}
}
});
</script>
<x-modal-delete-script>
<x-slot name="uri">shared</x-slot>
</x-modal-delete-script>
</x-app-layout>

View File

@ -64,8 +64,8 @@
<i class="fas fa-eye" title="view"></i>
</a>
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$yab->server->hostname}}" title="{{$yab->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$yab->id}}" title="{{$yab->server->hostname}}"></i>
</form>
</td>
</tr>