From 7c4eb03bb2e30860c13ffe6cf6800b1e0cf00a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 26 May 2020 18:13:37 +0200 Subject: Show hint about missing capabilities endpoint connection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Controller/SettingsController.php | 6 ++++++ src/components/AdminSettings.vue | 3 +++ 2 files changed, 9 insertions(+) diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index e5a45dd8..ce73dd1d 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -194,6 +194,12 @@ class SettingsController extends Controller{ $this->capabilitiesService->clear(); $this->capabilitiesService->refetch(); + if ($this->capabilitiesService->getCapabilities() === []) { + return new JSONResponse([ + 'status' => 'error', + 'data' => ['message' => 'Failed to connect to the remote server', 'hint' => 'missing_capabilities'] + ], 500); + } $response = [ 'status' => 'success', diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index 6a2b1581..c0b0f345 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -443,6 +443,9 @@ export default { } catch (e) { console.error(e) this.serverError = SERVER_STATE_CONNECTION_ERROR + if (e.response.data.hint === 'missing_capabilities') { + OCP.Toast.warning('Could not connect to the /hosting/capabilities endpoint. Please check if your webserver configuration is up to date.') + } } this.checkIfDemoServerIsActive() }, -- cgit v1.2.3