mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 02:34:12 -04:00
2 lines
No EOL
9 KiB
JavaScript
2 lines
No EOL
9 KiB
JavaScript
(()=>{"use strict";var t,e={22317(t,e,n){var a=n(21777),i=n(19051),o=n(53334),s=n(77690),r=n(85471),d=n(81222),p=n(63814),c=n(74095),l=n(32073),A=n(35947);const m=null===(u=(0,a.HW)())?(0,A.YK)().setApp("core").build():(0,A.YK)().setApp("core").setUid(u.uid).build();var u;(0,A.YK)().setApp("unified-search").detectUser().build();const g={calendar:{description:(0,o.t)("core","Schedule work & meetings, synced with all your devices."),icon:(0,p.d0)("core","places/calendar.svg")},contacts:{description:(0,o.t)("core","Keep your colleagues and friends in one place without leaking their private info."),icon:(0,p.d0)("core","places/contacts.svg")},mail:{description:(0,o.t)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,p.d0)("core","actions/mail.svg")},spreed:{description:(0,o.t)("core","Chatting, video calls, screen sharing, online meetings and web conferencing – in your browser and with mobile apps."),icon:(0,p.d0)("core","apps/spreed.svg")},richdocuments:{name:"Nextcloud Office",description:(0,o.t)("core","Collaborative documents, spreadsheets and presentations, built on Collabora Online."),icon:(0,p.d0)("core","apps/richdocuments.svg")},notes:{description:(0,o.t)("core","Distraction free note taking app."),icon:(0,p.d0)("core","apps/notes.svg")},richdocumentscode:{hidden:!0}},h=Object.keys(g),v={name:"RecommendedApps",components:{NcCheckboxRadioSwitch:l.A,NcButton:c.A},data:()=>({showInstallButton:!1,installingApps:!1,loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:(0,d.C)("core","defaultPageUrl")}),computed:{recommendedApps(){return this.apps.filter(t=>h.includes(t.id))},isAnyAppSelected(){return this.recommendedApps.some(t=>t.isSelected)}},async mounted(){try{const{data:t}=await i.Ay.get((0,p.Jv)("settings/apps/list"));m.info(`${t.apps.length} apps fetched`),this.apps=t.apps.map(t=>Object.assign(t,{loading:!1,installationError:!1,isSelected:t.isCompatible})),m.debug(`${this.recommendedApps.length} recommended apps found`,{apps:this.recommendedApps}),this.showInstallButton=!0}catch(t){m.error("could not fetch app list",{error:t}),this.loadingAppsError=!0}finally{this.loadingApps=!1}},methods:{async installApps(){const t=this.recommendedApps.filter(t=>!t.active&&t.isCompatible&&t.canInstall&&t.isSelected);if(0===t.length)return;this.installingApps=!0,t.forEach(t=>{t.loading=!0});const e=t.map(t=>t.id);m.debug(`installing ${t.length} recommended apps`,{appIds:e});try{await i.Ay.post((0,p.Jv)("settings/apps/enable"),{appIds:e,groups:[]},{confirmPassword:s.mH.Strict}),t.forEach(t=>{t.loading=!1,t.active=!0}),m.info("all recommended apps installed, redirecting …"),window.location=this.defaultPageUrl}catch(e){m.error("could not install recommended apps",{error:e}),t.forEach(t=>{t.loading=!1,t.isSelected=!1,t.installationError=!0}),this.installingApps=!1}},customIcon:t=>t in g&&g[t].icon?g[t].icon:(m.warn(`no app icon for recommended app ${t}`),(0,p.d0)("core","places/default-app-icon.svg")),customName:t=>t.id in g&&g[t.id].name||t.name,customDescription:t=>t in g?g[t].description:(m.warn(`no app description for recommended app ${t}`),""),isHidden:t=>t in g&&!!g[t].hidden,toggleSelect(t){if(!(t in g)||!this.showInstallButton)return;const e=this.apps.findIndex(e=>e.id===t);this.$set(this.apps[e],"isSelected",!this.apps[e].isSelected)}}};var f=n(85072),C=n.n(f),b=n(97825),y=n.n(b),x=n(77659),_=n.n(x),w=n(55056),S=n.n(w),k=n(10540),I=n.n(k),B=n(41113),O=n.n(B),E=n(28094),P={};P.styleTagTransform=O(),P.setAttributes=S(),P.insert=_().bind(null,"head"),P.domAPI=y(),P.insertStyleElement=I(),C()(E.A,P),E.A&&E.A.locals&&E.A.locals;var j=(0,n(14486).A)(v,function(){var t=this,e=t._self._c;return e("div",{staticClass:"guest-box",attrs:{"data-cy-setup-recommended-apps":""}},[e("h2",[t._v(t._s(t.t("core","Recommended apps")))]),t._v(" "),t.loadingApps?e("p",{staticClass:"loading text-center"},[t._v("\n\t\t"+t._s(t.t("core","Loading apps …"))+"\n\t")]):t.loadingAppsError?e("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._e(),t._v(" "),t._l(t.recommendedApps,function(n){return e("div",{key:n.id,staticClass:"app"},[t.isHidden(n.id)?t._e():[e("img",{attrs:{src:t.customIcon(n.id),alt:""}}),t._v(" "),e("div",{staticClass:"info"},[e("h3",[t._v(t._s(t.customName(n)))]),t._v(" "),e("p",{domProps:{textContent:t._s(t.customDescription(n.id))}}),t._v(" "),n.installationError?e("p",[e("strong",[t._v(t._s(t.t("core","App download or installation failed")))])]):n.isCompatible?n.canInstall?t._e():e("p",[e("strong",[t._v(t._s(t.t("core","Cannot install this app")))])]):e("p",[e("strong",[t._v(t._s(t.t("core","Cannot install this app because it is not compatible")))])])]),t._v(" "),e("NcCheckboxRadioSwitch",{attrs:{"model-value":n.isSelected||n.active,disabled:!n.isCompatible||n.active,loading:n.loading},on:{"update:modelValue":function(e){return t.toggleSelect(n.id)}}})]],2)}),t._v(" "),e("div",{staticClass:"dialog-row"},[t.showInstallButton&&!t.installingApps?e("NcButton",{attrs:{"data-cy-setup-recommended-apps-skip":"",href:t.defaultPageUrl,variant:"tertiary"}},[t._v("\n\t\t\t"+t._s(t.t("core","Skip"))+"\n\t\t")]):t._e(),t._v(" "),t.showInstallButton?e("NcButton",{attrs:{"data-cy-setup-recommended-apps-install":"",disabled:t.installingApps||!t.isAnyAppSelected,variant:"primary"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.installApps.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.installingApps?t.t("core","Installing apps …"):t.t("core","Install recommended apps"))+"\n\t\t")]):t._e()],1)],2)},[],!1,null,"262d65ec",null);const D=j.exports;(0,s.IF)(i.Ay),n.nc=(0,a.aV)(),r.Ay.mixin({methods:{t:o.Tl}}),(new(r.Ay.extend(D))).$mount("#recommended-apps"),m.debug("recommended apps view rendered")},28094(t,e,n){n.d(e,{A:()=>r});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".dialog-row[data-v-262d65ec]{display:flex;justify-content:end;margin-top:8px}p.loading[data-v-262d65ec],p.loading-error[data-v-262d65ec]{height:100px}p[data-v-262d65ec]:last-child{margin-top:10px}.text-center[data-v-262d65ec]{text-align:center}.app[data-v-262d65ec]{display:flex;flex-direction:row}.app img[data-v-262d65ec]{height:50px;width:50px;filter:var(--background-invert-if-dark)}.app img[data-v-262d65ec],.app .info[data-v-262d65ec]{padding:12px}.app .info h3[data-v-262d65ec],.app .info p[data-v-262d65ec]{text-align:start}.app .info h3[data-v-262d65ec]{margin-top:0}.app .checkbox-radio-switch[data-v-262d65ec]{margin-inline-start:auto;padding:0 2px}","",{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,gBAAA,CAGD,+BACC,YAAA,CAIF,6CACC,wBAAA,CACA,aAAA",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: start;\n\t\t}\n\n\t\th3 {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\n\t.checkbox-radio-switch {\n\t\tmargin-inline-start: auto;\n\t\tpadding: 0 2px;\n\t}\n}\n"],sourceRoot:""}]);const r=s}},n={};function a(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=e,t=[],a.O=(e,n,i,o)=>{if(!n){var s=1/0;for(c=0;c<t.length;c++){for(var[n,i,o]=t[c],r=!0,d=0;d<n.length;d++)(!1&o||s>=o)&&Object.keys(a.O).every(t=>a.O[t](n[d]))?n.splice(d--,1):(r=!1,o<s&&(s=o));if(r){t.splice(c--,1);var p=i();void 0!==p&&(e=p)}}return e}o=o||0;for(var c=t.length;c>0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[n,i,o]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.e=()=>Promise.resolve(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),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=2696,(()=>{a.b="undefined"!=typeof document&&document.baseURI||self.location.href;var t={2696:0};a.O.j=e=>0===t[e];var e=(e,n)=>{var i,o,[s,r,d]=n,p=0;if(s.some(e=>0!==t[e])){for(i in r)a.o(r,i)&&(a.m[i]=r[i]);if(d)var c=d(a)}for(e&&e(n);p<s.length;p++)o=s[p],a.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return a.O(c)},n=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),a.nc=void 0;var i=a.O(void 0,[4208],()=>a(22317));i=a.O(i)})();
|
||
//# sourceMappingURL=core-recommendedapps.js.map?v=76c218941be9abfbb5e0
|