Datensicherung, Footer, Update-Funktion, Docker-Setup
This commit is contained in:
@@ -22,7 +22,6 @@ tests
|
||||
# Docker selbst
|
||||
docker-compose*.yml
|
||||
Dockerfile
|
||||
docker/
|
||||
|
||||
# IDE
|
||||
.idea
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM php:8.5-fpm-bullseye
|
||||
FROM php:8.4-fpm-bullseye
|
||||
|
||||
# System-Abhängigkeiten
|
||||
RUN apt-get update && apt-get install -y \
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\View\View;
|
||||
|
||||
class BackupController extends Controller
|
||||
{
|
||||
public function index(): View
|
||||
{
|
||||
// Backup-Typen — hier später echte Einträge ergänzen
|
||||
$backupTypes = [
|
||||
// Beispiel-Struktur:
|
||||
// [
|
||||
// 'name' => 'Datenbank',
|
||||
// 'description' => 'MariaDB Vollbackup',
|
||||
// 'icon' => '🗄️',
|
||||
// 'last_run' => null,
|
||||
// 'status' => null,
|
||||
// ],
|
||||
];
|
||||
|
||||
// Backup-Logs — später aus DB oder Log-Dateien befüllen
|
||||
$logs = collect();
|
||||
|
||||
return view('backup.index', compact('backupTypes', 'logs'));
|
||||
}
|
||||
}
|
||||
@@ -75,11 +75,10 @@ CLONE_URL=$(echo "$GITEA_URL" | sed "s|https://|https://${GITEA_USER}:${GITEA_PA
|
||||
CLONE_URL="${CLONE_URL}/${GITEA_USER}/Network-MGMT.git"
|
||||
|
||||
echo ""
|
||||
echo -e "${Y}[1/4] Docker prüfen / installieren ...${NC}"
|
||||
if ! command -v docker &>/dev/null; then
|
||||
curl -fsSL https://get.docker.com | sh
|
||||
systemctl enable --now docker
|
||||
fi
|
||||
echo -e "${Y}[1/4] Docker installieren / aktualisieren ...${NC}"
|
||||
curl -fsSL https://get.docker.com | sh
|
||||
systemctl enable --now docker
|
||||
systemctl restart docker
|
||||
echo -e "${G} ✓ Docker: $(docker --version | awk '{print $3}' | tr -d ',')${NC}"
|
||||
|
||||
if ! docker compose version &>/dev/null 2>&1; then
|
||||
|
||||
@@ -3,6 +3,12 @@ events {
|
||||
}
|
||||
|
||||
http {
|
||||
# Extrahiert den Port aus dem Host-Header (z.B. 192.168.86.229:8080 → 8080)
|
||||
map $http_host $real_port {
|
||||
default 80;
|
||||
"~:(?<p>\d+)$" $p;
|
||||
}
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
@@ -28,6 +34,7 @@ http {
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SERVER_PORT $real_port;
|
||||
fastcgi_read_timeout 120;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,14 +34,23 @@
|
||||
|
||||
<div class="flex items-center justify-end mt-4">
|
||||
@if (Route::has('password.request'))
|
||||
<a class="underline text-sm text-gray-600 hover:text-gray-900 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" href="{{ route('password.request') }}">
|
||||
<a class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" href="{{ route('password.request') }}">
|
||||
{{ __('Forgot your password?') }}
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<x-primary-button class="ms-3">
|
||||
{{ __('Log in') }}
|
||||
Anmelden
|
||||
</x-primary-button>
|
||||
</div>
|
||||
|
||||
@if (Route::has('register'))
|
||||
<div class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-600 text-center">
|
||||
<a href="{{ route('register') }}"
|
||||
class="inline-block w-full text-center px-4 py-2 text-sm font-medium rounded-md border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition">
|
||||
Neuen Benutzer registrieren
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</form>
|
||||
</x-guest-layout>
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200">💾 Datensicherung</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-8">
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
|
||||
|
||||
{{-- Backup-Typen ------------------------------------------------}}
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg overflow-hidden">
|
||||
<div class="px-4 py-3 bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600 flex items-center justify-between">
|
||||
<span class="text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">
|
||||
Backup-Typen
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if(empty($backupTypes))
|
||||
<div class="px-4 py-12 text-center text-gray-400 dark:text-gray-500">
|
||||
<div class="text-4xl mb-3">💾</div>
|
||||
<p class="text-sm">Noch keine Backup-Typen konfiguriert.</p>
|
||||
<p class="text-xs mt-1">Hier werden später die verfügbaren Backup-Typen angezeigt.</p>
|
||||
</div>
|
||||
@else
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 p-4">
|
||||
@foreach($backupTypes as $type)
|
||||
<div class="border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex items-start gap-3">
|
||||
<div class="text-2xl">{{ $type['icon'] }}</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<p class="font-medium text-sm text-gray-900 dark:text-gray-100">{{ $type['name'] }}</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 mt-0.5">{{ $type['description'] }}</p>
|
||||
@if($type['last_run'])
|
||||
<p class="text-xs text-gray-400 mt-1">
|
||||
Zuletzt: {{ \Carbon\Carbon::parse($type['last_run'])->format('d.m.Y H:i') }}
|
||||
</p>
|
||||
@endif
|
||||
@if($type['status'])
|
||||
<span class="inline-block mt-1 px-2 py-0.5 text-xs rounded-full
|
||||
{{ $type['status'] === 'ok' ? 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400' : 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400' }}">
|
||||
{{ $type['status'] === 'ok' ? '✓ Erfolgreich' : '✗ Fehler' }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<button class="text-xs text-indigo-600 hover:underline whitespace-nowrap">
|
||||
Jetzt sichern
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Backup-Log --------------------------------------------------}}
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg overflow-hidden">
|
||||
<div class="px-4 py-3 bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600">
|
||||
<span class="text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">
|
||||
Backup-Protokoll
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if($logs->isEmpty())
|
||||
<div class="px-4 py-10 text-center text-gray-400 dark:text-gray-500 text-sm">
|
||||
Noch keine Backup-Einträge vorhanden.
|
||||
</div>
|
||||
@else
|
||||
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 text-sm">
|
||||
<thead class="bg-gray-50 dark:bg-gray-700">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Zeitpunkt</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Typ</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Status</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Größe</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Meldung</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
@foreach($logs as $log)
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700 transition">
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap">
|
||||
{{ \Carbon\Carbon::parse($log->created_at)->format('d.m.Y H:i') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-700 dark:text-gray-300">{{ $log->type }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="px-2 py-0.5 text-xs rounded-full
|
||||
{{ $log->status === 'success' ? 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400' : 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400' }}">
|
||||
{{ $log->status === 'success' ? '✓ OK' : '✗ Fehler' }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">{{ $log->size ?? '—' }}</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">{{ $log->message ?? '—' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -29,8 +29,8 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="font-sans antialiased">
|
||||
<div class="min-h-screen bg-gray-100 dark:bg-gray-900">
|
||||
<body class="font-sans antialiased min-h-screen flex flex-col bg-gray-100 dark:bg-gray-900">
|
||||
|
||||
@include('layouts.navigation')
|
||||
|
||||
<!-- Page Heading -->
|
||||
@@ -43,9 +43,15 @@
|
||||
@endisset
|
||||
|
||||
<!-- Page Content -->
|
||||
<main>
|
||||
<main class="flex-1">
|
||||
{{ $slot }}
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700">
|
||||
<div class="max-w-7xl mx-auto py-3 px-4 sm:px-6 lg:px-8 text-center text-xs text-gray-400 dark:text-gray-500">
|
||||
© {{ date('Y') }} MMS-Systemservice GmbH
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100">
|
||||
<div>
|
||||
<a href="/">
|
||||
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
|
||||
<x-application-logo style="width:400px;height:400px;" class="fill-current text-gray-500" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -83,6 +83,13 @@
|
||||
</x-slot>
|
||||
</x-dropdown>
|
||||
|
||||
{{-- Datensicherung --}}
|
||||
@role('admin')
|
||||
<x-nav-link :href="route('backup.index')" :active="request()->routeIs('backup.*')">
|
||||
💾 Datensicherung
|
||||
</x-nav-link>
|
||||
@endrole
|
||||
|
||||
{{-- Hilfe-Dropdown --}}
|
||||
<x-dropdown align="left" width="48">
|
||||
<x-slot name="trigger">
|
||||
@@ -190,6 +197,14 @@
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
|
||||
@role('admin')
|
||||
<div class="pt-2 pb-1 border-t border-gray-200">
|
||||
<x-responsive-nav-link :href="route('backup.index')" :active="request()->routeIs('backup.*')">
|
||||
💾 Datensicherung
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
@endrole
|
||||
|
||||
<div class="pt-2 pb-1 border-t border-gray-200">
|
||||
<div class="px-4 py-1 text-xs font-semibold text-gray-400 uppercase tracking-wider">Hilfe</div>
|
||||
<x-responsive-nav-link :href="route('help.manual')">
|
||||
|
||||
+11
-2
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\BackupController;
|
||||
use App\Http\Controllers\ProfileController;
|
||||
use App\Http\Controllers\HelpController;
|
||||
use App\Http\Controllers\NetworkController;
|
||||
@@ -10,7 +11,7 @@ use App\Http\Controllers\Admin\UpdateController as AdminUpdateController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('welcome');
|
||||
return redirect()->route('login');
|
||||
});
|
||||
|
||||
Route::get('/dashboard', function () {
|
||||
@@ -79,12 +80,20 @@ Route::prefix('network')
|
||||
|
||||
// Import
|
||||
Route::get('/import', [NetworkController::class, 'showImport'])->name('import');
|
||||
Route::post('/import', [NetworkController::class, 'import'])->name('import');
|
||||
Route::post('/import', [NetworkController::class, 'import'])->name('import.store');
|
||||
|
||||
// Scan-Detail
|
||||
Route::get('/scans/{scan}', [NetworkController::class, 'scan'])->name('scan');
|
||||
});
|
||||
|
||||
// Datensicherung – nur für Admins
|
||||
Route::prefix('backup')
|
||||
->name('backup.')
|
||||
->middleware(['auth', 'role:admin'])
|
||||
->group(function () {
|
||||
Route::get('/', [BackupController::class, 'index'])->name('index');
|
||||
});
|
||||
|
||||
// Hilfe-Bereich – für alle eingeloggten Benutzer
|
||||
Route::prefix('help')
|
||||
->name('help.')
|
||||
|
||||
Reference in New Issue
Block a user