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

Updated server index blade view

Updated server index blade view for NPM webpack usage
This commit is contained in:
cp6 2022-11-13 15:54:27 +11:00
parent f0903e08f4
commit 26356b3cd7

View File

@ -1,17 +1,9 @@
@section("title", "Servers") @section('title', 'Servers')
@section('style')
<x-modal-style></x-modal-style>
@endsection
@section('scripts')
<script src="{{ asset('js/vue.min.js') }}"></script>
<script src="{{ asset('js/axios.min.js') }}"></script>
@endsection
<x-app-layout> <x-app-layout>
<x-slot name="header"> <x-slot name="header">
{{ __('Servers') }} {{ __('Servers') }}
</x-slot> </x-slot>
<div class="container" id="app"> <div class="container" id="app">
<x-delete-confirm-modal></x-delete-confirm-modal>
<x-response-alerts></x-response-alerts> <x-response-alerts></x-response-alerts>
<ul class="nav nav-tabs mt-3" id="myTab" role="tablist"> <ul class="nav nav-tabs mt-3" id="myTab" role="tablist">
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
@ -94,7 +86,7 @@
<i class="fas fa-plug mx-1" id="{{$server->hostname}}" <i class="fas fa-plug mx-1" id="{{$server->hostname}}"
title="check if up" title="check if up"
@click="checkUp"> @click="checkIfUp">
</i> </i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal" <i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$server->id}}" title="{{$server->hostname}}"></i> id="{{$server->id}}" title="{{$server->hostname}}"></i>
@ -175,7 +167,7 @@
<i class="fas fa-plug mx-1" id="{{$server->hostname}}" <i class="fas fa-plug mx-1" id="{{$server->hostname}}"
title="check if up" title="check if up"
@click="checkUp"> @click="checkIfUp">
</i> </i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal" <i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$server->id}}" title="{{$server->hostname}}"></i> id="{{$server->id}}" title="{{$server->hostname}}"></i>
@ -196,7 +188,12 @@
</div> </div>
<x-details-footer></x-details-footer> <x-details-footer></x-details-footer>
</div> </div>
<x-delete-confirm-modal></x-delete-confirm-modal>
</div>
@section('scripts')
<script> <script>
window.addEventListener('load', function () {
document.getElementById("confirmDeleteModal").classList.remove("d-none");
axios.defaults.headers.common = { axios.defaults.headers.common = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest', 'X-Requested-With': 'XMLHttpRequest',
@ -214,7 +211,7 @@
showModal: false showModal: false
}, },
methods: { methods: {
checkUp(event) { checkIfUp(event) {
var hostname = event.target.id; var hostname = event.target.id;
if (hostname) { if (hostname) {
@ -238,5 +235,7 @@
} }
} }
}); });
})
</script> </script>
@endsection
</x-app-layout> </x-app-layout>