nextcloud/apps/settings/js/vue-settings-apps-489d5f46c...

2 lines
34 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonpSettings=window.webpackJsonpSettings||[]).push([[2],{514:function(t,e,a){var i=a(542);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,a(128).default)("51b62fff",i,!0,{})},515:function(t,e,a){var i=a(548);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,a(128).default)("40c7757c",i,!0,{})},516:function(t,e,a){var i=a(550);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,a(128).default)("e52a404a",i,!0,{})},517:function(t,e,a){var i=a(552);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,a(128).default)("38e40412",i,!0,{})},541:function(t,e,a){"use strict";var i=a(514);a.n(i).a},542:function(t,e,a){(e=a(127)(!1)).push([t.i,"\n.force[data-v-5a074e36] {\n\tbackground: var(--color-main-background);\n\tborder-color: var(--color-error);\n\tcolor: var(--color-error);\n}\n.force[data-v-5a074e36]:hover,\n.force[data-v-5a074e36]:active {\n\tbackground: var(--color-error);\n\tborder-color: var(--color-error) !important;\n\tcolor: var(--color-main-background);\n}\n",""]),t.exports=e},547:function(t,e,a){"use strict";var i=a(515);a.n(i).a},548:function(t,e,a){(e=a(127)(!1)).push([t.i,".settings-markdown[data-v-6a5af116] h1,.settings-markdown[data-v-6a5af116] h2,.settings-markdown[data-v-6a5af116] h3,.settings-markdown[data-v-6a5af116] h4,.settings-markdown[data-v-6a5af116] h5,.settings-markdown[data-v-6a5af116] h6{font-weight:600;line-height:120%;margin-top:24px;margin-bottom:12px;color:var(--color-main-text)}.settings-markdown[data-v-6a5af116] h1{font-size:36px;margin-top:48px}.settings-markdown[data-v-6a5af116] h2{font-size:28px;margin-top:48px}.settings-markdown[data-v-6a5af116] h3{font-size:24px}.settings-markdown[data-v-6a5af116] h4{font-size:21px}.settings-markdown[data-v-6a5af116] h5{font-size:17px}.settings-markdown[data-v-6a5af116] h6{font-size:var(--default-font-size)}.settings-markdown[data-v-6a5af116] pre{white-space:pre;overflow-x:auto;background-color:var(--color-background-dark);border-radius:var(--border-radius);padding:1em 1.3em;margin-bottom:1em}.settings-markdown[data-v-6a5af116] p code{background-color:var(--color-background-dark);border-radius:var(--border-radius);padding:.1em .3em}.settings-markdown[data-v-6a5af116] li{position:relative}.settings-markdown[data-v-6a5af116] ul,.settings-markdown[data-v-6a5af116] ol{padding-left:10px;margin-left:10px}.settings-markdown[data-v-6a5af116] ul li{list-style-type:disc}.settings-markdown[data-v-6a5af116] ul>li>ul>li{list-style-type:circle}.settings-markdown[data-v-6a5af116] ul>li>ul>li ul li{list-style-type:square}.settings-markdown[data-v-6a5af116] blockquote{padding-left:1em;border-left:4px solid var(--color-primary-element);color:var(--color-text-maxcontrast);margin-left:0;margin-right:0}\n",""]),t.exports=e},549:function(t,e,a){"use strict";var i=a(516);a.n(i).a},550:function(t,e,a){(e=a(127)(!1)).push([t.i,".app-details[data-v-e40a53d2]{padding:20px}.app-details__actions-manage[data-v-e40a53d2]{display:flex}.app-details__actions-manage input[data-v-e40a53d2]{flex:0 1 auto;min-width:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.app-details__dependencies[data-v-e40a53d2]{opacity:.7}.app-details__documentation[data-v-e40a53d2]{padding-top:20px}.app-details__description[data-v-e40a53d2]{padding-top:20px}.force[data-v-e40a53d2]{color:var(--color-error);border-color:var(--color-error);background:var(--color-main-background)}.force[data-v-e40a53d2]:hover,.force[data-v-e40a53d2]:active{color:var(--color-main-background);border-color:var(--color-error) !important;background:var(--color-error)}\n",""]),t.exports=e},551:function(t,e,a){"use strict";var i=a(517);a.n(i).a},552:function(t,e,a){(e=a(127)(!1)).push([t.i,".app-sidebar[data-v-5264f008]:not(.app-sidebar--without-background) :not(.app-sidebar-header--compact) .app-sidebar-header__figure{background-size:cover}.app-sidebar[data-v-5264f008]:not(.app-sidebar--without-background) .app-sidebar-header--compact .app-sidebar-header__figure{background-size:32px;filter:invert(1)}.app-sidebar[data-v-5264f008].app-sidebar--without-background .app-sidebar-header__figure{display:flex;align-items:center;justify-content:center}.app-sidebar[data-v-5264f008].app-sidebar--without-background .app-sidebar-header__figure--default-app-icon{width:32px;height:32px;background-size:32px}.app-sidebar[data-v-5264f008] .app-sidebar-header__desc .app-sidebar-header__subtitle{overflow:visible !important;height:auto;white-space:normal !important;line-height:16px}.app-sidebar[data-v-5264f008] .app-sidebar-header__action{margin:0 20px}.app-sidebar[data-v-5264f008] .app-sidebar-header__action input{margin:3px}.app-sidebar-tabs__release h2[data-v-5264f008]{border-bottom:1px solid var(--color-border)}.app-sidebar-tabs__release[data-v-5264f008] h3{font-size:20px}.app-sidebar-tabs__release[data-v-5264f008] h4{font-size:17px}\n",""]),t.exports=e},553:function(e,a,i){"use strict";i.r(a);var n=i(129),s=i(16),r=i(524),o=i.n(r),p=i(518),c=i.n(p),l=i(519),u=i.n(l),d=i(520),h=i.n(d),g=i(521),v=i.n(g),f=i(538),m=i.n(f),b=i(539),_=i.n(b),y=i(540),w=i.n(y),k=i(522),A=i.n(k),C=i(10),x={name:"AppScore",props:["score"],computed:{scoreImage:function(){var t="rating/s"+Math.round(10*this.score)+".svg";return Object(C.imagePath)("core",t)}}},N=i(36),S=Object(N.a)(x,(function(){var t=this.$createElement;return(this._self._c||t)("img",{staticClass:"app-score-image",attrs:{"src":this.scoreImage}})}),[],!1,null,null,null).exports,D={computed:{appGroups:function(){return this.app.groups.map((function(t){return{id:t,name:t}}))},installing:function(){return this.$store.getters.loading("install")},isLoading:function(){return this.app&&this.$store.getters.loading(this.app.id)},enableButtonText:function(){return this.app.needsDownload?t("settings","Download and enable"):t("settings","Enable")},forceEnableButtonText:function(){return this.app.needsDownload,t("settings","Enable untested app")},enableButtonTooltip:function(){return!!this.app.needsDownload&&t("settings","The app will be downloaded from the app store")},forceEnableButtonTooltip:function(){var e=t("settings","This app is not marked as compatible with your Nextcloud version. If you continue you will still be able to install the app. Note that the app might not work as expected.");return this.app.needsDownload?e+" "+t("settings","The app will be downloaded from the app store"):e}},data:function(){return{groupCheckedAppsData:!1}},mounted:function(){this.app&&this.app.groups&&this.app.groups.length>0&&(this.groupCheckedAppsData=!0)},methods:{asyncFindGroup:function(t){return this.$store.dispatch("getGroups",{search:t,limit:5,offset:0})},isLimitedToGroups:function(t){return!(!this.app.groups.length&&!this.groupCheckedAppsData)},setGroupLimit:function(){this.groupCheckedAppsData||this.$store.dispatch("enableApp",{appId:this.app.id,groups:[]})},canLimitToGroups:function(t){return!(t.types&&t.types.includes("filesystem")||t.types.includes("prelogin")||t.types.includes("authentication")||t.types.includes("logging")||t.types.includes("prevent_group_restriction"))},addGroupLimitation:function(t){var e=this.app.groups.concat([]).concat([t.id]);this.$store.dispatch("enableApp",{appId:this.app.id,groups:e})},removeGroupLimitation:function(t){var e=this.app.groups.concat([]),a=e.indexOf(t.id);a>-1&&e.splice(a,1),this.$store.dispatch("enableApp",{appId:this.app.id,groups:e})},forceEnable:function(t){this.$store.dispatch("forceEnableApp",{appId:t,groups:[]}).then((function(t){OC.Settings.Apps.rebuildNavigation()})).catch((function(t){OC.Notification.show(t)}))},enable:function(t){this.$store.dispatch("enableApp",{appId:t,groups:[]}).then((function(t){OC.Settings.Apps.rebuildNavigation()})).catch((function(t){OC.Notification.show(t)}))},disable:function(t){this.$store.dispatch("disableApp",{appId:t}).then((function(t){OC.Settings.Apps.rebuildNavigation()})).catch((function(t){OC.Notification.show(t)}))},remove:function(t){this.$store.dispatch("uninstallApp",{appId:t}).then((function(t){OC.Settings.Apps.rebuildNavigation()})).catch((function(t){OC.Notification.show(t)}))},install:function(t){this.$store.dispatch("enableApp",{appId:t}).then((function(t){OC.Settings.Apps.rebuildNavigation()})).catch((function(t){OC.Notification.show(t)}))},update:function(t){this.$store.dispatch("updateApp",{appId:t}).then((function(t){OC.Settings.Apps.rebuildNavigation()})).catch((function(t){OC.Notification.show(t)}))}}},L={name:"SvgFilterMixin",data:function(){return{filterId:""}},computed:{filterUrl:function(){return"url(#".concat(this.filterId,")")}},mounted:function(){this.filterId="invertIconApps"+Math.floor(100*Math.random())+(new Date).getSeconds()+(new Date).getMilliseconds()}};function I(t,e,a,i,n,s,r){try{var o=t[s](r),p=o.value}catch(t){return void a(t)}o.done?e(p):Promise.resolve(p).then(i,n)}var T={name:"AppItem",components:{AppScore:S},mixins:[D,Object(N.a)(L,void 0,void 0,!1,null,null,null).exports],props:{app:{},category:{},listView:{type:Boolean,default:!0}},data:function(){return{isSelected:!1,scrolled:!1,screenshotLoaded:!1}},computed:{hasRating:function(){return this.app.appstoreData&&this.app.appstoreData.ratingNumOverall>5}},watch:{"$route.params.id":function(t){this.isSelected=this.app.id===t}},mounted:function(){var t=this;if(this.isSelected=this.app.id===this.$route.params.id,this.app.screenshot){var e=new Image;e.onload=function(e){t.screenshotLoaded=!0},e.src=this.app.screenshot}},watchers:{},methods:{showAppDetails:function(t){var e,a=this;return(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("INPUT"!==t.currentTarget.tagName&&"A"!==t.currentTarget.tagName){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,a.$router.push({name:"apps-details",params:{category:a.category,id:a.app.id}});case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(2);case 9:case"end":return e.stop()}}),e,null,[[2,7]])})),function(){var t=this,a=arguments;return new Promise((function(i,n){var s=e.apply(t,a);function r(t){I(s,i,n,r,o,"next",t)}function o(t){I(s,i,n,r,o,"throw",t)}r(void 0)}))})()},prefix:function(t,e){return t+"_"+e}}},$=(i(541),Object(N.a)(T,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"section",class:{selected:t.isSelected},on:{"click":t.showAppDetails}},[a("div",{staticClass:"app-image app-image-icon",on:{"click":t.showAppDetails}},[t.listView&&!t.app.preview||!t.listView&&!t.screenshotLoaded?a("div",{staticClass:"icon-settings-dark"}):t.listView&&t.app.preview?a("svg",{attrs:{"width":"32","height":"32","viewBox":"0 0 32 32"}},[a("defs",[a("filter",{attrs:{"id":t.filterId}},[a("feColorMatrix",{attrs:{"in":"SourceGraphic","type":"matrix","values":"-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"}})],1)]),t._v(" "),a("image",{staticClass:"app-icon",attrs:{"x":"0","y":"0","width":"32","height":"32","preserveAspectRatio":"xMinYMin meet","filter":t.filterUrl,"xlink:href":t.app.preview}})]):t._e(),t._v(" "),!t.listView&&t.app.screenshot&&t.screenshotLoaded?a("img",{attrs:{"src":t.app.screenshot,"width":"100%"}}):t._e()]),t._v(" "),a("div",{staticClass:"app-name",on:{"click":t.showAppDetails}},[t._v("\n\t\t"+t._s(t.app.name)+"\n\t")]),t._v(" "),t.listView?t._e():a("div",{staticClass:"app-summary"},[t._v("\n\t\t"+t._s(t.app.summary)+"\n\t")]),t._v(" "),t.listView?a("div",{staticClass:"app-version"},[t.app.version?a("span",[t._v(t._s(t.app.version))]):t.app.appstoreData.releases[0].version?a("span",[t._v(t._s(t.app.appstoreData.releases[0].version))]):t._e()]):t._e(),t._v(" "),a("div",{staticClass:"app-level"},[300===t.app.level?a("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.t("settings","This app is supported via your current Nextcloud subscription."),expression:"t('settings', 'This app is supported via your current Nextcloud subscription.')",modifiers:{"auto":!0}}],staticClass:"supported icon-checkmark-color"},[t._v("\n\t\t\t"+t._s(t.t("settings","Supported")))]):t._e(),t._v(" "),200===t.app.level?a("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.t("settings","Featured apps are developed by and within the community. They offer central functionality and are ready for production use."),expression:"t('settings', 'Featured apps are developed by and within the community. They offer central functionality and are ready for production use.')",modifiers:{"auto":!0}}],staticClass:"official icon-checkmark"},[t._v("\n\t\t\t"+t._s(t.t("settings","Featured")))]):t._e(),t._v(" "),t.hasRating&&!t.listView?a("AppScore",{attrs:{"score":t.app.score}}):t._e()],1),t._v(" "),a("div",{staticClass:"actions"},[t.app.error?a("div",{staticClass:"warning"},[t._v("\n\t\t\t"+t._s(t.app.error)+"\n\t\t")]):t._e(),t._v(" "),t.isLoading?a("div",{staticClass:"icon icon-loading-small"}):t._e(),t._v(" "),t.app.update?a("input",{staticClass:"update primary",attrs:{"type":"button","value":t.t("settings","Update to {update}",{update:t.app.update}),"disabled":t.installing||t.isLoading},on:{"click":function(e){return e.stopPropagation(),t.update(t.app.id)}}}):t._e(),t._v(" "),t.app.canUnInstall?a("input",{staticClass:"uninstall",attrs:{"type":"button","value":t.t("settings","Remove"),"disabled":t.installing||t.isLoading},on:{"click":function(e){return e.stopPropagation(),t.remove(t.app.id)}}}):t._e(),t._v(" "),t.app.active?a("input",{staticClass:"enable",attrs:{"type":"button","value":t.t("settings","Disable"),"disabled":t.installing||t.isLoading},on:{"click":function(e){return e.stopPropagation(),t.disable(t.app.id)}}}):t._e(),t._v(" "),t.app.active||!t.app.canInstall&&!t.app.isCompatible?t.app.active?t._e():a("input",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.forceEnableButtonTooltip,expression:"forceEnableButtonTooltip",modifiers:{"auto":!0}}],staticClass:"enable force",attrs:{"type":"button","value":t.forceEnableButtonText,"disabled":t.installing||t.isLoading},on:{"click":function(e){return e.stopPropagation(),t.forceEnable(t.app.id)}}}):a("input",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.enableButtonTooltip,expression:"enableButtonTooltip",modifiers:{"auto":!0}}],staticClass:"enable",attrs:{"type":"button","value":t.enableButtonText,"disabled":!t.app.canInstall||t.installing||t.isLoading},on:{"click":function(e){return e.stopPropagation(),t.enable(t.app.id)}}})])])}),[],!1,null,"5a074e36",null).exports),O={name:"PrefixMixin",methods:{prefix:function(t,e){return t+"_"+e}}},B=Object(N.a)(O,void 0,void 0,!1,null,null,null).exports,E=i(543),U=i.n(E),M={name:"AppList",components:{AppItem:$},mixins:[B],props:["category","app","search"],computed:{counter:function(){return this.apps.filter((function(t){return t.update})).length},loading:function(){return this.$store.getters.loading("list")},hasPendingUpdate:function(){return this.apps.filter((function(t){return t.update})).length>1},showUpdateAll:function(){return this.hasPendingUpdate&&["installed","updates"].includes(this.category)},apps:function(){var t=this,e=this.$store.getters.getAllApps.filter((function(e){return-1!==e.name.toLowerCase().search(t.search.toLowerCase())})).sort((function(t,e){var a=""+(t.active?0:1)+(t.update?0:1)+t.name,i=""+(e.active?0:1)+(e.update?0:1)+e.name;return OC.Util.naturalSortCompare(a,i)}));return"installed"===this.category?e.filter((function(t){return t.installed})):"enabled"===this.category?e.filter((function(t){return t.active&&t.installed})):"disabled"===this.category?e.filter((function(t){return!t.active&&t.installed})):"app-bundles"===this.category?e.filter((function(t){return t.bundles})):"updates"===this.category?e.filter((function(t){return t.update})):"featured"===this.category?e.filter((function(t){return 200===t.level})):e.filter((function(e){return e.appstore&&void 0!==e.category&&(e.category===t.category||e.category.indexOf(t.category)>-1)}))},bundles:function(){var t=this;return this.$store.getters.getServerData.bundles.filter((function(e){return t.bundleApps(e.id).length>0}))},bundleApps:function(){return function(t){return this.$store.getters.getAllApps.filter((function(e){return void 0!==e.bundleIds&&e.bundleIds.includes(t)}))}},searchApps:function(){var t=this;return""===this.search?[]:this.$store.getters.getAllApps.filter((function(e){return-1!==e.name.toLowerCase().search(t.search.toLowerCase())&&!t.apps.find((function(t){return t.id===e.id}))}))},useAppStoreView:function(){return!this.useListView&&!this.useBundleView},useListView:function(){return"installed"===this.category||"enabled"===this.category||"disabled"===this.category||"updates"===this.category||"featured"===this.category},useBundleView:function(){return"app-bundles"===this.category},allBundlesEnabled:function(){var t=this;return function(e){return 0===t.bundleApps(e).filter((function(t){return!t.active})).length}},bundleToggleText:function(){var e=this;return function(a){return e.allBundlesEnabled(a)?t("settings","Disable all"):t("settings","Enable all")}}},methods:{toggleBundle:function(t){return this.allBundlesEnabled(t)?this.disableBundle(t):this.enableBundle(t)},enableBundle:function(t){var e=this.bundleApps(t).map((function(t){return t.id}));this.$store.dispatch("enableApp",{appId:e,groups:[]}).catch((function(t){console.error(t),OC.Notification.show(t)}))},disableBundle:function(t){var e=this.bundleApps(t).map((function(t){return t.id}));this.$store.dispatch("disableApp",{appId:e,groups:[]}).catch((function(t){OC.Notification.show(t)}))},updateAll:function(){var t=this,e=U()(1);this.apps.filter((function(t){return t.update})).map((function(a){return e((function(){return t.$store.dispatch("updateApp",{appId:a.id})}))}))}}},V=Object(N.a)(M,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{"id":"app-content-inner"}},[a("div",{staticClass:"apps-list",class:{installed:t.useBundleView||t.useListView,store:t.useAppStoreView},attrs:{"id":"apps-list"}},[t.useListView?[t.showUpdateAll?a("div",{staticClass:"counter"},[t._v("\n\t\t\t\t"+t._s(t.n("settings","%n app has an update available","%n apps have an update available",t.counter))+"\n\t\t\t\t"),t.showUpdateAll?a("button",{staticClass:"primary",attrs:{"id":"app-list-update-all"},on:{"click":t.updateAll}},[t._v("\n\t\t\t\t\t"+t._s(t.t("settings","Update all"))+"\n\t\t\t\t")]):t._e()]):t._e(),t._v(" "),a("transition-group",{staticClass:"apps-list-container",attrs:{"name":"app-list","tag":"div"}},t._l(t.apps,(function(e){return a("AppItem",{key:e.id,attrs:{"app":e,"category":t.category}})})),1)]:t._e(),t._v(" "),t.useBundleView?a("transition-group",{staticClass:"apps-list-container",attrs:{"name":"app-list","tag":"div"}},[t._l(t.bundles,(function(e){return[a("div",{key:e.id,staticClass:"apps-header"},[a("div",{staticClass:"app-image"}),t._v(" "),a("h2",[t._v(t._s(e.name)+" "),a("input",{attrs:{"type":"button","value":t.bundleToggleText(e.id)},on:{"click":function(a){return t.toggleBundle(e.id)}}})]),t._v(" "),a("div",{staticClass:"app-version"}),t._v(" "),a("div",{staticClass:"app-level"}),t._v(" "),a("div",{staticClass:"app-groups"}),t._v(" "),a("div",{staticClass:"actions"},[t._v("\n\t\t\t\t\t\t \n\t\t\t\t\t")])]),t._v(" "),t._l(t.bundleApps(e.id),(function(i){return a("AppItem",{key:e.id+i.id,attrs:{"app":i,"category":t.category}})}))]}))],2):t._e(),t._v(" "),t.useAppStoreView?t._l(t.apps,(function(e){return a("AppItem",{key:e.id,attrs:{"app":e,"category":t.category,"list-view":!1}})})):t._e()],2),t._v(" "),a("div",{staticClass:"apps-list installed",attrs:{"id":"apps-list-search"}},[a("div",{staticClass:"apps-list-container"},[""!==t.search&&t.searchApps.length>0?[a("div",{staticClass:"section"},[a("div"),t._v(" "),a("td",{attrs:{"colspan":"5"}},[a("h2",[t._v(t._s(t.t("settings","Results from other categories")))])])]),t._v(" "),t._l(t.searchApps,(function(e){return a("AppItem",{key:e.id,attrs:{"app":e,"category":t.category,"list-view":!0}})}))]:t._e()],2)]),t._v(" "),""===t.search||t.loading||0!==t.searchApps.length||0!==t.apps.length?t._e():a("div",{staticClass:"emptycontent emptycontent-search",attrs:{"id":"apps-list-empty"}},[a("div",{staticClass:"icon-settings-dark",attrs:{"id":"app-list-empty-icon"}}),t._v(" "),a("h2",[t._v(t._s(t.t("settings","No apps found for your version")))])]),t._v(" "),a("div",{attrs:{"id":"searchresults"}})])}),[],!1,null,null,null).exports,G=i(179),R=i(545),j=i.n(R),z=i(546),P=i.n(z),F={name:"Markdown",props:{text:{type:String,default:""}},computed:{renderMarkdown:function(){var t=new j.a.Renderer;return t.link=function(t,e,a){var i;try{i=decodeURIComponent(unescape(t)).replace(/[^\w:]/g,"").toLowerCase()}catch(t){return""}if(0!==i.indexOf("http:")&&0!==i.indexOf("https:"))return"";var n='<a href="'+t+'" rel="noreferrer noopener"';return e&&(n+=' title="'+e+'"'),n+=">"+a+"</a>"},t.image=function(t,e,a){return a||e},t.blockquote=function(t){return t},P.a.sanitize(j()(this.text.trim(),{renderer:t,gfm:!1,highlight:!1,tables:!1,breaks:!1,pedantic:!1,sanitize:!0,smartLists:!0,smartypants:!1}),{SAFE_FOR_JQUERY:!0,ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","strong","p","a","ul","ol","li","em","del","blockquote"]})}}},q=(i(547),Object(N.a)(F,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"settings-markdown",domProps:{"innerHTML":this._s(this.renderMarkdown)}})}),[],!1,null,"6a5af116",null).exports),Q={name:"AppDetails",components:{Multiselect:G.Multiselect,Markdown:q},mixins:[D,B],props:{app:{type:Object,required:!0}},data:function(){return{groupCheckedAppsData:!1}},computed:{appstoreUrl:function(){return"https://apps.nextcloud.com/apps/".concat(this.app.id)},licence:function(){return this.app.licence?t("settings","{license}-licensed",{license:(""+this.app.licence).toUpperCase()}):null},author:function(){return"string"==typeof this.app.author?[{"@value":this.app.author}]:this.app.author["@value"]?[this.app.author]:this.app.author},appGroups:function(){return this.app.groups.map((function(t){return{id:t,name:t}}))},groups:function(){return this.$store.getters.getGroups.filter((function(t){return"disabled"!==t.id})).sort((function(t,e){return t.name.localeCompare(e.name)}))}},mounted:function(){this.app.groups.length>0&&(this.groupCheckedAppsData=!0)}},J=(i(549),Object(N.a)(Q,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-details"},[a("div",{staticClass:"app-details__actions"},[t.app.active&&t.canLimitToGroups(t.app)?a("div",{staticClass:"app-details__actions-groups"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.groupCheckedAppsData,expression:"groupCheckedAppsData"}],staticClass:"groups-enable__checkbox checkbox",attrs:{"id":t.prefix("groups_enable",t.app.id),"type":"checkbox"},domProps:{"value":t.app.id,"checked":Array.isArray(t.groupCheckedAppsData)?t._i(t.groupCheckedAppsData,t.app.id)>-1:t.groupCheckedAppsData},on:{"change":[function(e){var a=t.groupCheckedAppsData,i=e.target,n=!!i.checked;if(Array.isArray(a)){var s=t.app.id,r=t._i(a,s);i.checked?r<0&&(t.groupCheckedAppsData=a.concat([s])):r>-1&&(t.groupCheckedAppsData=a.slice(0,r).concat(a.slice(r+1)))}else t.groupCheckedAppsData=n},t.setGroupLimit]}}),t._v(" "),a("label",{attrs:{"for":t.prefix("groups_enable",t.app.id)}},[t._v(t._s(t.t("settings","Limit to groups")))]),t._v(" "),a("input",{staticClass:"group_select",attrs:{"type":"hidden","title":t.t("settings","All"),"value":""}}),t._v(" "),t.isLimitedToGroups(t.app)?a("Multiselect",{staticClass:"multiselect-vue",attrs:{"options":t.groups,"value":t.appGroups,"options-limit":5,"placeholder":t.t("settings","Limit app usage to groups"),"label":"name","track-by":"id","multiple":!0,"close-on-select":!1,"tag-width":60},on:{"select":t.addGroupLimitation,"remove":t.removeGroupLimitation,"search-change":t.asyncFindGroup}},[a("span",{attrs:{"slot":"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])]):t._e()],1):t._e(),t._v(" "),a("div",{staticClass:"app-details__actions-manage"},[t.app.update?a("input",{staticClass:"update primary",attrs:{"type":"button","value":t.t("settings","Update to {version}",{version:t.app.update}),"disabled":t.installing||t.isLoading},on:{"click":function(e){return t.update(t.app.id)}}}):t._e(),t._v(" "),t.app.canUnInstall?a("input",{staticClass:"uninstall",attrs:{"type":"button","value":t.t("settings","Remove"),"disabled":t.installing||t.isLoading},on:{"click":function(e){return t.remove(t.app.id)}}}):t._e(),t._v(" "),t.app.active?a("input",{staticClass:"enable",attrs:{"type":"button","value":t.t("settings","Disable"),"disabled":t.installing||t.isLoading},on:{"click":function(e){return t.disable(t.app.id)}}}):t._e(),t._v(" "),t.app.active||!t.app.canInstall&&!t.app.isCompatible?t.app.active||t.app.canInstall?t._e():a("input",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.forceEnableButtonTooltip,expression:"forceEnableButtonTooltip",modifiers:{"auto":!0}}],staticClass:"enable force",attrs:{"type":"button","value":t.forceEnableButtonText,"disabled":t.installing||t.isLoading},on:{"click":function(e){return t.forceEnable(t.app.id)}}}):a("input",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.enableButtonTooltip,expression:"enableButtonTooltip",modifiers:{"auto":!0}}],staticClass:"enable primary",attrs:{"type":"button","value":t.enableButtonText,"disabled":!t.app.canInstall||t.installing||t.isLoading},on:{"click":function(e){return t.enable(t.app.id)}}})])]),t._v(" "),a("ul",{staticClass:"app-details__dependencies"},[t.app.missingMinOwnCloudVersion?a("li",[t._v("\n\t\t\t"+t._s(t.t("settings","This app has no minimum Nextcloud version assigned. This will be an error in the future."))+"\n\t\t")]):t._e(),t._v(" "),t.app.missingMaxOwnCloudVersion?a("li",[t._v("\n\t\t\t"+t._s(t.t("settings","This app has no maximum Nextcloud version assigned. This will be an error in the future."))+"\n\t\t")]):t._e(),t._v(" "),t.app.canInstall?t._e():a("li",[t._v("\n\t\t\t"+t._s(t.t("settings","This app cannot be installed because the following dependencies are not fulfilled:"))+"\n\t\t\t"),a("ul",{staticClass:"missing-dependencies"},t._l(t.app.missingDependencies,(function(e,i){return a("li",{key:i},[t._v("\n\t\t\t\t\t"+t._s(e)+"\n\t\t\t\t")])})),0)])]),t._v(" "),a("p",{staticClass:"app-details__documentation"},[t.app.internal?t._e():a("a",{staticClass:"appslink",attrs:{"href":t.appstoreUrl,"target":"_blank","rel":"noreferrer noopener"}},[t._v(t._s(t.t("settings","View in store"))+" ↗")]),t._v(" "),t.app.website?a("a",{staticClass:"appslink",attrs:{"href":t.app.website,"target":"_blank","rel":"noreferrer noopener"}},[t._v(t._s(t.t("settings","Visit website"))+" ↗")]):t._e(),t._v(" "),t.app.bugs?a("a",{staticClass:"appslink",attrs:{"href":t.app.bugs,"target":"_blank","rel":"noreferrer noopener"}},[t._v(t._s(t.t("settings","Report a bug"))+" ↗")]):t._e(),t._v(" "),t.app.documentation&&t.app.documentation.user?a("a",{staticClass:"appslink",attrs:{"href":t.app.documentation.user,"target":"_blank","rel":"noreferrer noopener"}},[t._v(t._s(t.t("settings","User documentation"))+" ↗")]):t._e(),t._v(" "),t.app.documentation&&t.app.documentation.admin?a("a",{staticClass:"appslink",attrs:{"href":t.app.documentation.admin,"target":"_blank","rel":"noreferrer noopener"}},[t._v(t._s(t.t("settings","Admin documentation"))+" ↗")]):t._e(),t._v(" "),t.app.documentation&&t.app.documentation.developer?a("a",{staticClass:"appslink",attrs:{"href":t.app.documentation.developer,"target":"_blank","rel":"noreferrer noopener"}},[t._v(t._s(t.t("settings","Developer documentation"))+" ↗")]):t._e()]),t._v(" "),a("Markdown",{staticClass:"app-details__description",attrs:{"text":t.app.description}})],1)}),[],!1,null,"e40a53d2",null).exports);s.default.use(o.a);var Y={name:"Apps",components:{AppContent:c.a,AppDetails:J,AppList:V,AppNavigation:u.a,AppNavigationCounter:h.a,AppNavigationItem:v.a,AppNavigationSpacer:m.a,AppScore:S,AppSidebar:_.a,AppSidebarTab:w.a,Content:A.a,Markdown:q},mixins:[D],props:{category:{type:String,default:"installed"},id:{type:String,default:""}},data:function(){return{searchQuery:"",screenshotLoaded:!1}},computed:{loading:function(){return this.$store.getters.loading("categories")},loadingList:function(){return this.$store.getters.loading("list")},app:function(){var t=this;return this.apps.find((function(e){return e.id===t.id}))},categories:function(){return this.$store.getters.getCategories},apps:function(){return this.$store.getters.getAllApps},updateCount:function(){return this.$store.getters.getUpdateCount},settings:function(){return this.$store.getters.getServerData},hasRating:function(){return this.app.appstoreData&&this.app.appstoreData.ratingNumOverall>5},appSidebar:function(){var e=Array.isArray(this.app.author)?this.app.author[0]["@value"]?this.app.author.map((function(t){return t["@value"]})).join(", "):this.app.author.join(", "):this.app.author["@value"]?this.app.author["@value"]:this.app.author,a=t("settings","{license}-licensed",{license:(""+this.app.licence).toUpperCase()});return{subtitle:t("settings","by {author}\n{license}",{author:e,license:a}),background:this.app.screenshot&&this.screenshotLoaded?this.app.screenshot:this.app.preview,compact:!(this.app.screenshot&&this.screenshotLoaded),title:this.app.name}},changelog:function(){return function(t){return t.translations.en.changelog}}},watch:{category:function(){this.searchQuery=""},app:function(){var t=this;if(this.screenshotLoaded=!1,this.app&&this.app.screenshot){var e=new Image;e.onload=function(e){t.screenshotLoaded=!0},e.src=this.app.screenshot}}},beforeMount:function(){this.$store.dispatch("getCategories"),this.$store.dispatch("getAllApps"),this.$store.dispatch("getGroups",{offset:0,limit:5}),this.$store.commit("setUpdateCount",this.$store.getters.getServerData.updateCount)},mounted:function(){Object(n.subscribe)("nextcloud:unified-search.search",this.setSearch),Object(n.subscribe)("nextcloud:unified-search.reset",this.resetSearch)},beforeDestroy:function(){Object(n.unsubscribe)("nextcloud:unified-search.search",this.setSearch),Object(n.unsubscribe)("nextcloud:unified-search.reset",this.resetSearch)},methods:{setSearch:function(t){var e=t.query;this.searchQuery=e},resetSearch:function(){this.searchQuery=""},hideAppDetails:function(){this.$router.push({name:"apps-category",params:{category:this.category}})}}},H=(i(551),Object(N.a)(Y,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("Content",{class:{"with-app-sidebar":t.app},attrs:{"app-name":"settings","content-class":{"icon-loading":t.loadingList},"navigation-class":{"icon-loading":t.loading}}},[a("AppNavigation",{scopedSlots:t._u([{key:"list",fn:function(){return[a("AppNavigationItem",{attrs:{"id":"app-category-your-apps","to":{name:"apps"},"exact":!0,"icon":"icon-category-installed","title":t.t("settings","Your apps")}}),t._v(" "),a("AppNavigationItem",{attrs:{"id":"app-category-enabled","to":{name:"apps-category",params:{category:"enabled"}},"icon":"icon-category-enabled","title":t.t("settings","Active apps")}}),t._v(" "),a("AppNavigationItem",{attrs:{"id":"app-category-disabled","to":{name:"apps-category",params:{category:"disabled"}},"icon":"icon-category-disabled","title":t.t("settings","Disabled apps")}}),t._v(" "),t.updateCount>0?a("AppNavigationItem",{attrs:{"id":"app-category-updates","to":{name:"apps-category",params:{category:"updates"}},"icon":"icon-download","title":t.t("settings","Updates")}},[a("AppNavigationCounter",{attrs:{"slot":"counter"},slot:"counter"},[t._v("\n\t\t\t\t\t"+t._s(t.updateCount)+"\n\t\t\t\t")])],1):t._e(),t._v(" "),a("AppNavigationItem",{attrs:{"id":"app-category-your-bundles","to":{name:"apps-category",params:{category:"app-bundles"}},"icon":"icon-category-app-bundles","title":t.t("settings","App bundles")}}),t._v(" "),a("AppNavigationSpacer"),t._v(" "),t.settings.appstoreEnabled?[a("AppNavigationItem",{attrs:{"id":"app-category-featured","to":{name:"apps-category",params:{category:"featured"}},"icon":"icon-favorite","title":t.t("settings","Featured apps")}}),t._v(" "),t._l(t.categories,(function(t){return a("AppNavigationItem",{key:"icon-category-"+t.ident,attrs:{"icon":"icon-category-"+t.ident,"to":{name:"apps-category",params:{category:t.ident}},"title":t.displayName}})}))]:t._e(),t._v(" "),a("AppNavigationItem",{attrs:{"id":"app-developer-docs","href":"settings.developerDocumentation","title":t.t("settings","Developer documentation")+" ↗"}})]},proxy:!0}])}),t._v(" "),a("AppContent",{staticClass:"app-settings-content",class:{"icon-loading":t.loadingList}},[a("AppList",{attrs:{"category":t.category,"app":t.app,"search":t.searchQuery}})],1),t._v(" "),t.id&&t.app?a("AppSidebar",t._b({class:{"app-sidebar--without-background":!t.appSidebar.background},on:{"close":t.hideAppDetails},scopedSlots:t._u([t.appSidebar.background?null:{key:"header",fn:function(){return[a("div",{staticClass:"app-sidebar-header__figure--default-app-icon icon-settings-dark"})]},proxy:!0},{key:"primary-actions",fn:function(){return[300===t.app.level||200===t.app.level||t.hasRating?a("div",{staticClass:"app-level"},[300===t.app.level?a("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.t("settings","This app is supported via your current Nextcloud subscription."),expression:"t('settings', 'This app is supported via your current Nextcloud subscription.')",modifiers:{"auto":!0}}],staticClass:"supported icon-checkmark-color"},[t._v("\n\t\t\t\t\t"+t._s(t.t("settings","Supported")))]):t._e(),t._v(" "),200===t.app.level?a("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.t("settings","Featured apps are developed by and within the community. They offer central functionality and are ready for production use."),expression:"t('settings', 'Featured apps are developed by and within the community. They offer central functionality and are ready for production use.')",modifiers:{"auto":!0}}],staticClass:"official icon-checkmark"},[t._v("\n\t\t\t\t\t"+t._s(t.t("settings","Featured")))]):t._e(),t._v(" "),t.hasRating?a("AppScore",{attrs:{"score":t.app.appstoreData.ratingOverall}}):t._e()],1):t._e()]},proxy:!0}],null,!0)},"AppSidebar",t.appSidebar,!1),[t._v(" "),t._v(" "),a("AppSidebarTab",{attrs:{"id":"desc","icon":"icon-category-office","name":t.t("settings","Details"),"order":0}},[a("AppDetails",{attrs:{"app":t.app}})],1),t._v(" "),t.app.appstoreData&&t.app.releases[0].translations.en.changelog?a("AppSidebarTab",{attrs:{"id":"desca","icon":"icon-category-organization","name":t.t("settings","Changelog"),"order":1}},t._l(t.app.releases,(function(e){return a("div",{key:e.version,staticClass:"app-sidebar-tabs__release"},[a("h2",[t._v(t._s(e.version))]),t._v(" "),t.changelog(e)?a("Markdown",{attrs:{"text":t.changelog(e)}}):t._e()],1)})),0):t._e()],1):t._e()],1)}),[],!1,null,"5264f008",null));a.default=H.exports}}]);
//# sourceMappingURL=vue-settings-apps-489d5f46c67b4e8fbf67.js.map?v=bd12356a182ff5f08453