added admin settings service and api; made filesystem paths configurable; added babel config; added admin settings webpack config

This commit is contained in:
Jonathan Treffler 2024-04-23 19:51:41 +02:00 committed by root
parent 188ea3dfa9
commit b79f6cab6b
12 changed files with 10224 additions and 32 deletions

View file

@ -0,0 +1,47 @@
<?php
namespace OCA\GroupfolderFilesystemSnapshots\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCA\GroupfolderFilesystemSnapshots\AppInfo\Application;
use OCA\GroupfolderFilesystemSnapshots\Service\SettingsService;
class AdminSettingsController extends Controller {
public function __construct(
private SettingsService $settingsService,
) {
parent::__construct(
Application::APP_ID,
\OC::$server->get(IRequest::class),
);
}
/**
* @return JSONResponse
*/
public function index(): JSONResponse {
return new JSONResponse($this->settingsService->getAppValues());
}
/**
* @param $key
*
* @return JSONResponse
*/
public function show($key): JSONResponse {
return new JSONResponse($this->settingsService->getAppValue($key));
}
/**
* @param $key
* @param $value
*
* @return JSONResponse
*/
public function update($key, $value): JSONResponse {
return new JSONResponse($this->settingsService->setAppValue($key, $value));
}
}