added admin settings service and api; made filesystem paths configurable; added babel config; added admin settings webpack config
This commit is contained in:
parent
188ea3dfa9
commit
b79f6cab6b
12 changed files with 10224 additions and 32 deletions
47
lib/Controller/AdminSettingsController.php
Normal file
47
lib/Controller/AdminSettingsController.php
Normal 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));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue