162 lines
9.4 KiB
PHP
162 lines
9.4 KiB
PHP
<x-filament-panels::page>
|
|
<div class="mx-auto max-w-7xl space-y-3 text-xs">
|
|
<x-filament.components.page-breadcrumbs
|
|
:breadcrumbs="[
|
|
['label' => 'Supporto', 'url' => null],
|
|
['label' => 'Modifiche', 'url' => null],
|
|
]"
|
|
/>
|
|
|
|
<x-filament::section class="!p-4">
|
|
<div class="flex flex-wrap items-start justify-between gap-3">
|
|
<div class="space-y-1">
|
|
<div class="text-base font-semibold">NetGescon - Modifiche e Aggiornamenti</div>
|
|
<div class="text-xs text-gray-600">
|
|
Versione corrente: <span class="font-mono font-semibold">{{ $this->currentVersion }}</span>
|
|
<span class="ml-2 rounded bg-gray-100 px-1.5 py-0.5 text-[10px] uppercase">fonte {{ $this->versionSource }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-1 text-xs text-gray-600">
|
|
<div class="font-medium text-gray-700">Legenda rapida</div>
|
|
<div class="flex flex-wrap gap-3">
|
|
<span class="inline-flex items-center gap-2"><span class="inline-block h-2.5 w-2.5 rounded-sm bg-success-500"></span>U utenti finali</span>
|
|
<span class="inline-flex items-center gap-2"><span class="inline-block h-2.5 w-2.5 rounded-sm bg-primary-500"></span>P assistenza/sviluppo</span>
|
|
<span class="inline-flex items-center gap-2"><span class="inline-block h-2.5 w-2.5 rounded-sm bg-warning-500"></span>E non bloccante</span>
|
|
<span class="inline-flex items-center gap-2"><span class="inline-block h-2.5 w-2.5 rounded-sm bg-danger-500"></span>E! bloccante</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section class="!p-4">
|
|
<div class="grid gap-3 lg:grid-cols-3">
|
|
<div class="rounded-lg border bg-gray-50 p-3 lg:col-span-2">
|
|
<div class="mb-2 text-xs font-semibold text-gray-700">Aggiornamento da server distribution</div>
|
|
<div class="grid gap-2 sm:grid-cols-3">
|
|
<label class="block">
|
|
<span class="mb-1 block text-[11px] font-medium">Canale</span>
|
|
<select wire:model="updateChannel" class="w-full rounded-md border-gray-300 text-xs">
|
|
<option value="free">free</option>
|
|
<option value="licensed">licensed</option>
|
|
</select>
|
|
</label>
|
|
<label class="inline-flex items-center gap-2 rounded-md border bg-white px-2 py-1.5 text-[11px]">
|
|
<input type="checkbox" wire:model="updateDryRun" class="rounded border-gray-300" />
|
|
Dry run
|
|
</label>
|
|
<label class="inline-flex items-center gap-2 rounded-md border bg-white px-2 py-1.5 text-[11px]">
|
|
<input type="checkbox" wire:model="updateForce" class="rounded border-gray-300" />
|
|
Force
|
|
</label>
|
|
</div>
|
|
|
|
<div class="mt-3 flex flex-wrap gap-2">
|
|
<x-filament::button size="sm" wire:click="runUpdate" :disabled="!$this->canRunUpdate()">
|
|
Lancia aggiornamento
|
|
</x-filament::button>
|
|
<x-filament::button size="sm" color="gray" wire:click="reloadDashboardData">
|
|
Aggiorna dati pagina
|
|
</x-filament::button>
|
|
</div>
|
|
|
|
@if(! $this->canRunUpdate())
|
|
<div class="mt-2 text-[11px] text-amber-700">Permesso update non disponibile per il tuo ruolo.</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="rounded-lg border bg-white p-3">
|
|
<div class="text-xs font-semibold text-gray-700">Esito ultimo update</div>
|
|
<div class="mt-2 space-y-1 text-[11px] text-gray-600">
|
|
<div>Ultima esecuzione: <span class="font-medium">{{ $this->lastUpdateAt ?? '-' }}</span></div>
|
|
<div>
|
|
Exit code:
|
|
@if($this->lastUpdateExitCode === null)
|
|
<span class="font-medium">-</span>
|
|
@elseif($this->lastUpdateExitCode === 0)
|
|
<span class="rounded bg-emerald-100 px-1.5 py-0.5 font-semibold text-emerald-800">0 OK</span>
|
|
@else
|
|
<span class="rounded bg-rose-100 px-1.5 py-0.5 font-semibold text-rose-800">{{ $this->lastUpdateExitCode }} ERRORE</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if(filled($this->lastUpdateOutput))
|
|
<div class="mt-3 rounded-lg border bg-slate-950 p-3">
|
|
<div class="mb-1 text-[11px] font-semibold text-slate-200">Output tecnico</div>
|
|
<pre class="max-h-64 overflow-auto whitespace-pre-wrap text-[11px] leading-relaxed text-slate-100">{{ $this->lastUpdateOutput }}</pre>
|
|
</div>
|
|
@endif
|
|
</x-filament::section>
|
|
|
|
<x-filament::section class="!p-4">
|
|
<div class="mb-2 text-xs font-semibold text-gray-700">Ultimi commit (descrizioni)</div>
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full border-collapse border text-[11px]">
|
|
<thead>
|
|
<tr class="bg-slate-100 text-slate-700">
|
|
<th class="border px-2 py-1.5 text-left">Data</th>
|
|
<th class="border px-2 py-1.5 text-left">Commit</th>
|
|
<th class="border px-2 py-1.5 text-left">Autore</th>
|
|
<th class="border px-2 py-1.5 text-left">Descrizione</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($this->latestCommits as $commit)
|
|
<tr class="hover:bg-slate-50">
|
|
<td class="border px-2 py-1.5 whitespace-nowrap">{{ $commit['date'] }}</td>
|
|
<td class="border px-2 py-1.5 font-mono">{{ $commit['short_hash'] }}</td>
|
|
<td class="border px-2 py-1.5">{{ $commit['author'] }}</td>
|
|
<td class="border px-2 py-1.5">{{ $commit['message'] }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="4" class="border px-2 py-3 text-center text-gray-500">Nessun commit disponibile.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
@php
|
|
$path = base_path('docs/NETGESCON-MODIFICHE.md');
|
|
$raw = file_exists($path) ? file_get_contents($path) : "# Modifiche\n\nFile non trovato: {$path}\n";
|
|
|
|
$gitPath = base_path('docs/NETGESCON-GIT-AUTOCHANGELOG.md');
|
|
$gitRaw = file_exists($gitPath) ? file_get_contents($gitPath) : "# Git Auto Changelog\n\nFile non trovato: {$gitPath}\nEsegui: `bash scripts/ops/netgescon-sync-git-changelog.sh`\n";
|
|
|
|
// Mini-render: sostituisce tag tipo [U], [P], [E], [E!] con un quadratino colorato.
|
|
$replacements = [
|
|
'[E!]' => '<span class="inline-flex items-center gap-2"><span class="inline-block h-3 w-3 rounded-sm bg-danger-500"></span><span class="font-mono">E!</span></span>',
|
|
'[U]' => '<span class="inline-flex items-center gap-2"><span class="inline-block h-3 w-3 rounded-sm bg-success-500"></span><span class="font-mono">U</span></span>',
|
|
'[P]' => '<span class="inline-flex items-center gap-2"><span class="inline-block h-3 w-3 rounded-sm bg-primary-500"></span><span class="font-mono">P</span></span>',
|
|
'[E]' => '<span class="inline-flex items-center gap-2"><span class="inline-block h-3 w-3 rounded-sm bg-warning-500"></span><span class="font-mono">E</span></span>',
|
|
];
|
|
|
|
$rawHtml = \Illuminate\Support\Str::markdown($raw);
|
|
$rawHtml = str_replace(array_keys($replacements), array_values($replacements), $rawHtml);
|
|
|
|
$gitRawHtml = \Illuminate\Support\Str::markdown($gitRaw);
|
|
$gitRawHtml = str_replace(array_keys($replacements), array_values($replacements), $gitRawHtml);
|
|
@endphp
|
|
|
|
<x-filament::section class="!p-4">
|
|
<div class="mb-2 text-xs font-semibold text-gray-700">Registro funzionale (manuale)</div>
|
|
<div class="prose prose-sm max-w-none text-[11px] leading-relaxed">
|
|
{!! $rawHtml !!}
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section class="!p-4">
|
|
<div class="mb-2 text-xs font-semibold text-gray-700">Changelog automatico da script</div>
|
|
<div class="prose prose-sm max-w-none text-[11px] leading-relaxed">
|
|
{!! $gitRawHtml !!}
|
|
</div>
|
|
</x-filament::section>
|
|
</div>
|
|
</x-filament-panels::page>
|