Initial commit

This commit is contained in:
2026-09-03 12:21:17 +02:00
commit 6d40da0410
155 changed files with 21554 additions and 0 deletions
@@ -0,0 +1,46 @@
<x-app-layout :active="'aggregates.index'" title="SoftSPM 2 - Przypisanie silników">
<div class="max-w-3xl space-y-stack-gap">
<div class="flex items-center gap-2">
<a href="{{ route('aggregates.show', $pump) }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Silniki dla pompy: {{ $pump->PUP_NAME }}</h1>
</div>
<form method="POST" action="{{ route('aggregates.update', $pump) }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
@csrf
@method('PUT')
<table class="w-full text-left">
<thead class="bg-secondary/10 border-b border-outline-variant/40">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-4 py-2 w-12"></th>
<th class="px-4 py-2">Typ silnika</th>
<th class="px-4 py-2 text-right">Napięcie [V]</th>
<th class="px-4 py-2 text-right">Moc [kW]</th>
<th class="px-4 py-2">Producent</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@foreach ($allEngines as $e)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-2">
<input type="checkbox" name="engines[]" value="{{ $e->ENG_ID }}"
{{ in_array((int) $e->ENG_ID, $assigned, true) ? 'checked' : '' }}
class="w-4 h-4 accent-secondary">
</td>
<td class="px-4 py-2 font-semibold text-on-surface">{{ $e->ENG_NAME }}</td>
<td class="px-4 py-2 text-right font-data-label">{{ $e->ENG_VOLTAGE }}</td>
<td class="px-4 py-2 text-right font-data-label">{{ $e->ENG_POWER }}</td>
<td class="px-4 py-2">{{ $e->manufacturer?->MCF_NAME }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="flex items-center gap-2 p-card-inner-padding border-t border-outline-variant/40">
<button type="submit" class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">Zapisz</button>
<a href="{{ route('aggregates.show', $pump) }}" class="px-5 py-2.5 rounded-full font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">Anuluj</a>
</div>
</form>
</div>
</x-app-layout>
@@ -0,0 +1,79 @@
<x-app-layout :active="'aggregates.index'" title="SoftSPM 2 - Katalog agregatow">
@php $fmt = fn ($v, $d = 3) => $v === null ? '-' : number_format(round((float) $v, $d), $d, ',', ' '); @endphp
<div class="space-y-stack-gap">
@if (session('status'))
<div class="status-chip-ok px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ session('status') }}</div>
@endif
<div>
<h1 class="font-headline-lg text-headline-lg text-on-surface">Katalog agregatow</h1>
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">Wynikow: <span class="font-data-label">{{ $aggregates->total() }}</span></p>
</div>
{{-- Wyszukiwarka pomp --}}
<form method="GET" action="{{ route('aggregates.index') }}"
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<div class="flex flex-wrap items-end gap-4">
<div class="space-y-1">
<label for="by" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Kryterium</label>
<select id="by" name="by" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="name" {{ $by === 'name' ? 'selected' : '' }}>Typ pompy</option>
<option value="flow" {{ $by === 'flow' ? 'selected' : '' }}>Wydajnosc Q</option>
</select>
</div>
<div class="space-y-1">
<label for="q" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Szukaj</label>
<input id="q" name="q" type="text" value="{{ $q }}" placeholder="typ lub Q"
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
</div>
<div class="space-y-1">
<label for="mcf" class="font-data-label text-data-label text-on-surface-variant tracking-wide">Producent</label>
<select id="mcf" name="mcf" class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded font-data-label text-on-surface">
<option value="{{ $mcfAll }}" {{ (int) $mcf === $mcfAll ? 'selected' : '' }}>Wszyscy</option>
@foreach ($manufacturers as $id => $name)
<option value="{{ $id }}" {{ (int) $mcf === (int) $id ? 'selected' : '' }}>{{ $name }}</option>
@endforeach
</select>
</div>
<button type="submit" class="bg-secondary text-on-secondary px-5 py-2.5 rounded-full font-title-sm text-title-sm hover:opacity-90 active:scale-95 transition-all">Szukaj</button>
</div>
</form>
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
<table class="w-full text-left">
<thead class="bg-secondary/10 border-b border-outline-variant/40">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-4 py-3 w-12">Lp.</th>
<x-sortable-th column="name">Typ pompy</x-sortable-th>
<x-sortable-th column="flow" align="right">Q<sub>n</sub> [m³/h]</x-sortable-th>
<x-sortable-th column="mcf">Producent</x-sortable-th>
<x-sortable-th column="engines" align="right">Silniki</x-sortable-th>
<th class="px-4 py-3 text-right">Akcje</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@forelse ($aggregates as $a)
<tr class="hover:bg-surface-container transition-colors">
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $aggregates->firstItem() + $loop->index }}.</td>
<td class="px-4 py-3 font-semibold text-on-surface">
<a href="{{ route('aggregates.show', $a) }}" class="hover:text-primary">{{ $a->PUP_NAME }}</a>
</td>
<td class="px-4 py-3 text-right font-data-label">{{ $fmt($a->PUP_Q_N) }}</td>
<td class="px-4 py-3">{{ $a->manufacturer?->MCF_NAME }}</td>
<td class="px-4 py-3 text-right font-data-label">{{ $a->engines_count }}</td>
<td class="px-4 py-3 text-right">
<a href="{{ route('aggregates.show', $a) }}" class="font-body-sm text-body-sm text-secondary hover:underline">Szczegoly</a>
</td>
</tr>
@empty
<tr><td colspan="6" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">Brak pomp dla wybranych kryteriow.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div>{{ $aggregates->links() }}</div>
</div>
</x-app-layout>
@@ -0,0 +1,96 @@
<x-app-layout :active="'aggregates.index'" title="SoftSPM 2 - Agregat {{ $pump->PUP_NAME }}">
@php $fmt = fn ($v, $d = 2) => $v === null ? '-' : number_format(round((float) $v, $d), $d, ',', ' '); @endphp
<div class="space-y-stack-gap">
@if (session('status'))
<div class="status-chip-ok px-3 py-2 rounded-lg font-body-sm text-body-sm">{{ session('status') }}</div>
@endif
<div class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<a href="{{ route('aggregates.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Katalog agregatow</a>
<h1 class="font-headline-lg text-headline-lg text-on-surface">{{ $pump->PUP_NAME }}</h1>
</div>
<a href="{{ route('aggregates.edit', $pump) }}"
class="bg-secondary text-on-secondary px-4 py-2 rounded-full font-title-sm text-title-sm hover:opacity-90 active:scale-95 transition-all">Przypisz silniki</a>
</div>
{{-- Wykresy --}}
<div class="grid grid-cols-1 md:grid-cols-2 gap-stack-gap">
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Wysokosc podnoszenia</h2>
@if ($hDrawable)
<x-pump-curve :plot="$hPlot" x-label="Q [m³/h]" y-label="H [m]" />
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak parametrow energetycznych dla pompy.</p>
@endif
</div>
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary mb-2">Sprawnosc</h2>
@if ($etaDrawable)
<x-pump-curve :plot="$etaPlot" x-label="Q [m³/h]" y-label="η [-]" />
@else
<p class="font-body-sm text-body-sm text-on-surface-variant py-6 text-center">Brak parametrow energetycznych dla pompy.</p>
@endif
</div>
</div>
{{-- Silniki dla pompy (kolumny wg oryginalu: Typ silnika / Napiecie / Producent) --}}
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
<div class="px-card-inner-padding pt-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-tertiary">Lista silnikow dla pompy: {{ $pump->PUP_NAME }}</h2>
</div>
<table class="w-full text-left mt-2">
<thead class="bg-secondary/10 border-y border-outline-variant/40">
<tr class="font-data-label text-data-label text-on-surface-variant tracking-wide">
<th class="px-4 py-2">Typ silnika</th>
<th class="px-4 py-2 text-right">Napiecie [V]</th>
<th class="px-4 py-2">Producent</th>
</tr>
</thead>
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
@forelse ($engines as $e)
<tr class="cursor-pointer transition-colors {{ $engine && $engine->ENG_ID === $e->ENG_ID ? 'bg-secondary-container/60' : 'hover:bg-surface-container' }}"
onclick="location.href='{{ route('aggregates.show', ['pump' => $pump->PUP_ID, 'engine' => $e->ENG_ID]) }}'">
<td class="px-4 py-2 font-semibold text-on-surface">{{ $e->ENG_NAME }}</td>
<td class="px-4 py-2 text-right font-data-label">{{ $e->ENG_VOLTAGE }}</td>
<td class="px-4 py-2">{{ $e->MCF_NAME }}</td>
</tr>
@empty
<tr><td colspan="3" class="px-4 py-4 text-center font-body-sm text-on-surface-variant">Brak przypisanych silnikow - kliknij "Przypisz silniki".</td></tr>
@endforelse
</tbody>
</table>
</div>
{{-- Karta zestawu pompa + silnik --}}
@if ($engine)
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
<h2 class="font-title-sm text-title-sm text-primary mb-3">{{ $pump->PUP_NAME }} + {{ $engine->ENG_NAME }}</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-6">
<a href="{{ route('pumps.show', $pump) }}" class="block group">
<p class="font-data-label text-data-label text-on-surface-variant tracking-wide mb-2 group-hover:text-primary">Pompa →</p>
<dl class="grid grid-cols-2 gap-y-1 font-body-md text-body-md">
<dt class="text-on-surface-variant">Typ pompy</dt><dd class="font-semibold">{{ $pump->PUP_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd>{{ $pump->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="text-on-surface-variant">Q<sub>n</sub> [m³/h]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_Q_N, 3) }}</dd>
<dt class="text-on-surface-variant">H<sub>p</sub> [m]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_H_P) }}</dd>
<dt class="text-on-surface-variant">η<sub>max</sub> [-]</dt><dd class="font-data-label">{{ $fmt($pump->PUP_ETA_MAX) }}</dd>
</dl>
</a>
<a href="{{ route('engines.show', $engine) }}" class="block group">
<p class="font-data-label text-data-label text-on-surface-variant tracking-wide mb-2 group-hover:text-primary">Silnik →</p>
<dl class="grid grid-cols-2 gap-y-1 font-body-md text-body-md">
<dt class="text-on-surface-variant">Typ silnika</dt><dd class="font-semibold">{{ $engine->ENG_NAME }}</dd>
<dt class="text-on-surface-variant">Producent</dt><dd>{{ $engine->manufacturer?->MCF_NAME ?? '-' }}</dd>
<dt class="text-on-surface-variant">Napiecie [V]</dt><dd class="font-data-label">{{ $engine->ENG_VOLTAGE ?? '-' }}</dd>
<dt class="text-on-surface-variant">Moc [kW]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_POWER) }}</dd>
<dt class="text-on-surface-variant">Sprawnosc η [-]</dt><dd class="font-data-label">{{ $fmt($engine->ENG_ETA) }}</dd>
</dl>
</a>
</div>
</div>
@endif
</div>
</x-app-layout>