2021-06-05 09:26:32 +00:00
@ extends ( 'layouts.main' )
@ section ( 'content' )
<!-- CONTENT HEADER -->
< section class = " content-header " >
< div class = " container-fluid " >
< div class = " row mb-2 " >
< div class = " col-sm-6 " >
2021-12-21 13:56:12 +00:00
< h1 > {{ __ ( 'Servers' ) }} </ h1 >
2021-06-05 09:26:32 +00:00
</ div >
< div class = " col-sm-6 " >
< ol class = " breadcrumb float-sm-right " >
2021-12-21 13:56:12 +00:00
< li class = " breadcrumb-item " >< a href = " { { route('home') }} " > {{ __ ( 'Dashboard' ) }} </ a ></ li >
2021-11-20 02:48:26 +00:00
< li class = " breadcrumb-item " >< a class = " text-muted "
2021-12-21 13:56:12 +00:00
href = " { { route('servers.index') }} " > {{ __ ( 'Servers' ) }} </ a >
2021-06-05 09:26:32 +00:00
</ li >
</ ol >
</ div >
</ div >
</ div >
</ section >
<!-- END CONTENT HEADER -->
<!-- MAIN CONTENT -->
< section class = " content " >
< div class = " container-fluid " >
<!-- CUSTOM CONTENT -->
2021-12-22 23:27:43 +00:00
< div class = " d-flex justify-content-md-start justify-content-center mb-3 " >
2021-12-21 18:44:31 +00:00
< a @ if ( Auth :: user () -> Servers -> count () >= Auth :: user () -> server_limit )
disabled = " disabled " title = " Server limit reached! "
@ endif href = " { { route('servers.create') }} "
class = " btn
@ if ( Auth :: user () -> Servers -> count () >= Auth :: user () -> server_limit ) disabled
@ endif btn - primary " ><i
class = " fa fa-plus mr-2 " ></ i >
{{ __ ( 'Create Server' ) }}
</ a >
2021-06-05 09:26:32 +00:00
</ div >
2021-12-23 23:03:32 +00:00
< div class = " row d-flex flex-row justify-content-center justify-content-md-start " >
2021-11-20 02:48:26 +00:00
@ foreach ( $servers as $server )
2021-12-23 23:03:32 +00:00
< div class = " col-xl-3 col-lg-5 col-md-6 col-sm-6 col-xs-12 card pr-0 pl-0 ml-sm-2 mr-sm-3 "
style = " max-width: 350px " >
2021-11-20 02:48:26 +00:00
< div class = " card-header " >
< div class = " d-flex justify-content-between align-items-center " >
2021-12-21 18:41:04 +00:00
< h5 class = " card-title mt-1 " > {{ $server -> name }}
2021-11-20 02:48:26 +00:00
</ h5 >
< div class = " card-tools mt-1 " >
< div class = " dropdown no-arrow " >
< a href = " # " role = " button " id = " dropdownMenuLink " data - toggle = " dropdown "
aria - haspopup = " true " aria - expanded = " false " >
< i class = " fas fa-ellipsis-v fa-sm fa-fw text-white-50 " ></ i >
</ a >
< div class = " dropdown-menu dropdown-menu-right shadow animated--fade-in "
aria - labelledby = " dropdownMenuLink " >
2022-01-14 12:34:37 +00:00
@ if ( ! empty ( config ( 'SETTINGS::MISC:PHPMYADMIN:URL' )))
< a href = " { { config('SETTINGS::MISC:PHPMYADMIN:URL') }} "
2021-11-20 02:48:26 +00:00
class = " dropdown-item text-info " target = " __blank " >< i title = " manage "
2021-12-21 18:44:31 +00:00
class = " fas fa-database mr-2 " ></ i >< span > {{ __ ( 'Database' ) }} </ span ></ a >
2021-11-20 02:48:26 +00:00
@ endif
< div class = " dropdown-divider " ></ div >
< span class = " dropdown-item " >< i title = " Created at "
class = " fas fa-sync-alt mr-2 " ></ i >< span > {{ $server -> created_at -> isoFormat ( 'LL' ) }} </ span ></ span >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
</ div >
</ div >
2021-11-20 02:48:26 +00:00
</ div >
< div class = " card-body " >
2021-12-21 14:15:18 +00:00
< div class = " container mt-1 " >
2021-11-20 02:48:26 +00:00
< div class = " row mb-3 " >
2021-12-21 18:44:31 +00:00
< div class = " col my-auto " > {{ __ ( 'Status' ) }} :</ div >
2021-12-22 09:12:03 +00:00
< div class = " col-7 my-auto " >
2022-07-22 02:40:03 +00:00
@ if ( $server -> suspended )
2022-07-22 02:09:34 +00:00
< span class = " badge badge-danger " > {{ __ ( 'Suspended' ) }} </ span >
@ elseif ( $server -> cancelled )
< span class = " badge badge-warning " > {{ __ ( 'Cancelled' ) }} </ span >
@ else
< span class = " badge badge-success " > {{ __ ( 'Active' ) }} </ span >
@ endif
2021-12-21 18:41:04 +00:00
</ div >
2021-11-20 02:48:26 +00:00
</ div >
< div class = " row mb-2 " >
2021-12-22 09:12:03 +00:00
< div class = " col-5 " >
2021-12-21 18:44:31 +00:00
{{ __ ( 'Location' ) }} :
2021-11-20 02:48:26 +00:00
</ div >
2021-12-23 13:48:04 +00:00
< div class = " col-7 d-flex justify-content-between align-items-center " >
2021-12-22 09:12:03 +00:00
< span class = " " > {{ $server -> location }} </ span >
2021-12-23 13:48:04 +00:00
< i data - toggle = " popover " data - trigger = " hover "
data - content = " { { __('Node') }}: { { $server->node }} "
class = " fas fa-info-circle " ></ i >
2021-11-20 02:48:26 +00:00
</ div >
2021-12-21 14:15:18 +00:00
</ div >
< div class = " row mb-2 " >
2021-12-22 09:12:03 +00:00
< div class = " col-5 " >
2021-12-21 18:44:31 +00:00
{{ __ ( 'Software' ) }} :
2021-12-21 14:15:18 +00:00
</ div >
2021-12-22 09:12:03 +00:00
< div class = " col-7 text-wrap " >
< span > {{ $server -> nest }} </ span >
2021-11-20 02:48:26 +00:00
</ div >
2021-12-21 14:15:18 +00:00
2021-11-20 02:48:26 +00:00
</ div >
< div class = " row mb-2 " >
2021-12-22 09:12:03 +00:00
< div class = " col-5 " >
2021-12-21 18:44:31 +00:00
{{ __ ( 'Specification' ) }} :
2021-11-20 02:48:26 +00:00
</ div >
2021-12-22 09:12:03 +00:00
< div class = " col-7 text-wrap " >
< span > {{ $server -> egg }} </ span >
2021-11-20 02:48:26 +00:00
</ div >
2021-12-21 14:15:18 +00:00
</ div >
2022-07-22 00:58:08 +00:00
< div class = " row mb-2 " >
2021-12-22 09:12:03 +00:00
< div class = " col-5 " >
{{ __ ( 'Resource plan' ) }} :
2021-11-20 02:48:26 +00:00
</ div >
2021-12-22 19:18:48 +00:00
< div class = " col-7 text-wrap d-flex justify-content-between align-items-center " >
< span > {{ $server -> product -> name }}
</ span >
< i data - toggle = " popover " data - trigger = " hover " data - html = " true "
2022-07-22 00:58:08 +00:00
data - content = " { { __('CPU') }}: { { $server->product ->cpu / 100 }} { { __('vCores') }} <br/> { { __('RAM') }}: { { $server->product ->memory }} MB <br/> { { __('Disk') }}: { { $server->product ->disk }} MB <br/> { { __('Backups') }}: { { $server->product ->backups }} <br/> { { __('MySQL Databases') }}: { { $server->product ->databases }} <br/> { { __('Allocations') }}: { { $server->product ->allocations }} <br/> { { __('Billing Period') }}: { { $server -> product -> billing_period } } "
2021-12-22 19:18:48 +00:00
class = " fas fa-info-circle " ></ i >
2021-12-21 14:15:18 +00:00
</ div >
2022-07-22 00:58:08 +00:00
</ div >
2021-12-21 14:15:18 +00:00
2022-07-22 00:58:08 +00:00
< div class = " row mb-4 " >
2022-07-22 02:31:00 +00:00
< div class = " col-5 word-break " style = " hyphens: auto " >
2022-07-22 00:58:08 +00:00
{{ __ ( 'Next Billing Cycle' ) }} :
</ div >
< div class = " col-7 d-flex text-wrap align-items-center " >
< span >
2022-07-22 02:33:54 +00:00
@ if ( $server -> suspended )
2022-07-22 02:09:34 +00:00
-
@ else
@ switch ( $server -> product -> billing_period )
@ case ( 'monthly' )
{{ \Carbon\Carbon :: parse ( $server -> last_billed ) -> addMonth () -> toDayDateTimeString (); }}
@ break
@ case ( 'weekly' )
{{ \Carbon\Carbon :: parse ( $server -> last_billed ) -> addWeek () -> toDayDateTimeString (); }}
@ break
@ case ( 'daily' )
{{ \Carbon\Carbon :: parse ( $server -> last_billed ) -> addDay () -> toDayDateTimeString (); }}
@ break
@ case ( 'hourly' )
{{ \Carbon\Carbon :: parse ( $server -> last_billed ) -> addHour () -> toDayDateTimeString (); }}
@ break
2022-07-22 03:31:05 +00:00
@ case ( 'quarterly' )
{{ \Carbon\Carbon :: parse ( $server -> last_billed ) -> addMonths ( 3 ) -> toDayDateTimeString (); }}
@ break
2022-07-22 02:09:34 +00:00
@ case ( 'half-annually' )
{{ \Carbon\Carbon :: parse ( $server -> last_billed ) -> addMonths ( 6 ) -> toDayDateTimeString (); }}
@ break
@ case ( 'annually' )
{{ \Carbon\Carbon :: parse ( $server -> last_billed ) -> addYear () -> toDayDateTimeString (); }}
@ break
@ default
{{ __ ( 'Unknown' ) }}
@ endswitch
@ endif
2022-07-22 00:58:08 +00:00
</ span >
</ div >
2021-11-20 02:48:26 +00:00
</ div >
2022-07-22 00:58:08 +00:00
2021-11-20 02:48:26 +00:00
< div class = " row mb-2 " >
2021-12-21 14:15:18 +00:00
< div class = " col-4 " >
2021-12-22 09:14:58 +00:00
{{ __ ( 'Price' ) }} :
< span class = " text-muted " >
({{ CREDITS_DISPLAY_NAME }})
2021-12-22 09:12:03 +00:00
</ span >
2021-11-20 02:48:26 +00:00
</ div >
2022-06-18 21:41:40 +00:00
< div class = " col-8 text-center " >
< div class = " text-muted " >
@ if ( $server -> product -> billing_period == 'monthly' )
{{ __ ( 'per Month' ) }}
2022-07-22 02:09:34 +00:00
@ elseif ( $server -> product -> billing_period == 'half-annually' )
2022-07-22 02:00:23 +00:00
{{ __ ( 'per 6 Months' ) }}
2022-07-22 03:31:05 +00:00
@ elseif ( $server -> product -> billing_period == 'quarterly' )
{{ __ ( 'per 3 Months' ) }}
2022-07-22 02:09:34 +00:00
@ elseif ( $server -> product -> billing_period == 'annually' )
2022-07-22 02:00:23 +00:00
{{ __ ( 'per Year' ) }}
2022-06-18 21:41:40 +00:00
@ elseif ( $server -> product -> billing_period == 'weekly' )
{{ __ ( 'per Week' ) }}
@ elseif ( $server -> product -> billing_period == 'daily' )
{{ __ ( 'per Day' ) }}
@ elseif ( $server -> product -> billing_period == 'hourly' )
{{ __ ( 'per Hour' ) }}
@ endif
2021-12-22 09:12:03 +00:00
</ div >
2022-06-18 21:41:40 +00:00
< span >
2022-07-27 21:26:03 +00:00
{{ number_format ( $server -> product -> price ) }}
2022-06-18 21:41:40 +00:00
</ span >
2021-11-20 02:48:26 +00:00
</ div >
</ div >
2021-06-05 09:26:32 +00:00
</ div >
2021-11-20 02:48:26 +00:00
</ div >
2021-06-05 09:26:32 +00:00
2022-07-22 00:58:08 +00:00
< div class = " card-footer text-center " >
2022-01-14 12:34:37 +00:00
< a href = " { { config('SETTINGS::SYSTEM:PTERODACTYL:URL') }}/server/ { { $server->identifier }} "
2021-12-22 09:12:03 +00:00
target = " __blank "
2022-07-22 00:58:08 +00:00
class = " btn btn-info text-center float-left ml-2 "
2022-07-22 02:25:23 +00:00
data - toggle = " tooltip " data - placement = " bottom " title = " { { __('Manage Server') }} " >
2022-07-22 00:58:08 +00:00
< i class = " fas fa-tools mx-4 " ></ i >
2021-12-22 08:34:05 +00:00
</ a >
2022-08-15 10:39:58 +00:00
< a href = " { { route('servers.show', ['server' => $server->id ])}} "
class = " btn btn-info mx-3 w-100 align-items-center justify-content-center d-flex "
data - toggle = " tooltip " data - placement = " bottom " title = " { { __('Server Settings') }} " >
2022-08-03 12:34:00 +00:00
< i class = " fas fa-cog mr-2 " ></ i >
</ a >
2022-07-22 00:58:08 +00:00
< button onclick = " handleServerCancel(' { { $server->id }}'); " target = " __blank "
class = " btn btn-warning text-center "
2022-07-22 03:12:06 +00:00
{{ $server -> suspended || $server -> cancelled ? " disabled " : " " }}
2022-07-22 02:25:23 +00:00
data - toggle = " tooltip " data - placement = " bottom " title = " { { __('Cancel Server') }} " >
2022-07-22 00:58:08 +00:00
< i class = " fas fa-ban mx-4 " ></ i >
</ button >
< button onclick = " handleServerDelete(' { { $server->id }}'); " target = " __blank "
class = " btn btn-danger text-center float-right mr-2 "
2022-07-22 02:25:23 +00:00
data - toggle = " tooltip " data - placement = " bottom " title = " { { __('Delete Server') }} " >
2022-07-22 00:58:08 +00:00
< i class = " fas fa-trash mx-4 " ></ i >
2021-12-22 08:34:05 +00:00
</ button >
2021-06-05 09:26:32 +00:00
</ div >
</ div >
@ endforeach
</ div >
<!-- END CUSTOM CONTENT -->
</ div >
</ section >
<!-- END CONTENT -->
< script >
2022-07-22 00:58:08 +00:00
const handleServerCancel = ( serverId ) => {
// Handle server cancel with sweetalert
2021-12-22 10:04:35 +00:00
Swal . fire ({
2022-07-22 00:58:08 +00:00
title : " { { __('Cancel Server?') }} " ,
text : " { { __('This will cancel your current server to the next billing period. It will get suspended when the current period runs out.') }} " ,
2021-12-22 10:04:35 +00:00
icon : 'warning' ,
confirmButtonColor : '#d9534f' ,
showCancelButton : true ,
2022-07-22 00:58:08 +00:00
confirmButtonText : " { { __('Yes, cancel it!') }} " ,
cancelButtonText : " { { __('No, abort!') }} " ,
2021-12-22 10:04:35 +00:00
reverseButtons : true
}) . then (( result ) => {
if ( result . value ) {
2022-07-22 00:58:08 +00:00
// Delete server
2022-07-22 01:52:49 +00:00
fetch ( " { { route('servers.cancel', '') }} " + '/' + serverId , {
method : 'PATCH' ,
2022-07-22 00:58:08 +00:00
headers : {
'X-CSRF-TOKEN' : '{{ csrf_token() }}'
}
}) . then (() => {
window . location . reload ();
});
2021-12-22 10:04:35 +00:00
return
}
2022-07-22 00:58:08 +00:00
})
2021-12-22 08:34:05 +00:00
}
const handleServerDelete = ( serverId ) => {
2022-07-22 00:58:08 +00:00
Swal . fire ({
title : " { { __('Delete Server?') }} " ,
2022-07-22 03:26:48 +00:00
html : " { { !! __('This is an irreversible action, all files of this server will be removed. <strong>No funds will get refunded</strong>. We recommend deleting the server when server is suspended.') !!}} " ,
2022-07-22 00:58:08 +00:00
icon : 'warning' ,
confirmButtonColor : '#d9534f' ,
showCancelButton : true ,
confirmButtonText : " { { __('Yes, delete it!') }} " ,
cancelButtonText : " { { __('No, abort!') }} " ,
reverseButtons : true
}) . then (( result ) => {
if ( result . value ) {
// Delete server
fetch ( " { { route('servers.destroy', '') }} " + '/' + serverId , {
method : 'DELETE' ,
headers : {
'X-CSRF-TOKEN' : '{{ csrf_token() }}'
}
}) . then (() => {
window . location . reload ();
});
return
2021-12-22 10:04:35 +00:00
}
});
2022-07-22 00:58:08 +00:00
2021-06-05 09:26:32 +00:00
}
2021-12-22 19:18:48 +00:00
document . addEventListener ( 'DOMContentLoaded' , () => {
$ ( '[data-toggle="popover"]' ) . popover ();
});
2022-07-22 00:58:08 +00:00
$ ( function () {
$ ( '[data-toggle="tooltip"]' ) . tooltip ()
})
2021-06-05 09:26:32 +00:00
</ script >
@ endsection