summaryrefslogtreecommitdiffstats
path: root/settings/src/store
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-05-30 11:56:32 +0200
committerJulius Härtl <jus@bitgrid.net>2018-06-06 11:40:09 +0200
commit5326ba00648949c535f009a72d8d8be4a544cac9 (patch)
treecafe57476f01bdcd462c7caba58824e127b8c03a /settings/src/store
parent52895cb41ef061900081e82f6232c417f2aa221b (diff)
downloadnextcloud-server-5326ba00648949c535f009a72d8d8be4a544cac9.tar.gz
nextcloud-server-5326ba00648949c535f009a72d8d8be4a544cac9.zip
Check for server health
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings/src/store')
-rw-r--r--settings/src/store/apps.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/settings/src/store/apps.js b/settings/src/store/apps.js
index eb584443935..f19f894309b 100644
--- a/settings/src/store/apps.js
+++ b/settings/src/store/apps.js
@@ -174,9 +174,33 @@ const actions = {
apps.forEach(_appId => {
context.commit('enableApp', {appId: _appId, groups: groups});
});
- return true;
+
+ // check for server health
+ return api.get(OC.generateUrl('apps/files'))
+ .then(() => {
+ if (response.data.update_required) {
+ OC.dialogs.info(
+ t(
+ 'settings',
+ 'The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds.'
+ ),
+ t('settings','App update'),
+ function () {
+ window.location.reload();
+ },
+ true
+ );
+ setTimeout(function() {
+ location.reload();
+ }, 5000);
+ }
+ })
+ .catch((error) => {
+ context.commit('setError', {appId: apps, error: t('settings', 'Error: This app can not be enabled because it makes the server unstable')});
+ });
})
.catch((error) => {
+ context.commit('setError', {appId: apps, error: t('settings', 'Error while enabling app')});
context.commit('stopLoading', apps);
context.commit('stopLoading', 'install');
context.commit('APPS_API_FAILURE', { appId, error })