Merge pull request #280 from ControlPanel-gg/product_linking
Product linking
This commit is contained in:
commit
0acd97026e
|
@ -84,6 +84,7 @@ class ProductController extends Controller
|
||||||
if (is_null($egg->id) || is_null($node->id)) return response()->json('node and egg id is required', '400');
|
if (is_null($egg->id) || is_null($node->id)) return response()->json('node and egg id is required', '400');
|
||||||
|
|
||||||
return Product::query()
|
return Product::query()
|
||||||
|
->where('disabled', '=', false)
|
||||||
->whereHas('nodes', function (Builder $builder) use ($node) {
|
->whereHas('nodes', function (Builder $builder) use ($node) {
|
||||||
$builder->where('id', '=', $node->id);
|
$builder->where('id', '=', $node->id);
|
||||||
})
|
})
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
x-model="selectedNest"
|
x-model="selectedNest"
|
||||||
@change="setEggs();">
|
@change="setEggs();">
|
||||||
<option selected disabled hidden
|
<option selected disabled hidden
|
||||||
value="null">{{count($nests) > 0 ? __('Please select software..') : __('---')}}</option>
|
value="null">{{count($nests) > 0 ? __('Please select software ...') : __('---')}}</option>
|
||||||
@foreach ($nests as $nest)
|
@foreach ($nests as $nest)
|
||||||
<option value="{{ $nest->id }}">{{ $nest->name }}</option>
|
<option value="{{ $nest->id }}">{{ $nest->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@ -229,10 +229,11 @@
|
||||||
<small x-text="selectedProductObject?.name ?? '{{__('No selection')}}'"
|
<small x-text="selectedProductObject?.name ?? '{{__('No selection')}}'"
|
||||||
class="text-muted"></small>
|
class="text-muted"></small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template x-if="selectedProductObject?.name">
|
<template x-if="selectedProductObject?.name">
|
||||||
<ul class="pl-0">
|
<ul class="pl-0">
|
||||||
<li class="d-flex justify-content-between">
|
<li class="d-flex justify-content-between">
|
||||||
<small class="text-muted d-inline-block">{{__('Cpu')}}</small>
|
<small class="text-muted d-inline-block">{{__('CPU')}}</small>
|
||||||
<small class="text-muted d-inline-block"
|
<small class="text-muted d-inline-block"
|
||||||
x-text="selectedProductObject.cpu + ' %'"></small>
|
x-text="selectedProductObject.cpu + ' %'"></small>
|
||||||
</li>
|
</li>
|
||||||
|
@ -242,20 +243,24 @@
|
||||||
x-text="selectedProductObject.memory + ' {{__('MB')}}'"></small>
|
x-text="selectedProductObject.memory + ' {{__('MB')}}'"></small>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<small class="text-muted d-inline-block">{{__('Storage')}}</small>
|
<small class="text-muted d-inline-block">{{__('Disk')}}</small>
|
||||||
<small class="text-muted d-inline-block"
|
<small class="text-muted d-inline-block"
|
||||||
x-text="selectedProductObject.disk + ' {{__('MB')}}'"></small>
|
x-text="selectedProductObject.disk + ' {{__('MB')}}'"></small>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<small class="text-muted d-inline-block">{{__('Databases')}}</small>
|
<small class="text-muted d-inline-block">{{__('Databases')}}</small>
|
||||||
<small class="text-muted d-inline-block"
|
<small class="text-muted d-inline-block"
|
||||||
x-text="selectedProductObject.databases + ' {{__('Mysql')}}'"></small>
|
x-text="selectedProductObject.databases + ' {{__('MySQL')}}'"></small>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<small class="text-muted d-inline-block">{{__('Backups')}}</small>
|
<small class="text-muted d-inline-block">{{__('Backups')}}</small>
|
||||||
<small class="text-muted d-inline-block"
|
<small class="text-muted d-inline-block"
|
||||||
x-text="selectedProductObject.backups"></small>
|
x-text="selectedProductObject.backups"></small>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<small class="text-muted d-inline-block">{{__('Allocations')}} ({{__('ports')}})</small>
|
||||||
|
<small class="text-muted d-inline-block" x-text="selectedProductObject.allocations"></small>
|
||||||
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -428,7 +433,7 @@
|
||||||
getNodeInputText() {
|
getNodeInputText() {
|
||||||
if (this.fetchedLocations) {
|
if (this.fetchedLocations) {
|
||||||
if (this.locations.length > 0) {
|
if (this.locations.length > 0) {
|
||||||
return '{{__('Please select a node...')}}';
|
return '{{__('Please select a node ...')}}';
|
||||||
}
|
}
|
||||||
return '{{__('No nodes found matching current configuration')}}'
|
return '{{__('No nodes found matching current configuration')}}'
|
||||||
}
|
}
|
||||||
|
@ -438,7 +443,7 @@
|
||||||
getProductInputText() {
|
getProductInputText() {
|
||||||
if (this.fetchedProducts) {
|
if (this.fetchedProducts) {
|
||||||
if (this.products.length > 0) {
|
if (this.products.length > 0) {
|
||||||
return '{{__('Please select a resource...')}}';
|
return '{{__('Please select a resource ...')}}';
|
||||||
}
|
}
|
||||||
return '{{__('No resources found matching current configuration')}}'
|
return '{{__('No resources found matching current configuration')}}'
|
||||||
}
|
}
|
||||||
|
@ -447,7 +452,7 @@
|
||||||
|
|
||||||
getEggInputText() {
|
getEggInputText() {
|
||||||
if (this.selectedNest) {
|
if (this.selectedNest) {
|
||||||
return '{{__('Please select a configuration...')}}';
|
return '{{__('Please select a configuration ...')}}';
|
||||||
}
|
}
|
||||||
return '{{__('---')}}';
|
return '{{__('---')}}';
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue