(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(6028)}])},5741:function(e,n,t){"use strict";var r=t(5893),o=t(1714),i=t(122),c=t(7169),l=t(4690);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(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(e){var n=e.children,t=e.sx,a=u(e,["children","sx"]);return(0,r.jsx)(i.Z,s({underline:"hover",variant:"subtitle1"},a,{sx:s({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"}})]})}))}},3106:function(e,n){"use strict";n.Z={bcn:"Back-Channel Network",ifn:"Internet-Facing Network",mn:"Migration Network",sn:"Storage Network"}},6028:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Ke}});var r=t(5893),o=t(8263),i=t(9008),c=t(7294),l=t(2029),a=t(157),s=t(8750),u=t(1905),d=t(3106),f=t(4188),h=t(4390);function p(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(6607),g=t(480),x=t(2349),j=t(7750);function w(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function P(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(){h.Z.delete("/host/connection",{data:n}).catch((function(e){var n=(0,S.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(){k((function(e){return!e}))},onItemCheckboxChange:function(e,n,t){T[e].isChecked=t,C((function(e){return ne({},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)(j.$_,{children:e}),(0,r.jsx)(J,{label:"Ping",state:o})]})})}})}),E]})}),(0,r.jsx)(B,{ref:s}),(0,r.jsx)(a.Z,ne({closeOnProceed:!0},v,{ref:f}))]})},oe=t(582),ie=t(5741),ce=t(3906);function le(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t1}),[y]),F=(0,u.Z)("".concat(l.Z,"/ssh-key/conflict"),{onError:function(e){p({children:"Failed to fetch SSH key conflicts. Error: ".concat(e),type:"error"})},onSuccess:function(e){b((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]=se({},n[c],{hostName:r,hostUUID:o,ipAddress:i})})),e}),{})}))},refreshInterval:i}).isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(G.TZ,{header:"Manage changed SSH keys",loading:F,children:[(0,r.jsxs)(Z.Z,{spacing:".2em",children:[(0,r.jsx)(j.Ac,{children:"The identity of the following targets have unexpectedly changed."}),(0,r.jsxs)(V.Z,{type:"warning",isAllowClose:!0,children:["If you haven't rebuilt the listed targets, then you could be experiencing a"," ",(0,r.jsx)(ie.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)(H.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)(j.Ac,{children:"Host name"}),(0,r.jsx)(oe.Z,{sx:{flexGrow:1}})]}),(0,r.jsxs)(Z.Z,{row:!0,spacing:".3em",sx:{flexGrow:1},children:[(0,r.jsx)(j.Ac,{children:"IP address"}),(0,r.jsx)(oe.Z,{sx:{flexGrow:1}})]}),(0,r.jsx)(oe.Z,{sx:{flexGrow:1}})]}),allowCheckAll:E,allowCheckItem:!0,allowDelete:!0,allowEdit:!1,disableDelete:!k,edit:!0,getListCheckboxProps:function(){return{checked:O}},listEmpty:(0,r.jsx)(j.Ac,{align:"center",children:"No conflicting keys found."}),listItems:y,onAllCheckboxChange:function(e,n){I(n)},onDelete:function(){var e,n=P.reduce((function(e,n){if(!A(n))return e;var t=y[n].hostUUID;return e[t]||(e[t]=[]),e[t].push(n),e}),{});x({actionProceedText:"Delete",content:"Resolve ".concat(P.length," SSH key conflicts. Please make sure the identity change(s) are expected to avoid MITM attacks."),onProceedAppend:function(){h.Z.delete("/ssh-key/conflict",{data:n}).catch((function(e){var n=(0,S.Z)(e);n.children="Failed to delete selected SSH key conflicts. ".concat(n.children),p(n)}))},proceedColour:"red",titleText:"Delete ".concat(P.length," conflicting SSH keys?")}),null===(e=s.current.setOpen)||void 0===e||e.call(null,!0)},onItemCheckboxChange:function(e,n,t){T(e,t)},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)(j.Ac,{children:t}),(0,r.jsx)(j.Ac,{children:o})]})},renderListItemCheckboxState:function(e){return A(e)}})]}),C]}),(0,r.jsx)(a.Z,se({closeOnProceed:!0},g,{ref:s}))]})};function fe(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function he(e){for(var n=1;n0),l(pe,t===(null===(n=y.current.getValue)||void 0===n?void 0:n.call(null)))},onFirstRender:o(ye),ref:m,required:h})},"common-user-input-cell-confirm-password":{children:(0,r.jsx)(I.Z,{input:(0,r.jsx)(C.Z,{id:pe,inputProps:{readOnly:!v},label:"Confirm password",type:f.Z.password}),inputTestBatch:{defaults:{onSuccess:function(){i(pe)}},onFinishBatch:t(pe),tests:[{test:E.HJ},{onFailure:function(){i(pe,{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(pe),ref:y,required:v})}}:void 0}),[t,o,v,h,i,l,p]);return(0,r.jsx)(O.Z,{columns:{xs:1,sm:2,md:3},layout:he({"common-user-input-cell-name":{children:(0,r.jsx)(I.Z,{input:(0,r.jsx)(C.Z,{id:me,inputProps:{readOnly:u},label:be,value:s}),inputTestBatch:(0,E.Gn)(be,(function(){i(me)}),{onFinishBatch:t(me)},(function(e){i(me,{children:e})})),onFirstRender:o(me),required:!0}),md:1,sm:2}},x),spacing:"1em"})},xe=t(2545),je=t(8610),we=t(6632),Pe=t(8859);function Ae(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 qe(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)||We(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 ze(e){return function(e){if(Array.isArray(e))return He(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||We(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 We(e,n){if(e){if("string"===typeof e)return He(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)?He(e,n):void 0}}var Ke=function(e){var n=e.refreshInterval,t=void 0===n?6e4:n,d=(0,Y.Z)().protect,f=(0,c.useState)(!1),h=f[0],p=f[1],m=(0,c.useState)({actionProceedText:"",closeOnProceed:!0,content:"",dialogProps:{open:h},onCancelAppend:function(){p(!1)},onProceedAppend:function(){p(!1)},titleText:""}),y=m[0],b=m[1],v=qe((0,M.Z)(void 0,d),2),g=v[0],x=v[1],j=qe((0,M.Z)("",d),2),w=j[0],P=j[1],A=(0,u.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}),Z=A.data,O=A.isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{children:(0,r.jsx)("title",{children:O?"Loading...":"".concat(null===Z||void 0===Z?void 0:Z.shortHostName," Config")})}),(0,r.jsx)(s.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)(Be,{installTarget:g,onSubmit:function(e){var n=e.onProceedAppend,t=$e(e,["onProceedAppend"]);b((function(e){return Ge({},e,t,{onProceedAppend:function(){for(var e=arguments.length,t=new Array(e),r=0;r