Fixes
This commit is contained in:
parent
ecb255fc6a
commit
866eee5b16
@ -14,10 +14,16 @@ class DatabaseSeeder extends Seeder
|
|||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
// User::factory(10)->create();
|
// User::factory(10)->create();
|
||||||
|
if (empty(User::where('email', 'test@example.co')->first())){
|
||||||
User::factory()->create([
|
User::factory()->create([
|
||||||
'name' => 'Test User',
|
'name' => 'Test User',
|
||||||
'email' => 'test@example.com',
|
'email' => 'test@example.com',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->call([
|
||||||
|
HostSeeder::class,
|
||||||
|
TaskSeeder::class,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
22
database/seeders/HostSeeder.php
Normal file
22
database/seeders/HostSeeder.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\Host;
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class HostSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
foreach (['IT-PRG-DOCKER', 'IT-PRG-DOCKER02', 'CK-PRG-DOCKER01'] as $hostname) {
|
||||||
|
Host::create([
|
||||||
|
'hostname' => $hostname,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
23
database/seeders/TaskSeeder.php
Normal file
23
database/seeders/TaskSeeder.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\Task;
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class TaskSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
foreach (['Update Zabbixu', 'Instalace Aktualizací', 'Kontrola Logu'] as $name) {
|
||||||
|
Task::create([
|
||||||
|
'name' => $name,
|
||||||
|
'description' => $name,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
<h1>{{ __('Planned Maintenance') }}</h1>
|
<h1>{{ __('Planned Maintenance') }}</h1>
|
||||||
</div>
|
</div>
|
||||||
<p>{!! $maintenance_history->maintenance->description !!}</p>
|
<p>{!! $maintenance_history->maintenance->description !!}</p>
|
||||||
|
<x-form::form action="save" method="PUT">
|
||||||
@foreach ($maintenance_history->historyHosts as $historyHost)
|
@foreach ($maintenance_history->historyHosts as $historyHost)
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="btn-toggle btn py-3 w-100 bg-primary text-start" style="--bs-bg-opacity: .2;" data-bs-toggle="collapse" data-bs-target="#collapse{{ $historyHost->id }}">
|
<div class="btn-toggle btn py-3 w-100 bg-primary text-start" style="--bs-bg-opacity: .2;" data-bs-toggle="collapse" data-bs-target="#collapse{{ $historyHost->id }}">
|
||||||
@ -12,12 +13,14 @@
|
|||||||
<div class="collapse" id="collapse{{ $historyHost->id }}">
|
<div class="collapse" id="collapse{{ $historyHost->id }}">
|
||||||
<div class="card card-body mt-2">
|
<div class="card card-body mt-2">
|
||||||
@foreach ($historyHost->historyTasks as $historyTasks)
|
@foreach ($historyHost->historyTasks as $historyTasks)
|
||||||
<x-form::checkbox wire:model="test" label="{{$historyTasks->maintenanceTask->task->name}}"/>
|
<x-form::checkbox wire:model="test" label="{{$historyTasks->maintenanceTask->task->name}}" />
|
||||||
{!! $historyTasks->maintenanceTask->task->description !!}
|
<p>{!! $historyTasks->maintenanceTask->task->description !!}</p>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
<x-form::button class="btn-primary" type="submit">{{ __('Ukončit')}}</x-form::button>
|
||||||
|
</x-form::form>
|
||||||
</div>
|
</div>
|
||||||
</x-layout-app>
|
</x-layout-app>
|
@ -1,8 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Jobs\ScheduleNextMaintenance;
|
||||||
use Illuminate\Foundation\Inspiring;
|
use Illuminate\Foundation\Inspiring;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
use Illuminate\Support\Facades\Schedule;
|
||||||
|
|
||||||
Artisan::command('inspire', function () {
|
// Artisan::command('inspire', function () {
|
||||||
$this->comment(Inspiring::quote());
|
// $this->comment(Inspiring::quote());
|
||||||
})->purpose('Display an inspiring quote')->hourly();
|
// })->purpose('Display an inspiring quote')->hourly();
|
||||||
|
|
||||||
|
Schedule::job(new ScheduleNextMaintenance())->daily()->withoutOverlapping();
|
Loading…
Reference in New Issue
Block a user