This commit is contained in:
JonatanRek 2024-09-25 22:09:17 +02:00
commit 0b29730e7f
6 changed files with 264 additions and 326 deletions

View File

@ -4,10 +4,14 @@
use SteelAnts\LaravelAuth\Traits\Authentication; use SteelAnts\LaravelAuth\Traits\Authentication;
class AuthController extends Controller
class AuthController
{ {
use Authentication; use Authentication;
protected string $redirectTo = "maintenance.planned"; protected string $redirectTo = "maintenance.planned";
public function __construct()
{
$this->middleware('auth')->only(['logout','root']);
}
} }

View File

@ -62,10 +62,12 @@ public function plannedDetailFinishPost(Request $request, MaintenanceHistory $ma
// } // }
foreach ($request->input('skippedHostsSummary') as $history_host_id => $summary) { if ($request->has('skippedHostsSummary')) {
$maintenance_history->historyHosts->find($history_host_id)->update([ foreach ($request->input('skippedHostsSummary') as $history_host_id => $summary) {
'summary' => $summary, $maintenance_history->historyHosts->find($history_host_id)->update([
]); 'summary' => $summary,
]);
}
} }
if ($request->has('skippedHostTasksSummary')) { if ($request->has('skippedHostTasksSummary')) {
@ -145,7 +147,7 @@ public function start(Request $request, MaintenanceHistory $maintenance_history)
} }
if ($createPeriode) { if ($createPeriode) {
for ($i=0; $i < count($timePeriodes); $i++) { for ($i = 0; $i < count($timePeriodes); $i++) {
unset($timePeriodes[$i]['every']); unset($timePeriodes[$i]['every']);
unset($timePeriodes[$i]['month']); unset($timePeriodes[$i]['month']);
unset($timePeriodes[$i]['dayofweek']); unset($timePeriodes[$i]['dayofweek']);

View File

@ -44,6 +44,7 @@ public function handle(): void
'start_at' => $nextRunTime, 'start_at' => $nextRunTime,
'guestor_id' => $maintenance->guestor_id, 'guestor_id' => $maintenance->guestor_id,
]); ]);
$maintenancePlanned->refresh(); $maintenancePlanned->refresh();
$hosts = $maintenance->hosts; $hosts = $maintenance->hosts;

557
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
<div> <div>
<x-form::form wire:submit.prevent="{{ $action }}"> <x-form::form wire:submit.prevent="{{ $action }}">
<x-form::input group-class="mb-3" type="text" wire:model="name" id="name" label="name" /> <x-form::input group-class="mb-3" type="text" wire:model="name" id="name" label="name" />
<x-form::select group-class="mb-3" wire:model="guestor_id" label="Livewire Select" :options="$guestor_available" placeholder="Select guestor..." /> <x-form::select group-class="mb-3" wire:model="guestor_id" label="Responsible User" :options="$guestor_available" placeholder="Select guestor..." />
<x-form::select group-class="mb-3" wire:model.live="blocking_maintenance_id" label="Livewire Select" :options="$maintenances_available" placeholder="Select blocking maintenance..." /> <x-form::select group-class="mb-3" wire:model.live="blocking_maintenance_id" label="Blocking Maintenance" :options="$maintenances_available" placeholder="Select blocking maintenance..." />
<x-form::quill group-class="mb-3" type="text" wire:model="description" id="description" label="description" /> <x-form::quill group-class="mb-3" type="text" wire:model="description" id="description" label="description" />
@if(empty($blocking_maintenance_id)) @if(empty($blocking_maintenance_id))
@ -12,7 +12,7 @@
@endif @endif
<x-form::input group-class="mb-3" type="text" wire:model="duration" id="duration" label="duration" help="in hours (60 minutes) maximum 24h" /> <x-form::input group-class="mb-3" type="text" wire:model="duration" id="duration" label="duration" help="in hours (60 minutes) maximum 24h" />
<x-form::select group-class="mb-3" wire:model.live="hosts" label="Livewire Select" :options="$hosts_available" placeholder="Select value..." multiple /> <x-form::select group-class="mb-3" wire:model.live="hosts" label="Hosts in Maintenance" :options="$hosts_available" placeholder="Select value..." multiple />
@foreach($hosts as $key => $host_id) @foreach($hosts as $key => $host_id)
<x-form::select group-class="mb-3" wire:key="{{ $host_id }}" wire:model="hosts_tasks.{{ $host_id }}" label="Select Tasks for Host {{ $hosts_available[$host_id] }}" :options="$hosts_tasks_available" placeholder="Select value..." multiple /> <x-form::select group-class="mb-3" wire:key="{{ $host_id }}" wire:model="hosts_tasks.{{ $host_id }}" label="Select Tasks for Host {{ $hosts_available[$host_id] }}" :options="$hosts_tasks_available" placeholder="Select value..." multiple />

View File

@ -1,9 +1,13 @@
<?php <?php
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
Route::auth(); Route::auth();
Route::get('/', function () { Route::get('/', function () {
if (Auth::check()){
return redirect()->route('maintenance.planned');
}
return redirect()->route('login'); return redirect()->route('login');
}); });