fix: resources
This commit is contained in:
parent
e0b0dda382
commit
f8c86769a7
@ -11,7 +11,18 @@ class Resources extends Component
|
|||||||
use AuthorizesRequests;
|
use AuthorizesRequests;
|
||||||
public ?Server $server = null;
|
public ?Server $server = null;
|
||||||
public $parameters = [];
|
public $parameters = [];
|
||||||
|
public function getListeners()
|
||||||
|
{
|
||||||
|
$teamId = auth()->user()->currentTeam()->id;
|
||||||
|
return [
|
||||||
|
"echo-private:team.{$teamId},ApplicationStatusChanged" => 'refreshStatus',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function refreshStatus() {
|
||||||
|
$this->server->refresh();
|
||||||
|
$this->dispatch('success', 'Resource statuses refreshed.');
|
||||||
|
}
|
||||||
public function mount() {
|
public function mount() {
|
||||||
$this->parameters = get_route_parameters();
|
$this->parameters = get_route_parameters();
|
||||||
try {
|
try {
|
||||||
|
@ -15,6 +15,7 @@ class Services extends Component
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
public Service $service,
|
public Service $service,
|
||||||
public string $complexStatus = 'exited',
|
public string $complexStatus = 'exited',
|
||||||
|
public bool $showRefreshButton = true
|
||||||
) {
|
) {
|
||||||
$this->complexStatus = $service->status();
|
$this->complexStatus = $service->status();
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
@else
|
@else
|
||||||
<x-status.stopped :status="$complexStatus" />
|
<x-status.stopped :status="$complexStatus" />
|
||||||
@endif
|
@endif
|
||||||
@if (!str($complexStatus)->contains('exited'))
|
@if (!str($complexStatus)->contains('exited') && $showRefreshButton)
|
||||||
<button title="Refresh Status" wire:click='check_status(true)' class="mx-1 hover:fill-white fill-warning">
|
<button title="Refresh Status" wire:click='check_status(true)' class="mx-1 hover:fill-white fill-warning">
|
||||||
<svg class="w-4 h-4" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<svg class="w-4 h-4" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path
|
<path
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<x-server.navbar :server="$server" :parameters="$parameters" />
|
<x-server.navbar :server="$server" :parameters="$parameters" />
|
||||||
<h2>Resources</h2>
|
<div class="flex flex-col">
|
||||||
<div class="pb-4 title">Here you can find all resources for this server.</div>
|
<div class="flex gap-2">
|
||||||
|
<h2>Resources</h2>
|
||||||
|
<x-forms.button wire:click="refreshStatus">Refresh</x-forms.button>
|
||||||
|
</div>
|
||||||
|
<div class="pb-4 title">Here you can find all resources for this server.</div>
|
||||||
|
</div>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
@ -10,7 +15,8 @@
|
|||||||
<table class="min-w-full divide-y divide-coolgray-400">
|
<table class="min-w-full divide-y divide-coolgray-400">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="text-neutral-500">
|
<tr class="text-neutral-500">
|
||||||
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Project Name</th>
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Project</th>
|
||||||
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Environment</th>
|
||||||
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Name</th>
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Name</th>
|
||||||
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Type</th>
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Type</th>
|
||||||
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Status</th>
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">Status</th>
|
||||||
@ -22,13 +28,16 @@
|
|||||||
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
||||||
{{ data_get($resource->project(), 'name') }}
|
{{ data_get($resource->project(), 'name') }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-5 py-4 text-sm whitespace-nowrap"> <a class=""
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
||||||
|
{{ data_get($resource, 'environment.name') }}
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-4 text-sm whitespace-nowrap"><a class=""
|
||||||
href="{{ $resource->link() }}">{{ $resource->name }} </a></td>
|
href="{{ $resource->link() }}">{{ $resource->name }} </a></td>
|
||||||
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
||||||
{{ str($resource->type())->headline() }}</td>
|
{{ str($resource->type())->headline() }}</td>
|
||||||
<td class="px-5 py-4 text-sm font-medium whitespace-nowrap">
|
<td class="px-5 py-4 text-sm font-medium whitespace-nowrap">
|
||||||
@if ($resource->type() === 'service')
|
@if ($resource->type() === 'service')
|
||||||
<x-status.services :service="$resource" />
|
<x-status.services :service="$resource" :showRefreshButton="false" />
|
||||||
@else
|
@else
|
||||||
<x-status.index :status="$resource->status" :showRefreshButton="false" />
|
<x-status.index :status="$resource->status" :showRefreshButton="false" />
|
||||||
@endif
|
@endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user