i dont know

This commit is contained in:
Lars Behrends
2025-10-20 23:40:55 +02:00
parent 552bb72370
commit 73d8441787
33 changed files with 3079 additions and 69 deletions

View File

@@ -15,13 +15,13 @@ use App\Services\ExophaseSyncService;
use PDO;
use Slim\Views\Twig;
class AdminController extends Controller
class AdminController extends AdminBaseController
{
private PDO $pdo;
protected PDO $pdo;
public function __construct(PDO $pdo, Twig $view)
{
parent::__construct($view);
parent::__construct($pdo, $view);
$this->pdo = $pdo;
}
@@ -33,7 +33,7 @@ class AdminController extends Controller
$syncLogModel = new SyncLog($this->pdo);
$recentSyncs = SyncLog::getRecent($this->pdo, 10);
return $this->view->render($response, 'admin/index.twig', [
return $this->render($response, 'admin/index.twig', [
'title' => 'Admin Dashboard',
'sources' => $sources,
'recent_syncs' => $recentSyncs
@@ -119,14 +119,23 @@ class AdminController extends Controller
return min(100, round(($processed / $total) * 100, 2));
}
public function settings(Request $request, Response $response, $args)
{
return $this->render($response, 'admin/settings.twig', [
'title' => 'Admin Settings',
'current_route' => 'settings'
]);
}
public function sources(Request $request, Response $response, $args)
{
$sourceModel = new Source($this->pdo);
$sources = $sourceModel->findAll();
return $this->view->render($response, 'admin/sources.twig', [
return $this->render($response, 'admin/sources.twig', [
'title' => 'Source Management',
'sources' => $sources
'sources' => $sources,
'current_route' => 'sources'
]);
}