server/dist/core-recommendedapps.js

3 lines
8.2 KiB
JavaScript
Raw Normal View History

/*! For license information please see core-recommendedapps.js.LICENSE.txt */
(()=>{"use strict";var n,e={64810:(n,e,t)=>{var a=t(22200),o=t(79753),i=t(9944),r=t(20144),s=t(17499);const c=null===(p=(0,a.getCurrentUser)())?(0,s.getLoggerBuilder)().setApp("core").build():(0,s.getLoggerBuilder)().setApp("core").setUid(p.uid).build();var p,l=t(4820),d=t(16453),g=t(63560);const m={calendar:{description:(0,i.translate)("core","Schedule work & meetings, synced with all your devices."),icon:(0,o.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,o.imagePath)("core","places/contacts.svg")},mail:{description:(0,i.translate)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,o.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,o.imagePath)("core","apps/spreed.svg")},richdocuments:{description:(0,i.translate)("core","Collaboratively edit office documents."),icon:(0,o.imagePath)("core","apps/richdocuments.svg")},richdocumentscode:{description:(0,i.translate)("core","Local document editing back-end used by the Collabora Online app."),icon:(0,o.imagePath)("core","apps/richdocumentscode.svg")}},u=Object.keys(m),h=(0,d.loadState)("core","defaultPageUrl"),A={name:"RecommendedApps",data:()=>({loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:h}),computed:{recommendedApps(){return this.apps.filter((n=>u.includes(n.id)))}},mounted(){return l.default.get((0,o.generateUrl)("settings/apps/list")).then((n=>n.data)).then((n=>{c.info("".concat(n.apps.length," apps fetched")),this.apps=n.apps.map((n=>Object.assign(n,{loading:!1,installationError:!1}))),c.debug("".concat(this.recommendedApps.length," recommended apps found"),{apps:this.recommendedApps}),this.installApps()})).catch((n=>{c.error("could not fetch app list",{error:n}),this.loadingAppsError=!0})).then((()=>{this.loadingApps=!1}))},methods:{installApps(){const n=(0,g.Z)(1),e=this.recommendedApps.filter((n=>!n.active&&n.isCompatible&&n.canInstall)).map((e=>n((()=>(c.info("installing ".concat(e.id)),e.loading=!0,l.default.post((0,o.generateUrl)("settings/apps/enable"),{appIds:[e.id],groups:[]}).catch((n=>{c.error("could not install ".concat(e.id),{error:n}),e.installationError=!0})).then((()=>{c.info("installed ".concat(e.id)),e.loading=!1})))))));c.debug("installing ".concat(e.length," recommended apps")),Promise.all(e).then((()=>{c.info("all recommended apps installed, redirecting …"),window.location=h})).catch((n=>c.error("could not install recommended apps",{error:n})))},customIcon:n=>n in m&&m[n].icon?m[n].icon:(c.warn("no app icon for recommended app ".concat(n)),(0,o.imagePath)("core","places/default-app-icon.svg")),customDescription:n=>n in m?m[n].description:(c.warn("no app description for recommended app ".concat(n)),"")}};var f=t(93379),v=t.n(f),C=t(22487);v()(C.Z,{insert:"head",singleton:!1}),C.Z.locals;const b=(0,t(51900).Z)(A,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"body-login-container"},[t("h2",[n._v(n._s(n.t("core","Recommended apps")))]),n._v(" "),n.loadingApps?t("p",{staticClass:"loading text-center"},[n._v("\n\t\t"+n._s(n.t("core","Loading apps …"))+"\n\t")]):n.loadingAppsError?t("p",{staticClass:"loading-error text-center"},[n._v("\n\t\t"+n._s(n.t("core","Could not fetch list of apps from the App Store."))+"\n\t")]):t("p",{staticClass:"text-center"},[n._v("\n\t\t"+n._s(n.t("core","Installing apps …"))+"\n\t")]),n._v(" "),n._l(n.recommendedApps,(function(e){return t("div",{key:e.id,staticClass:"app"},[t("img",{attrs:{src:n.customIcon(e.id),alt:""}}),n._v(" "),t("div",{staticClass:"info"},[t("h3",[n._v("\n\t\t\t\t"+n._s(e.name)+"\n\t\t\t\t"),e.loading?t("span",{staticClass:"icon icon-loading-small-dark"}):e.active?t("span",{staticClass:"icon icon-checkmark-white"}):n._e()]),n._v(" "),t("p",{domProps:{innerHTML:n._s(n.customDescription(e.id))}}),n._v(" "),e.installationE
//# sourceMappingURL=core-recommendedapps.js.map?v=be7562e34233337cca99