mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
i dont know
This commit is contained in:
@@ -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'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user