add nextcloud shell

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Harivansh Rathi 2026-03-31 21:25:48 +00:00
parent 57f221fb72
commit eea46f28ad
9 changed files with 337 additions and 0 deletions

View file

@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace OCA\AinasControlplane\Settings;
use OCA\AinasControlplane\AppInfo\Application;
use OCA\AinasControlplane\Service\ControlPlaneClient;
use OCA\AinasControlplane\Service\ControlPlaneConfig;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
class Admin implements ISettings {
public function __construct(
private readonly ControlPlaneConfig $controlPlaneConfig,
private readonly ControlPlaneClient $controlPlaneClient,
) {
}
public function getForm(): TemplateResponse {
return new TemplateResponse(
Application::APP_ID,
'admin',
[
'controlPlaneUrl' => $this->controlPlaneConfig->getBaseUrl(),
'snapshot' => $this->controlPlaneClient->fetchSnapshot(),
],
);
}
public function getSection(): string {
return Application::APP_ID;
}
public function getPriority(): int {
return 50;
}
}

View file

@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace OCA\AinasControlplane\Settings;
use OCA\AinasControlplane\AppInfo\Application;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Settings\IIconSection;
class AdminSection implements IIconSection {
public function __construct(
private readonly IURLGenerator $urlGenerator,
private readonly IL10N $l,
) {
}
public function getID(): string {
return Application::APP_ID;
}
public function getName(): string {
return $this->l->t('aiNAS');
}
public function getPriority(): int {
return 50;
}
public function getIcon(): ?string {
return $this->urlGenerator->imagePath(Application::APP_ID, 'app-dark.svg');
}
}