diff --git a/js/script.js b/js/script.js index 52bcfffa..ba5ef1e3 100644 --- a/js/script.js +++ b/js/script.js @@ -317,19 +317,19 @@ function updateMonitoringUrl(event) { const url = new URL($endpointUrl.value) url.searchParams.delete('format') - url.searchParams.delete('skipUpdate') url.searchParams.delete('skipApps') + url.searchParams.delete('skipUpdate') for (const $param of $params) { if ($param.name === 'format_json' && $param.checked) { url.searchParams.set('format', 'json') } - if ($param.name === 'skip_update' && $param.checked) { - url.searchParams.set('skipUpdate', 'true') - } if ($param.name === 'skip_apps' && $param.checked) { url.searchParams.set('skipApps', 'true') } + if ($param.name === 'skip_update' && !$param.checked) { + url.searchParams.set('skipUpdate', 'false') + } } $endpointUrl.value = url.toString() diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 5824c1f2..5c5f3a73 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -113,7 +113,7 @@ private function checkAuthorized(): bool { * @PublicPage * @BruteForceProtection(action=serverinfo) */ - public function info(bool $skipUpdate = false, bool $skipApps = false): DataResponse { + public function info(bool $skipApps = false, bool $skipUpdate = true): DataResponse { if (!$this->checkAuthorized()) { $response = new DataResponse(['message' => 'Unauthorized']); $response->throttle(); @@ -122,7 +122,7 @@ public function info(bool $skipUpdate = false, bool $skipApps = false): DataResp } return new DataResponse([ 'nextcloud' => [ - 'system' => $this->systemStatistics->getSystemStatistics($skipUpdate, $skipApps), + 'system' => $this->systemStatistics->getSystemStatistics($skipApps, $skipUpdate), 'storage' => $this->storageStatistics->getStorageStatistics(), 'shares' => $this->shareStatistics->getShareStatistics() ], diff --git a/lib/SystemStatistics.php b/lib/SystemStatistics.php index 36985b08..c61e3ff0 100644 --- a/lib/SystemStatistics.php +++ b/lib/SystemStatistics.php @@ -51,7 +51,7 @@ public function __construct(IConfig $config, IAppManager $appManager, Installer * * @throws \OCP\Files\InvalidPathException */ - public function getSystemStatistics(bool $skipUpdate = false, bool $skipApps = false): array { + public function getSystemStatistics(bool $skipApps = false, bool $skipUpdate = true): array { $processorUsage = $this->getProcessorUsage(); $memoryUsage = $this->os->getMemory(); @@ -73,14 +73,14 @@ public function getSystemStatistics(bool $skipUpdate = false, bool $skipApps = f 'swap_free' => $memoryUsage->getSwapFree() * 1024, ]; - if (!$skipUpdate) { - $data['update'] = $this->getServerUpdateInfo(); - } - if (!$skipApps) { $data['apps'] = $this->getAppsInfo(); } + if (!$skipUpdate) { + $data['update'] = $this->getServerUpdateInfo(); + } + return $data; } diff --git a/templates/settings-admin.php b/templates/settings-admin.php index 474d5e70..2cd4516d 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -424,14 +424,14 @@ function FormatMegabytes(int $byte): string { -
- - -
+
+ + +