summaryrefslogtreecommitdiffstats
path: root/settings
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
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')
-rw-r--r--settings/src/components/appList/appItem.vue2
-rw-r--r--settings/src/store/apps.js26
2 files changed, 26 insertions, 2 deletions
diff --git a/settings/src/components/appList/appItem.vue b/settings/src/components/appList/appItem.vue
index 9c784c11de6..72cf8b4e3ee 100644
--- a/settings/src/components/appList/appItem.vue
+++ b/settings/src/components/appList/appItem.vue
@@ -65,7 +65,7 @@
<div class="actions">
<div class="warning" v-if="app.error">{{ app.error }}</div>
<div class="icon icon-loading-small" v-if="loading(app.id)"></div>
- <input v-if="app.update" class="update" type="button" :value="t('settings', 'Update to %s', app.update)" v-on:click="update(app.id)" :disabled="installing || loading(app.id)" />
+ <input v-if="app.update" class="update" type="button" :value="t('settings', 'Update to {update}', {update:app.update})" v-on:click="update(app.id)" :disabled="installing || loading(app.id)" />
<input v-if="app.canUnInstall" class="uninstall" type="button" :value="t('settings', 'Remove')" v-on:click="remove(app.id)" :disabled="installing || loading(app.id)" />
<input v-if="app.active" class="enable" type="button" :value="t('settings','Disable')" v-on:click="disable(app.id)" :disabled="installing || loading(app.id)" />
<input v-if="!app.active" class="enable" type="button" :value="enableButtonText" v-on:click="enable(app.id)" v-tooltip.auto="enableButtonTooltip" :disabled="!app.canInstall || installing || loading(app.id)" />
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 })