123 |
- /*! For license information please see core-recommendedapps.js.LICENSE.txt */
- (()=>{"use strict";var t,n={13421:(t,n,e)=>{var a=e(45994),o=e(31352),i=e(20144),s=e(17499);const r=null===(c=(0,a.ts)())?(0,s.IY)().setApp("core").build():(0,s.IY)().setApp("core").setUid(c.uid).build();var c,l=e(4820),p=e(79753),d=e(79954),u=e(63560),g=e(10861),m=e.n(g);const f={calendar:{description:(0,o.Iu)("core","Schedule work & meetings, synced with all your devices."),icon:(0,p.imagePath)("core","places/calendar.svg")},contacts:{description:(0,o.Iu)("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,o.Iu)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,p.imagePath)("core","actions/mail.svg")},spreed:{description:(0,o.Iu)("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,o.Iu)("core","Collaborative documents, spreadsheets and presentations, built on Collabora Online."),icon:(0,p.imagePath)("core","apps/richdocuments.svg")},notes:{description:(0,o.Iu)("core","Distraction free note taking app."),icon:(0,p.imagePath)("core","apps/notes.svg")},richdocumentscode:{hidden:!0}},A=Object.keys(f),h=(0,d.j)("core","defaultPageUrl"),v={name:"RecommendedApps",components:{NcButton:m()},data:()=>({showInstallButton:!1,installingApps:!1,loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:h}),computed:{recommendedApps(){return this.apps.filter((t=>A.includes(t.id)))}},async mounted(){try{const{data:t}=await l.default.get((0,p.generateUrl)("settings/apps/list"));r.info("".concat(t.apps.length," apps fetched")),this.apps=t.apps.map((t=>Object.assign(t,{loading:!1,installationError:!1}))),r.debug("".concat(this.recommendedApps.length," recommended apps found"),{apps:this.recommendedApps}),this.showInstallButton=!0}catch(t){r.error("could not fetch app list",{error:t}),this.loadingAppsError=!0}finally{this.loadingApps=!1}},methods:{installApps(){this.showInstallButton=!1,this.installingApps=!0;const t=(0,u.Z)(1),n=this.recommendedApps.filter((t=>!t.active&&t.isCompatible&&t.canInstall)).map((n=>t((()=>(r.info("installing ".concat(n.id)),n.loading=!0,l.default.post((0,p.generateUrl)("settings/apps/enable"),{appIds:[n.id],groups:[]}).catch((t=>{r.error("could not install ".concat(n.id),{error:t}),n.installationError=!0})).then((()=>{r.info("installed ".concat(n.id)),n.loading=!1})))))));r.debug("installing ".concat(n.length," recommended apps")),Promise.all(n).then((()=>{r.info("all recommended apps installed, redirecting …"),window.location=h})).catch((t=>r.error("could not install recommended apps",{error:t})))},customIcon:t=>t in f&&f[t].icon?f[t].icon:(r.warn("no app icon for recommended app ".concat(t)),(0,p.imagePath)("core","places/default-app-icon.svg")),customName:t=>t.id in f&&f[t.id].name||t.name,customDescription:t=>t in f?f[t].description:(r.warn("no app description for recommended app ".concat(t)),""),isHidden:t=>t in f&&!!f[t].hidden,goTo(t){window.location.href=t}}};var C=e(93379),b=e.n(C),_=e(7795),y=e.n(_),w=e(90569),x=e.n(w),I=e(3565),k=e.n(I),P=e(19216),B=e.n(P),O=e(44589),j=e.n(O),D=e(33887),E={};E.styleTagTransform=j(),E.setAttributes=k(),E.insert=x().bind(null,"head"),E.domAPI=y(),E.insertStyleElement=B(),b()(D.Z,E),D.Z&&D.Z.locals&&D.Z.locals;const S=(0,e(51900).Z)(v,(function(){var t=this,n=t._self._c;return n("div",{staticClass:"guest-box"},[n("h2",[t._v(t._s(t.t("core","Recommended apps")))]),t._v(" "),t.loadingApps?n("p",{staticClass:"loading text-center"},[t._v("\n\t\t"+t._s(t.t("core","Loading apps …"))+"\n\t")]):t.loadingAppsError?n("p",{staticClass:"loading-error text-center"},[t._v("\n\t\t"+t._s(t.t("core","Could not fetch list of apps from the App Store."))+"\n\t")]):t.installingApps?n("p",{staticClass:"text-center"},[t._v("\n\t\t"+t._s(t.t("core","Installing apps …"))+"\n\t")]):t._e(),t._v(" "),t._l(t.recommendedApps,(function(e){return n("div",{key:e.id,staticClass:"app"},[t.isHidden(e.id)?t._e():[n("img",{attrs:{src:t.customIcon(e.id),alt:""}}),t._v(" "),n("div",{staticClass:"info"},[n("h3",[t._v("\n\t\t\t\t\t"+t._s(t.customName(e))+"\n\t\t\t\t\t"),e.loading?n("span",{staticClass:"icon icon-loading-small-dark"}):e.active?n("span",{staticClass:"icon icon-checkmark-white"}):t._e()]),t._v(" "),n("p",{domProps:{innerHTML:t._s(t.customDescription(e.id))}}),t._v(" "),e.installationError?n("p",[n("strong",[t._v(t._s(t.t("core","App download or installation failed")))])]):e.isCompatible?e.canInstall?t._e():n("p",[n("strong",[t._v(t._s(t.t("core","Cannot install this app")))])]):n("p",[n("strong",[t._v(t._s(t.t("core","Cannot install this app because it is not compatible")))])])])]],2)})),t._v(" "),n("div",{staticClass:"dialog-row"},[t.showInstallButton?n("NcButton",{attrs:{type:"tertiary",role:"link",href:"defaultPageUrl"},on:{click:function(n){return t.goTo(t.defaultPageUrl)}}},[t._v("\n\t\t\t"+t._s(t.t("core","Skip"))+"\n\t\t")]):t._e(),t._v(" "),t.showInstallButton?n("NcButton",{attrs:{type:"primary"},on:{click:function(n){return n.stopPropagation(),n.preventDefault(),t.installApps.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.t("core","Install recommended apps"))+"\n\t\t")]):t._e()],1)],2)}),[],!1,null,"50fce157",null).exports;e.nc=btoa((0,a.IH)()),i.default.mixin({methods:{t:o.Iu}}),(new(i.default.extend(S))).$mount("#recommended-apps"),r.debug("recommended apps view rendered")},33887:(t,n,e)=>{e.d(n,{Z:()=>r});var a=e(87537),o=e.n(a),i=e(23645),s=e.n(i)()(o());s.push([t.id,".dialog-row[data-v-50fce157]{display:flex;justify-content:end;margin-top:8px}p.loading[data-v-50fce157],p.loading-error[data-v-50fce157]{height:100px}p[data-v-50fce157]:last-child{margin-top:10px}.text-center[data-v-50fce157]{text-align:center}.app[data-v-50fce157]{display:flex;flex-direction:row}.app img[data-v-50fce157]{height:50px;width:50px;filter:var(--background-invert-if-dark)}.app img[data-v-50fce157],.app .info[data-v-50fce157]{padding:12px}.app .info h3[data-v-50fce157],.app .info p[data-v-50fce157]{text-align:left}.app .info h3[data-v-50fce157]{margin-top:0}.app .info h3>span.icon[data-v-50fce157]{display:inline-block}","",{version:3,sources:["webpack://./core/src/components/setup/RecommendedApps.vue"],names:[],mappings:"AACA,6BACC,YAAA,CACA,mBAAA,CACA,cAAA,CAIA,4DAEC,YAAA,CAGD,8BACC,eAAA,CAIF,8BACC,iBAAA,CAGD,sBACC,YAAA,CACA,kBAAA,CAEA,0BACC,WAAA,CACA,UAAA,CACA,uCAAA,CAGD,sDACC,YAAA,CAIA,6DACC,eAAA,CAGD,+BACC,YAAA,CAGD,yCACC,oBAAA",sourcesContent:["\n.dialog-row {\n\tdisplay: flex;\n\tjustify-content: end;\n\tmargin-top: 8px;\n}\n\np {\n\t&.loading,\n\t&.loading-error {\n\t\theight: 100px;\n\t}\n\n\t&:last-child {\n\t\tmargin-top: 10px;\n\t}\n}\n\n.text-center {\n\ttext-align: center;\n}\n\n.app {\n\tdisplay: flex;\n\tflex-direction: row;\n\n\timg {\n\t\theight: 50px;\n\t\twidth: 50px;\n\t\tfilter: var(--background-invert-if-dark);\n\t}\n\n\timg, .info {\n\t\tpadding: 12px;\n\t}\n\n\t.info {\n\t\th3, p {\n\t\t\ttext-align: left;\n\t\t}\n\n\t\th3 {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\th3 > span.icon {\n\t\t\tdisplay: inline-block;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const r=s}},e={};function a(t){var o=e[t];if(void 0!==o)return o.exports;var i=e[t]={id:t,loaded:!1,exports:{}};return n[t].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=n,t=[],a.O=(n,e,o,i)=>{if(!e){var s=1/0;for(p=0;p<t.length;p++){e=t[p][0],o=t[p][1],i=t[p][2];for(var r=!0,c=0;c<e.length;c++)(!1&i||s>=i)&&Object.keys(a.O).every((t=>a.O[t](e[c])))?e.splice(c--,1):(r=!1,i<s&&(s=i));if(r){t.splice(p--,1);var l=o();void 0!==l&&(n=l)}}return n}i=i||0;for(var p=t.length;p>0&&t[p-1][2]>i;p--)t[p]=t[p-1];t[p]=[e,o,i]},a.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return a.d(n,{a:n}),n},a.d=(t,n)=>{for(var e in n)a.o(n,e)&&!a.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),a.j=1033,(()=>{a.b=document.baseURI||self.location.href;var t={1033:0};a.O.j=n=>0===t[n];var n=(n,e)=>{var o,i,s=e[0],r=e[1],c=e[2],l=0;if(s.some((n=>0!==t[n]))){for(o in r)a.o(r,o)&&(a.m[o]=r[o]);if(c)var p=c(a)}for(n&&n(e);l<s.length;l++)i=s[l],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0;return a.O(p)},e=self.webpackChunknextcloud=self.webpackChunknextcloud||[];e.forEach(n.bind(null,0)),e.push=n.bind(null,e.push.bind(e))})(),a.nc=void 0;var o=a.O(void 0,[7874],(()=>a(13421)));o=a.O(o)})();
- //# sourceMappingURL=core-recommendedapps.js.map?v=534582d384c8b7969a41
|