diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index 3d3f322c5..6f5296b9d 100644 --- a/app/vmselect/vmui/asset-manifest.json +++ b/app/vmselect/vmui/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "./static/css/main.5c28f4a7.css", - "main.js": "./static/js/main.0be86920.js", + "main.js": "./static/js/main.6eed9ce1.js", "static/js/27.c1ccfd29.chunk.js": "./static/js/27.c1ccfd29.chunk.js", "static/media/Lato-Regular.ttf": "./static/media/Lato-Regular.d714fec1633b69a9c2e9.ttf", "static/media/Lato-Bold.ttf": "./static/media/Lato-Bold.32360ba4b57802daa4d6.ttf", @@ -9,6 +9,6 @@ }, "entrypoints": [ "static/css/main.5c28f4a7.css", - "static/js/main.0be86920.js" + "static/js/main.6eed9ce1.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index f224f22d1..e3a2dc0c0 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -
'+(n?e:md(e,!0))+"
\n":""+(n?e:md(e,!0))+"
\n"}},{key:"blockquote",value:function(e){return"\n".concat(e,"\n")}},{key:"html",value:function(e){return e}},{key:"heading",value:function(e,t,n,r){if(this.options.headerIds){var i=this.options.headerPrefix+r.slug(n);return"
".concat(e,"
\n")}},{key:"table",value:function(e,t){return t&&(t="".concat(t,"")),"".concat(e,"
")}},{key:"br",value:function(){return this.options.xhtml?""+md(e.message+"",!0)+"";throw e}try{var l=jd.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(Vd.walkTokens(l,t.walkTokens)).then((function(){return Yd.parse(l,t)})).catch(u);Vd.walkTokens(l,t.walkTokens)}return Yd.parse(l,t)}catch(s){u(s)}}Vd.options=Vd.setOptions=function(e){var t;return Nd(Vd.defaults,e),t=Vd.defaults,cd=t,Vd},Vd.getDefaults=ld,Vd.defaults=cd,Vd.use=function(){for(var e=Vd.defaults.extensions||{renderers:{},childTokens:{}},t=arguments.length,n=new Array(t),r=0;r
"+md(s.message+"",!0)+"";throw s}},Vd.Parser=Yd,Vd.parser=Yd.parse,Vd.Renderer=$d,Vd.TextRenderer=Hd,Vd.Lexer=jd,Vd.lexer=jd.lex,Vd.Tokenizer=Ld,Vd.Slugger=Ud,Vd.parse=Vd;Vd.options,Vd.setOptions,Vd.use,Vd.walkTokens,Vd.parseInline,Yd.parse,jd.lex;var qd=function(e){var t=e.title,n=e.description,r=e.unit,i=e.expr,o=e.showLegend,a=e.filename,u=e.alias,l=Xo().isMobile,c=Ni().period,s=$o().customStep,f=Fi(),d=ie(null),h=Ft(ee(!1),2),p=h[0],v=h[1],m=Ft(ee({limits:{enable:!1,range:{1:[0,0]}}}),2),y=m[0],_=m[1],b=ae((function(){return Array.isArray(i)&&i.every((function(e){return e}))}),[i]),D=Uf({predefinedQuery:b?i:[],display:"chart",visible:p,customStep:s}),w=D.isLoading,x=D.graphData,k=D.error,C=D.warning,A=function(e){var t=yr({},y);t.limits.range=e,_(t)};if(ne((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){return v(e.isIntersecting)}))}),{threshold:.1});return d.current&&e.observe(d.current),function(){d.current&&e.unobserve(d.current)}}),[d]),!b)return Vr(ta,{variant:"error",children:[Vr("code",{children:'"expr"'})," not found. Check the configuration file ",Vr("b",{children:a}),"."]});var E=function(){return Vr("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Vr(g,{children:[Vr("div",{children:[Vr("span",{children:"Description:"}),Vr("div",{dangerouslySetInnerHTML:{__html:Vd.parse(n)}})]}),Vr("hr",{})]}),Vr("div",{children:[Vr("span",{children:"Queries:"}),Vr("div",{children:i.map((function(e,t){return Vr("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})};return Vr("div",{className:"vm-predefined-panel",ref:d,children:[Vr("div",{className:"vm-predefined-panel-header",children:[Vr(ma,{title:Vr(E,{}),children:Vr("div",{className:"vm-predefined-panel-header__info",children:Vr(Hi,{})})}),Vr("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Vr(Wf,{yaxis:y,setYaxisLimits:A,toggleEnableLimits:function(){var e=yr({},y);e.limits.enable=!e.limits.enable,_(e)}})]}),Vr("div",{className:"vm-predefined-panel-body",children:[w&&Vr(Qf,{}),k&&Vr(ta,{variant:"error",children:k}),C&&Vr(ta,{variant:"warning",children:C}),x&&Vr(Nf,{data:x,period:c,customStep:s,query:i,yaxis:y,unit:r,alias:u,showLegend:o,setYaxisLimits:A,setPeriod:function(e){var t=e.from,n=e.to;f({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1,height:l?.5*window.innerHeight:500})]})]})},Wd=function(e){var t=e.index,n=e.title,r=e.panels,i=e.filename,o=bo(document.body),a=ae((function(){return o.width/12}),[o]),u=Ft(ee(!t),2),l=u[0],c=u[1],s=Ft(ee([]),2),f=s[0],d=s[1];ne((function(){d(r&&r.map((function(e){return e.width||12})))}),[r]);var h=Ft(ee({start:0,target:0,enable:!1}),2),p=h[0],v=h[1],m=function(e){if(p.enable){var t=p.start,n=Math.ceil((t-e.clientX)/a);if(!(Math.abs(n)>=12)){var r=f.map((function(e,t){return e-(t===p.target?n:0)}));d(r)}}},g=function(){v(yr(yr({},p),{},{enable:!1}))},y=function(e){return function(t){!function(e,t){v({start:e.clientX,target:t,enable:!0})}(t,e)}};return ne((function(){return window.addEventListener("mousemove",m),window.addEventListener("mouseup",g),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",g)}}),[p]),Vr("div",{className:"vm-predefined-dashboard",children:Vr(qa,{defaultExpanded:l,onChange:function(e){return c(e)},title:Vr((function(){return Vr("div",{className:wo()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":l}),children:[(n||i)&&Vr("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),r&&Vr("span",{className:"vm-predefined-dashboard-header__count",children:["(",r.length," panels)"]})]})}),{}),children:Vr("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(r)&&r.length?r.map((function(e,t){return Vr("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(f[t])},children:[Vr(qd,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),Vr("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:y(t)})]},t)})):Vr("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Vr(ta,{variant:"error",children:[Vr("code",{children:'"panels"'})," not found. Check the configuration file ",Vr("b",{children:i}),"."]})})})})})},Qd=function(){!function(){var e=Ni(),t=e.duration,n=e.relativeTime,r=e.period.date,i=$o().customStep,o=Ft(pr(),2)[1],a=function(){var e,a=id((mr(e={},"g0.range_input",t),mr(e,"g0.end_input",r),mr(e,"g0.step_input",i),mr(e,"g0.relative_time",n),e));o(a)};ne(a,[t,n,r,i]),ne(a,[])}();var e=Xo().isMobile,t=ua(),n=t.dashboardsSettings,r=t.dashboardsLoading,i=t.dashboardsError,o=Ft(ee(0),2),a=o[0],u=o[1],l=ae((function(){return n.map((function(e,t){return{label:e.title||"",value:t}}))}),[n]),c=ae((function(){return n[a]||{}}),[n,a]),s=ae((function(){return null===c||void 0===c?void 0:c.rows}),[c]),f=ae((function(){return c.title||c.filename||""}),[c]),d=ae((function(){return Array.isArray(s)&&!!s.length}),[s]),h=function(e){return function(){!function(e){u(e)}(e)}};return Vr("div",{className:"vm-predefined-panels",children:[r&&Vr(Qf,{}),i&&Vr(ta,{variant:"error",children:i}),!n.length&&Vr(ta,{variant:"info",children:"Dashboards not found"}),l.length>1&&Vr("div",{className:wo()({"vm-predefined-panels-tabs":!0,"vm-block":!0,"vm-block_mobile":e}),children:l.map((function(e){return Vr("div",{className:wo()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==a}),onClick:h(e.value),children:e.label},e.value)}))}),Vr("div",{className:"vm-predefined-panels__dashboards",children:[d&&s.map((function(e,t){return Vr(Wd,{index:t,filename:f,title:e.title,panels:e.panels},"".concat(a,"_").concat(t))})),!!n.length&&!d&&Vr(ta,{variant:"error",children:[Vr("code",{children:'"rows"'})," not found. Check the configuration file ",Vr("b",{children:f}),"."]})]})]})},Gd=function(e,t){var n=t.match?"&match[]="+encodeURIComponent(t.match):"",r=t.focusLabel?"&focusLabel="+encodeURIComponent(t.focusLabel):"";return"".concat(e,"/api/v1/status/tsdb?topN=").concat(t.topN,"&date=").concat(t.date).concat(n).concat(r)},Jd=function(){function e(){Bt(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return Rt(e,[{key:"tsdbStatusData",get:function(){return this.tsdbStatus},set:function(e){this.tsdbStatus=e}},{key:"defaultTSDBStatus",get:function(){return{totalSeries:0,totalLabelValuePairs:0,seriesCountByMetricName:[],seriesCountByLabelName:[],seriesCountByFocusLabelValue:[],seriesCountByLabelValuePair:[],labelValueCountByLabelName:[]}}},{key:"keys",value:function(e){var t=[];return e&&(t=t.concat("seriesCountByFocusLabelValue")),t=t.concat("seriesCountByMetricName","seriesCountByLabelName","seriesCountByLabelValuePair","labelValueCountByLabelName"),t}},{key:"defaultState",get:function(){var e=this;return this.keys("job").reduce((function(t,n){return yr(yr({},t),{},{tabs:yr(yr({},t.tabs),{},mr({},n,e.tabsNames)),containerRefs:yr(yr({},t.containerRefs),{},mr({},n,ie(null))),defaultActiveTab:yr(yr({},t.defaultActiveTab),{},mr({},n,0))})}),{tabs:{},containerRefs:{},defaultActiveTab:{}})}},{key:"sectionsTitles",value:function(e){return{seriesCountByMetricName:"Metric names with the highest number of series",seriesCountByLabelName:"Labels with the highest number of series",seriesCountByFocusLabelValue:'Values for "'.concat(e,'" label with the highest number of series'),seriesCountByLabelValuePair:"Label=value pairs with the highest number of series",labelValueCountByLabelName:"Labels with the highest number of unique values"}}},{key:"tablesHeaders",get:function(){return{seriesCountByMetricName:Zd,seriesCountByLabelName:Kd,seriesCountByFocusLabelValue:Xd,seriesCountByLabelValuePair:eh,labelValueCountByLabelName:th}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),Zd=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Kd=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Xd=[{id:"name",label:"Label value"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{disablePadding:!1,id:"action",label:"Action",numeric:!1}],eh=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],th=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],nh={seriesCountByMetricName:function(e,t){return rh("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return rh(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return rh(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},rh=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},ih=function(e){var t=e.topN,n=e.error,r=e.query,i=e.onSetHistory,o=e.onRunQuery,a=e.onSetQuery,u=e.onTopNChange,l=e.onFocusLabelChange,c=e.totalSeries,s=e.totalLabelValuePairs,f=e.date,d=e.match,h=e.focusLabel,p=Li().autocomplete,v=Ii(),m=Xo().isMobile,g=Gf().queryOptions,y=ae((function(){return t<1?"Number must be bigger than zero":""}),[t]);return Vr("div",{className:wo()({"vm-cardinality-configurator":!0,"vm-block":!0,"vm-block_mobile":m}),children:[Vr("div",{className:"vm-cardinality-configurator-controls",children:[Vr("div",{className:"vm-cardinality-configurator-controls__query",children:Vr(Mf,{value:r,autocomplete:p,options:g,error:n,onArrowUp:function(){i(-1)},onArrowDown:function(){i(1)},onEnter:o,onChange:a,label:"Time series selector"})}),Vr("div",{className:"vm-cardinality-configurator-controls__item",children:Vr(xa,{label:"Number of entries per table",type:"number",value:t,error:y,onChange:u})}),Vr("div",{className:"vm-cardinality-configurator-controls__item",children:Vr(xa,{label:"Focus label",type:"text",value:h||"",onChange:l,endIcon:Vr(ma,{title:Vr("div",{children:[Vr("p",{children:"To identify values with the highest number of series for the selected label."}),Vr("p",{children:"Adds a table showing the series with the highest number of series."})]}),children:Vr(Hi,{})})})})]}),Vr("div",{className:"vm-cardinality-configurator-additional",children:Vr(Tf,{label:"Autocomplete",value:p,onChange:function(){v({type:"TOGGLE_AUTOCOMPLETE"})}})}),Vr("div",{className:wo()({"vm-cardinality-configurator-bottom":!0,"vm-cardinality-configurator-bottom_mobile":m}),children:[Vr("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",Vr("b",{children:c})," series with ",Vr("b",{children:s}),' "label=value" pairs at ',Vr("b",{children:f}),d&&Vr("span",{children:[" for series selector ",Vr("b",{children:d})]}),". Show top ",t," entries per table."]}),Vr("div",{className:"vm-cardinality-configurator-bottom__docs",children:[Vr("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/#cardinality-explorer",rel:"help noreferrer",children:[Vr(po,{}),"Documentation"]}),Vr("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://victoriametrics.com/blog/cardinality-explorer/",rel:"help noreferrer",children:[Vr(mo,{}),"Example of using"]})]}),Vr(fa,{startIcon:Vr(Xi,{}),onClick:o,fullWidth:!0,children:"Execute Query"})]})]})};function oh(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return Vr("thead",{className:"vm-table-header",children:Vr("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return Vr("th",{className:wo()({"vm-table-cell vm-table-cell_header":!0,"vm-table-cell_sort":"action"!==e.id&&"percentage"!==e.id,"vm-table-cell_right":"action"===e.id}),onClick:(i=e.id,function(e){r(e,i)}),children:Vr("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&Vr("div",{className:wo()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Vr(Qi,{})})]})},e.id);var i}))})})}function ah(e,t,n){return t[n]
'+(n?e:md(e,!0))+"
\n":""+(n?e:md(e,!0))+"
\n"}},{key:"blockquote",value:function(e){return"\n".concat(e,"\n")}},{key:"html",value:function(e){return e}},{key:"heading",value:function(e,t,n,r){if(this.options.headerIds){var i=this.options.headerPrefix+r.slug(n);return"
".concat(e,"
\n")}},{key:"table",value:function(e,t){return t&&(t="".concat(t,"")),"".concat(e,"
")}},{key:"br",value:function(){return this.options.xhtml?""+md(e.message+"",!0)+"";throw e}try{var l=jd.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(Vd.walkTokens(l,t.walkTokens)).then((function(){return Yd.parse(l,t)})).catch(u);Vd.walkTokens(l,t.walkTokens)}return Yd.parse(l,t)}catch(s){u(s)}}Vd.options=Vd.setOptions=function(e){var t;return Nd(Vd.defaults,e),t=Vd.defaults,cd=t,Vd},Vd.getDefaults=ld,Vd.defaults=cd,Vd.use=function(){for(var e=Vd.defaults.extensions||{renderers:{},childTokens:{}},t=arguments.length,n=new Array(t),r=0;r
"+md(s.message+"",!0)+"";throw s}},Vd.Parser=Yd,Vd.parser=Yd.parse,Vd.Renderer=$d,Vd.TextRenderer=Hd,Vd.Lexer=jd,Vd.lexer=jd.lex,Vd.Tokenizer=Ld,Vd.Slugger=Ud,Vd.parse=Vd;Vd.options,Vd.setOptions,Vd.use,Vd.walkTokens,Vd.parseInline,Yd.parse,jd.lex;var qd=function(e){var t=e.title,n=e.description,r=e.unit,i=e.expr,o=e.showLegend,a=e.filename,u=e.alias,l=Xo().isMobile,c=Ni().period,s=$o().customStep,f=Fi(),d=ie(null),h=Ft(ee(!1),2),p=h[0],v=h[1],m=Ft(ee({limits:{enable:!1,range:{1:[0,0]}}}),2),y=m[0],_=m[1],b=ae((function(){return Array.isArray(i)&&i.every((function(e){return e}))}),[i]),D=Uf({predefinedQuery:b?i:[],display:"chart",visible:p,customStep:s}),w=D.isLoading,x=D.graphData,k=D.error,C=D.warning,A=function(e){var t=yr({},y);t.limits.range=e,_(t)};if(ne((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){return v(e.isIntersecting)}))}),{threshold:.1});return d.current&&e.observe(d.current),function(){d.current&&e.unobserve(d.current)}}),[d]),!b)return Vr(ta,{variant:"error",children:[Vr("code",{children:'"expr"'})," not found. Check the configuration file ",Vr("b",{children:a}),"."]});var E=function(){return Vr("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Vr(g,{children:[Vr("div",{children:[Vr("span",{children:"Description:"}),Vr("div",{dangerouslySetInnerHTML:{__html:Vd.parse(n)}})]}),Vr("hr",{})]}),Vr("div",{children:[Vr("span",{children:"Queries:"}),Vr("div",{children:i.map((function(e,t){return Vr("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})};return Vr("div",{className:"vm-predefined-panel",ref:d,children:[Vr("div",{className:"vm-predefined-panel-header",children:[Vr(ma,{title:Vr(E,{}),children:Vr("div",{className:"vm-predefined-panel-header__info",children:Vr(Hi,{})})}),Vr("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Vr(Wf,{yaxis:y,setYaxisLimits:A,toggleEnableLimits:function(){var e=yr({},y);e.limits.enable=!e.limits.enable,_(e)}})]}),Vr("div",{className:"vm-predefined-panel-body",children:[w&&Vr(Qf,{}),k&&Vr(ta,{variant:"error",children:k}),C&&Vr(ta,{variant:"warning",children:C}),x&&Vr(Nf,{data:x,period:c,customStep:s,query:i,yaxis:y,unit:r,alias:u,showLegend:o,setYaxisLimits:A,setPeriod:function(e){var t=e.from,n=e.to;f({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1,height:l?.5*window.innerHeight:500})]})]})},Wd=function(e){var t=e.index,n=e.title,r=e.panels,i=e.filename,o=bo(document.body),a=ae((function(){return o.width/12}),[o]),u=Ft(ee(!t),2),l=u[0],c=u[1],s=Ft(ee([]),2),f=s[0],d=s[1];ne((function(){d(r&&r.map((function(e){return e.width||12})))}),[r]);var h=Ft(ee({start:0,target:0,enable:!1}),2),p=h[0],v=h[1],m=function(e){if(p.enable){var t=p.start,n=Math.ceil((t-e.clientX)/a);if(!(Math.abs(n)>=12)){var r=f.map((function(e,t){return e-(t===p.target?n:0)}));d(r)}}},g=function(){v(yr(yr({},p),{},{enable:!1}))},y=function(e){return function(t){!function(e,t){v({start:e.clientX,target:t,enable:!0})}(t,e)}};return ne((function(){return window.addEventListener("mousemove",m),window.addEventListener("mouseup",g),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",g)}}),[p]),Vr("div",{className:"vm-predefined-dashboard",children:Vr(qa,{defaultExpanded:l,onChange:function(e){return c(e)},title:Vr((function(){return Vr("div",{className:wo()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":l}),children:[(n||i)&&Vr("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),r&&Vr("span",{className:"vm-predefined-dashboard-header__count",children:["(",r.length," panels)"]})]})}),{}),children:Vr("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(r)&&r.length?r.map((function(e,t){return Vr("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(f[t])},children:[Vr(qd,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),Vr("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:y(t)})]},t)})):Vr("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Vr(ta,{variant:"error",children:[Vr("code",{children:'"panels"'})," not found. Check the configuration file ",Vr("b",{children:i}),"."]})})})})})},Qd=function(){!function(){var e=Ni(),t=e.duration,n=e.relativeTime,r=e.period.date,i=$o().customStep,o=Ft(pr(),2)[1],a=function(){var e,a=id((mr(e={},"g0.range_input",t),mr(e,"g0.end_input",r),mr(e,"g0.step_input",i),mr(e,"g0.relative_time",n),e));o(a)};ne(a,[t,n,r,i]),ne(a,[])}();var e=Xo().isMobile,t=ua(),n=t.dashboardsSettings,r=t.dashboardsLoading,i=t.dashboardsError,o=Ft(ee(0),2),a=o[0],u=o[1],l=ae((function(){return n.map((function(e,t){return{label:e.title||"",value:t}}))}),[n]),c=ae((function(){return n[a]||{}}),[n,a]),s=ae((function(){return null===c||void 0===c?void 0:c.rows}),[c]),f=ae((function(){return c.title||c.filename||""}),[c]),d=ae((function(){return Array.isArray(s)&&!!s.length}),[s]),h=function(e){return function(){!function(e){u(e)}(e)}};return Vr("div",{className:"vm-predefined-panels",children:[r&&Vr(Qf,{}),i&&Vr(ta,{variant:"error",children:i}),!n.length&&Vr(ta,{variant:"info",children:"Dashboards not found"}),l.length>1&&Vr("div",{className:wo()({"vm-predefined-panels-tabs":!0,"vm-block":!0,"vm-block_mobile":e}),children:l.map((function(e){return Vr("div",{className:wo()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==a}),onClick:h(e.value),children:e.label},e.value)}))}),Vr("div",{className:"vm-predefined-panels__dashboards",children:[d&&s.map((function(e,t){return Vr(Wd,{index:t,filename:f,title:e.title,panels:e.panels},"".concat(a,"_").concat(t))})),!!n.length&&!d&&Vr(ta,{variant:"error",children:[Vr("code",{children:'"rows"'})," not found. Check the configuration file ",Vr("b",{children:f}),"."]})]})]})},Gd=function(e,t){var n=t.match?"&match[]="+encodeURIComponent(t.match):"",r=t.focusLabel?"&focusLabel="+encodeURIComponent(t.focusLabel):"";return"".concat(e,"/api/v1/status/tsdb?topN=").concat(t.topN,"&date=").concat(t.date).concat(n).concat(r)},Jd=function(){function e(){Bt(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return Rt(e,[{key:"tsdbStatusData",get:function(){return this.tsdbStatus},set:function(e){this.tsdbStatus=e}},{key:"defaultTSDBStatus",get:function(){return{totalSeries:0,totalLabelValuePairs:0,seriesCountByMetricName:[],seriesCountByLabelName:[],seriesCountByFocusLabelValue:[],seriesCountByLabelValuePair:[],labelValueCountByLabelName:[]}}},{key:"keys",value:function(e){var t=[];return e&&(t=t.concat("seriesCountByFocusLabelValue")),t=t.concat("seriesCountByMetricName","seriesCountByLabelName","seriesCountByLabelValuePair","labelValueCountByLabelName"),t}},{key:"defaultState",get:function(){var e=this;return this.keys("job").reduce((function(t,n){return yr(yr({},t),{},{tabs:yr(yr({},t.tabs),{},mr({},n,e.tabsNames)),containerRefs:yr(yr({},t.containerRefs),{},mr({},n,ie(null))),defaultActiveTab:yr(yr({},t.defaultActiveTab),{},mr({},n,0))})}),{tabs:{},containerRefs:{},defaultActiveTab:{}})}},{key:"sectionsTitles",value:function(e){return{seriesCountByMetricName:"Metric names with the highest number of series",seriesCountByLabelName:"Labels with the highest number of series",seriesCountByFocusLabelValue:'Values for "'.concat(e,'" label with the highest number of series'),seriesCountByLabelValuePair:"Label=value pairs with the highest number of series",labelValueCountByLabelName:"Labels with the highest number of unique values"}}},{key:"tablesHeaders",get:function(){return{seriesCountByMetricName:Zd,seriesCountByLabelName:Kd,seriesCountByFocusLabelValue:Xd,seriesCountByLabelValuePair:eh,labelValueCountByLabelName:th}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),Zd=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Kd=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Xd=[{id:"name",label:"Label value"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{disablePadding:!1,id:"action",label:"Action",numeric:!1}],eh=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],th=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],nh={seriesCountByMetricName:function(e,t){return rh("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return rh(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return rh(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},rh=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},ih=function(e){var t=e.topN,n=e.error,r=e.query,i=e.onSetHistory,o=e.onRunQuery,a=e.onSetQuery,u=e.onTopNChange,l=e.onFocusLabelChange,c=e.totalSeries,s=e.totalLabelValuePairs,f=e.date,d=e.match,h=e.focusLabel,p=Li().autocomplete,v=Ii(),m=Xo().isMobile,g=Gf().queryOptions,y=ae((function(){return t<1?"Number must be bigger than zero":""}),[t]);return Vr("div",{className:wo()({"vm-cardinality-configurator":!0,"vm-block":!0,"vm-block_mobile":m}),children:[Vr("div",{className:"vm-cardinality-configurator-controls",children:[Vr("div",{className:"vm-cardinality-configurator-controls__query",children:Vr(Mf,{value:r,autocomplete:p,options:g,error:n,onArrowUp:function(){i(-1)},onArrowDown:function(){i(1)},onEnter:o,onChange:a,label:"Time series selector"})}),Vr("div",{className:"vm-cardinality-configurator-controls__item",children:Vr(xa,{label:"Number of entries per table",type:"number",value:t,error:y,onChange:u})}),Vr("div",{className:"vm-cardinality-configurator-controls__item",children:Vr(xa,{label:"Focus label",type:"text",value:h||"",onChange:l,endIcon:Vr(ma,{title:Vr("div",{children:[Vr("p",{children:"To identify values with the highest number of series for the selected label."}),Vr("p",{children:"Adds a table showing the series with the highest number of series."})]}),children:Vr(Hi,{})})})})]}),Vr("div",{className:"vm-cardinality-configurator-additional",children:Vr(Tf,{label:"Autocomplete",value:p,onChange:function(){v({type:"TOGGLE_AUTOCOMPLETE"})}})}),Vr("div",{className:wo()({"vm-cardinality-configurator-bottom":!0,"vm-cardinality-configurator-bottom_mobile":m}),children:[Vr("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",Vr("b",{children:c})," series with ",Vr("b",{children:s}),' "label=value" pairs at ',Vr("b",{children:f}),d&&Vr("span",{children:[" for series selector ",Vr("b",{children:d})]}),". Show top ",t," entries per table."]}),Vr("div",{className:"vm-cardinality-configurator-bottom__docs",children:[Vr("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/#cardinality-explorer",rel:"help noreferrer",children:[Vr(po,{}),"Documentation"]}),Vr("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://victoriametrics.com/blog/cardinality-explorer/",rel:"help noreferrer",children:[Vr(mo,{}),"Example of using"]})]}),Vr(fa,{startIcon:Vr(Xi,{}),onClick:o,fullWidth:!0,children:"Execute Query"})]})]})};function oh(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return Vr("thead",{className:"vm-table-header",children:Vr("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return Vr("th",{className:wo()({"vm-table-cell vm-table-cell_header":!0,"vm-table-cell_sort":"action"!==e.id&&"percentage"!==e.id,"vm-table-cell_right":"action"===e.id}),onClick:(i=e.id,function(e){r(e,i)}),children:Vr("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&Vr("div",{className:wo()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Vr(Qi,{})})]})},e.id);var i}))})})}function ah(e,t,n){return t[n]