diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index 6beaef4d6..2a926dcc9 100644 --- a/app/vmselect/vmui/asset-manifest.json +++ b/app/vmselect/vmui/asset-manifest.json @@ -1,12 +1,12 @@ { "files": { "main.css": "./static/css/main.e8e53cbf.css", - "main.js": "./static/js/main.b53fb552.js", + "main.js": "./static/js/main.58fe7908.js", "static/js/27.c1ccfd29.chunk.js": "./static/js/27.c1ccfd29.chunk.js", "index.html": "./index.html" }, "entrypoints": [ "static/css/main.e8e53cbf.css", - "static/js/main.b53fb552.js" + "static/js/main.58fe7908.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index a86ea93fd..3b09855aa 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -
'+(n?e:Hf(e,!0))+"
\n":""+(n?e:Hf(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?""+Hf(e.message+"",!0)+"";throw e}try{var l=hd.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(gd.walkTokens(l,t.walkTokens)).then((function(){return yd.parse(l,t)})).catch(u);gd.walkTokens(l,t.walkTokens)}return yd.parse(l,t)}catch(s){u(s)}}gd.options=gd.setOptions=function(e){var t;return nd(gd.defaults,e),t=gd.defaults,If=t,gd},gd.getDefaults=Lf,gd.defaults=If,gd.use=function(){for(var e=gd.defaults.extensions||{renderers:{},childTokens:{}},t=arguments.length,n=new Array(t),r=0;r
"+Hf(s.message+"",!0)+"";throw s}},gd.Parser=yd,gd.parser=yd.parse,gd.Renderer=pd,gd.TextRenderer=vd,gd.Lexer=hd,gd.lexer=hd.lex,gd.Tokenizer=ld,gd.Slugger=md,gd.parse=gd;gd.options,gd.setOptions,gd.use,gd.walkTokens,gd.parseInline,yd.parse,hd.lex;var _d=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=mi().period,c=So().customStep,s=yi(),f=ie(null),d=At(ee(!0),2),h=d[0],p=d[1],v=At(ee({limits:{enable:!1,range:{1:[0,0]}}}),2),m=v[0],g=v[1],_=ae((function(){return Array.isArray(i)&&i.every((function(e){return e}))}),[i]),b=mf({predefinedQuery:_?i:[],display:"chart",visible:h,customStep:c}),D=b.isLoading,w=b.graphData,x=b.error,k=b.warning,C=function(e){var t=dr({},m);t.limits.range=e,g(t)};if(ne((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){return p(e.isIntersecting)}))}),{threshold:.1});return f.current&&e.observe(f.current),function(){f.current&&e.unobserve(f.current)}}),[]),!_)return Fr(Ro,{variant:"error",children:[Fr("code",{children:'"expr"'})," not found. Check the configuration file ",Fr("b",{children:a}),"."]});var E=function(){return Fr("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Fr(y,{children:[Fr("div",{children:[Fr("span",{children:"Description:"}),Fr("div",{dangerouslySetInnerHTML:{__html:gd.parse(n)}})]}),Fr("hr",{})]}),Fr("div",{children:[Fr("span",{children:"Queries:"}),Fr("div",{children:i.map((function(e,t){return Fr("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})};return Fr("div",{className:"vm-predefined-panel",ref:f,children:[Fr("div",{className:"vm-predefined-panel-header",children:[Fr(Zo,{title:Fr(E,{}),children:Fr("div",{className:"vm-predefined-panel-header__info",children:Fr(Ni,{})})}),Fr("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Fr(bf,{yaxis:m,setYaxisLimits:C,toggleEnableLimits:function(){var e=dr({},m);e.limits.enable=!e.limits.enable,g(e)}})]}),Fr("div",{className:"vm-predefined-panel-body",children:[D&&Fr(Df,{}),x&&Fr(Ro,{variant:"error",children:x}),k&&Fr(Ro,{variant:"warning",children:k}),w&&Fr(tf,{data:w,period:l,customStep:c,query:i,yaxis:m,unit:r,alias:u,showLegend:o,setYaxisLimits:C,setPeriod:function(e){var t=e.from,n=e.to;s({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1})]})]})},bd=function(e){var t=e.index,n=e.title,r=e.panels,i=e.filename,o=oo(document.body),a=ae((function(){return o.width/12}),[o]),u=At(ee(!t),2),l=u[0],c=u[1],s=At(ee([]),2),f=s[0],d=s[1];ne((function(){d(r&&r.map((function(e){return e.width||12})))}),[r]);var h=At(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)}}},y=function(){v(dr(dr({},p),{},{enable:!1}))},g=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",y),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",y)}}),[p]),Fr("div",{className:"vm-predefined-dashboard",children:Fr(ga,{defaultExpanded:l,onChange:function(e){return c(e)},title:Fr((function(){return Fr("div",{className:uo()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":l}),children:[(n||i)&&Fr("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),r&&Fr("span",{className:"vm-predefined-dashboard-header__count",children:["(",r.length," panels)"]})]})}),{}),children:Fr("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(r)&&r.length?r.map((function(e,t){return Fr("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(f[t])},children:[Fr(_d,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),Fr("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:g(t)})]},t)})):Fr("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Fr(Ro,{variant:"error",children:[Fr("code",{children:'"panels"'})," not found. Check the configuration file ",Fr("b",{children:i}),"."]})})})})})},Dd=function(){!function(){var e=mi(),t=e.duration,n=e.relativeTime,r=e.period.date,i=So().customStep,o=function(){var e,o=Of((sr(e={},"g0.range_input",t),sr(e,"g0.end_input",r),sr(e,"g0.step_input",i),sr(e,"g0.relative_time",n),e));Cr(o)};ne(o,[t,n,r,i]),ne(o,[])}();var e=Vo(),t=e.dashboardsSettings,n=e.dashboardsLoading,r=e.dashboardsError,i=At(ee(0),2),o=i[0],a=i[1],u=ae((function(){return t.map((function(e,t){return{label:e.title||"",value:t}}))}),[t]),l=ae((function(){return t[o]||{}}),[t,o]),c=ae((function(){return null===l||void 0===l?void 0:l.rows}),[l]),s=ae((function(){return l.title||l.filename||""}),[l]),f=ae((function(){return Array.isArray(c)&&!!c.length}),[c]),d=function(e){return function(){!function(e){a(e)}(e)}};return Fr("div",{className:"vm-predefined-panels",children:[n&&Fr(Df,{}),r&&Fr(Ro,{variant:"error",children:r}),!t.length&&Fr(Ro,{variant:"info",children:"Dashboards not found"}),u.length>1&&Fr("div",{className:"vm-predefined-panels-tabs vm-block",children:u.map((function(e){return Fr("div",{className:uo()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==o}),onClick:d(e.value),children:e.label},e.value)}))}),Fr("div",{className:"vm-predefined-panels__dashboards",children:[f&&c.map((function(e,t){return Fr(bd,{index:t,filename:s,title:e.title,panels:e.panels},"".concat(o,"_").concat(t))})),!!t.length&&!f&&Fr(Ro,{variant:"error",children:[Fr("code",{children:'"rows"'})," not found. Check the configuration file ",Fr("b",{children:s}),"."]})]})]})},wd=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)},xd=function(){function e(){Ft(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return Bt(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 dr(dr({},t),{},{tabs:dr(dr({},t.tabs),{},sr({},n,e.tabsNames)),containerRefs:dr(dr({},t.containerRefs),{},sr({},n,ie(null))),defaultActiveTab:dr(dr({},t.defaultActiveTab),{},sr({},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:kd,seriesCountByLabelName:Cd,seriesCountByFocusLabelValue:Ed,seriesCountByLabelValuePair:Sd,labelValueCountByLabelName:Ad}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),kd=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Cd=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Ed=[{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}],Sd=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Ad=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],Nd={seriesCountByMetricName:function(e,t){return Fd("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return Fd(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return Fd(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},Fd=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},Od=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=wi().autocomplete,v=xi(),m=wf().queryOptions,y=ae((function(){return t<1?"Number must be bigger than zero":""}),[t]);return Fr("div",{className:"vm-cardinality-configurator vm-block",children:[Fr("div",{className:"vm-cardinality-configurator-controls",children:[Fr("div",{className:"vm-cardinality-configurator-controls__query",children:Fr(rf,{value:r||d||"",autocomplete:p,options:m,error:n,onArrowUp:function(){i(-1)},onArrowDown:function(){i(1)},onEnter:o,onChange:a,label:"Time series selector"})}),Fr("div",{className:"vm-cardinality-configurator-controls__item",children:Fr(da,{label:"Number of entries per table",type:"number",value:t,error:y,onChange:u})}),Fr("div",{className:"vm-cardinality-configurator-controls__item",children:Fr(da,{label:"Focus label",type:"text",value:h||"",onChange:l})}),Fr("div",{className:"vm-cardinality-configurator-controls__item",children:Fr(lf,{label:"Autocomplete",value:p,onChange:function(){v({type:"TOGGLE_AUTOCOMPLETE"})}})})]}),Fr("div",{className:"vm-cardinality-configurator-bottom",children:[Fr("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",Fr("b",{children:c})," series with ",Fr("b",{children:s}),' "label=value" pairs at ',Fr("b",{children:f}),d&&Fr("span",{children:[" for series selector ",Fr("b",{children:d})]}),". Show top ",t," entries per table."]}),Fr(Qo,{startIcon:Fr(Ui,{}),onClick:o,children:"Execute Query"})]})]})};function Td(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return Fr("thead",{className:"vm-table-header",children:Fr("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return Fr("th",{className:uo()({"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:Fr("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&Fr("div",{className:uo()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Fr(Li,{})})]})},e.id);var i}))})})}function Md(e,t,n){return t[n]
'+(n?e:Hf(e,!0))+"
\n":""+(n?e:Hf(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?""+Hf(e.message+"",!0)+"";throw e}try{var l=hd.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(gd.walkTokens(l,t.walkTokens)).then((function(){return yd.parse(l,t)})).catch(u);gd.walkTokens(l,t.walkTokens)}return yd.parse(l,t)}catch(s){u(s)}}gd.options=gd.setOptions=function(e){var t;return nd(gd.defaults,e),t=gd.defaults,If=t,gd},gd.getDefaults=Lf,gd.defaults=If,gd.use=function(){for(var e=gd.defaults.extensions||{renderers:{},childTokens:{}},t=arguments.length,n=new Array(t),r=0;r
"+Hf(s.message+"",!0)+"";throw s}},gd.Parser=yd,gd.parser=yd.parse,gd.Renderer=pd,gd.TextRenderer=vd,gd.Lexer=hd,gd.lexer=hd.lex,gd.Tokenizer=ld,gd.Slugger=md,gd.parse=gd;gd.options,gd.setOptions,gd.use,gd.walkTokens,gd.parseInline,yd.parse,hd.lex;var _d=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=mi().period,c=So().customStep,s=yi(),f=ie(null),d=At(ee(!0),2),h=d[0],p=d[1],v=At(ee({limits:{enable:!1,range:{1:[0,0]}}}),2),m=v[0],g=v[1],_=ae((function(){return Array.isArray(i)&&i.every((function(e){return e}))}),[i]),b=mf({predefinedQuery:_?i:[],display:"chart",visible:h,customStep:c}),D=b.isLoading,w=b.graphData,x=b.error,k=b.warning,C=function(e){var t=dr({},m);t.limits.range=e,g(t)};if(ne((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){return p(e.isIntersecting)}))}),{threshold:.1});return f.current&&e.observe(f.current),function(){f.current&&e.unobserve(f.current)}}),[]),!_)return Fr(Ro,{variant:"error",children:[Fr("code",{children:'"expr"'})," not found. Check the configuration file ",Fr("b",{children:a}),"."]});var E=function(){return Fr("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Fr(y,{children:[Fr("div",{children:[Fr("span",{children:"Description:"}),Fr("div",{dangerouslySetInnerHTML:{__html:gd.parse(n)}})]}),Fr("hr",{})]}),Fr("div",{children:[Fr("span",{children:"Queries:"}),Fr("div",{children:i.map((function(e,t){return Fr("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})};return Fr("div",{className:"vm-predefined-panel",ref:f,children:[Fr("div",{className:"vm-predefined-panel-header",children:[Fr(Zo,{title:Fr(E,{}),children:Fr("div",{className:"vm-predefined-panel-header__info",children:Fr(Ni,{})})}),Fr("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Fr(bf,{yaxis:m,setYaxisLimits:C,toggleEnableLimits:function(){var e=dr({},m);e.limits.enable=!e.limits.enable,g(e)}})]}),Fr("div",{className:"vm-predefined-panel-body",children:[D&&Fr(Df,{}),x&&Fr(Ro,{variant:"error",children:x}),k&&Fr(Ro,{variant:"warning",children:k}),w&&Fr(tf,{data:w,period:l,customStep:c,query:i,yaxis:m,unit:r,alias:u,showLegend:o,setYaxisLimits:C,setPeriod:function(e){var t=e.from,n=e.to;s({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1})]})]})},bd=function(e){var t=e.index,n=e.title,r=e.panels,i=e.filename,o=oo(document.body),a=ae((function(){return o.width/12}),[o]),u=At(ee(!t),2),l=u[0],c=u[1],s=At(ee([]),2),f=s[0],d=s[1];ne((function(){d(r&&r.map((function(e){return e.width||12})))}),[r]);var h=At(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)}}},y=function(){v(dr(dr({},p),{},{enable:!1}))},g=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",y),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",y)}}),[p]),Fr("div",{className:"vm-predefined-dashboard",children:Fr(ga,{defaultExpanded:l,onChange:function(e){return c(e)},title:Fr((function(){return Fr("div",{className:uo()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":l}),children:[(n||i)&&Fr("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),r&&Fr("span",{className:"vm-predefined-dashboard-header__count",children:["(",r.length," panels)"]})]})}),{}),children:Fr("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(r)&&r.length?r.map((function(e,t){return Fr("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(f[t])},children:[Fr(_d,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),Fr("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:g(t)})]},t)})):Fr("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Fr(Ro,{variant:"error",children:[Fr("code",{children:'"panels"'})," not found. Check the configuration file ",Fr("b",{children:i}),"."]})})})})})},Dd=function(){!function(){var e=mi(),t=e.duration,n=e.relativeTime,r=e.period.date,i=So().customStep,o=function(){var e,o=Of((sr(e={},"g0.range_input",t),sr(e,"g0.end_input",r),sr(e,"g0.step_input",i),sr(e,"g0.relative_time",n),e));Cr(o)};ne(o,[t,n,r,i]),ne(o,[])}();var e=Vo(),t=e.dashboardsSettings,n=e.dashboardsLoading,r=e.dashboardsError,i=At(ee(0),2),o=i[0],a=i[1],u=ae((function(){return t.map((function(e,t){return{label:e.title||"",value:t}}))}),[t]),l=ae((function(){return t[o]||{}}),[t,o]),c=ae((function(){return null===l||void 0===l?void 0:l.rows}),[l]),s=ae((function(){return l.title||l.filename||""}),[l]),f=ae((function(){return Array.isArray(c)&&!!c.length}),[c]),d=function(e){return function(){!function(e){a(e)}(e)}};return Fr("div",{className:"vm-predefined-panels",children:[n&&Fr(Df,{}),r&&Fr(Ro,{variant:"error",children:r}),!t.length&&Fr(Ro,{variant:"info",children:"Dashboards not found"}),u.length>1&&Fr("div",{className:"vm-predefined-panels-tabs vm-block",children:u.map((function(e){return Fr("div",{className:uo()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==o}),onClick:d(e.value),children:e.label},e.value)}))}),Fr("div",{className:"vm-predefined-panels__dashboards",children:[f&&c.map((function(e,t){return Fr(bd,{index:t,filename:s,title:e.title,panels:e.panels},"".concat(o,"_").concat(t))})),!!t.length&&!f&&Fr(Ro,{variant:"error",children:[Fr("code",{children:'"rows"'})," not found. Check the configuration file ",Fr("b",{children:s}),"."]})]})]})},wd=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)},xd=function(){function e(){Ft(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return Bt(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 dr(dr({},t),{},{tabs:dr(dr({},t.tabs),{},sr({},n,e.tabsNames)),containerRefs:dr(dr({},t.containerRefs),{},sr({},n,ie(null))),defaultActiveTab:dr(dr({},t.defaultActiveTab),{},sr({},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:kd,seriesCountByLabelName:Cd,seriesCountByFocusLabelValue:Ed,seriesCountByLabelValuePair:Sd,labelValueCountByLabelName:Ad}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),kd=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Cd=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Ed=[{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}],Sd=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Ad=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],Nd={seriesCountByMetricName:function(e,t){return Fd("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return Fd(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return Fd(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},Fd=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},Od=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=wi().autocomplete,v=xi(),m=wf().queryOptions,y=ae((function(){return t<1?"Number must be bigger than zero":""}),[t]);return Fr("div",{className:"vm-cardinality-configurator vm-block",children:[Fr("div",{className:"vm-cardinality-configurator-controls",children:[Fr("div",{className:"vm-cardinality-configurator-controls__query",children:Fr(rf,{value:r||d||"",autocomplete:p,options:m,error:n,onArrowUp:function(){i(-1)},onArrowDown:function(){i(1)},onEnter:o,onChange:a,label:"Time series selector"})}),Fr("div",{className:"vm-cardinality-configurator-controls__item",children:Fr(da,{label:"Number of entries per table",type:"number",value:t,error:y,onChange:u})}),Fr("div",{className:"vm-cardinality-configurator-controls__item",children:Fr(da,{label:"Focus label",type:"text",value:h||"",onChange:l})}),Fr("div",{className:"vm-cardinality-configurator-controls__item",children:Fr(lf,{label:"Autocomplete",value:p,onChange:function(){v({type:"TOGGLE_AUTOCOMPLETE"})}})})]}),Fr("div",{className:"vm-cardinality-configurator-bottom",children:[Fr("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",Fr("b",{children:c})," series with ",Fr("b",{children:s}),' "label=value" pairs at ',Fr("b",{children:f}),d&&Fr("span",{children:[" for series selector ",Fr("b",{children:d})]}),". Show top ",t," entries per table."]}),Fr(Qo,{startIcon:Fr(Ui,{}),onClick:o,children:"Execute Query"})]})]})};function Td(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return Fr("thead",{className:"vm-table-header",children:Fr("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return Fr("th",{className:uo()({"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:Fr("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&Fr("div",{className:uo()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Fr(Li,{})})]})},e.id);var i}))})})}function Md(e,t,n){return t[n]