Added tabs to home page for stats and avg cards

This commit is contained in:
cp6 2023-09-19 22:47:24 +10:00
parent d4b75b204f
commit 047260b953

View File

@ -1,85 +1,123 @@
@section("title", "Home") @section("title", "Home")
<x-app-layout> <x-app-layout>
<div class="row mt-4"> <div class="row mt-3">
<div class="col-6 col-lg-2 mb-3"> <ul class="nav nav-tabs mt-3" id="myTab" role="tablist">
<x-service-tally-card tally="{{ $information['servers'] }}" route="{{route('servers.index')}}" <li class="nav-item" role="presentation">
service="Servers"></x-service-tally-card> <button class="nav-link active" id="tally-tab" data-bs-toggle="tab" data-bs-target="#tally"
</div> type="button"
<div class="col-6 col-lg-2 mb-3"> role="tab" aria-controls="tally" aria-selected="true">Tally
<x-service-tally-card tally="{{ $information['shared'] }}" route="{{route('shared.index')}}" </button>
service="Shared"></x-service-tally-card> </li>
</div> <li class="nav-item" role="presentation">
<div class="col-6 col-lg-2 mb-3"> <button class="nav-link" id="costings-tab"
<x-service-tally-card tally="{{ $information['reseller'] }}" route="{{route('reseller.index')}}" data-bs-toggle="tab" data-bs-target="#costings" type="button" role="tab"
service="Reseller"></x-service-tally-card> aria-controls="costings" aria-selected="false">Costings
</div> </button>
<div class="col-6 col-lg-2 mb-3"> </li>
<x-service-tally-card tally="{{ $information['domains'] }}" route="{{route('domains.index')}}" <li class="nav-item" role="presentation">
service="Domains"></x-service-tally-card> <button class="nav-link" id="averages-tab"
</div> data-bs-toggle="tab" data-bs-target="#averages" type="button" role="tab"
<div class="col-6 col-lg-2 mb-3"> aria-controls="averages" aria-selected="false">Averages
<x-service-tally-card tally="{{ $information['misc'] }}" route="{{route('misc.index')}}" </button>
service="Misc"></x-service-tally-card> </li>
</div> </ul>
<div class="col-6 col-lg-2 mb-3">
<x-service-tally-card tally="{{ $information['dns'] }}" route="{{route('dns.index')}}" <div class="tab-content" id="myTabContent">
service="DNS"></x-service-tally-card> <div class="tab-pane fade show active" id="tally" role="tabpanel" aria-labelledby="tally-tab">
</div> <div class="row mt-3">
<div class="col-6 col-lg-2 mb-3">
<x-service-tally-card tally="{{ $information['servers'] }}"
route="{{route('servers.index')}}"
service="Servers"></x-service-tally-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-service-tally-card tally="{{ $information['shared'] }}" route="{{route('shared.index')}}"
service="Shared"></x-service-tally-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-service-tally-card tally="{{ $information['reseller'] }}"
route="{{route('reseller.index')}}"
service="Reseller"></x-service-tally-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-service-tally-card tally="{{ $information['domains'] }}"
route="{{route('domains.index')}}"
service="Domains"></x-service-tally-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-service-tally-card tally="{{ $information['misc'] }}" route="{{route('misc.index')}}"
service="Misc"></x-service-tally-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-service-tally-card tally="{{ $information['dns'] }}" route="{{route('dns.index')}}"
service="DNS"></x-service-tally-card>
</div>
</div>
</div>
<div class="tab-pane fade" id="costings" role="tabpanel" aria-labelledby="costings-tab">
<div class="row mt-3">
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_cost_weekly']}}" title="Weekly cost"
append="{{$information['currency']}}"></x-info-card>
</div>
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_cost_monthly']}}" title="Monthly cost"
append="{{$information['currency']}}"></x-info-card>
</div>
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_cost_yearly']}}" title="Yearly cost"
append="{{$information['currency']}}"></x-info-card>
</div>
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_cost_2_yearly']}}" title="2 yearly cost"
append="{{$information['currency']}}"></x-info-card>
</div>
</div>
</div>
<div class="tab-pane fade" id="averages" role="tabpanel" aria-labelledby="averages-tab">
<div class="row mt-3">
<div class="col-6 col-lg-2 mb-3">
<x-info-card value="{{$information['servers_summary']['cpu_sum']}}"
title="CPU"></x-info-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-info-card
value="{{number_format($information['servers_summary']['ram_mb_sum'] / 1024, 2)}}"
title="RAM"
append="GB"></x-info-card>
</div>
<div class="col-6 col-lg-2 mb-3">
@if($information['servers_summary']['disk_gb_sum'] >= 1000)
<x-info-card
value="{{number_format($information['servers_summary']['disk_gb_sum'] / 1024,2)}}"
title="DISK" append="TB"></x-info-card>
@else
<x-info-card value="{{$information['servers_summary']['disk_gb_sum']}}" title="DISK"
append="GB"></x-info-card>
@endif
</div>
<div class="col-6 col-lg-2 mb-3">
<x-info-card
value="{{number_format($information['servers_summary']['bandwidth_sum'] / 1024, 2)}}"
title="Bandwidth" append="TB"></x-info-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-info-card value="{{$information['servers_summary']['locations_sum']}}"
title="Locations"></x-info-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-info-card value="{{$information['servers_summary']['providers_sum']}}"
title="Providers"></x-info-card>
</div>
</div>
</div>
</div>
</div> </div>
<div class="row mt-3"> <div class="row mt-3">
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_cost_weekly']}}" title="Weekly cost"
append="{{$information['currency']}}"></x-info-card>
</div>
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_cost_monthly']}}" title="Monthly cost"
append="{{$information['currency']}}"></x-info-card>
</div>
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_cost_yearly']}}" title="Yearly cost"
append="{{$information['currency']}}"></x-info-card>
</div>
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_cost_2_yearly']}}" title="2 yearly cost"
append="{{$information['currency']}}"></x-info-card>
</div>
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_services']}}" title="Active services"></x-info-card>
</div>
<div class="col-12 col-lg-2 mb-3">
<x-info-card value="{{$information['total_inactive']}}" title="Inactive services"></x-info-card>
</div>
</div>
<div class="row mt-3">
<div class="col-6 col-lg-2 mb-3">
<x-info-card value="{{$information['servers_summary']['cpu_sum']}}" title="CPU"></x-info-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-info-card value="{{number_format($information['servers_summary']['ram_mb_sum'] / 1024, 2)}}" title="RAM"
append="GB"></x-info-card>
</div>
<div class="col-6 col-lg-2 mb-3">
@if($information['servers_summary']['disk_gb_sum'] >= 1000)
<x-info-card value="{{number_format($information['servers_summary']['disk_gb_sum'] / 1024,2)}}"
title="DISK" append="TB"></x-info-card>
@else
<x-info-card value="{{$information['servers_summary']['disk_gb_sum']}}" title="DISK"
append="GB"></x-info-card>
@endif
</div>
<div class="col-6 col-lg-2 mb-3">
<x-info-card value="{{number_format($information['servers_summary']['bandwidth_sum'] / 1024, 2)}}"
title="Bandwidth" append="TB"></x-info-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-info-card value="{{$information['servers_summary']['locations_sum']}}" title="Locations"></x-info-card>
</div>
<div class="col-6 col-lg-2 mb-3">
<x-info-card value="{{$information['servers_summary']['providers_sum']}}" title="Providers"></x-info-card>
</div>
@if(Session::get('due_soon_amount') > 0) @if(Session::get('due_soon_amount') > 0)
<h3 class="my-3">Due soon</h3> <h3 class="my-3">Due soon</h3>
@if(!empty($information['due_soon'])) @if(!empty($information['due_soon']))