0
0
Fork 0
mirror of https://github.com/alerta/alerta-webui.git synced 2025-03-16 21:43:29 +00:00
alerta_alerta-webui/js/chunk-2d0b9bc4.49249a93.js
2024-04-11 11:01:05 +00:00

2 lines
No EOL
11 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b9bc4"],{"33e3":function(t,e,s){"use strict";s.r(e);var r=s("c6a6"),i=s("8336"),a=s("b0af"),n=s("99d9"),o=s("a523"),l=s("2e4b"),c=s("0e8f"),u=s("132d"),p=s("a722"),d=s("e449"),h=s("f774"),f=s("b56d"),m=s("9910"),v=s("2677"),g=s("71d9"),$=s("2a7f"),x=function(){var t=this,e=t._self._c;return e(h["a"],{attrs:{value:t.sidesheet,clipped:"","disable-resize-watcher":"",absolute:"","hide-overlay":"",width:"300",right:""}},[e(a["a"],{attrs:{tile:""}},[e(g["a"],{attrs:{color:t.isDark?"#616161":"#eeeeee",card:"",dense:""}},[e($["b"],[t._v(" "+t._s(t.$t("Filters"))+" ")]),e(m["a"]),e($["a"]),e(d["a"],{attrs:{bottom:"",right:"","offset-y":""}},[e(i["a"],{attrs:{slot:"activator",icon:""},on:{click:t.close},slot:"activator"},[e(u["a"],[t._v("close")])],1)],1)],1),e(o["a"],{attrs:{fluid:"","grid-list-xl":""}},[e(p["a"],{attrs:{"align-center":"",wrap:""}},[e(c["a"],{staticClass:"pb-0",attrs:{xs12:""}},[e(v["a"],{attrs:{label:t.$t("Search"),"prepend-inner-icon":"search",outline:"",dense:"",clearable:"",hint:t.$t("FilterDescription"),"persistent-hint":""},model:{value:t.filterText,callback:function(e){t.filterText=e},expression:"filterText"}})],1),e(c["a"],{staticClass:"pb-0",attrs:{xs12:""}},[e(r["a"],{attrs:{items:t.allowedEnvironments,"menu-props":{maxHeight:"400"},placeholder:t.$t("AllEnvironments"),label:t.$t("Environment"),multiple:"",outline:"",dense:"",hint:t.$t("EnvironmentDescription"),"persistent-hint":""},model:{value:t.filterEnvironment,callback:function(e){t.filterEnvironment=e},expression:"filterEnvironment"}})],1),e(c["a"],{staticClass:"pb-0",attrs:{xs12:""}},[e(f["a"],{attrs:{items:t.severityList,"small-chips":"",placeholder:t.$t("AllSeverities"),label:t.$t("Severity"),multiple:"",outline:"",dense:"",hint:t.$t("SeverityDescription"),"persistent-hint":""},model:{value:t.filterSeverity,callback:function(e){t.filterSeverity=e},expression:"filterSeverity"}})],1),e(c["a"],{staticClass:"pb-0",attrs:{xs12:""}},[e(f["a"],{attrs:{items:t.statusList,"small-chips":"",placeholder:t.$t("AllStatuses"),label:t.$t("Status"),multiple:"",outline:"",dense:"",hint:t.$t("StatusDescription"),"persistent-hint":""},model:{value:t.filterStatus,callback:function(e){t.filterStatus=e},expression:"filterStatus"}})],1),t.$config.customer_views?e(c["a"],{staticClass:"pb-0",attrs:{xs12:""}},[e(f["a"],{attrs:{items:t.currentCustomers,"menu-props":{maxHeight:"400"},placeholder:t.$t("AllCustomers"),label:t.$t("Customer"),multiple:"",outline:"",dense:"",hint:t.$t("CustomerDescription"),"persistent-hint":""},model:{value:t.filterCustomer,callback:function(e){t.filterCustomer=e},expression:"filterCustomer"}})],1):t._e(),e(c["a"],{staticClass:"pb-0",attrs:{xs12:""}},[e(r["a"],{attrs:{items:t.currentServices,"menu-props":{maxHeight:"400"},placeholder:t.$t("AllServices"),label:t.$t("Service"),multiple:"",outline:"",dense:"",hint:t.$t("ServiceDescription"),"persistent-hint":""},model:{value:t.filterService,callback:function(e){t.filterService=e},expression:"filterService"}})],1),e(c["a"],{staticClass:"pb-0",attrs:{xs12:""}},[e(f["a"],{attrs:{items:t.currentGroups,"menu-props":{maxHeight:"400"},placeholder:t.$t("AllGroups"),label:t.$t("Group"),multiple:"",outline:"",dense:"",hint:t.$t("GroupDescription"),"persistent-hint":""},model:{value:t.filterGroup,callback:function(e){t.filterGroup=e},expression:"filterGroup"}})],1),e(c["a"],{staticClass:"pb-0",attrs:{xs12:""}},[e("span",{staticClass:"body-2"},[t._v(t._s(t.$t("DateTime")))]),e(f["a"],{attrs:{items:t.dateRanges,name:"dateRange",label:t.$t("DateTime"),solo:"",flat:"","prepend-inner-icon":"schedule","item-value":"range","hide-details":""},model:{value:t.filterDateRange,callback:function(e){t.filterDateRange=e},expression:"filterDateRange"}})],1),e(c["a"],{directives:[{name:"show",rawName:"v-show",value:t.showDateRange,expression:"showDateRange"}],staticClass:"pb-0 pr-0",attrs:{xs8:""}},[e(v["a"],{attrs:{label:t.$t("StartDate"),"prepend-inner-icon":"event",outline:"","hide-details":""},on:{"click:prepend-inner":function(e){t.menu1=!t.menu1}},model:{value:t.period.startDate,callback:function(e){t.$set(t.period,"startDate",e)},expression:"period.startDate"}})],1),e(c["a"],{directives:[{name:"show",rawName:"v-show",value:t.showDateRange,expression:"showDateRange"}],staticClass:"pb-0 pl-1",attrs:{xs4:""}},[e(v["a"],{attrs:{label:t.$t("Time"),outline:"","hide-details":""},model:{value:t.period.startTime,callback:function(e){t.$set(t.period,"startTime",e)},expression:"period.startTime"}})],1),e(c["a"],{staticClass:"pa-0"},[e(d["a"],{ref:"menu1",attrs:{"close-on-content-click":!1,"nudge-right":40,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","max-width":"290px","min-width":"290px"},model:{value:t.menu1,callback:function(e){t.menu1=e},expression:"menu1"}},[e("div",{attrs:{slot:"activator"},slot:"activator"}),e(l["a"],{attrs:{"no-title":""},on:{input:function(e){t.menu1=!1}},model:{value:t.period.startDate,callback:function(e){t.$set(t.period,"startDate",e)},expression:"period.startDate"}})],1)],1),e(c["a"],{directives:[{name:"show",rawName:"v-show",value:t.showDateRange,expression:"showDateRange"}],staticClass:"pb-0 pr-0",attrs:{xs8:""}},[e(v["a"],{attrs:{label:t.$t("EndDate"),"prepend-inner-icon":"event",outline:"","hide-details":""},on:{"click:prepend-inner":function(e){t.menu2=!t.menu2}},model:{value:t.period.endDate,callback:function(e){t.$set(t.period,"endDate",e)},expression:"period.endDate"}})],1),e(c["a"],{directives:[{name:"show",rawName:"v-show",value:t.showDateRange,expression:"showDateRange"}],staticClass:"pb-0 pl-1",attrs:{xs4:""}},[e(v["a"],{attrs:{label:t.$t("Time"),outline:"","hide-details":""},model:{value:t.period.endTime,callback:function(e){t.$set(t.period,"endTime",e)},expression:"period.endTime"}})],1),e(c["a"],{staticClass:"pa-0"},[e(d["a"],{ref:"menu2",attrs:{"close-on-content-click":!1,"nudge-right":40,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","max-width":"290px","min-width":"290px"},model:{value:t.menu2,callback:function(e){t.menu2=e},expression:"menu2"}},[e("div",{attrs:{slot:"activator"},slot:"activator"}),e(l["a"],{attrs:{"no-title":""},on:{input:function(e){t.menu2=!1}},model:{value:t.period.endDate,callback:function(e){t.$set(t.period,"endDate",e)},expression:"period.endDate"}})],1)],1)],1)],1)],1),e(a["a"],{attrs:{flat:""}},[e(c["a"],{attrs:{xs12:""}},[e(n["a"],[e(i["a"],{directives:[{name:"show",rawName:"v-show",value:t.showDateRange,expression:"showDateRange"}],attrs:{color:"primary"},on:{click:t.setDateRange}},[t._v(" "+t._s(t.$t("Apply"))+" ")]),e(m["a"]),e(i["a"],{attrs:{color:"blue darken-1",flat:""},on:{click:t.reset}},[t._v(" "+t._s(t.$t("Reset"))+" ")])],1)],1)],1)],1)},b=[],D=s("5530"),w=(s("d81d"),s("4e82"),s("b64b"),s("4de4"),s("d3b7"),s("c1df")),R=s.n(w),k=s("fe0b"),S={props:{value:{type:Boolean,default:!1}},data:function(t){return{sidesheet:t.value,active:null,pagination:{rowsPerPage:10,sortBy:"updateTime"},showDateRange:!1,menu1:!1,menu2:!1,period:{startDate:null,startTime:null,endDate:null,endTime:null}}},computed:{dateRanges:function(){return[{text:k["a"].t("Latest"),range:[null,null]},{text:k["a"].t("Hour"),range:[-3600,null]},{text:k["a"].t("SixHours"),range:[-21600,null]},{text:k["a"].t("TwelveHours"),range:[-43200,null]},{divider:!0},{text:k["a"].t("SelectRange"),range:[0,0]}]},isDark:function(){return this.$store.getters.getPreference("isDark")},history:function(){return this.item.history.map((function(t,e){return Object(D["a"])({index:e},t)}))},allowedEnvironments:function(){return this.$config.environments},severityList:function(){var t=this.$config.alarm_model.severity;return Object.keys(t).sort((function(e,s){return t[e]-t[s]}))},statusList:function(){var t={open:"A",assign:"B",ack:"C",shelved:"D",blackout:"E",closed:"F",expired:"G",unknown:"H"},e=this.$config.alarm_model.status||t;return Object.keys(e).sort((function(t,s){return e[t].localeCompare(e[s])}))},currentCustomers:function(){return this.$store.getters["customers/customers"]},currentServices:function(){return this.$store.getters["alerts/services"]},currentGroups:function(){return this.$store.getters["alerts/groups"]},filterText:{get:function(){return this.$store.state.reports.filter.text},set:function(t){this.$store.dispatch("reports/setFilter",{text:t})}},filterEnvironment:{get:function(){return this.$store.state.reports.filter.environment},set:function(t){this.$store.dispatch("reports/setFilter",{environment:t.length>0?t:null})}},filterSeverity:{get:function(){return this.$store.state.reports.filter.severity},set:function(t){this.$store.dispatch("reports/setFilter",{severity:t.length>0?t:null})}},filterStatus:{get:function(){return this.$store.state.reports.filter.status},set:function(t){this.$store.dispatch("reports/setFilter",{status:t.length>0?t:null})}},filterCustomer:{get:function(){return this.$store.state.reports.filter.customer},set:function(t){this.$store.dispatch("reports/setFilter",{customer:t.length>0?t:null})}},filterService:{get:function(){return this.$store.state.reports.filter.service},set:function(t){this.$store.dispatch("reports/setFilter",{service:t.length>0?t:null})}},filterGroup:{get:function(){return this.$store.state.reports.filter.group},set:function(t){this.$store.dispatch("reports/setFilter",{group:t.length>0?t:null})}},filterDateRange:{get:function(){return this.$store.state.reports.filter.dateRange[0]>0?[0,0]:this.$store.state.reports.filter.dateRange},set:function(t){0===t[0]?(this.period=this.getDateRange(this.$store.state.reports.filter.dateRange[0]?this.$store.state.reports.filter.dateRange[0]:R()().unix()-604800,this.$store.state.reports.filter.dateRange[1]?this.$store.state.reports.filter.dateRange[1]:R()().unix()),this.showDateRange=!0):(this.showDateRange=!1,this.$store.dispatch("reports/setFilter",{dateRange:t}))}}},watch:{value:function(t){this.sidesheet=t}},created:function(){this.getEnvironments(),this.$config.customer_views&&this.getCustomers(),this.getServices(),this.getGroups(),0===this.filterDateRange[0]&&(this.period=this.getDateRange(this.$store.state.reports.filter.dateRange[0],this.$store.state.reports.filter.dateRange[1]),this.showDateRange=!0)},methods:{getEnvironments:function(){this.$store.dispatch("alerts/getEnvironments")},getCustomers:function(){this.$store.dispatch("customers/getCustomers")},getServices:function(){this.$store.dispatch("alerts/getServices")},getGroups:function(){this.$store.dispatch("alerts/getGroups")},getDateRange:function(t,e){var s=R.a.unix(t).utc(),r=R.a.unix(e).utc();return{startDate:s.format("YYYY-MM-DD"),startTime:s.format("HH:mm"),endDate:r.format("YYYY-MM-DD"),endTime:r.format("HH:mm")}},toEpoch:function(t,e){return new Date(t+" "+e).getTime()/1e3},setDateRange:function(){this.$store.dispatch("reports/setFilter",{dateRange:[this.toEpoch(this.period.startDate,this.period.startTime),this.toEpoch(this.period.endDate,this.period.endTime)]})},reset:function(){this.showDateRange=!1,this.$store.dispatch("reports/resetFilter")},close:function(){this.$emit("close")}}},C=S,y=s("2877"),T=Object(y["a"])(C,x,b,!1,null,null,null);e["default"]=T.exports}}]);
//# sourceMappingURL=chunk-2d0b9bc4.49249a93.js.map