pleroma/priv/static/adminfe/static/js/chunk-506f.4a1a9945.js
2022-11-22 23:53:01 +01:00

2 lines
7.6 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-506f"],{"9/5/":function(t,e,n){(function(e){var n="Expected a function",r=NaN,o="[object Symbol]",s=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt,l="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,p=l||d||Function("return this")(),f=Object.prototype.toString,h=Math.max,g=Math.min,m=function(){return p.Date.now()};function b(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&f.call(t)==o}(t))return r;if(b(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=b(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var n=i.test(t);return n||c.test(t)?u(t.slice(2),n?2:8):a.test(t)?r:+t}t.exports=function(t,e,r){var o,s,a,i,c,u,l=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new TypeError(n);function y(e){var n=o,r=s;return o=s=void 0,l=e,i=t.apply(r,n)}function _(t){var n=t-u;return void 0===u||n>=e||n<0||p&&t-l>=a}function j(){var t=m();if(_(t))return k(t);c=setTimeout(j,function(t){var n=e-(t-u);return p?g(n,a-(t-l)):n}(t))}function k(t){return c=void 0,f&&o?y(t):(o=s=void 0,i)}function x(){var t=m(),n=_(t);if(o=arguments,s=this,u=t,n){if(void 0===c)return function(t){return l=t,c=setTimeout(j,e),d?y(t):i}(u);if(p)return c=setTimeout(j,e),y(u)}return void 0===c&&(c=setTimeout(j,e)),i}return e=v(e)||0,b(r)&&(d=!!r.leading,a=(p="maxWait"in r)?h(v(r.maxWait)||0,e):a,f="trailing"in r?!!r.trailing:f),x.cancel=function(){void 0!==c&&clearTimeout(c),l=0,o=u=s=c=void 0},x.flush=function(){return void 0===c?i:k(m())},x}}).call(this,n("yLpj"))},"9Ais":function(t,e,n){},QWDZ:function(t,e,n){"use strict";n("9Ais")},UQK7:function(t,e,n){"use strict";n.r(e);var r=n("ExVU"),o=n("LvDl"),s=n.n(o),a=n("9/5/"),i=n.n(a),c=n("rIUS"),u={name:"LogEntryMessage",props:{actor:{type:Object,required:!0},message:{type:String,required:!0},subject:{type:[Object,Array],required:!1,default:function(){return{}}}},computed:{logEntryMessage:function(){return this.actor.nickname?this.message.split(this.actor.nickname)[1]:this.message},logEntryMessageWithoutId:function(){return this.logEntryMessage.split("#".concat(this.subject.id))}},methods:{propertyExists:function(t,e){return t[e]}}},l=(n("gu1K"),n("KHd+")),d=Object(l.a)(u,function(){var t=this,e=t._self._c;return e("span",[t.propertyExists(t.actor,"id")?e("router-link",{staticClass:"router-link",attrs:{to:{name:"UsersShow",params:{id:t.actor.id}}}},[t.propertyExists(t.actor,"nickname")?e("span",{staticStyle:{"font-weight":"600"}},[t._v("\n @"+t._s(t.actor.nickname)+"\n ")]):t._e()]):t._e(),t._v(" "),"report"===t.subject.type&&t.propertyExists(t.subject,"id")?e("span",[t._v("\n "+t._s(t.logEntryMessageWithoutId[0])+"\n "),e("router-link",{staticClass:"router-link",attrs:{to:{name:"ReportsShow",params:{id:t.subject.id}}}},[e("span",{staticStyle:{"font-weight":"600"}},[t._v("#"+t._s(t.subject.id))])]),t._v("\n "+t._s(t.logEntryMessageWithoutId[1])+"\n ")],1):e("span",[t._v(t._s(t.logEntryMessage))])],1)},[],!1,null,null,null).exports,p={components:{RebootButton:c.a,LogEntryMessage:d},data:function(){return{dateRange:"",search:"",user:"",currentPage:1}},computed:{isMobile:function(){return"mobile"===this.$store.state.app.device},loading:function(){return this.$store.state.moderationLog.logLoading&&this.$store.state.moderationLog.adminsLoading},log:function(){return this.$store.state.moderationLog.fetchedLog},total:function(){return this.$store.state.moderationLog.logItemsCount},users:function(){return[{label:"Admins",options:this.$store.state.moderationLog.admins.users},{label:"Moderators",options:this.$store.state.moderationLog.moderators.users}]}},created:function(){var t=this;this.handleDebounceSearchInput=i()(function(e){t.fetchLogWithFilters()},500)},mounted:function(){this.$store.dispatch("GetNodeInfo"),this.$store.dispatch("NeedReboot"),this.$store.dispatch("FetchModerationLog"),this.$store.dispatch("FetchAdmins")},methods:{fetchLogWithFilters:function(){var t=s.a.omitBy({start_date:this.dateRange?this.dateRange[0].toISOString():null,end_date:this.dateRange?this.dateRange[1].toISOString():null,user_id:this.user,search:this.search,page:this.currentPage},function(t){return""===t||null===t});this.$store.dispatch("FetchModerationLog",t)},normalizeTimestamp:function(t){return r.DateTime.fromSeconds(t).toFormat("yyyy-MM-dd HH:mm")},propertyExists:function(t,e){return t[e]}}},f=(n("QWDZ"),Object(l.a)(p,function(){var t=this,e=t._self._c;return t.loading?t._e():e("div",{staticClass:"moderation-log-container"},[e("div",{staticClass:"moderation-log-header-container"},[e("h1",[t._v(t._s(t.$t("moderationLog.moderationLog")))]),t._v(" "),e("reboot-button")],1),t._v(" "),e("div",{staticClass:"moderation-log-nav-container"},[e("el-select",{staticClass:"moderation-log-user-select",attrs:{clearable:"",placeholder:"Filter by admin/moderator"},on:{change:t.fetchLogWithFilters},model:{value:t.user,callback:function(e){t.user=e},expression:"user"}},t._l(t.users,function(n){return e("el-option-group",{key:n.label,attrs:{label:n.label}},t._l(n.options,function(t){return e("el-option",{key:t.id,attrs:{label:t.nickname,value:t.id}})}),1)}),1),t._v(" "),e("el-input",{staticClass:"moderation-log-search",attrs:{placeholder:"Search logs",clearable:""},on:{input:t.handleDebounceSearchInput},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1),t._v(" "),e("el-date-picker",{staticClass:"moderation-log-date-panel",attrs:{"default-time":["00:00:00","23:59:59"],type:"daterange","start-placeholder":"Start date","end-placeholder":"End date","unlink-panels":""},on:{change:t.fetchLogWithFilters},model:{value:t.dateRange,callback:function(e){t.dateRange=e},expression:"dateRange"}}),t._v(" "),e("el-timeline",t._l(t.log,function(n,r){return e("el-timeline-item",{key:r,attrs:{timestamp:t.normalizeTimestamp(n.time)}},[t.propertyExists(n.data.actor,"nickname")?e("log-entry-message",{attrs:{actor:n.data.actor,message:n.message,subject:n.data.subject}}):e("span",[t._v(t._s(n.message))])],1)}),1),t._v(" "),e("div",{staticClass:"pagination"},[e("el-pagination",{attrs:{"current-page":t.currentPage,"hide-on-single-page":!0,"page-size":50,total:t.total,small:t.isMobile,layout:"prev, pager, next"},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"current-change":t.fetchLogWithFilters}})],1)],1)},[],!1,null,"645c846e",null));e.default=f.exports},boZH:function(t,e,n){},gu1K:function(t,e,n){"use strict";n("boZH")},rIUS:function(t,e,n){"use strict";var r=n("yXPU"),o=n.n(r),s=n("o0o1"),a=n.n(s),i=n("mSNy"),c={name:"RebootButton",computed:{needReboot:function(){return this.$store.state.app.needReboot}},methods:{restartApp:function(){var t=this;return o()(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$store.dispatch("RestartApplication");case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return");case 8:t.$message({type:"success",message:i.a.t("settings.restartSuccess")});case 9:case"end":return e.stop()}},e,null,[[0,5]])}))()}}},u=n("KHd+"),l=Object(u.a)(c,function(){var t=this._self._c;return this.needReboot?t("el-tooltip",{attrs:{content:this.$t("settings.restartApp"),placement:"bottom-end"}},[t("el-button",{staticClass:"reboot-button",attrs:{type:"warning"},on:{click:this.restartApp}},[t("span",[t("i",{staticClass:"el-icon-refresh"}),this._v("\n "+this._s(this.$t("settings.instanceReboot"))+"\n ")])])],1):this._e()},[],!1,null,null,null);e.a=l.exports}}]);
//# sourceMappingURL=chunk-506f.4a1a9945.js.map