feat: initial api endpoints

feat: server resources are now looks better
This commit is contained in:
Andras Bacsai
2024-02-16 21:56:38 +01:00
parent 3539e4dce9
commit b8708f086e
24 changed files with 318 additions and 142 deletions

View File

@@ -18,6 +18,12 @@
]) }}">
<button>General</button>
</a>
<a class="{{ request()->routeIs('server.resources') ? 'text-white' : '' }}"
href="{{ route('server.resources', [
'server_uuid' => data_get($parameters, 'server_uuid'),
]) }}">
<button>Resources</button>
</a>
<a class="{{ request()->routeIs('server.private-key') ? 'text-white' : '' }}"
href="{{ route('server.private-key', [
'server_uuid' => data_get($parameters, 'server_uuid'),

View File

@@ -5,7 +5,7 @@
</a>
<x-services.links />
<div class="flex-1"></div>
@if (serviceStatus($service) === 'degraded')
@if ($service->status() === 'degraded')
<button wire:click='deploy' onclick="startService.showModal()"
class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
<svg class="w-5 h-5 text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
@@ -26,7 +26,7 @@
Stop
</button>
@endif
@if (serviceStatus($service) === 'running')
@if ($service->status() === 'running')
<button wire:click='restart' class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
<svg class="w-5 h-5 text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
@@ -47,7 +47,7 @@
Stop
</button>
@endif
@if (serviceStatus($service) === 'exited')
@if ($service->status() === 'exited')
<button wire:click='stop(true)'
class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
<svg class="w-5 h-5 " viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">

View File

@@ -1,11 +1,15 @@
@props(['status', 'showRefreshButton' => true])
@if (str($status)->startsWith('running'))
<x-status.running :status="$status" />
@elseif(str($status)->startsWith('restarting') || str($status)->startsWith('starting') || str($status)->startsWith('degraded'))
@elseif(str($status)->startsWith('restarting') ||
str($status)->startsWith('starting') ||
str($status)->startsWith('degraded'))
<x-status.restarting :status="$status" />
@else
<x-status.stopped :status="$status" />
<x-status.stopped :status="$status"/>
@endif
@if (!str($status)->contains('exited'))
@if (!str($status)->contains('exited') && $showRefreshButton)
<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">
<path