feat: add Django backend foundation and Docker runtime

Add a Django admin-backed management layer for pobsync configs, runs,
snapshots, and schedules. Keep the existing CLI engine as the execution
source of truth, add import/run management commands, and provide SQLite
default plus optional MariaDB Docker Compose support.
This commit is contained in:
2026-05-19 04:48:13 +02:00
parent 27acd790bd
commit 1a51c3e448
23 changed files with 722 additions and 3 deletions

View File

@@ -0,0 +1,40 @@
from __future__ import annotations
from django.contrib import admin
from .models import BackupRun, GlobalConfig, HostConfig, ScheduleConfig, SnapshotRecord
@admin.register(GlobalConfig)
class GlobalConfigAdmin(admin.ModelAdmin):
list_display = ("name", "backup_root", "updated_at")
readonly_fields = ("created_at", "updated_at")
@admin.register(HostConfig)
class HostConfigAdmin(admin.ModelAdmin):
list_display = ("host", "address", "enabled", "updated_at")
list_filter = ("enabled",)
search_fields = ("host", "address")
readonly_fields = ("created_at", "updated_at")
@admin.register(BackupRun)
class BackupRunAdmin(admin.ModelAdmin):
list_display = ("host", "run_type", "status", "started_at", "ended_at", "snapshot_path")
list_filter = ("run_type", "status", "started_at")
search_fields = ("host__host", "snapshot_path")
@admin.register(SnapshotRecord)
class SnapshotRecordAdmin(admin.ModelAdmin):
list_display = ("host", "kind", "dirname", "status", "started_at")
list_filter = ("kind", "status", "started_at")
search_fields = ("host__host", "dirname", "path")
@admin.register(ScheduleConfig)
class ScheduleConfigAdmin(admin.ModelAdmin):
list_display = ("host", "cron_expr", "enabled", "prune", "updated_at")
list_filter = ("enabled", "prune")
search_fields = ("host__host", "cron_expr")