Can now get channels!
- Inject LoggerInterface across WebhookController, TalkService, and ImageCleanup - Replace TalkService.getAvailableTalkRooms() OCS API calls with direct database queries - Add getBaseUrl() helper to resolve localhost/SSRF constraints for internal API calls - Update buildRichObject() to generate public link shares for file attachments - Add saveBotPassword, debug, and debugTables endpoints to WebhookController - Separate frontend assets (JS/CSS) from adminSettings template - Add composer.json and autoload files for PSR-4 autoloading - Update Admin settings to use TemplateResponse and register app icons
This commit is contained in:
+15
-8
@@ -3,6 +3,7 @@
|
||||
namespace OCA\NCdiscordhook\Settings;
|
||||
|
||||
use OCA\NCdiscordhook\Service\TalkService;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IL10N;
|
||||
use OCP\Settings\ISettings;
|
||||
|
||||
@@ -15,7 +16,10 @@ class Admin implements ISettings {
|
||||
$this->l10n = $l10n;
|
||||
}
|
||||
|
||||
public function getForm(): string {
|
||||
public function getForm(): TemplateResponse {
|
||||
\OCP\Util::addStyle('ncdiscordhook', 'adminSettings');
|
||||
\OCP\Util::addScript('ncdiscordhook', 'settings');
|
||||
|
||||
$params = [
|
||||
'hasBotPassword' => $this->talkService->hasBotPassword(),
|
||||
'retentionDays' => $this->talkService->getRetentionDays(),
|
||||
@@ -23,12 +27,8 @@ class Admin implements ISettings {
|
||||
'authTokens' => $this->talkService->getAuthTokens(),
|
||||
];
|
||||
|
||||
$template = \OC::$server->get(\OCP\ITemplate\ITemplateFactory::class)->load('ncdiscordhook', 'adminSettings');
|
||||
foreach ($params as $key => $value) {
|
||||
$template->assign($key, $value);
|
||||
}
|
||||
|
||||
return $template->fetchPage();
|
||||
$response = new TemplateResponse('ncdiscordhook', 'adminSettings', $params);
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function getPriority(): int {
|
||||
@@ -36,6 +36,13 @@ class Admin implements ISettings {
|
||||
}
|
||||
|
||||
public function getSection(): string {
|
||||
return 'server';
|
||||
return 'additional';
|
||||
}
|
||||
|
||||
public function getIcons(): array {
|
||||
$urlGenerator = \OC::$server->get(\OCP\IURLGenerator::class);
|
||||
return [
|
||||
$urlGenerator->imagePath('ncdiscordhook', 'app.svg'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user