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-21 14:15:18 +00:00
|
|
|
<div class="d-flex justify-content-end 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-22 09:12:03 +00:00
|
|
|
<div class="row">
|
2021-11-20 02:48:26 +00:00
|
|
|
@foreach ($servers as $server)
|
|
|
|
|
2021-12-22 09:12:03 +00:00
|
|
|
<div class="col-xl-3 col-lg-5 col-md-6 col-sm-6 col-xs-12 card pr-0 pl-0" 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">
|
|
|
|
@if (!empty(env('PHPMYADMIN_URL')))
|
|
|
|
<a href="{{ env('PHPMYADMIN_URL', 'http://localhost') }}"
|
|
|
|
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">
|
2021-12-21 18:41:04 +00:00
|
|
|
<i
|
|
|
|
class="fas {{ $server->isSuspended() ? 'text-danger' : 'text-success' }} fa-circle mr-2"></i>
|
|
|
|
{{ $server->isSuspended() ? 'Suspended' : 'Active' }}
|
|
|
|
</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-22 09:12:03 +00:00
|
|
|
<div class="col-7">
|
|
|
|
<span class="">{{ $server->location }}</span>
|
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>
|
|
|
|
<div class="row mb-4">
|
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 09:12:03 +00:00
|
|
|
<div class="col-7 text-wrap">
|
|
|
|
<span>{{ $server->resourceplanName }}</span>
|
2021-12-21 14:15:18 +00:00
|
|
|
</div>
|
|
|
|
|
2021-11-20 02:48:26 +00:00
|
|
|
</div>
|
|
|
|
<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>
|
2021-12-22 09:12:03 +00:00
|
|
|
<div class="col-8">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6 text-center">
|
|
|
|
<div class="text-muted">{{ __('per Hour') }}</div>
|
|
|
|
<span>
|
|
|
|
{{ number_format($server->product->getHourlyPrice(), 2, '.', '') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="col-6 text-center">
|
|
|
|
<div class="text-muted">{{ __('per Month') }}
|
|
|
|
</div>
|
2021-12-22 09:14:58 +00:00
|
|
|
<span>
|
|
|
|
{{ $server->product->getHourlyPrice() * 24 * 30 }}
|
2021-12-22 09:12:03 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
2021-11-20 02:48:26 +00:00
|
|
|
</div>
|
|
|
|
</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
|
|
|
|
2021-12-22 09:12:03 +00:00
|
|
|
<div class="card-footer d-flex align-items-center justify-content-between">
|
2021-12-22 08:34:05 +00:00
|
|
|
<a href="{{ env('PTERODACTYL_URL', 'http://localhost') }}/server/{{ $server->identifier }}"
|
2021-12-22 09:12:03 +00:00
|
|
|
target="__blank"
|
|
|
|
class="btn btn-info mx-3 w-100 align-items-center justify-content-center d-flex">
|
2021-12-22 08:34:05 +00:00
|
|
|
<i class="fas fa-tools mr-2"></i>
|
2021-12-22 09:12:03 +00:00
|
|
|
<span>{{ __('Manage') }}</span>
|
2021-12-22 08:34:05 +00:00
|
|
|
</a>
|
|
|
|
<button onclick="handleServerDelete('{{ $server->id }}');" target="__blank"
|
2021-12-22 09:12:03 +00:00
|
|
|
class="btn btn-danger mx-3 w-100 align-items-center justify-content-center d-flex">
|
2021-12-22 08:34:05 +00:00
|
|
|
<i class="fas fa-trash mr-2"></i>
|
2021-12-22 09:12:03 +00:00
|
|
|
<span>{{ __('Delete') }}</span>
|
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>
|
2021-12-22 08:34:05 +00:00
|
|
|
const handleSubmit = () => {
|
|
|
|
return confirm('Are you sure you want to delete this server?');
|
|
|
|
}
|
|
|
|
|
|
|
|
const handleServerDelete = (serverId) => {
|
|
|
|
if (handleSubmit()) {
|
|
|
|
fetch("{{ route('servers.destroy', '') }}" + '/' + serverId, {
|
|
|
|
method: 'DELETE',
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
|
|
|
}
|
|
|
|
}).then(() => {
|
|
|
|
window.location.reload();
|
|
|
|
});
|
|
|
|
}
|
2021-06-05 09:26:32 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
@endsection
|