mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-15 09:01:13 +00:00
rename3
This commit is contained in:
parent
c3b5332477
commit
c7560e1630
28 changed files with 95 additions and 95 deletions
43
apps/betternascontrolplane/lib/Controller/PageController.php
Normal file
43
apps/betternascontrolplane/lib/Controller/PageController.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\BetterNasControlplane\Controller;
|
||||
|
||||
use OCA\BetterNasControlplane\AppInfo\Application;
|
||||
use OCA\BetterNasControlplane\Service\ControlPlaneClient;
|
||||
use OCA\BetterNasControlplane\Service\ControlPlaneConfig;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\FrontpageRoute;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\Attribute\OpenAPI;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
class PageController extends Controller {
|
||||
public function __construct(
|
||||
IRequest $request,
|
||||
private readonly ControlPlaneClient $controlPlaneClient,
|
||||
private readonly ControlPlaneConfig $controlPlaneConfig,
|
||||
) {
|
||||
parent::__construct(Application::APP_ID, $request);
|
||||
}
|
||||
|
||||
#[NoCSRFRequired]
|
||||
#[NoAdminRequired]
|
||||
#[OpenAPI(OpenAPI::SCOPE_IGNORE)]
|
||||
#[FrontpageRoute(verb: 'GET', url: '/')]
|
||||
public function index(): TemplateResponse {
|
||||
return new TemplateResponse(
|
||||
Application::APP_ID,
|
||||
'index',
|
||||
[
|
||||
'appName' => 'betterNAS Control Plane',
|
||||
'controlPlaneUrl' => $this->controlPlaneConfig->getBaseUrl(),
|
||||
'snapshot' => $this->controlPlaneClient->fetchSnapshot(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue