feat: Added Resource plan-/product-data to server card

This commit is contained in:
IceToast 2021-12-22 20:18:48 +01:00
parent 2bfe26247a
commit 5a05c5f846
2 changed files with 12 additions and 4 deletions

View file

@ -44,9 +44,9 @@ class ServerController extends Controller
$server->nest = $serverRelationships['nest']['attributes']['name'];
//get productname by product_id for server
$productName = Product::find($server->product_id)->name;
$product = Product::find($server->product_id);
$server->resourceplanName = $productName;
$server->product = $product;
}
return view('servers.index')->with([

View file

@ -107,8 +107,12 @@
<div class="col-5 ">
{{ __('Resource plan') }}:
</div>
<div class="col-7 text-wrap">
<span>{{ $server->resourceplanName }}</span>
<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"
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/>"
class="fas fa-info-circle"></i>
</div>
</div>
@ -193,5 +197,9 @@
window.location.reload();
});
}
document.addEventListener('DOMContentLoaded', () => {
$('[data-toggle="popover"]').popover();
});
</script>
@endsection