mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
Make isWhiteboardEnabled an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
385eba66df
commit
462160aaa5
5 changed files with 10 additions and 24 deletions
|
|
@ -136,7 +136,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
|||
'is_nvidia_gpu_enabled' => $configurationManager->isNvidiaGpuEnabled(),
|
||||
'is_talk_recording_enabled' => $configurationManager->isTalkRecordingEnabled(),
|
||||
'is_docker_socket_proxy_enabled' => $configurationManager->isDockerSocketProxyEnabled(),
|
||||
'is_whiteboard_enabled' => $configurationManager->isWhiteboardEnabled(),
|
||||
'is_whiteboard_enabled' => $configurationManager->isWhiteboardEnabled,
|
||||
'community_containers' => $configurationManager->listAvailableCommunityContainers(),
|
||||
'community_containers_enabled' => $configurationManager->GetEnabledCommunityContainers(),
|
||||
'bypass_container_update' => $bypass_container_update,
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
continue;
|
||||
}
|
||||
} elseif ($entry['container_name'] === 'nextcloud-aio-whiteboard') {
|
||||
if (!$this->configurationManager->isWhiteboardEnabled()) {
|
||||
if (!$this->configurationManager->isWhiteboardEnabled) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -200,7 +200,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
continue;
|
||||
}
|
||||
} elseif ($value === 'nextcloud-aio-whiteboard') {
|
||||
if (!$this->configurationManager->isWhiteboardEnabled()) {
|
||||
if (!$this->configurationManager->isWhiteboardEnabled) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,11 +119,7 @@ readonly class ConfigurationController {
|
|||
} else {
|
||||
$this->configurationManager->SetDockerSocketProxyEnabledState(0);
|
||||
}
|
||||
if (isset($request->getParsedBody()['whiteboard'])) {
|
||||
$this->configurationManager->SetWhiteboardEnabledState(1);
|
||||
} else {
|
||||
$this->configurationManager->SetWhiteboardEnabledState(0);
|
||||
}
|
||||
$this->configurationManager->isWhiteboardEnabled = isset($request->getParsedBody()['whiteboard']);
|
||||
}
|
||||
|
||||
if (isset($request->getParsedBody()['community-form'])) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ class ConfigurationManager
|
|||
set { $this->set('password', $value); }
|
||||
}
|
||||
|
||||
public bool $isWhiteboardEnabled {
|
||||
get => $this->get('isWhiteboardEnabled', true);
|
||||
set { $this->set('isWhiteboardEnabled', $value); }
|
||||
}
|
||||
|
||||
public bool $restoreExcludePreviews {
|
||||
get => $this->get('restore-exclude-previews', false);
|
||||
set { $this->set('restore-exclude-previews', $value); }
|
||||
|
|
@ -207,21 +212,6 @@ class ConfigurationManager
|
|||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
public function isWhiteboardEnabled() : bool {
|
||||
$config = $this->GetConfig();
|
||||
if (isset($config['isWhiteboardEnabled']) && $config['isWhiteboardEnabled'] === 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function SetWhiteboardEnabledState(int $value) : void {
|
||||
$config = $this->GetConfig();
|
||||
$config['isWhiteboardEnabled'] = $value;
|
||||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
public function SetClamavEnabledState(int $value) : void {
|
||||
$config = $this->GetConfig();
|
||||
$config['isClamavEnabled'] = $value;
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ readonly class DockerActionManager {
|
|||
'AIO_DATABASE_HOST' => gethostbyname('nextcloud-aio-database'),
|
||||
// Allow to get local ip-address of caddy container and add it to trusted proxies automatically
|
||||
'CADDY_IP_ADDRESS' => in_array('caddy', $this->configurationManager->GetEnabledCommunityContainers(), true) ? gethostbyname('nextcloud-aio-caddy') : '',
|
||||
'WHITEBOARD_ENABLED' => $this->configurationManager->isWhiteboardEnabled() ? 'yes' : '',
|
||||
'WHITEBOARD_ENABLED' => $this->configurationManager->isWhiteboardEnabled ? 'yes' : '',
|
||||
default => $this->configurationManager->GetRegisteredSecret($placeholder),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue