mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
init
This commit is contained in:
75
resources/views/livewire/queues/create-queue.blade.php
Normal file
75
resources/views/livewire/queues/create-queue.blade.php
Normal file
@ -0,0 +1,75 @@
|
||||
<div>
|
||||
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'create-queue')">
|
||||
{{ __('Create Queue') }}
|
||||
</x-primary-button>
|
||||
|
||||
<x-modal name="create-queue">
|
||||
<form wire:submit.prevent="create" class="p-6">
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __('Create Queue') }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="command" :value="__('Command')" />
|
||||
<x-text-input wire:model.defer="command" id="command" name="command" type="text" class="mt-1 w-full" />
|
||||
@error('command')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="user" :value="__('User')" />
|
||||
<x-select-input wire:model.defer="user" id="user" name="user" class="mt-1 w-full">
|
||||
<option value="" selected disabled>{{ __("Select") }}</option>
|
||||
<option value="root" @if($user === 'root') selected @endif>root</option>
|
||||
<option value="{{ $site->server->ssh_user }}" @if($user === $site->server->ssh_user) selected @endif>{{ $site->server->ssh_user }}</option>
|
||||
</x-select-input>
|
||||
@error('user')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="auto_start" :value="__('Auto Start')" />
|
||||
<x-select-input wire:model="auto_start" id="auto_start" name="auto_start" class="mt-1 w-full">
|
||||
<option value="" selected disabled>{{ __("Select") }}</option>
|
||||
<option value="1" @if($auto_start) selected @endif>{{ __("Yes") }}</option>
|
||||
<option value="0" @if(!$auto_start) selected @endif>{{ __("No") }}</option>
|
||||
</x-select-input>
|
||||
@error('auto_start')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="auto_restart" :value="__('Auto Restart')" />
|
||||
<x-select-input wire:model="auto_restart" id="auto_restart" name="auto_restart" class="mt-1 w-full">
|
||||
<option value="" selected disabled>{{ __("Select") }}</option>
|
||||
<option value="1" @if($auto_restart) selected @endif>{{ __("Yes") }}</option>
|
||||
<option value="0" @if(!$auto_restart) selected @endif>{{ __("No") }}</option>
|
||||
</x-select-input>
|
||||
@error('auto_restart')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="numprocs" :value="__('Numprocs')" />
|
||||
<x-text-input wire:model.defer="numprocs" id="numprocs" name="numprocs" type="text" class="mt-1 w-full" placeholder="2" />
|
||||
@error('numprocs')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __('Cancel') }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-primary-button class="ml-3" @created.window="$dispatch('close')">
|
||||
{{ __('Create') }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
||||
</div>
|
27
resources/views/livewire/queues/partials/status.blade.php
Normal file
27
resources/views/livewire/queues/partials/status.blade.php
Normal file
@ -0,0 +1,27 @@
|
||||
@if($status == \App\Enums\QueueStatus::RUNNING)
|
||||
<x-status status="success">{{ $status }}</x-status>
|
||||
@endif
|
||||
@if($status == \App\Enums\QueueStatus::CREATING)
|
||||
<x-status status="warning">{{ $status }}</x-status>
|
||||
@endif
|
||||
@if($status == \App\Enums\QueueStatus::FAILED)
|
||||
<x-status status="danger">{{ $status }}</x-status>
|
||||
@endif
|
||||
@if($status == \App\Enums\QueueStatus::RESTARTING)
|
||||
<x-status status="warning">{{ $status }}</x-status>
|
||||
@endif
|
||||
@if($status == \App\Enums\QueueStatus::STARTING)
|
||||
<x-status status="warning">{{ $status }}</x-status>
|
||||
@endif
|
||||
@if($status == \App\Enums\QueueStatus::STOPPING)
|
||||
<x-status status="warning">{{ $status }}</x-status>
|
||||
@endif
|
||||
@if($status == \App\Enums\QueueStatus::STOPPED)
|
||||
<x-status status="danger">{{ $status }}</x-status>
|
||||
@endif
|
||||
@if($status == \App\Enums\QueueStatus::FAILED)
|
||||
<x-status status="danger">{{ $status }}</x-status>
|
||||
@endif
|
||||
@if($status == \App\Enums\QueueStatus::DELETING)
|
||||
<x-status status="danger">{{ $status }}</x-status>
|
||||
@endif
|
54
resources/views/livewire/queues/queues-list.blade.php
Normal file
54
resources/views/livewire/queues/queues-list.blade.php
Normal file
@ -0,0 +1,54 @@
|
||||
<div>
|
||||
<x-card-header>
|
||||
<x-slot name="title">{{ __("Queues") }}</x-slot>
|
||||
<x-slot name="description">{{ __("You can manage and create queues for your site") }}</x-slot>
|
||||
<x-slot name="aside">
|
||||
<livewire:queues.create-queue :site="$site" />
|
||||
</x-slot>
|
||||
</x-card-header>
|
||||
<div x-data="" class="space-y-3">
|
||||
@if(count($queues) > 0)
|
||||
@foreach($queues as $queue)
|
||||
<x-item-card>
|
||||
<div class="flex flex-grow flex-col items-start justify-center">
|
||||
<span class="mb-1 flex items-center lowercase text-red-600">
|
||||
{{ $queue->command }}
|
||||
</span>
|
||||
<span class="text-sm text-gray-400">
|
||||
{{ __("User:") }} {{ $queue->user }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
@include('livewire.queues.partials.status', ['status' => $queue->status])
|
||||
<div class="inline-flex">
|
||||
<x-icon-button wire:click="start({{ $queue }})" wire:loading.attr="disabled">
|
||||
<x-heroicon-o-play class="w-4 h-4" />
|
||||
</x-icon-button>
|
||||
<x-icon-button wire:click="stop({{ $queue }})" wire:loading.attr="disabled">
|
||||
<x-heroicon-o-stop class="w-4 h-4" />
|
||||
</x-icon-button>
|
||||
<x-icon-button wire:click="restart({{ $queue }})" wire:loading.attr="disabled">
|
||||
<x-heroicon-o-arrow-path class="w-4 h-4" />
|
||||
</x-icon-button>
|
||||
<x-icon-button x-on:click="$wire.deleteId = '{{ $queue->id }}'; $dispatch('open-modal', 'delete-queue')">
|
||||
<x-heroicon-o-trash class="w-4 h-4" />
|
||||
</x-icon-button>
|
||||
</div>
|
||||
</div>
|
||||
</x-item-card>
|
||||
@endforeach
|
||||
<x-confirm-modal
|
||||
name="delete-queue"
|
||||
:title="__('Confirm')"
|
||||
:description="__('Are you sure that you want to delete this queue?')"
|
||||
method="delete"
|
||||
/>
|
||||
@else
|
||||
<x-simple-card>
|
||||
<div class="text-center">
|
||||
{{ __("You don't have any queues yet!") }}
|
||||
</div>
|
||||
</x-simple-card>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user