fix: statuses

This commit is contained in:
Andras Bacsai 2024-02-22 15:15:16 +01:00
parent 01ab820459
commit c77f32e696
7 changed files with 14 additions and 15 deletions

View File

@ -11,12 +11,11 @@ class Index extends Component
/** /**
* Create a new component instance. * Create a new component instance.
*/ */
public $status = "exited:unhealthy";
public function __construct( public function __construct(
public $resource = null, public $resource = null,
public bool $showRefreshButton = true, public bool $showRefreshButton = true,
) { ) {
$this->status = $resource->status;
} }
/** /**

View File

@ -7,7 +7,7 @@
// The release version of your application // The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.222', 'release' => '4.0.0-beta.223',
// When left empty or `null` the Laravel environment will be used // When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'), 'environment' => config('app.env'),

View File

@ -1,3 +1,3 @@
<?php <?php
return '4.0.0-beta.222'; return '4.0.0-beta.223';

View File

@ -1,14 +1,13 @@
@if (str($status)->startsWith('running')) @if (str($resource->status)->startsWith('running'))
<x-status.running :status="$status" /> <x-status.running :status="$resource->status" />
@elseif(str($status)->startsWith('restarting') || @elseif(str($resource->status)->startsWith('restarting') ||
str($status)->startsWith('starting') || str($resource->status)->startsWith('starting') ||
str($status)->startsWith('degraded')) str($resource->status)->startsWith('degraded'))
<x-status.restarting :status="$status" /> <x-status.restarting :status="$resource->status" />
@else @else
<x-status.stopped :status="$status" /> <x-status.stopped :status="$resource->status" />
@endif @endif
@if (!str($resource->status)->contains('exited') && $showRefreshButton)
@if (!str($status)->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

View File

@ -10,6 +10,7 @@
<x-new-modal disabled isErrorButton buttonTitle="Delete"> <x-new-modal disabled isErrorButton buttonTitle="Delete">
This server will be deleted. It is not reversible. <br>Please think again. This server will be deleted. It is not reversible. <br>Please think again.
</x-new-modal> </x-new-modal>
<div>You need to delete all resources before deleting this server.</div>
@else @else
<x-new-modal isErrorButton buttonTitle="Delete"> <x-new-modal isErrorButton buttonTitle="Delete">
This server will be deleted. It is not reversible. <br>Please think again. This server will be deleted. It is not reversible. <br>Please think again.

View File

@ -53,7 +53,7 @@
@if ($resource->type() === 'service') @if ($resource->type() === 'service')
<x-status.services :service="$resource" :showRefreshButton="false" /> <x-status.services :service="$resource" :showRefreshButton="false" />
@else @else
<x-status.index :status="$resource->status" :showRefreshButton="false" /> <x-status.index :resource="$resource" :showRefreshButton="false" />
@endif @endif
</td> </td>
</tr> </tr>

View File

@ -4,7 +4,7 @@
"version": "3.12.36" "version": "3.12.36"
}, },
"v4": { "v4": {
"version": "4.0.0-beta.222" "version": "4.0.0-beta.223"
} }
} }
} }