summaryrefslogtreecommitdiffstats
path: root/settings/src/components
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-05-29 22:40:31 +0200
committerJulius Härtl <jus@bitgrid.net>2018-06-06 11:40:09 +0200
commit127b21b493323034eff6944c0ec7a808529e7529 (patch)
treebec7b22ec6ea828b1716b39833ca447571bff67c /settings/src/components
parent5f8b935c8e44304db3d0d0caefbc78e503041bcf (diff)
downloadnextcloud-server-127b21b493323034eff6944c0ec7a808529e7529.tar.gz
nextcloud-server-127b21b493323034eff6944c0ec7a808529e7529.zip
Implement app bundle management
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings/src/components')
-rw-r--r--settings/src/components/appList.vue32
1 files changed, 31 insertions, 1 deletions
diff --git a/settings/src/components/appList.vue b/settings/src/components/appList.vue
index 78e6cdb5adf..36980f57085 100644
--- a/settings/src/components/appList.vue
+++ b/settings/src/components/appList.vue
@@ -113,10 +113,40 @@ export default {
},
useBundleView() {
return (this.category === 'app-bundles');
+ },
+ allBundlesEnabled() {
+ return function(id) {
+ console.log(this.bundleApps(id).filter(app => !app.active));
+ return this.bundleApps(id).filter(app => !app.active).length === 0;
+ }
+ },
+ bundleToggleText() {
+ return function(id) {
+ if (this.allBundlesEnabled(id)) {
+ return t('settings', 'Disable all');
+ }
+ return t('settings', 'Enable all');
+ }
}
},
methods: {
-
+ toggleBundle(id) {
+ if (this.allBundlesEnabled) {
+ return this.disableBundle(id);
+ }
+ return this.enableBundle(id);
+ },
+ enableBundle(id) {
+ let apps = this.bundleApps(id).map(app => app.id);
+ console.log(apps);
+ this.$store.dispatch('enableApp', { appId: apps, groups: [] })
+ .catch((error) => { console.log(error); OC.Notification.show(error)});
+ },
+ disableBundle(id) {
+ let apps = this.bundleApps(id).map(app => app.id);
+ this.$store.dispatch('disableApp', { appId: apps, groups: [] })
+ .catch((error) => { OC.Notification.show(error)});
+ }
},
}
</script>