web-interface.assets.bb8c8232-9201.254dbea333abf953c23e.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-9201"],{SfPIQIJE:(Z,A,r)=>{r.d(A,{A:()=>f});var v=r("Z7aTuO5B"),s=r("J6y4/h8P"),e=r("rIl5IEuP"),a=r("ty2gyrHp"),w=r("IOI9nV80"),M=r("NV1/EHMi");const b=(0,s.default)(e.ButtonToolbar)`
margin-bottom: 10px;
`,S=(0,s.default)(e.Button)(({theme:d})=>(0,s.css)`
font-family: ${d.fonts.family.navigation};
font-size: ${d.fonts.size.navigation};
color: ${d.colors.variant.darker.default};
&:hover,
&:focus {
background: inherit;
text-decoration: none;
}
&:hover {
color: inherit;
${(0,M.WS)(d)}
}
&.active {
color: ${d.colors.global.textDefault};
${(0,M.at)(d)}
&:hover,
&:focus {
${(0,M.at)(d)}
}
`);S.displayName="Button";const f=({items:d})=>v.createElement(b,null,d.map(({path:D,title:W,permissions:_,exactPathMatch:G})=>D?v.createElement(w.Wj,{permissions:_!=null?_:[],key:D},v.createElement(a.m,{to:D,relativeActive:!G},v.createElement(S,{bsStyle:"link"},v.createElement(M.Ay,null,W)))):null))},D8q7xuJq:(Z,A,r)=>{r.d(A,{A:()=>S});var v=r("DUKaTDO2"),s=r("jAGDuYSC"),e=r("eFxcQyPT"),a=r("MdYBRjRJ");const w={customFieldMappings:[],name:null,id:null,description:null,indexSetIds:[]},M=async x=>{const f=(0,a.H3)(`/system/indices/index_sets/profiles/${x}`);return(0,e.Ay)("GET",f).then(d=>({id:d.id,name:d.name,description:d.description,customFieldMappings:d.custom_field_mappings,indexSetIds:d.index_set_ids}))},S=x=>{const{data:f,isFetched:d,isFetching:D,refetch:W}=(0,v.useQuery)(["indexSetFieldTypeProfile",x],()=>M(x),{onError:_=>{s.A.error(`Loading index field type profile failed with status: ${_}`,"Could not load index field type profile")},keepPreviousData:!0,enabled:!!x});return{data:f!=null?f:w,isFetched:d,isFetching:D,refetch:W}}},JA6mCPyt:(Z,A,r)=>{r.d(A,{A:()=>S});var v=r("DUKaTDO2"),s=r("MdYBRjRJ"),e=r("eFxcQyPT"),a=r("jAGDuYSC");const w=[],M=async()=>{const x=(0,s.H3)("/system/indices/index_sets/profiles/all");return(0,e.Ay)("GET",x).then(f=>f.map(({name:d,id:D})=>({value:D,label:d})))},S=()=>{const{data:x,isLoading:f,refetch:d}=(0,v.useQuery)(["indexSetFieldTypeProfileOptions"],()=>M(),{onError:D=>{a.A.error(`Loading index field type profile options failed with status: ${D}`,"Could not load index field type profile options")},keepPreviousData:!0});return{options:x!=null?x:w,isLoading:f,refetch:d}}},"6bzBY7Xo":(Z,A,r)=>{r.d(A,{Pd:()=>c,V$:()=>E,lc:()=>S,pr:()=>f});var v=r("ii0bleBb"),s=r.n(v);const e=s().exact({max_index_retention_period:s().string}),a=s().exact({type:s().string,max_size:s().number}),w=s().exact({type:s().string,max_docs_per_index:s().number}),M=s().exact({type:s().string,rotation_period:s().string,max_rotation_period:s().string,rotate_empty_index_set:s().bool}),b=s().exact({type:s().string,index_lifetime_max:s().string,index_lifetime_min:s().string}),S=s().oneOfType([a,w,M,b]),x=s().string,f=s().shape({type:s().string.isRequired,max_number_of_indices:s().number,index_action:s().string}),d=s().exact({type:s().string.isRequired}),D=s().exact({type:s().string.isRequired,enum:s().arrayOf(s().string).isRequired}),W=s().exact({rotation_period:d,max_rotation_period:d,type:d.isRequired,max_size:d,max_docs_per_index:d,rotate_empty_index_set:d,index_lifetime_max:d,index_lifetime_min:d}),_=s().exact({type:s().string.isRequired,id:s().string,properties:W.isRequired}),G=s().exact({max_number_of_indices:d.isRequired,type:d.isRequired,index_action:D}),m=s().exact({type:s().string.isRequired,id:s().string,properties:G}),E=s().exact({type:s().string.isRequired,default_config:S.isRequired,json_schema:_.isRequired}),c=s().exact({type:s().string.isRequired,default_config:f.isRequired,json_schema:m.isRequired})},tnyWuV3Q:(Z,A,r)=>{r.d(A,{A:()=>e});const v=["failures","events"],e=a=>!v.includes(a==null?void 0:a.index_template_type)},Zr9SSA9t:(Z,A,r)=>{r.d(A,{$c:()=>m,Hq:()=>Oe,A9:()=>f,Rp:()=>Kt,r3:()=>je,BC:()=>Je,xO:()=>rn,JY:()=>Se,Ou:()=>rt,$B:()=>gt,K2:()=>fn,d4:()=>yn,TC:()=>Sn,Oe:()=>Re,kp:()=>dt});var v=r("ii0bleBb"),s=r.n(v),e=r("Z7aTuO5B"),a=r("rIl5IEuP"),w=r("4IfE3Ihm"),M=Object.defineProperty,b=(t,n,i)=>n in t?M(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,S=(t,n,i)=>(b(t,typeof n!="symbol"?n+"":n,i),i);class x extends e.Component{render(){const{indexRange:n}=this.props;return n?e.createElement("span",null,"Range re-calculated"," ",e.createElement(w.A,{dateTime:n.calculated_at})," ","in ",n.took_ms,"ms."):e.createElement("span",null,e.createElement("i",null,"No index range available."))}}S(x,"propTypes",{indexRange:s().object});const f=x;var d=r("aHNeFNVd"),D=Object.defineProperty,W=(t,n,i)=>n in t?D(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,_=(t,n,i)=>(W(t,typeof n!="symbol"?n+"":n,i),i);class G extends e.Component{constructor(){super(...arguments),_(this,"_onReopen",()=>{d.Zm.reopen(this.props.indexName)}),_(this,"_onDeleteIndex",()=>{window.confirm(`Really delete index ${this.props.indexName}?`)&&d.Zm.delete(this.props.indexName)})}render(){const{indexRange:n}=this.props;return e.createElement("div",{className:"index-info"},e.createElement(f,{indexRange:n}),e.createElement(a.Alert,{bsStyle:"info"},"This index is closed. Index information is not available"," ","at the moment, please reopen the index and try again."),e.createElement("hr",{style:{marginBottom:"5",marginTop:"10"}}),e.createElement(a.Button,{bsStyle:"warning",bsSize:"xs",onClick:this._onReopen},"Reopen index")," ",e.createElement(a.Button,{bsStyle:"danger",bsSize:"xs",onClick:this._onDeleteIndex},"Delete index"))}}_(G,"propTypes",{indexName:s().string.isRequired,indexRange:s().object});const m=G;var E=r("8wYeYPUw"),c=r("zkmy/ViL"),l=r("IOI9nV80"),Y=r("JnTtTRmZ"),O=r.n(Y),F=r("jAGDuYSC"),j=r("MdYBRjRJ"),ne=r("U1Iufsob"),ie=r("eFxcQyPT"),ue=r("IA3Ku5lS");const Q=(0,ue.rN)("core.IndexRanges",()=>O().createActions({list:{asyncResult:!0},recalculate:{asyncResult:!0},recalculateIndex:{asyncResult:!0}})),Pn=(0,ue.Bv)("core.IndexRanges",()=>O().createStore({listenables:[Q],indexRanges:void 0,getInitialState(){return{indexRanges:this.indexRanges}},init(){Q.list()},list(){const t=j.H3(ne.A.IndexRangesApiController.list().url),n=(0,ie.Ay)("GET",t).then(i=>{this.indexRanges=i.ranges,this.trigger(this.getInitialState())});Q.list.promise(n)},recalculate(t){const n=j.H3(ne.A.IndexRangesApiController.rebuild(t).url),i=(0,ie.Ay)("POST",n);i.then(F.A.success("Index ranges will be recalculated shortly")).catch(o=>{F.A.error(`Could not create a job to start index ranges recalculation, reason: ${o}`,"Error starting index ranges recalculation")}),Q.recalculate.promise(i)},recalculateIndex(t){const n=j.H3(ne.A.IndexRangesApiController.rebuildSingle(t).url),i=(0,ie.Ay)("POST",n);i.then(F.A.success(`Index ranges for ${t} will be recalculated shortly`)).catch(o=>{F.A.error(`Could not create a job to start index ranges recalculation for ${t}, reason: ${o}`,`Error starting index ranges recalculation for ${t}`)}),Q.recalculateIndex.promise(i)}})),Me=({index:t,indexName:n,indexRange:i,indexSetId:o,isDeflector:p})=>{(0,e.useEffect)(()=>(d.Zm.subscribe(n),()=>{d.Zm.unsubscribe(n)}),[n]);const h=(0,e.useCallback)(()=>{window.confirm(`Really recalculate the index ranges for index ${n}?`)&&Q.recalculateIndex(n).then(()=>{d.Zm.list(o)})},[n,o]),y=(0,e.useCallback)(()=>{window.confirm(`Really delete index ${n}?`)&&d.Zm.delete(n).then(()=>{d.Zm.list(o)})},[n,o]),R=(0,e.useMemo)(()=>p?e.createElement("span",null,e.createElement(a.Button,{bsStyle:"danger",bsSize:"xs",disabled:!0},"Active write index cannot be deleted")):e.createElement("span",null,e.createElement(a.Button,{bsStyle:"warning",bsSize:"xs",onClick:h},"Recalculate index ranges")," ",e.createElement(a.Button,{bsStyle:"danger",bsSize:"xs",onClick:y},"Delete index")),[p,y,h]);return!t||!t.all_shards?e.createElement(l.y$,null):e.createElement("div",{className:"index-info"},e.createElement(f,{indexRange:i})," ",e.createElement(E.A,null,c.A.formatNumber(t.all_shards.segments)," segments,"," ",c.A.formatNumber(t.all_shards.open_search_contexts)," open search contexts,"," ",c.A.formatNumber(t.all_shards.documents.deleted)," deleted messages",e.createElement(a.Row,{style:{marginBottom:"10"}},e.createElement(a.Col,{md:4,className:"shard-meters"},e.createElement(Re,{title:"Primary shard operations",shardMeter:t.primary_shards})),e.createElement(a.Col,{md:4,className:"shard-meters"},e.createElement(Re,{title:"Total shard operations",shardMeter:t.all_shards}))),e.createElement(dt,{routing:t.routing,indexName:n})),e.createElement("hr",{style:{marginBottom:"5",marginTop:"10"}}),R)};Me.propTypes={index:s().object.isRequired,indexName:s().string.isRequired,indexRange:s().object.isRequired,indexSetId:s().string.isRequired,isDeflector:s().bool.isRequired};const Oe=Me;var $e=r("/7OuCFNo"),X=r("d4kzUuQm"),mt=r("+K2jZtwG");const gt=({indexSetId:t})=>{const n=(0,mt.A)(),i=(0,$e.A)(),o=(0,e.useCallback)(()=>{i.push(X.Ay.SYSTEM.INDEX_SETS.FIELD_TYPES(t))},[i,t]);return n?e.createElement(a.ButtonGroup,null,e.createElement(a.DropdownButton,{bsStyle:"info",title:"Configuration",id:"indices-configuration-actions",pullRight:!0},n&&e.createElement(a.MenuItem,{onClick:o},"Configure index field types"))):null};var pt=r("9oVghaOd"),ae=r.n(pt),le=r("UiXZqrDE"),g=r("J6y4/h8P"),q=r("QL8i6bcz"),ft=r("RCNj0OY4"),Et=r("DUKaTDO2");const ht=()=>(0,ie.Ay)("GET",(0,j.H3)(`${ne.A.ClusterConfigResource.config().url}/org.graylog2.configuration.IndexSetsDefaultConfiguration`)),we=()=>{const{data:t,isLoading:n}=(0,Et.useQuery)(["index-defaults"],ht,{onError:i=>{F.A.error(`Error fetching index defaults: ${i.message}`)},retry:1});return{loadingIndexDefaultsConfig:n,indexDefaultsConfig:t}};var Le=r("hVkUd7xY"),$n=r("7AEsdJl4"),wn=r("aozvvWC3");const Be=["index_lifetime_max","index_lifetime_min","index_hot_lifetime_min"],yt=["index_hot_lifetime_min","warm_tier_enabled","warm_tier_repository_name"],ye=t=>Math.round(ae().duration(t).asDays()),xt=t=>{if(!t.data_tiering)return t;let{data_tiering:n}=t;return Be.forEach(i=>{if(n[i]){const o=ye(n[i]);n={...n,[i]:o}}}),{...t,data_tiering:n}},_t=(t,n)=>{var i;if(!t.data_tiering)return t;const o={archive_before_deletion:!1,warm_tier_enabled:!1,warm_tier_repository_name:null},p=n.exports("dataTiering").find(R=>R.type===oe.HOT_WARM),h=(i=p==null?void 0:p.type)!=null?i:oe.HOT_ONLY;let{data_tiering:y}=t;return h===oe.HOT_WARM&&(y={...o,...y}),h===oe.HOT_ONLY&&yt.forEach(R=>{delete y[R]}),Be.forEach(R=>{y[R]&&(y={...y,[R]:`P${y[R]}D`})}),y={...y,type:h},{...t,data_tiering:y}},St=()=>{var t;const n=q.d.exports("dataTiering").find(h=>h.type==="hot_warm"),{values:i}=(0,le.useFormikContext)(),o=h=>h<0?"Negative numbers are not allowed.":"",p=h=>{var y,R,$;const L=[];return h<0&&L.push("Negative numbers are not allowed."),h>((y=i==null?void 0:i.data_tiering)==null?void 0:y.index_lifetime_max)&&L.push("Min. days in storage needs to be smaller than max. days in storage."),(R=i==null?void 0:i.data_tiering)!=null&&R.warm_tier_enabled&&h<(($=i==null?void 0:i.data_tiering)==null?void 0:$.index_hot_lifetime_min)&&L.push("Min. days in storage needs to be bigger than min. days in hot tier."),L.length>0?L.join(" "):""};return e.createElement(e.Fragment,null,e.createElement(l.o$,{type:"number",label:"Max. days in storage",name:"data_tiering.index_lifetime_max",min:0,help:"After how many days your data should be deleted.",validate:o,required:!0}),e.createElement(l.o$,{type:"number",label:"Min. days in storage",name:"data_tiering.index_lifetime_min",min:0,max:(t=i==null?void 0:i.data_tiering)==null?void 0:t.index_lifetime_max,validate:p,help:"How many days at minumum your data should be stored.",required:!0}),n&&e.createElement(e.Fragment,null,e.createElement(a.Input,{id:"roles-selector-input",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Archiving"},e.createElement(l.jF,{type:"checkbox",id:"data_tiering.archive_before_deletion",label:"Archive before deletion",name:"data_tiering.archive_before_deletion",help:"Archive this index before it is deleted?"})),e.createElement(n.TiersConfigurationFields,null)))},Rt=({config:t})=>e.createElement("div",null,e.createElement("dl",null,e.createElement("dt",null,"Rotation strategy:"),e.createElement("dd",null,"Data Tiering"),e.createElement("dt",null,"Max. in storage:"),e.createElement("dd",null,ye(t.index_lifetime_max)," days"),e.createElement("dt",null,"Min. in storage:"),e.createElement("dd",null,ye(t.index_lifetime_min)," days"))),It=g.default.div(({theme:t})=>(0,g.css)`
padding-left: ${t.spacings.md};
padding-right: ${t.spacings.md};
display: flex;
align-items: center;
justify-content: space-between;
`),vt=g.default.div`
overflow: hidden;
width: 100%;
`,bt=g.default.p(({theme:t})=>(0,g.css)`
margin-left: ${t.spacings.sm};
margin-bottom: 0;
`),Fe=g.default.div`
position: relative;
height: 60px;
`,Ct=g.default.div(({theme:t})=>(0,g.css)`
height: 40px;
background: ${t.colors.variant.lighter.info};
position: relative;
`),Ne=g.default.div(({theme:t,value:n,color:i})=>(0,g.css)`
height: 100%;
font-size: ${t.fonts.size.small};
text-align: center;
flex-shrink: 0;
background-color: ${i};
transition: width 500ms ease-in-out;
position: absolute;
left: 0;
width: ${n}%;
max-width: 100%;
cursor: pointer;
&::after {
border-right: 1px solid ${t.colors.variant.darkest.info};
content: '';
position: absolute;
right: 0;
bottom: 0;
height: 60px;
z-index: 1;
}
`),Ue=g.default.div(({value:t})=>(0,g.css)`
position: absolute;
bottom: 25px;
${t>3?`right: ${100-t}%;`:"left: 0;"}
`),xe=(0,g.default)(a.Tooltip)(({value:t})=>(0,g.css)`
position: absolute;
top: 0;
${t>12?`
right: ${100-t}%;
&.bottom > .tooltip-arrow {
margin-left: -20px;
}
`:`
left: 0;
margin-left: 3px;
`}
`),ze=({archiveData:t,minDays:n,maxDays:i,minDaysInHot:o,warmTierEnabled:p})=>{const[h,y]=(0,e.useState)(!1),[R,$]=(0,e.useState)(!1),L=(0,g.useTheme)(),V=C=>C<=0||i<=0?0:C/i*100,I=V(n),P=V(o),T=p&&P>0;return e.createElement(It,null,e.createElement(vt,null,e.createElement(Fe,null,I>0&&e.createElement(Ue,{value:I},n," days"),T&&P!==I&&e.createElement(Ue,{value:P},o," days")),e.createElement(Ct,null,e.createElement(Ne,{value:I,color:L.colors.variant.info,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)}),T&&e.createElement(Ne,{value:P,color:L.colors.variant.darkest.info,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1)})),e.createElement(Fe,null,T&&R&&(P===I?e.createElement(xe,{placement:"bottom",id:"min-days-in-hot-and-storage",arrowOffsetLeft:P<=12?"10px":"100%",value:P},"Min. # of days in Hot Tier and storage"):e.createElement(xe,{placement:"bottom",id:"min-days-in-hot",arrowOffsetLeft:P<=12?"10px":"100%",value:P},"Min. # of days in Hot Tier")),I>0&&h&&e.createElement(xe,{placement:"bottom",id:"min-days-in-storage",arrowOffsetLeft:I<=12?"10px":"100%",value:I},"Min. # of days in storage"))),e.createElement(bt,null,t?"Archived and deleted":"Deleted"," after ",e.createElement("strong",null,i," days")))},Dt=ze;ze.defaultProps={minDays:0,maxDays:0,minDaysInHot:0,warmTierEnabled:!1,archiveData:!1};const oe={HOT_ONLY:"hot_only",HOT_WARM:"hot_warm"};var k=r("PhRf2fIG"),Tt=r("zJwTQ5+g"),me=r("ty2gyrHp"),At=r("JA6mCPyt");const Pt=(0,g.styled)(a.Alert)`
overflow: auto;
margin-right: 15px;
margin-left: 15px;
`,Mt=(0,g.styled)(l.l6)`
margin-bottom: 10px;
`,Ot=g.styled.h3`
margin-bottom: 10px;
`,$t=({value:t,onChange:n,name:i})=>{const{isLoading:o,options:p}=(0,At.A)(),h=y=>n(y||null);return e.createElement("div",null,e.createElement(Ot,null,"Index Set Profile"),e.createElement(Pt,null,"With index set field type ",e.createElement(me.N,{target:"_blank",to:X.Ay.SYSTEM.INDICES.FIELD_TYPE_PROFILES.OVERVIEW},"profiles")," you can bundle up custom field types into profiles. You can assign any profile to this index set. To see and use profile setting for index set, you have to rotate indices."),e.createElement(a.Row,null,e.createElement(a.Col,{md:12},e.createElement(a.Input,{id:i,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Index field type mapping profile"},e.createElement(Mt,{placeholder:"Select index field type profile",inputId:i,options:p,value:t,disabled:o,onChange:h})))))};var wt=r("zJE5UjMB");const Lt=t=>{const{loadingIndexDefaultsConfig:n,indexDefaultsConfig:i}=we(),[o,p]=(0,e.useState)(t);return(0,e.useEffect)(()=>{if(n||!i)return;const h={title:"",description:"",index_prefix:i.index_prefix,writable:!0,can_be_default:!0,shards:i.shards,data_tiering:i.data_tiering,replicas:i.replicas,rotation_strategy_class:i.rotation_strategy_class,rotation_strategy:i.rotation_strategy_config,retention_strategy_class:i.retention_strategy_class,retention_strategy:i.retention_strategy_config,index_analyzer:i.index_analyzer,index_optimization_max_num_segments:i.index_optimization_max_num_segments,index_optimization_disabled:i.index_optimization_disabled,field_type_refresh_interval:ae().duration(i.field_type_refresh_interval,i.field_type_refresh_interval_unit).asMilliseconds()};if(t){const y=Object.fromEntries(Object.entries(t).filter(([R,$])=>$!=null));p({...h,...y})}else p({...h})},[n,i,t]),[o,p]};var Bt=r("tnyWuV3Q");const Ft=(0,g.default)(l.hP)`
margin-left: 0;
`,Nt=g.default.h2(({theme:t})=>(0,g.css)`
margin-bottom: ${t.spacings.sm};
`),We=g.default.div(({theme:t})=>(0,g.css)`
margin-bottom: ${t.spacings.xs};
margin-top: ${t.spacings.md};
`),Ut=t=>{let n;return(t==null?void 0:t.length)===0?n="Invalid index prefix: cannot be empty":(t==null?void 0:t.indexOf("_"))===0||(t==null?void 0:t.indexOf("-"))===0||(t==null?void 0:t.indexOf("+"))===0?n="Invalid index prefix: must start with a letter or number":(t==null?void 0:t.toLocaleLowerCase())!==t?n="Invalid index prefix: must be lower case":t!=null&&t.match(/^[a-z0-9][a-z0-9_\-+]*$/)||(n="Invalid index prefix: must only contain letters, numbers, '_', '-' and '+'"),n},zt=(t,n)=>({rotation_strategy_class:t,rotation_strategy:n}),Wt=(t,n)=>({retention_strategy_class:t,retention_strategy:n}),He=({rotationStrategies:t,indexSetRotationStrategy:n,indexSetRotationStrategyClass:i})=>t?e.createElement(Le.A,{title:"Index Rotation Configuration",name:"rotation",description:"Graylog uses multiple indices to store documents in. You can configure the strategy it uses to determine when to rotate the currently active write index.",selectPlaceholder:"Select rotation strategy",pluginExports:q.d.exports("indexRotationConfig"),strategies:t,activeConfig:{config:n,strategy:i},getState:zt}):e.createElement(l.y$,null),Ke=({retentionStrategies:t,retentionStrategiesContext:n,indexSetRetentionStrategy:i,IndexSetRetentionStrategyClass:o})=>t?e.createElement(Le.A,{title:"Index Retention Configuration",name:"retention",description:"Graylog uses a retention strategy to clean up old indices.",selectPlaceholder:"Select retention strategy",pluginExports:q.d.exports("indexRetentionConfig"),strategies:t,retentionStrategiesContext:n,activeConfig:{config:i,strategy:o},getState:Wt}):e.createElement(l.y$,null),Ht=()=>{const t=e.createElement("span",null,"A ",e.createElement("strong",null,"unique")," prefix used in Elasticsearch indices belonging to this index set. The prefix must start with a letter or number, and can only contain letters, numbers, '_', '-' and '+'.");return e.createElement("span",null,e.createElement(l.o$,{type:"text",label:"Index prefix",name:"index_prefix",help:t,validate:Ut,required:!0}),e.createElement(l.o$,{type:"text",label:"Analyzer",name:"index_analyzer",help:"Elasticsearch analyzer for this index set.",required:!0}))},_e=({indexSet:t,rotationStrategies:n,retentionStrategies:i,retentionStrategiesContext:o,create:p,onUpdate:h,cancelLink:y,submitButtonText:R,submitLoadingText:$})=>{const L=(0,$e.A)(),[V,I]=(0,e.useState)("seconds"),{loadingIndexDefaultsConfig:P,indexDefaultsConfig:T}=we(),[C]=Lt(t),ee=ft.A.isCloud(),J=(0,wt.A)("data_tiering_cloud"),Ie=[{value:"data_tiering",label:"Data Tiering"},{value:"legacy",label:"Legacy (Deprecated)"}],ve=()=>C!=null&&C.use_legacy_rotation?"legacy":"data_tiering",[se,be]=(0,e.useState)(ve()),Ce=(0,e.useCallback)(U=>{const z={...U,data_tiering:T.data_tiering,use_legacy_rotation:!0};if(ee&&!J||se==="legacy")return z;const K=_t(U,q.d);if(P||!T)return{...K,use_legacy_rotation:!1};const B={rotation_strategy_class:T.rotation_strategy_class,rotation_strategy:T.rotation_strategy_config,retention_strategy_class:T.retention_strategy_class,retention_strategy:T.retention_strategy_config};return{...K,...B,use_legacy_rotation:!1}},[P,T,se,J,ee]),De=U=>h(Ce(U)),ge=(U,z,K,B,te)=>{B(K,ae().duration(U,z).asMilliseconds()),te(K,ae().duration(U,z).asMilliseconds()),I(z)};if(!C)return null;const{rotation_strategy:pe,rotation_strategy_class:fe,retention_strategy:u,retention_strategy_class:N}=C,Te=()=>L.push(y);return P?e.createElement(l.y$,null):e.createElement(a.Row,null,e.createElement(a.Col,{md:8},e.createElement(le.Formik,{onSubmit:De,enableReinitialize:!0,initialValues:xt(C)},({isValid:U,setFieldValue:z,isSubmitting:K,values:B})=>{var te,ce,Ee,ct,ut;return e.createElement(Tt.A,null,e.createElement(le.Form,null,e.createElement(a.Row,null,e.createElement(a.Col,{md:12},e.createElement(l.o$,{type:"text",label:"Title",name:"title",help:"Descriptive name of the index set.",required:!0}),e.createElement(l.o$,{type:"text",label:"Description",name:"description",help:"Add a description of this index set.",required:!0}),p&&e.createElement(Ht,null),e.createElement(E.A,null,e.createElement(l.o$,{type:"number",label:"Index shards",name:"shards",help:"Number of Elasticsearch shards used per index in this index set.",required:!0}),e.createElement(l.o$,{type:"number",label:"Index replicas",name:"replicas",help:"Number of Elasticsearch replicas used per index in this index set.",required:!0}),e.createElement(l.o$,{type:"number",label:"Max. number of segments",name:"index_optimization_max_num_segments",minLength:1,help:"Maximum number of segments per Elasticsearch index after optimization (force merge).",required:!0}),e.createElement(a.Input,{id:"roles-selector-input",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Index optimization after rotation"},e.createElement(l.jF,{type:"checkbox",id:"index_optimization_disabled",label:"Disable index optimization after rotation",name:"index_optimization_disabled",help:"Disable Elasticsearch index optimization (force merge) after rotation."})),e.createElement(le.Field,{name:"field_type_refresh_interval"},({field:{name:he,value:Ae,onChange:Pe}})=>e.createElement(a.Input,{id:"roles-selector-input",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Field type refresh interval"},e.createElement(l.gM,{id:"field-type-refresh-interval",type:"number",help:"How often the field type information for the active write index will be updated.",value:ae().duration(Ae,"milliseconds").as(V),unit:V.toUpperCase(),units:["SECONDS","MINUTES"],required:!0,update:(Tn,An)=>ge(Tn,An,he,Pe,z)})))))),ee&&!J?e.createElement(e.Fragment,null,C.writable&&e.createElement(He,{rotationStrategies:n,indexSetRotationStrategy:pe,indexSetRotationStrategyClass:fe}),C.writable&&e.createElement(Ke,{retentionStrategies:i,retentionStrategiesContext:o,indexSetRetentionStrategy:u,IndexSetRetentionStrategyClass:N})):e.createElement(e.Fragment,null,e.createElement(Nt,null,"Rotation and Retention"),e.createElement(a.SegmentedControl,{data:Ie,value:se,handleChange:be}),se==="data_tiering"?e.createElement(We,null,e.createElement("h3",null,"Data Tiering Configuration"),e.createElement(Dt,{minDays:(te=B.data_tiering)==null?void 0:te.index_lifetime_min,maxDays:(ce=B.data_tiering)==null?void 0:ce.index_lifetime_max,minDaysInHot:(Ee=B.data_tiering)==null?void 0:Ee.index_hot_lifetime_min,warmTierEnabled:(ct=B.data_tiering)==null?void 0:ct.warm_tier_enabled,archiveData:(ut=B.data_tiering)==null?void 0:ut.archive_before_deletion}),e.createElement(St,null)):e.createElement(We,null,C.writable&&e.createElement(He,{rotationStrategies:n,indexSetRotationStrategy:pe,indexSetRotationStrategyClass:fe}),C.writable&&e.createElement(Ke,{retentionStrategies:i,retentionStrategiesContext:o,indexSetRetentionStrategy:u,IndexSetRetentionStrategyClass:N}))),(0,Bt.A)(C)&&e.createElement(le.Field,{name:"field_type_profile"},({field:{name:he,value:Ae}})=>e.createElement($t,{value:Ae,onChange:Pe=>{z(he,Pe)},name:he})),e.createElement(a.Row,null,e.createElement(a.Col,{md:9,mdOffset:3},e.createElement(Ft,{disabledSubmit:!U,submitButtonText:R,submitLoadingText:$,isSubmitting:K,isAsyncSubmit:!0,displayCancel:!0,onCancel:Te})))))})))};_e.propTypes={indexSet:k.qg,rotationStrategies:s().array.isRequired,retentionStrategies:s().array.isRequired,retentionStrategiesContext:s().shape({max_index_retention_period:s().string}).isRequired,create:s().bool,onUpdate:s().func.isRequired,cancelLink:s().string.isRequired,submitButtonText:s().string.isRequired,submitLoadingText:s().string.isRequired},_e.defaultProps={create:!1,indexSet:void 0};const Kt=_e;var Ge=r("4E3oowBb"),Gt=r("gTexEe+8"),Yt=r("pUKP3+Pg"),jt=Object.defineProperty,Vt=(t,n,i)=>n in t?jt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,H=(t,n,i)=>(Vt(t,typeof n!="symbol"?n+"":n,i),i);class Ye extends e.Component{constructor(n){super(n),H(this,"_onModalOpen",()=>{Yt.hZ.load(i=>{const o=[];i.forEach(p=>{p.index_set_id===this.props.indexSet.id&&o.push({id:p.id,title:p.title})}),this.setState({assignedStreams:o})})}),H(this,"open",()=>{this.setState({showModal:!0},this._onModalOpen)}),H(this,"close",()=>{this.setState({showModal:!1})}),H(this,"_onRemoveClick",i=>{this.setState({deleteIndices:i.target.checked})}),H(this,"_isLoading",()=>!this.state.assignedStreams),H(this,"_isDeletable",()=>!this._isLoading()&&this.state.assignedStreams.length<1&&!this.props.indexSet.default),H(this,"_modalContent",()=>{if(this._isLoading())return e.createElement(l.y$,{text:"Loading assigned streams..."});if(this.props.indexSet.default)return e.createElement(a.Row,null,e.createElement(a.Col,{md:12},e.createElement(a.Alert,{bsStyle:"danger"},"Unable to delete the index set because it is the default index set!")));if(!this._isDeletable()){const i=this.state.assignedStreams.sort((o,p)=>(0,Ge.j)(o.title,p.title)).map(o=>e.createElement("li",{key:`stream-id-${o.id}`},o.title));return e.createElement("div",null,e.createElement(a.Row,null,e.createElement(a.Col,{md:12},e.createElement(a.Alert,{bsStyle:"danger"},"Unable to delete the index set because it has assigned streams. Remove stream assignments to be able to delete this index set."))),e.createElement(a.Row,null,e.createElement(a.Col,{md:12},e.createElement("h4",null,"Assigned streams:"),e.createElement("ul",null,i))))}return e.createElement(a.Row,null,e.createElement(a.Col,{md:12},e.createElement(a.Input,{id:"remove-data-checkbox",type:"checkbox",label:"Remove all data for this index set?",help:e.createElement("span",null,"All indices related to this index set will be deleted from Elasticsearch."),checked:this.state.deleteIndices,onChange:this._onRemoveClick})))}),H(this,"_onDelete",i=>{i.preventDefault(),this._isDeletable()&&(this.props.onDelete(this.props.indexSet,this.state.deleteIndices),this.close())}),this.state={showModal:!1,assignedStreams:void 0,deleteIndices:!0}}render(){return e.createElement(Gt.A,{show:this.state.showModal,title:`Delete index set "${this.props.indexSet.title}"?`,"data-telemetry-title":"Delete index set",onCancel:this.close,onSubmitForm:this._onDelete,submitButtonText:"Delete",submitButtonDisabled:!this._isDeletable()},this._modalContent())}}H(Ye,"propTypes",{indexSet:s().object.isRequired,onDelete:s().func.isRequired});const je=Ye;var Jt=r("D8q7xuJq");const Zt=(0,g.default)(a.Row)`
dl {
margin-bottom: 0;
dt {
float: left;
width: 190px;
overflow: hidden;
clear: left;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
}
dd {
margin-left: 180px;
}
}
`,Ve=({indexSet:t})=>{const{data:{name:n},isFetching:i}=(0,Jt.A)(t.field_type_profile);return e.createElement(Zt,null,e.createElement(a.Col,{lg:3},e.createElement("dl",null,e.createElement("dt",null,"Index prefix:"),e.createElement("dd",null,t.index_prefix),e.createElement(E.A,null,e.createElement("dt",null,"Shards:"),e.createElement("dd",null,t.shards),e.createElement("dt",null,"Replicas:"),e.createElement("dd",null,t.replicas)),e.createElement("dt",null,"Field type refresh interval:"),e.createElement("dd",null,t.field_type_refresh_interval/1e3," seconds"),e.createElement("dt",null,"Field type profile:"),!i&&e.createElement("dd",null,t.field_type_profile?e.createElement(me.N,{to:X.Ay.SYSTEM.INDICES.FIELD_TYPE_PROFILES.edit(t.field_type_profile),target:"_blank"},n):e.createElement("i",null,"Not set")))),e.createElement(a.Col,{lg:6},e.createElement(rt,{indexSet:t})))};Ve.propTypes={indexSet:s().object.isRequired};const Je=Ve;var Qt=r("CrIFpfDF"),Ze=r("TJOheZRu"),Xt=r("8fnsnG21"),qt=r("rVdVsuGH"),kt=r("8OvTct/Z"),en=r("0t7Ye+61"),Qe=r("v4GbOr/o");const tn=(0,g.default)(a.Row)(({theme:t})=>(0,g.css)`
border-bottom: 1px solid ${t.colors.gray[90]};
padding-bottom: ${t.spacings.sm};
`),nn=(0,g.default)(a.Col)(({theme:t})=>(0,g.css)`
display: flex;
align-items: center;
gap: ${t.spacings.xs};
`),an=g.default.p`
margin-bottom: 0;
`,Xe=g.default.span`
font-style: italic;
`,qe=t=>{if(!t)return"N/A";const n=`${c.A.formatNumber(t.indices)} ${Ze.A.pluralize(t.indices,"index","indices")}`,i=`${c.A.formatNumber(t.documents)} ${Ze.A.pluralize(t.documents,"document","documents")}`,o=c.A.formatBytes(t.size);return`${n}, ${i}, ${o}`},rn=()=>{const{indexSetsCount:o,indexSets:p,indexSetStats:h,globalIndexSetStats:y}=(0,Xt.P)(k.zE),{page:R,resetPage:$}=(0,qt.Ay)(),L=(0,kt.A)(),{pathname:V}=(0,en.A)(),[I,P]=(0,e.useState)(!1),[T,C]=(0,e.useState)(void 0),ee=(0,e.useRef)(),J=(0,e.useCallback)((u=1,N=10)=>{T?k.pG.searchPaginated(T,(u-1)*N,N,I):k.pG.listPaginated((u-1)*N,N,I)},[I,T]);(0,e.useEffect)(()=>{J(R)},[J,R]),(0,e.useEffect)(()=>{I&&k.pG.stats()},[I]);const Ie=u=>{(u&&u.length>=3||!u||u.length===0)&&(C(u),$())},ve=()=>{C(void 0),$()},se=()=>{P(!I)},be=u=>()=>{L(Qe.g.INDICES.INDEX_SET_DEFAULT_SET,{app_pathname:(0,j.i)(V),app_section:"index-sets",app_action_value:"set-default-index-set"}),k.pG.setDefault(u).then(()=>J())},Ce=u=>()=>{ee.current[`index-set-deletion-form-${u.id}`].open()},De=(u,N)=>{L(Qe.g.INDICES.INDEX_SET_DELETED,{app_pathname:(0,j.i)(V),app_section:"index-sets",app_action_value:"delete-index-set"}),k.pG.delete(u,N).then(()=>{$(),J(R)})},ge="Stats are disabled by default",pe=u=>{const N=e.createElement(Qt.A,null,e.createElement(me.m,{to:X.Ay.SYSTEM.INDEX_SETS.CONFIGURATION(u.id)},e.createElement(a.Button,null,"Edit")),e.createElement(a.DropdownButton,{title:"More Actions",id:`index-set-dropdown-${u.id}`,pullRight:!0},e.createElement(a.MenuItem,{onSelect:be(u),disabled:!u.can_be_default||u.default},"Set as default"),e.createElement(a.MenuItem,{divider:!0}),e.createElement(a.MenuItem,{onSelect:Ce(u),variant:"danger"},"Delete"))),Te=e.createElement(a.Col,{md:12},e.createElement(Je,{indexSet:u}),e.createElement(je,{ref:Ee=>{ee.current={...ee.current,[`index-set-deletion-form-${u.id}`]:Ee}},indexSet:u,onDelete:De})),U=e.createElement(me.N,{to:X.Ay.SYSTEM.INDEX_SETS.SHOW(u.id)},u.title),z=u.default?e.createElement(a.Label,{key:`index-set-${u.id}-default-label`,bsStyle:"primary"},"default"):"",K=u.writable?"":e.createElement(a.Label,{key:`index-set-${u.id}-readOnly-label`,bsStyle:"info"},"read only");let{description:B}=u;u.default&&(B+=`${B.endsWith(".")?"":"."} Graylog will use this index set by default.`);let te;const ce=h[u.id];return ce&&(te=qe(ce)),e.createElement(l.z5,{key:`index-set-${u.id}`,title:U,titleSuffix:e.createElement("span",null,I?te:e.createElement(Xe,null,ge)," ",z," ",K),description:B,actions:N,contentRow:Te})},fe=!p;return e.createElement(e.Fragment,null,e.createElement(a.Row,null,e.createElement(a.Col,{md:12},e.createElement(l.B9,{onSearch:Ie,queryWidth:300,wrapperClass:"has-bm",onReset:ve,query:T,placeholder:"Find index sets"}))),e.createElement(tn,null,e.createElement(nn,{md:3},e.createElement(an,null,e.createElement("strong",null,"Stats for all indices:")," ",I?qe(y):e.createElement(Xe,null,ge)),e.createElement(a.Button,{onClick:se},I?"Disable stats":"Enable stats"))),e.createElement(a.Row,null,e.createElement(a.Col,{md:12},fe?e.createElement(l.y$,null):e.createElement(l.OW,{pageSize:10,totalItems:o,showPageSizeSelect:!1},e.createElement(l.b2,{bsNoItemsStyle:"info",noItemsText:"There are no index sets to display",items:p.map(u=>pe(u))})))))};var sn=r("9pdI12pI"),ke=r.n(sn),ln=Object.defineProperty,on=(t,n,i)=>n in t?ln(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,dn=(t,n,i)=>(on(t,typeof n!="symbol"?n+"":n,i),i);class et extends e.Component{render(){const{index:n}=this.props;return n.size?e.createElement("span",null,"(",c.A.formatBytes(n.size.bytes)," ","/ ",ke()(n.size.events).format("0,0")," messages)"," "):e.createElement("span",null)}}dn(et,"propTypes",{index:s().object.isRequired});const cn=et;var un=Object.defineProperty,mn=(t,n,i)=>n in t?un(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,re=(t,n,i)=>(mn(t,typeof n!="symbol"?n+"":n,i),i);class tt extends e.Component{constructor(){super(...arguments),re(this,"state",{showDetails:this.props.isDeflector}),re(this,"_formatLabels",n=>{const i=[];return n.is_deflector&&i.push(e.createElement(a.Label,{key:`${this.props.name}-deflector-label`,bsStyle:"primary"},"active write index")),n.is_closed&&i.push(e.createElement(a.Label,{key:`${this.props.name}-closed-label`,bsStyle:"warning"},"closed")),n.is_reopened&&i.push(e.createElement(a.Label,{key:`${this.props.name}-reopened-label`,bsStyle:"success"},"reopened")),e.createElement("span",{className:"index-label"},i)}),re(this,"_formatIndexRange",()=>{if(this.props.isDeflector)return e.createElement("span",null,"Contains messages up to ",e.createElement(l.sR,{dateTime:new Date}));const n=this.props.index.size;if(n){const i=n.events,{deleted:o}=n;if(i===0||i-o===0)return"Index does not contain any messages."}return this.props.indexRange?this.props.indexRange.begin===0?e.createElement("span",null,"Contains messages up to ",e.createElement(l.sR,{dateTime:this.props.indexRange.end})):e.createElement("span",null,"Contains messages from ",e.createElement(l.sR,{dateTime:this.props.indexRange.begin})," up to"," ",e.createElement(l.sR,{dateTime:this.props.indexRange.end})):"Time range of index is unknown, because index range is not available. Please recalculate index ranges manually."}),re(this,"_formatShowDetailsLink",()=>this.state.showDetails?e.createElement("span",{className:"index-more-actions"},e.createElement(l.In,{name:"arrow_drop_down"})," Hide Details / Actions"):e.createElement("span",{className:"index-more-actions"},e.createElement(l.In,{name:"arrow_right"})," Show Details / Actions")),re(this,"_toggleShowDetails",n=>{n.preventDefault(),this.setState({showDetails:!this.state.showDetails})})}render(){const{index:n}=this.props;return e.createElement("span",null,e.createElement("h2",null,this.props.name," ",e.createElement("small",null,this._formatLabels(n)," ",this._formatIndexRange(n)," ",e.createElement(cn,{index:n}),e.createElement("a",{onClick:this._toggleShowDetails,href:"#"},this._formatShowDetailsLink()))),e.createElement("div",{className:"index-info-holder"},this.state.showDetails&&this.props.children))}}re(tt,"propTypes",{children:s().node.isRequired,index:s().object.isRequired,indexRange:s().object,isDeflector:s().bool.isRequired,name:s().string.isRequired});const Se=tt,de=(0,ue.rN)("core.Deflector",()=>O().createActions({cycle:{asyncResult:!0},list:{asyncResult:!0}})),Wn=(0,ue.Bv)("core.Deflector",()=>O().createStore({listenables:[de],deflector:{info:void 0},getInitialState(){return{deflector:this.deflector}},cycle(t){const n=j.H3(ne.A.DeflectorApiController.cycle(t).url),i=(0,ie.Ay)("POST",n);de.cycle.promise(i)},list(t){const n=j.H3(ne.A.DeflectorApiController.list(t).url),i=(0,ie.Ay)("GET",n).then(o=>{this.deflector.info=o,this.trigger({deflector:this.deflector})});de.list.promise(i)}})),gn=t=>{window.confirm("This will recalculate index ranges for this index set using a background system job. Do you want to proceed?")&&Q.recalculate(t)},pn=t=>{window.confirm("This will manually cycle the current active write index on this index set. Do you want to proceed?")&&de.cycle(t).then(()=>{de.list(t)})},nt=({indexSet:t,indexSetId:n})=>{const i=(0,e.useCallback)(()=>pn(n),[n]),o=(0,e.useCallback)(()=>gn(n),[n]),p=(0,e.useMemo)(()=>t!=null&&t.writable?e.createElement(a.MenuItem,{eventKey:"2",onClick:i},"Rotate active write index"):null,[t==null?void 0:t.writable,i]);return e.createElement(a.ButtonGroup,null,e.createElement(a.DropdownButton,{bsStyle:"info",title:"Maintenance",id:"indices-maintenance-actions",pullRight:!0},e.createElement(a.MenuItem,{eventKey:"1",onClick:o},"Recalculate index ranges"),p))};nt.propTypes={indexSetId:s().string.isRequired,indexSet:s().object.isRequired};const fn=nt,En=({index:t,indexDetails:n,indexSetId:i})=>{const o=t&&t.range?t.range:null,p=n.find(({index_name:h})=>h===t.index_name);return e.createElement(a.Row,{className:"content index-description"},e.createElement(a.Col,{md:12},e.createElement(Se,{index:t,name:t.index_name,count:t.size,indexRange:o,isDeflector:t.is_deflector},e.createElement("span",null,e.createElement(Oe,{index:p,indexName:t.index_name,indexRange:o,indexSetId:i,isDeflector:t.is_deflector})))))},hn=({index:t})=>{const n=t.range;return e.createElement(a.Row,{className:"content index-description"},e.createElement(a.Col,{md:12},e.createElement(Se,{index:t,name:t.index_name,indexRange:n,isDeflector:t.is_deflector},e.createElement("span",null,e.createElement(m,{indexName:t.index_name,indexRange:n})))))},it=({indexDetails:t,indices:n,indexSetId:i})=>e.createElement("span",null,n.map(o=>o.is_closed?e.createElement(hn,{index:o,key:`index-summary-${o.index_name}`}):e.createElement(En,{index:o,indexDetails:t,indexSetId:i,key:`index-summary-${o.index_name}`})));it.propTypes={indexDetails:s().array.isRequired,indices:s().array.isRequired,indexSetId:s().string.isRequired};const yn=it;var at=r("pCQ1IoSG");const rt=({indexSet:t})=>{if(!t.writable)return e.createElement(a.Row,null,e.createElement(a.Col,{md:12},"Index set is not writable and will not be included in index rotation and retention. It is also not possible to assign it to a stream."));const n=t.data_tiering;if(!n){const o={strategy:t.rotation_strategy_class,config:t.rotation_strategy},p={strategy:t.retention_strategy_class,config:t.retention_strategy};return e.createElement(a.Row,null,e.createElement(a.Col,{md:6},e.createElement(at.A,{config:o,pluginExports:q.d.exports("indexRotationConfig")})),e.createElement(a.Col,{md:6},e.createElement(at.A,{config:p,rotationStrategyClass:o.strategy,pluginExports:q.d.exports("indexRetentionConfig")})))}const i=q.d.exports("dataTiering").find(o=>o.type===oe.HOT_WARM);return e.createElement(a.Row,null,e.createElement(a.Col,{md:6},e.createElement(Rt,{config:n})),i&&e.createElement(a.Col,{md:6},e.createElement(i.TiersSummary,{config:n})))};var xn=r("SfPIQIJE");const _n=[{title:"Indices & Index Sets",path:X.Ay.SYSTEM.INDICES.LIST,exactPathMatch:!0},{title:"Field Type Profiles",path:X.Ay.SYSTEM.INDICES.FIELD_TYPE_PROFILES.OVERVIEW,exactPathMatch:!1}],Sn=()=>e.createElement(a.Row,null,e.createElement(xn.A,{items:_n}));var Rn=Object.defineProperty,In=(t,n,i)=>n in t?Rn(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,st=(t,n,i)=>(In(t,typeof n!="symbol"?n+"":n,i),i);class lt extends e.Component{constructor(){super(...arguments),st(this,"_formatMeter",n=>{const i=e.createElement("span",null,ke()(n.total).format("0,0")," ops");return n.total>0?e.createElement("span",null,i," ",e.createElement("span",{title:`${n.time_seconds}s`},"(took ",ae().duration(n.time_seconds,"seconds").humanize(),")")):i})}render(){const n=this.props.shardMeter;return e.createElement("span",null,e.createElement("h3",{style:{display:"inline"}},this.props.title),e.createElement("dl",null,e.createElement("dt",null,"Index:"),e.createElement("dd",null,this._formatMeter(n.index)),e.createElement("dt",null,"Flush:"),e.createElement("dd",null,this._formatMeter(n.flush)),e.createElement("dt",null,"Merge:"),e.createElement("dd",null,this._formatMeter(n.merge)),e.createElement("dt",null,"Query:"),e.createElement("dd",null,this._formatMeter(n.search_query)),e.createElement("dt",null,"Fetch:"),e.createElement("dd",null,this._formatMeter(n.search_fetch)),e.createElement("dt",null,"Get:"),e.createElement("dd",null,this._formatMeter(n.get)),e.createElement("dt",null,"Refresh:"),e.createElement("dd",null,this._formatMeter(n.refresh))))}}st(lt,"propTypes",{title:s().string.isRequired,shardMeter:s().object.isRequired});const Re=lt;var vn=r("vAwPiEFV"),bn=r.n(vn);const Cn=({route:t})=>{const n=e.createElement(e.Fragment,null,"State: ",e.createElement("i",null,t.state)," on ",t.node_hostname," (",t.node_name,")");return e.createElement("li",{className:bn()("shard",`shard-${t.state}`,{"shard-primary":t.primary})},e.createElement(l.N,{placement:"top",overlay:n},e.createElement("span",{className:"id"},"S",t.id)))},Dn=g.default.div(({theme:t})=>(0,g.css)`
.shards {
.shard {
padding: 10px;
margin: 5px;
width: 50px;
float: left;
text-align: center;
}
.shard-started {
background-color: ${t.utils.colorLevel(t.colors.variant.light.success,-2)};
}
.shard-relocating {
background-color: ${t.utils.colorLevel(t.colors.variant.light.primary,-2)};
}
.shard-initializing {
background-color: ${t.utils.colorLevel(t.colors.variant.light.warning,-5)};
}
.shard-unassigned {
background-color: ${t.utils.colorLevel(t.colors.variant.light.default,-2)};
}
.shard-primary .id {
font-weight: bold;
margin-bottom: 3px;
border-bottom: 1px solid ${t.colors.gray[10]};
}
}
.description {
font-size: ${t.fonts.size.small};
margin-top: 2px;
margin-left: 6px;
}
`),ot=({indexName:t,routing:n})=>e.createElement(Dn,null,e.createElement("h3",null,"Shard routing"),e.createElement("ul",{className:"shards"},n.sort((i,o)=>(0,Ge.j)(i.id,o.id)).map(i=>e.createElement(Cn,{key:`${t}-shard-route-${i.node_id}-${i.id}`,route:i}))),e.createElement("br",{style:{clear:"both"}}),e.createElement("div",{className:"description"},"Bold shards are primaries, others are replicas. Replicas are elected to primaries automatically when primaries leave the cluster. Size and document counts only reflect primary shards and no possible replica duplication."));ot.propTypes={routing:s().array.isRequired,indexName:s().string.isRequired};const dt=ot},"+K2jZtwG":(Z,A,r)=>{r.d(A,{A:()=>a});var v=r("q2j1bVbz"),s=r("yGRmSjYM");const a=()=>{const w=(0,v.A)();return(0,s.Nn)(w.permissions,"typemappings:edit")}},PhRf2fIG:(Z,A,r)=>{r.d(A,{pG:()=>_,qg:()=>W,zE:()=>G});var v=r("JnTtTRmZ"),s=r.n(v),e=r("ii0bleBb"),a=r.n(e),w=r("8u9vblRK"),M=r.n(w),b=r("U1Iufsob"),S=r("eFxcQyPT"),x=r("MdYBRjRJ"),f=r("jAGDuYSC"),d=r("IA3Ku5lS"),D=r("6bzBY7Xo");const W=a().shape({can_be_default:a().bool,id:a().string,title:a().string,description:a().string.isRequired,index_prefix:a().string.isRequired,shards:a().number.isRequired,replicas:a().number.isRequired,rotation_strategy_class:a().string.isRequired,rotation_strategy:D.lc.isRequired,retention_strategy_class:a().string.isRequired,retention_strategy:D.pr.isRequired,creation_date:a().string,index_analyzer:a().string.isRequired,index_optimization_max_num_segments:a().number.isRequired,index_optimization_disabled:a().bool.isRequired,field_type_refresh_interval:a().number.isRequired,index_template_type:a().string,writable:a().bool.isRequired,default:a().bool.isRequired}),_=(0,d.rN)("core.IndexSets",()=>s().createActions({list:{asyncResult:!0},listPaginated:{asyncResult:!0},get:{asyncResult:!0},update:{asyncResult:!0},create:{asyncResult:!0},delete:{asyncResult:!0},searchPaginated:{asyncResult:!0},setDefault:{asyncResult:!0},stats:{asyncResult:!0}})),G=(0,d.Bv)("core.IndexSets",()=>s().createStore({listenables:[_],indexSetsCount:void 0,indexSets:void 0,indexSetStats:void 0,indexSet:void 0,globalIndexSetStats:void 0,getInitialState(){return this.getState()},getState(){return{indexSetsCount:this.indexSetsCount,indexSets:this.indexSets,indexSetStats:this.indexSetStats,indexSet:this.indexSet,globalIndexSetStats:this.globalIndexSetStats}},propagateChanges(){this.trigger(this.getState())},list(m){const E=(0,x.H3)(b.A.IndexSetsApiController.list(m).url),c=(0,S.Ay)("GET",E);c.then(l=>(this.indexSetsCount=l.total,this.indexSets=l.index_sets,this.indexSetStats=l.stats,this.propagateChanges(),l),l=>{f.A.error(`Fetching index sets list failed: ${l.message}`,"Could not retrieve index sets.")}),_.list.promise(c)},listPaginated(m,E,c){const l=(0,x.H3)(b.A.IndexSetsApiController.listPaginated(m,E,c).url),Y=(0,S.Ay)("GET",l);Y.then(O=>(this.indexSetsCount=O.total,this.indexSets=O.index_sets,this.indexSetStats=O.stats,this.propagateChanges(),O),O=>{f.A.error(`Fetching index sets list failed: ${this._errorMessage(O)}`,"Could not retrieve index sets.")}),_.listPaginated.promise(Y)},searchPaginated(m,E,c,l){const Y=(0,x.H3)(b.A.IndexSetsApiController.searchPaginated(m,E,c,l).url),O=(0,S.Ay)("GET",Y);O.then(F=>(this.indexSetsCount=F.total,this.indexSets=F.index_sets,this.indexSetStats=F.stats,this.propagateChanges(),F),F=>{f.A.error(`Fetching index sets list failed: ${this._errorMessage(F)}`,"Could not retrieve index sets.")}),_.searchPaginated.promise(O)},get(m){const E=(0,x.H3)(b.A.IndexSetsApiController.get(m).url),c=(0,S.Ay)("GET",E);c.then(l=>(this.indexSet=l,this.propagateChanges(),l),l=>{f.A.error(`Fetching index set '${m}' failed with status: ${this._errorMessage(l)}`,"Could not retrieve index set.")}),_.get.promise(c)},update(m){const E=(0,x.H3)(b.A.IndexSetsApiController.get(m.id).url),c=(0,S.Ay)("PUT",E,m);c.then(l=>(f.A.success(`Successfully updated index set '${m.title}'`,"Success"),this.indexSet=l,this.propagateChanges(),l),l=>{f.A.error(`Updating index set '${m.title}' failed with status: ${this._errorMessage(l)}`,"Could not update index set.")}),_.update.promise(c)},create(m){const E=(0,x.H3)(b.A.IndexSetsApiController.create().url),c=(0,S.Ay)("POST",E,m);c.then(l=>(f.A.success(`Successfully created index set '${m.title}'`,"Success"),this.indexSet=l,this.propagateChanges(),l),l=>{f.A.error(`Creating index set '${m.title}' failed with status: ${this._errorMessage(l)}`,"Could not create index set.")}),_.create.promise(c)},delete(m,E){const c=(0,x.H3)(b.A.IndexSetsApiController.delete(m.id,E).url),l=(0,S.Ay)("DELETE",c);l.then(()=>{f.A.success(`Successfully deleted index set '${m.title}'`,"Success")},Y=>{f.A.error(`Deleting index set '${m.title}' failed with status: ${this._errorMessage(Y)}`,"Could not delete index set.")}),_.delete.promise(l)},setDefault(m){const E=(0,x.H3)(b.A.IndexSetsApiController.setDefault(m.id).url),c=(0,S.Ay)("PUT",E);c.then(()=>{f.A.success(`Successfully set index set '${m.title}' as default`,"Success")},l=>{f.A.error(`Setting index set '${m.title}' as default failed with status: ${this._errorMessage(l)}`,"Could not set default index set.")}),_.setDefault.promise(c)},stats(){const m=(0,x.H3)(b.A.IndexSetsApiController.stats().url),E=(0,S.Ay)("GET",m);E.then(c=>(this.globalIndexSetStats={indices:c.indices,documents:c.documents,size:c.size},this.propagateChanges(),c),c=>{f.A.error(`Fetching global index stats failed: ${c.message}`,"Could not retrieve global index stats.")}),_.stats.promise(E)},_errorMessage(m){try{return M()(m.additional.body)?m.additional.body.map(({message:E,path:c})=>`${c!=null?c:""} ${E}.`).join(" "):m.additional.body.message}catch{return m.message}}}))}}]);})();
//# sourceMappingURL=bb8c8232-9201.254dbea333abf953c23e.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy