You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/dist/core-recommendedapps.js

3 lines
9.7 KiB
JavaScript

/*! For license information please see core-recommendedapps.js.LICENSE.txt */
!function(){"use strict";var n,t={74151:function(n,t,e){var a,o=e(45994),i=e(9944),r=e(20144),s=e(17499),c=null===(a=(0,o.ts)())?(0,s.IY)().setApp("core").build():(0,s.IY)().setApp("core").setUid(a.uid).build(),l=e(4820),p=e(79753),d=e(79954),u=e(63560),f=e(10861),m=e.n(f);function g(n,t,e,a,o,i,r){try{var s=n[i](r),c=s.value}catch(n){return void e(n)}s.done?t(c):Promise.resolve(c).then(a,o)}var A={calendar:{description:(0,i.translate)("core","Schedule work & meetings, synced with all your devices."),icon:(0,p.imagePath)("core","places/calendar.svg")},contacts:{description:(0,i.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,i.translate)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,p.imagePath)("core","actions/mail.svg")},spreed:{description:(0,i.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:{name:"Nextcloud Office",description:(0,i.translate)("core","Collaborative documents, spreadsheets and presentations, built on Collabora Online."),icon:(0,p.imagePath)("core","apps/richdocuments.svg")},richdocumentscode:{hidden:!0}},h=Object.keys(A),v=(0,d.j)("core","defaultPageUrl"),C={name:"RecommendedApps",components:{NcButton:m()},data:function(){return{showInstallButton:!1,installingApps:!1,loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:v}},computed:{recommendedApps:function(){return this.apps.filter((function(n){return h.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 i=n.apply(t,e);function r(n){g(i,a,o,r,s,"next",n)}function s(n){g(i,a,o,r,s,"throw",n)}r(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=v})).catch((function(n){return c.error("could not install recommended apps",{error:n})}))},customIcon:function(n){return n in A&&A[n].icon?A[n].icon:(c.warn("no app icon for recommended app ".concat(n)),(0,p.imagePath)("core","places/default-app-icon.svg"))},customName:function(n){return n.id in A&&A[n.id].name||n.name},customDescription:function(n){return n in A?A[n].description:(c.warn("no app description for recommended app ".concat(n)),"")},isHidden:function(n){return n in A&&!!A[n].hidden},goTo:function(n){window.location.href=n}}},b=C,x=e(93379),w=e.n(x),_=e(7795),y=e.n(_),k=e(90569),P=e.n(k),I=e(3565),B=e.n(I),O=e(19216),j=e.n(O),D=e(44589),E=e.n(D),S=e(47041),T={};T.styleTagTransform=E(),T.setAttributes=B(),T.insert=P().bind(null,"h
//# sourceMappingURL=core-recommendedapps.js.map?v=09339f3f64a1ad114db6