You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
10 KiB

  1. /*! For license information please see core-recommendedapps.js.LICENSE.txt */
  2. !function(){"use strict";var n,t={68241:function(n,t,e){var a,o=e(22200),r=e(9944),i=e(20144),s=e(17499),c=null===(a=(0,o.getCurrentUser)())?(0,s.getLoggerBuilder)().setApp("core").build():(0,s.getLoggerBuilder)().setApp("core").setUid(a.uid).build(),l=e(4820),p=e(79753),d=e(16453),u=e(72260),f=e(93379),g=e.n(f),m=e(30472),A=(g()(m.Z,{insert:"head",singleton:!1}),m.Z.locals,e(51900)),h=(0,A.Z)({name:"InstallButton"},(function(){var n=this,t=n.$createElement;return(n._self._c||t)("button",n._g({staticClass:"primary",attrs:{autofocus:!0}},n.$listeners),[n._v("\n\t"+n._s(n.t("core","Install recommended apps"))+"\n")])}),[],!1,null,"104c4a0f",null).exports;function v(n,t,e,a,o,r,i){try{var s=n[r](i),c=s.value}catch(n){return void e(n)}s.done?t(c):Promise.resolve(c).then(a,o)}var C={calendar:{description:(0,r.translate)("core","Schedule work & meetings, synced with all your devices."),icon:(0,p.imagePath)("core","places/calendar.svg")},contacts:{description:(0,r.translate)("core","Keep your colleagues and friends in one place without leaking their private info."),icon:(0,p.imagePath)("core","places/contacts.svg")},mail:{description:(0,r.translate)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,p.imagePath)("core","actions/mail.svg")},spreed:{description:(0,r.translate)("core","Chatting, video calls, screensharing, online meetings and web conferencing – in your browser and with mobile apps."),icon:(0,p.imagePath)("core","apps/spreed.svg")},richdocuments:{description:(0,r.translate)("core","Collaboratively edit office documents."),icon:(0,p.imagePath)("core","apps/richdocuments.svg")},richdocumentscode:{description:(0,r.translate)("core","Local document editing back-end used by the Collabora Online app."),icon:(0,p.imagePath)("core","apps/richdocumentscode.svg")}},b=Object.keys(C),x=(0,d.loadState)("core","defaultPageUrl"),_={name:"RecommendedApps",components:{InstallButton:h},data:function(){return{showInstallButton:!1,installingApps:!1,loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:x}},computed:{recommendedApps:function(){return this.apps.filter((function(n){return b.includes(n.id)}))}},mounted:function(){var n,t=this;return(n=regeneratorRuntime.mark((function n(){var e,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,l.default.get((0,p.generateUrl)("settings/apps/list"));case 3:e=n.sent,a=e.data,c.info("".concat(a.apps.length," apps fetched")),t.apps=a.apps.map((function(n){return Object.assign(n,{loading:!1,installationError:!1})})),c.debug("".concat(t.recommendedApps.length," recommended apps found"),{apps:t.recommendedApps}),t.showInstallButton=!0,n.next=15;break;case 11:n.prev=11,n.t0=n.catch(0),c.error("could not fetch app list",{error:n.t0}),t.loadingAppsError=!0;case 15:return n.prev=15,t.loadingApps=!1,n.finish(15);case 18:case"end":return n.stop()}}),n,null,[[0,11,15,18]])})),function(){var t=this,e=arguments;return new Promise((function(a,o){var r=n.apply(t,e);function i(n){v(r,a,o,i,s,"next",n)}function s(n){v(r,a,o,i,s,"throw",n)}i(void 0)}))})()},methods:{installApps:function(){this.showInstallButton=!1,this.installingApps=!0;var n=(0,u.Z)(1),t=this.recommendedApps.filter((function(n){return!n.active&&n.isCompatible&&n.canInstall})).map((function(t){return n((function(){return c.info("installing ".concat(t.id)),t.loading=!0,l.default.post((0,p.generateUrl)("settings/apps/enable"),{appIds:[t.id],groups:[]}).catch((function(n){c.error("could not install ".concat(t.id),{error:n}),t.installationError=!0})).then((function(){c.info("installed ".concat(t.id)),t.loading=!1}))}))}));c.debug("installing ".concat(t.length," recommended apps")),Promise.all(t).then((function(){c.info("all recommended apps installed, redirecting …"),window.location=x})).catch((function(n){return c.error("could not install recommended apps",{error:n})}))},customIcon:function(n){return n in C&&C[n].icon?C[n].icon:(c.warn("no app icon for recommended app ".concat(n)),(0,p.imagePath)("core","places/default-app-icon.svg"))},customDesc
  3. //# sourceMappingURL=core-recommendedapps.js.map?v=5a00b2fe80f32f2e895a