diff --git a/striker-ui/out/_next/static/7XDPxYo6bqsS6Slu5OONN/_buildManifest.js b/striker-ui/out/_next/static/8B2qFvgX8u8D8ZWgE33V8/_buildManifest.js similarity index 74% rename from striker-ui/out/_next/static/7XDPxYo6bqsS6Slu5OONN/_buildManifest.js rename to striker-ui/out/_next/static/8B2qFvgX8u8D8ZWgE33V8/_buildManifest.js index f5ab6e26..6a4247c4 100644 --- a/striker-ui/out/_next/static/7XDPxYo6bqsS6Slu5OONN/_buildManifest.js +++ b/striker-ui/out/_next/static/8B2qFvgX8u8D8ZWgE33V8/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,c,a,e,t,n,i,f,d,u,b,k,h,j,r,g){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,e,i,f,k,"static/chunks/717-8bd60b96d67fd464.js",c,t,n,d,h,j,"static/chunks/pages/index-1f8f0ad3b3894dbc.js"],"/_error":["static/chunks/pages/_error-2280fa386d040b66.js"],"/anvil":[s,a,e,i,f,k,c,t,n,d,h,"static/chunks/pages/anvil-c1177b17efcafc34.js"],"/config":[s,a,e,u,c,t,n,b,"static/chunks/pages/config-0ecdb2b2b3f8c089.js"],"/file-manager":[s,a,e,i,"static/chunks/768-9ee3dcb62beecb53.js",c,t,"static/chunks/pages/file-manager-1a707639a4834587.js"],"/init":[s,a,i,f,u,r,c,t,n,d,g,"static/chunks/pages/init-ae1befa8975f7914.js"],"/login":[s,a,e,c,t,n,b,"static/chunks/pages/login-b5de0cd2f49998d6.js"],"/manage-element":[s,a,e,i,f,u,r,"static/chunks/195-d5fd184cc249f755.js",c,t,n,d,b,g,"static/chunks/pages/manage-element-2b1d8792c2a5bf47.js"],"/server":[s,e,"static/chunks/227-a3756585a7ef09ae.js",c,j,"static/chunks/pages/server-db52258419acacf3.js"],sortedPages:["/","/_app","/_error","/anvil","/config","/file-manager","/init","/login","/manage-element","/server"]}}("static/chunks/382-f51344f6f9208507.js","static/chunks/62-532ed713980da8db.js","static/chunks/483-f8013e38dca1620d.js","static/chunks/894-e57948de523bcf96.js","static/chunks/780-e8b3396d257460a4.js","static/chunks/899-83e9de2a35c6bcf0.js","static/chunks/182-08683bbe95fbb010.js","static/chunks/614-0ce04fd295045ffe.js","static/chunks/140-ec935fb15330b98a.js","static/chunks/644-c7c6e21c71345aed.js","static/chunks/903-dc2a40be612a10c3.js","static/chunks/485-77798bccc4308d0e.js","static/chunks/825-d34974d169ea09cc.js","static/chunks/94-db0af749b6e45543.js","static/chunks/676-6159ce853338cc1f.js","static/chunks/692-59a4ae2829590f4c.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,c,a,e,t,n,i,f,d,b,u,k,h,j,r,g){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,e,i,f,k,"static/chunks/717-8bd60b96d67fd464.js",c,t,n,d,h,j,"static/chunks/pages/index-1f8f0ad3b3894dbc.js"],"/_error":["static/chunks/pages/_error-2280fa386d040b66.js"],"/anvil":[s,a,e,i,f,k,c,t,n,d,h,"static/chunks/pages/anvil-c1177b17efcafc34.js"],"/config":[s,a,e,b,c,t,n,u,"static/chunks/pages/config-0ecdb2b2b3f8c089.js"],"/file-manager":[s,a,e,i,"static/chunks/768-9ee3dcb62beecb53.js",c,t,"static/chunks/pages/file-manager-1a707639a4834587.js"],"/init":[s,a,i,f,b,r,c,t,n,d,g,"static/chunks/pages/init-7428606d331bc1dd.js"],"/login":[s,a,e,c,t,n,u,"static/chunks/pages/login-b5de0cd2f49998d6.js"],"/manage-element":[s,a,e,i,f,b,r,"static/chunks/195-d5fd184cc249f755.js",c,t,n,d,u,g,"static/chunks/pages/manage-element-2b1d8792c2a5bf47.js"],"/server":[s,e,"static/chunks/227-a3756585a7ef09ae.js",c,j,"static/chunks/pages/server-db52258419acacf3.js"],sortedPages:["/","/_app","/_error","/anvil","/config","/file-manager","/init","/login","/manage-element","/server"]}}("static/chunks/382-f51344f6f9208507.js","static/chunks/62-532ed713980da8db.js","static/chunks/483-f8013e38dca1620d.js","static/chunks/894-e57948de523bcf96.js","static/chunks/780-e8b3396d257460a4.js","static/chunks/899-83e9de2a35c6bcf0.js","static/chunks/182-08683bbe95fbb010.js","static/chunks/614-0ce04fd295045ffe.js","static/chunks/140-ec935fb15330b98a.js","static/chunks/644-c7c6e21c71345aed.js","static/chunks/903-dc2a40be612a10c3.js","static/chunks/485-77798bccc4308d0e.js","static/chunks/825-d34974d169ea09cc.js","static/chunks/94-db0af749b6e45543.js","static/chunks/676-6159ce853338cc1f.js","static/chunks/692-64941f28ab144919.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/striker-ui/out/_next/static/7XDPxYo6bqsS6Slu5OONN/_middlewareManifest.js b/striker-ui/out/_next/static/8B2qFvgX8u8D8ZWgE33V8/_middlewareManifest.js similarity index 100% rename from striker-ui/out/_next/static/7XDPxYo6bqsS6Slu5OONN/_middlewareManifest.js rename to striker-ui/out/_next/static/8B2qFvgX8u8D8ZWgE33V8/_middlewareManifest.js diff --git a/striker-ui/out/_next/static/7XDPxYo6bqsS6Slu5OONN/_ssgManifest.js b/striker-ui/out/_next/static/8B2qFvgX8u8D8ZWgE33V8/_ssgManifest.js similarity index 100% rename from striker-ui/out/_next/static/7XDPxYo6bqsS6Slu5OONN/_ssgManifest.js rename to striker-ui/out/_next/static/8B2qFvgX8u8D8ZWgE33V8/_ssgManifest.js diff --git a/striker-ui/out/_next/static/chunks/692-59a4ae2829590f4c.js b/striker-ui/out/_next/static/chunks/692-59a4ae2829590f4c.js deleted file mode 100644 index 51f20d62..00000000 --- a/striker-ui/out/_next/static/chunks/692-59a4ae2829590f4c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[692],{1939:function(e,n,t){var r=t(5893),o=t(7357),i=t(7169);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 u(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}var l="Decorator",s={ok:"".concat(l,"-ok"),warning:"".concat(l,"-warning"),error:"".concat(l,"-error"),off:"".concat(l,"-off")};n.Z=function(e){var n,t=e.colour,l=e.sx,f=c(e,["colour","sx"]);return(0,r.jsx)(o.Z,u({},f,{className:s[t],sx:u((n={borderRadius:i.n_,height:"100%",width:"1.4em"},a(n,"&.".concat(s.ok),{backgroundColor:i.Ej}),a(n,"&.".concat(s.warning),{backgroundColor:i.Wd}),a(n,"&.".concat(s.error),{backgroundColor:i.hM}),a(n,"&.".concat(s.off),{backgroundColor:i.s7}),n),l)}))}},5741:function(e,n,t){var r=t(5893),o=t(1714),i=t(122),a=t(7169),u=t(4690);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(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,c=s(e,["children","sx"]);return(0,r.jsx)(i.Z,l({underline:"hover",variant:"subtitle1"},c,{sx:l({color:a.lD,textDecorationColor:a.s7},t),children:(0,r.jsxs)(u.Z,{row:!0,children:[n,(0,r.jsx)(o.Z,{sx:{marginLeft:".3em"}})]})}))}},8461:function(e,n,t){t.d(n,{Z:function(){return fe}});var r=t(5893),o=t(7357),i=t(2734),a=t(8396),u=t(6239),c=t(9699),l=t(2026),s=t(5537),f=t(2428),d=t(2275),p=t(3490),v=t(8951),m=t(7294),b=t(5934),g=t(2029),y=t(7169),h=t(3106),w=t(1250),x=t(4390),k=t(4799),I=t(1939),j=t(7750);function C(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;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}var U=function(e){var n=e.isFloating,t=e.networkInterface,i=t.networkInterfaceName,a=t.networkInterfaceState,u=e.onClose,c=e.sx,l=M(e,["isFloating","networkInterface","onClose","sx"]),f=n?{borderColor:y.s7,borderRadius:y.n_,borderStyle:"solid",borderWidth:"1px",backgroundColor:y.E5,padding:".6em 1.2em"}:{};return(0,r.jsxs)(o.Z,O({sx:O({display:"flex",flexDirection:"row","& > :not(:first-child)":{alignSelf:"center",marginLeft:".5em"}},f,c)},l,{children:[(0,r.jsx)(I.Z,{colour:"up"===a?"ok":"off",sx:{height:"auto"}}),(0,r.jsx)(j.Ac,{text:i}),u&&(0,r.jsx)(k.Z,{onClick:u,size:"small",sx:{color:y.s7},children:(0,r.jsx)(s.Z,{})})]}))};U.defaultProps={isFloating:!1,onClose:void 0};var Z=U,D=(0,t(1496).ZP)(o.Z)((function(){return{borderColor:y.s7,borderStyle:"dashed",borderWidth:"4px",display:"flex",flexDirection:"column",padding:".6em","& > :not(:first-child)":{marginTop:".3em"}}})),S=t(4690),P=t(1770),A=t(1706),N=t(9099),R=t(7869),E=t(6284),T=t(3679),F=t(1905),L=t(7783),V=t(2152),H=function(e){for(var n=0,t=0;te.length)&&(n=e.length);for(var t=0,r=new Array(n);t :not(:first-child)":{marginLeft:".5em"}},children:[(0,r.jsx)(I.Z,{colour:"up"===t?"ok":"off",sx:{height:"auto"}}),(0,r.jsx)(j.KI,{text:i})]})},sortComparator:function(e,n){return H(e)-H(n)}},{field:"networkInterfaceMACAddress",flex:1,headerName:"MAC",renderCell:function(e){var n=e.value;return(0,r.jsx)(j.$_,{text:n})}},{field:"networkInterfaceState",flex:1,headerName:"State",renderCell:function(e){var n=e.value,t=String(n);return(0,r.jsx)(j.KI,{text:"".concat(t.charAt(0).toUpperCase()).concat(t.substring(1))})}},{field:"networkInterfaceSpeed",flex:1,headerName:"Speed",renderCell:function(e){var n=e.value;return(0,r.jsx)(j.KI,{text:"".concat(parseFloat(n).toLocaleString()," Mbps")})}},{field:"networkInterfaceOrder",flex:1,headerName:"Order"}]},le=function(e){var n=e.createDropMouseUpHandler,t=e.getNetworkTypeCount,u=e.hostDetail,c=(void 0===u?{}:u).hostType,l=e.networkIndex,d=e.networkInput,p=e.networkInterfaceCount,v=e.networkInterfaceInputMap,b=e.removeNetwork,g=e.setMessageRe,w=e.setNetworkInputs,x=e.setNetworkInterfaceInputMap,k=e.testInput,I=e.testInputToToggleSubmitDisabled,C=(0,i.Z)(),O=(0,a.Z)(C.breakpoints.up("md")),M=(0,a.Z)(C.breakpoints.up("lg")),U=(0,m.useRef)({}),S=(0,m.useRef)({}),P=d.inputUUID,R=d.interfaces,F=d.ipAddress,V=d.isRequired,H=d.subnetMask,q=d.type,_=d.typeCount,X=(0,m.useMemo)((function(){return ue(P)}),[P]),$=(0,m.useMemo)((function(){return ne(X)}),[X]),z=(0,m.useMemo)((function(){return te(X)}),[X]),K=(0,m.useMemo)((function(){return oe(X)}),[X]),Y=(0,m.useMemo)((function(){return ie(X)}),[X]),Q=(0,m.useMemo)((function(){return"node"===c}),[c]),ee=(0,m.useMemo)((function(){return!Q&&p<=2?[1]:ae}),[Q,p]),re=(0,m.useMemo)((function(){var e=h.Z.bcn,n=h.Z.ifn,t=h.Z.mn,r=h.Z.sn;return Q&&p>=8?{bcn:e,ifn:n,mn:t,sn:r}:{bcn:e,ifn:n,sn:r}}),[Q,p]);return(0,m.useEffect)((function(){var e=d.ipAddressInputRef,n=d.subnetMaskInputRef;e===U&&n===S||(d.ipAddressInputRef=U,d.subnetMaskInputRef=S,w((function(e){return W(e)})))}),[d,w]),(0,r.jsxs)(T.Lg,{children:[(0,r.jsxs)(T.CH,{children:[(0,r.jsx)(L.Z,{id:"network-".concat(P,"-name"),isReadOnly:V,inputLabelProps:{isNotifyRequired:!0},label:"Network name",selectItems:Object.entries(re).map((function(e){var n=J(e,2),r=n[0],o=n[1],i=t(r,{lastIndex:l});return r!==q&&(i+=1),{value:r,displayValue:"".concat(o," ").concat(i)}})),selectProps:{onChange:function(e){var n=e.target.value,r=String(n);d.type=r;var o=t(r,{lastIndex:l});d.typeCount=o,d.name="".concat(h.Z[r]," ").concat(o),w((function(e){return W(e)}))},renderValue:M?void 0:function(e){return"".concat(String(e).toUpperCase()," ").concat(_)},value:q}}),!V&&(0,r.jsx)(A.Z,{onClick:function(){b(l)},sx:{padding:".2em",position:"absolute",right:"-9px",top:"-4px"},children:(0,r.jsx)(s.Z,{fontSize:"small"})})]}),(0,r.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column",margin:".6em","& > :not(:first-child)":{marginTop:"1em"}},children:[ee.map((function(e){var t="Link ".concat(e),i=e-1,a=R[i],u=(null!==a&&void 0!==a?a:{}).networkInterfaceUUID,c=void 0===u?"":u,l=O?(0,r.jsx)(j.Ac,{text:"Drop to add interface."}):(0,r.jsx)(f.Z,{sx:{alignSelf:"center",color:y.s7}});return(0,r.jsxs)(o.Z,{sx:{alignItems:"center",display:"flex",flexDirection:"row","& > :not(:first-child)":{marginLeft:"1em"},"& > :last-child":{flexGrow:1}},children:[(0,r.jsx)(j.Ac,{sx:{whiteSpace:"nowrap"},text:t}),(0,r.jsx)(D,{onMouseUp:function(){for(var e=arguments.length,t=new Array(e),r=0;r=Ie.length||Object.values(H).every((function(e){return e.isApplied}))||"node"===I&&Ie.length<=6}),[I,ae,Ie,H]),Oe=(0,m.useMemo)((function(){return c&&!l}),[c,l]),Me=(0,m.useCallback)((function(e,n){var t;return null===(t=we.current.setMessage)||void 0===t?void 0:t.call(null,e,n)}),[]),Ue=(0,m.useCallback)((function(e,n){var t;return null===(t=we.current.setMessageRe)||void 0===t?void 0:t.call(null,e,n)}),[]),Ze=(0,m.useCallback)((function(e){return Me(Q,e)}),[Me]),De=(0,m.useCallback)((function(e){return Me(ee,e)}),[Me]),Se=(0,m.useCallback)((function(e){var n,t=e.fn,r=void 0===t?"every":t,o=e.ip,i=void 0===o?"":o,a=e.mask,u=void 0===a?"":a,c=e.isNegateMatch,l=void 0===c?"every"===r:c,s=e.onMatch,f=e.onMiss,d=e.skipUUID,p="every"===r;try{n=new v.Netmask("".concat(i,"/").concat(u))}catch(m){}return ae[r]((function(e){var t,r,o=e.inputUUID,a=e.ipAddressInputRef,u=e.subnetMaskInputRef;if(o===d)return p;var c=null===(t=null===a||void 0===a?void 0:a.current.getValue)||void 0===t?void 0:t.call(null),b=null===(r=null===u||void 0===u?void 0:u.current.getValue)||void 0===r?void 0:r.call(null),g=!1;try{g=function(e,n){var t=n.b,r=n.bIP,o=void 0===r?"":r;return e.contains(null!==t&&void 0!==t?t:o)||void 0!==t&&t.contains(e)}(new v.Netmask("".concat(c,"/").concat(b)),{b:n,bIP:i})}catch(m){}return g?null===s||void 0===s||s.call(null,e):null===f||void 0===f||f.call(null,e),l?!g:g}))}),[ae]),Pe=(0,m.useCallback)((function(e){x.Z.put("/init/set-map-network",{value:e}).catch((function(n){var t=(0,P.Z)(n);t.children=(0,r.jsxs)(r.Fragment,{children:["Failed to ",e?"enable":"disable"," network mapping."," ",t.children]}),Me("api",t)}))}),[Me]),Ae=(0,m.useMemo)((function(){var e,n=(B(e={},Q,{defaults:{getValue:function(){var e;return null===(e=ge.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){Ze()}},tests:[{onFailure:function(){Ze({children:"Domain name servers should be a comma-separated list of IPv4 addresses without trailing comma(s)."})},test:function(e){var n=e.value;return w.ah.test(n)}},{test:q.HJ}]}),B(e,ee,{defaults:{getValue:function(){var e;return null===(e=ye.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){De()}},tests:[{onFailure:function(){De({children:"Gateway should be a valid IPv4 address."})},test:function(e){var n=e.value;return w.tf.test(n)}},{test:function(e){var n=e.value,t=!0,r=Se({fn:"some",ip:n,onMatch:function(e){var r=e.ipAddress,o=e.name,i=e.type,a=e.typeCount;if(n===r)return t=!1,void De({children:"Gateway cannot be the same as IP address in ".concat(o,".")});be("".concat(i).concat(a))}});return r||De({children:"Gateway must be in one network's subnet."}),r&&t}},{test:q.HJ}]}),e);return ae.forEach((function(e){var t,r,o=e.inputUUID,i=e.interfaces,a=e.ipAddressInputRef,u=e.name,c=e.subnetMaskInputRef,l=ue(o),s=ne(l),f=te(l),d=oe(l),p=function(e){return Me(s,e)},v=function(e){return Me(f,e)},m=function(e){return Me(d,e)},b=function(e,n,t){var r,o="".concat(ie(l),"-").concat(n),i="".concat(ie(ue(n)),"-").concat(e);Me((null===(r=we.current.exists)||void 0===r?void 0:r.call(null,i))?i:o,t)},g=function(e){var n=e.ip,i=void 0===n?null===(t=null===a||void 0===a?void 0:a.current.getValue)||void 0===t?void 0:t.call(null):n,l=e.mask,s=void 0===l?null===(r=null===c||void 0===c?void 0:c.current.getValue)||void 0===r?void 0:r.call(null):l;return Se({ip:i,mask:s,onMatch:function(e){var n=e.inputUUID,t=e.name;b(o,n,{children:'"'.concat(u,'" and "').concat(t,'" cannot be in the same subnet.')})},onMiss:function(e){var n=e.inputUUID;b(o,n)},skipUUID:o})};n[s]={defaults:{getCompare:function(){return i.map((function(e){return void 0!==e}))},onSuccess:function(){p()}},tests:[{onFailure:function(){p({children:"".concat(u," must have at least 1 interface.")})},test:function(e){return e.compare.some((function(e){return e}))}},{onFailure:function(){p({children:"".concat(u," must have a Link 1 interface.")})},test:function(e){var n=J(e.compare,2),t=n[0];return!(n[1]&&!t)}}]},n[f]={defaults:{getValue:function(){var e;return null===(e=null===a||void 0===a?void 0:a.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){v()}},tests:[{onFailure:function(){v({children:"IP address in ".concat(u," must be a valid IPv4 address.")})},test:function(e){var n=e.value;return w.tf.test(n)}},{test:function(e){var n=e.value;return g({ip:n})}},{test:q.HJ}]},n[re(l)]={defaults:{value:u},tests:[{test:q.HJ}]},n[d]={defaults:{getValue:function(){var e;return null===(e=null===c||void 0===c?void 0:c.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){m()}},tests:[{onFailure:function(){m({children:"Subnet mask in ".concat(u," must be a valid IPv4 address.")})},test:function(e){var n=e.value;return w.tf.test(n)}},{test:function(e){var n=e.value;return g({mask:n})}},{test:q.HJ}]}})),n}),[ae,Ze,De,Me,Se]),Ne=(0,m.useMemo)((function(){return(0,q.LT)(Ae)}),[Ae]),Re=(0,m.useCallback)((function(e){null===s||void 0===s||s.call(null,Ne(G({isIgnoreOnCallbacks:!0,isTestAll:!0},e)))}),[Ne,s]),Ee=(0,m.useCallback)((function(){pe(void 0)}),[]),Te=(0,m.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.inputUUID,t=void 0===n?(0,b.Z)():n,r=e.interfaces,o=void 0===r?W(z):r,i=e.ipAddress,a=void 0===i?"":i,u=e.name,c=void 0===u?"Unknown Network":u,l=e.subnetMask,f=void 0===l?"":l,d=e.type,p=void 0===d?"":d,v=e.typeCount,m=void 0===v?0:v;ae.unshift({inputUUID:t,interfaces:o,ipAddress:a,name:c,subnetMask:f,type:p,typeCount:m}),null===s||void 0===s||s.call(null,!1),se(W(ae))}),[ae,s]),Fe=(0,m.useCallback)((function(e){var n=J(ae.splice(e,1),1)[0],t=n.inputUUID;n.interfaces.forEach((function(e){if(void 0!==e){var n=e.networkInterfaceUUID;H[n].isApplied=!1}})),Re({excludeTestIdsRe:RegExp(t)}),se(W(ae)),_((function(e){return G({},e)}))}),[ae,H,Re]),Le=(0,m.useCallback)((function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.inputs,r=void 0===t?ae:t,o=n.lastIndex,i=void 0===o?0:o,a=0,u=r.length-1;u>=i;u-=1)r[u].type===e&&(a+=1);return a}),[ae]),Ve=(0,m.useMemo)((function(){if(void 0!==de){var e=de.networkInterfaceUUID;return function(n,t){return function(){var r,o=(null!==(r=n[t])&&void 0!==r?r:{}).networkInterfaceUUID;o&&o!==e&&(H[o].isApplied=!1),n[t]=de,H[e].isApplied=!0}}}}),[de,H]),He=(0,m.useMemo)((function(){return de?{cursor:"grabbing",userSelect:"none"}:{}}),[de]),qe=(0,m.useMemo)((function(){if(void 0===de)return(0,r.jsx)(r.Fragment,{});var e=D.x,n=D.y;return(0,r.jsx)(Z,{isFloating:!0,networkInterface:de,sx:{left:"calc(".concat(e,"px + .4em)"),position:"absolute",top:"calc(".concat(n,"px - 1.6em)"),zIndex:20}})}),[D,de]),_e=(0,m.useMemo)((function(){return de?function(){Ee()}:void 0}),[Ee,de]),Be=(0,m.useMemo)((function(){return de?function(e){var n=e.currentTarget,t=e.nativeEvent,r=t.clientX,o=t.clientY,i=n.getBoundingClientRect(),a=i.left,u=i.top;T({x:r-a,y:o-u})}:void 0}),[de]),Ge=(0,m.useMemo)((function(){return de?function(){Ee()}:void 0}),[Ee,de]);(0,m.useEffect)((function(){if([Object.keys(H).length>0,c,l,he.current,ge.current,ye.current].every((function(e){return Boolean(e)}))){var e,n;he.current=!1;var t=l.dns,r=l.gateway,o=l.gatewayInterface,i=l.networks;null===(e=ge.current.setValue)||void 0===e||e.call(null,t),null===(n=ye.current.setValue)||void 0===n||n.call(null,r);var a=[],u=Object.values(i).reduce((function(e,n){var t,r,o=n.ip,i=n.link1Uuid,u=n.link2Uuid,c=void 0===u?"":u,l=n.subnetMask,s=n.type,f=Le(s,{inputs:e})+1,d=M[s]===f,p="".concat(h.Z[s]," ").concat(f);return a.push(i,c),e.push({inputUUID:(0,b.Z)(),interfaces:[null===(t=H[i])||void 0===t?void 0:t.metadata,null===(r=H[c])||void 0===r?void 0:r.metadata],ipAddress:o,isRequired:d,name:p,subnetMask:l,type:s,typeCount:f}),e}),[]);be(o),_((function(e){var n=G({},e);return a.forEach((function(e){n[e]&&(n[e].isApplied=!0)})),n})),se(u),Re()}}),[Te,c,Le,l,ae,H,M,Re]),(0,m.useEffect)((function(){return Pe(1),window&&window.addEventListener("beforeunload",(function(){var e=new XMLHttpRequest;e.open("PUT","".concat(g.Z,"/init/set-map-network"),!1),e.send(null)}),{once:!0}),function(){Pe(0)}}),[Pe]),(0,m.useImperativeHandle)(n,(function(){return G({},we.current,{get:function(){var e,n;return{dns:null===(e=ge.current.getValue)||void 0===e?void 0:e.call(null),gateway:null===(n=ye.current.getValue)||void 0===n?void 0:n.call(null),gatewayInterface:me,networks:ae.map((function(e){var n,r,o=e.inputUUID,a=e.interfaces,u=e.ipAddressInputRef,c=e.name,l=e.subnetMaskInputRef,s=e.type,f=e.typeCount;return{inputUUID:o,interfaces:a,ipAddress:null!==(t=null===(n=null===u||void 0===u?void 0:u.current.getValue)||void 0===n?void 0:n.call(null))&&void 0!==t?t:"",name:c,subnetMask:null!==(i=null===(r=null===l||void 0===l?void 0:l.current.getValue)||void 0===r?void 0:r.call(null))&&void 0!==i?i:"",type:s,typeCount:f}}))}}})}),[me,ae]);var Je,We="13em";return je?(0,r.jsx)(V.Z,{}):(0,r.jsxs)(o.Z,{onMouseDown:function(e){var n=e.clientX,t=e.clientY,r=e.currentTarget.getBoundingClientRect(),o=r.left,i=r.top;T({x:n-o,y:t-i})},onMouseLeave:_e,onMouseMove:Be,onMouseUp:Ge,sx:G({position:"relative"},He),children:[qe,(0,r.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column","& > :not(:first-child, :nth-child(3))":{marginTop:"1em"}},children:[(0,r.jsx)(d._,{autoHeight:!0,columns:ce((function(e){pe(e)}),H),componentsProps:{row:{onMouseDown:function(e){var n=e.target,t=(void 0===n?{}:n).parentElement,r=(void 0===t?{}:t).dataset,o=(void 0===r?{}:r).id,i=void 0===o?void 0:o;if(i){var a=H[i],u=a.isApplied,c=a.metadata;u||pe(c)}}}},disableColumnMenu:!0,disableSelectionOnClick:!0,getRowClassName:function(e){var n,t=e.row.networkInterfaceUUID,r="";return(null!==(n=H[t])&&void 0!==n&&n).isApplied||(r+=" ".concat($.ifaceNotApplied)),r},getRowId:function(e){return e.networkInterfaceUUID},hideFooter:!0,rows:Ie,sx:(Je={color:y.s7},B(Je,"& .".concat(u.Z.root),{color:"inherit"}),B(Je,"& .".concat(p._.cell,":focus"),{outline:"none"}),B(Je,"& .".concat(p._.row,".").concat($.ifaceNotApplied,":hover"),B({cursor:"grab"},"& .".concat(p._.cell," p"),{cursor:"auto"})),Je)}),!Oe&&(0,r.jsx)(S.Z,{row:!0,sx:{"& > :first-child":{alignSelf:"start",marginTop:".7em"},"& > :last-child":{flexGrow:1}},children:(0,r.jsx)(o.Z,{sx:{alignItems:"strech",display:"flex",flexDirection:"row",overflowX:"auto",paddingLeft:".3em","& > div":{marginBottom:".8em",marginTop:".4em",minWidth:We,width:"25%"},"& > :not(:first-child)":{marginLeft:"1em"}},children:ae.map((function(e,n){var t=e.inputUUID;return(0,r.jsx)(le,{createDropMouseUpHandler:Ve,getNetworkTypeCount:Le,hostDetail:l,networkIndex:n,networkInput:e,networkInterfaceCount:Ie.length,networkInterfaceInputMap:H,removeNetwork:Fe,setMessageRe:Ue,setNetworkInputs:se,setNetworkInterfaceInputMap:_,testInput:Ne,testInputToToggleSubmitDisabled:Re},"network-".concat(t))}))})}),(0,r.jsxs)(S.Z,{sm:"row",sx:{marginTop:".2em","& > :not(button)":{minWidth:We,width:{sm:"25%"}}},children:[(0,r.jsx)(A.Z,{disabled:Ce,onClick:function(){Te()},children:(0,r.jsx)(f.Z,{})}),(0,r.jsx)(N.Z,{input:(0,r.jsx)(E.Z,{id:"network-init-gateway",inputProps:{onBlur:function(e){var n=e.target.value;Ne({inputs:B({},ee,{value:n})})}},inputLabelProps:{isNotifyRequired:!0},onChange:function(e){var n=e.target.value;Re({inputs:B({},ee,{value:n})}),De()},label:"Gateway"}),ref:ye}),(0,r.jsx)(N.Z,{input:(0,r.jsx)(E.Z,{id:"network-init-dns-csv",inputProps:{onBlur:function(e){var n=e.target.value;Ne({inputs:B({},Q,{value:n})})}},inputLabelProps:{isNotifyRequired:!0},onChange:function(e){var n=e.target.value;Re({inputs:B({},Q,{value:n})}),Ze()},label:"Domain name server(s)"}),ref:ge})]}),(0,r.jsx)(R.Z,{count:1,defaultMessageType:"warning",ref:we})]})]})}));se.defaultProps={expectHostDetail:!1,hostDetail:void 0,toggleSubmitDisabled:void 0},se.displayName="NetworkInitForm";var fe=se},3106:function(e,n){n.Z={bcn:"Back-Channel Network",ifn:"Internet-Facing Network",mn:"Migration Network",sn:"Storage Network"}}}]); \ No newline at end of file diff --git a/striker-ui/out/_next/static/chunks/692-64941f28ab144919.js b/striker-ui/out/_next/static/chunks/692-64941f28ab144919.js new file mode 100644 index 00000000..9c4aec3c --- /dev/null +++ b/striker-ui/out/_next/static/chunks/692-64941f28ab144919.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[692],{1939:function(e,n,t){var r=t(5893),o=t(7357),i=t(7169);function u(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(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}var c="Decorator",s={ok:"".concat(c,"-ok"),warning:"".concat(c,"-warning"),error:"".concat(c,"-error"),off:"".concat(c,"-off")};n.Z=function(e){var n,t=e.colour,c=e.sx,f=l(e,["colour","sx"]);return(0,r.jsx)(o.Z,a({},f,{className:s[t],sx:a((n={borderRadius:i.n_,height:"100%",width:"1.4em"},u(n,"&.".concat(s.ok),{backgroundColor:i.Ej}),u(n,"&.".concat(s.warning),{backgroundColor:i.Wd}),u(n,"&.".concat(s.error),{backgroundColor:i.hM}),u(n,"&.".concat(s.off),{backgroundColor:i.s7}),n),c)}))}},5741:function(e,n,t){var r=t(5893),o=t(1714),i=t(122),u=t(7169),a=t(4690);function l(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(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,l=s(e,["children","sx"]);return(0,r.jsx)(i.Z,c({underline:"hover",variant:"subtitle1"},l,{sx:c({color:u.lD,textDecorationColor:u.s7},t),children:(0,r.jsxs)(a.Z,{row:!0,children:[n,(0,r.jsx)(o.Z,{sx:{marginLeft:".3em"}})]})}))}},8461:function(e,n,t){t.d(n,{Z:function(){return de}});var r=t(5893),o=t(7357),i=t(2734),u=t(8396),a=t(6239),l=t(9699),c=t(2026),s=t(5537),f=t(2428),d=t(2275),v=t(3490),p=t(8951),m=t(7294),b=t(5934),g=t(2029),y=t(7169),h=t(3106),w=t(1250),k=t(4390),x=t(4799),I=t(1939),j=t(7750);function C(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;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}var S=function(e){var n=e.isFloating,t=e.networkInterface,i=t.networkInterfaceName,u=t.networkInterfaceState,a=e.onClose,l=e.sx,c=M(e,["isFloating","networkInterface","onClose","sx"]),f=n?{borderColor:y.s7,borderRadius:y.n_,borderStyle:"solid",borderWidth:"1px",backgroundColor:y.E5,padding:".6em 1.2em"}:{};return(0,r.jsxs)(o.Z,O({sx:O({display:"flex",flexDirection:"row","& > :not(:first-child)":{alignSelf:"center",marginLeft:".5em"}},f,l)},c,{children:[(0,r.jsx)(I.Z,{colour:"up"===u?"ok":"off",sx:{height:"auto"}}),(0,r.jsx)(j.Ac,{text:i}),a&&(0,r.jsx)(x.Z,{onClick:a,size:"small",sx:{color:y.s7},children:(0,r.jsx)(s.Z,{})})]}))};S.defaultProps={isFloating:!1,onClose:void 0};var U=S,Z=(0,t(1496).ZP)(o.Z)((function(){return{borderColor:y.s7,borderStyle:"dashed",borderWidth:"4px",display:"flex",flexDirection:"column",padding:".6em","& > :not(:first-child)":{marginTop:".3em"}}})),D=t(4690),P=t(1770),A=t(1706),N=t(9099),R=t(7869),E=t(6284),T=t(3679),V=t(1905),F=t(7783),L=t(2152),q=function(e){for(var n=0,t=0;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 J(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=[],u=!0,a=!1;try{for(t=t.call(e);!(u=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);u=!0);}catch(l){a=!0,o=l}finally{try{u||null==t.return||t.return()}finally{if(a)throw o}}return i}}(e,n)||X(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 W(e){return function(e){if(Array.isArray(e))return B(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||X(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 X(e,n){if(e){if("string"===typeof e)return B(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)?B(e,n):void 0}}var z={ifaceNotApplied:"".concat("NetworkInitForm","-network-interface-not-applied")},K=[void 0,void 0],Y="dns",Q="gateway",ee=function(e){return"".concat(e,"Interface")},ne=function(e){return"".concat(e,"IPAddress")},te=function(e){return"".concat(e,"Name")},re=function(e){return"".concat(e,"SubnetMask")},oe=function(e){return"".concat(e,"NetworkSubnetConflict")},ie=Array.from({length:2},(function(e,n){return n+1})),ue={bcn:{ip:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"10.20".concat(e,".").concat(n)},mask:"255.255.0.0"},ifn:{ip:function(){return""},mask:""},mn:{ip:function(){return"10.199."},mask:"255.255.0.0"},sn:{ip:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"10.10".concat(e,".").concat(n)},mask:"255.255.0.0"}},ae=function(e){return"network".concat(e)},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.inputUUID,t=void 0===n?(0,b.Z)():n,r=e.interfaces,o=void 0===r?W(K):r,i=e.ipAddress,u=void 0===i?"":i,a=e.name,l=e.subnetMask,c=void 0===l?"":l,s=e.type,f=void 0===s?"":s,d=e.typeCount,v=void 0===d?0:d,p=$(e,["inputUUID","interfaces","ipAddress","name","subnetMask","type","typeCount"]),m=a;return a||(m=h.Z[f]&&v>0?"".concat(h.Z[f]," ").concat(v):"Unknown Network"),G({inputUUID:t,interfaces:o,ipAddress:u,name:m,subnetMask:c,type:f,typeCount:v},p)},ce=function(e,n){return[{align:"center",field:"",renderCell:function(t){var i,u=t.row,a=(null!==(i=n[u.networkInterfaceUUID])&&void 0!==i&&i).isApplied,s="grab",f=function(){for(var n=arguments.length,t=new Array(n),r=0;r :not(:first-child)":{marginLeft:".5em"}},children:[(0,r.jsx)(I.Z,{colour:"up"===t?"ok":"off",sx:{height:"auto"}}),(0,r.jsx)(j.KI,{text:i})]})},sortComparator:function(e,n){return q(e)-q(n)}},{field:"networkInterfaceMACAddress",flex:1,headerName:"MAC",renderCell:function(e){var n=e.value;return(0,r.jsx)(j.$_,{text:n})}},{field:"networkInterfaceState",flex:1,headerName:"State",renderCell:function(e){var n=e.value,t=String(n);return(0,r.jsx)(j.KI,{text:"".concat(t.charAt(0).toUpperCase()).concat(t.substring(1))})}},{field:"networkInterfaceSpeed",flex:1,headerName:"Speed",renderCell:function(e){var n=e.value;return(0,r.jsx)(j.KI,{text:"".concat(parseFloat(n).toLocaleString()," Mbps")})}},{field:"networkInterfaceOrder",flex:1,headerName:"Order"}]},se=function(e){var n=e.allowMigrationNetwork,t=e.createDropMouseUpHandler,a=e.getNetworkTypeCount,l=e.hostDetail,c=void 0===l?{}:l,d=c.hostType,v=c.sequence,p=e.networkIndex,b=e.networkInput,g=e.networkInterfaceCount,w=e.networkInterfaceInputMap,k=e.removeNetwork,x=e.setMessageRe,I=e.setNetworkInputs,C=e.setNetworkInterfaceInputMap,O=e.testInput,M=e.testInputToToggleSubmitDisabled,S=(0,i.Z)(),D=(0,u.Z)(S.breakpoints.up("md")),P=(0,u.Z)(S.breakpoints.up("lg")),R=(0,m.useRef)({}),V=(0,m.useRef)({}),L=b.inputUUID,q=b.interfaces,H=b.ipAddress,B=b.isRequired,$=b.subnetMask,X=b.type,z=b.typeCount,K=(0,m.useMemo)((function(){return ae(L)}),[L]),Y=(0,m.useMemo)((function(){return ee(K)}),[K]),Q=(0,m.useMemo)((function(){return ne(K)}),[K]),te=(0,m.useMemo)((function(){return re(K)}),[K]),le=(0,m.useMemo)((function(){return oe(K)}),[K]),ce=(0,m.useMemo)((function(){return"node"===d}),[d]),se=(0,m.useMemo)((function(){return!ce&&g<=2?[1]:ie}),[ce,g]),fe=(0,m.useMemo)((function(){var e=h.Z.bcn,t=h.Z.ifn,r=h.Z.mn,o=h.Z.sn;return ce&&g>=8&&(n||"mn"===X)?{bcn:e,ifn:t,mn:r,sn:o}:{bcn:e,ifn:t,sn:o}}),[n,ce,g,X]),de=(0,m.useCallback)((function(e,n,t){var r=R.current,o=r.getIsChangedByUser,i=r.setValue,u=V.current,a=u.getIsChangedByUser,l=u.setValue;(null===o||void 0===o?void 0:o.call(null))||(e.ipAddress=n,null===i||void 0===i||i.call(null,n)),(null===a||void 0===a?void 0:a.call(null))||(e.subnetMask=t,null===l||void 0===l||l.call(null,t))}),[]);return(0,m.useEffect)((function(){var e,n;"striker"===d&&"ifn"!==X&&(!(null===(e=R.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))&&Number(v)&&(null===(n=R.current.setValue)||void 0===n||n.call(null,H.replace(/^((?:\d+\.){3})\d*$/,"$1".concat(v)))))}),[d,H,v,X]),(0,m.useEffect)((function(){var e=b.ipAddressInputRef,n=b.subnetMaskInputRef;e===R&&n===V||(b.ipAddressInputRef=R,b.subnetMaskInputRef=V,I((function(e){return W(e)})))}),[b,I]),(0,r.jsxs)(T.Lg,{children:[(0,r.jsxs)(T.CH,{children:[(0,r.jsx)(F.Z,{id:"network-".concat(L,"-name"),isReadOnly:B,inputLabelProps:{isNotifyRequired:!0},label:"Network name",selectItems:Object.entries(fe).map((function(e){var n=J(e,2),t=n[0],r=n[1],o=a(t,{lastIndex:p});return t!==X&&(o+=1),{value:t,displayValue:"".concat(r," ").concat(o)}})),selectProps:{onChange:function(e){var n=e.target.value,t=String(n);b.type=t;var r=a(t,{lastIndex:p});b.typeCount=r,b.name="".concat(h.Z[t]," ").concat(r);var o=ue[t];if(o){var i,u=o.ip,l=o.mask;"striker"===d&&"bcn"===t&&(i="4."),de(b,u(r,i),l)}I((function(e){return W(e)}))},renderValue:P?void 0:function(e){return"".concat(String(e).toUpperCase()," ").concat(z)},value:X}}),!B&&(0,r.jsx)(A.Z,{onClick:function(){k(p)},sx:{padding:".2em",position:"absolute",right:"-9px",top:"-4px"},children:(0,r.jsx)(s.Z,{fontSize:"small"})})]}),(0,r.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column",margin:".6em","& > :not(:first-child)":{marginTop:"1em"}},children:[se.map((function(e){var n="Link ".concat(e),i=e-1,u=q[i],a=(null!==u&&void 0!==u?u:{}).networkInterfaceUUID,l=void 0===a?"":a,c=D?(0,r.jsx)(j.Ac,{text:"Drop to add interface."}):(0,r.jsx)(f.Z,{sx:{alignSelf:"center",color:y.s7}});return(0,r.jsxs)(o.Z,{sx:{alignItems:"center",display:"flex",flexDirection:"row","& > :not(:first-child)":{marginLeft:"1em"},"& > :last-child":{flexGrow:1}},children:[(0,r.jsx)(j.Ac,{sx:{whiteSpace:"nowrap"},text:n}),(0,r.jsx)(Z,{onMouseUp:function(){for(var e=arguments.length,n=new Array(e),r=0;r=xe.length||Object.values(B).every((function(e){return e.isApplied}))||"node"===t&&xe.length<=6}),[t,K,xe,B]),Ce=(0,m.useMemo)((function(){return u&&!l}),[u,l]),Oe=(0,m.useMemo)((function(){return K.every((function(e){return"mn"!==e.type}))}),[K]),Me=(0,m.useCallback)((function(e,n){var t;return null===(t=he.current.setMessage)||void 0===t?void 0:t.call(null,e,n)}),[]),Se=(0,m.useCallback)((function(e,n){var t;return null===(t=he.current.setMessageRe)||void 0===t?void 0:t.call(null,e,n)}),[]),Ue=(0,m.useCallback)((function(e){return Me(Y,e)}),[Me]),Ze=(0,m.useCallback)((function(e){return Me(Q,e)}),[Me]),De=(0,m.useCallback)((function(e){var n,t=e.fn,r=void 0===t?"every":t,o=e.ip,i=void 0===o?"":o,u=e.mask,a=void 0===u?"":u,l=e.isNegateMatch,c=void 0===l?"every"===r:l,s=e.onMatch,f=e.onMiss,d=e.skipUUID,v="every"===r;try{n=new p.Netmask("".concat(i,"/").concat(a))}catch(m){}return K[r]((function(e){var t,r,o=e.inputUUID,u=e.ipAddressInputRef,a=e.subnetMaskInputRef;if(o===d)return v;var l=null===(t=null===u||void 0===u?void 0:u.current.getValue)||void 0===t?void 0:t.call(null),b=null===(r=null===a||void 0===a?void 0:a.current.getValue)||void 0===r?void 0:r.call(null),g=!1;try{g=function(e,n){var t=n.b,r=n.bIP,o=void 0===r?"":r;return e.contains(null!==t&&void 0!==t?t:o)||void 0!==t&&t.contains(e)}(new p.Netmask("".concat(l,"/").concat(b)),{b:n,bIP:i})}catch(m){}return g?null===s||void 0===s||s.call(null,e):null===f||void 0===f||f.call(null,e),c?!g:g}))}),[K]),Pe=(0,m.useCallback)((function(e){k.Z.put("/init/set-map-network",{value:e}).catch((function(n){var t=(0,P.Z)(n);t.children=(0,r.jsxs)(r.Fragment,{children:["Failed to ",e?"enable":"disable"," network mapping."," ",t.children]}),Me("api",t)}))}),[Me]),Ae=(0,m.useMemo)((function(){var e,n=(_(e={},Y,{defaults:{getValue:function(){var e;return null===(e=be.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){Ue()}},tests:[{onFailure:function(){Ue({children:"Domain name servers should be a comma-separated list of IPv4 addresses without trailing comma(s)."})},test:function(e){var n=e.value;return w.ah.test(n)}},{test:H.HJ}]}),_(e,Q,{defaults:{getValue:function(){var e;return null===(e=ge.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){Ze()}},tests:[{onFailure:function(){Ze({children:"Gateway should be a valid IPv4 address."})},test:function(e){var n=e.value;return w.tf.test(n)}},{test:function(e){var n=e.value,t=!0,r=De({fn:"some",ip:n,onMatch:function(e){var r=e.ipAddress,o=e.name,i=e.type,u=e.typeCount;if(n===r)return t=!1,void Ze({children:"Gateway cannot be the same as IP address in ".concat(o,".")});me("".concat(i).concat(u))}});return r||Ze({children:"Gateway must be in one network's subnet."}),r&&t}},{test:H.HJ}]}),e);return K.forEach((function(e){var t,r,o=e.inputUUID,i=e.interfaces,u=e.ipAddressInputRef,a=e.name,l=e.subnetMaskInputRef,c=ae(o),s=ee(c),f=ne(c),d=re(c),v=function(e){return Me(s,e)},p=function(e){return Me(f,e)},m=function(e){return Me(d,e)},b=function(e,n,t){var r,o="".concat(oe(c),"-").concat(n),i="".concat(oe(ae(n)),"-").concat(e);Me((null===(r=he.current.exists)||void 0===r?void 0:r.call(null,i))?i:o,t)},g=function(e){var n=e.ip,i=void 0===n?null===(t=null===u||void 0===u?void 0:u.current.getValue)||void 0===t?void 0:t.call(null):n,c=e.mask,s=void 0===c?null===(r=null===l||void 0===l?void 0:l.current.getValue)||void 0===r?void 0:r.call(null):c;return De({ip:i,mask:s,onMatch:function(e){var n=e.inputUUID,t=e.name;b(o,n,{children:'"'.concat(a,'" and "').concat(t,'" cannot be in the same subnet.')})},onMiss:function(e){var n=e.inputUUID;b(o,n)},skipUUID:o})};n[s]={defaults:{getCompare:function(){return i.map((function(e){return void 0!==e}))},onSuccess:function(){v()}},tests:[{onFailure:function(){v({children:"".concat(a," must have at least 1 interface.")})},test:function(e){return e.compare.some((function(e){return e}))}},{onFailure:function(){v({children:"".concat(a," must have a Link 1 interface.")})},test:function(e){var n=J(e.compare,2),t=n[0];return!(n[1]&&!t)}}]},n[f]={defaults:{getValue:function(){var e;return null===(e=null===u||void 0===u?void 0:u.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){p()}},tests:[{onFailure:function(){p({children:"IP address in ".concat(a," must be a valid IPv4 address.")})},test:function(e){var n=e.value;return w.tf.test(n)}},{test:function(e){var n=e.value;return g({ip:n})}},{test:H.HJ}]},n[te(c)]={defaults:{value:a},tests:[{test:H.HJ}]},n[d]={defaults:{getValue:function(){var e;return null===(e=null===l||void 0===l?void 0:l.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){m()}},tests:[{onFailure:function(){m({children:"Subnet mask in ".concat(a," must be a valid IPv4 address.")})},test:function(e){var n=e.value;return w.tf.test(n)}},{test:function(e){var n=e.value;return g({mask:n})}},{test:H.HJ}]}})),n}),[K,Ue,Ze,Me,De]),Ne=(0,m.useMemo)((function(){return(0,H.LT)(Ae)}),[Ae]),Re=(0,m.useCallback)((function(e){null===s||void 0===s||s.call(null,Ne(G({isIgnoreOnCallbacks:!0,isTestAll:!0},e)))}),[Ne,s]),Ee=(0,m.useCallback)((function(){de(void 0)}),[]),Te=(0,m.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};K.unshift(le(e)),null===s||void 0===s||s.call(null,!1),ie(W(K))}),[K,s]),Ve=(0,m.useCallback)((function(e){var n=J(K.splice(e,1),1)[0],t=n.inputUUID;n.interfaces.forEach((function(e){if(void 0!==e){var n=e.networkInterfaceUUID;B[n].isApplied=!1}})),Re({excludeTestIdsRe:RegExp(t)}),ie(W(K)),$((function(e){return G({},e)}))}),[K,B,Re]),Fe=(0,m.useCallback)((function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.inputs,r=void 0===t?K:t,o=n.lastIndex,i=void 0===o?0:o,u=0,a=r.length-1;a>=i;a-=1)r[a].type===e&&(u+=1);return u}),[K]),Le=(0,m.useMemo)((function(){if(void 0!==fe){var e=fe.networkInterfaceUUID;return function(n,t){return function(){var r,o=(null!==(r=n[t])&&void 0!==r?r:{}).networkInterfaceUUID;o&&o!==e&&(B[o].isApplied=!1),n[t]=fe,B[e].isApplied=!0}}}}),[fe,B]),qe=(0,m.useMemo)((function(){return fe?{cursor:"grabbing",userSelect:"none"}:{}}),[fe]),He=(0,m.useMemo)((function(){if(void 0===fe)return(0,r.jsx)(r.Fragment,{});var e=T.x,n=T.y;return(0,r.jsx)(U,{isFloating:!0,networkInterface:fe,sx:{left:"calc(".concat(e,"px + .4em)"),position:"absolute",top:"calc(".concat(n,"px - 1.6em)"),zIndex:20}})}),[T,fe]),Be=(0,m.useMemo)((function(){return fe?function(){Ee()}:void 0}),[Ee,fe]),_e=(0,m.useMemo)((function(){return fe?function(e){var n=e.currentTarget,t=e.nativeEvent,r=t.clientX,o=t.clientY,i=n.getBoundingClientRect(),u=i.left,a=i.top;F({x:r-u,y:o-a})}:void 0}),[fe]),Ge=(0,m.useMemo)((function(){return fe?function(){Ee()}:void 0}),[Ee,fe]);(0,m.useEffect)((function(){if([Object.keys(B).length>0,u,l,ye.current,be.current,ge.current].every((function(e){return Boolean(e)}))){var e,n;ye.current=!1;var t=l.dns,r=l.gateway,o=l.gatewayInterface,i=l.networks;null===(e=be.current.setValue)||void 0===e||e.call(null,t),null===(n=ge.current.setValue)||void 0===n||n.call(null,r);var a=[],c=Object.values(i).reduce((function(e,n){var t,r,o=n.ip,i=n.link1Uuid,u=n.link2Uuid,l=void 0===u?"":u,c=n.subnetMask,s=n.type,f=Fe(s,{inputs:e})+1,d=S[s]===f,v="".concat(h.Z[s]," ").concat(f);return a.push(i,l),e.push({inputUUID:(0,b.Z)(),interfaces:[null===(t=B[i])||void 0===t?void 0:t.metadata,null===(r=B[l])||void 0===r?void 0:r.metadata],ipAddress:o,isRequired:d,name:v,subnetMask:c,type:s,typeCount:f}),e}),[]);me(o),$((function(e){var n=G({},e);return a.forEach((function(e){n[e]&&(n[e].isApplied=!0)})),n})),ie(c),Re()}}),[Te,u,Fe,l,K,B,S,Re]),(0,m.useEffect)((function(){return Pe(1),window&&window.addEventListener("beforeunload",(function(){var e=new XMLHttpRequest;e.open("PUT","".concat(g.Z,"/init/set-map-network"),!1),e.send(null)}),{once:!0}),function(){Pe(0)}}),[Pe]),(0,m.useImperativeHandle)(n,(function(){return G({},he.current,{get:function(){var e,n;return{dns:null===(e=be.current.getValue)||void 0===e?void 0:e.call(null),gateway:null===(n=ge.current.getValue)||void 0===n?void 0:n.call(null),gatewayInterface:pe,networks:K.map((function(e){var n,t,r=e.inputUUID,o=e.interfaces,i=e.ipAddressInputRef,u=e.name,a=e.subnetMaskInputRef,l=e.type,c=e.typeCount;return{inputUUID:r,interfaces:o,ipAddress:null!==(C=null===(n=null===i||void 0===i?void 0:i.current.getValue)||void 0===n?void 0:n.call(null))&&void 0!==C?C:"",name:u,subnetMask:null!==(O=null===(t=null===a||void 0===a?void 0:a.current.getValue)||void 0===t?void 0:t.call(null))&&void 0!==O?O:"",type:l,typeCount:c}}))}}})}),[pe,K]);var $e,Je="13em";return Ie?(0,r.jsx)(L.Z,{}):(0,r.jsxs)(o.Z,{onMouseDown:function(e){var n=e.clientX,t=e.clientY,r=e.currentTarget.getBoundingClientRect(),o=r.left,i=r.top;F({x:n-o,y:t-i})},onMouseLeave:Be,onMouseMove:_e,onMouseUp:Ge,sx:G({position:"relative"},qe),children:[He,(0,r.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column","& > :not(:first-child, :nth-child(3))":{marginTop:"1em"}},children:[(0,r.jsx)(d._,{autoHeight:!0,columns:ce((function(e){de(e)}),B),componentsProps:{row:{onMouseDown:function(e){var n=e.target,t=(void 0===n?{}:n).parentElement,r=(void 0===t?{}:t).dataset,o=(void 0===r?{}:r).id,i=void 0===o?void 0:o;if(i){var u=B[i],a=u.isApplied,l=u.metadata;a||de(l)}}}},disableColumnMenu:!0,disableSelectionOnClick:!0,getRowClassName:function(e){var n,t=e.row.networkInterfaceUUID,r="";return(null!==(n=B[t])&&void 0!==n&&n).isApplied||(r+=" ".concat(z.ifaceNotApplied)),r},getRowId:function(e){return e.networkInterfaceUUID},hideFooter:!0,rows:xe,sx:($e={color:y.s7},_($e,"& .".concat(a.Z.root),{color:"inherit"}),_($e,"& .".concat(v._.cell,":focus"),{outline:"none"}),_($e,"& .".concat(v._.row,".").concat(z.ifaceNotApplied,":hover"),_({cursor:"grab"},"& .".concat(v._.cell," p"),{cursor:"auto"})),$e)}),!Ce&&(0,r.jsx)(D.Z,{row:!0,sx:{"& > :first-child":{alignSelf:"start",marginTop:".7em"},"& > :last-child":{flexGrow:1}},children:(0,r.jsx)(o.Z,{sx:{alignItems:"strech",display:"flex",flexDirection:"row",overflowX:"auto",paddingLeft:".3em","& > div":{marginBottom:".8em",marginTop:".4em",minWidth:Je,width:"25%"},"& > :not(:first-child)":{marginLeft:"1em"}},children:K.map((function(e,n){var o=e.inputUUID;return(0,r.jsx)(se,{allowMigrationNetwork:Oe,createDropMouseUpHandler:Le,getNetworkTypeCount:Fe,hostDetail:{hostType:t,sequence:I},networkIndex:n,networkInput:e,networkInterfaceCount:xe.length,networkInterfaceInputMap:B,removeNetwork:Ve,setMessageRe:Se,setNetworkInputs:ie,setNetworkInterfaceInputMap:$,testInput:Ne,testInputToToggleSubmitDisabled:Re},"network-".concat(o))}))})}),(0,r.jsxs)(D.Z,{sm:"row",sx:{marginTop:".2em","& > :not(button)":{minWidth:Je,width:{sm:"25%"}}},children:[(0,r.jsx)(A.Z,{disabled:je,onClick:function(){Te()},children:(0,r.jsx)(f.Z,{})}),(0,r.jsx)(N.Z,{input:(0,r.jsx)(E.Z,{id:"network-init-gateway",inputProps:{onBlur:function(e){var n=e.target.value;Ne({inputs:_({},Q,{value:n})})}},inputLabelProps:{isNotifyRequired:!0},onChange:function(e){var n=e.target.value;Re({inputs:_({},Q,{value:n})}),Ze()},label:"Gateway"}),ref:ge}),(0,r.jsx)(N.Z,{input:(0,r.jsx)(E.Z,{id:"network-init-dns-csv",inputProps:{onBlur:function(e){var n=e.target.value;Ne({inputs:_({},Y,{value:n})})}},inputLabelProps:{isNotifyRequired:!0},onChange:function(e){var n=e.target.value;Re({inputs:_({},Y,{value:n})}),Ue()},label:"Domain name server(s)"}),ref:be})]}),(0,r.jsx)(R.Z,{count:1,defaultMessageType:"warning",ref:he})]})]})}));fe.defaultProps={expectHostDetail:!1,hostDetail:void 0,hostSequence:void 0,toggleSubmitDisabled:void 0},fe.displayName="NetworkInitForm";var de=fe},3106:function(e,n){n.Z={bcn:"Back-Channel Network",ifn:"Internet-Facing Network",mn:"Migration Network",sn:"Storage Network"}}}]); \ No newline at end of file diff --git a/striker-ui/out/_next/static/chunks/pages/init-7428606d331bc1dd.js b/striker-ui/out/_next/static/chunks/pages/init-7428606d331bc1dd.js new file mode 100644 index 00000000..24e8319e --- /dev/null +++ b/striker-ui/out/_next/static/chunks/pages/init-7428606d331bc1dd.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[464],{593:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/init",function(){return t(8616)}])},9099:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r=t(7294),i={boolean:function(e){return Boolean(e)},number:function(e){return parseInt(String(e),10)||0},string:function(e){return String(e)}},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.postSet,t=e.preSet,r=e.set,l=e.setType,o=void 0===l?"string":l,u=e.valueKey,a=void 0===u?"value":u;return function(e){var l=e.target[a],u=i[o](l);null===t||void 0===t||t.call(null,e),null===r||void 0===r||r.call(null,u),null===n||void 0===n||n.call(null,e)}},o=t(7987);function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function d(e){return function(e){if(Array.isArray(e))return u(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 u(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 u(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.")}()}function f(e){var n=function(e,n){if("object"!==v(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===v(n)?n:String(n)}var v=function(e){return e&&"undefined"!==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var p="input",m={boolean:!1,number:0,string:""},h={createInputOnChangeHandlerOptions:{},required:!1,valueType:"string"},g=(0,r.forwardRef)((function(e,n){var t=e.input,i=e.inputTestBatch,u=e.onBlurAppend,v=e.onFirstRender,g=e.onFocusAppend,x=e.onUnmount,y=e.required,b=void 0===y?h.required:y,j=e.valueKey,w=e.valueType,P=void 0===w?h.valueType:w,S=e.createInputOnChangeHandlerOptions,k=void 0===S?h.createInputOnChangeHandlerOptions:S,O=k.postSet,Z=k.valueKey,C=void 0===Z?j:Z,A=c(e.createInputOnChangeHandlerOptions,["postSet","valueKey"]),I=t.props,N=(0,r.useMemo)((function(){return null!==C&&void 0!==C?C:"checked"in I?"checked":"value"}),[I,C]),V=I.onBlur,H=I.onChange,R=I.onFocus,M=I[N],F=void 0===M?m[P]:M,T=c(I,["onBlur","onChange","onFocus",N].map(f)),E=(0,r.useState)(F),z=E[0],B=E[1],D=(0,r.useState)(!1),_=D[0],L=D[1],q=(0,r.useState)(!1),U=q[0],$=q[1],Q=(0,r.useCallback)((function(e){B(e)}),[]),J=(0,r.useMemo)((function(){var e;return i&&(i.isRequired=b,e=(0,o.LT)(a({},p,i))),e}),[i,b]),G=(0,r.useMemo)((function(){return null!==V&&void 0!==V?V:J&&function(){for(var e=arguments.length,n=new Array(e),t=0;te.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function a(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,i,l=[],o=!0,u=!1;try{for(t=t.call(e);!(o=(r=t.next()).done)&&(l.push(r.value),!n||l.length!==n);o=!0);}catch(a){u=!0,i=a}finally{try{o||null==t.return||t.return()}finally{if(u)throw i}}return l}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return o(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 o(e,n)}(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 s(e){var n=function(e,n){if("object"!==c(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===c(n)?n:String(n)}var c=function(e){return e&&"undefined"!==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var d={count:0,defaultMessageType:"info",onSet:void 0,usePlaceholder:!0},f=(0,i.forwardRef)((function(e,n){var t=e.count,o=void 0===t?d.count:t,c=e.defaultMessageType,f=void 0===c?d.defaultMessageType:c,v=e.onSet,p=e.usePlaceholder,m=void 0===p?d.usePlaceholder:p,h=(0,i.useState)({}),g=h[0],x=h[1],y=(0,i.useCallback)((function(e){return void 0!==g[e]}),[g]),b=(0,i.useCallback)((function(e,n){var t=0;x((function(r){r[e];var i=u(r,[e].map(s));return n&&(i[e]=n),t=Object.keys(i).length,i})),null===v||void 0===v||v.call(null,t)}),[v]),j=(0,i.useCallback)((function(e,n){var t=0,r=n?function(e,r){e[r]=n,t+=1}:void 0;x((function(n){var i={};return Object.keys(n).forEach((function(l){e.test(l)?null===r||void 0===r||r.call(null,i,l):(i[l]=n[l],t+=1)})),i})),null===v||void 0===v||v.call(null,t)}),[v]),w=(0,i.useMemo)((function(){var e=Object.entries(g),n=o>0,t=n?o:e.length,i=[];if(e.every((function(e){var n=a(e,2),o=n[0],u=n[1],s=u.children,c=u.type,d=void 0===c?f:c;return i.push((0,r.jsx)(l.Z,{type:d,children:s},"message-".concat(o))),i.length1&&void 0!==arguments[1]?arguments[1]:{},t=n.fillString,r=void 0===t?"0":t,i=n.maxLength,l=void 0===i?2:i,o=n.which,u=void 0===o?"Start":o;return String(e)["pad".concat(u)](l,r)};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 S(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},l=Object.keys(e);for(r=0;r=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var k={show:!0},O=function(e){var n=e.onClick,t=e.show,i=void 0===t?k.show:t,l=S(e,["onClick","show"]);return i?(0,r.jsx)(v.Z,function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&void 0!==arguments[0]?arguments[0]:"",n=e.split(/\s/).filter((function(e){return!/and|of/.test(e)})).slice(0,5),t=n.length>1?2:n.length;return _[t](n)},q=function(e){var n=e.organizationPrefix,t=e.hostNumber,r=e.domainName;return[n,t,r].every((function(e){return Boolean(e)}))?"".concat(n,"-striker").concat(w(t),".").concat(r):""},U=(0,a.forwardRef)((function(e,n){var t,i,l,u,s=e.expectHostDetail,c=void 0!==s&&s,d=e.hostDetail,f=e.onHostNumberBlurAppend,v=e.toggleSubmitDisabled,w=(0,a.useState)(),P=w[0],S=w[1],k=(0,a.useState)(!1),O=k[0],I=k[1],R=(0,a.useState)(!1),_=R[0],U=R[1],$=(0,a.useState)(!0),Q=$[0],J=$[1],G=(0,a.useState)(!0),K=G[0],W=G[1],X=(0,a.useRef)(!0),Y=(0,a.useRef)({}),ee=(0,a.useRef)({}),ne=(0,a.useRef)({}),te=(0,a.useRef)({}),re=(0,a.useRef)({}),ie=(0,a.useRef)({}),le=(0,a.useRef)({}),oe=(0,a.useRef)({}),ue=(0,a.useCallback)((function(e){var n;return null===(n=oe.current.setMessage)||void 0===n?void 0:n.call(null,D,e)}),[]),ae=(0,a.useCallback)((function(e){var n;return null===(n=oe.current.setMessage)||void 0===n?void 0:n.call(null,z,e)}),[]),se=(0,a.useCallback)((function(e){var n;return null===(n=oe.current.setMessage)||void 0===n?void 0:n.call(null,T,e)}),[]),ce=(0,a.useCallback)((function(e){var n;return null===(n=oe.current.setMessage)||void 0===n?void 0:n.call(null,E,e)}),[]),de=(0,a.useCallback)((function(e){var n;return null===(n=oe.current.setMessage)||void 0===n?void 0:n.call(null,M,e)}),[]),fe=(0,a.useCallback)((function(e){var n;return null===(n=oe.current.setMessage)||void 0===n?void 0:n.call(null,F,e)}),[]),ve=(0,a.useMemo)((function(){var e;return N(e={},M,{defaults:{getValue:function(){var e;return null===(e=Y.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){de(void 0)}},tests:[{onFailure:function(){de({children:(0,r.jsxs)(r.Fragment,{children:["Admin password cannot contain single-quote (",(0,r.jsx)(A.Q0,{text:"'"}),"), double-quote (",(0,r.jsx)(A.Q0,{text:'"'}),"), slash (",(0,r.jsx)(A.Q0,{text:"/"}),"), backslash (",(0,r.jsx)(A.Q0,{text:"\\"}),"), angle brackets (",(0,r.jsx)(A.Q0,{text:"<>"}),"), curly brackets (",(0,r.jsx)(A.Q0,{text:"{}"}),")."]})})},test:function(e){var n=e.value;return!/['"/\\><}{]/g.test(n)}},{test:C.HJ}]}),N(e,F,{defaults:{getValue:function(){var e,n;return null===(e=ee.current)||void 0===e||null===(n=e.getValue)||void 0===n?void 0:n.call(null)},onSuccess:function(){fe(void 0)}},tests:[{onFailure:function(){fe({children:"Confirmation doesn't match admin password."})},test:function(e){var n;return e.value===(null===(n=Y.current.getValue)||void 0===n?void 0:n.call(null))}},{test:C.HJ}]}),N(e,T,{defaults:{compare:[!K],getValue:function(){var e;return null===(e=re.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){se(void 0)}},tests:[{onFailure:function(){se({children:(0,r.jsxs)(r.Fragment,{children:["Domain name can only contain lowercase alphanumeric, hyphen (",(0,r.jsx)(A.Q0,{text:"-"}),"), and dot (",(0,r.jsx)(A.Q0,{text:"."}),") characters."]})})},test:function(e){var n=e.compare,t=e.value;return n[0]||g.FZ.test(t)}},{test:C.HJ}]}),N(e,E,{defaults:{compare:[!K],getValue:function(){var e;return null===(e=le.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){ce(void 0)}},tests:[{onFailure:function(){ce({children:(0,r.jsxs)(r.Fragment,{children:["Host name can only contain lowercase alphanumeric, hyphen (",(0,r.jsx)(A.Q0,{text:"-"}),"), and dot (",(0,r.jsx)(A.Q0,{text:"."}),") characters."]})})},test:function(e){var n=e.compare,t=e.value;return n[0]||g.FZ.test(t)}},{test:C.HJ}]}),N(e,z,{defaults:{getValue:function(){var e;return null===(e=ie.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){ae(void 0)}},tests:[{onFailure:function(){ae({children:"Striker number can only contain digits."})},test:function(e){var n=e.value;return/^\d+$/.test(n)}},{test:C.HJ}]}),N(e,B,{defaults:{getValue:function(){var e;return null===(e=ne.current.getValue)||void 0===e?void 0:e.call(null)}},tests:[{test:C.HJ}]}),N(e,D,{defaults:{getValue:function(){var e;return null===(e=te.current.getValue)||void 0===e?void 0:e.call(null)},max:5,min:1,onSuccess:function(){ue(void 0)}},tests:[{onFailure:function(e){var n=e.max,t=e.min;ue({children:"Organization prefix must be ".concat(t," to ").concat(n," lowercase alphanumeric characters.")})},test:function(e){var n=e.max,t=e.min,r=e.value;return RegExp("^[a-z0-9]{".concat(t,",").concat(n,"}$")).test(r)}}]}),e}),[K,de,fe,se,ce,ae,ue]),pe=(0,a.useMemo)((function(){return(0,C.LT)(ve)}),[ve]),me=(0,a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.excludeTestIds,t=void 0===n?[]:n,r=e.inputs,i=e.isContinueOnFailure,l=e.isExcludeConfirmAdminPassword,o=void 0===l?!Q:l;o&&t.push(F),null===v||void 0===v||v.call(null,pe({excludeTestIds:t,inputs:r,isContinueOnFailure:i,isIgnoreOnCallbacks:!0,isTestAll:!0}))}),[Q,pe,v]),he=(0,a.useCallback)((function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.organizationName,i=void 0===r?null===(t=ne.current.getValue)||void 0===t?void 0:t.call(null):r,l=L(i);return null===(e=te.current.setValue)||void 0===e||e.call(null,l),me({inputs:N({},D,{isIgnoreOnCallbacks:!1,value:l}),isContinueOnFailure:!0}),l}),[me]),ge=(0,a.useCallback)((function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.organizationPrefix,r=void 0===t?null===(i=te.current.getValue)||void 0===i?void 0:i.call(null):t,o=n.hostNumber,a=void 0===o?null===(l=ie.current.getValue)||void 0===l?void 0:l.call(null):o,s=n.domainName,c=void 0===s?null===(u=re.current.getValue)||void 0===u?void 0:u.call(null):s,d=q({organizationPrefix:r,hostNumber:a,domainName:c});return null===(e=le.current.setValue)||void 0===e||e.call(null,d),me({inputs:N({},E,{isIgnoreOnCallbacks:!1,value:d}),isContinueOnFailure:!0}),d}),[me]),xe=(0,a.useCallback)((function(){var e;return Boolean(null===(e=ne.current.getValue)||void 0===e?void 0:e.call(null))}),[]),ye=(0,a.useCallback)((function(){var e,n,t;return[null===(e=te.current.getValue)||void 0===e?void 0:e.call(null),null===(n=ie.current.getValue)||void 0===n?void 0:n.call(null),null===(t=re.current.getValue)||void 0===t?void 0:t.call(null)].every((function(e){return Boolean(e)}))}),[]),be=(0,a.useCallback)((function(){var e;(null===(e=te.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))?I(xe()):he()}),[xe,he]),je=(0,a.useCallback)((function(){var e;(null===(e=le.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))?U(ye()):ge()}),[ye,ge]),we=(0,a.useCallback)((function(){var e,n=he();(null===(e=le.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))||ge({organizationPrefix:n})}),[ge,he]),Pe=(0,a.useCallback)((function(){ge()}),[ge]),Se=(0,a.useCallback)((function(e){return function(n){return n===e?void 0:e}}),[]),ke=(0,a.useMemo)((function(){return(0,r.jsx)(m.Z,{checked:K,onChange:function(e,n){var t;W(n),me({inputs:(t={},N(t,T,{compare:[!n],isIgnoreOnCallbacks:!1}),N(t,E,{compare:[!n],isIgnoreOnCallbacks:!1}),t),isContinueOnFailure:!0})},sx:{padding:".2em"}})}),[K,me]);return(0,a.useEffect)((function(){if([c,d,X.current,re.current,le.current,ie.current,ne.current,te.current].every((function(e){return Boolean(e)}))){var e,n,t,r,i;X.current=!1;var l=d.domain,o=d.hostName,u=d.organization,a=d.prefix,s=d.sequence;null===(e=re.current.setValue)||void 0===e||e.call(null,l),null===(n=le.current.setValue)||void 0===n||n.call(null,o),null===(t=ie.current.setValue)||void 0===t||t.call(null,s),null===(r=ne.current.setValue)||void 0===r||r.call(null,u),null===(i=te.current.setValue)||void 0===i||i.call(null,a),me()}}),[c,d,me]),(0,a.useImperativeHandle)(n,(function(){return{get:function(){var e,n,t,r,i,l;return{adminPassword:null===(e=Y.current.getValue)||void 0===e?void 0:e.call(null),organizationName:null===(n=ne.current.getValue)||void 0===n?void 0:n.call(null),organizationPrefix:null===(t=te.current.getValue)||void 0===t?void 0:t.call(null),domainName:null===(r=re.current.getValue)||void 0===r?void 0:r.call(null),hostNumber:null===(i=ie.current.getValue)||void 0===i?void 0:i.call(null),hostName:null===(l=le.current.getValue)||void 0===l?void 0:l.call(null)}}}})),(0,r.jsxs)(p.Z,{children:[(0,r.jsxs)(o.ZP,{columns:{xs:1,sm:2,md:3},container:!0,spacing:"1em",children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsxs)(p.Z,{children:[(0,r.jsx)(x.Z,{input:(0,r.jsx)(j.Z,{id:"striker-init-general-organization-name",inputProps:{onBlur:be},inputLabelProps:{isNotifyRequired:!0},label:"Organization name",onChange:function(){me()},onHelp:function(){S(Se("Name of the organization that maintains this Anvil! system. You can enter anything that makes sense to you."))}}),ref:ne}),(0,r.jsxs)(p.Z,{row:!0,sx:{"& > :first-child":{flexGrow:1}},children:[(0,r.jsx)(x.Z,{input:(0,r.jsx)(j.Z,{id:"striker-init-general-organization-prefix",inputProps:{endAdornment:(0,r.jsx)(Z,{show:O,onClick:we}),inputProps:{maxLength:5,sx:{minWidth:"2.5em"}},onBlur:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r1?n-1:0),r=1;r * > *":{width:"100%"}},children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(x.Z,{input:(0,r.jsx)(j.Z,{id:"striker-init-general-admin-password",inputProps:{inputProps:{type:h.Z.password},onBlur:function(e){var n=e.target.value;pe({inputs:N({},M,{value:n})})},onPasswordVisibilityAppend:function(e){var n=e===h.Z.password;me({isExcludeConfirmAdminPassword:!n}),J(n),fe()}},inputLabelProps:{isNotifyRequired:!0},label:"Admin password",onChange:function(e){var n=e.target.value;me({inputs:N({},M,{value:n})}),de()},onHelp:function(){S(Se("Password use to login to this Striker and connect to its database. Don't provide an used password here because it'll be stored as plaintext."))}}),ref:Y})}),Q&&(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(x.Z,{input:(0,r.jsx)(j.Z,{id:"striker-init-general-confirm-admin-password",inputProps:{inputProps:{type:h.Z.password},onBlur:function(e){var n=e.target.value;pe({inputs:N({},F,{value:n})})}},inputLabelProps:{isNotifyRequired:Q},label:"Confirm password",onChange:function(e){var n=e.target.value;me({inputs:N({},F,{value:n})}),fe()}}),ref:ee})})]})})]}),(0,r.jsx)(b.Z,{count:1,defaultMessageType:"warning",ref:oe}),(0,r.jsx)(y.Z,{children:(0,r.jsxs)(p.Z,{row:!0,sx:{"& > :last-child":{flexGrow:1}},children:[ke,(0,r.jsx)(A.Ac,{inverted:!0,children:K?"Uncheck to skip domain and host name pattern validation.":"Check to re-enable domain and host name pattern validation."})]})}),P&&(0,r.jsx)(y.Z,{onClose:function(){S(void 0)},children:P})]})}));U.defaultProps={expectHostDetail:!1,hostDetail:void 0,onHostNumberBlurAppend:void 0,toggleSubmitDisabled:void 0},U.displayName="GeneralInitForm";var $=U,Q=t(1770),J=t(1706),G=t(3377),K=t(2444),W=t(5741),X=t(8461),Y=t(3679),ee=t(2152),ne=t(2749);function te(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&void 0!==arguments[0]?arguments[0]:{},n=e.postSet,t=e.preSet,r=e.set,l=e.setType,o=void 0===l?"string":l,u=e.valueKey,a=void 0===u?"value":u;return function(e){var l=e.target[a],u=i[o](l);null===t||void 0===t||t.call(null,e),null===r||void 0===r||r.call(null,u),null===n||void 0===n||n.call(null,e)}},o=t(7987);function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function d(e){return function(e){if(Array.isArray(e))return u(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 u(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 u(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.")}()}function f(e){var n=function(e,n){if("object"!==v(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===v(n)?n:String(n)}var v=function(e){return e&&"undefined"!==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var p="input",m={boolean:!1,number:0,string:""},h={createInputOnChangeHandlerOptions:{},required:!1,valueType:"string"},g=(0,r.forwardRef)((function(e,n){var t=e.input,i=e.inputTestBatch,u=e.onBlurAppend,v=e.onFirstRender,g=e.onFocusAppend,x=e.onUnmount,y=e.required,b=void 0===y?h.required:y,j=e.valueKey,w=e.valueType,P=void 0===w?h.valueType:w,S=e.createInputOnChangeHandlerOptions,k=void 0===S?h.createInputOnChangeHandlerOptions:S,O=k.postSet,Z=k.valueKey,C=void 0===Z?j:Z,A=s(e.createInputOnChangeHandlerOptions,["postSet","valueKey"]),I=t.props,N=(0,r.useMemo)((function(){return null!==C&&void 0!==C?C:"checked"in I?"checked":"value"}),[I,C]),V=I.onBlur,R=I.onChange,M=I.onFocus,F=I[N],H=void 0===F?m[P]:F,T=s(I,["onBlur","onChange","onFocus",N].map(f)),E=(0,r.useState)(H),z=E[0],D=E[1],B=(0,r.useState)(!1),_=B[0],L=B[1],U=(0,r.useState)(!1),q=U[0],$=U[1],Q=(0,r.useCallback)((function(e){D(e)}),[]),J=(0,r.useMemo)((function(){var e;return i&&(i.isRequired=b,e=(0,o.LT)(a({},p,i))),e}),[i,b]),G=(0,r.useMemo)((function(){return null!==V&&void 0!==V?V:J&&function(){for(var e=arguments.length,n=new Array(e),t=0;te.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function a(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,i,l=[],o=!0,u=!1;try{for(t=t.call(e);!(o=(r=t.next()).done)&&(l.push(r.value),!n||l.length!==n);o=!0);}catch(a){u=!0,i=a}finally{try{o||null==t.return||t.return()}finally{if(u)throw i}}return l}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return o(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 o(e,n)}(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 c(e){var n=function(e,n){if("object"!==s(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===s(n)?n:String(n)}var s=function(e){return e&&"undefined"!==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var d={count:0,defaultMessageType:"info",onSet:void 0,usePlaceholder:!0},f=(0,i.forwardRef)((function(e,n){var t=e.count,o=void 0===t?d.count:t,s=e.defaultMessageType,f=void 0===s?d.defaultMessageType:s,v=e.onSet,p=e.usePlaceholder,m=void 0===p?d.usePlaceholder:p,h=(0,i.useState)({}),g=h[0],x=h[1],y=(0,i.useCallback)((function(e){return void 0!==g[e]}),[g]),b=(0,i.useCallback)((function(e,n){var t=0;x((function(r){r[e];var i=u(r,[e].map(c));return n&&(i[e]=n),t=Object.keys(i).length,i})),null===v||void 0===v||v.call(null,t)}),[v]),j=(0,i.useCallback)((function(e,n){var t=0,r=n?function(e,r){e[r]=n,t+=1}:void 0;x((function(n){var i={};return Object.keys(n).forEach((function(l){e.test(l)?null===r||void 0===r||r.call(null,i,l):(i[l]=n[l],t+=1)})),i})),null===v||void 0===v||v.call(null,t)}),[v]),w=(0,i.useMemo)((function(){var e=Object.entries(g),n=o>0,t=n?o:e.length,i=[];if(e.every((function(e){var n=a(e,2),o=n[0],u=n[1],c=u.children,s=u.type,d=void 0===s?f:s;return i.push((0,r.jsx)(l.Z,{type:d,children:c},"message-".concat(o))),i.length1&&void 0!==arguments[1]?arguments[1]:{},t=n.fillString,r=void 0===t?"0":t,i=n.maxLength,l=void 0===i?2:i,o=n.which,u=void 0===o?"Start":o;return String(e)["pad".concat(u)](l,r)};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 S(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},l=Object.keys(e);for(r=0;r=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var k={show:!0},O=function(e){var n=e.onClick,t=e.show,i=void 0===t?k.show:t,l=S(e,["onClick","show"]);return i?(0,r.jsx)(v.Z,function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&void 0!==arguments[0]?arguments[0]:"",n=e.split(/\s/).filter((function(e){return!/and|of/.test(e)})).slice(0,5),t=n.length>1?2:n.length;return _[t](n)},U=function(e){var n=e.organizationPrefix,t=e.hostNumber,r=e.domainName;return[n,t,r].every((function(e){return Boolean(e)}))?"".concat(n,"-striker").concat(w(t),".").concat(r):""},q=(0,a.forwardRef)((function(e,n){var t,i,l,u,c=e.expectHostDetail,s=void 0!==c&&c,d=e.hostDetail,f=e.toggleSubmitDisabled,v=(0,a.useState)(),w=v[0],P=v[1],S=(0,a.useState)(!1),k=S[0],O=S[1],I=(0,a.useState)(!1),V=I[0],M=I[1],_=(0,a.useState)(!0),q=_[0],$=_[1],Q=(0,a.useState)(!0),J=Q[0],G=Q[1],K=(0,a.useRef)(!0),W=(0,a.useRef)({}),X=(0,a.useRef)({}),Y=(0,a.useRef)({}),ee=(0,a.useRef)({}),ne=(0,a.useRef)({}),te=(0,a.useRef)({}),re=(0,a.useRef)({}),ie=(0,a.useRef)({}),le=(0,a.useCallback)((function(e){var n;return null===(n=ie.current.setMessage)||void 0===n?void 0:n.call(null,B,e)}),[]),oe=(0,a.useCallback)((function(e){var n;return null===(n=ie.current.setMessage)||void 0===n?void 0:n.call(null,z,e)}),[]),ue=(0,a.useCallback)((function(e){var n;return null===(n=ie.current.setMessage)||void 0===n?void 0:n.call(null,T,e)}),[]),ae=(0,a.useCallback)((function(e){var n;return null===(n=ie.current.setMessage)||void 0===n?void 0:n.call(null,E,e)}),[]),ce=(0,a.useCallback)((function(e){var n;return null===(n=ie.current.setMessage)||void 0===n?void 0:n.call(null,F,e)}),[]),se=(0,a.useCallback)((function(e){var n;return null===(n=ie.current.setMessage)||void 0===n?void 0:n.call(null,H,e)}),[]),de=(0,a.useMemo)((function(){var e;return N(e={},F,{defaults:{getValue:function(){var e;return null===(e=W.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){ce(void 0)}},tests:[{onFailure:function(){ce({children:(0,r.jsxs)(r.Fragment,{children:["Admin password cannot contain single-quote (",(0,r.jsx)(A.Q0,{text:"'"}),"), double-quote (",(0,r.jsx)(A.Q0,{text:'"'}),"), slash (",(0,r.jsx)(A.Q0,{text:"/"}),"), backslash (",(0,r.jsx)(A.Q0,{text:"\\"}),"), angle brackets (",(0,r.jsx)(A.Q0,{text:"<>"}),"), curly brackets (",(0,r.jsx)(A.Q0,{text:"{}"}),")."]})})},test:function(e){var n=e.value;return!/['"/\\><}{]/g.test(n)}},{test:C.HJ}]}),N(e,H,{defaults:{getValue:function(){var e,n;return null===(e=X.current)||void 0===e||null===(n=e.getValue)||void 0===n?void 0:n.call(null)},onSuccess:function(){se(void 0)}},tests:[{onFailure:function(){se({children:"Confirmation doesn't match admin password."})},test:function(e){var n;return e.value===(null===(n=W.current.getValue)||void 0===n?void 0:n.call(null))}},{test:C.HJ}]}),N(e,T,{defaults:{compare:[!J],getValue:function(){var e;return null===(e=ne.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){ue(void 0)}},tests:[{onFailure:function(){ue({children:(0,r.jsxs)(r.Fragment,{children:["Domain name can only contain lowercase alphanumeric, hyphen (",(0,r.jsx)(A.Q0,{text:"-"}),"), and dot (",(0,r.jsx)(A.Q0,{text:"."}),") characters."]})})},test:function(e){var n=e.compare,t=e.value;return n[0]||g.FZ.test(t)}},{test:C.HJ}]}),N(e,E,{defaults:{compare:[!J],getValue:function(){var e;return null===(e=re.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){ae(void 0)}},tests:[{onFailure:function(){ae({children:(0,r.jsxs)(r.Fragment,{children:["Host name can only contain lowercase alphanumeric, hyphen (",(0,r.jsx)(A.Q0,{text:"-"}),"), and dot (",(0,r.jsx)(A.Q0,{text:"."}),") characters."]})})},test:function(e){var n=e.compare,t=e.value;return n[0]||g.FZ.test(t)}},{test:C.HJ}]}),N(e,z,{defaults:{getValue:function(){var e;return null===(e=te.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){oe(void 0)}},tests:[{onFailure:function(){oe({children:"Striker number can only contain digits."})},test:function(e){var n=e.value;return/^\d+$/.test(n)}},{test:C.HJ}]}),N(e,D,{defaults:{getValue:function(){var e;return null===(e=Y.current.getValue)||void 0===e?void 0:e.call(null)}},tests:[{test:C.HJ}]}),N(e,B,{defaults:{getValue:function(){var e;return null===(e=ee.current.getValue)||void 0===e?void 0:e.call(null)},max:5,min:1,onSuccess:function(){le(void 0)}},tests:[{onFailure:function(e){var n=e.max,t=e.min;le({children:"Organization prefix must be ".concat(t," to ").concat(n," lowercase alphanumeric characters.")})},test:function(e){var n=e.max,t=e.min,r=e.value;return RegExp("^[a-z0-9]{".concat(t,",").concat(n,"}$")).test(r)}}]}),e}),[J,ce,se,ue,ae,oe,le]),fe=(0,a.useMemo)((function(){return(0,C.LT)(de)}),[de]),ve=(0,a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.excludeTestIds,t=void 0===n?[]:n,r=e.inputs,i=e.isContinueOnFailure,l=e.isExcludeConfirmAdminPassword,o=void 0===l?!q:l;o&&t.push(H),null===f||void 0===f||f.call(null,fe({excludeTestIds:t,inputs:r,isContinueOnFailure:i,isIgnoreOnCallbacks:!0,isTestAll:!0}))}),[q,fe,f]),pe=(0,a.useCallback)((function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.organizationName,i=void 0===r?null===(t=Y.current.getValue)||void 0===t?void 0:t.call(null):r,l=L(i);return null===(e=ee.current.setValue)||void 0===e||e.call(null,l),ve({inputs:N({},B,{isIgnoreOnCallbacks:!1,value:l}),isContinueOnFailure:!0}),l}),[ve]),me=(0,a.useCallback)((function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.organizationPrefix,r=void 0===t?null===(i=ee.current.getValue)||void 0===i?void 0:i.call(null):t,o=n.hostNumber,a=void 0===o?null===(l=te.current.getValue)||void 0===l?void 0:l.call(null):o,c=n.domainName,s=void 0===c?null===(u=ne.current.getValue)||void 0===u?void 0:u.call(null):c,d=U({organizationPrefix:r,hostNumber:a,domainName:s});return null===(e=re.current.setValue)||void 0===e||e.call(null,d),ve({inputs:N({},E,{isIgnoreOnCallbacks:!1,value:d}),isContinueOnFailure:!0}),d}),[ve]),he=(0,a.useCallback)((function(){var e;return Boolean(null===(e=Y.current.getValue)||void 0===e?void 0:e.call(null))}),[]),ge=(0,a.useCallback)((function(){var e,n,t;return[null===(e=ee.current.getValue)||void 0===e?void 0:e.call(null),null===(n=te.current.getValue)||void 0===n?void 0:n.call(null),null===(t=ne.current.getValue)||void 0===t?void 0:t.call(null)].every((function(e){return Boolean(e)}))}),[]),xe=(0,a.useCallback)((function(){var e;(null===(e=ee.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))?O(he()):pe()}),[he,pe]),ye=(0,a.useCallback)((function(){var e;(null===(e=re.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))?M(ge()):me()}),[ge,me]),be=(0,a.useCallback)((function(){var e,n=pe();(null===(e=re.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))||me({organizationPrefix:n})}),[me,pe]),je=(0,a.useCallback)((function(){me()}),[me]),we=(0,a.useCallback)((function(e){return function(n){return n===e?void 0:e}}),[]),Pe=(0,a.useMemo)((function(){return(0,r.jsx)(m.Z,{checked:J,onChange:function(e,n){var t;G(n),ve({inputs:(t={},N(t,T,{compare:[!n],isIgnoreOnCallbacks:!1}),N(t,E,{compare:[!n],isIgnoreOnCallbacks:!1}),t),isContinueOnFailure:!0})},sx:{padding:".2em"}})}),[J,ve]);return(0,a.useEffect)((function(){if([s,d,K.current,ne.current,re.current,te.current,Y.current,ee.current].every((function(e){return Boolean(e)}))){var e,n,t,r,i;K.current=!1;var l=d.domain,o=d.hostName,u=d.organization,a=d.prefix,c=d.sequence;null===(e=ne.current.setValue)||void 0===e||e.call(null,l),null===(n=re.current.setValue)||void 0===n||n.call(null,o),null===(t=te.current.setValue)||void 0===t||t.call(null,c),null===(r=Y.current.setValue)||void 0===r||r.call(null,u),null===(i=ee.current.setValue)||void 0===i||i.call(null,a),ve()}}),[s,d,ve]),(0,a.useImperativeHandle)(n,(function(){return{get:function(){var e,n,t,r,i,l;return{adminPassword:null===(e=W.current.getValue)||void 0===e?void 0:e.call(null),organizationName:null===(n=Y.current.getValue)||void 0===n?void 0:n.call(null),organizationPrefix:null===(t=ee.current.getValue)||void 0===t?void 0:t.call(null),domainName:null===(r=ne.current.getValue)||void 0===r?void 0:r.call(null),hostNumber:null===(i=te.current.getValue)||void 0===i?void 0:i.call(null),hostName:null===(l=re.current.getValue)||void 0===l?void 0:l.call(null)}}}})),(0,r.jsxs)(p.Z,{children:[(0,r.jsxs)(o.ZP,{columns:{xs:1,sm:2,md:3},container:!0,spacing:"1em",children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsxs)(p.Z,{children:[(0,r.jsx)(x.Z,{input:(0,r.jsx)(j.Z,{id:"striker-init-general-organization-name",inputProps:{onBlur:xe},inputLabelProps:{isNotifyRequired:!0},label:"Organization name",onChange:function(){ve()},onHelp:function(){P(we("Name of the organization that maintains this Anvil! system. You can enter anything that makes sense to you."))}}),ref:Y}),(0,r.jsxs)(p.Z,{row:!0,sx:{"& > :first-child":{flexGrow:1}},children:[(0,r.jsx)(x.Z,{input:(0,r.jsx)(j.Z,{id:"striker-init-general-organization-prefix",inputProps:{endAdornment:(0,r.jsx)(Z,{show:k,onClick:be}),inputProps:{maxLength:5,sx:{minWidth:"2.5em"}},onBlur:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r1?n-1:0),r=1;r1?n-1:0),r=1;r * > *":{width:"100%"}},children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(x.Z,{input:(0,r.jsx)(j.Z,{id:"striker-init-general-admin-password",inputProps:{inputProps:{type:h.Z.password},onBlur:function(e){var n=e.target.value;fe({inputs:N({},F,{value:n})})},onPasswordVisibilityAppend:function(e){var n=e===h.Z.password;ve({isExcludeConfirmAdminPassword:!n}),$(n),se()}},inputLabelProps:{isNotifyRequired:!0},label:"Admin password",onChange:function(e){var n=e.target.value;ve({inputs:N({},F,{value:n})}),ce()},onHelp:function(){P(we("Password use to login to this Striker and connect to its database. Don't provide an used password here because it'll be stored as plaintext."))}}),ref:W})}),q&&(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(x.Z,{input:(0,r.jsx)(j.Z,{id:"striker-init-general-confirm-admin-password",inputProps:{inputProps:{type:h.Z.password},onBlur:function(e){var n=e.target.value;fe({inputs:N({},H,{value:n})})}},inputLabelProps:{isNotifyRequired:q},label:"Confirm password",onChange:function(e){var n=e.target.value;ve({inputs:N({},H,{value:n})}),se()}}),ref:X})})]})})]}),(0,r.jsx)(b.Z,{count:1,defaultMessageType:"warning",ref:ie}),(0,r.jsx)(y.Z,{children:(0,r.jsxs)(p.Z,{row:!0,sx:{"& > :last-child":{flexGrow:1}},children:[Pe,(0,r.jsx)(A.Ac,{inverted:!0,children:J?"Uncheck to skip domain and host name pattern validation.":"Check to re-enable domain and host name pattern validation."})]})}),w&&(0,r.jsx)(y.Z,{onClose:function(){P(void 0)},children:w})]})}));q.defaultProps={expectHostDetail:!1,hostDetail:void 0,toggleSubmitDisabled:void 0},q.displayName="GeneralInitForm";var $=q,Q=t(1770),J=t(1706),G=t(3377),K=t(2444),W=t(5741),X=t(8461),Y=t(3679),ee=t(2152),ne=t(2749);function te(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);tAnvil
\ No newline at end of file +Anvil
\ No newline at end of file diff --git a/striker-ui/out/config.html b/striker-ui/out/config.html index 5da5ed4c..c61db3fd 100644 --- a/striker-ui/out/config.html +++ b/striker-ui/out/config.html @@ -1 +1 @@ -Loading...
Install target
Configure striker peers
Configure striker peers
Inbound connections

    No inbound connections found.
Peer connections

    No peer connections found.
Manage changed SSH keys
Manage changed SSH keys
The identity of the following targets have unexpectedly changed.
If you haven't rebuilt the listed targets, then you could be experiencing a
"Man In The Middle"
attack. Please verify the targets have changed for a known reason before proceeding to remove the broken keys.

Host name

IP address


    No conflicting keys found.
Manage users
Manage users

    No users found.
\ No newline at end of file +Loading...
Install target
Configure striker peers
Configure striker peers
Inbound connections

    No inbound connections found.
Peer connections

    No peer connections found.
Manage changed SSH keys
Manage changed SSH keys
The identity of the following targets have unexpectedly changed.
If you haven't rebuilt the listed targets, then you could be experiencing a
"Man In The Middle"
attack. Please verify the targets have changed for a known reason before proceeding to remove the broken keys.

Host name

IP address


    No conflicting keys found.
Manage users
Manage users

    No users found.
\ No newline at end of file diff --git a/striker-ui/out/file-manager.html b/striker-ui/out/file-manager.html index 0b9d3e97..199f2d73 100644 --- a/striker-ui/out/file-manager.html +++ b/striker-ui/out/file-manager.html @@ -1 +1 @@ -File Manager

Files

    \ No newline at end of file +File Manager

    Files

      \ No newline at end of file diff --git a/striker-ui/out/index.html b/striker-ui/out/index.html index 4c13cb6c..bfd47011 100644 --- a/striker-ui/out/index.html +++ b/striker-ui/out/index.html @@ -1 +1 @@ -Dashboard
      \ No newline at end of file +Dashboard
      \ No newline at end of file diff --git a/striker-ui/out/init.html b/striker-ui/out/init.html index 1a44e8be..f8a440f5 100644 --- a/striker-ui/out/init.html +++ b/striker-ui/out/init.html @@ -1 +1 @@ -

      Loading...

      Placeholder
      Uncheck to skip domain and host name pattern validation.
      \ No newline at end of file +

      Loading...

      Placeholder
      Uncheck to skip domain and host name pattern validation.
      \ No newline at end of file diff --git a/striker-ui/out/login.html b/striker-ui/out/login.html index 8a8aa992..fd16f9d5 100644 --- a/striker-ui/out/login.html +++ b/striker-ui/out/login.html @@ -1 +1 @@ -Login
      Placeholder
      \ No newline at end of file +Login
      Placeholder
      \ No newline at end of file diff --git a/striker-ui/out/manage-element.html b/striker-ui/out/manage-element.html index 2dc204f9..b9c3a079 100644 --- a/striker-ui/out/manage-element.html +++ b/striker-ui/out/manage-element.html @@ -1 +1 @@ -Loading
      \ No newline at end of file +Loading
      \ No newline at end of file diff --git a/striker-ui/out/server.html b/striker-ui/out/server.html index 1cf7f265..4436883d 100644 --- a/striker-ui/out/server.html +++ b/striker-ui/out/server.html @@ -1 +1 @@ -
      \ No newline at end of file +
      \ No newline at end of file