(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[490],{329:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/config",function(){return t(6256)}])},157:function(e,n,t){"use strict";var r=t(5893),o=t(7357),i=t(8262),c=t(7294),l=t(7169),a=t(4825),u=t(4690),s=t(3679),d=t(2152),f=t(7750);function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function b(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"===typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v={blue:l.Ej,red:l.hM},g=(0,c.forwardRef)((function(e,n){var t=e.actionCancelText,p=void 0===t?"Cancel":t,h=e.actionProceedText,g=e.contentContainerProps,x=void 0===g?{}:g,j=e.closeOnProceed,w=void 0!==j&&j,P=e.content,O=e.dialogProps,A=void 0===O?{}:O,Z=A.open,S=void 0!==Z&&Z,k=A.PaperProps,I=void 0===k?{}:k,C=e.disableProceed,T=e.formContent,E=e.loading,M=void 0!==E&&E,D=e.loadingAction,F=void 0!==D&&D,U=e.onActionAppend,R=e.onCancelAppend,N=e.onProceedAppend,B=e.onSubmitAppend,L=e.openInitially,_=void 0!==L&&L,H=e.preActionArea,V=e.proceedButtonProps,$=void 0===V?{}:V,G=e.proceedColour,W=void 0===G?"blue":G,q=e.scrollContent,z=void 0!==q&&q,K=e.scrollBoxProps,X=(void 0===K?{}:K).sx,J=e.titleText,Y=y(e.dialogProps,["open","PaperProps"]),Q=y(e.scrollBoxProps,["sx"]),ee=I.sx,ne=y(I,["sx"]),te=$.disabled,re=void 0===te?C:te,oe=$.sx,ie=y($,["disabled","sx"]),ce=(0,c.useState)(_),le=ce[0],ae=ce[1],ue=(0,c.useMemo)((function(){return n?le:S}),[S,le,n]),se=(0,c.useMemo)((function(){return v[W]}),[W]),de=(0,c.useMemo)((function(){var e,n,t,r=function(){for(var e=arguments.length,n=new Array(e),t=0;t1?n-1:0),r=1;r=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}n.Z=function(e){var n=e.children,t=e.sx,a=s(e,["children","sx"]);return(0,r.jsx)(i.Z,u({underline:"hover",variant:"subtitle1"},a,{sx:u({color:c.lD,textDecorationColor:c.s7},t),children:(0,r.jsxs)(l.Z,{row:!0,children:[n,(0,r.jsx)(o.Z,{sx:{marginLeft:".3em"}})]})}))}},6632:function(e,n,t){"use strict";var r=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}n.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.actionProceedText,t=void 0===n?"":n,o=e.content,l=void 0===o?"":o,a=e.titleText,u=void 0===a?"":a,s=c(e,["actionProceedText","content","titleText"]);return(0,r.useState)(i({actionProceedText:t,content:l,titleText:u},s))}},3106:function(e,n){"use strict";n.Z={bcn:"Back-Channel Network",ifn:"Internet-Facing Network",mn:"Migration Network",sn:"Storage Network"}},6256:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return sn}});var r=t(5893),o=t(6886),i=t(9008),c=t(7294),l=t(2029),a=t(157),u=t(5521),s=t(1905),d=t(3106),f=t(4188),p=t(4390);function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t3&&void 0!==arguments[3]?arguments[3]:e,o=function(t){var r;null===(r=n.current.setMessage)||void 0===r||r.call(null,e,t)};return t&&(t[r]=o),o},b=function(e,n){var t,r,o={};return t=e,o=(null!=(r=Array)&&"undefined"!==typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](t):t instanceof r)?e.reduce((function(e,t){return y(t,n,e),e}),o):Object.entries(e).reduce((function(e,t){var r=m(t,2),o=r[0],i=r[1];return y(i,n,e,o),e}),o)},v=t(4894),g=t(6607),x=t(480),j=t(2349),w=t(7750);function P(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function O(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(g({actionProceedText:"Delete",content:"The peer relationship between this striker and the selected ".concat(t," host(s) will terminate. The removed peer(s) can be re-added later."),onProceedAppend:function(){p.Z.delete("/host/connection",{data:n}).catch((function(e){var n=(0,k.Z)(e);n.children="Failed to delete peer connection(s). ".concat(n.children),y(n)}))},proceedColour:"red",titleText:"Delete ".concat(t," peer(s) from this striker?")}),null===(e=f.current.setOpen)||void 0===e||e.call(null,!0))},onEdit:function(){S((function(e){return!e}))},onItemCheckboxChange:function(e,n,t){C[e].isChecked=t,T((function(e){return oe({},e)}))},renderListItem:function(e,n){var t=n.isPingTest,o=void 0!==t&&t;return(0,r.jsx)(Z.Z,{row:!0,spacing:0,children:(0,r.jsxs)(Z.Z,{spacing:0,children:[(0,r.jsx)(w.$_,{children:e}),(0,r.jsx)(ne,{label:"Ping",state:o})]})})}})}),E]})}),(0,r.jsx)(G,{ref:u}),(0,r.jsx)(a.Z,oe({closeOnProceed:!0},v,{ref:f}))]})},le=t(582),ae=t(5741);function ue(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t1}),[v]),S=(0,s.Z)("".concat(l.Z,"/ssh-key/conflict"),{onError:function(e){y({children:"Failed to fetch SSH key conflicts. Error: ".concat(e),type:"error"})},onSuccess:function(e){g((function(n){return Object.values(e).reduce((function(e,t){return Object.values(t).forEach((function(t){var r=t.hostName,o=t.hostUUID,i=t.ipAddress,c=t.stateUUID;e[c]=de({},n[c],{hostName:r,hostUUID:o,ipAddress:i})})),e}),{})}))},refreshInterval:i}).isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(z.TZ,{header:"Manage changed SSH keys",loading:S,children:[(0,r.jsxs)(Z.Z,{spacing:".2em",children:[(0,r.jsx)(w.Ac,{children:"The identity of the following targets have unexpectedly changed."}),(0,r.jsxs)(q.Z,{type:"warning",isAllowClose:!0,children:["If you haven't rebuilt the listed targets, then you could be experiencing a"," ",(0,r.jsx)(ae.Z,{href:t,sx:{display:"inline-flex"},target:"_blank",children:'"Man In The Middle"'})," ","attack. Please verify the targets have changed for a known reason before proceeding to remove the broken keys."]}),(0,r.jsx)(W.Z,{header:(0,r.jsxs)(Z.Z,{row:!0,spacing:".3em",sx:{width:"100%","& > :not(:last-child)":{display:{xs:"none",sm:"flex"}},"& > :last-child":{display:{xs:"initial",sm:"none"},marginLeft:0}},children:[(0,r.jsxs)(Z.Z,{row:!0,spacing:".3em",sx:{flexBasis:"calc(50% + 1em)"},children:[(0,r.jsx)(w.Ac,{children:"Host name"}),(0,r.jsx)(le.Z,{sx:{flexGrow:1}})]}),(0,r.jsxs)(Z.Z,{row:!0,spacing:".3em",sx:{flexGrow:1},children:[(0,r.jsx)(w.Ac,{children:"IP address"}),(0,r.jsx)(le.Z,{sx:{flexGrow:1}})]}),(0,r.jsx)(le.Z,{sx:{flexGrow:1}})]}),allowCheckAll:A,allowCheckItem:!0,allowDelete:!0,allowEdit:!1,edit:!0,listEmpty:(0,r.jsx)(w.Ac,{align:"center",children:"No conflicting keys found."}),listItems:v,onAllCheckboxChange:function(e,n){Object.keys(v).forEach((function(e){v[e].isChecked=n})),g((function(e){return de({},e)}))},onDelete:function(){var e,n=0,t=Object.entries(v).reduce((function(e,t){var r=fe(t,2),o=r[0],i=r[1],c=i.hostUUID;return i.isChecked&&(e[c]||(e[c]=[]),e[c].push(o),n+=1),e}),{});P({actionProceedText:"Delete",content:"Resolve ".concat(n," SSH key conflicts. Please make sure the identity change(s) are expected to avoid MITM attacks."),onProceedAppend:function(){p.Z.delete("/ssh-key/conflict",{data:t}).catch((function(e){var n=(0,k.Z)(e);n.children="Failed to delete selected SSH key conflicts. ".concat(n.children),y(n)}))},proceedColour:"red",titleText:"Delete ".concat(n," conflicting SSH keys?")}),null===(e=d.current.setOpen)||void 0===e||e.call(null,!0)},onItemCheckboxChange:function(e,n,t){var r;v[e].isChecked=t,null===(r=f.current.setCheckAll)||void 0===r||r.call(null,Object.values(v).every((function(e){return e.isChecked}))),g((function(e){return de({},e)}))},renderListItem:function(e,n){var t=n.hostName,o=n.ipAddress;return(0,r.jsxs)(Z.Z,{spacing:0,sm:"row",sx:{width:"100%","& > *":{flexBasis:"50%"}},xs:"column",children:[(0,r.jsx)(w.Ac,{children:t}),(0,r.jsx)(w.Ac,{children:o})]})},renderListItemCheckboxState:function(e,n){return!0===n.isChecked},ref:f})]}),O]}),(0,r.jsx)(a.Z,de({closeOnProceed:!0},j,{ref:d}))]})};function he(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function me(e){for(var n=1;n0),l(ye,t===(null===(n=y.current.getValue)||void 0===n?void 0:n.call(null)))},onFirstRender:o(ve),ref:m,required:p})},"common-user-input-cell-confirm-password":{children:(0,r.jsx)(I.Z,{input:(0,r.jsx)(T.Z,{id:ye,inputProps:{readOnly:!v},label:"Confirm password",type:f.Z.password}),inputTestBatch:{defaults:{onSuccess:function(){i(ye)}},onFinishBatch:t(ye),tests:[{test:E.HJ},{onFailure:function(){i(ye,{children:"The passwords do not match."})},test:function(e){var n;return e.value===(null===(n=m.current.getValue)||void 0===n?void 0:n.call(null))}}]},onFirstRender:o(ye),ref:y,required:v})}}:void 0}),[t,o,v,p,i,l,h]);return(0,r.jsx)(S.Z,{columns:{xs:1,sm:2,md:3},layout:me({"common-user-input-cell-name":{children:(0,r.jsx)(I.Z,{input:(0,r.jsx)(T.Z,{id:be,inputProps:{readOnly:s},label:ge,value:u}),inputTestBatch:(0,E.Gn)(ge,(function(){i(be)}),{onFinishBatch:t(be)},(function(e){i(be,{children:e})})),onFirstRender:o(be),required:!0}),md:1,sm:2}},x),spacing:"1em"})},we=t(2545),Pe=t(7212),Oe=t(8462),Ae=t(8216);function Ze(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0}),[o.length]),l=(0,c.useCallback)((function(e){var t=e.confirmDialogProps,i=void 0===t?{}:t,c=e.formSummaryProps,l=void 0===c?{}:c,a=e.getConfirmDialogTitle;return De({actionProceedText:"Delete",content:(0,r.jsx)(Ee,De({entries:n,maxDepth:0},l)),proceedColour:"red",titleText:a(o.length)},i)}),[n,o.length]),a=(0,c.useCallback)((function(e){return n[e]}),[n]),u=(0,c.useCallback)((function(e,n){return t((0,g.ZP)(e,n||void 0))}),[]);return{buildDeleteDialogProps:l,checklist:n,checks:o,getCheck:a,hasChecks:i,setCheck:u}},Ue=t(6632),Re=t(8859);function Ne(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function ln(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],c=!0,l=!1;try{for(t=t.call(e);!(c=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);c=!0);}catch(a){l=!0,o=a}finally{try{c||null==t.return||t.return()}finally{if(l)throw o}}return i}}(e,n)||un(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function an(e){return function(e){if(Array.isArray(e))return tn(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||un(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function un(e,n){if(e){if("string"===typeof e)return tn(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?tn(e,n):void 0}}var sn=function(e){var n=e.refreshInterval,t=void 0===n?6e4:n,d=(0,M.Z)().protect,f=(0,c.useState)(!1),p=f[0],h=f[1],m=(0,c.useState)({actionProceedText:"",closeOnProceed:!0,content:"",dialogProps:{open:p},onCancelAppend:function(){h(!1)},onProceedAppend:function(){h(!1)},titleText:""}),y=m[0],b=m[1],v=ln((0,D.Z)(void 0,d),2),g=v[0],x=v[1],j=ln((0,D.Z)("",d),2),w=j[0],P=j[1],O=(0,s.Z)("".concat(l.Z,"/host/local"),{onError:function(){P("Unknown")},onSuccess:function(e){var n=e.installTarget,t=e.shortHostName;x(n),P(t)},refreshInterval:t}),A=O.data,Z=O.isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{children:(0,r.jsx)("title",{children:Z?"Loading...":"".concat(null===A||void 0===A?void 0:A.shortHostName," Config")})}),(0,r.jsx)(u.Z,{}),(0,r.jsxs)(o.ZP,{container:!0,columns:{xs:1,md:3,lg:4},children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(nn,{installTarget:g,onSubmit:function(e){var n=e.onProceedAppend,t=cn(e,["onProceedAppend"]);b((function(e){return on({},e,t,{onProceedAppend:function(){for(var e=arguments.length,t=new Array(e),r=0;r