PageSourceSearch

https://app.middleware.io/static/vUBzHF0c.production.bundle.min.js

js middleware.io collected 2026-10-02 03:36:35 UTC 73,490 bytes, 1 lines download raw bytes

1import{r as Y,$ as Rs,D as Ks,v as L,j as t,a0 as z,U as K}from"./CZzrexQa.production.bundle.min.js";import{s as oa}from"./9eHdvLN4.production.bundle.min.js";import{g as na,b as Q,c as ra,d as la,e as ca,f as da,h as ha,i as pa,j as ga,k as ua,l as fa,m as ma,n as ba,o as Ca,p as ja,q as xa,s as _a,t as Da,u as ya,v as ka,w as Pa,x as va,y as W,z as zs,A as Vs,B as Ys}from"./gFHMGxt6.production.bundle.min.js";import{D as Sa}from"./7LcJfZNO.production.bundle.min.js";import{D as H}from"./D8sKcCdJ.production.bundle.min.js";import{B as M}from"./YCM_kEyP.production.bundle.min.js";import{a7 as $,a8 as F,l as Js}from"./b2Mkg01q.production.bundle.min.js";import{e as Z}from"./CUZmxn9S.production.bundle.min.js";import{F as B}from"./DFn2u8qh.production.bundle.min.js";import{F as v}from"./B0uEge7d.production.bundle.min.js";import{aI as Gs,aE as J,aU as Ta}from"./DeceMiF-.production.bundle.min.js";import{S as $s}from"./D0x1Z4HE.production.bundle.min.js";import{c as q,i as Qs,a as Fa,j as Ia}from"./C_cH1u9D.production.bundle.min.js";import{T as U}from"./oN3AJijl.production.bundle.min.js";import{C as wa}from"./DuuYbKmt.production.bundle.min.js";import{R as Ws}from"./-0uhm-DD.production.bundle.min.js";import{r as Na}from"./vhNSgALD.production.bundle.min.js";import{i as R}from"./D2TiwZt4.production.bundle.min.js";import{G as La}from"./C_Ln3svq.production.bundle.min.js";import{B as X,a as tt}from"./D-90pMQ7.production.bundle.min.js";import{e as et,A as Zs,f as D,J as Xs,T as ta,h as ea,i as V}from"./CHClG9UV.production.bundle.min.js";import{p as Aa,a as Ma}from"./DzP7rVs8.production.bundle.min.js";import{B as Ea}from"./D5DvdsUG.production.bundle.min.js";/* empty css                              */import{c as qa}from"./BtHfF601.production.bundle.min.js";import{O as Oa}from"./3wIbuO__.production.bundle.min.js";import"./CiD4UJCU.production.bundle.min.js";import"./DvLd3evF.production.bundle.min.js";import"./ClxpELDE.production.bundle.min.js";import"./DWUNlcjA.production.bundle.min.js";import"./DGYQp8fe.production.bundle.min.js";import"./BmBjCq8D.production.bundle.min.js";import"./Dsqj8S3w.production.bundle.min.js";import"./CXT9N8xZ.production.bundle.min.js";import"./kkIr59yR.production.bundle.min.js";import"./tkddr5kZ.production.bundle.min.js";import"./Bm1LOIPR.production.bundle.min.js";import"./D4lvmK5r.production.bundle.min.js";import"./DwmhJbxl.production.bundle.min.js";import"./DGAisTA8.production.bundle.min.js";import"./DQegFpUo.production.bundle.min.js";import"./Ci_hGDFV.production.bundle.min.js";import"./E6csxmgU.production.bundle.min.js";import"./Y4Ob0Is8.production.bundle.min.js";import"./CNsPFEJO.production.bundle.min.js";import"./DtpVAsok.production.bundle.min.js";import"./2mZBARql.production.bundle.min.js";import"./CJIgguc4.production.bundle.min.js";import"./zzLyrqbE.production.bundle.min.js";import"./CpVN2k6O.production.bundle.min.js";import"./B7Fri_dM.production.bundle.min.js";import"./CLBsRoPD.production.bundle.min.js";import"./Ch78CD0x.production.bundle.min.js";import"./D1TNtnEv.production.bundle.min.js";import"./DnQqxH0F.production.bundle.min.js";import"./B2ufxn2G.production.bundle.min.js";function sa(u){if(Array.isArray(u))return u.map(String);if(u&&typeof u=="object"){const d=u;if(Array.isArray(d.value))return d.value.map(String);if(Array.isArray(d.enabled_features))return d.enabled_features.map(String)}return[]}function st(u){const d={thumb:"",reason:"",pageUrl:"",activityContent:""};if(u==null)return d;if(typeof u=="string")try{return st(JSON.parse(u))}catch{return d}if(typeof u=="object"&&u!==null){const g=u;return"RawMessage"in g&&g.RawMessage!=null&&typeof g.RawMessage=="object"?st(g.RawMessage):{thumb:typeof g.thumb=="string"?g.thumb:"",reason:typeof g.reason=="string"?g.reason:"",pageUrl:typeof g.page_url=="string"?g.page_url:"",activityContent:typeof g.activity_content=="string"?g.activity_content:""}}return d}function Ha(u){if(u==null||u==="")return"";if(typeof u=="string")return u;if(typeof u=="object"){const d=u;if(typeof d.String=="string")return d.String}return String(u)}function Ba(u,d){const g=d==null?void 0:d.thumb;return g==="up"?"Up":g==="down"?"Down":g||"—"}function Ua(u,d){return((d==null?void 0:d.reason)??"").trim()||"—"}function Ra(u,d){const g=((d==null?void 0:d.pageUrl)??"").trim();if(!g)return"—";const S=g.length>96?`${g.slice(0,96)}…`:g;return t.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:S})}const Ka=Y.memo(function(d){const[g,S]=Y.useState(!1),j=d.activityContent.trim();return j?t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"bkoff-ai-feedback-content-trigger",onClick:()=>S(!0),shouldStopPropagation:!0,children:t.jsx(Oa,{color:"var(--color-text)"})}),t.jsx(La,{isOpen:g,onClose:()=>S(!1),title:"Activity content",size:"xl",dialogContentClassName:"bkoff-ai-feedback-content-dialog",children:t.jsx("div",{className:"bkoff-ai-chat-feedback-activity-md bkoff-ai-chat-feedback-activity-md--dialog",children:t.jsx(Ta,{content:j})})})]}):t.jsx(t.Fragment,{children:"—"})});function za(u,d){const g=(d==null?void 0:d.activityContent)??"";return t.jsx(Ka,{activityContent:g})}const aa=[{title:"Updated",columnKey:"updatedAt"},{title:"Chat ID",columnKey:"chatId"},{title:"Activity ID",columnKey:"activityId"},{title:"Rating",columnKey:"thumb",render:Ba},{title:"Reason",columnKey:"reason",render:Ua},{title:"Page URL",columnKey:"pageUrl",render:Ra},{title:"Content",columnKey:"activityContent",render:za}],Va=aa,at=new Date;at.setDate(at.getDate()-30);const it=new Date;it.setDate(it.getDate()-1);class Ya extends Y.Component{constructor(d){var g,S,j,y,T,E;
1super(d),this.currentPage=1,this.platforms={linux:"Linux / Windows / Docker",k8s:"Kubernetes"},this.dbConfigs={PostgreSQL:"postgres_config"},this.getBtnText=o=>{const a=Rs.filter(n=>n.timeRangeOption===o.range)[0];return a.timeRangeOption===Ks.Custom?`${L.unix(o.fromTs/1e3).format("MMM DD HH:mm")} - ${L.unix(o.toTs/1e3).format("MMM DD HH:mm")}`:a.label},this.getProjectTableData=()=>Array.isArray(this.state.projectList)?this.state.projectList.map((o,a)=>{var f,p,b,k;const n=this.state.ttlValues[a]!==void 0?this.state.ttlValues[a]:o.ttl,l=((p=(f=o.meta_data)==null?void 0:f.RawMessage)==null?void 0:p.isolated_schema_start_ts)>0?(k=(b=o.meta_data)==null?void 0:b.RawMessage)==null?void 0:k.isolated_schema_start_ts:173442906e4,h=L(l).format("YYYY-MM-DD HH:mm:ss");return{...o,rowIndex:a,ttlValue:n,formattedTime:h}}):[],this.getProjectTableColumns=()=>R()?this.state.projectTableColumns.filter(o=>o.columnKey!=="ttlValue"&&o.columnKey!=="actions"):this.state.projectTableColumns,this.loadAccountEnabledFeatures=()=>{var a;const o=(a=this.props.userDetails)==null?void 0:a.account_id;if(!o){this.setState({accountEnabledFeatureNames:[]});return}this.props.requestBackoffGetAccountSetting({account_id:o,key:Zs},n=>{this.setState({accountEnabledFeatureNames:sa(n)})})},this.loadAiChatFeedback=o=>{var f;const a=(f=this.props.userDetails)==null?void 0:f.account_id,n=this.state.aiChatFeedbackProjectId,l=100,h=Math.max(1,o??this.state.aiChatFeedbackPage??1);if(!a||n==null||n<=0){this.setState({aiChatFeedbackRows:[],aiChatFeedbackTotal:0,aiChatFeedbackLoading:!1,aiChatFeedbackPage:1});return}this.setState({aiChatFeedbackLoading:!0,aiChatFeedbackPage:h}),this.props.requestBackoffAiChatFeedback({account_id:a,project_id:n,limit:l,offset:(h-1)*l},p=>{if(!p){this.setState({aiChatFeedbackRows:[],aiChatFeedbackTotal:0,aiChatFeedbackLoading:!1,aiChatFeedbackPage:1});return}const b=p.total,k=Math.max(1,Math.ceil(b/l)),I=b===0?1:Math.min(h,k);if(I!==h){this.loadAiChatFeedback(I);return}const w=p.items.flatMap(A=>{if(!A||typeof A!="object")return[];const x=A,O=st(x.rating);return[{rowKey:String(x.id??""),updatedAt:x.updated_at?L(String(x.updated_at)).format("YYYY-MM-DD HH:mm:ss"):"",chatId:String(x.fingerprint??""),activityId:Ha(x.activity_id),thumb:O.thumb,reason:O.reason,pageUrl:O.pageUrl,activityContent:O.activityContent,projectId:Number(x.project_id??0)}]});this.setState({aiChatFeedbackRows:w,aiChatFeedbackTotal:b,aiChatFeedbackLoading:!1,aiChatFeedbackPage:I})})},this.generateData=o=>{const a=[],l=this.state.usageProviderData;for(let h=l.length-1;h>=0;h--){const p=L(l[h].date).format("YYYY-MM-DD HH:mm:ss"),b=o==="infra"?l[h].infra:o==="apm"?l[h].apm:o==="database"?l[h].database:l[h].logs;a.push({xAxis:p,yAxis:b,barColor:"#2575ee"})}return a},this.parseString=o=>{try{return JSON.parse(o)}catch{return{}}},this.getProjects=()=>{W(this.props.userDetails.account_id,(o,a)=>{if(!o||!a){this.props.showToast("error","Failed to fetch projects");return}this.setState({ingestionControl:{...this.state.ingestionControl,availableProjects:a}})})},this.getDatabaseProjects=()=>{W(this.props.userDetails.account_id,(o,a)=>{var n;if(!o||!a){this.props.showToast("error","Failed to fetch projects for database");return}this.setState({database:{...(n=this.state)==null?void 0:n.database,availableProjects:a}})})},this.getProjectList=()=>{W(this.props.userDetails.account_id,(o,a)=>{if(!o||!a){this.props.showToast("error","Failed to fetch projects");return}const n=a.reduce((l,h,f)=>(l[f]=h.ttl,l),{});this.setState({projectList:a,ttlValues:n}),this.setState({ingestionControl:{...this.state.ingestionControl,availableProjects:a}})})},this.getProjectHosts=()=>{zs(this.state.ingestionControl.selectedProject,this.state.ingestionControl.platform,(o,a)=>{if(!o||!a){this.props.showToast("error","Failed to fetch hosts");return}this.setState({ingestionControl:{...this.state.ingestionControl,availableHosts:a}})})},this.getDatabaseProjectHosts=()=>{var o,a,n,l;zs((a=(o=this.state)==null?void 0:o.database)==null?void 0:a.selectedProject,(l=(n=this.state)==null?void 0:n.database)==null?void 0:l.platform,(h,f)=>{var p;if(!h||!f){this.props.showToast("error","Failed to fetch hosts for database");return}this.setState({database:{...(p=this.state)==null?void 0:p.database,availableHosts:f}})})},this.getHostSettings=()=>{var o;Vs(this.state.ingestionControl.selectedHost,this.props.userDetails.account_id,((o=this.state.ingestionControl.availableProjects.find(a=>a.uid===this.state.ingestionControl.selectedProject))==null?void 0:o.id)??0,(a,n)=>{var b;if(!a||!n){this.props.showToast("error","Failed to fetch host settings");return}const{platform:l}=this.state.ingestionControl,h=((b=n.config[l])==null?void 0:b.exporters)||[],f=h.length>0?h:[{endpoint:"","api-key":""}],p={...n.config,[l]:{...n.config[l],exporters:f}};this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:p}})})},this.getDatabaseHostSettings=()=>{var o,a,n,l,h;Vs((a=(o=this.state)==null?void 0:o.database)==null?void 0:a.selectedHost,this.props.userDetails.account_id,((h=(l=(n=this.state)==null?void 0:n.database)==null?void 0:l.availableProjects.find(f=>{var p,b;return f.uid===((b=(p=this.state)==null?void 0:p.database)==null?void 0:b.selectedProject)}))==null?void 0:h.id)??0,(f,p)=>{var A,x,O;if(!f||!p){this.props.showToast("error","Failed to fetch host settings for database");return}const{platform:b}=(A=this.state)==null?void 0:A.database,k=((x=p.config[b])==null?void 0:x.exporters)||[],I=k.length>0?k:[{endpoint:"","api-key":""}],w={...p.config,[b]:{...p.config[b],exporters:I}};this.setState({database:{...(O=this.state)==null?void 0:O.database,hostConfig:w}})})},this.updateHostConfig=()=>{var k,I;const{ingestionControl:o}=this.state,{platform:a,selectedHost:n,availableProjects:l,selectedProject:h,hostConfig:f}=o,p=JSON.parse(JSON.stringify(f));(a==="linux"||a==="k8s")&&(p[a]||(p[a]={}),p[a].exporters=(k=f[a])==null?void 0:k.exporters);const b=((I=l.find(w=>w.uid===h))==null?void 0:I.id)??0;Ys(n,this.props.userDetails.account_id,b,p,w=>{w?this.props.showToast("success","Host settings updated successfully"):this.props.showToast("error","Failed to update host settings")})},this.updateDatabaseHostConfig=()=>{var k,I;const{database:o}=this.state,{platform:a,selectedHost:n,availableProjects:l,selectedProject:h,hostConfig:f}=o,p=JSON.parse(JSON.stringify(f));(a==="linux"||a==="k8s")&&(p[a]||(p[a]={}),p[a].exporters=(k=f[a])==null?void 0:k.exporters);const b=((I=l.find(w=>w.uid===h))==null?void 0:I.id)??0;Ys(n,this.props.userDetails.account_id,b,p,w=>{w?this.props.showToast("success","Host settings updated successfully for database"):this.props.showToast("error","Failed to update host settings for database")})},this.handleTTLChange=(o,a)=>{this.setState(n=>({ttlValues:{...n.ttlValues,[o]:a}}))},this.handleUpdateTTL=o=>{this.setState({isDialogOpen:!0,currentProjectIndex:o})},this.updateBillingMetadata=(o,a,n)=>{this.props.requestUpdateBillingMetadata(o,l=>{(l==null?void 0:l.status)===200?(this.props.showToast("success",a),n==null||n()):this.props.showToast("error",l==null?void 0:l.data.error)})},this.updateBillingDataLimits=(o,a,n)=>{this.props.requestUpdateBillingDataLimits(o,l=>{(l==null?void 0:l.status)===200?(this.props.showToast("success",a),n==null||n()):this.props.showToast("error",l==null?void 0:l.data.error)})},this.handleConfirmTTLChange=()=>{const{currentProjectIndex:o,ttlValues:a}=this.state;if(o!=null){const n=a[o];n!==void 0&&(this.setState(l=>({ttlValues:{...l.ttlValues,[o]:n},isDialogOpen:!1})),this.props.requestUpdateProjectTTL({account_id:this.state.projectList[o].account_id,project_id:this.state.projectList[o].id,ttl:n},l=>{(l==null?void 0:l.status)===200?this.props.showToast("success","TTL updated successfully"):this.props.showToast("error",l==null?void 0:l.data.error)}))}},this.handleCancelTTLChange=()=>{this.setState({isDialogOpen:!1,currentProjectIndex:null})},this.handleDbDelete=()=>{this.setState({projectDbDeleteInfo:{...this.state.projectDbDeleteInfo,isLoading:!0}}),this.props.requestUpdateProjectDbDeleted({account_id:this.state.projectDbDeleteInfo.accountId,project_id:this.state.projectDbDeleteInfo.projectId,db_deleted:this.state.projectDbDeleteInfo.db_deleted},o=>{(o==null?void 0:o.status)===200?(this.props.showToast("success",`${this.state.projectDbDeleteInfo.db_deleted?"Clickhouse database deleted successfully.":"Project activated successfully."}`),this.handleCancelDbDelete(),this.getProjectList()):this.props.showToast("error",o==null?void 0:o.data.error)})},this.handleCancelDbDelete=()=>{this.setState({projectDbDeleteInfo:{deleteConfirm:!1,projectId:0,accountId:0,db_deleted:!1,projectName:"",isLoading:!1}})},this.handleTabChange=o=>{switch(o){case 0:(!this.props.projectDiskData||this.props.projectDiskData.length===0)&&(this.setState({loader:!0}),this.props.requestProjectDiskData({...this.props.userDetails,data_type:"disk",project_uid:this.state.selectedProjectUid},(a,n,l)=>{n||this.setState({loader:!1})}));break;case 1:(!this.props.projectDiskPartData||this.props.projectDiskPartData.length===0)&&(this.setState({loader:!0}),this.props.requestProjectDiskData({...this.props.userDetails,data_type:"disk_part",project_uid:this.state.selectedProjectUid},(a,n,l)=>{n||this.setState({loader:!1})}));break;case 2:(!this.props.projectDiskPartTableData||this.props.projectDiskPartTableData.length===0)&&(this.setState({loader:!0}),this.props.requestProjectDiskData({...this.props.userDetails,data_type:"disk_part_table",project_uid:this.state.selectedProjectUid},(a,n,l)=>{n||this.setState({loader:!1})}));break;default:this.setState({loader:!1});break}},this.checkIfPublicFeatureEnabled=(o,a)=>
1{if(a){const n=a.indexOf(o);return n>-1?this.setState({isEnabledPublicFeature:!0}):this.setState({isEnabledPublicFeature:!1}),n>-1}return this.setState({isEnabledPublicFeature:!1}),!1},this.checkIfJsonParseLogsFeatureEnabled=(o,a)=>{if(a){const n=a.indexOf(o);return n>-1?this.setState({isEnabledJsonParseLogs:!0}):this.setState({isEnabledJsonParseLogs:!1}),n>-1}return this.setState({isEnabledJsonParseLogs:!1}),!1},this.checkIfTraceDisableNodejsVerboseSpansFeatureEnabled=(o,a)=>{const n=(a==null?void 0:a.includes(o))??!1;return this.setState({isEnabledTraceDisableNodejsVerboseSpans:n}),n},this.checkIfAIDashboardEnabled=(o,a)=>{const n=(a==null?void 0:a.includes(o))??!1;return this.setState({isAiDashbpardEnabled:n}),n},this.state={...this.state,isCountHistory:5,isCountUser:5,isCountLogs:5,fromDate:at,toDate:it,usageProviderData:[],apioutput:0,tableColumnsForOld:[{title:"USAGE DATE",columnKey:"date",render:(o,a)=>t.jsx("span",{className:"user-info",children:t.jsx("span",{children:a.date.split(" ").slice(1).join(" ")})})},{title:"INFRA HOSTS ",columnKey:"infra",tooltipInfo:"Max/day"},{title:"APM HOSTS",columnKey:"apm",tooltipInfo:"Max/day"},{title:"DATABASE HOSTS",columnKey:"database",tooltipInfo:"Max/day"},{title:"Synthetic checks",columnKey:"synthetics",tooltipInfo:"number of synthetic checks",render:(o,a)=>t.jsx("span",{children:K(a.synthetics,!1,!0)})},{title:"Serverless traces",columnKey:"serverless_traces",tooltipInfo:"number of traces generated by serverless monitoring",render:(o,a)=>t.jsx("span",{children:K(a.serverless_traces,!1,!0)})},{title:"LOGS (Size)",columnKey:"logs",tooltipInfo:"Number of logs ingested",render:(o,a)=>(L(a.date).format("YYYY-MM-DD"),t.jsx("span",{className:"logs",children:t.jsx("span",{children:z(a.log_size)})}))},{title:"RUM",columnKey:"rum",tooltipInfo:"Number of sessions",render:(o,a)=>t.jsx("span",{children:K(a.rum,!1,!0)})},{title:"Metrics",columnKey:D.MetricSize,tooltipInfo:"Size of metrics (This column is just for analysis purpose as this user is in old plan)",render:(o,a)=>t.jsx("span",{children:z(a.metric_size)})},{title:"Traces",columnKey:D.TraceSize,tooltipInfo:"Size of traces (This column is just for analysis purpose as this user is in old plan)",render:(o,a)=>t.jsx("span",{children:z(a.trace_size)})},{title:"Browser Tests",columnKey:D.browserTest,render:o=>t.jsx("span",{children:K(o,!1,!0)}),width:150},{title:"OpsAI",columnKey:D.OpsAI,render:o=>t.jsx("span",{children:K(o,!1,!0)}),width:150}],tableColumns:[{title:"USAGE DATE",columnKey:"date",render:(o,a)=>t.jsx("span",{className:"user-info",children:t.jsx("span",{children:a.date.split(" ").slice(1).join(" ")})})},{title:"Metrics",columnKey:"metric_size",tooltipInfo:"Max/day",render:(o,a)=>t.jsx("span",{children:z(a.metric_size)})},{title:"Traces",columnKey:"trace_size",tooltipInfo:"Max/day",render:(o,a)=>t.jsx("span",{children:z(a.trace_size)})},{title:"Logs",columnKey:"log_size",tooltipInfo:"Max/day",render:(o,a)=>t.jsx("span",{children:z(a.log_size)})},{title:"RUM",columnKey:"rum",tooltipInfo:"Max/day"},{title:"Synthetic Checks",columnKey:"synthetics",tooltipInfo:"Max/day"},{title:"Browser Tests",columnKey:D.browserTest,render:o=>t.jsx("span",{children:K(o,!1,!0)}),width:150},{title:"OpsAI",columnKey:D.OpsAI,render:o=>t.jsx("span",{children:K(o,!1,!0)}),width:150}],projectTableColumns:[{title:"Project Name",columnKey:"name",render:(o,a)=>{const n=a;return t.jsxs("span",{className:"project-name",children:[n.name," "]})}},{title:"Project Alias",columnKey:"alias",render:(o,a)=>{const n=a;return t.jsxs("span",{className:"project-alias",children:[n.alias," "]})}},{title:"UID / ID / DB",columnKey:"uid",render:(o,a)=>{const n=a;return t.jsxs("span",{className:"project-uid",children:[n.uid," - ",n.id," - ",n.db]})}},{title:"Isolated Date",columnKey:"formattedTime",render:o=>t.jsx("span",{children:o})},{title:"TTL",columnKey:"ttlValue",render:(o,a)=>{const n=a,l=n.ttlValue??0;return R()?t.jsx("span",{children:l}):t.jsx(v,{id:`ttl-${n.rowIndex}`,type:"number",label:"TTL",value:l.toString(),onChange:h=>this.handleTTLChange(n.rowIndex,parseInt(h,10))})}},{title:"Actions",columnKey:"actions",render:(o,a)=>{const n=a;return R()?null:t.jsxs("div",{className:"bkoff-projects-actions-row",children:[t.jsx(M,{primary:!0,onClick:()=>this.handleUpdateTTL(n.rowIndex),children:"Update TTL"}),t.jsx(M,{onClick:()=>
1{this.setState({isDetailsModalOpen:!0,selectedProjectUid:n.uid}),(!this.props.projectDiskData||this.props.projectDiskData.length===0)&&this.props.requestProjectDiskData({...this.props.userDetails,data_type:"disk",project_uid:n.uid},(l,h)=>{h||this.setState({loader:!1,selectedProjectPage:1})})},children:"Details"}),t.jsx(M,{error:!0,onClick:()=>{this.setState({projectDbDeleteInfo:{projectId:n.id,db_deleted:!n.db_deleted,deleteConfirm:!0,accountId:n.account_id,projectName:n.name,isLoading:!1}})},children:n.db_deleted?"Activate DB":"Delete DB"}),t.jsx(M,{onClick:()=>{var l,h,f,p;this.setState({isFeaturesModalOpen:!0,selectedProjectUid:n.uid}),this.checkIfPublicFeatureEnabled(n.uid,(l=this.state.publicDashboard)==null?void 0:l.project_uids),this.checkIfJsonParseLogsFeatureEnabled(n.uid,(h=this.state.jsonParseLogs)==null?void 0:h.project_uids),this.checkIfTraceDisableNodejsVerboseSpansFeatureEnabled(n.uid,(f=this.state.traceDisableNodejsVerboseSpans)==null?void 0:f.project_uids),this.checkIfAIDashboardEnabled(n.uid,(p=this.state.aiDashbpards)==null?void 0:p.project_uids)},children:"Features"}),t.jsx(M,{onClick:()=>{this.setState({aiChatFeedbackModalOpen:!0,aiChatFeedbackProjectId:n.id,aiChatFeedbackProjectName:n.name,aiChatFeedbackPage:1},()=>this.loadAiChatFeedback(1))},children:"AI Feedbacks"})]})}}],projectDetailsColumns:[{title:"Host",columnKey:"host"},{title:"Database ",columnKey:"database"},{title:"Disk Name",columnKey:"disk_name"},{title:"Partition",columnKey:"partition"},{title:"Table",columnKey:"table"},{title:"Rows",columnKey:"rows"},{title:"Compressed",columnKey:"compressed"},{title:"Uncompressed",columnKey:"uncompressed"},{title:"Part",columnKey:"part_count"}],ingestionControl:{platform:"linux",availableProjects:[],selectedProject:"",availableHosts:[],otel_telemetry_log_levels:["debug","info","warn","error","fatal"],selectedHost:"",hostConfig:{linux:{exporters:[{endpoint:"","api-key":""}]},k8s:{exporters:[{endpoint:"","api-key":""}]}}},ttlValues:{},isDialogOpen:!1,currentProjectIndex:null,billing:{opsAIFreeLimit:((j=(S=(g=this.props.userDetails)==null?void 0:g.billing_meta_data)==null?void 0:S.RawMessage)==null?void 0:j.opsai_issue_limit)||10,aiDashboardTokenLimit:((E=(T=(y=this.props.userDetails)==null?void 0:y.billing_meta_data)==null?void 0:T.RawMessage)==null?void 0:E.ai_dashboard_token_limit)||10},accountEnabledFeatureNames:[],aiChatFeedbackRows:[],aiChatFeedbackTotal:0,aiChatFeedbackLoading:!1,aiChatFeedbackPage:1,aiChatFeedbackModalOpen:!1,aiChatFeedbackProjectId:null,aiChatFeedbackProjectName:""}}componentDidMount(){this.props.requestBackoffAgent(this.props.userDetails),this.props.requestBackoffUserLogin(this.props.userDetails),this.props.requestBackoffLogs(this.props.userDetails);const d=new Date;d.setDate(d.getDate()-30);const g=Date.parse(d.toDateString()),S=new Date;S.setDate(S.getDate()-1),this.setState({fromDate:d,toDate:S,isLoading:!0}),this.setState({isLoading:!0},()=>{var j,y,T,E;this.props.requestBackofUsages({sts:g,ets:Date.now(),account_id:(y=(j=this.props)==null?void 0:j.userDetails)==null?void 0:y.account_id,uid:(E=(T=this.props)==null?void 0:T.userDetails)==null?void 0:E.uid},()=>{this.setState({isLoading:!1})})}),this.getProjectList(),this.props.requestFeatureFlagStatus({featureFlagName:et},(j,y,T)=>{!y&&j&&this.setState({publicDashboard:T})}),this.props.requestFeatureFlagStatus({featureFlagName:Xs},(j,y,T)=>{!y&&j&&this.setState({jsonParseLogs:T})}),this.props.requestFeatureFlagStatus({featureFlagName:ta},(j,y,T)=>{!y&&j&&this.setState({traceDisableNodejsVerboseSpans:T})}),this.props.requestFeatureFlagStatus({featureFlagName:ea},(j,y,T)=>{!y&&j&&this.setState({aiDashbpards:T})}),this.loadAccountEnabledFeatures(),this.loadAiChatFeedback(1),this.setState({datePickerBtnText:this.getBtnText({fromTs:d.getTime(),toTs:S.getTime(),range:Ks.OneMonth}),datePickerVisible:!1})}componentDidUpdate(d,g){var S,j;if(((S=d.userDetails)==null?void 0:S.account_id)!==((j=this.props.userDetails)==null?void 0:j.account_id)&&(this.loadAccountEnabledFeatures(),this.state.aiChatFeedbackModalOpen&&this.setState({aiChatFeedbackModalOpen:!1,aiChatFeedbackProjectId:null,aiChatFeedbackProjectName:"",aiChatFeedbackRows:[],aiChatFeedbackTotal:0,aiChatFeedbackPage:1})),(d.usages!=this.props.usages||g.infraRate!=this.state.infraRate||g.apmRate!=this.state.apmRate)&&this.props.usages!=null&&Object.keys(this.props.usages).length>0){const y=Aa(this.props.usages,[D.Infra,D.Apm,D.Database,D.Serverless,D.MetricSize,D.TraceSize,D.LogSize,D.Rum,D.synthetics,D.OpsAI,D.browserTest]),T=Ma(y),E=new Date;E.setDate(E.getDate()+1),this.setState({usageProviderData:T,isUpdate:!0},()=>{let o=0,a=0,n=0,l=0,h=0,f=0,p=0;this.state.usageProviderData.forEach(x=>{o+=x.logs,a+=x.infra,n+=x.apm,l+=x.synthetics,f+=x.totalServerlessTraces,p+=x.database,h+=x.browser_test});const b=Math.round(a*this.state.infraRate/30/this.state.infraRate),k=Math.round(n*this.state.apmRate/30/this.state.apmRate),I=Math.round(p*this.state.dbRate/30/this.state.dbRate),w=Math.round(l*this.state.syntheticRate/30/this.state.syntheticRate),A=Math.round(f*this.state.serverlessRate/30/this.state.serverlessRate);this.setState({infraChartData:this.generateData("infra"),apmChartData:this.generateData("apm"),logsChartData:this.generateData("logs"),databaseChartData:this.generateData("database"),totalInfraHosts:Number.isInteger(b)?b:0,totalApmHosts:Number.isInteger(k)?k:0,totalDatabaseHosts:Number.isInteger(I)?I:0,totalSyntheticsHosts:Number.isInteger(w)?w:0,totalServerlessHosts:Number.isInteger(A)?A:0,totalLogs:o,totalSynthetics:l,totalServerlessTraces:f,totalBrowserTest:h})})}}render(){var ot,nt,rt,lt,ct,dt,ht,pt,gt,ut,ft,mt,bt,Ct,jt,xt,_t,Dt,yt,kt,Pt,vt,St,Tt,Ft,It,wt,Nt,Lt,At,Mt,Et,qt,Ot,Ht,Bt,Ut,Rt,Kt,zt,Vt,Yt,Jt,Gt,$t,Qt,Wt,Zt,Xt,te,ee,se,ae,ie,oe,ne,re,le,ce,de,he,pe,ge,ue,fe,me,be,Ce,je,xe,_e,De,ye,ke,Pe,ve,Se,Te,Fe,Ie,we,Ne,Le,Ae,Me,Ee,qe,Oe,He,Be,Ue,Re,Ke,ze,Ve,Ye,Je,Ge,$e,Qe,We,Ze,Xe,ts,es,ss,as,is,os,ns,rs,ls,cs,ds,hs,ps,gs,us,fs,ms,bs,Cs,js,xs,_s,Ds,ys,ks,Ps,vs,Ss,Ts,Fs,Is,ws,Ns,Ls,As,Ms,Es,qs,Os,Hs,Bs,Us;const{agents:d,userlogins:g,logsdetail:S,billingMetaData:j}=this.props,y=S.sort((e,s)=>e.date_time-s.date_time),T=this.state.usageProviderData,E=[{label:"Usage Date",key:"date"}
1,{label:"Infrastructure Machines (Max /day)",key:"infra"},{label:"APM Hosts (Max /day)",key:"apm"},{label:"Logs (Size of logs ingested)",key:"log_size"},{label:"Synthetic checks (number of synthetic checks)",key:"synthetics"},{label:"Serverless traces (number of traces generated by serverless monitoring)",key:"serverless_traces"},{label:"Database Hosts (Max /day)",key:"database"},{label:"RUM",key:"rum"},{label:"Metrics (Size of ingested metrics in Bytes)",key:D.MetricSize},{label:"Traces (Size of ingested traces in Bytes)",key:D.TraceSize},{label:"OpsAI (Number of Issues)",key:D.OpsAI}],o=[{label:"Usage Date",key:"date"},{label:"Metric",key:"metric_size"},{label:"Traces",key:"trace_size"},{label:"Logs",key:"log_size"},{label:"RUM",key:"rum"},{label:"Synthetic Checks",key:"synthetics"},{label:"OpsAI (Number of Issues)",key:D.OpsAI}],a=new Date(this.state.fromDate),n=new Date(this.state.toDate),l=L().month(a.getMonth()).format("MMM"),h=L().month(n.getMonth()).format("MMM");a.getDate()+""+l+a.getHours()+a.getMinutes()+n.getDate()+h+n.getHours()+n.getMinutes();const f={type:Fa,config:{}},p={type:Ia,config:{}},b=[{title:"NAME",columnKey:"name",width:150,render:(e,s)=>t.jsxs("p",{className:"cell-formatting",children:[s.user_name," ",t.jsx("span",{className:"status-badge-v2 is-secondary",children:s.user_id})]})},{title:"EMAIL",columnKey:"email",width:250,render:(e,s)=>t.jsx("p",{className:"cell-formatting",children:s.email})},{title:"LAST LOGIN",columnKey:"LAST LOGIN",width:200,render:(e,s)=>s.created_at?t.jsx("div",{children:L(s.created_at).format("MMM DD, YYYY  hh:mm a")}):t.jsx("div",{className:"pending",children:"Login pending..."})},{title:"Role",columnKey:"name",width:250,render:(e,s)=>t.jsx("p",{className:"cell-formatting",children:s.name})},{title:"Status",columnKey:"status",width:250,render:(e,s)=>s.status=="active"?t.jsx("span",{className:"status paid",children:s.status}):t.jsx("span",{className:"status invite",children:"invited"})}],k=[{title:"User Name",columnKey:"name",width:150,render:(e,s)=>t.jsx("p",{className:"cell-formatting",children:s.name})},{title:"Login Date & Time",columnKey:"created_at",width:250,render:(e,s)=>t.jsx("p",{className:"cell-formatting",children:L(s.created_at).format("MMM DD, YYYY  hh:mm a")})}],I=[{title:"Logs",columnKey:"logs",width:150,render:(e,s)=>{var i;return t.jsxs(t.Fragment,{children:[s.logs," ",s.logs=="Infra Agent Installed!"?t.jsxs("span",{className:"machine",children:[s.meta_data!=null?(i=JSON.parse(s.meta_data))==null?void 0:i.host_count:""," ","Machine"]}):""]})}},{title:"Date & Time",columnKey:"created_at",width:250,render:(e,s)=>t.jsx("p",{className:"cell-formatting",children:L(s.date_time).format("MMM DD, YYYY  hh:mm a")})},{title:"Username",columnKey:"name",width:150,render:(e,s)=>t.jsx("p",{className:"cell-formatting",children:s.name})},{title:"Installation Script",columnKey:"script",width:150,render:(e,s)=>s.meta_data&&t.jsx(Ws,{src:this.parseString(s.meta_data),name:null,displayDataTypes:!1,collapsed:!0,iconStyle:"square",enableClipboard:!1})}],w=[{title:"DB Name",columnKey:"db_name",width:150,render:(e,s)=>t.jsx("p",{children:s.db_name})},{title:"DB Rows",columnKey:"db_rows",width:250,render:(e,s)=>{const i=Qs(s.db_count,f);return t.jsx("p",{children:i})}},{title:"DB Size",columnKey:"db_size",width:150,render:(e,s)=>{const i=Qs(s.db_size,p);return t.jsx("p",{children:i})}},{title:"DB Parts",columnKey:"script",width:150,render:(e,s)=>t.jsx("p",{children:s.db_parts})}],A=d.filter(e=>e.mw_data=="").filter(e=>{var i,r,c;if(!this.state.search)return!0;const s=this.state.search.toLowerCase();return((i=e.user_name)==null?void 0:i.toLowerCase().includes(s))||((r=e.email)==null?void 0:r.toLowerCase().includes(s))||((c=e.name)==null?void 0:c.toLowerCase().includes(s))}),x=d.filter(e=>e.mw_data&&e.mw_data.trim()==""),O=[{key:"disable_host_metrics_receiver",label:"Disable Host Metrics Receiver"},{key:"enable_process_collection",label:"Enable Process Collection"},{key:"enable_memory_limiter_ds",label:"Enable Memory Limiter (DaemonSet)"}];return t.jsx(Y.Fragment,{children:t.jsx("div",{className:"mw-user-details",children:t.jsxs($,{targetIndex:0,showBorderBottom:!0,children:[t.jsx(F,{title:"Agent Details",prefixIcon:t.jsx(t.Fragment,{}),children:t.jsx(U,{children:t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:"10px"},children:t.jsx($s,{placeholder:"Search",onChange:e=>{this.setState({search:e})},value:this.state.search,width:300})}),t.jsx(q,{columns:b,dataProvider:A,loading:!1,uniqId:"user_list",pagination:{totalRecords:A.length,page:this.currentPage,recordsPerPage:10,onChange:(e,s)=>{this.currentPage=e},recordsLabel:"Users List",showPrevNextPagination:!0}
1,maxHeight:"calc(100vh - 220px)"})]})})}),t.jsx(F,{title:"Login History",prefixIcon:t.jsx(t.Fragment,{}),children:t.jsx(U,{children:t.jsx("div",{children:t.jsx(q,{columns:k,dataProvider:g,loading:!1,uniqId:"login_info",pagination:{totalRecords:g.length,page:this.currentPage,recordsPerPage:10,onChange:(e,s)=>{this.currentPage=e},recordsLabel:"User Login Info",showPrevNextPagination:!0},maxHeight:"calc(100vh - 220px)"})})})}),t.jsx(F,{title:"Activity logs",prefixIcon:t.jsx(t.Fragment,{}),children:t.jsx(U,{children:t.jsx("div",{children:t.jsx(q,{columns:I,dataProvider:y,loading:!1,uniqId:"activity_logs",pagination:{totalRecords:y.length,page:this.currentPage,recordsPerPage:10,onChange:(e,s)=>{this.currentPage=e},recordsLabel:"User Activity Details",showPrevNextPagination:!0},maxHeight:"calc(100vh - 220px)"})})})}),t.jsx(F,{title:"Data Size",prefixIcon:t.jsx(t.Fragment,{}),children:t.jsx(U,{children:t.jsx("div",{children:t.jsx(q,{columns:w,dataProvider:x,loading:!1,uniqId:"data_size",pagination:{totalRecords:x.length,page:this.currentPage,recordsPerPage:10,onChange:(e,s)=>{this.currentPage=e},recordsLabel:"Data Size",showPrevNextPagination:!0},maxHeight:"calc(100vh - 220px)"})})})}),t.jsxs(F,{title:"Account Usages",prefixIcon:t.jsx(t.Fragment,{}),children:[t.jsxs("div",{className:"usage-header-bkoff",children:[t.jsx(Sa,{isDatePickerVisible:this.state.datePickerVisible,handleDatePickerVisibility:e=>{this.setState({datePickerVisible:e})},presetOptions:Rs,datePickerBtnText:this.state.datePickerBtnText,disableFutureDates:!0,onChange:e=>{e.fromTs&&e.toTs&&((new Date(e.toTs).getTime()-new Date(e.fromTs).getTime())/(1e3*3600*24)>45?this.props.showToast("error","You can not select range of more than 45 days"):this.setState({fromDate:new Date(e.fromTs),toDate:new Date(e.toTs),datePickerBtnText:this.getBtnText({fromTs:e.fromTs,toTs:e.toTs,range:e.range}),isLoading:!0,usageProviderData:[]},()=>{var r,c,C,m,P,_;this.props.requestBackofUsages({sts:(r=e==null?void 0:e.fromTs)==null?void 0:r.valueOf(),ets:(c=e==null?void 0:e.toTs)==null?void 0:c.valueOf(),filterby:this.state.filter,project:this.state.project,account_id:(m=(C=this.props)==null?void 0:C.userDetails)==null?void 0:m.account_id,uid:(_=(P=this.props)==null?void 0:P.userDetails)==null?void 0:_.uid},()=>{this.setState({isLoading:!1})})}))}}),t.jsx(wa,{data:T,headers:(rt=(nt=(ot=this.props.userDetails)==null?void 0:ot.billing_meta_data)==null?void 0:nt.RawMessage)!=null&&rt.show_for_old_plan?E:o,filename:((ct=(lt=this.props)==null?void 0:lt.userDetails)==null?void 0:ct.uid)+"_mw_usage.csv",children:t.jsx(M,{primary:!0,children:"Download CSV"})})]}),t.jsx("div",{className:"daily-breakdown-list",children:t.jsx(q,{uniqId:"usage-report",loading:this.state.isLoading,columns:(pt=(ht=(dt=this.props.userDetails)==null?void 0:dt.billing_meta_data)==null?void 0:ht.RawMessage)!=null&&pt.show_for_old_plan?this.state.tableColumnsForOld:this.state.tableColumns,dataProvider:this.state.usageProviderData})})]}),t.jsx(F,{title:"Integrated Apps",prefixIcon:t.jsx(t.Fragment,{}),children:t.jsx("div",{className:"agent-data-table logs-details",children:t.jsxs("table",{className:"integrated-app-table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{className:"project-uid",children:"Project UID"}),t.jsx("th",{className:"key-name",children:"Key Name"}),t.jsx("th",{className:"create-date",children:"Create Date"}),t.jsx("th",{className:"update-date",children:"Update Date"}),t.jsx("th",{className:"json-data",children:"JSON Data"})]})}),t.jsx("tbody",{children:d.map((e,s)=>{var i;if(e.is_meta_data){const r=(i=this.state.projectList)==null?void 0:i.find(G=>G.id===e.project_id),c=(r==null?void 0:r.uid)||"-",C=e.key==="vercel_integration_app",m=e.value?this.parseString(e.value):null;let P=!1,_=!1,N=!1;return C&&m&&(P=m.log_drain&&m.log_drain.id&&m.log_drain.id!=="",_=m.log_drain_v2&&m.log_drain_v2.id&&m.log_drain_v2.id!=="",N=m.trace_drain_v2&&m.trace_drain_v2.id&&m.trace_drain_v2.id!==""),t.jsx(t.Fragment,{children:t.jsxs("tr",{children:[t.jsx("td",{children:`${c} - ${e.project_id}`}),t.jsxs("td",{children:[t.jsx("div",{children:e.key.replace("_integration_app","")}),C&&t.jsxs("div",{className:"vercel-drain-status",children:[t.jsx("span",{children:"Log: V1: "}),P?t.jsx(X,{}):t.jsx(tt,{}),t.jsx("span",{children:", V2: "}),_?t.jsx(X,{}):t.jsx(tt,{}),t.jsx("span",{children:" | Trace V2: "}),N?t.jsx(X,{}):t.jsx(tt,{})]})]}),t.jsx("td",{children:L(e.created_at_meta).format("MMM DD, YYYY  hh:mm a")}),t.jsx("td",{children:L(e.updated_at_meta).format("MMM DD, YYYY  hh:mm a")}
1),t.jsx("td",{children:m&&t.jsx(Ws,{src:m,name:null,displayDataTypes:!1,collapsed:!0,iconStyle:"square",enableClipboard:!1})})]},s)})}})})]})})}),t.jsxs(F,{title:"Ingestion Control",prefixIcon:t.jsx(t.Fragment,{}),children:[t.jsx($,{onTabChange:e=>{const s=Object.keys(this.platforms)[e];this.setState({ingestionControl:{...this.state.ingestionControl,platform:s,availableProjects:[],selectedProject:"",availableHosts:[],selectedHost:"",hostConfig:{exporters:[{endpoint:"","api-key":""}]}}},this.getProjects)},targetIndex:Object.keys(this.platforms).indexOf(this.state.ingestionControl.platform),children:Object.keys(this.platforms).map(e=>t.jsx(F,{title:this.platforms[e]},e))}),t.jsxs("div",{className:"ingestion-control-main",children:[t.jsx("br",{}),t.jsx("label",{htmlFor:"",children:"Project"}),t.jsx(H,{selectedValues:this.state.ingestionControl.selectedProject||"",options:this.state.ingestionControl.availableProjects.map(e=>({value:e.uid.toLowerCase(),label:e.name})),onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,selectedProject:e,availableHosts:[],selectedHost:"",hostConfig:{exporters:[{endpoint:"","api-key":""}]}}},this.getProjectHosts)}}),t.jsx("br",{}),t.jsx("label",{htmlFor:"",children:this.state.ingestionControl.platform==="linux"?"Host":"Cluster"}),t.jsx(H,{disabled:!this.state.ingestionControl.selectedProject,selectedValues:this.state.ingestionControl.selectedHost||"",options:this.state.ingestionControl.availableHosts.map(e=>({value:e,label:e})),onChange:e=>{typeof e=="string"&&this.setState({ingestionControl:{...this.state.ingestionControl,selectedHost:e}},this.getHostSettings)}}),t.jsx("br",{}),t.jsx(v,{id:"max_recv_msg_size_mib",label:"gRPC Max Receive Message Size (MiB)",placeholder:"Enter number in range 1 to 8796093022207 - (Optional)",value:((gt=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:gt.max_recv_msg_size_mib)||"",disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],max_recv_msg_size_mib:Number(e)}}}})}}),t.jsx("br",{}),t.jsx(v,{id:"max_log_size",label:"Max Log Size",value:((ut=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:ut.max_log_size)||"",disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],max_log_size:e}}}})}}),t.jsx("br",{}),t.jsx("label",{htmlFor:"",children:"Configure Debug Exporter"}),t.jsxs("div",{style:{display:"flex",gap:"10px"},children:[t.jsx("div",{style:{flex:2},children:t.jsx(v,{id:"configure_debug_exporter",placeholder:"Enter pipeline names (comma separated)",value:((ft=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:ft.configure_debug_exporter)||"",disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],configure_debug_exporter:e}}}})}})}),t.jsx("div",{style:{flex:1},children:t.jsx(H,{disabled:!this.state.ingestionControl.selectedHost,defaultValue:((mt=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:mt.debug_exporter_verbosity)||"detailed",options:[{value:"none",label:"None"},{value:"basic",label:"Basic"},{value:"normal",label:"Normal"},{value:"detailed",label:"Detailed"}],onChange:e=>{typeof e=="string"&&this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],debug_exporter_verbosity:e}}}})}})})]}),t.jsx("br",{}),t.jsx("label",{htmlFor:"",children:"OTEL Telemetry Log Level"}),t.jsx(H,{disabled:!this.state.ingestionControl.selectedHost,defaultValue:((bt=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:bt.otel_telemetry_log_level)||"",options:this.state.ingestionControl.otel_telemetry_log_levels.map(e=>({value:e.toString(),label:e.toString()}))||[],onChange:e=>{typeof e=="string"&&this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],otel_telemetry_log_level:e}}}})}}),t.jsx("br",{}),t.jsx(v,{id:"prometheus_collection",label:"Prometheus Collection Interval",value:((Ct=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:Ct.prom_collection_interval)||"",disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],prom_collection_interval:e}}}})}}),t.jsx("div",{style:{marginTop:"0.75rem",marginBottom:"0.75rem"},children:((xt=(jt=this.state)==null?void 0:jt.ingestionControl)==null?void 0:xt.platform)==="k8s"&&t.jsx(v,{id:"k8s_cluster_receiver_collection_interval",label:"K8s Cluster Receiver Collection Interval",value:((_t=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:_t.k8s_cluster_receiver_collection_interval)||"",disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],k8s_cluster_receiver_collection_interval:e}}}})}})}),t.jsxs("div",{style:{marginTop:"0.75rem",marginBottom:"0.75rem"},children:[t.jsx("label",{children:"OTEL Compression Format"}),t.jsx(H,{disabled:!this.state.ingestionControl.selectedHost,defaultValue:((Dt=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:Dt.otel_compression_format)||"gzip",options:[{value:"gzip",label:"Gzip"},{value:"zstd",label:"Zstd"},{value:"snappy",label:"Snappy"}],onChange:e=>{typeof e=="string"&&this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],otel_compression_format:e}}}})}})]}),t.jsx("div",{style:{marginBottom:"0.75rem"},children:t.jsx(B,{id:"deobfuscate_query_statement",checked:((yt=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:yt.deobfuscate_query_statement)||!1,disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],deobfuscate_query_statement:e??!1}}}})},label:"Deobfuscate Query Statement"})}),(this.state.ingestionControl.platform==="linux"||this.state.ingestionControl.platform==="k8s")&&t.jsxs("div",{className:"exporters-section",children:[t.jsx("h4",{children:"Exporters"}),(Pt=(kt=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:kt.exporters)==null?void 0:Pt.map((e,s)=>{var i,r,c,C;return t.jsxs("div",{className:"exporter-entry",children:[t.jsx(v,{label:"Endpoint",value:e.endpoint,onChange:m=>{var N;const{platform:P}=this.state.ingestionControl,_=[...((N=this.state.ingestionControl.hostConfig[P])==null?void 0:N.exporters)||[]];s!=null&&(_[s]={..._[s],endpoint:m}),this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[P]:{...this.state.ingestionControl.hostConfig[P],exporters:_}}}})},id:"endpoint"}),t.jsx("br",{}),t.jsx(v,{label:"API Key",value:e["api-key"],onChange:m=>{var N;const{platform:P}=this.state.ingestionControl,_=[...((N=this.state.ingestionControl.hostConfig[P])==null?void 0:N.exporters)||[]];_[s]={..._[s],"api-key":m},this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[P]:{...this.state.ingestionControl.hostConfig[P],exporters:_}}}})},id:"api-key"}),s===(((r=(i=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:i.exporters)==null?void 0:r.length)||0)-1&&t.jsx(M,{onClick:()=>{var N;const{platform:m}=this.state.ingestionControl,_=[...((N=this.state.ingestionControl.hostConfig[m])==null?void 0:N.exporters)||[],{endpoint:"","api-key":""}];this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[m]:{...this.state.ingestionControl.hostConfig[m],exporters:_}}}})},children:"Add Exporter"}),(((C=(c=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:c.exporters)==null?void 0:C.length)||0)>1&&t.jsx(M,{onClick:()=>{var _,N;const{platform:m}
1=this.state.ingestionControl,P=((N=(_=this.state.ingestionControl.hostConfig[m])==null?void 0:_.exporters)==null?void 0:N.filter((G,ia)=>ia!==s))||[];this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[m]:{...this.state.ingestionControl.hostConfig[m],exporters:P}}}})},children:"Remove"})]},s)})]}),t.jsx("div",{style:{marginBottom:"0.75rem"},children:((St=(vt=this.state)==null?void 0:vt.ingestionControl)==null?void 0:St.platform)==="k8s"&&t.jsx(B,{id:"extra_metadata_labels",checked:((Tt=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:Tt.extra_metadata_labels)||!1,disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],extra_metadata_labels:e??!1}}}})},label:"Extra Metadata Labels"})}),t.jsx("div",{style:{marginBottom:"0.75rem"},children:((It=(Ft=this.state)==null?void 0:Ft.ingestionControl)==null?void 0:It.platform)==="k8s"&&t.jsx(B,{id:"deployment",checked:((wt=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:wt.deployment)||!1,disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],deployment:e??!1}}}})},label:"Restart Deployemnt Kube Agent"})}),t.jsx("div",{style:{marginTop:"0.75rem",marginBottom:"0.75rem"},children:((Lt=(Nt=this.state)==null?void 0:Nt.ingestionControl)==null?void 0:Lt.platform)==="k8s"&&t.jsx(B,{id:"disable_k8s_objects",checked:((At=this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform])==null?void 0:At.disable_k8s_objects)||!1,disabled:!this.state.ingestionControl.selectedHost,onChange:e=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[this.state.ingestionControl.platform]:{...this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform],disable_k8s_objects:e??!1}}}})},label:"Disable K8S Objects"})}),((Et=(Mt=this.state)==null?void 0:Mt.ingestionControl)==null?void 0:Et.platform)==="k8s"&&O.map(({key:e,label:s})=>{var r;const i=this.state.ingestionControl.platform;return t.jsx("div",{style:{marginTop:"0.75rem",marginBottom:"0.75rem"},children:t.jsx(B,{id:e,label:s,checked:((r=this.state.ingestionControl.hostConfig[i])==null?void 0:r[e])||!1,disabled:!this.state.ingestionControl.selectedHost,onChange:c=>{this.setState({ingestionControl:{...this.state.ingestionControl,hostConfig:{...this.state.ingestionControl.hostConfig,[i]:{...this.state.ingestionControl.hostConfig[i],[e]:c??!1}}}})}},e)})}),t.jsx(M,{primary:!0,disabled:!this.state.ingestionControl.selectedProject||!this.state.ingestionControl.selectedHost,onClick:()=>{if(!this.state.ingestionControl.hostConfig[this.state.ingestionControl.platform].max_log_size){this.props.showToast("error","Max Log Size cannot be empty");return}const{ingestionControl:s}=this.state,i=s.hostConfig[s.platform];i.agent_restart_status=!0,s.platform==="k8s"&&i.deployment!=!0&&(i.daemonset=!0,i.deployment=!0),this.setState({ingestionControl:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}}),this.updateHostConfig()},children:"Save"})]})]}),t.jsxs(F,{title:"Database Control",children:[t.jsx($,{onTabChange:e=>{var i;const s=Object.keys(this.platforms)[e];this.setState({database:{...(i=this.state)==null?void 0:i.database,platform:s,availableProjects:[],selectedProject:"",availableHosts:[],selectedHost:"",selectedDb:"",hostConfig:{exporters:[{endpoint:"","api-key":""}]}}},this.getDatabaseProjects)},targetIndex:Object.keys(this.platforms).indexOf(((Ot=(qt=this.state)==null?void 0:qt.database)==null?void 0:Ot.platform)||"linux"),children:Object.keys(this.platforms).map(e=>t.jsx(F,{title:this.platforms[e]},e))}),t.jsxs("div",{className:"ingestion-control-main",children:[t.jsx("br",{}),t.jsx("label",{htmlFor:"",children:"Project"}),t.jsx(H,{selectedValues:((Bt=(Ht=this.state)==null?void 0:Ht.database)==null?void 0:Bt.selectedProject)||"",options:(Rt=(Ut=this.state)==null?void 0:Ut.database)==null?void 0:Rt.availableProjects.map(e=>({value:e.uid.toLowerCase(),label:e.name})),onChange:e=>{var s;this.setState({database:{...(s=this.state)==null?void 0:s.database,selectedProject:e,availableHosts:[],selectedHost:"",hostConfig:{exporters:[{endpoint:"","api-key":""}]}}},this.getDatabaseProjectHosts)}}),t.jsx("br",{}),t.jsx("label",{htmlFor:"",children:((zt=(Kt=this.state)==null?void 0:Kt.database)==null?void 0:zt.platform)==="linux"?"Host":"Cluster"}),t.jsx(H,{disabled:!((Yt=(Vt=this.state)==null?void 0:Vt.database)!=null&&Yt.selectedProject),selectedValues:((Gt=(Jt=this.state)==null?void 0:Jt.database)==null?void 0:Gt.selectedHost)||"",options:(Qt=($t=this.state)==null?void 0:$t.database)==null?void 0:Qt.availableHosts.map(e=>({value:e,label:e})),onChange:e=>{var s;typeof e=="string"&&this.setState({database:{...(s=this.state)==null?void 0:s.database,selectedHost:e}},this.getDatabaseHostSettings)}}),t.jsx("br",{}),t.jsx("label",{htmlFor:"",children:"Database"}),t.jsx(H,{disabled:!((Zt=(Wt=this.state)==null?void 0:Wt.database)!=null&&Zt.selectedHost),selectedValues:((te=(Xt=this.state)==null?void 0:Xt.database)==null?void 0:te.selectedDb)||"",options:Object.keys(this.dbConfigs).map(e=>({value:e,label:e})),onChange:e=>{var s;typeof e=="string"&&this.setState({database:{...(s=this.state)==null?void 0:s.database,selectedDb:e}})}}),t.jsx("br",{}),((se=(ee=this.state)==null?void 0:ee.database)==null?void 0:se.selectedDb)=="PostgreSQL"&&((ie=(ae=this.state)==null?void 0:ae.database)==null?void 0:ie.platform)=="k8s"&&t.jsxs("div",{children:[t.jsx(Js,{title:"Query Collection",children:t.jsxs("div",{className:"ml-10",children:[t.jsx("div",{className:"mt-10",children:t.jsx(B,{label:"Enable Query Sample Collection",onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.query_sample_enabled=e,c.events={...c.events,"db.server.query_s
1ample":{enabled:e}}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})},checked:(re=(ne=(oe=this.state.database)==null?void 0:oe.hostConfig[this.state.database.platform])==null?void 0:ne[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:re.settings[0].query_sample_enabled,id:`query_sample_enabled_${Math.random()}`})}),((de=(ce=(le=this.state.database)==null?void 0:le.hostConfig[this.state.database.platform])==null?void 0:ce[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:de.settings[0].query_sample_enabled)&&t.jsx("div",{className:"ml-10 mt-10",children:t.jsx(v,{id:"query_sample_max_rows_per_query",label:"Max Rows Per Query",placeholder:"1000",type:"number",min:0,value:((fe=(ue=(ge=(pe=(he=this.state.database)==null?void 0:he.hostConfig[this.state.database.platform])==null?void 0:pe[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:ge.settings[0])==null?void 0:ue.query_sample_collection)==null?void 0:fe.max_rows_per_query)||"",disabled:!((me=this.state.database)!=null&&me.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.query_sample_collection={max_rows_per_query:Number(e)}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})}),t.jsx("div",{className:"mt-20",children:t.jsx(B,{label:"Enable Top Query Collection",onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.top_query_enabled=e,c.events={...c.events,"db.server.top_query":{enabled:e}}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})},checked:(je=(Ce=(be=this.state.database)==null?void 0:be.hostConfig[this.state.database.platform])==null?void 0:Ce[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:je.settings[0].top_query_enabled,id:`top_query_enabled_${Math.random()}`})}),((De=(_e=(xe=this.state.database)==null?void 0:xe.hostConfig[this.state.database.platform])==null?void 0:_e[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:De.settings[0].top_query_enabled)&&t.jsxs("div",{className:"ml-10",children:[t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"top_query_top_n_query",label:"Top N Query",placeholder:"1000",type:"number",min:0,value:(Se=(ve=(Pe=(ke=(ye=this.state.database)==null?void 0:ye.hostConfig[this.state.database.platform])==null?void 0:ke[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:Pe.settings[0])==null?void 0:ve.top_query_collection)==null?void 0:Se.top_n_query,disabled:!((Te=this.state.database)!=null&&Te.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.top_query_collection={...c.top_query_collection,top_n_query:Number(e)}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})}),t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"top_query_max_rows_per_query",label:"Max Rows Per Query",placeholder:"1000",type:"number",min:0,value:(Le=(Ne=(we=(Ie=(Fe=this.state.database)==null?void 0:Fe.hostConfig[this.state.database.platform])==null?void 0:Ie[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:we.settings[0])==null?void 0:Ne.top_query_collection)==null?void 0:Le.max_rows_per_query,disabled:!((Ae=this.state.database)!=null&&Ae.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.top_query_collection={...c.top_query_collection,max_rows_per_query:Number(e)}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})}),t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"top_query_max_explain_each_interval",label:"Max Explain Each Interval",placeholder:"1000",type:"number",min:0,value:(He=(Oe=(qe=(Ee=(Me=this.state.database)==null?void 0:Me.hostConfig[this.state.database.platform])==null?void 0:Ee[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:qe.settings[0])==null?void 0:Oe.top_query_collection)==null?void 0:He.max_explain_each_interval,disabled:!((Be=this.state.database)!=null&&Be.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.top_query_collection={...c.top_query_collection,max_explain_each_interval:Number(e)}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})}),t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"top_query_query_plan_cache_size",label:"Query Plan Cache Size",placeholder:"1000",type:"number",min:0,value:(Ve=(ze=(Ke=(Re=(Ue=this.state.database)==null?void 0:Ue.hostConfig[this.state.database.platform])==null?void 0:Re[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:Ke.settings[0])==null?void 0:ze.top_query_collection)==null?void 0:Ve.query_plan_cache_size,disabled:!((Ye=this.state.database)!=null&&Ye.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.top_query_collection={...c.top_query_collection,query_plan_cache_size:Number(e)}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})}),t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"top_query_query_plan_cache_ttl",label:"Query Plan Cache TTL",placeholder:"1h",value:(We=(Qe=($e=(Ge=(Je=this.state.database)==null?void 0:Je.hostConfig[this.state.database.platform])==null?void 0:Ge[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:$e.settings[0])==null?void 0:Qe.top_query_collection)==null?void 0:We.query_plan_cache_ttl,disabled:!((Ze=this.state.database)!=null&&Ze.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.top_query_collection={...c.top_query_collection,query_plan_cache_ttl:e}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})})]})]})}),t.jsx(Js,{title:"Connection Pool",children:t.jsxs("div",{className:"ml-10",children:[t.jsx("div",{className:"mt-10",children:t.jsx(B,{label:"Enable Connection Pool",onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.connection_pool_enabled=e}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})},checked:(es=(ts=(Xe=this.state.database)==null?void 0:Xe.hostConfig[this.state.database.platform])==null?void 0:ts[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:es.settings[0].connection_pool_enabled,id:`connection_pool_enabled_${Math.random()}`})}),((is=(as=(ss=this.state.database)==null?void 0:ss.hostConfig[this.state.database.platform])==null?void 0:as[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:is.settings[0].connection_pool_enabled)&&t.jsxs("div",{className:"ml-10",children:[t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"connection_pool_max_idle_time",label:"Max Idle Time",placeholder:"10m",value:(cs=(ls=(rs=(ns=(os=this.state.database)==null?void 0:os.hostConfig[this.state.database.platform])==null?void 0:ns[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:rs.settings[0])==null?void 0:ls.connection_pool)==null?void 0:cs.max_idle_time,disabled:!((ds=this.state.database)!=null&&ds.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.connection_pool={...c.connection_pool,max_idle_time:e}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})}),t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"connection_pool_max_lifetime",label:"Max LifeTime",placeholder:"10m",value:(fs=(us=(gs=(ps=(hs=this.state.database)==null?void 0:hs.hostConfig[this.state.database.platform])==null?void 0:ps[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:gs.settings[0])==null?void 0:us.connection_pool)==null?void 0:fs.max_lifetime,disabled:!((ms=this.state.database)!=null&&ms.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.connection_pool={...c.connection_pool,max_lifetime:e}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})}),t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"connection_pool_max_idle",label:"Max Idle",placeholder:"10",type:"number",min:0,value:(_s=(xs=(js=(Cs=(bs=this.state.database)==null?void 0:bs.hostConfig[this.state.database.platform])==null?void 0:Cs[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:js.settings[0])==null?void 0:xs.connection_pool)==null?void 0:_s.max_idle,disabled:!((Ds=this.state.database)!=null&&Ds.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.connection_pool={...c.connection_pool,max_idle:Number(e)}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})}),t.jsx("div",{className:"mt-10",children:t.jsx(v,{id:"connection_pool_max_open",label:"Max Open",placeholder:"1000",type:"number",min:0,value:(Ss=(vs=(Ps=(ks=(ys=this.state.database)==null?void 0:ys.hostConfig[this.state.database.platform])==null?void 0:ks[this.dbConfigs[this.state.database.selectedDb]])==null?void 0:Ps.settings[0])==null?void 0:vs.connection_pool)==null?void 0:Ss.max_open,disabled:!((Ts=this.state.database)!=null&&Ts.selectedDb),onChange:e=>{var r;const{database:s}=this.state,i=s.hostConfig[s.platform];(r=i==null?void 0:i[this.dbConfigs[s.selectedDb]])==null||r.settings.map(c=>{c.connection_pool={...c.connection_pool,max_open:Number(e)}}),this.setState({database:{...s,hostConfig:{...s.hostConfig,[s.platform]:i}}})}})})]})]})})]}),t.jsx("br",{}),t.jsx(M,{primary:!0,disabled:!((Is=(Fs=this.state)==null?void 0:Fs.database)!=null&&Is.selectedProject)||!((Ns=(ws=this.state)==null?void 0:ws.database)!=null&&Ns.selectedHost)||!((As=(Ls=this.state)==null?void 0:Ls.database)!=null&&As.selectedDb),onClick:()=>{const{database:e}=this.state,s=e==null?void 0:e.hostConfig[e==null?void 0:e.platform];s.agent_restart_status=!0,(e==null?void 0:e.platform)==="k8s"&&s.deployment!=!0&&(s.daemonset=!0,s.deployment=!0),this.setState({database:{...e,hostConfig:{...e==null?void 0:e.hostConfig,[e==null?void 0:e.platform]:s}}}),this.updateDatabaseHostConfig()},children:"Save"})]})]}),t.jsxs(F,{title:"Projects",prefixIcon:t.jsx(t.Fragment,{}),children:[t.jsx(U,{children:t.jsx(q,{uniqId:"projects-table",loading:this.state.isLoading,columns:this.getProjectTableColumns(),dataProvider:this.getProjectTableData(),pagination:{totalRecords:((Ms=this.state.projectList)==null?void 0:Ms.length)||0,page:1},noDataLabel:"No projects found"})}),this.state.currentProjectIndex!=null&&t.jsx(Gs,{isOpen:this.state.isDialogOpen,onClose:this.handleCancelTTLChange,title:`Sure about changing TTL to ${this.state.ttlValues[this.state.currentProjectIndex]} for project ${this.state.projectList[this.state.currentProjectIndex].name} ?`,description:"Careful: if TTL reduces then existing data will be deleted, please think twice before change it",confirmBtnText:"Change TTL",handleConfirmEvent:this.handleConfirmTTLChange,cancelBtnText:"No, keep it",handleCancelEvent:this.handleCancelTTLChange,enableDoubleConfirmation:!1,entityName:this.state.currentProjectIndex!==null?this.state.projectList[this.state.currentProjectIndex].name:"",entityType:"Project"}),this.state.projectDbDeleteInfo!=null&&t.jsx(Gs,{isOpen:this.state.projectDbDeleteInfo.projectId>0,onClose:this.handleCancelDbDelete,title:`Sure about ${this.state.projectDbDeleteInfo.db_deleted?"deleting":"activating"} database for project ${this.state.projectDbDeleteInfo.projectName} ?`,description:`${this.state.projectDbDeleteInfo.db_deleted?"Careful: if delete database then data will not be restored":"This action will make the database operational and accessible to users"} `,confirmBtnText:this.state.projectDbDeleteInfo.isLoading?"Loading...":this.state.projectDbDeleteInfo.db_deleted?"Delete database":"Activate database",handleConfirmEvent:this.handleDbDelete,cancelBtnText:"No, keep it",handleCancelEvent:this.handleCancelDbDelete,enableDoubleConfirmation:!1,entityName:this.state.projectDbDeleteInfo.projectName,entityType:"Database"}
1),this.state.isDetailsModalOpen!=null&&t.jsx(Z,{isOpen:this.state.isDetailsModalOpen,position:"right",overlayClassName:"bkoff_dialog_backdrop",onClose:()=>{this.setState({isDetailsModalOpen:!1,selectedProjectUid:"",selectedProjectTable:0}),this.props.receivedProjectDiskData({},"reset")},size:"md",verticalCenter:!0,children:t.jsx(Y.Fragment,{children:t.jsxs("div",{className:"mw-user-details",children:[t.jsx("div",{className:"d-flex",children:t.jsx("p",{className:"user-name",children:"Details"})}),t.jsxs("div",{children:[t.jsx($s,{value:this.state.search,onChange:e=>{this.setState({search:e?e.trim():""})},placeholder:"Search Project Details"}),t.jsxs($,{onTabChange:e=>{this.setState({selectedProjectTable:e,selectedProjectPage:1}),this.handleTabChange(e)},targetIndex:this.state.selectedProjectTable,children:[t.jsx(F,{title:"Disk"}),t.jsx(F,{title:"Disk + Partition"}),t.jsx(F,{title:"Disk + Part + Table"})]}),t.jsx(q,{columns:this.state.projectDetailsColumns,loading:this.state.loader,uniqId:"project-details",dataProvider:((Es=this.state.selectedProjectTable===2?this.props.projectDiskPartTableData:this.state.selectedProjectTable===1?this.props.projectDiskPartData:this.props.projectDiskData)==null?void 0:Es.filter(e=>Object.keys(e).some(s=>String(e[s]).toLowerCase().includes((this.state.search||"").toLowerCase()))))||[],pagination:{totalRecords:this.state.selectedProjectTable===2?((qs=this.props.projectDiskPartTableData)==null?void 0:qs.length)||0:this.state.selectedProjectTable===1?((Os=this.props.projectDiskPartData)==null?void 0:Os.length)||0:((Hs=this.props.projectDiskData)==null?void 0:Hs.length)||0,page:this.state.selectedProjectPage,onChange:(e,s)=>{this.setState({selectedProjectPage:e})},recordsPerPage:20,internalPaginatedData:!0}})]})]})})}),this.state.isFeaturesModalOpen!=null&&t.jsx(Z,{isOpen:this.state.isFeaturesModalOpen,position:"right",overlayClassName:"bkoff_dialog_backdrop",onClose:()=>{this.setState({isFeaturesModalOpen:!1})},size:"md",verticalCenter:!0,children:t.jsx(Y.Fragment,{children:t.jsx("div",{className:"feature-data",children:t.jsxs("table",{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Feature"}),t.jsx("th",{children:"Status"})]})}),t.jsxs("tbody",{children:[t.jsxs("tr",{children:[t.jsx("td",{children:"Public Dashboard"}),t.jsx("td",{children:R()?t.jsx("span",{children:this.state.isEnabledPublicFeature?"Enabled":"Disabled"}):t.jsx(J,{showSecondaryToggleOffState:!0,id:"feature",checked:this.state.isEnabledPublicFeature,onChange:e=>{var i;let s=((i=this.state.publicDashboard)==null?void 0:i.project_uids)||[];this.state.isEnabledPublicFeature?s=s.filter(r=>r!==this.state.selectedProjectUid):s.push(this.state.selectedProjectUid),this.props.requestUpdateFeatureFlagStatus({featureFlagName:et,featureFlagValue:!0,projectUids:s},(r,c,C)=>{!c&&r&&C&&(this.setState({publicDashboard:C}),this.checkIfPublicFeatureEnabled(this.state.selectedProjectUid,s))})}})})]},1),t.jsxs("tr",{children:[t.jsx("td",{children:"JSON Parse Logs"}),t.jsx("td",{children:R()?t.jsx("span",{children:this.state.isEnabledJsonParseLogs?"Enabled":"Disabled"}):t.jsx(J,{showSecondaryToggleOffState:!0,id:"json-parse-logs",checked:this.state.isEnabledJsonParseLogs,onChange:e=>{var i;let s=((i=this.state.jsonParseLogs)==null?void 0:i.project_uids)||[];this.state.isEnabledJsonParseLogs?s=s.filter(r=>r!==this.state.selectedProjectUid):s.push(this.state.selectedProjectUid),this.props.requestUpdateFeatureFlagStatus({featureFlagName:Xs,featureFlagValue:!0,projectUids:s},(r,c,C)=>{!c&&r&&C&&(this.setState({jsonParseLogs:C}),this.checkIfJsonParseLogsFeatureEnabled(this.state.selectedProjectUid,s))})}})})]},3),t.jsxs("tr",{children:[t.jsx("td",{children:"Trace Disable NodeJS Verbose Spans"}),t.jsx("td",{children:R()?t.jsx("span",{children:this.state.isEnabledTraceDisableNodejsVerboseSpans?"Enabled":"Disabled"}):t.jsx(J,{showSecondaryToggleOffState:!0,id:"trace-disable-nodejs-verbose-spans",checked:this.state.isEnabledTraceDisableNodejsVerboseSpans,onChange:e=>{var i;let s=((i=this.state.traceDisableNodejsVerboseSpans)==null?void 0:i.project_uids)||[];this.state.isEnabledTraceDisableNodejsVerboseSpans?s=s.filter(r=>r!==this.state.selectedProjectUid):s.push(this.state.selectedProjectUid),this.props.requestUpdateFeatureFlagStatus({featureFlagName:ta,featureFlagValue:!0,projectUids:s},(r,c,C)=>{!c&&r&&C&&(this.setState({traceDisableNodejsVerboseSpans:C}),this.checkIfTraceDisableNodejsVerboseSpansFeatureEnabled(this.state.selectedProjectUid,s))})}})})]},4),t.jsxs("tr",{children:[t.jsx("td",{children:"Enable AI Dashboards"}),t.jsx("td",{children:R()?t.jsx("span",{children:this.state.isAiDashbpardEnabled?"Enabled":"Disabled"}):t.jsx(J,{showSecondaryToggleOffState:!0,id:"enable-ai-dashboard",checked:this.state.isAiDashbpardEnabled,onChange:e=>{var i;let s=((i=this.state.aiDashbpards)==null?void 0:i.project_uids)||[];this.state.isAiDashbpardEnabled?s=s.filter(r=>r!==this.state.selectedProjectUid):s.push(this.state.selectedProjectUid),this.props.requestUpdateFeatureFlagStatus({featureFlagName:ea,featureFlagValue:!0,projectUids:s},(r,c,C)=>{!c&&r&&C&&(this.setState({aiDashbpards:C}),this.checkIfAIDashboardEnabled(this.state.selectedProjectUid,s))})}})})]},5)]})]})})})}),this.state.aiChatFeedbackModalOpen&&t.jsx(Z,{isOpen:this.state.aiChatFeedbackModalOpen,position:"right",overlayClassName:"bkoff_dialog_backdrop",onClose:()=>{this.setState({aiChatFeedbackModalOpen:!1,aiChatFeedbackProjectId:null,aiChatFeedbackProjectName:"",aiChatFeedbackRows:[],aiChatFeedbackTotal:0,aiChatFeedbackLoading:!1,aiChatFeedbackPage:1})},size:"lg",verticalCenter:!0,children:t.jsxs("div",{className:"bkoff-ai-feedback-dialog",children:[t.jsxs("h3",{className:"bkoff-ai-feedback-dialog__title",children:[this.state.aiChatFeedbackProjectName," ",t.jsxs("span",{className:"bkoff-ai-feedback-dialog__title-meta",children:["(#",this.state.aiChatFeedbackProjectId,")"]})]}),t.jsx("div",{className:"bkoff-ai-feedback-dialog__table-wrap",children:t.jsx(U,{children:t.jsx(q,{uniqId:"bkoff-ai-chat-feedback-project",loading:this.state.aiChatFeedbackLoading,columns:Va,dataProvider:this.state.aiChatFeedbackRows.map(e=>({...e,key:e.rowKey}
1)),maxHeight:"calc(100vh - 220px)",pagination:{totalRecords:this.state.aiChatFeedbackTotal,page:this.state.aiChatFeedbackPage,recordsPerPage:100,recordsLabel:"AI chat feedback",onChange:e=>{this.loadAiChatFeedback(e)}}})})}),!this.state.aiChatFeedbackLoading&&this.state.aiChatFeedbackRows.length===0&&t.jsx("div",{className:"bkoff-ai-feedback-dialog__empty",children:"No AI chat activity feedback for this project."})]})})]}),t.jsx(F,{title:"Billing",prefixIcon:t.jsx(t.Fragment,{}),children:t.jsx("div",{className:"bkoff-billing-wrapper",children:t.jsx(Ea,{billingMetaData:j,accountId:(Bs=this.props.userDetails)==null?void 0:Bs.account_id,showToast:this.props.showToast,requestBkoffDataLimitLogs:this.props.requestBkoffDataLimitLogs,onSubmitDataLimits:(e,s)=>this.updateBillingDataLimits(e,"Data limits updated successfully",s),otherMetadata:this.props.userDetails.billing_meta_data_config})})}),t.jsx(F,{title:"Features",prefixIcon:t.jsx(t.Fragment,{}),children:t.jsx("div",{className:"bkoff-billing-wrapper",children:t.jsx(U,{children:t.jsx(q,{uniqId:"features-table",loading:!1,columns:[{title:"Feature",columnKey:"feature"},{title:"Status",columnKey:"status",render:(e,s)=>{if(s.key===V){const r=this.state.accountEnabledFeatureNames.includes(V);return R()?t.jsx("span",{children:r?"Enabled":"Disabled"}):t.jsx(J,{showSecondaryToggleOffState:!0,id:"ai-welcome-dashboard-global",checked:r,onChange:()=>{var _;const c=(_=this.props.userDetails)==null?void 0:_.account_id;if(!c)return;const C=!this.state.accountEnabledFeatureNames.includes(V),m=new Set(this.state.accountEnabledFeatureNames);C?m.add(V):m.delete(V);const P=Array.from(m);this.props.requestBackoffUpsertAccountSetting({account_id:c,key:Zs,value:P},(N,G)=>{G===200&&this.setState({accountEnabledFeatureNames:sa(N)})})}})}return null}}],dataProvider:[{key:V,feature:"AI Welcome Dashboard"}]})})})}),t.jsx(F,{title:"AI chat feedback",prefixIcon:t.jsx(t.Fragment,{}),children:t.jsxs("div",{className:"bkoff-billing-wrapper",children:[t.jsx(U,{children:t.jsx(q,{uniqId:"ai-chat-feedback-table",loading:this.state.aiChatFeedbackLoading,columns:aa,dataProvider:this.state.aiChatFeedbackRows.map(e=>({...e,key:e.rowKey})),maxHeight:"calc(100vh - 280px)",pagination:{totalRecords:this.state.aiChatFeedbackTotal,page:this.state.aiChatFeedbackPage,recordsPerPage:100,recordsLabel:"AI chat feedback",onChange:e=>{this.loadAiChatFeedback(e)}}})}),!this.state.aiChatFeedbackLoading&&this.state.aiChatFeedbackRows.length===0&&t.jsx("div",{style:{marginTop:"0.75rem"},children:"No AI chat activity feedback for this account."})]})})]},`bkoff-user-tabs-${((Us=this.props.userDetails)==null?void 0:Us.account_id)??"none"}`)})})}}const $i=qa(u=>({agents:ha(u),billingMetaData:da(u),userlogins:ca(u),logsdetail:la(u),usages:ra(u),projectDiskData:Q(u,"disk"),projectDiskPartData:Q(u,"disk_part"),projectDiskPartTableData:Q(u,"disk_part_table"),featureFlag:na(u,et)}),{requestBackoffAgent:va,requestBackoffUserLogin:Pa,requestBackoffLogs:ka,requestBackofUsages:ya,showToast:oa,requestUpdateProjectTTL:Da,requestUpdateProjectDbDeleted:_a,requestProjectDiskData:xa,receivedProjectDiskData:Na,requestFeatureFlagStatus:ja,requestUpdateFeatureFlagStatus:Ca,requestBkoffDataLimitLogs:ba,requestUpdateBillingDataLimits:ma,requestUpdateBillingMetadata:fa,requestBackoffGetAccountSetting:ua,requestBackoffUpsertAccountSetting:ga,requestBackoffAiChatFeedback:pa})(Ya);export{$i as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.