29 lines
69 KiB
JavaScript
29 lines
69 KiB
JavaScript
(window.webpackJsonpSettings=window.webpackJsonpSettings||[]).push([[6],{318:function(e,t){function s(e){return"function"==typeof e.value||(console.warn("[Vue-click-outside:] provided expression",e.expression,"is not a function."),!1)}function i(e){return void 0!==e.componentInstance&&e.componentInstance.$isServer}e.exports={bind:function(e,t,n){function a(t){if(n.context){var s=t.path||t.composedPath&&t.composedPath();s&&s.length>0&&s.unshift(t.target),e.contains(t.target)||function(e,t){if(!e||!t)return!1;for(var s=0,i=t.length;s<i;s++)try{if(e.contains(t[s]))return!0;if(t[s].contains(e))return!1}catch(e){return!1}return!1}(n.context.popupItem,s)||e.__vueClickOutside__.callback(t)}}s(t)&&(e.__vueClickOutside__={handler:a,callback:t.value},!i(n)&&document.addEventListener("click",a))},update:function(e,t){s(t)&&(e.__vueClickOutside__.callback=t.value)},unbind:function(e,t,s){!i(s)&&document.removeEventListener("click",e.__vueClickOutside__.handler),delete e.__vueClickOutside__}}},319:function(e,t,s){
|
|
/*!
|
|
* vue-infinite-loading v2.4.4
|
|
* (c) 2016-2019 PeachScript
|
|
* MIT License
|
|
*/
|
|
e.exports=function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=9)}([function(e,t,s){var i=s(6);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals),(0,s(3).default)("09280948",i,!0,{})},function(e,t,s){var i=s(8);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals),(0,s(3).default)("51e4c3f9",i,!0,{})},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var s=function(e,t){var s,i=e[1]||"",n=e[3];if(!n)return i;if(t&&"function"==typeof btoa){var a=(s=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),r=n.sources.map((function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"}));return[i].concat(r).concat([a]).join("\n")}return[i].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+s+"}":s})).join("")},t.i=function(e,s){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},n=0;n<this.length;n++){var a=this[n][0];"number"==typeof a&&(i[a]=!0)}for(n=0;n<e.length;n++){var r=e[n];"number"==typeof r[0]&&i[r[0]]||(s&&!r[2]?r[2]=s:s&&(r[2]="("+r[2]+") and ("+s+")"),t.push(r))}},t}},function(e,t,s){"use strict";function i(e,t){for(var s=[],i={},n=0;n<t.length;n++){var a=t[n],r=a[0],o={id:e+":"+n,css:a[1],media:a[2],sourceMap:a[3]};i[r]?i[r].parts.push(o):s.push(i[r]={id:r,parts:[o]})}return s}s.r(t),s.d(t,"default",(function(){return h}));var n="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!n)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var a={},r=n&&(document.head||document.getElementsByTagName("head")[0]),o=null,l=0,u=!1,d=function(){},c=null,p="data-vue-ssr-id",g="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e,t,s,n){u=s,c=n||{};var r=i(e,t);return f(r),function(t){for(var s=[],n=0;n<r.length;n++){var o=r[n];(l=a[o.id]).refs--,s.push(l)}for(t?f(r=i(e,t)):r=[],n=0;n<s.length;n++){var l;if(0===(l=s[n]).refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete a[l.id]}}}}function f(e){for(var t=0;t<e.length;t++){var s=e[t],i=a[s.id];if(i){i.refs++;for(var n=0;n<i.parts.length;n++)i.parts[n](s.parts[n]);for(;n<s.parts.length;n++)i.parts.push(v(s.parts[n]));i.parts.length>s.parts.length&&(i.parts.length=s.parts.length)}else{var r=[];for(n=0;n<s.parts.length;n++)r.push(v(s.parts[n]));a[s.id]={id:s.id,refs:1,parts:r}}}}function m(){var e=document.createElement("style");return e.type="text/css",r.appendChild(e),e}function v(e){var t,s,i=document.querySelector("style["+p+'~="'+e.id+'"]');if(i){if(u)return d;i.parentNode.removeChild(i)}if(g){var n=l++;i=o||(o=m()),t=y.bind(null,i,n,!1),s=y.bind(null,i,n,!0)}else i=m(),t=function(e,t){var s=t.css,i=t.media,n=t.sourceMap;if(i&&e.setAttribute("media",i),c.ssrId&&e.setAttribute(p,t.id),n&&(s+="\n/*# sourceURL="+n.sources[0]+" */",s+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),e.styleSheet)e.styleSheet.cssText=s;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(s))}}.bind(null,i),s=function(){i.parentNode.removeChild(i)};return t(e),function(i){if(i){if(i.css===e.css&&i.media===e.media&&i.sourceMap===e.sourceMap)return;t(e=i)}else s()}}var b,w=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function y(e,t,s,i){var n=s?"":i.css;if(e.styleSheet)e.styleSheet.cssText=w(t,n);else{var a=document.createTextNode(n),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(a,r[t]):e.appendChild(a)}}},function(e,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(t){return"function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?e.exports=i=function(e){return s(e)}:e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":s(e)},i(t)}e.exports=i},function(e,t,s){"use strict";s.r(t);var i=s(0),n=s.n(i);for(var a in i)"default"!==a&&function(e){s.d(t,e,(function(){return i[e]}))}(a);t.default=n.a},function(e,t,s){(e.exports=s(2)(!1)).push([e.i,'.loading-wave-dots[data-v-46b20d22]{position:relative}.loading-wave-dots[data-v-46b20d22] .wave-item{position:absolute;top:50%;left:50%;display:inline-block;margin-top:-4px;width:8px;height:8px;border-radius:50%;-webkit-animation:loading-wave-dots-data-v-46b20d22 linear 2.8s infinite;animation:loading-wave-dots-data-v-46b20d22 linear 2.8s infinite}.loading-wave-dots[data-v-46b20d22] .wave-item:first-child{margin-left:-36px}.loading-wave-dots[data-v-46b20d22] .wave-item:nth-child(2){margin-left:-20px;-webkit-animation-delay:.14s;animation-delay:.14s}.loading-wave-dots[data-v-46b20d22] .wave-item:nth-child(3){margin-left:-4px;-webkit-animation-delay:.28s;animation-delay:.28s}.loading-wave-dots[data-v-46b20d22] .wave-item:nth-child(4){margin-left:12px;-webkit-animation-delay:.42s;animation-delay:.42s}.loading-wave-dots[data-v-46b20d22] .wave-item:last-child{margin-left:28px;-webkit-animation-delay:.56s;animation-delay:.56s}@-webkit-keyframes loading-wave-dots-data-v-46b20d22{0%{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}10%{-webkit-transform:translateY(-6px);transform:translateY(-6px);background:#999}20%{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}to{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}}@keyframes loading-wave-dots-data-v-46b20d22{0%{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}10%{-webkit-transform:translateY(-6px);transform:translateY(-6px);background:#999}20%{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}to{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}}.loading-circles[data-v-46b20d22] .circle-item{width:5px;height:5px;-webkit-animation:loading-circles-data-v-46b20d22 linear .75s infinite;animation:loading-circles-data-v-46b20d22 linear .75s infinite}.loading-circles[data-v-46b20d22] .circle-item:first-child{margin-top:-14.5px;margin-left:-2.5px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(2){margin-top:-11.26px;margin-left:6.26px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(3){margin-top:-2.5px;margin-left:9.5px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(4){margin-top:6.26px;margin-left:6.26px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(5){margin-top:9.5px;margin-left:-2.5px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(6){margin-top:6.26px;margin-left:-11.26px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(7){margin-top:-2.5px;margin-left:-14.5px}.loading-circles[data-v-46b20d22] .circle-item:last-child{margin-top:-11.26px;margin-left:-11.26px}@-webkit-keyframes loading-circles-data-v-46b20d22{0%{background:#dfdfdf}90%{background:#505050}to{background:#dfdfdf}}@keyframes loading-circles-data-v-46b20d22{0%{background:#dfdfdf}90%{background:#505050}to{background:#dfdfdf}}.loading-bubbles[data-v-46b20d22] .bubble-item{background:#666;-webkit-animation:loading-bubbles-data-v-46b20d22 linear .75s infinite;animation:loading-bubbles-data-v-46b20d22 linear .75s infinite}.loading-bubbles[data-v-46b20d22] .bubble-item:first-child{margin-top:-12.5px;margin-left:-.5px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(2){margin-top:-9.26px;margin-left:8.26px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(3){margin-top:-.5px;margin-left:11.5px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(4){margin-top:8.26px;margin-left:8.26px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(5){margin-top:11.5px;margin-left:-.5px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(6){margin-top:8.26px;margin-left:-9.26px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(7){margin-top:-.5px;margin-left:-12.5px}.loading-bubbles[data-v-46b20d22] .bubble-item:last-child{margin-top:-9.26px;margin-left:-9.26px}@-webkit-keyframes loading-bubbles-data-v-46b20d22{0%{width:1px;height:1px;box-shadow:0 0 0 3px #666}90%{width:1px;height:1px;box-shadow:0 0 0 0 #666}to{width:1px;height:1px;box-shadow:0 0 0 3px #666}}@keyframes loading-bubbles-data-v-46b20d22{0%{width:1px;height:1px;box-shadow:0 0 0 3px #666}90%{width:1px;height:1px;box-shadow:0 0 0 0 #666}to{width:1px;height:1px;box-shadow:0 0 0 3px #666}}.loading-default[data-v-46b20d22]{position:relative;border:1px solid #999;-webkit-animation:loading-rotating-data-v-46b20d22 ease 1.5s infinite;animation:loading-rotating-data-v-46b20d22 ease 1.5s infinite}.loading-default[data-v-46b20d22]:before{content:"";position:absolute;display:block;top:0;left:50%;margin-top:-3px;margin-left:-3px;width:6px;height:6px;background-color:#999;border-radius:50%}.loading-spiral[data-v-46b20d22]{border:2px solid #777;border-right-color:transparent;-webkit-animation:loading-rotating-data-v-46b20d22 linear .85s infinite;animation:loading-rotating-data-v-46b20d22 linear .85s infinite}@-webkit-keyframes loading-rotating-data-v-46b20d22{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loading-rotating-data-v-46b20d22{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.loading-bubbles[data-v-46b20d22],.loading-circles[data-v-46b20d22]{position:relative}.loading-bubbles[data-v-46b20d22] .bubble-item,.loading-circles[data-v-46b20d22] .circle-item{position:absolute;top:50%;left:50%;display:inline-block;border-radius:50%}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(2),.loading-circles[data-v-46b20d22] .circle-item:nth-child(2){-webkit-animation-delay:93ms;animation-delay:93ms}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(3),.loading-circles[data-v-46b20d22] .circle-item:nth-child(3){-webkit-animation-delay:.186s;animation-delay:.186s}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(4),.loading-circles[data-v-46b20d22] .circle-item:nth-child(4){-webkit-animation-delay:.279s;animation-delay:.279s}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(5),.loading-circles[data-v-46b20d22] .circle-item:nth-child(5){-webkit-animation-delay:.372s;animation-delay:.372s}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(6),.loading-circles[data-v-46b20d22] .circle-item:nth-child(6){-webkit-animation-delay:.465s;animation-delay:.465s}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(7),.loading-circles[data-v-46b20d22] .circle-item:nth-child(7){-webkit-animation-delay:.558s;animation-delay:.558s}.loading-bubbles[data-v-46b20d22] .bubble-item:last-child,.loading-circles[data-v-46b20d22] .circle-item:last-child{-webkit-animation-delay:.651s;animation-delay:.651s}',""])},function(e,t,s){"use strict";s.r(t);var i=s(1),n=s.n(i);for(var a in i)"default"!==a&&function(e){s.d(t,e,(function(){return i[e]}))}(a);t.default=n.a},function(e,t,s){(e.exports=s(2)(!1)).push([e.i,".infinite-loading-container[data-v-46b21138]{clear:both;text-align:center}.infinite-loading-container[data-v-46b21138] [class^=loading-]{display:inline-block;margin:5px 0;width:28px;height:28px;font-size:28px;line-height:28px;border-radius:50%}.btn-try-infinite[data-v-46b21138]{margin-top:5px;padding:5px 10px;color:#999;font-size:14px;line-height:1;background:transparent;border:1px solid #ccc;border-radius:3px;outline:none;cursor:pointer}.btn-try-infinite[data-v-46b21138]:not(:active):hover{opacity:.8}",""])},function(e,t,s){"use strict";s.r(t);var i={throttleLimit:50,loopCheckTimeout:1e3,loopCheckMaxCalls:10},n=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e={passive:!0},!0}});window.addEventListener("testpassive",t,t),window.remove("testpassive",t,t)}catch(e){}return e}(),a={STATE_CHANGER:["emit `loaded` and `complete` event through component instance of `$refs` may cause error, so it will be deprecated soon, please use the `$state` argument instead (`$state` just the special `$event` variable):","\ntemplate:",'<infinite-loading @infinite="infiniteHandler"></infinite-loading>',"\nscript:\n...\ninfiniteHandler($state) {\n ajax('https://www.example.com/api/news')\n .then((res) => {\n if (res.data.length) {\n $state.loaded();\n } else {\n $state.complete();\n }\n });\n}\n...","","more details: https://github.com/PeachScript/vue-infinite-loading/issues/57#issuecomment-324370549"].join("\n"),INFINITE_EVENT:"`:on-infinite` property will be deprecated soon, please use `@infinite` event instead.",IDENTIFIER:"the `reset` event will be deprecated soon, please reset this component by change the `identifier` property."},r={INFINITE_LOOP:["executed the callback function more than ".concat(i.loopCheckMaxCalls," times for a short time, it looks like searched a wrong scroll wrapper that doest not has fixed height or maximum height, please check it. If you want to force to set a element as scroll wrapper ranther than automatic searching, you can do this:"),'\n\x3c!-- add a special attribute for the real scroll wrapper --\x3e\n<div infinite-wrapper>\n ...\n \x3c!-- set force-use-infinite-wrapper --\x3e\n <infinite-loading force-use-infinite-wrapper></infinite-loading>\n</div>\nor\n<div class="infinite-wrapper">\n ...\n \x3c!-- set force-use-infinite-wrapper as css selector of the real scroll wrapper --\x3e\n <infinite-loading force-use-infinite-wrapper=".infinite-wrapper"></infinite-loading>\n</div>\n ',"more details: https://github.com/PeachScript/vue-infinite-loading/issues/55#issuecomment-316934169"].join("\n")},o={READY:0,LOADING:1,COMPLETE:2,ERROR:3},l={color:"#666",fontSize:"14px",padding:"10px 0"},u={mode:"development",props:{spinner:"default",distance:100,forceUseInfiniteWrapper:!1},system:i,slots:{noResults:"No results :(",noMore:"No more data :)",error:"Opps, something went wrong :(",errorBtnText:"Retry",spinner:""},WARNINGS:a,ERRORS:r,STATUS:o},d=s(4),c=s.n(d),p={BUBBLES:{render:function(e){return e("span",{attrs:{class:"loading-bubbles"}},Array.apply(Array,Array(8)).map((function(){return e("span",{attrs:{class:"bubble-item"}})})))}},CIRCLES:{render:function(e){return e("span",{attrs:{class:"loading-circles"}},Array.apply(Array,Array(8)).map((function(){return e("span",{attrs:{class:"circle-item"}})})))}},DEFAULT:{render:function(e){return e("i",{attrs:{class:"loading-default"}})}},SPIRAL:{render:function(e){return e("i",{attrs:{class:"loading-spiral"}})}},WAVEDOTS:{render:function(e){return e("span",{attrs:{class:"loading-wave-dots"}},Array.apply(Array,Array(5)).map((function(){return e("span",{attrs:{class:"wave-item"}})})))}}};function g(e,t,s,i,n,a,r,o){var l,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=s,u._compiled=!0),i&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),r?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},u._ssrRegister=l):n&&(l=o?function(){n.call(this,this.$root.$options.shadowRoot)}:n),l)if(u.functional){u._injectStyles=l;var d=u.render;u.render=function(e,t){return l.call(t),d(e,t)}}else{var c=u.beforeCreate;u.beforeCreate=c?[].concat(c,l):[l]}return{exports:e,options:u}}var h=g({name:"Spinner",computed:{spinnerView:function(){return p[(this.$attrs.spinner||"").toUpperCase()]||this.spinnerInConfig},spinnerInConfig:function(){return u.slots.spinner&&"string"==typeof u.slots.spinner?{render:function(){return this._v(u.slots.spinner)}}:"object"===c()(u.slots.spinner)?u.slots.spinner:p[u.props.spinner.toUpperCase()]||p.DEFAULT}}},(function(){var e=this.$createElement;return(this._self._c||e)(this.spinnerView,{tag:"component"})}),[],!1,(function(e){var t=s(5);t.__inject__&&t.__inject__(e)}),"46b20d22",null);h.options.__file="Spinner.vue";var f=h.exports;function m(e){"production"!==u.mode&&console.warn("[Vue-infinite-loading warn]: ".concat(e))}var v={timers:[],caches:[],throttle:function(e){var t=this;-1===this.caches.indexOf(e)&&(this.caches.push(e),this.timers.push(setTimeout((function(){e(),t.caches.splice(t.caches.indexOf(e),1),t.timers.shift()}),u.system.throttleLimit)))},reset:function(){this.timers.forEach((function(e){clearTimeout(e)})),this.timers.length=0,this.caches=[]}},b={isChecked:!1,timer:null,times:0,track:function(){var e=this;this.times+=1,clearTimeout(this.timer),this.timer=setTimeout((function(){e.isChecked=!0}),u.system.loopCheckTimeout),this.times>u.system.loopCheckMaxCalls&&(function(e){console.error("[Vue-infinite-loading error]: ".concat(e))}(r.INFINITE_LOOP),this.isChecked=!0)}},w={key:"_infiniteScrollHeight",getScrollElm:function(e){return e===window?document.documentElement:e},save:function(e){var t=this.getScrollElm(e);t[this.key]=t.scrollHeight},restore:function(e){var t=this.getScrollElm(e);"number"==typeof t[this.key]&&(t.scrollTop=t.scrollHeight-t[this.key]+t.scrollTop),this.remove(t)},remove:function(e){void 0!==e[this.key]&&delete e[this.key]}};function y(e){return e.offsetWidth+e.offsetHeight>0}var _=g({name:"InfiniteLoading",data:function(){return{scrollParent:null,scrollHandler:null,isFirstLoad:!0,status:o.READY,slots:u.slots}},components:{Spinner:f},computed:{isShowSpinner:function(){return this.status===o.LOADING},isShowError:function(){return this.status===o.ERROR},isShowNoResults:function(){return this.status===o.COMPLETE&&this.isFirstLoad},isShowNoMore:function(){return this.status===o.COMPLETE&&!this.isFirstLoad},slotStyles:function(){var e=this,t={};return Object.keys(u.slots).forEach((function(s){var i=function(e){return e.replace(/[A-Z]/g,(function(e){return"-".concat(e.toLowerCase())}))}(s);(!e.$slots[i]&&!u.slots[s].render||e.$slots[i]&&!e.$slots[i][0].tag)&&(t[s]=l)})),t}},props:{distance:{type:Number,default:u.props.distance},spinner:String,direction:{type:String,default:"bottom"},forceUseInfiniteWrapper:{type:[Boolean,String],default:u.props.forceUseInfiniteWrapper},identifier:{default:+new Date},onInfinite:Function},watch:{identifier:function(){this.stateChanger.reset()}},mounted:function(){var e=this;this.$watch("forceUseInfiniteWrapper",(function(){e.scrollParent=e.getScrollParent()}),{immediate:!0}),this.scrollHandler=function(t){e.status===o.READY&&(t&&t.constructor===Event&&y(e.$el)?v.throttle(e.attemptLoad):e.attemptLoad())},setTimeout((function(){e.scrollHandler(),e.scrollParent.addEventListener("scroll",e.scrollHandler,n)}),1),this.$on("$InfiniteLoading:loaded",(function(t){e.isFirstLoad=!1,"top"===e.direction&&e.$nextTick((function(){w.restore(e.scrollParent)})),e.status===o.LOADING&&e.$nextTick(e.attemptLoad.bind(null,!0)),t&&t.target===e||m(a.STATE_CHANGER)})),this.$on("$InfiniteLoading:complete",(function(t){e.status=o.COMPLETE,e.$nextTick((function(){e.$forceUpdate()})),e.scrollParent.removeEventListener("scroll",e.scrollHandler,n),t&&t.target===e||m(a.STATE_CHANGER)})),this.$on("$InfiniteLoading:reset",(function(t){e.status=o.READY,e.isFirstLoad=!0,w.remove(e.scrollParent),e.scrollParent.addEventListener("scroll",e.scrollHandler,n),setTimeout((function(){v.reset(),e.scrollHandler()}),1),t&&t.target===e||m(a.IDENTIFIER)})),this.stateChanger={loaded:function(){e.$emit("$InfiniteLoading:loaded",{target:e})},complete:function(){e.$emit("$InfiniteLoading:complete",{target:e})},reset:function(){e.$emit("$InfiniteLoading:reset",{target:e})},error:function(){e.status=o.ERROR,v.reset()}},this.onInfinite&&m(a.INFINITE_EVENT)},deactivated:function(){this.status===o.LOADING&&(this.status=o.READY),this.scrollParent.removeEventListener("scroll",this.scrollHandler,n)},activated:function(){this.scrollParent.addEventListener("scroll",this.scrollHandler,n)},methods:{attemptLoad:function(e){var t=this;this.status!==o.COMPLETE&&y(this.$el)&&this.getCurrentDistance()<=this.distance?(this.status=o.LOADING,"top"===this.direction&&this.$nextTick((function(){w.save(t.scrollParent)})),"function"==typeof this.onInfinite?this.onInfinite.call(null,this.stateChanger):this.$emit("infinite",this.stateChanger),!e||this.forceUseInfiniteWrapper||b.isChecked||b.track()):this.status===o.LOADING&&(this.status=o.READY)},getCurrentDistance:function(){return"top"===this.direction?"number"==typeof this.scrollParent.scrollTop?this.scrollParent.scrollTop:this.scrollParent.pageYOffset:this.$el.getBoundingClientRect().top-(this.scrollParent===window?window.innerHeight:this.scrollParent.getBoundingClientRect().bottom)},getScrollParent:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$el;return"string"==typeof this.forceUseInfiniteWrapper&&(e=t.querySelector(this.forceUseInfiniteWrapper)),e||("BODY"===t.tagName?e=window:!this.forceUseInfiniteWrapper&&["scroll","auto"].indexOf(getComputedStyle(t).overflowY)>-1?e=t:(t.hasAttribute("infinite-wrapper")||t.hasAttribute("data-infinite-wrapper"))&&(e=t)),e||this.getScrollParent(t.parentNode)}},destroyed:function(){!this.status!==o.COMPLETE&&(v.reset(),w.remove(this.scrollParent),this.scrollParent.removeEventListener("scroll",this.scrollHandler,n))}},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"infinite-loading-container"},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.isShowSpinner,expression:"isShowSpinner"}],staticClass:"infinite-status-prompt",style:e.slotStyles.spinner},[e._t("spinner",[s("spinner",{attrs:{spinner:e.spinner}})])],2),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isShowNoResults,expression:"isShowNoResults"}],staticClass:"infinite-status-prompt",style:e.slotStyles.noResults},[e._t("no-results",[e.slots.noResults.render?s(e.slots.noResults,{tag:"component"}):[e._v(e._s(e.slots.noResults))]])],2),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isShowNoMore,expression:"isShowNoMore"}],staticClass:"infinite-status-prompt",style:e.slotStyles.noMore},[e._t("no-more",[e.slots.noMore.render?s(e.slots.noMore,{tag:"component"}):[e._v(e._s(e.slots.noMore))]])],2),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isShowError,expression:"isShowError"}],staticClass:"infinite-status-prompt",style:e.slotStyles.error},[e._t("error",[e.slots.error.render?s(e.slots.error,{tag:"component",attrs:{trigger:e.attemptLoad}}):[e._v("\n "+e._s(e.slots.error)+"\n "),s("br"),e._v(" "),s("button",{staticClass:"btn-try-infinite",domProps:{textContent:e._s(e.slots.errorBtnText)},on:{click:e.attemptLoad}})]],{trigger:e.attemptLoad})],2)])}),[],!1,(function(e){var t=s(7);t.__inject__&&t.__inject__(e)}),"46b21138",null);_.options.__file="InfiniteLoading.vue";var C=_.exports;function x(e){u.mode=e.config.productionTip?"development":"production"}Object.defineProperty(C,"install",{configurable:!1,enumerable:!1,value:function(e,t){Object.assign(u.props,t&&t.props),Object.assign(u.slots,t&&t.slots),Object.assign(u.system,t&&t.system),e.component("infinite-loading",C),x(e)}}),"undefined"!=typeof window&&window.Vue&&(window.Vue.component("infinite-loading",C),x(window.Vue)),t.default=C}])},329:function(e,s,i){"use strict";i.r(s);var n=i(4),a=i(317),r=i.n(a),o=i(122),l=i(318),u=i.n(l),d=i(265),c=i(136);function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}
|
|
/**
|
|
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
*
|
|
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
*
|
|
* @license GNU AGPL version 3 or any later version
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/var g={props:{user:{type:Object,required:!0},settings:{type:Object,default:function(){return{}}},groups:{type:Array,default:function(){return[]}},subAdminsGroups:{type:Array,default:function(){return[]}},quotaOptions:{type:Array,default:function(){return[]}},showConfig:{type:Object,default:function(){return{}}},languages:{type:Array,required:!0},externalActions:{type:Array,default:function(){return[]}}},computed:{userGroups:function(){var e=this,t=this.groups.filter((function(t){return e.user.groups.includes(t.id)}));return t},userSubAdminsGroups:function(){var e=this,t=this.subAdminsGroups.filter((function(t){return e.user.subadmin.includes(t.id)}));return t},availableGroups:function(){var e=this;return this.groups.map((function(t){var s=Object.assign({},t);return s.$isDisabled=!1===t.canAdd&&!e.user.groups.includes(t.id)||!1===t.canRemove&&e.user.groups.includes(t.id),s}))},usedSpace:function(){return this.user.quota.used?t("settings","{size} used",{size:OC.Util.humanFileSize(this.user.quota.used)}):t("settings","{size} used",{size:OC.Util.humanFileSize(0)})},usedQuota:function(){var e=this.user.quota.quota;e>0?e=Math.min(100,Math.round(this.user.quota.used/e*100)):e=95*(1-1/(this.user.quota.used/(10*Math.pow(2,30))+1));return isNaN(e)?0:e},userQuota:function(){if(this.user.quota.quota>=0){var e=OC.Util.humanFileSize(this.user.quota.quota),t=this.quotaOptions.find((function(t){return t.id===e}));return t||{id:e,label:e}}return"default"===this.user.quota.quota?this.quotaOptions[0]:this.quotaOptions[1]},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},userLanguage:function(){var e=this,t=this.languages[0].languages.concat(this.languages[1].languages).find((function(t){return t.code===e.user.language}));return"object"!==p(t)&&""!==this.user.language?{code:this.user.language,name:this.user.language}:""!==this.user.language&&t},userLastLoginTooltip:function(){return this.user.lastLogin>0?OC.Util.formatDate(this.user.lastLogin):""},userLastLogin:function(){return this.user.lastLogin>0?OC.Util.relativeModifiedDate(this.user.lastLogin):t("settings","Never")}},methods:{generateAvatar:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;return OC.generateUrl("/avatar/{user}/{size}?v={version}",{user:e,size:t,version:oc_userconfig.avatar.version})}}},h={name:"UserRowSimple",components:{PopoverMenu:o.PopoverMenu,ActionButton:o.ActionButton,Actions:o.Actions},directives:{ClickOutside:u.a},mixins:[g],props:{user:{type:Object,required:!0},loading:{type:Object,required:!0},showConfig:{type:Object,required:!0},userActions:{type:Array,required:!0},openedMenu:{type:Boolean,required:!0},feedbackMessage:{type:String,required:!0},subAdminsGroups:{type:Array,required:!0},settings:{type:Object,required:!0}},computed:{userGroupsLabels:function(){return this.userGroups.map((function(e){return e.name})).join(", ")},userSubAdminsGroupsLabels:function(){return this.userSubAdminsGroups.map((function(e){return e.name})).join(", ")},usedSpace:function(){return this.user.quota.used?t("settings","{size} used",{size:OC.Util.humanFileSize(this.user.quota.used)}):t("settings","{size} used",{size:OC.Util.humanFileSize(0)})},canEdit:function(){return Object(c.getCurrentUser)().uid!==this.user.id&&"admin"!==this.user.id}},methods:{hideMenu:function(){this.$emit("hideMenu")},toggleEdit:function(){this.$emit("update:editing",!0)}}},f=i(26),m=Object(f.a)(h,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"row",class:{disabled:e.loading.delete||e.loading.disable},attrs:{"data-id":e.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":e.loading.delete||e.loading.disable||e.loading.wipe}},[e.loading.delete||e.loading.disable||e.loading.wipe?e._e():s("img",{attrs:{alt:"",width:"32",height:"32",src:e.generateAvatar(e.user.id,32),srcset:e.generateAvatar(e.user.id,64)+" 2x, "+e.generateAvatar(e.user.id,128)+" 4x"}})]),e._v(" "),s("div",{staticClass:"name"},[e._v("\n\t\t"+e._s(e.user.id)+"\n\t\t"),s("div",{staticClass:"displayName subtitle"},[e._v("\n\t\t\t"+e._s(e.user.displayname)+"\n\t\t")])]),e._v(" "),s("div"),e._v(" "),s("div",{staticClass:"mailAddress"},[e._v("\n\t\t"+e._s(e.user.email)+"\n\t")]),e._v(" "),s("div",{staticClass:"groups"},[e._v("\n\t\t"+e._s(e.userGroupsLabels)+"\n\t")]),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?s("div",{staticClass:"subAdminsGroups"},[e._v("\n\t\t"+e._s(e.userSubAdminsGroupsLabels)+"\n\t")]):e._e(),e._v(" "),s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.usedSpace,expression:"usedSpace",modifiers:{auto:!0}}],staticClass:"quota"},[s("progress",{staticClass:"quota-user-progress",class:{warn:e.usedQuota>80},attrs:{max:"100"},domProps:{value:e.usedQuota}})]),e._v(" "),e.showConfig.showLanguages?s("div",{staticClass:"languages"},[e._v("\n\t\t"+e._s(e.userLanguage.name)+"\n\t")]):e._e(),e._v(" "),e.showConfig.showUserBackend||e.showConfig.showStoragePath?s("div",{staticClass:"userBackend"},[e.showConfig.showUserBackend?s("div",{staticClass:"userBackend"},[e._v("\n\t\t\t"+e._s(e.user.backend)+"\n\t\t")]):e._e(),e._v(" "),e.showConfig.showStoragePath?s("div",{staticClass:"storageLocation subtitle"},[e._v("\n\t\t\t"+e._s(e.user.storageLocation)+"\n\t\t")]):e._e()]):e._e(),e._v(" "),e.showConfig.showLastLogin?s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.userLastLoginTooltip,expression:"userLastLoginTooltip",modifiers:{auto:!0}}],staticClass:"lastLogin"},[e._v("\n\t\t"+e._s(e.userLastLogin)+"\n\t")]):e._e(),e._v(" "),s("div",{staticClass:"userActions"},[e.canEdit&&!e.loading.all?s("div",{staticClass:"toggleUserActions"},[s("Actions",[s("ActionButton",{attrs:{icon:"icon-rename"},on:{click:e.toggleEdit}},[e._v("\n\t\t\t\t\t"+e._s(e.t("settings","Edit User"))+"\n\t\t\t\t")])],1),e._v(" "),s("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideMenu,expression:"hideMenu"}],staticClass:"icon-more",on:{click:function(t){return e.$emit("toggleMenu")}}}),e._v(" "),s("div",{staticClass:"popovermenu",class:{open:e.openedMenu}},[s("PopoverMenu",{attrs:{menu:e.userActions}})],1)],1):e._e(),e._v(" "),s("div",{staticClass:"feedback",style:{opacity:""!==e.feedbackMessage?1:0}},[s("div",{staticClass:"icon-checkmark"}),e._v("\n\t\t\t"+e._s(e.feedbackMessage)+"\n\t\t")])])])}),[],!1,null,"2b9eb13a",null).exports;n.default.use(d.a);var v={name:"UserRow",components:{UserRowSimple:m,PopoverMenu:o.PopoverMenu,Actions:o.Actions,ActionButton:o.ActionButton,Multiselect:o.Multiselect},directives:{ClickOutside:u.a},mixins:[g],props:{user:{type:Object,required:!0},settings:{type:Object,default:function(){return{}}},groups:{type:Array,default:function(){return[]}},subAdminsGroups:{type:Array,default:function(){return[]}},quotaOptions:{type:Array,default:function(){return[]}},showConfig:{type:Object,default:function(){return{}}},languages:{type:Array,required:!0},externalActions:{type:Array,default:function(){return[]}}},data:function(){return{rand:parseInt(1e3*Math.random()),openedMenu:!1,feedbackMessage:"",editing:!1,loading:{all:!1,displayName:!1,password:!1,mailAddress:!1,groups:!1,subadmins:!1,quota:!1,delete:!1,disable:!1,languages:!1,wipe:!1}}},computed:{userActions:function(){var e=[{icon:"icon-delete",text:t("settings","Delete user"),action:this.deleteUser},{icon:"icon-delete",text:t("settings","Wipe all devices"),action:this.wipeUserDevices},{icon:this.user.enabled?"icon-close":"icon-add",text:this.user.enabled?t("settings","Disable user"):t("settings","Enable user"),action:this.enableDisableUser}];return null!==this.user.email&&""!==this.user.email&&e.push({icon:"icon-mail",text:t("settings","Resend welcome email"),action:this.sendWelcomeMail}),e.concat(this.externalActions)}},methods:{toggleMenu:function(){this.openedMenu=!this.openedMenu},hideMenu:function(){this.openedMenu=!1},wipeUserDevices:function(){var e=this,s=this.user.id;OC.dialogs.confirmDestructive(t("settings","In case of lost device or exiting the organization, this can remotely wipe the Nextcloud data from all devices associated with {userid}. Only works if the devices are connected to the internet.",{userid:s}),t("settings","Remote wipe of devices"),{type:OC.dialogs.YES_NO_BUTTONS,confirm:t("settings","Wipe {userid}'s devices",{userid:s}),confirmClasses:"error",cancel:t("settings","Cancel")},(function(t){t&&(e.loading.wipe=!0,e.loading.all=!0,e.$store.dispatch("wipeUserDevices",s).then((function(){e.loading.wipe=!1,e.loading.all=!1})))}),!0)},deleteUser:function(){var e=this,s=this.user.id;OC.dialogs.confirmDestructive(t("settings","Fully delete {userid}'s account including all their personal files, app data, etc.",{userid:s}),t("settings","Account deletion"),{type:OC.dialogs.YES_NO_BUTTONS,confirm:t("settings","Delete {userid}'s account",{userid:s}),confirmClasses:"error",cancel:t("settings","Cancel")},(function(t){if(t)return e.loading.delete=!0,e.loading.all=!0,e.$store.dispatch("deleteUser",s).then((function(){e.loading.delete=!1,e.loading.all=!1}))}),!0)},enableDisableUser:function(){var e=this;this.loading.delete=!0,this.loading.all=!0;var t=this.user.id,s=!this.user.enabled;return this.$store.dispatch("enableDisableUser",{userid:t,enabled:s}).then((function(){e.loading.delete=!1,e.loading.all=!1}))},updateDisplayName:function(){var e=this,t=this.$refs.displayName.value;this.loading.displayName=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"displayname",value:t}).then((function(){e.loading.displayName=!1,e.$refs.displayName.value=t}))},updatePassword:function(){var e=this,t=this.$refs.password.value;this.loading.password=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"password",value:t}).then((function(){e.loading.password=!1,e.$refs.password.value=""}))},updateEmail:function(){var e=this,t=this.$refs.mailAddress.value;this.loading.mailAddress=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"email",value:t}).then((function(){e.loading.mailAddress=!1,e.$refs.mailAddress.value=t}))},createGroup:function(e){var t;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return this.loading={groups:!0,subadmins:!0},s.prev=1,s.next=4,regeneratorRuntime.awrap(this.$store.dispatch("addGroup",e));case 4:return t=this.user.id,s.next=7,regeneratorRuntime.awrap(this.$store.dispatch("addUserGroup",{userid:t,gid:e}));case 7:s.next=12;break;case 9:s.prev=9,s.t0=s.catch(1),console.error(s.t0);case 12:return s.prev=12,this.loading={groups:!1,subadmins:!1},s.finish(12);case 15:return s.abrupt("return",this.$store.getters.getGroups[this.groups.length]);case 16:case"end":return s.stop()}}),null,this,[[1,9,12,15]])},addUserGroup:function(e){var t,s;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(!1!==e.canAdd){i.next=2;break}return i.abrupt("return",!1);case 2:return this.loading.groups=!0,t=this.user.id,s=e.id,i.prev=5,i.next=8,regeneratorRuntime.awrap(this.$store.dispatch("addUserGroup",{userid:t,gid:s}));case 8:i.next=13;break;case 10:i.prev=10,i.t0=i.catch(5),console.error(i.t0);case 13:return i.prev=13,this.loading.groups=!1,i.finish(13);case 16:case"end":return i.stop()}}),null,this,[[5,10,13,16]])},removeUserGroup:function(e){var t,s;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(!1!==e.canRemove){i.next=2;break}return i.abrupt("return",!1);case 2:return this.loading.groups=!0,t=this.user.id,s=e.id,i.prev=5,i.next=8,regeneratorRuntime.awrap(this.$store.dispatch("removeUserGroup",{userid:t,gid:s}));case 8:this.loading.groups=!1,this.$route.params.selectedGroup===s&&this.$store.commit("deleteUser",t),i.next=15;break;case 12:i.prev=12,i.t0=i.catch(5),this.loading.groups=!1;case 15:case"end":return i.stop()}}),null,this,[[5,12]])},addUserSubAdmin:function(e){var t,s;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return this.loading.subadmins=!0,t=this.user.id,s=e.id,i.prev=3,i.next=6,regeneratorRuntime.awrap(this.$store.dispatch("addUserSubAdmin",{userid:t,gid:s}));case 6:this.loading.subadmins=!1,i.next=12;break;case 9:i.prev=9,i.t0=i.catch(3),console.error(i.t0);case 12:case"end":return i.stop()}}),null,this,[[3,9]])},removeUserSubAdmin:function(e){var t,s;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return this.loading.subadmins=!0,t=this.user.id,s=e.id,i.prev=3,i.next=6,regeneratorRuntime.awrap(this.$store.dispatch("removeUserSubAdmin",{userid:t,gid:s}));case 6:i.next=11;break;case 8:i.prev=8,i.t0=i.catch(3),console.error(i.t0);case 11:return i.prev=11,this.loading.subadmins=!1,i.finish(11);case 14:case"end":return i.stop()}}),null,this,[[3,8,11,14]])},setUserQuota:function(){var e,t=arguments;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return e=t.length>0&&void 0!==t[0]?t[0]:"none",this.loading.quota=!0,e=e.id?e.id:e,s.prev=3,s.next=6,regeneratorRuntime.awrap(this.$store.dispatch("setUserData",{userid:this.user.id,key:"quota",value:e}));case 6:s.next=11;break;case 8:s.prev=8,s.t0=s.catch(3),console.error(s.t0);case 11:return s.prev=11,this.loading.quota=!1,s.finish(11);case 14:return s.abrupt("return",e);case 15:case"end":return s.stop()}}),null,this,[[3,8,11,14]])},validateQuota:function(e){var t=OC.Util.computerFileSize(e);return null!==t&&t>=0&&this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(e)))},setUserLanguage:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading.languages=!0,t.prev=1,t.next=4,regeneratorRuntime.awrap(this.$store.dispatch("setUserData",{userid:this.user.id,key:"language",value:e.code}));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),console.error(t.t0);case 9:return t.prev=9,this.loading.languages=!1,t.finish(9);case 12:return t.abrupt("return",e);case 13:case"end":return t.stop()}}),null,this,[[1,6,9,12]])},sendWelcomeMail:function(){var e=this;this.loading.all=!0,this.$store.dispatch("sendWelcomeMail",this.user.id).then((function(s){s&&(e.feedbackMessage=t("setting","Welcome mail sent!"),setTimeout((function(){e.feedbackMessage=""}),2e3)),e.loading.all=!1}))}}},b=Object(f.a)(v,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return 1===Object.keys(e.user).length?s("div",{staticClass:"row",attrs:{"data-id":e.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":e.loading.delete||e.loading.disable||e.loading.wipe}},[e.loading.delete||e.loading.disable||e.loading.wipe?e._e():s("img",{attrs:{src:e.generateAvatar(e.user.id,32),srcset:e.generateAvatar(e.user.id,64)+" 2x, "+e.generateAvatar(e.user.id,128)+" 4x",alt:"",height:"32",width:"32"}})]),e._v(" "),s("div",{staticClass:"name"},[e._v("\n\t\t"+e._s(e.user.id)+"\n\t")]),e._v(" "),s("div",{staticClass:"obfuscated"},[e._v("\n\t\t"+e._s(e.t("settings","You do not have permissions to see the details of this user"))+"\n\t")])]):e.editing?s("div",{staticClass:"row row--editable",class:{disabled:e.loading.delete||e.loading.disable},attrs:{"data-id":e.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":e.loading.delete||e.loading.disable||e.loading.wipe}},[e.loading.delete||e.loading.disable||e.loading.wipe?e._e():s("img",{attrs:{src:e.generateAvatar(e.user.id,32),srcset:e.generateAvatar(e.user.id,64)+" 2x, "+e.generateAvatar(e.user.id,128)+" 4x",alt:"",height:"32",width:"32"}})]),e._v(" "),s("div",{staticClass:"displayName"},[s("form",{staticClass:"displayName",class:{"icon-loading-small":e.loading.displayName},on:{submit:function(t){return t.preventDefault(),e.updateDisplayName(t)}}},[e.user.backendCapabilities.setDisplayName?[e.user.backendCapabilities.setDisplayName?s("input",{ref:"displayName",attrs:{id:"displayName"+e.user.id+e.rand,disabled:e.loading.displayName||e.loading.all,autocapitalize:"off",autocomplete:"new-password",autocorrect:"off",spellcheck:"false",type:"text"},domProps:{value:e.user.displayname}}):e._e(),e._v(" "),e.user.backendCapabilities.setDisplayName?s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}}):e._e()]:s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.t("settings","The backend does not support changing the display name"),expression:"t('settings', 'The backend does not support changing the display name')",modifiers:{auto:!0}}],staticClass:"name"})],2)]),e._v(" "),e.settings.canChangePassword&&e.user.backendCapabilities.setPassword?s("form",{staticClass:"password",class:{"icon-loading-small":e.loading.password},on:{submit:function(t){return t.preventDefault(),e.updatePassword(t)}}},[s("input",{ref:"password",attrs:{id:"password"+e.user.id+e.rand,disabled:e.loading.password||e.loading.all,minlength:e.minPasswordLength,placeholder:e.t("settings","Add new password"),autocapitalize:"off",autocomplete:"new-password",autocorrect:"off",required:"",spellcheck:"false",type:"password",value:""}}),e._v(" "),s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]):s("div"),e._v(" "),s("form",{staticClass:"mailAddress",class:{"icon-loading-small":e.loading.mailAddress},on:{submit:function(t){return t.preventDefault(),e.updateEmail(t)}}},[s("input",{ref:"mailAddress",attrs:{id:"mailAddress"+e.user.id+e.rand,disabled:e.loading.mailAddress||e.loading.all,placeholder:e.t("settings","Add new email address"),autocapitalize:"off",autocomplete:"new-password",autocorrect:"off",spellcheck:"false",type:"email"},domProps:{value:e.user.email}}),e._v(" "),s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]),e._v(" "),s("div",{staticClass:"groups",class:{"icon-loading-small":e.loading.groups}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,disabled:e.loading.groups||e.loading.all,limit:2,multiple:!0,options:e.availableGroups,placeholder:e.t("settings","Add user in group"),"tag-width":60,taggable:e.settings.isAdmin,value:e.userGroups,label:"name","tag-placeholder":"create","track-by":"id"},on:{remove:e.removeUserGroup,select:e.addUserGroup,tag:e.createGroup}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?s("div",{staticClass:"subadmins",class:{"icon-loading-small":e.loading.subadmins}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,disabled:e.loading.subadmins||e.loading.all,limit:2,multiple:!0,options:e.subAdminsGroups,placeholder:e.t("settings","Set user as admin for"),"tag-width":60,value:e.userSubAdminsGroups,label:"name","track-by":"id"},on:{remove:e.removeUserSubAdmin,select:e.addUserSubAdmin}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1):e._e(),e._v(" "),s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.usedSpace,expression:"usedSpace",modifiers:{auto:!0}}],staticClass:"quota",class:{"icon-loading-small":e.loading.quota}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,disabled:e.loading.quota||e.loading.all,options:e.quotaOptions,placeholder:e.t("settings","Select user quota"),taggable:!0,value:e.userQuota,label:"label","tag-placeholder":"create","track-by":"id"},on:{input:e.setUserQuota,tag:e.validateQuota}})],1),e._v(" "),e.showConfig.showLanguages?s("div",{staticClass:"languages",class:{"icon-loading-small":e.loading.languages}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,disabled:e.loading.languages||e.loading.all,options:e.languages,placeholder:e.t("settings","No language set"),value:e.userLanguage,"group-label":"label","group-values":"languages",label:"name","track-by":"code"},on:{input:e.setUserLanguage}})],1):e._e(),e._v(" "),e.showConfig.showStoragePath||e.showConfig.showUserBackend?s("div",{staticClass:"storageLocation"}):e._e(),e._v(" "),e.showConfig.showLastLogin?s("div"):e._e(),e._v(" "),s("div",{staticClass:"userActions"},[e.OC.currentUser===e.user.id||"admin"===e.user.id||e.loading.all?e._e():s("div",{staticClass:"toggleUserActions"},[s("Actions",[s("ActionButton",{attrs:{icon:"icon-checkmark"},on:{click:function(t){e.editing=!1}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("settings","Done"))+"\n\t\t\t\t")])],1),e._v(" "),s("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideMenu,expression:"hideMenu"}],staticClass:"icon-more",on:{click:e.toggleMenu}}),e._v(" "),s("div",{staticClass:"popovermenu",class:{open:e.openedMenu}},[s("PopoverMenu",{attrs:{menu:e.userActions}})],1)],1),e._v(" "),s("div",{staticClass:"feedback",style:{opacity:""!==e.feedbackMessage?1:0}},[s("div",{staticClass:"icon-checkmark"}),e._v("\n\t\t\t"+e._s(e.feedbackMessage)+"\n\t\t")])])]):s("UserRowSimple",{attrs:{editing:e.editing,"feedback-message":e.feedbackMessage,groups:e.groups,languages:e.languages,loading:e.loading,"opened-menu":e.openedMenu,settings:e.settings,"show-config":e.showConfig,"sub-admins-groups":e.subAdminsGroups,"user-actions":e.userActions,user:e.user},on:{"update:editing":function(t){e.editing=t},hideMenu:e.hideMenu,toggleMenu:e.toggleMenu}})}),[],!1,null,null,null).exports,w=i(319),y=i.n(w),_={id:"none",label:t("settings","Unlimited")},C={id:"default",label:t("settings","Default quota")},x={id:"",displayName:"",password:"",mailAddress:"",groups:[],subAdminsGroups:[],quota:C,language:{code:"en",name:t("settings","Default language")}},k={name:"UserList",components:{userRow:b,Multiselect:o.Multiselect,InfiniteLoading:y.a},props:{users:{type:Array,default:function(){return[]}},showConfig:{type:Object,required:!0},selectedGroup:{type:String,default:null},externalActions:{type:Array,default:function(){return[]}}},data:function(){return{unlimitedQuota:_,defaultQuota:C,loading:{all:!1,groups:!1},scrolled:!1,searchQuery:"",newUser:Object.assign({},x)}},computed:{settings:function(){return this.$store.getters.getServerData},filteredUsers:function(){return"disabled"===this.selectedGroup?this.users.filter((function(e){return!1===e.enabled})):this.settings.isAdmin?this.users.filter((function(e){return!1!==e.enabled})):this.users.filter((function(e){return!1!==e.enabled&&e.id!==OC.getCurrentUser().uid}))},groups:function(){return this.$store.getters.getGroups.filter((function(e){return"disabled"!==e.id})).sort((function(e,t){return e.name.localeCompare(t.name)}))},canAddGroups:function(){return this.groups.map((function(e){return(e=Object.assign({},e)).$isDisabled=!1===e.canAdd,e}))},subAdminsGroups:function(){return this.$store.getters.getSubadminGroups},quotaOptions:function(){var e=this.settings.quotaPreset.reduce((function(e,t){return e.concat({id:t,label:t})}),[]);return e.unshift(this.unlimitedQuota),e.unshift(this.defaultQuota),e},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},usersCount:function(){return this.users.length},languages:function(){return[{label:t("settings","Common languages"),languages:this.settings.languages.commonlanguages},{label:t("settings","All languages"),languages:this.settings.languages.languages}]}},watch:{selectedGroup:function(e,t){this.redirectIfDisabled(),this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset(),this.setNewUserDefaultGroup(e)},usersCount:function(e,t){0===e&&1===t?this.$refs.infiniteLoading.stateChanger.reset():1===e&&0===t&&this.$refs.infiniteLoading.stateChanger.loaded()}},mounted:function(){this.settings.canChangePassword||OC.Notification.showTemporary(t("settings","Password change is disabled because the master key is disabled")),this.resetForm(),this.userSearch=new OCA.Search(this.search,this.resetSearch),this.redirectIfDisabled()},methods:{onScroll:function(e){this.scrolled=e.target.scrollTo>0},validateQuota:function(e){var t=OC.Util.computerFileSize(e);return null!==t&&t>=0?(e=OC.Util.humanFileSize(OC.Util.computerFileSize(e)),this.newUser.quota={id:e,label:e},this.newUser.quota):(this.newUser.quota=this.quotaOptions[0],this.quotaOptions[0])},infiniteHandler:function(e){this.$store.dispatch("getUsers",{offset:this.usersOffset,limit:this.usersLimit,group:"disabled"!==this.selectedGroup?this.selectedGroup:"",search:this.searchQuery}).then((function(t){t?e.loaded():e.complete()}))},search:function(e){this.searchQuery=e,this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset()},resetSearch:function(){this.search("")},resetForm:function(){this.newUser=Object.assign({},x),this.settings.defaultLanguage&&n.default.set(this.newUser.language,"code",this.settings.defaultLanguage),this.setNewUserDefaultGroup(this.selectedGroup),this.loading.all=!1},createUser:function(){var e=this;this.loading.all=!0,this.$store.dispatch("addUser",{userid:this.newUser.id,password:this.newUser.password,displayName:this.newUser.displayName,email:this.newUser.mailAddress,groups:this.newUser.groups.map((function(e){return e.id})),subadmin:this.newUser.subAdminsGroups.map((function(e){return e.id})),quota:this.newUser.quota.id,language:this.newUser.language.code}).then((function(){e.resetForm(),e.$refs.newusername.focus()})).catch((function(t){if(e.loading.all=!1,t.response&&t.response.data&&t.response.data.ocs&&t.response.data.ocs.meta){var s=t.response.data.ocs.meta.statuscode;102===s?e.$refs.newusername.focus():107===s&&e.$refs.newuserpassword.focus()}}))},setNewUserDefaultGroup:function(e){if(e&&e.length>0){var t=this.groups.find((function(t){return t.id===e}));if(t)return void(this.newUser.groups=[t])}this.newUser.groups=[]},createGroup:function(e){var t=this;return this.loading.groups=!0,this.$store.dispatch("addGroup",e).then((function(s){t.newUser.groups.push(t.groups.find((function(t){return t.id===e}))),t.loading.groups=!1})).catch((function(){t.loading.groups=!1})),this.$store.getters.getGroups[this.groups.length]},redirectIfDisabled:function(){var e=this.$store.getters.getGroups;"disabled"===this.selectedGroup&&e.findIndex((function(e){return"disabled"===e.id&&0===e.usercount}))>-1&&(this.$router.push({name:"users"}),this.$refs.infiniteLoading.stateChanger.reset())}}},A=Object(f.a)(k,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"user-list-grid",attrs:{id:"app-content"},on:{"&scroll":function(t){return e.onScroll(t)}}},[s("div",{staticClass:"row",class:{sticky:e.scrolled&&!e.showConfig.showNewUserForm},attrs:{id:"grid-header"}},[s("div",{staticClass:"avatar",attrs:{id:"headerAvatar"}}),e._v(" "),s("div",{staticClass:"name",attrs:{id:"headerName"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Username"))+"\n\n\t\t\t"),s("div",{staticClass:"subtitle"},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Display name"))+"\n\t\t\t")])]),e._v(" "),s("div",{staticClass:"password",attrs:{id:"headerPassword"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Password"))+"\n\t\t")]),e._v(" "),s("div",{staticClass:"mailAddress",attrs:{id:"headerAddress"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Email"))+"\n\t\t")]),e._v(" "),s("div",{staticClass:"groups",attrs:{id:"headerGroups"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Groups"))+"\n\t\t")]),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?s("div",{staticClass:"subadmins",attrs:{id:"headerSubAdmins"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Group admin for"))+"\n\t\t")]):e._e(),e._v(" "),s("div",{staticClass:"quota",attrs:{id:"headerQuota"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Quota"))+"\n\t\t")]),e._v(" "),e.showConfig.showLanguages?s("div",{staticClass:"languages",attrs:{id:"headerLanguages"}},[e._v("\n\t\t\t"+e._s(e.t("settings","Language"))+"\n\t\t")]):e._e(),e._v(" "),e.showConfig.showUserBackend||e.showConfig.showStoragePath?s("div",{staticClass:"headerUserBackend userBackend"},[e.showConfig.showUserBackend?s("div",{staticClass:"userBackend"},[e._v("\n\t\t\t\t"+e._s(e.t("settings","User backend"))+"\n\t\t\t")]):e._e(),e._v(" "),e.showConfig.showStoragePath?s("div",{staticClass:"subtitle storageLocation"},[e._v("\n\t\t\t\t"+e._s(e.t("settings","Storage location"))+"\n\t\t\t")]):e._e()]):e._e(),e._v(" "),e.showConfig.showLastLogin?s("div",{staticClass:"headerLastLogin lastLogin"},[e._v("\n\t\t\t"+e._s(e.t("settings","Last login"))+"\n\t\t")]):e._e(),e._v(" "),s("div",{staticClass:"userActions"})]),e._v(" "),s("form",{directives:[{name:"show",rawName:"v-show",value:e.showConfig.showNewUserForm,expression:"showConfig.showNewUserForm"}],staticClass:"row",class:{sticky:e.scrolled&&e.showConfig.showNewUserForm},attrs:{id:"new-user",disabled:e.loading.all},on:{submit:function(t){return t.preventDefault(),e.createUser(t)}}},[s("div",{class:e.loading.all?"icon-loading-small":"icon-add"}),e._v(" "),s("div",{staticClass:"name"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.id,expression:"newUser.id"}],ref:"newusername",attrs:{id:"newusername",disabled:e.settings.newUserGenerateUserID,placeholder:e.settings.newUserGenerateUserID?e.t("settings","Will be autogenerated"):e.t("settings","Username"),autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"username",pattern:"[a-zA-Z0-9 _\\.@\\-']+",required:"",type:"text"},domProps:{value:e.newUser.id},on:{input:function(t){t.target.composing||e.$set(e.newUser,"id",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"displayName"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.displayName,expression:"newUser.displayName"}],attrs:{id:"newdisplayname",placeholder:e.t("settings","Display name"),autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"displayname",type:"text"},domProps:{value:e.newUser.displayName},on:{input:function(t){t.target.composing||e.$set(e.newUser,"displayName",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"password"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.password,expression:"newUser.password"}],ref:"newuserpassword",attrs:{id:"newuserpassword",minlength:e.minPasswordLength,placeholder:e.t("settings","Password"),required:""===e.newUser.mailAddress,autocapitalize:"none",autocomplete:"new-password",autocorrect:"off",name:"password",type:"password"},domProps:{value:e.newUser.password},on:{input:function(t){t.target.composing||e.$set(e.newUser,"password",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"mailAddress"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.newUser.mailAddress,expression:"newUser.mailAddress"}],attrs:{id:"newemail",placeholder:e.t("settings","Email"),required:""===e.newUser.password||e.settings.newUserRequireEmail,autocapitalize:"none",autocomplete:"off",autocorrect:"off",name:"email",type:"email"},domProps:{value:e.newUser.mailAddress},on:{input:function(t){t.target.composing||e.$set(e.newUser,"mailAddress",t.target.value)}}})]),e._v(" "),s("div",{staticClass:"groups"},[e.settings.isAdmin?e._e():s("input",{class:{"icon-loading-small":e.loading.groups},attrs:{id:"newgroups",required:!e.settings.isAdmin,tabindex:"-1",type:"text"},domProps:{value:e.newUser.groups}}),e._v(" "),s("Multiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,disabled:e.loading.groups||e.loading.all,multiple:!0,options:e.canAddGroups,placeholder:e.t("settings","Add user in group"),"tag-width":60,taggable:!0,label:"name","tag-placeholder":"create","track-by":"id"},on:{tag:e.createGroup},model:{value:e.newUser.groups,callback:function(t){e.$set(e.newUser,"groups",t)},expression:"newUser.groups"}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1),e._v(" "),e.subAdminsGroups.length>0&&e.settings.isAdmin?s("div",{staticClass:"subadmins"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"close-on-select":!1,multiple:!0,options:e.subAdminsGroups,placeholder:e.t("settings","Set user as admin for"),"tag-width":60,label:"name","track-by":"id"},model:{value:e.newUser.subAdminsGroups,callback:function(t){e.$set(e.newUser,"subAdminsGroups",t)},expression:"newUser.subAdminsGroups"}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("settings","No results")))])])],1):e._e(),e._v(" "),s("div",{staticClass:"quota"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,options:e.quotaOptions,placeholder:e.t("settings","Select user quota"),taggable:!0,label:"label","track-by":"id"},on:{tag:e.validateQuota},model:{value:e.newUser.quota,callback:function(t){e.$set(e.newUser,"quota",t)},expression:"newUser.quota"}})],1),e._v(" "),e.showConfig.showLanguages?s("div",{staticClass:"languages"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{"allow-empty":!1,options:e.languages,placeholder:e.t("settings","Default language"),"group-label":"label","group-values":"languages",label:"name","track-by":"code"},model:{value:e.newUser.language,callback:function(t){e.$set(e.newUser,"language",t)},expression:"newUser.language"}})],1):e._e(),e._v(" "),e.showConfig.showStoragePath?s("div",{staticClass:"storageLocation"}):e._e(),e._v(" "),e.showConfig.showUserBackend?s("div",{staticClass:"userBackend"}):e._e(),e._v(" "),e.showConfig.showLastLogin?s("div",{staticClass:"lastLogin"}):e._e(),e._v(" "),s("div",{staticClass:"userActions"},[s("input",{staticClass:"button primary icon-checkmark-white has-tooltip",attrs:{id:"newsubmit",title:e.t("settings","Add a new user"),type:"submit",value:""}})])]),e._v(" "),e._l(e.filteredUsers,(function(t,i){return s("user-row",{key:i,attrs:{"external-actions":e.externalActions,groups:e.groups,languages:e.languages,"quota-options":e.quotaOptions,settings:e.settings,"show-config":e.showConfig,"sub-admins-groups":e.subAdminsGroups,user:t}})})),e._v(" "),s("InfiniteLoading",{ref:"infiniteLoading",on:{infinite:e.infiniteHandler}},[s("div",{attrs:{slot:"spinner"},slot:"spinner"},[s("div",{staticClass:"users-icon-loading icon-loading"})]),e._v(" "),s("div",{attrs:{slot:"no-more"},slot:"no-more"},[s("div",{staticClass:"users-list-end"})]),e._v(" "),s("div",{attrs:{slot:"no-results"},slot:"no-results"},[s("div",{attrs:{id:"emptycontent"}},[s("div",{staticClass:"icon-contacts-dark"}),e._v(" "),s("h2",[e._v(e._s(e.t("settings","No users in here")))])])])])],2)}),[],!1,null,null,null).exports;function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.default.use(r.a);var S={name:"Users",components:{AppContent:o.AppContent,AppNavigation:o.AppNavigation,AppNavigationItem:o.AppNavigationItem,AppNavigationNew:o.AppNavigationNew,AppNavigationSettings:o.AppNavigationSettings,Content:o.Content,UserList:A,Multiselect:o.Multiselect},props:{selectedGroup:{type:String,default:null}},data:function(){return{unlimitedQuota:{id:"none",label:t("settings","Unlimited")},selectedQuota:!1,externalActions:[],showAddGroupEntry:!1,loadingAddGroup:!1,showConfig:{showStoragePath:!1,showUserBackend:!1,showLastLogin:!1,showNewUserForm:!1,showLanguages:!1}}},computed:{users:function(){return this.$store.getters.getUsers},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},showLanguages:{get:function(){return this.getLocalstorage("showLanguages")},set:function(e){this.setLocalStorage("showLanguages",e)}},showLastLogin:{get:function(){return this.getLocalstorage("showLastLogin")},set:function(e){this.setLocalStorage("showLastLogin",e)}},showUserBackend:{get:function(){return this.getLocalstorage("showUserBackend")},set:function(e){this.setLocalStorage("showUserBackend",e)}},showStoragePath:{get:function(){return this.getLocalstorage("showStoragePath")},set:function(e){this.setLocalStorage("showStoragePath",e)}},userCount:function(){return this.$store.getters.getUserCount},settings:function(){return this.$store.getters.getServerData},quotaOptions:function(){var e=this.settings.quotaPreset.reduce((function(e,t){return e.concat({id:t,label:t})}),[]);return e.unshift(this.unlimitedQuota),e},defaultQuota:{get:function(){return!1!==this.selectedQuota?this.selectedQuota:this.settings.defaultQuota!==this.unlimitedQuota.id&&OC.Util.computerFileSize(this.settings.defaultQuota)>=0?{id:this.settings.defaultQuota,label:this.settings.defaultQuota}:this.unlimitedQuota},set:function(e){this.selectedQuota=e}},menu:function(){var e=this,s=this,i=this.$store.getters.getGroups,a=(i=(i=Array.isArray(i)?i:[]).map((function(i){var n={};return n.id=i.id.replace(" ","_"),n.key=n.id,n.utils={},n.router={name:"group",params:{selectedGroup:i.id}},n.text=i.name,n.title=i.name,(i.usercount-i.disabled>0||-1===i.usercount)&&(n.utils.counter=i.usercount-i.disabled),"admin"!==n.id&&"disabled"!==n.id&&e.settings.isAdmin&&(n.utils.actions=[{icon:"icon-delete",text:t("settings","Remove group"),action:function(){s.removeGroup(i.id)}}]),n}))).find((function(e){return"disabled"!==e.id&&"admin"!==e.id}));if(a=void 0===a?[]:a,(a=Array.isArray(a)?a:[a]).length>0){var r={caption:!0,text:t("settings","Groups")};i.unshift(r)}var o=i.find((function(e){return"admin"===e.id})),l=i.find((function(e){return"disabled"===e.id}));i=i.filter((function(e){return-1===["admin","disabled"].indexOf(e.id)})),o&&o.text&&(o.text=t("settings","Admins"),o.icon="icon-user-admin",i.unshift(o)),l&&l.text&&(l.text=t("settings","Disabled users"),l.icon="icon-disabled-users",l.utils&&(l.utils.counter>0||-1===l.utils.counter)&&(i.unshift(l),-1===l.utils.counter&&delete l.utils.counter));var u={id:"everyone",key:"everyone",icon:"icon-contacts-dark",router:{name:"users"},text:t("settings","Everyone")};this.userCount>0&&n.default.set(u,"utils",{counter:this.userCount}),i.unshift(u);var d={id:"addgroup",key:"addgroup",icon:"icon-add",text:t("settings","Add group"),classes:this.loadingAddGroup?"icon-loading-small":""};return this.showAddGroupEntry?(n.default.set(d,"edit",{text:t("settings","Add group"),action:this.createGroup,reset:function(){s.showAddGroupEntry=!1}}),d.classes="editing"):n.default.set(d,"action",(function(){s.showAddGroupEntry=!0,n.default.nextTick((function(){window.addgroup.querySelector('form > input[type="text"]').focus()}))})),i.unshift(d),i}},beforeMount:function(){this.$store.commit("initGroups",{groups:this.$store.getters.getServerData.groups,orderBy:this.$store.getters.getServerData.sortGroups,userCount:this.$store.getters.getServerData.userCount}),this.$store.dispatch("getPasswordPolicyMinLength")},created:function(){Object.assign(OCA,{Settings:{UserList:{registerAction:this.registerAction}}})},methods:{toggleNewUserMenu:function(){this.showConfig.showNewUserForm=!this.showConfig.showNewUserForm,this.showConfig.showNewUserForm&&n.default.nextTick((function(){window.newusername.focus()}))},getLocalstorage:function(e){var t=this.$localStorage.get(e);return this.showConfig[e]=null!==t?"true"===t:this.showConfig[e],this.showConfig[e]},setLocalStorage:function(e,t){return this.showConfig[e]=t,this.$localStorage.set(e,t),t},removeGroup:function(e){var s=this;OC.dialogs.confirm(t("settings","You are about to remove the group {group}. The users will NOT be deleted.",{group:e}),t("settings","Please confirm the group removal "),(function(t){t&&s.$store.dispatch("removeGroup",e)}))},setDefaultQuota:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.$store.dispatch("setAppConfig",{app:"files",key:"default_quota",value:t.id?t.id:t}).then((function(){"object"!==U(t)&&(t={id:t,label:t}),e.defaultQuota=t}))},validateQuota:function(e){return null===OC.Util.computerFileSize(e)?this.setDefaultQuota("none"):this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(e)))},registerAction:function(e,t,s){return this.externalActions.push({icon:e,text:t,action:s}),this.externalActions},createGroup:function(e){var t=this,s=e.target[0].value;this.loadingAddGroup=!0,this.$store.dispatch("addGroup",s).then((function(){t.showAddGroupEntry=!1,t.loadingAddGroup=!1,t.$router.push({name:"group",params:{selectedGroup:s}})})).catch((function(){t.loadingAddGroup=!1}))}}},L=Object(f.a)(S,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("Content",{attrs:{"app-name":"settings","navigation-class":{"icon-loading":e.loadingAddGroup}}},[s("AppNavigation",[s("AppNavigationNew",{attrs:{"button-id":"new-user-button",text:e.t("settings","New user"),"button-class":"icon-add"},on:{click:e.toggleNewUserMenu}}),e._v(" "),s("ul",{attrs:{id:"usergrouplist"}},e._l(e.menu,(function(e){return s("AppNavigationItem",{key:e.key,attrs:{item:e}})})),1),e._v(" "),s("AppNavigationSettings",[s("div",[s("p",[e._v(e._s(e.t("settings","Default quota:")))]),e._v(" "),s("Multiselect",{attrs:{value:e.defaultQuota,options:e.quotaOptions,"tag-placeholder":"create",placeholder:e.t("settings","Select default quota"),label:"label","track-by":"id","allow-empty":!1,taggable:!0},on:{tag:e.validateQuota,input:e.setDefaultQuota}})],1),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showLanguages,expression:"showLanguages"}],staticClass:"checkbox",attrs:{id:"showLanguages",type:"checkbox"},domProps:{checked:Array.isArray(e.showLanguages)?e._i(e.showLanguages,null)>-1:e.showLanguages},on:{change:function(t){var s=e.showLanguages,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&(e.showLanguages=s.concat([null])):a>-1&&(e.showLanguages=s.slice(0,a).concat(s.slice(a+1)))}else e.showLanguages=n}}}),e._v(" "),s("label",{attrs:{for:"showLanguages"}},[e._v(e._s(e.t("settings","Show Languages")))])]),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showLastLogin,expression:"showLastLogin"}],staticClass:"checkbox",attrs:{id:"showLastLogin",type:"checkbox"},domProps:{checked:Array.isArray(e.showLastLogin)?e._i(e.showLastLogin,null)>-1:e.showLastLogin},on:{change:function(t){var s=e.showLastLogin,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&(e.showLastLogin=s.concat([null])):a>-1&&(e.showLastLogin=s.slice(0,a).concat(s.slice(a+1)))}else e.showLastLogin=n}}}),e._v(" "),s("label",{attrs:{for:"showLastLogin"}},[e._v(e._s(e.t("settings","Show last login")))])]),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showUserBackend,expression:"showUserBackend"}],staticClass:"checkbox",attrs:{id:"showUserBackend",type:"checkbox"},domProps:{checked:Array.isArray(e.showUserBackend)?e._i(e.showUserBackend,null)>-1:e.showUserBackend},on:{change:function(t){var s=e.showUserBackend,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&(e.showUserBackend=s.concat([null])):a>-1&&(e.showUserBackend=s.slice(0,a).concat(s.slice(a+1)))}else e.showUserBackend=n}}}),e._v(" "),s("label",{attrs:{for:"showUserBackend"}},[e._v(e._s(e.t("settings","Show user backend")))])]),e._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.showStoragePath,expression:"showStoragePath"}],staticClass:"checkbox",attrs:{id:"showStoragePath",type:"checkbox"},domProps:{checked:Array.isArray(e.showStoragePath)?e._i(e.showStoragePath,null)>-1:e.showStoragePath},on:{change:function(t){var s=e.showStoragePath,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&(e.showStoragePath=s.concat([null])):a>-1&&(e.showStoragePath=s.slice(0,a).concat(s.slice(a+1)))}else e.showStoragePath=n}}}),e._v(" "),s("label",{attrs:{for:"showStoragePath"}},[e._v(e._s(e.t("settings","Show storage path")))])])])],1),e._v(" "),s("AppContent",[s("UserList",{attrs:{users:e.users,"show-config":e.showConfig,"selected-group":e.selectedGroup,"external-actions":e.externalActions},scopedSlots:e._u([{key:"content",fn:function(){},proxy:!0}])})],1)],1)}),[],!1,null,null,null);s.default=L.exports}}]);
|
|
//# sourceMappingURL=vue-6.js.map?v=513d7884f7066d3aab7f
|