db3eeb54cc9475c9a29bdb7b675aee6868a11d41
[anni] / priv / static / adminfe / static / js / chunk-4995.94e052fc.js
1 (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4995"],{"07OA":function(t,e,r){"use strict";var s=r("51EY");r.n(s).a},"4rb0":function(t,e,r){},"51EY":function(t,e,r){},"5tnn":function(t,e,r){"use strict";var s=r("V/GZ");r.n(s).a},"V/GZ":function(t,e,r){},cEOe:function(t,e,r){"use strict";r.r(e);var s=r("ZhIB"),o=r.n(s),n=r("wd/R"),a=r.n(n),i=r("dpNl"),l=r("yrTF"),c={name:"Report",components:{ModerateUserDropdown:i.a,ReportContent:l.a},props:{reports:{type:Array,required:!0}},computed:{loading:function(){return this.$store.state.reports.loading},pageSize:function(){return this.$store.state.reports.pageSize},totalReportsCount:function(){return this.$store.state.reports.totalReportsCount},currentPage:function(){return this.$store.state.reports.currentPage}},methods:{capitalizeFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},changeReportState:function(t,e){this.$store.dispatch("ChangeReportState",[{state:t,id:e}])},getStateType:function(t){switch(t){case"closed":return"info";case"resolved":return"success";default:return"primary"}},handlePageChange:function(t){this.$store.dispatch("FetchReports",t)},parseTimestamp:function(t){return a()(t).format("L HH:mm")},propertyExists:function(t,e,r){return r?t[e]&&t[r]:t[e]}}},p=(r("07OA"),r("KHd+")),u=Object(p.a)(c,function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("el-timeline",{staticClass:"reports-timeline"},t._l(t.reports,function(e){return r("el-timeline-item",{key:e.id,staticClass:"timeline-item-container",attrs:{timestamp:t.parseTimestamp(e.created_at),placement:"top"}},[r("el-card",{staticClass:"report"},[r("div",{staticClass:"report-header-container"},[r("div",{staticClass:"title-container"},[t.propertyExists(e.account,"nickname")?r("h3",{staticClass:"report-title"},[t._v(t._s(t.$t("reports.reportOn"))+" "+t._s(e.account.nickname))]):r("h3",{staticClass:"report-title"},[t._v(t._s(t.$t("reports.report")))]),t._v(" "),t.propertyExists(e.account,"id")?r("h5",{staticClass:"id"},[t._v(t._s(t.$t("reports.id"))+": "+t._s(e.id))]):t._e()]),t._v(" "),r("div",[r("el-tag",{staticClass:"report-tag",attrs:{type:t.getStateType(e.state),size:"large"}},[t._v(t._s(t.capitalizeFirstLetter(e.state)))]),t._v(" "),r("el-dropdown",{attrs:{trigger:"click"}},[r("el-button",{staticClass:"report-actions-button",attrs:{plain:"",size:"small",icon:"el-icon-edit"}},[t._v(t._s(t.$t("reports.changeState"))),r("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),r("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},["resolved"!==e.state?r("el-dropdown-item",{nativeOn:{click:function(r){return t.changeReportState("resolved",e.id)}}},[t._v(t._s(t.$t("reports.resolve")))]):t._e(),t._v(" "),"open"!==e.state?r("el-dropdown-item",{nativeOn:{click:function(r){return t.changeReportState("open",e.id)}}},[t._v(t._s(t.$t("reports.reopen")))]):t._e(),t._v(" "),"closed"!==e.state?r("el-dropdown-item",{nativeOn:{click:function(r){return t.changeReportState("closed",e.id)}}},[t._v(t._s(t.$t("reports.close")))]):t._e()],1)],1),t._v(" "),t.propertyExists(e.account,"nickname")?r("moderate-user-dropdown",{attrs:{account:e.account,"report-id":e.id,"rendered-from":"reportsPage"}}):t._e()],1)]),t._v(" "),r("el-divider",{staticClass:"divider"}),t._v(" "),r("report-content",{attrs:{report:e}})],1)],1)}),1),t._v(" "),t.loading?t._e():r("div",{staticClass:"reports-pagination"},[r("el-pagination",{attrs:{total:t.totalReportsCount,"current-page":t.currentPage,"page-size":t.pageSize,background:"",layout:"prev, pager, next"},on:{"current-change":t.handlePageChange}})],1)],1)},[],!1,null,null,null);u.options.__file="Report.vue";var d=u.exports,v=r("mSNy"),h={data:function(){return{filter:"open",options:[{value:"open",label:v.a.t("reportsFilter.open")},{value:"closed",label:v.a.t("reportsFilter.closed")},{value:"resolved",label:v.a.t("reportsFilter.resolved")}]}},created:function(){this.$store.dispatch("SetReportsFilter",this.$data.filter)},methods:{toggleFilters:function(){this.$store.dispatch("SetReportsFilter",this.$data.filter),this.$store.dispatch("ClearFetchedReports"),this.$store.dispatch("FetchReports",1)}}},_=(r("5tnn"),Object(p.a)(h,function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("el-select",{staticClass:"select-field",attrs:{placeholder:t.$t("reportsFilter.inputPlaceholder"),clearable:"","value-key":"value"},on:{change:t.toggleFilters},model:{value:t.filter,callback:function(e){t.filter=e},expression:"filter"}},t._l(t.options,function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}},[t._v(t._s(e.label))])}),1)},[],!1,null,"5ab7c15a",null));_.options.__file="ReportsFilter.vue";var f=_.exports,g={components:{RebootButton:r("rIUS").a,Report:d,ReportsFilter:f},computed:{loading:function(){return this.$store.state.reports.loading},normalizedReportsCount:function(){return o()(this.$store.state.reports.totalReportsCount).format("0a")},reports:function(){return this.$store.state.reports.fetchedReports}},mounted:function(){this.$store.dispatch("GetNodeInfo"),this.$store.dispatch("NeedReboot"),this.$store.dispatch("FetchTagPolicySetting"),this.$store.dispatch("FetchReports",1)}},m=(r("wnWh"),Object(p.a)(g,function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"reports-container"},[r("div",{staticClass:"reports-header-container"},[r("h1",[t._v("\n      "+t._s(t.$t("reports.reports"))+"\n      "),r("span",{staticClass:"report-count"},[t._v("("+t._s(t.normalizedReportsCount)+")")])]),t._v(" "),r("reboot-button")],1),t._v(" "),r("div",{staticClass:"reports-filter-container"},[r("reports-filter")],1),t._v(" "),r("div",{staticClass:"block"},[r("report",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{reports:t.reports}}),t._v(" "),0===t.reports.length?r("div",{staticClass:"no-reports-message"},[r("p",[t._v("There are no reports to display")])]):t._e()],1)])},[],!1,null,"6ac87f34",null));m.options.__file="index.vue";e.default=m.exports},wnWh:function(t,e,r){"use strict";var s=r("4rb0");r.n(s).a}}]);
2 //# sourceMappingURL=chunk-4995.94e052fc.js.map