PageSourceSearch

https://app.cloudfix.com/_next/static/chunks/pages/settings/resourceTagging-b12124d296e588ec.js

js cloudfix.com collected 2026-09-24 18:30:07 UTC 12,387 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4400],{37952:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/resourceTagging",function(){return s(4089)}])},83840:function(e,t,s){"use strict";s.d(t,{v:function(){return r},e:function(){return j}});var n,r,l=s(53704),a=s(15388),i=s.n(a),c=s(39094),o=s(88407),d=s(21902),u=s(83537),x=s.n(u),f=s(97910),m=e=>{let{tabs:t,selectedTab:s}=e,n=(0,d.useRef)(null),[r,a]=(0,d.useState)(!1),[i,c]=(0,d.useState)(!1),u=()=>{if(n.current){let{scrollLeft:e,scrollWidth:t,clientWidth:s}=n.current;a(e>0),c(Math.ceil(e+s)<t-1)}};(0,d.useEffect)(()=>{let e=n.current;if(e){e.addEventListener("scroll",u),u();let t=new ResizeObserver(u);return t.observe(e),()=>{e.removeEventListener("scroll",u),t.disconnect()}}},[]);let m=e=>e?"bg-white p-2 rounded-t-lg select-none w-52":"bg-[#C0EBF2] p-2 rounded-t-lg w-52 hover:bg-[#A8E2EB] transition-colors";return(0,l.jsx)("div",{className:"relative mx-auto mt-4 max-w-[1756px] 6xl:w-[1756px]",children:(0,l.jsxs)("div",{className:"relative px-12",children:[r&&(0,l.jsx)("button",{"aria-label":"Scroll tabs left",onClick:()=>{n.current&&n.current.scrollBy({left:-200,behavior:"smooth"})},className:"pointer-events-auto absolute inset-y-0 left-12 z-10 flex w-20 cursor-pointer items-center justify-start rounded-t-lg bg-gradient-to-r from-[#ffffff] via-[#ffffff] to-transparent pl-2",type:"button",children:(0,l.jsx)(f.wyc,{className:"size-5 text-gray-600",size:16})}),i&&(0,l.jsx)("button",{"aria-label":"Scroll tabs right",onClick:()=>{n.current&&n.current.scrollBy({left:200,behavior:"smooth"})},className:"pointer-events-auto absolute inset-y-0 right-12 z-10 flex w-20 cursor-pointer items-center justify-end rounded-t-lg bg-gradient-to-l from-[#ffffff] via-[#ffffff] to-transparent pr-2",type:"button",children:(0,l.jsx)(f.XCv,{className:"size-5 text-gray-600",size:16})}),(0,l.jsx)("div",{ref:n,className:"scrollbar-hide relative overflow-x-auto rounded-t-lg",children:(0,l.jsx)(o.O.List,{className:"flex min-w-full space-x-2 whitespace-nowrap border-b-0 text-sm",children:t.map((e,t)=>(0,l.jsx)(x(),{href:e.href,children:(0,l.jsx)(o.O,{className:"".concat(m(e.type===s)," rounded-t-lg"),children:e.name})},"".concat(t,"-").concat(e.type)))})})]})})},h=s(7099),g=s(73030);(n=r||(r={}))[n.FindersFixers=0]="FindersFixers",n[n.OUsOnboarding=1]="OUsOnboarding",n[n.Integrations=2]="Integrations",n[n.Users=3]="Users",n[n.ExcludedAccounts=4]="ExcludedAccounts",n[n.ResourceTagging=5]="ResourceTagging",n[n.APITokens=6]="APITokens",n[n.MCP=7]="MCP";let p=[{type:0,name:"Finders & Fixers",href:"/settings/finders"},{type:1,name:"OUs Onboarding",href:"/settings/onboarding"},{type:2,name:"Integrations",href:"/settings/integrations"},{type:3,name:"Users",href:"/settings/users"},{type:4,name:"Excluded Accounts",href:"/settings/excludedAccounts"},{type:5,name:"Resource Tagging",href:"/settings/resourceTagging"},{type:6,name:"API Tokens",href:"/settings/apiTokens"},{type:7,name:"MCP",href:"/settings/mcp",requiredPermission:g.y3.MCP_READ}];function j(e){let{children:t,selectedTab:s}=e,{hasPermission:n,permissions:r}=(0,h.T)(),a=r.length>0,d=p.filter(e=>{let t="requiredPermission"in e?e.requiredPermission:null;return null===t||a&&n(t)});return(0,l.jsxs)(c.Z,{children:[(0,l.jsx)(i(),{children:(0,l.jsx)("title",{children:"CloudFix - Settings"})}),(0,l.jsx)("main",{className:"h-screen p-10 pt-[70px]","data-benchid":"deshboard-id",children:(0,l.jsxs)(o.O.Group,{children:[(0,l.jsx)(m,{tabs:d,selectedTab:s}),(0,l.jsx)(o.O.Panels,{className:"-mt-8 h-full",children:t})]})})]})}},4089:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return C}});var n=s(53704),r=s(21902),l=s(54512),a=s(23514),i=s(5643),c=s(86570),o=s(3015),d=s(87648),u=s(48046);function x(e){let{isActive:t,onClickClose:s,onClickConfirm:r,message:l}=e;return t?(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,n.jsxs)("div",{className:"rounded-lg bg-white p-8 shadow-lg",children:[(0,n.jsx)("p",{className:"mb-4 text-lg",children:l}),(0,n.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,n.jsx)(o.zx,{styleType:"grey",onClick:s,children:"Cancel"}),(0,n.jsx)(o.zx,{styleType:"green",onClick:r,children:"Confirm"})]})]})}):null}var f=s(15922),m=s(97910),h=s(11347),g=s(73030),p=s(20328),j=function(){let[e,t]=(0,r.useState)([]),[s,j]=(0,r.useState)(!1),[y,b]=(0,r.useState)(null),[v,w]=(0,r.useState)(!1),C=(0,r.useRef)(null),[_,N]=(0,r.useState)(!1),[S,k]=(0,r.useState)(null),{createAutomaticResourceTaggingMutation:E}=(0,l.Z)(),T=E(),{getAwsAccountInfoQuery:R}=(0,h.h)(),{data:P,isLoading:O,isError:A,refetch:z}=R({refetchOnWindowFocus:!1}),{handleFilter:I,filteredColumns:U,handleRemoveFilter:F,isInFilteredColumns:V,displayTableRows:G,setTableRows:L,sortedBy:D,handleSort:W}=(0,d.x)({key:"aws_account_id",comparison:u.U.string,direction:"asc"}),[M,B]=(0,r.useState)(""),[X,Z]=(0,r.useState)(""),J=(0,r.useCallback)(e=>e.map((e,t)=>{let[s,n,r,l]=e.split(",");if(!s||!n||!r||!l)throw Error("Invalid data format in line ".concat(t+2));return{tenantId:"",aws_account_id:s,l4:n,l5:r,account_owner:l}}
1),[]),q=(0,r.useCallback)(e=>{var s;let n=null===(s=e.target)||void 0===s?void 0:s.result,r=n.split("\n").filter(e=>""!==e.trim());if(r.length<2){b("The CSV file is empty or invalid.");return}let l=r[0].trim().toLowerCase();if("aws_account_id,l4,l5,account_owner"!==l){b("Invalid CSV format. Please use the correct header: aws_account_id,l4,l5,account_owner");return}try{let e=J(r.slice(1));t(e),L(e.map(Q)),j(!0),b(null)}catch(e){b(e.message)}},[J,L]),Y=(0,r.useCallback)(e=>{var t;let s=null===(t=e.target.files)||void 0===t?void 0:t[0];if(b(null),!s)return;if(!s.name.endsWith(".csv")){b("Please upload a CSV file.");return}let n=new FileReader;n.onload=q,n.onerror=()=>{b("Error reading the file. Please try again.")},n.readAsText(s)},[q,b]),H=()=>{if(0===e.length){b("No data to submit. Please upload a CSV file first.");return}let s=btoa("aws_account_id,l4,l5,account_owner\n"+e.map(e=>"".concat(e.aws_account_id,",").concat(e.l4,",").concat(e.l5,",").concat(e.account_owner)).join("\n"));T.mutate({csvFile:s},{onSuccess:()=>{k({type:"success",message:"CSV file uploaded and processed successfully. It may take up to 24 hours for the data to be fully loaded and reflected in the system."}),j(!1),t([]),K()},onError:e=>{b("Failed to process CSV file. Please try again."),console.error("Error processing CSV:",e),K()}})},K=(0,r.useCallback)(()=>{C.current&&(C.current.value="")},[]);function Q(e){return{...e,id:e.aws_account_id,isSelected:!1,isSelectable:!1,isVisible:!0,isSelectDisabled:!1}}let $=(0,r.useCallback)(e=>{Y({target:{files:e}})},[Y]),{getRootProps:ee,getInputProps:et,isDragActive:es}=(0,f.uI)({onDrop:$,accept:{"text/csv":[".csv"]}}),en=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"mb-4",children:"Please upload a CSV file with the following format:"}),(0,n.jsxs)("pre",{className:"overflow-x-auto rounded bg-gray-100 p-4",children:["aws_account_id,l4,l5,account_owner",(0,n.jsx)("br",{}),"123456789012,Engineering,ProjectX,John Doe",(0,n.jsx)("br",{}),"987654321098,Marketing,ProjectY,Jane Smith"]}),(0,n.jsx)(o.zx,{styleType:"blue",type:"button",onClick:()=>{let e=new Blob(["aws_account_id,l4,l5,account_owner\n123456789012,Engineering,ProjectX,John Doe\n987654321098,Marketing,ProjectY,Jane Smith\n"],{type:"text/csv"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="sample.csv",s.click(),URL.revokeObjectURL(t)},children:"Download Sample CSV"})]});return(0,r.useEffect)(()=>{if(s)L(e.map(Q));else if(P&&P.length>0){let e=P.map(e=>({tenantId:e.tenantId,aws_account_id:e.accountId,l4:e.l4,l5:e.l5,account_owner:e.accountOwner}));L(e.map(Q))}else L([])},[s,e,P,L]),(0,n.jsxs)("div",{className:"m-8 rounded-xl bg-white 6xl:mx-auto 6xl:w-[1756px]",children:[(0,n.jsxs)("div",{className:"flex flex-row justify-between px-8 py-9",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold",children:"Resource Tagging"}),(0,n.jsxs)("div",{className:"flex space-x-4",children:[(0,n.jsx)(p.S,{to:g.y3.RESOURCE_TAGGING_WRITE,children:(0,n.jsx)(o.zx,{styleType:"purple",type:"button",icon:(0,n.jsx)(o.pO,{className:"size-5 text-white"}),onClick:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.click()},children:"Upload CSV"})}),s&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.zx,{styleType:"green",type:"button",onClick:()=>w(!0),children:"Submit"}),(0,n.jsx)(o.zx,{styleType:"grey",type:"button",onClick:()=>{j(!1),t([]),K()},children:"Cancel Upload"})]})]})]}),(0,n.jsx)(p.S,{to:g.y3.RESOURCE_TAGGING_WRITE,children:(0,n.jsx)("div",{className:"mb-4 px-8",children:(0,n.jsxs)("div",{className:"rounded-md border border-gray-200",children:[(0,n.jsxs)("button",{className:"w-full bg-gray-100 px-4 py-2 text-left font-semibold hover:bg-gray-200 focus:outline-none",onClick:()=>N(!_),children:["CSV File Format ",_?"▲":"▼"]}),_&&(0,n.jsx)("div",{className:"border-t border-gray-200 p-4",children:en})]})})}),(0,n.jsxs)("div",{className:"px-8",children:[S&&(0,n.jsx)(()=>S?(0,n.jsxs)("div",{className:"mb-4 flex items-center justify-between rounded-md p-4 ".concat("success"===S.type?"bg-green-100":"bg-red-100"),children:[(0,n.jsx)("p",{className:"".concat("success"===S.type?"text-green-800":"text-red-800"),children:S.message}),(0,n.jsx)("button",{onClick:()=>k(null),className:"ml-4 text-gray-500 hover:text-gray-700 focus:outline-none",children:(0,n.jsx)(o.b0,{className:"size-5"})})]}):null,{}),y&&(0,n.jsx)(o.bZ,{type:"error",messages:[y],automaticallyClose
1:!0})]}),(0,n.jsx)("div",{className:"flex min-h-0 w-full min-w-full shrink-0 grow",children:O?(0,n.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,n.jsx)(o.aN,{})}):A?(0,n.jsxs)("div",{className:"flex flex-1 items-center justify-center",children:[(0,n.jsx)("p",{children:"Error loading AWS account info. Please try again."}),(0,n.jsx)(o.zx,{styleType:"blue",type:"button",onClick:()=>{z()},children:"Retry"})]}):s||P&&P.length>0?(0,n.jsx)(a.i,{classNameWrapper:"bg-white",columns:[{header:(0,n.jsxs)("div",{className:"flex flex-row items-center gap-x-1",children:["AWS ACCOUNT ID",(0,n.jsx)(c.oz,{onChange:B,onReset:()=>{F("aws_account_id"),B("")},onSearch:()=>I("aws_account_id","aws_account_id",M),value:M,isActive:V("aws_account_id")}),(0,n.jsx)(i.tV,{className:"size-3",direction:D.direction,enabled:"aws_account_id"===D.key,onClick:()=>W({key:"aws_account_id",comparison:u.U.string,firstDirection:"asc"})})]}),property:"aws_account_id"},{header:(0,n.jsxs)("div",{className:"flex flex-row items-center gap-x-1",children:["L4",(0,n.jsx)(c.oz,{onChange:Z,onReset:()=>{F("l4"),Z("")},onSearch:()=>I("l4","l4",X),value:X,isActive:V("l4")}),(0,n.jsx)(i.tV,{className:"size-3",direction:D.direction,enabled:"l4"===D.key,onClick:()=>W({key:"l4",comparison:u.U.string,firstDirection:"asc"})})]}),property:"l4"},{header:"L5",property:"l5"},{header:"ACCOUNT OWNER",property:"account_owner"}],data:G,elementsPerPage:10,isBordered:!0,isLoading:T.isLoading,filteredColumns:U,onRemoveFilter:F}):(0,n.jsxs)("div",{...ee(),className:"m-4 flex flex-1 items-center justify-center rounded-lg border-2 border-dashed border-gray-300 p-8",children:[(0,n.jsx)("input",{...et()}),(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)(m.rG2,{className:"mx-auto mb-4 size-12 text-gray-400"}),(0,n.jsx)("p",{className:"mb-4 text-lg font-semibold",children:"No records found. Please add a record to start"}),es?(0,n.jsx)("p",{children:"Drop the CSV file here ..."}):(0,n.jsx)("p",{children:"Drag 'n' drop a CSV file here, or click to select a file"})]})]})}),(0,n.jsx)("input",{type:"file",accept:".csv",ref:C,className:"hidden",onChange:Y}),v&&(0,n.jsx)(x,{isActive:v,onClickClose:()=>w(!1),onClickConfirm:()=>{w(!1),H()},message:"Are you sure you want to submit? This will replace the existing tags."})]})},y=s(39094),b=s(23072),v=s(83840),w=s(33441),C=(0,b.Z)(function(){return(0,n.jsx)(y.Z,{children:(0,n.jsx)(w.e,{permissions:[g.y3.RESOURCE_TAGGING_READ,g.y3.RESOURCE_TAGGING_WRITE],children:(0,n.jsx)(v.e,{selectedTab:v.v.ResourceTagging,children:(0,n.jsx)(j,{})})})})})}},function(e){e.O(0,[911,8385,8848,580,4622,2766,4328,6033,5730,3537,5636,100,1743,1408,7662,6873,4996,9135,4480,5922,3015,8774,921,6695,3721,4151,9774,2888,179],function(){return e(e.s=37952)}),_N_E=e.O()}]);

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.