mirror of
https://github.com/nextcloud/server.git
synced 2025-02-07 01:50:38 +00:00
2 lines
No EOL
11 KiB
JavaScript
2 lines
No EOL
11 KiB
JavaScript
(()=>{"use strict";var t,e={38382:(t,e,n)=>{var i=n(21777),o=n(53334),r=n(85471),a=n(35947);const s=null===(c=(0,i.HW)())?(0,a.YK)().setApp("core").build():(0,a.YK)().setApp("core").setUid(c.uid).build();var c;(0,a.YK)().setApp("unified-search").detectUser().build();var d=n(32981),l=n(63814),p=n(65043);function u(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function h(t,e,n){return t.set(m(t,e),n),n}function A(t,e){return t.get(m(t,e))}function m(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function g(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class v{constructor(t){g(this,"value",void 0),g(this,"next",void 0),this.value=t}}var f=new WeakMap,C=new WeakMap,b=new WeakMap;class y{constructor(){u(this,f,void 0),u(this,C,void 0),u(this,b,void 0),this.clear()}enqueue(t){var e;const n=new v(t);A(f,this)?(A(C,this).next=n,h(C,this,n)):(h(f,this,n),h(C,this,n)),h(b,this,(e=A(b,this),++e))}dequeue(){var t;const e=A(f,this);if(e)return h(f,this,A(f,this).next),h(b,this,(t=A(b,this),--t)),e.value}peek(){if(A(f,this))return A(f,this).value}clear(){h(f,this,void 0),h(C,this,void 0),h(b,this,0)}get size(){return A(b,this)}*[Symbol.iterator](){let t=A(f,this);for(;t;)yield t.value,t=t.next}}function w(t){x(t);const e=new y;let n=0;const i=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},o=async(t,e,o)=>{const r=(async()=>t(...o))();e(r);try{await r}catch{}n--,i()},r=function(r){for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c<a;c++)s[c-1]=arguments[c];return new Promise((a=>{((r,a,s)=>{new Promise((t=>{e.enqueue(t)})).then(o.bind(void 0,r,a,s)),(async()=>{await Promise.resolve(),n<t&&i()})()})(r,a,s)}))};return Object.defineProperties(r,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(o){x(o),t=o,queueMicrotask((()=>{for(;n<t&&e.size>0;)i()}))}}}),r}function x(t){if(!Number.isInteger(t)&&t!==Number.POSITIVE_INFINITY||!(t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var _=n(70995),k=n(32073);const S={calendar:{description:(0,o.t)("core","Schedule work & meetings, synced with all your devices."),icon:(0,l.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,l.d0)("core","places/contacts.svg")},mail:{description:(0,o.t)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,l.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,l.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,l.d0)("core","apps/richdocuments.svg")},notes:{description:(0,o.t)("core","Distraction free note taking app."),icon:(0,l.d0)("core","apps/notes.svg")},richdocumentscode:{hidden:!0}},I=Object.keys(S),P={name:"RecommendedApps",components:{NcCheckboxRadioSwitch:k.A,NcButton:_.A},data:()=>({showInstallButton:!1,installingApps:!1,loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:(0,d.C)("core","defaultPageUrl")}),computed:{recommendedApps(){return this.apps.filter((t=>I.includes(t.id)))},isAnyAppSelected(){return this.recommendedApps.some((t=>t.isSelected))}},async mounted(){try{const{data:t}=await p.Ay.get((0,l.Jv)("settings/apps/list"));s.info(`${t.apps.length} apps fetched`),this.apps=t.apps.map((t=>Object.assign(t,{loading:!1,installationError:!1,isSelected:t.isCompatible}))),s.debug(`${this.recommendedApps.length} recommended apps found`,{apps:this.recommendedApps}),this.showInstallButton=!0}catch(t){s.error("could not fetch app list",{error:t}),this.loadingAppsError=!0}finally{this.loadingApps=!1}},methods:{installApps(){this.installingApps=!0;const t=w(1),e=this.recommendedApps.filter((t=>!t.active&&t.isCompatible&&t.canInstall&&t.isSelected)).map((e=>t((async()=>(s.info(`installing ${e.id}`),e.loading=!0,p.Ay.post((0,l.Jv)("settings/apps/enable"),{appIds:[e.id],groups:[]}).catch((t=>{s.error(`could not install ${e.id}`,{error:t}),e.isSelected=!1,e.installationError=!0})).then((()=>{s.info(`installed ${e.id}`),e.loading=!1,e.active=!0})))))));s.debug(`installing ${e.length} recommended apps`),Promise.all(e).then((()=>{s.info("all recommended apps installed, redirecting …"),window.location=this.defaultPageUrl})).catch((t=>s.error("could not install recommended apps",{error:t})))},customIcon:t=>t in S&&S[t].icon?S[t].icon:(s.warn(`no app icon for recommended app ${t}`),(0,l.d0)("core","places/default-app-icon.svg")),customName:t=>t.id in S&&S[t.id].name||t.name,customDescription:t=>t in S?S[t].description:(s.warn(`no app description for recommended app ${t}`),""),isHidden:t=>t in S&&!!S[t].hidden,toggleSelect(t){if(!(t in S)||!this.showInstallButton)return;const e=this.apps.findIndex((e=>e.id===t));this.$set(this.apps[e],"isSelected",!this.apps[e].isSelected)}}};var O=n(85072),j=n.n(O),B=n(97825),E=n.n(B),T=n(77659),N=n.n(T),D=n(55056),$=n.n(D),Y=n(10540),U=n.n(Y),M=n(41113),R=n.n(M),q=n(40414),z={};z.styleTagTransform=R(),z.setAttributes=$(),z.insert=N().bind(null,"head"),z.domAPI=E(),z.insertStyleElement=U(),j()(q.A,z),q.A&&q.A.locals&&q.A.locals;const F=(0,n(14486).A)(P,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"guest-box"},[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:{checked:n.isSelected||n.active,disabled:!n.isCompatible||n.active,loading:n.loading},on:{"update:checked":function(e){return t.toggleSelect(n.id)}}})]],2)})),t._v(" "),e("div",{staticClass:"dialog-row"},[t.showInstallButton&&!t.installingApps?e("NcButton",{attrs:{type:"tertiary",role:"link",href:t.defaultPageUrl}},[t._v("\n\t\t\t"+t._s(t.t("core","Skip"))+"\n\t\t")]):t._e(),t._v(" "),t.showInstallButton?e("NcButton",{attrs:{type:"primary",disabled:t.installingApps||!t.isAnyAppSelected},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,"02d18598",null).exports;n.nc=(0,i.aV)(),r.Ay.mixin({methods:{t:o.Tl}}),(new(r.Ay.extend(F))).$mount("#recommended-apps"),s.debug("recommended apps view rendered")},40414:(t,e,n)=>{n.d(e,{A:()=>s});var i=n(71354),o=n.n(i),r=n(76314),a=n.n(r)()(o());a.push([t.id,".dialog-row[data-v-02d18598]{display:flex;justify-content:end;margin-top:8px}p.loading[data-v-02d18598],p.loading-error[data-v-02d18598]{height:100px}p[data-v-02d18598]:last-child{margin-top:10px}.text-center[data-v-02d18598]{text-align:center}.app[data-v-02d18598]{display:flex;flex-direction:row}.app img[data-v-02d18598]{height:50px;width:50px;filter:var(--background-invert-if-dark)}.app img[data-v-02d18598],.app .info[data-v-02d18598]{padding:12px}.app .info h3[data-v-02d18598],.app .info p[data-v-02d18598]{text-align:start}.app .info h3[data-v-02d18598]{margin-top:0}.app .checkbox-radio-switch[data-v-02d18598]{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 s=a}},n={};function i(t){var o=n[t];if(void 0!==o)return o.exports;var r=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=e,t=[],i.O=(e,n,o,r)=>{if(!n){var a=1/0;for(l=0;l<t.length;l++){n=t[l][0],o=t[l][1],r=t[l][2];for(var s=!0,c=0;c<n.length;c++)(!1&r||a>=r)&&Object.keys(i.O).every((t=>i.O[t](n[c])))?n.splice(c--,1):(s=!1,r<a&&(a=r));if(s){t.splice(l--,1);var d=o();void 0!==d&&(e=d)}}return e}r=r||0;for(var l=t.length;l>0&&t[l-1][2]>r;l--)t[l]=t[l-1];t[l]=[n,o,r]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.e=()=>Promise.resolve(),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),i.j=2696,(()=>{i.b=document.baseURI||self.location.href;var t={2696:0};i.O.j=e=>0===t[e];var e=(e,n)=>{var o,r,a=n[0],s=n[1],c=n[2],d=0;if(a.some((e=>0!==t[e]))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(c)var l=c(i)}for(e&&e(n);d<a.length;d++)r=a[d],i.o(t,r)&&t[r]&&t[r][0](),t[r]=0;return i.O(l)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),i.nc=void 0;var o=i.O(void 0,[4208],(()=>i(38382)));o=i.O(o)})();
|
||
//# sourceMappingURL=core-recommendedapps.js.map?v=16f2afe569974c7d4ccd
|