Update source into github

This commit is contained in:
pbao9
2025-07-24 16:18:27 +07:00
parent 41419358dd
commit 69851ac7bc
2642 changed files with 284095 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\Card;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class CardBody extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.card.card-body');
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\Card;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class CardHeader extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.card.card-header');
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\View\Components\Card;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class CardLink extends Component
{
public $href;
public $icon;
public function __construct($href = '#', $icon = '')
{
$this->href = $href;
$this->icon = $icon;
}
public function render(): View|Closure|string
{
return view('components.card-link');
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\Card;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class CardService extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.card-service');
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\View\Components\Card;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class CardWrapper extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.card.card-wrapper');
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class FallingEffect extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.falling-effect');
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\View\Components\Form;
use App\Repositories\Customer\CustomerRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Customer extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public CustomerRepositoryInterface $customerRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$customers = $this->customerRepository->filter([],[],[]);
return view('components.form.customer',compact('customers'));
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\View\Components\Form;
use App\Repositories\Payment\PaymentReppositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Payment extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public PaymentReppositoryInterface $paymentReppository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$payments = $this->paymentReppository->filter([],[],[]);
return view('components.form.payment',compact('payments'));
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\View\Components\Input;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class InputSwitch extends Component
{
public $name;
public $value;
public $checked;
public function __construct($name = '', $value = '', $checked = false)
{
$this->name = $name;
$this->value = $value;
$this->checked = filter_var($checked, FILTER_VALIDATE_BOOLEAN);
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.input.switch');
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class LivewireAssets extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.livewire-assets');
}
}
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace App\View\Components\Module;
use App\Repositories\Module\Datacenter\DatacenterRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Datacenter extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public DatacenterRepositoryInterface $datacenterRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$vcenterId = $this->model?->vCenter?->id;
$datacenters = null;
if ($vcenterId) {
$datacenters = $this->datacenterRepository->filter(
['vcenter_id' => $vcenterId],
[],
[],
['id', 'name']
);
}
return view('components.module.datacenter', compact('datacenters'));
}
}
+48
View File
@@ -0,0 +1,48 @@
<?php
namespace App\View\Components\Module;
use App\Repositories\Module\Host\HostRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Host extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public HostRepositoryInterface $hostRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$hosts = null;
if(
$this->model &&
(
isset($this->model->ipaddress->host->module_datacenter_id) ||
isset($this->model->host->module_datacenter_id)
)
)
{
$hosts = $this->hostRepository->filter(
[
'module_datacenter_id' => $this->model->ipaddress->host->module_datacenter_id ?? $this->model->host->module_datacenter_id
],
[],
[],
['id', 'name']
);
}
return view('components.module.host',compact('hosts'));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace App\View\Components\Module;
use App\Repositories\Module\IpAddress\IpAddressRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class IpAddress extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public IpAddressRepositoryInterface $ipAddressRepository
) {
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$ipaddress = null;
if ($this->model && isset($this->model->ipaddress->module_host_id)) {
$ipaddress = $this->ipAddressRepository->filter(
[
'module_host_id' => $this->model->ipaddress->module_host_id
],
[],
[],
['id', 'ip']
);
}
return view('components.module.ip-address',compact('ipaddress'));
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace App\View\Components\Module;
use App\Repositories\Module\Network\NetworkRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Network extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public NetworkRepositoryInterface $networkRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$networks = null;
if($this->model && (
isset($this->model->ipaddress->module_host_id) ||
isset($this->model->module_host_id)
))
{
$networks = $this->networkRepository->filter(
[
'module_host_id' => $this->model->ipaddress->module_host_id ?? $this->model->module_host_id
],
[],
[],
['id', 'name']
);
}
return view('components.module.network',compact('networks'));
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace App\View\Components\Module;
use App\Repositories\OsGroup\OsGroupRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Os extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public OsGroupRepositoryInterface $osGroupRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$lists = null;
if($this->model && (
isset($this->model->ipaddress->modulVe_host_id) ||
isset($this->model->module_host_id)
))
{
$lists = $this->osGroupRepository->filter(
[
'module_host_id' => $this->model->ipaddress->module_host_id ?? $this->model->module_host_id
],
[],
[],
['id', 'name']
);
}
return view('components.module.os',compact('lists'));
}
}
@@ -0,0 +1,52 @@
<?php
namespace App\View\Components\Module;
use App\Http\Services\vCenter;
use App\Repositories\vCenter\vCenterRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class OsServerVersion extends Component
{
public function __construct(
public $model = null,
public vCenter $vCenter,
public vCenterRepositoryInterface $vCenterRepository
) {
}
public function render(): View|Closure|string
{
$versions = $this->fetchVersions();
return view('components.module.os-server-version', compact('versions'));
}
protected function fetchVersions()
{
$vCenter = optional($this->model?->osGroup?->host?->datacenter?->vCenter);
if (!$vCenter || !$vCenter->host) {
return null;
}
$this->vCenter->token = $vCenter->token ?? '';
$this->vCenter->apiUri = $vCenter->host ?? '';
$templateId = $this->model?->osGroup?->host?->template;
$versions = $this->vCenter->getAllVersion($templateId);
if ($versions === "Login_Again") {
$token = $this->vCenter->loginServer($vCenter);
if ($token) {
$this->vCenterRepository->update($vCenter->id, ['token' => $token]);
$this->vCenter->token = $token;
$versions = $this->vCenter->getAllVersion($templateId);
}
}
return $versions;
}
}
+53
View File
@@ -0,0 +1,53 @@
<?php
namespace App\View\Components\Module;
use App\Repositories\Os\OsRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class OsVersion extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public OsRepositoryInterface $osRepositoryInterface,
public $model = null,
public $os = null
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$os_versions = null;
if($this->model && isset($this->model->os_id))
{
// First get the current OS to find its group
$currentOs = $this->osRepositoryInterface->find($this->model->os_id);
if($currentOs && $currentOs->os_group_id) {
// Then get all OS versions in the same group
$os_versions = $this->osRepositoryInterface->filter(
[
'os_group_id' => $currentOs->os_group_id
],
[],
[],
['id', 'version']
);
}
}
return view('components.module.os-version', [
'os_versions' => $os_versions,
'os' => $this->os,
'model' => $this->model
]);
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace App\View\Components\Module;
use App\Repositories\vCenter\vCenterRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class VCenter extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public vCenterRepositoryInterface $vCenterRepository,
public $selected = null
)
{
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$vcenters = $this->vCenterRepository->filter(
[
'status' => 1
],
[],
[],
['id', 'host']
);
return view('components.module.v-center', compact('vcenters'));
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\View\Components\Order;
use App\Repositories\Customer\CustomerRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Customer extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public CustomerRepositoryInterface $customerRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$customers = $this->customerRepository->filter([],[],[]);
return view('components.order.customer',compact('customers'));
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\View\Components\Order;
use App\Repositories\Discount\DiscountRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Discount extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public DiscountRepositoryInterface $discountRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$discounts = $this->discountRepository->filter();
return view('components.order.discount',compact('discounts'));
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\View\Components\Order;
use App\Repositories\Payment\PaymentReppositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Payment extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public PaymentReppositoryInterface $paymentReppository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$payments = $this->paymentReppository->filter([],[],[]);
return view('components.order.payment',compact('payments'));
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\View\Components\Order;
use App\Repositories\Type\TypeRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Type extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public TypeRepositoryInterface $typeRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$types= $this->typeRepository->getAll();
return view('components.order.type',compact('types'));
}
}
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace App\View\Components;
use App\Repositories\Menu\MenuRepositoryInterface;
use App\Traits\GetConfig;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class SiderbarUser extends Component
{
use GetConfig;
public $menu;
/**
* Create a new component instance.
*/
protected MenuRepositoryInterface $menuRepositoryInterface;
public function __construct(MenuRepositoryInterface $menuRepositoryInterface)
{
$this->menuRepositoryInterface = $menuRepositoryInterface;
$this->menu = $this->menuRepositoryInterface->getTree();
}
// public function routeName($routeName, $param)
// {
// return $routeName ? route($routeName, $param) : '#';
// }
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.siderbar-user');
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Status extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.status');
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\View\Components;
use App\Repositories\Type\TypeRepositoryInterface;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Type extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public $model = null,
public TypeRepositoryInterface $typeRepository
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$types = $this->typeRepository->getAll();
return view('components.type',compact('types'));
}
}