⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.78
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
build
/
View File Name :
AlertRuleListLegacy.8e675db4469232c87308.js
"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9312],{71826:(T,h,t)=>{t.r(h),t.d(h,{AlertRuleListUnconnected:()=>I,default:()=>G});var e=t(96540),f=t(69733),u=t(12131),g=t(32264),d=t(67647),p=t(88323),m=t(55852),E=t(66864),A=t(28138),y=t(36830),v=t(28444),C=t(37390);function s({onDismiss:a}){return e.createElement(C.a,{title:"Adding an Alert",isOpen:!0,onDismiss:a,onClickBackdrop:a},e.createElement(E.gW,{spacing:"sm"},e.createElement("img",{src:"public/img/alert_howto_new.png",alt:""}),e.createElement("p",null,"Alerts are added and configured in the Alert tab of any dashboard graph panel, letting you build and visualize an alert using existing queries."),e.createElement("p",null,"Remember to save the dashboard to persist your alert rule changes.")))}var l=t(23257),r=t.n(l),i=t(10860),R=t(14578);const O=({rule:a,search:n,onTogglePause:o})=>{const N=`${a.url}?editPanel=${a.panelId}&tab=alert`,c=(0,e.useCallback)(S=>e.createElement(r(),{key:S,highlightClassName:"highlight-search-match",textToHighlight:S,searchWords:[n]}),[n]);return e.createElement(i.Z,null,e.createElement(i.Z.Heading,null,c(a.name)),e.createElement(i.Z.Figure,null,e.createElement(R.I,{size:"xl",name:a.stateIcon,className:`alert-rule-item__icon ${a.stateClass}`})),e.createElement(i.Z.Meta,null,e.createElement("span",{key:"state"},e.createElement("span",{key:"text",className:`${a.stateClass}`},c(a.stateText)," "),"for ",a.stateAge),a.info?c(a.info):null),e.createElement(i.Z.Actions,null,e.createElement(m.$n,{key:"play",variant:"secondary",icon:a.state==="paused"?"play":"pause",onClick:o},a.state==="paused"?"Resume":"Pause"),e.createElement(m.z9,{key:"edit",variant:"secondary",href:N,icon:"cog"},"Edit alert")))};var F=t(42418);const Z="grafana.legacyalerting.unifiedalertingpromo",L=()=>e.createElement(F.F,{severity:"warning",title:"Grafana legacy alerting is deprecated and will be removed in a future release."},e.createElement("p",null,"You are using Grafana legacy alerting, which has been deprecated since Grafana 9.0. The codebase is now staying as is and will be removed in Grafana 11.0.",e.createElement("br",null),"We recommend upgrading to Grafana Alerting as soon as possible."),e.createElement("p",null,"See"," ",e.createElement("a",{href:"https://grafana.com/docs/grafana/latest/alerting/set-up/migrating-alerts/"},"how to upgrade to Grafana Alerting")," ","to learn more."));var P=t(52659),M=t(52806);const D=a=>a.searchQuery,x=a=>{const n=new RegExp(a.alertRules.searchQuery,"i");return a.alertRules.items.filter(o=>n.test(o.name)||n.test(o.stateText)||n.test(o.info))},B=(a,n)=>a.notificationChannel.id===n?a.notificationChannel:null;function $(a){return{alertRules:x(a),search:D(a.alertRules),isLoading:a.alertRules.isLoading}}const U={getAlertRulesAsync:P.yF,setSearchQuery:M.Ri,togglePauseAlertRule:P.l3},W=(0,f.connect)($,U);class I extends e.PureComponent{constructor(){super(...arguments),this.stateFilters=[{label:"All",value:"all"},{label:"OK",value:"ok"},{label:"Not OK",value:"not_ok"},{label:"Alerting",value:"alerting"},{label:"No data",value:"no_data"},{label:"Paused",value:"paused"},{label:"Pending",value:"pending"}],this.onStateFilterChanged=n=>{u.Ny.partial({state:n.value})},this.onOpenHowTo=()=>{A.A.publish(new v.S8({component:s}))},this.onSearchQueryChange=n=>{this.props.setSearchQuery(n)},this.onTogglePause=n=>{this.props.togglePauseAlertRule(n.id,{paused:n.state!=="paused"})},this.alertStateFilterOption=({text:n,value:o})=>e.createElement("option",{key:o,value:o},n)}componentDidMount(){this.fetchRules()}componentDidUpdate(n){n.queryParams.state!==this.props.queryParams.state&&this.fetchRules()}async fetchRules(){await this.props.getAlertRulesAsync({state:this.getStateFilter()})}getStateFilter(){return this.props.queryParams.state??"all"}render(){const{alertRules:n,search:o,isLoading:N}=this.props;return e.createElement(y.Y,{navId:"alert-list-legacy"},e.createElement(y.Y.Contents,{isLoading:N},e.createElement("div",{className:"page-action-bar"},e.createElement("div",{className:"gf-form gf-form--grow"},e.createElement(d.Z,{placeholder:"Search alerts",value:o,onChange:this.onSearchQueryChange})),e.createElement("div",{className:"gf-form"},e.createElement("label",{className:"gf-form-label",htmlFor:"alert-state-filter"},"States"),e.createElement("div",{className:"width-13"},e.createElement(p.l6,{inputId:"alert-state-filter",options:this.stateFilters,onChange:this.onStateFilterChanged,value:this.getStateFilter()}))),e.createElement("div",{className:"page-action-bar__spacer"}),g.$.unifiedAlertingEnabled&&e.createElement(m.z9,{variant:"primary",href:"alerting-legacy/ng/new"},"Add NG Alert"),e.createElement(m.$n,{variant:"secondary",onClick:this.onOpenHowTo},"How to add an alert")),e.createElement(L,null),e.createElement(E.gW,{spacing:"none"},n.map(c=>e.createElement(O,{rule:c,key:c.id,search:o,onTogglePause:()=>this.onTogglePause(c)})))))}}const G=W(I)},52659:(T,h,t)=>{t.d(h,{$h:()=>C,L5:()=>E,d:()=>y,fo:()=>v,l3:()=>m,ut:()=>A,yF:()=>p});var e=t(17172),f=t(12131),u=t(82467),g=t(3169),d=t(52806);function p(s){return async l=>{l((0,d.EF)());const r=await(0,e.AI)().get("/api/alerts",s);l((0,d.L9)(r))}}function m(s,l){return async r=>{await(0,e.AI)().post(`/api/alerts/${s}/pause`,l);const i=f.Ny.getSearchObject().state||"all";r(p({state:i.toString()}))}}function E(s){return async l=>{try{await(0,e.AI)().post("/api/alert-notifications",s),l((0,u.dx)((0,g.tZ)("Notification created"))),f.Ny.push("/alerting-legacy/notifications")}catch(r){(0,e.NF)(r)&&l((0,u.dx)((0,g.gi)(r.data.error)))}}}function A(s){return async l=>{try{await(0,e.AI)().put(`/api/alert-notifications/${s.id}`,s),l((0,u.dx)((0,g.tZ)("Notification updated")))}catch(r){(0,e.NF)(r)&&l((0,u.dx)((0,g.gi)(r.data.error)))}}}function y(s){return async(l,r)=>{const i=r().notificationChannel.notificationChannel;await(0,e.AI)().post("/api/alert-notifications/test",{id:i.id,...s})}}function v(){return async s=>{const r=(await(0,e.AI)().get("/api/alert-notifiers-legacy")).sort((i,R)=>i.name>R.name?1:-1);s((0,d.of)(r))}}function C(s){return async l=>{await l(v());const r=await(0,e.AI)().get(`/api/alert-notifications/${s}`);l((0,d.cN)(r))}}}}]); //# sourceMappingURL=AlertRuleListLegacy.8e675db4469232c87308.js.map