1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8748],{15190:function(e,a,r){r.d(a,{p:function(){return i},Z:function(){return I}});var t,i,s=r(52322),l=r(2784),n=r(64266),o=r(62065),d=r(63955),c=r(88883),p=r(30195),m=r(11463),u=r(75986),h=r(95290),v=r(38617);let x=p.z.object({hostname:p.z.string().optional(),ips:p.z.string().optional(),customerId:p.z.string().optional(),manufacturer:p.z.string().min(1),model:p.z.string().min(1),releaseDate:p.z.string().min(1),hardwareId:p.z.boolean().optional(),hostId:p.z.string().min(1).optional(),osBaseType:p.z.object({value:p.z.string(),label:p.z.string()})}),g=[{value:"macos",label:"MacOS"},{value:"windows",label:"Windows"},{value:"linux",label:"Linux"}],b=e=>g.find(a=>a.value===e)||{label:"",value:""};var f=e=>{var a,r,t;let{method:n}=e,{host:p,multiple:f,accept:w,helpMessage:j,value:y}=n,{handleSubmit:F,register:D,control:I,formState:{isValid:C,isDirty:N},setValue:k,reset:T}=(0,d.cI)({resolver:(0,c.F)(x),mode:"onChange",defaultValues:{...function(e){switch(e.value){case i.firmware:return{osBaseType:{value:"cisco",label:"Cisco"}};case i.genericFirmware:return{osBaseType:{value:"linux",label:"Linux"}}}return{}}(n)}}),{resolvedTheme:S}=(0,v.useTheme)(),[z,M]=(0,l.useState)(!1);(0,l.useEffect)(()=>{"dark"===S?M(!0):M(!1)},[S]);let B=null==p?void 0:null===(t=p.assetTab)||void 0===t?void 0:null===(r=t.fields.ips)||void 0===r?void 0:null===(a=r.value)||void 0===a?void 0:a.join(","),E="-"!==B?B:"";(0,l.useEffect)(()=>{if(p){var e,a,r,t;k("hostname",p.hostName),k("ips",E),k("manufacturer",(null===(a=p.assetTab)||void 0===a?void 0:null===(e=a.fields.vendor)||void 0===e?void 0:e.value)||""),k("model",(null===(t=p.assetTab)||void 0===t?void 0:null===(r=t.fields.model)||void 0===r?void 0:r.value)||""),k("customerId",p.customerId||""),k("osBaseType",b((null==p?void 0:p.baseOperatingSystem)||"")),k("hostId",p.id)}},[p]);let U={control:(e,a)=>({...e,backgroundColor:z?"#2d3748":"#f9fafb",borderColor:z?"#4a5568":"#d1d5db",color:z?"white":"#1f2937",fontSize:"0.875rem",borderRadius:"0.5rem",padding:"0.25rem",boxShadow:a.isFocused?"0 0 0 2px #4299e1":"none"}),option:(e,a)=>({...e,backgroundColor:a.isFocused?z?"#2b6cb0":"#bee3f8":a.isSelected?z?"#2c5282":"#4299e1":z?"#2d3748":"white",color:z?"white":"black",padding:"0.625rem"}),menu:e=>({...e,backgroundColor:z?"#2d3748":"white"}),singleValue:e=>({...e,color:z?"white":"#1f2937"})},[Z,O]=(0,l.useState)(null),[L,q]=(0,l.useState)(!1),A=n.value===i.binary||n.value===i.bmcFirmware,R=n.value===i.binary||n.value===i.bmcFirmware,_=n.value!==i.genericFirmware;return(0,s.jsx)("div",{children:(0,s.jsxs)("form",{onSubmit:F(e=>{var a,r;O({...e,...p?{hostId:p.id}:{},releaseDate:new Date(null!==(r=e.releaseDate)&&void 0!==r?r:"").toISOString(),osBaseType:null===(a=e.osBaseType)||void 0===a?void 0:a.value,...e.hardwareId?{hardwareId:e.customerId}:{hardwareId:void 0}})}),children:[(0,s.jsx)(o.Z,{multiple:f,accept:w,helpMessage:j,formData:Z,setValidationFlag:q,method:y,...!p&&{resetForm:T}}),(0,s.jsx)(u.Z,{register:D,tooltip:"The name of the device. Optional.",name:"hostname",label:"Device Name",placeholder:"Enter Device name"}),_&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Z,{register:D,tooltip:"Set of IP addresses of the device. Optional. Use , as separator to specify multiple.",name:"ips",label:"IP Addresses",placeholder:"Enter IP addresses"}),(0,s.jsx)(u.Z,{register:D,tooltip:"Custom name of the device. Optional.",name:"customerId",label:R?"Custom ID":"Custom ID/Hardware ID",placeholder:R?"Enter custom ID":"Enter Custom ID/Hardware ID"})]}),n.value===i.firmware&&(0,s.jsx)(u.Z,{register:D,name:"hardwareId",label:"Use Custom Id as Hardware Id",type:"checkbox",classes:{container:"flex items-center",label:"text-sm font-medium text-gray-900 dark:text-white",input:"w-10 h-4"}}),(0,s.jsx)(u.Z,{register:D,tooltip:"The manufacturer of the device. Required. At least 1 character and less than 100.",name:"manufacturer",label:"Manufacturer *",placeholder:"Enter Manufacturer*"}),(0,s.jsx)(u.Z,{register:D,tooltip:"The model of the device. Required. At least 1 character and less than 100.",name:"model",label:"Model *",placeholder:"Enter Model*"}),(0,s.jsx)(u.Z,{register:D,tooltip:"Release date of the firmware. Required.",name:"releaseDate",label:"Release Date *",type:"date",placeholder:"Choose a Date"}),A?(0,s.jsxs)("label",{htmlFor:"osBaseType",className:"flex mt-2 gap-2 items-center mb-2 text-sm font-medium text-gray-900 dark:text-white",children:["Operating System *"," ",(0,s.jsx)("span",{title:"Operating system of the device. Required.",children:(0,s.jsx)(h.Z,{size:24,xlinkTitle:"Operating system of the device. Required."})})]}):null,A?(0,s.jsx)(d.Qr,{name:"osBaseType",control:I,render:e=>{let{field:a}=e;return(0,s.jsx)(m.ZP,{...a,name:"osBaseType",className:"mt-4",styles:U,placeholder:"Select operating system",options:g})}}):null,(0,s.jsx)("button",{type:"submit",className:"text-white mt-4 bg-eclypsiumUploadButton p-2 disabled:cursor-not-allowed cursor-pointer data-[state=active]:brightness-125 hover:brightness-125",disabled:!C&&N&&!L,children:"Upload"})]})})},w=r(7914),j=r(56683),y=r(43757),F=r(90915);(t=i||(i={})).archive="archive",t.esx="esx",t.binary="binary",t.firmware="firmware",t.bmcFirmware="bmc-firmware",t.genericFirmware="genericFirmware",t.customWhitelistFirmware="firmwareUpload";let D=(e,a,r)=>{let t=[{host:e,name:"Archive",value:"archive",accept:"application/x-tar,a
1pplication/gzip,application/x-gzip,application/x-compressed-tar",helpMessage:(0,s.jsxs)(j.pq,{children:["Drag and drop archive onto this area to upload them or",(0,s.jsx)("p",{className:"text-sky-500 cursor-pointer",children:" add a .tar or .tar.gz archive."})]})},{host:e,name:"ESX File",value:"esx",accept:"application/x-tar,application/gzip,application/x-gzip,application/x-compressed-tar",helpMessage:(0,s.jsxs)(j.pq,{children:["Drag and drop archive onto this area to upload them or",(0,s.jsx)("p",{className:"text-sky-500 cursor-pointer",children:" add a .tar or .tar.gz archive."})]})},{host:e,name:"Binary",value:"binary",multiple:!1,accept:"application/octet-stream,application/macbinary",helpMessage:(0,s.jsxs)(j.pq,{children:["Drag and drop SPI image onto this area to upload it or",(0,s.jsx)("p",{className:"text-sky-500 cursor-pointer",children:" add a .bin file."})]})},{host:e,name:"Device Firmware",value:"firmware",multiple:!1,accept:"application/octet-stream,application/macbinary",helpMessage:(0,s.jsxs)(j.pq,{children:["Drag and drop Device Firmware (or CISCO IOS) image onto this area to upload it or",(0,s.jsx)("p",{className:"text-sky-500 cursor-pointer",children:" add a .bin file."})]})}];return(a||r)&&t.push({host:e,name:"BMC Firmware",value:"bmc-firmware",multiple:!1,accept:"application/octet-stream,application/macbinary",helpMessage:(0,s.jsxs)(j.pq,{children:["Drag and drop BMC image onto this area to upload it or",(0,s.jsx)("p",{className:"text-sky-500 cursor-pointer",children:" add a .bin file."})]})},{host:e,name:"Linux Embedded Image",value:"genericFirmware",multiple:!1,accept:"application/octet-stream,application/macbinary",helpMessage:(0,s.jsxs)(j.pq,{children:["Drag and drop Linux Embedded image onto this area to upload it or",(0,s.jsx)("p",{className:"text-sky-500 cursor-pointer",children:" add a .bin file."})]})}),t};var I=e=>{let{fullHostData:a}=e,r=D(a,(0,y.X)(F.T.BMC_UPLOADS_ENABLED),(0,y.X)(F.T.EMBA_ENABLED)).filter(e=>null==a||!a.id||"firmware"!==e.value),t=["binary","firmware","bmc-firmware","genericFirmware"],i=null;return a&&(i={hostId:a.id,manufacturer:"",osBaseType:"",model:"",releaseDate:""}),(0,s.jsx)(w.Z,{defaultValue:"archive",triggers:r,children:e=>r.map(a=>(0,s.jsx)(n.VY,{forceMount:!0,hidden:a.value!==e,className:"bg-white dark:bg-eclypsiumgray outline-none pr-4 pl-4 pb-4",value:a.value,children:t.filter(e=>e===a.value).length?(0,s.jsx)(f,{method:a}):(0,s.jsx)(o.Z,{multiple:a.multiple,accept:a.accept,helpMessage:a.helpMessage,formData:i,setValidationFlag:void 0,method:a.value})},a.name))})}},62065:function(e,a,r){var t=r(52322);r(2784);var i=r(11535),s=r(48615),l=r(73806),n=r(28888),o=r(81193),d=r(15190);let c=e=>{switch(e){case d.p.binary:return{firmwareType:"spi"};case d.p.bmcFirmware:return{firmwareType:"bmc"};case d.p.genericFirmware:return{firmwareType:"generic"};case d.p.firmware:return{independenceLevel:"extension",brand:"cisco",deviceType:"router"};default:return{}}};a.Z=e=>{let{multiple:a=!0,helpMessage:r,accept:p,formData:m,setValidationFlag:u,method:h,resetForm:v}=e,x=c(h),{inputRef:g,uploads:b,handleChange:f,handleClick:w,handleDragLeave:j,handleDragOver:y,handleDrop:F,cancelAllUploads:D,clearAllUploads:I,updateUploadById:C,isUploading:N}=(0,s.j)({accept:p,multiple:a,formData:m,setValidationFlag:u,extraFormData:x,method:h,resetForm:v});return(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsx)("div",{children:!a&&b.length?(0,t.jsx)("div",{className:"text-center mb-2",children:b[0].file.name}):(0,t.jsx)(t.Fragment,{})}),(0,t.jsx)("div",{className:"mb-4 text-center",onClick:w,children:r}),(0,t.jsx)(o.r,{tooltipText:(e=>{switch(e){case d.p.firmware:return"Upload firmware";case d.p.binary:return"Upload binary";case d.p.esx:return"Upload ESX";case d.p.archive:return"Upload file";case d.p.bmcFirmware:return"Upload BMC binary";case d.p.genericFirmware:return"Upload Linux Embedded image binary";default:return"Upload"}})(h),children:(0,t.jsxs)("div",{onDragOver:y,onDragLeave:j,onDrop:F,onClick:w,className:"w-full text-center p-8 border-dashed border-2 cursor-pointer",children:[(0,t.jsx)("input",{accept:p,type:"file",multiple:a,style:{display:"none"},onChange:f,ref:g}),(0,t.jsx)("div",{className:"flex items-center justify-center",children:(0,t.jsx)(n.le,{name:"upload",className:"h-20 w-20 ",pathFill:"#f7931e"})})]})}),(0,t.jsx)("hr",{className:"bg-gray w-100 mt-8"}),b.length>0?(0,t.jsx)("div",{children:b.map(e=>!e||e&&e.isHidden?(0,t.jsx)(t.Fragment,{}):(0,t.jsxs)("div",{className:"flex flex-row justify-between p-2 items-center bg-eclypsiumgray-veryLight dark:bg-eclypsiumgray-dark my-2 ",children:[(0,t.jsx)("div",{className:"w-80 pr-2 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,t.jsx)("span",{children:e.file.name})}),100===e.progress&&e.uploadedAt?(0,t.jsxs)("div",{children:["Uploaded on ",new Date(e.uploadedAt).toLocaleDateString(void 0,{})]}):(0,t.jsx)(t.Fragment,{children:e.errorMessage?(0,t.jsx)("div",{className:"w-full text-red-700 font-bold",children:e.errorMessage}):(0,t.jsx)(l.Z,{status:e.status})}),(0,t.jsx)(i.FB,{className:"cursor-pointer ml-2 mr-2 min-w-[50px]",size:36,onClick:()=>C(e.id,"isHidden",!0)})]},e.id))}):(0,t.jsx)(t.Fragment,{}),b.filter(e=>!e.isHidden).length?(0,t.jsxs)("div",{className:"mt-2 flex flex-row-reverse gap-3",children:[(0,t.jsx)("button",{className:"bg-[#b91c1c] text-white p-2 data-[state=active]:brightness-125 hover:brightness-125 disabled:hover:brightness-50",onClick:D,disabled:!N,children:a?"Cancel All Uploads":"Cancel Upload"}),(0,t.jsx)("button",{onClick:I,className:"text-white bg-[#117b8e] p-2 data-[state=active]:brightness-125 hover:brightness-125",children:a?" Clear Finished Uploads":"Clear"})]}):(0,t.jsx)(t.Fragment,{})]})}}}]);
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.