diff --git a/dist/dashboard/404.html b/dist/dashboard/404.html index 5d405b2d1..49416cb29 100644 --- a/dist/dashboard/404.html +++ b/dist/dashboard/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/dist/dashboard/_next/static/chunks/pages/index-4b1dd2874fc68314.js b/dist/dashboard/_next/static/chunks/pages/index-953c970d47270b0c.js similarity index 50% rename from dist/dashboard/_next/static/chunks/pages/index-4b1dd2874fc68314.js rename to dist/dashboard/_next/static/chunks/pages/index-953c970d47270b0c.js index 0b5c4d9f3..da75eafd3 100644 --- a/dist/dashboard/_next/static/chunks/pages/index-4b1dd2874fc68314.js +++ b/dist/dashboard/_next/static/chunks/pages/index-953c970d47270b0c.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5405],{48312:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(48354)}])},48354:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Home}});var a,r,s=t(85893),i=t(9008),l=t.n(i),o=t(25675),d=t.n(o),c={src:"/_next/static/media/logo-nodes.249ea9ed.svg",height:283,width:425,blurWidth:0,blurHeight:0},u=t(30378),h=t.n(u),x=t(89192),Navigation=()=>(0,s.jsxs)("div",{className:h().navbarParent,children:[(0,s.jsx)("div",{className:h().logoWrapper,children:(0,s.jsx)(d(),{src:c,alt:"Ocean Node Logo",height:70})}),(0,s.jsx)("div",{className:h().connectButtonWrapper,children:(0,s.jsx)(x.NL,{})})]}),j=t(94428),m=t.n(j),components_Footer=()=>{let e=new Date().getFullYear();return(0,s.jsxs)("div",{className:m().footerContainer,children:[(0,s.jsxs)("p",{children:["@ ",e,", Ocean Nodes"]}),(0,s.jsxs)("div",{className:m().footerLinks,children:[(0,s.jsx)("a",{href:"https://oceanprotocol.com/",target:"_blank",children:"Website"}),(0,s.jsx)("a",{href:"https://github.com/oceanprotocol/ocean-node",target:"_blank",children:"GitHub"}),(0,s.jsx)("a",{href:"https://discord.com/invite/TnXjkR5",target:"_blank",children:"Discord"})]})]})},p=t(67294),v=t(11706),b=t.n(v),f=t(59581),_=t(46085),g=t.n(_),N=t(69417),y=t(94054),S=t(50135),C=t(33841),Z=t(30638),I=t(23599),w=t(10586),T=t(50720),D=t(67971),k=t(27484),E=t.n(k),P={src:"/_next/static/media/download.0a4876ec.svg",height:30,width:30,blurWidth:0,blurHeight:0};function DownloadButton(){let[e,n]=(0,p.useState)(!1),[t,a]=(0,p.useState)(!1),[r,i]=(0,p.useState)(E()()),[l,o]=(0,p.useState)(E()()),[c,u]=(0,p.useState)(""),[h,x]=(0,p.useState)(""),[j,m]=(0,p.useState)(""),{signature:v,expiryTimestamp:b}=(0,f.O)(),_=(0,p.useCallback)(async()=>{let e=r?"&startTime=".concat(r.toISOString()):"",n=l?"&endTime=".concat(l.toISOString()):"",t=c?"&maxLogs=".concat(c):"",s=h&&"all"!==h?"&moduleName=".concat(h):"",i=j&&"all"!==j?'&level="'.concat(j,'"'):"";a(!0);try{if(!b||!v){console.error("Missing expiryTimestamp or signature");return}let r=await fetch("/logs?".concat(e).concat(n).concat(t).concat(s).concat(i),{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({expiryTimestamp:b,signature:v})}),l=await r.json();if(l){let e="data:application/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(l)),n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download","LogsData.json"),document.body.appendChild(n),n.click(),n.remove()}a(!1)}catch(e){console.error(e),a(!1)}},[r,l,c,h,j]);return(0,s.jsxs)("div",{className:g().column,children:[(0,s.jsx)(N.Z,{type:"button",onClick:()=>n(!e),children:"Download Logs"}),e&&(0,s.jsxs)("div",{className:g().filters,children:[(0,s.jsxs)(T._,{dateAdapter:w.y,children:[(0,s.jsx)(y.Z,{fullWidth:!0,margin:"normal",children:(0,s.jsx)(D.x,{label:"Start Date",value:r,onChange:e=>i(e)})}),(0,s.jsx)(y.Z,{fullWidth:!0,margin:"normal",children:(0,s.jsx)(D.x,{label:"End Date",value:l,onChange:e=>o(e)})})]}),(0,s.jsx)(S.Z,{label:"Max Logs",type:"number",value:c,onChange:e=>u(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),(0,s.jsxs)(y.Z,{fullWidth:!0,margin:"normal",children:[(0,s.jsx)(C.Z,{id:"select-module-name-label",children:"Module Name"}),(0,s.jsxs)(Z.Z,{labelId:"select-module-name-label",label:"Module Name",id:"module-name",value:h,onChange:e=>x(e.target.value),children:[(0,s.jsx)(I.Z,{value:"all",children:"all"}),(0,s.jsx)(I.Z,{value:"http",children:"http"}),(0,s.jsx)(I.Z,{value:"p2p",children:"p2p"}),(0,s.jsx)(I.Z,{value:"indexer",children:"indexer"}),(0,s.jsx)(I.Z,{value:"reindexer",children:"reindexer"}),(0,s.jsx)(I.Z,{value:"provider",children:"provider"}),(0,s.jsx)(I.Z,{value:"database",children:"database"}),(0,s.jsx)(I.Z,{value:"config",children:"config"}),(0,s.jsx)(I.Z,{value:"core",children:"core"}),(0,s.jsx)(I.Z,{value:"OceanNode",children:"OceanNode"})]})]}),(0,s.jsxs)(y.Z,{fullWidth:!0,margin:"normal",children:[(0,s.jsx)(C.Z,{id:"select-level-label",children:"Level"}),(0,s.jsxs)(Z.Z,{labelId:"select-level-label",label:"Level",id:"level",value:j,onChange:e=>m(e.target.value),children:[(0,s.jsx)(I.Z,{value:"all",children:"all"}),(0,s.jsx)(I.Z,{value:"error",children:"error"}),(0,s.jsx)(I.Z,{value:"warn",children:"warn"}),(0,s.jsx)(I.Z,{value:"info",children:"info"}),(0,s.jsx)(I.Z,{value:"http",children:"http"}),(0,s.jsx)(I.Z,{value:"verbose",children:"verbose"}),(0,s.jsx)(I.Z,{value:"debug",children:"debug"}),(0,s.jsx)(I.Z,{value:"silly",children:"silly"})]})]}),(0,s.jsx)(N.Z,{type:"button",onClick:_,variant:"outlined",startIcon:(0,s.jsx)(d(),{src:P,alt:"download button",width:24,height:24}),disabled:t,children:"Download"})]})]})}function StopNode(){let[e,n]=(0,p.useState)(!1),{signature:t,expiryTimestamp:a}=(0,f.O)();async function stopNode(){n(!0);try{a&&t&&await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"stopNode",expiryTimestamp:a,signature:t})}),alert("The node has been stopped. The dashboard will no longer be displayed."),window.location.reload()}catch(e){console.error("error",e)}finally{n(!1)}}return(0,s.jsx)(N.Z,{onClick:stopNode,variant:"outlined",color:"error",children:e?(0,s.jsx)(()=>(0,s.jsx)("span",{className:g().loader}),{}):(0,s.jsx)("div",{children:"Stop Node"})})}var A=t(92321),O=t(31536);function NetworkSelector(e){let{chainId:n,setChainId:t}=e,{networks:a}=(0,f.O)();return(0,s.jsxs)(y.Z,{fullWidth:!0,margin:"normal",variant:"outlined",children:[(0,s.jsx)(C.Z,{id:"network-select-label",children:"Network"}),(0,s.jsx)(Z.Z,{labelId:"network-select-label",id:"network-select",value:n||"",onChange:e=>t(e.target.value),label:"Network",children:Object.values(a).map(e=>(0,s.jsx)(I.Z,{value:e.chainId.toString(),children:e.network},e.chainId))})]})}(a=r||(r={})).DELIVERED="DELIVERED",a.PENDING="PENDING",a.FAILURE="FAILURE",a.SUCCESS="SUCCESS";let checkJobPool=async function(e){try{let n=await fetch("/api/services/jobs/"+(e||""),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}),t=await n.json();return t.jobs}catch(e){console.error(e)}return[]};function getSeverityFromStatus(e){switch(e){case r.DELIVERED:return"info";case r.SUCCESS:return"success";case r.PENDING:return"warning";default:return"error"}}function isJobDone(e){return[r.SUCCESS,r.FAILURE].includes(e)}var R=t(8434);function JobStatusPanel(e){console.log("PROPS: ",e);let n=e.job?function(e){switch(e){case r.DELIVERED:return"DodgerBlue";case r.PENDING:return"LightSlateGrey";case r.SUCCESS:return"ForestGreen";case r.FAILURE:return"OrangeRed";default:return"black"}}(e.job.status):"black";return(0,s.jsx)("div",{children:null!==e.job&&(0,s.jsxs)(R.Z,{sx:{bgcolor:n},variant:"filled",severity:e.severity,onClose:()=>{},children:["Job with id ",(0,s.jsx)("strong",{children:e.job.jobId})," has status"," ",(0,s.jsx)("strong",{children:e.job.status})]})})}var W=t(602);function ReIndexChain(){let[e,n]=(0,p.useState)(!1),[t,a]=(0,p.useState)(!1),[i,l]=(0,p.useState)(),{signature:o,expiryTimestamp:d}=(0,f.O)(),[c,u]=(0,p.useState)("info"),[h,x]=(0,p.useState)(null),j=null;async function reIndex(){a(!0);try{if(d&&o&&i){let e=await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"reindexChain",chainId:i,expiryTimestamp:d,signature:o})});if(200===e.status){let t=await e.json();u(t.status===r.DELIVERED?"info":"error"),x(t),alert("Chain with ID ".concat(i," is now being reindexed."));let a=!1;j=setInterval(async()=>{let e=await checkJobPool(t.jobId);if(1===e.length){let n=e[0];u(getSeverityFromStatus(n.status)),a=isJobDone(n.status),x(n)}else x(null)},3e3),a&&j&&(0,W.clearInterval)(j),n(!1)}else alert("Error reindexing chain. Please try again.")}}catch(e){console.error("error",e)}finally{a(!1)}}return(0,s.jsxs)("div",{className:g().column,children:[(0,s.jsx)(N.Z,{type:"button",onClick:()=>n(!e),children:"ReIndex Chain"}),e&&(0,s.jsxs)("div",{className:g().filters,children:[(0,s.jsx)(NetworkSelector,{chainId:i,setChainId:l}),(0,s.jsx)(N.Z,{type:"button",onClick:reIndex,variant:"outlined",disabled:t,children:"ReIndex Chain"})]}),(0,s.jsx)(JobStatusPanel,{job:h,severity:c})]})}function ReIndexTransaction(){let[e,n]=(0,p.useState)(!1),[t,a]=(0,p.useState)(!1),[i,l]=(0,p.useState)(),[o,d]=(0,p.useState)(),{signature:c,expiryTimestamp:u}=(0,f.O)(),[h,x]=(0,p.useState)("info"),[j,m]=(0,p.useState)(null),v=null;async function reIndexTx(){a(!0);try{if(u&&c&&i&&o){let e=await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"reindexTx",chainId:i,txId:o,expiryTimestamp:u,signature:c})});if(200===e.status){let t=await e.json();x(t.status===r.DELIVERED?"info":"error"),m(t),alert("Transaction with TX ID ".concat(o," on chain ").concat(i," is now being reindexed."));let a=!1;v=setInterval(async()=>{let e=await checkJobPool(t.jobId);if(1===e.length){let n=e[0];x(getSeverityFromStatus(n.status)),a=isJobDone(n.status),m(n)}else m(null)},3e3),a&&v&&clearInterval(v),n(!1)}else alert("Error reindexing transaction. Please try again.")}}catch(e){console.error("error",e)}finally{a(!1)}}return(0,s.jsxs)("div",{className:g().column,children:[(0,s.jsx)(N.Z,{type:"button",onClick:()=>n(!e),children:"ReIndex Transaction"}),e&&(0,s.jsxs)("div",{className:g().filters,children:[(0,s.jsx)(NetworkSelector,{chainId:i,setChainId:l}),(0,s.jsx)(S.Z,{label:"Transaction ID",value:o,onChange:e=>d(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),(0,s.jsx)(N.Z,{type:"button",onClick:reIndexTx,variant:"outlined",disabled:t,children:"ReIndex Transaction"})]}),(0,s.jsx)(JobStatusPanel,{job:j,severity:h})]})}var L=t(58703),F=t(64666),B=t(37645),J=t(6514),U=t(58951),G=t(31425);function TransferFees(){let[e,n]=(0,p.useState)(!1),[t,a]=(0,p.useState)(!1),[r,i]=(0,p.useState)(""),[l,o]=(0,p.useState)(""),[d,c]=(0,p.useState)(""),[u,h]=(0,p.useState)(""),{signature:x,expiryTimestamp:j}=(0,f.O)(),[m,v]=(0,p.useState)(null),[b,_]=(0,p.useState)(!1),[y,C]=(0,p.useState)(!1),[Z,I]=(0,p.useState)(null),[w,T]=(0,p.useState)(null),validateInputs=()=>r&&l&&d&&u?isNaN(Number(d))?(v("Token amount must be a number."),!1):(v(null),!0):(v("All fields are required."),!1);async function transferFees(){if(validateInputs()){a(!0);try{let e=await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"collectFees",chainId:r,tokenAddress:l,tokenAmount:d,destinationAddress:u,expiryTimestamp:j,signature:x})});if(200===e.status){let t=await e.json();(null==t?void 0:t.tx)&&(null==t?void 0:t.message)&&(T(t.tx),I(t.message),C(!0),_(!0),n(!1))}else v("Error transferring fees. Please try again.")}catch(e){console.error("error",e),v("Error transferring fees. Please try again.")}finally{a(!1)}}}let handleDialogClose=()=>{C(!1)};return(0,s.jsxs)("div",{className:g().column,children:[(0,s.jsx)(N.Z,{variant:"text",onClick:()=>n(!e),children:"Transfer Fees"}),e&&(0,s.jsxs)("div",{className:g().filters,children:[(0,s.jsx)(S.Z,{label:"Chain ID",value:r,onChange:e=>i(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined",type:"number"}),(0,s.jsx)(S.Z,{label:"Token Address",value:l,onChange:e=>o(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),(0,s.jsx)(S.Z,{label:"Token Amount",value:d,onChange:e=>c(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined",type:"number"}),(0,s.jsx)(S.Z,{label:"Destination Address",value:u,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),m&&(0,s.jsx)(R.Z,{severity:"error",children:m}),(0,s.jsx)(N.Z,{type:"button",onClick:transferFees,variant:"outlined",disabled:t,fullWidth:!0,children:"Transfer Fees"})]}),(0,s.jsx)(L.Z,{open:b,autoHideDuration:6e3,onClose:()=>_(!1),message:"Fees successfully transferred!"}),(0,s.jsxs)(F.Z,{open:y,onClose:handleDialogClose,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,s.jsx)(B.Z,{id:"alert-dialog-title",children:"Transfer Successful"}),(0,s.jsx)(J.Z,{children:(0,s.jsx)(U.Z,{id:"alert-dialog-description",children:Z&&(0,s.jsxs)("span",{children:[Z," ",(0,s.jsx)("br",{}),(0,s.jsx)("strong",{style:{marginTop:"10px",display:"block"},children:"Transaction Hash:"})," ",w]})})}),(0,s.jsx)(G.Z,{children:(0,s.jsx)(N.Z,{onClick:handleDialogClose,autoFocus:!0,children:"Close"})})]})]})}function AdminActions(){let{generateSignature:e,signature:n,validTimestamp:t,admin:a}=(0,f.O)(),{isConnected:r}=(0,A.m)();return(0,s.jsxs)("div",{className:g().root,children:[(0,s.jsx)("div",{className:g().title,children:"ADMIN ACTIONS"}),!r&&(0,s.jsx)(x.NL,{}),r&&!a&&(0,s.jsx)("div",{className:g().unauthorised,children:"Your account does not have admin access"}),(!n||!t)&&r&&a&&(0,s.jsx)("button",{type:"button",className:g().unlockButton,onClick:e,children:"Unlock"}),r&&n&&t&&r&&a&&(0,s.jsxs)(O.Z,{spacing:2,direction:"column",children:[(0,s.jsx)(DownloadButton,{}),(0,s.jsx)(ReIndexChain,{}),(0,s.jsx)(ReIndexTransaction,{}),(0,s.jsx)(TransferFees,{}),(0,s.jsx)(StopNode,{})]})]})}var H=t(17044),Q=t.n(H);function Spinner(){return(0,s.jsx)("span",{className:Q().loader})}var M=t(85108),q=t.n(M);let truncateString=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;if(e){let t=e.slice(0,2+n),a=e.slice(-n);return"".concat(t,"....").concat(a)}return e};var X=t(75368),V=t.n(X),K={src:"/_next/static/media/copy.63713a04.svg",height:16,width:15,blurWidth:0,blurHeight:0};function Copy(e){let{text:n}=e,[t,a]=(0,p.useState)(!1),copyToClipboard=e=>{let n=document.createElement("textarea");n.value=e,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)};return(0,p.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>{a(!1)},1e3);return()=>clearTimeout(e)},[t]),(0,s.jsxs)("div",{className:V().action,onClick:()=>{copyToClipboard(n),a(!0)},children:[(0,s.jsx)(d(),{src:K,alt:"icont-copy",className:V().icon}),t&&(0,s.jsx)("div",{className:V().feedback,children:"Copied!"})]})}function NodePeers(){let[e,n]=(0,p.useState)([]),[t,a]=(0,p.useState)(!0),fetchNodePeers=async()=>{a(!0);try{let e=await fetch("/getOceanPeers",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}),t=await e.json();n(t)}catch(e){console.error("error",e)}finally{a(!1)}};return(0,p.useEffect)(()=>{fetchNodePeers();let e=setInterval(()=>{fetchNodePeers()},12e4);return()=>clearInterval(e)},[]),(0,s.jsxs)("div",{className:q().nodes,children:[(0,s.jsxs)("div",{className:q().title24,children:["Connected Nodes (Total ",e.length,")"]}),t&&(0,s.jsx)("div",{className:q().loaderContainer,children:(0,s.jsx)(Spinner,{})}),e.length>0?e.map(e=>(0,s.jsxs)("div",{className:q().nodeAddress,children:[truncateString(e,12)," ",(0,s.jsx)(Copy,{text:e})]},e)):(0,s.jsx)("div",{children:"There are no nodes connected"})]})}function SupportedStorage(e){let{data:n}=e;return(0,s.jsxs)("div",{className:b().indexer,children:[(0,s.jsx)("div",{className:b().title29,children:"SUPPORTED STORAGE"}),(0,s.jsxs)("div",{className:b().provider,children:[(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsx)("b",{children:"arwave:"})}),(0,s.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.arwave.toString()," "]})]}),(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsx)("b",{children:"ipfs:"})}),(0,s.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.ipfs.toString()," "]})]}),(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsx)("b",{children:"url:"})}),(0,s.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.url.toString()," "]})]})]})]})}function SupportedNetworks_SupportedStorage(e){let{data:n}=e;return(0,s.jsxs)("div",{className:b().indexer,children:[(0,s.jsx)("div",{className:b().title29,children:"SUPPORTED Networks"}),(0,s.jsx)("div",{className:b().provider,children:null==n?void 0:n.provider.map(e=>(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsx)("b",{children:e.chainId})}),(0,s.jsxs)("div",{children:[e.network," "]})]}))})]})}var Y=t(93967),z=t.n(Y),$=t(72882),ee=t(7906),en=t(53184),et=t(53816),ea=t(53252),er=t(295),es=t(27061);function IndexQueue(){let[e,n]=(0,p.useState)([]),{networks:t}=(0,f.O)(),[a,r]=(0,p.useState)(!1),i=null;return(0,p.useEffect)(()=>{let fetchQueue=()=>{fetch("/api/services/indexQueue").then(e=>{400===e.status?(console.warn("Cannot fetch queue: Node is not running Indexer"),r(!0),i&&clearInterval(i)):e.json().then(e=>{let a=e.queue.map(e=>{let n=t.find(n=>n.chainId===e.chainId);return{txId:e.txId,chainId:e.chainId,chain:n?n.network:"Unknown Network"}});n(a)})}).catch(e=>{console.error("Error fetching queue:",e)})};fetchQueue();let e=1e4;return es.env.INDEXER_INTERVAL&&(e=Number(es.env.INDEXER_INTERVAL)),i=setInterval(fetchQueue,e),()=>{i&&clearInterval(i)}},[]),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:b().title24,style:{paddingTop:"55px",paddingBottom:"55px"},children:"Indexing Queue"}),e.length>0?(0,s.jsx)($.Z,{children:(0,s.jsxs)(ee.Z,{"aria-label":"simple table",children:[(0,s.jsx)(en.Z,{children:(0,s.jsxs)(et.Z,{children:[(0,s.jsx)(ea.Z,{children:(0,s.jsx)("b",{children:"Transaction ID"})}),(0,s.jsx)(ea.Z,{align:"right",children:(0,s.jsx)("b",{children:"Network"})})]})}),(0,s.jsx)(er.Z,{children:e.map((e,n)=>(0,s.jsxs)(et.Z,{children:[(0,s.jsx)(ea.Z,{component:"th",scope:"row",children:e.txId}),(0,s.jsx)(ea.Z,{align:"right",children:e.chain})]},n))})]})}):(0,s.jsx)("p",{children:"Indexing queue is empty."}),a&&(0,s.jsx)(R.Z,{className:b().indexerQueueAlert,severity:"warning",onClose:()=>{r(!1)},children:"Node is not running Indexer. No need to get queue at this point!"})]})}var ei=t(86886),el=t(66242);function Indexer(e){let{data:n}=e;return(0,s.jsxs)("div",{className:z()([b().indexer,b().borderBottom]),children:[(0,s.jsx)("div",{className:b().title29,children:"INDEXER"}),(0,s.jsx)(ei.ZP,{container:!0,spacing:2,children:null==n?void 0:n.indexer.map(e=>(0,s.jsx)(ei.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,s.jsxs)(el.Z,{className:z()([b().indexBlock,e.delayed&&b().delayed]),sx:{marginBottom:4,borderRadius:"8px",position:"relative"},children:[(0,s.jsx)("h5",{children:e.network}),(0,s.jsxs)("div",{children:["ChainID: ",e.chainId]}),(0,s.jsxs)("div",{children:["BLOCK: ",e.block]})]},e.block)},e.block))}),(0,s.jsx)(IndexQueue,{})]})}function AdminAccounts(){let{allAdmins:e}=(0,f.O)();return(0,s.jsxs)("div",{className:b().indexer,children:[(0,s.jsx)("div",{className:b().title29,children:"Admin Accounts"}),(0,s.jsx)("div",{className:b().provider,children:e.map((e,n)=>(0,s.jsx)("div",{className:b().providerRow,children:e},n))})]})}function NodePlatform(e){let{platformData:n}=e;return(0,s.jsxs)("div",{className:b().indexer,children:[(0,s.jsx)("div",{className:b().title29,children:"PLATFORM"}),(0,s.jsx)("div",{className:b().provider,children:n.map(e=>(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsxs)("b",{children:[e.key,":"]})}),(0,s.jsxs)("div",{children:[e.value," "]})]},e.value))})]})}var eo=t(5616),ed=t(15861),ec=t(67720);function Dashboard(){let[e,n]=(0,p.useState)(),[t,a]=(0,p.useState)(!0),[r,i]=(0,p.useState)(""),{setAllAdmins:l,setNetworks:o}=(0,f.O)();(0,p.useEffect)(()=>{a(!0);try{fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"status"})}).then(e=>e.json()).then(e=>{n(e),l(e.allowedAdmins),o(e.indexer),a(!1)})}catch(e){a(!1),console.error("error",e)}},[]),(0,p.useEffect)(()=>{fetch("https://api.ipify.org?format=json").then(e=>e.json()).then(e=>{i(e.ip)}).catch(e=>{console.error("Failed to fetch IP address:",e)})},[]);let d=[{id:null==e?void 0:e.id,ip:r,indexerData:null==e?void 0:e.indexer}],c=[];return e&&Object.keys(null==e?void 0:e.platform).forEach(n=>{let t={key:n,value:JSON.stringify(null==e?void 0:e.platform[n])};c.push(t)}),(0,s.jsxs)("div",{className:b().root,children:[(0,s.jsx)(AdminActions,{}),(0,s.jsx)("div",{className:b().bodyContainer,children:t?(0,s.jsx)("div",{className:b().loaderContainer,children:(0,s.jsx)(Spinner,{})}):(0,s.jsxs)("div",{className:b().body,children:[(0,s.jsx)(()=>(0,s.jsxs)(eo.Z,{p:2,children:[(0,s.jsx)(ed.Z,{variant:"h5",gutterBottom:!0,children:"NETWORK"}),(0,s.jsx)(ec.Z,{}),(0,s.jsxs)(eo.Z,{mt:2,mb:2,children:[(0,s.jsx)(ed.Z,{variant:"h6",children:"HTTP Status"}),(0,s.jsxs)(ed.Z,{variant:"body1",children:["HTTP - ",(null==e?void 0:e.http)?"UP":"DOWN"]})]}),(0,s.jsx)(ec.Z,{}),(0,s.jsxs)(eo.Z,{mt:2,mb:2,children:[(0,s.jsx)(ed.Z,{variant:"h6",children:"P2P Status"}),(0,s.jsxs)(ed.Z,{variant:"body1",children:["P2P - ",(null==e?void 0:e.p2p)?"UP":"DOWN"]})]}),(0,s.jsx)(ec.Z,{}),(0,s.jsxs)(eo.Z,{mt:2,mb:2,children:[(0,s.jsx)(ed.Z,{variant:"h6",children:"NODE ID"}),d.map(e=>(0,s.jsxs)(eo.Z,{display:"flex",alignItems:"center",mb:1,children:[(0,s.jsx)(ed.Z,{variant:"body1",className:b().node,children:e.id}),(0,s.jsx)(Copy,{text:null==e?void 0:e.id})]},e.id))]}),(0,s.jsx)(ec.Z,{}),(0,s.jsxs)(eo.Z,{mt:2,mb:2,children:[(0,s.jsx)(ed.Z,{variant:"h6",children:"Address"}),(0,s.jsxs)(eo.Z,{display:"flex",alignItems:"center",children:[(0,s.jsx)(ed.Z,{variant:"body1",className:b().node,children:null==e?void 0:e.address}),(0,s.jsx)(Copy,{text:null==e?void 0:e.address})]})]}),(0,s.jsx)(ec.Z,{}),(0,s.jsx)(eo.Z,{mt:2,children:(0,s.jsx)(NodePeers,{})})]}),{}),(0,s.jsx)(Indexer,{data:e}),(0,s.jsx)(SupportedNetworks_SupportedStorage,{data:e}),(0,s.jsx)(SupportedStorage,{data:e}),(0,s.jsx)(AdminAccounts,{}),(0,s.jsx)(NodePlatform,{platformData:c})]})})]})}function Home(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l(),{children:[(0,s.jsx)("title",{children:"Ocean nodes"}),(0,s.jsx)("meta",{name:"description",content:"Ocean nodes dashboard"}),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,s.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,s.jsx)("header",{children:(0,s.jsx)(Navigation,{})}),(0,s.jsx)("main",{children:(0,s.jsx)(Dashboard,{})}),(0,s.jsx)("footer",{children:(0,s.jsx)(components_Footer,{})})]})}},46085:function(e){e.exports={download:"Admin_download__ZZ4G0",unlockButton:"Admin_unlockButton__ke4Fn",buttonIcon:"Admin_buttonIcon___M4VS",loader:"Admin_loader__3WuLo",rotation:"Admin_rotation__lknWO",rotationBack:"Admin_rotationBack__qlWG_",root:"Admin_root__Q70by",title:"Admin_title__Xr7QQ",unauthorised:"Admin_unauthorised__6u5Bb"}},75368:function(e){e.exports={icon:"Copy_icon__BB7bs",feedback:"Copy_feedback__Wse_F",action:"Copy_action__IlKRq",button:"Copy_button__zsJoM"}},11706:function(e){e.exports={root:"Dashboard_root__SCu4R",bodyContainer:"Dashboard_bodyContainer__Fs5NF",body:"Dashboard_body__kpkou",details:"Dashboard_details__TI_cX",columnP2P:"Dashboard_columnP2P__0zKqU",columnHTTP:"Dashboard_columnHTTP__lhw_5",nodes:"Dashboard_nodes__7r0Ge",indexerQueueAlert:"Dashboard_indexerQueueAlert__iCMHE",borderBottom:"Dashboard_borderBottom__5pTDi",title29:"Dashboard_title29__TBf_2",title24:"Dashboard_title24__q5w52",nodeAddress:"Dashboard_nodeAddress__jgxgu",node:"Dashboard_node__UCu0_",indexer:"Dashboard_indexer__PpMWp",indexBlock:"Dashboard_indexBlock__Ng0C_",delayed:"Dashboard_delayed__3Tj7O",provider:"Dashboard_provider__wMZ4i",providerRow:"Dashboard_providerRow__k2QJ8",providerTitle:"Dashboard_providerTitle__5DXbm",loaderContainer:"Dashboard_loaderContainer__CAGjT",loader:"Dashboard_loader__p4KHC",rotation:"Dashboard_rotation__RIDl3"}},94428:function(e){e.exports={footerContainer:"style_footerContainer___mKsH",footerLinks:"style_footerLinks__1vBvO"}},30378:function(e){e.exports={navbarParent:"style_navbarParent__OgqE_",logoWrapper:"style_logoWrapper__ARfWA",connectButtonWrapper:"style_connectButtonWrapper__G4TF7"}},85108:function(e){e.exports={title24:"style_title24__8ssRQ",loaderContainer:"style_loaderContainer__dYPch",nodes:"style_nodes__ioZOx",nodeAddress:"style_nodeAddress__t2M8E"}},17044:function(e){e.exports={loader:"style_loader__s3fCW",rotation:"style_rotation__wALkg"}}},function(e){e.O(0,[5679,9774,2888,179],function(){return e(e.s=48312)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5405],{48312:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(30431)}])},30431:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Home}});var a,r,s=t(85893),i=t(9008),l=t.n(i),o=t(25675),d=t.n(o),c={src:"/_next/static/media/logo-nodes.249ea9ed.svg",height:283,width:425,blurWidth:0,blurHeight:0},u=t(30378),h=t.n(u),x=t(89192),Navigation=()=>(0,s.jsxs)("div",{className:h().navbarParent,children:[(0,s.jsx)("div",{className:h().logoWrapper,children:(0,s.jsx)(d(),{src:c,alt:"Ocean Node Logo",height:70})}),(0,s.jsx)("div",{className:h().connectButtonWrapper,children:(0,s.jsx)(x.NL,{})})]}),j=t(94428),m=t.n(j),components_Footer=()=>{let e=new Date().getFullYear();return(0,s.jsxs)("div",{className:m().footerContainer,children:[(0,s.jsxs)("p",{children:["@ ",e,", Ocean Nodes"]}),(0,s.jsxs)("div",{className:m().footerLinks,children:[(0,s.jsx)("a",{href:"https://oceanprotocol.com/",target:"_blank",children:"Website"}),(0,s.jsx)("a",{href:"https://github.com/oceanprotocol/ocean-node",target:"_blank",children:"GitHub"}),(0,s.jsx)("a",{href:"https://discord.com/invite/TnXjkR5",target:"_blank",children:"Discord"})]})]})},p=t(67294),v=t(11706),b=t.n(v),_=t(59581),f=t(46085),g=t.n(f),N=t(69417),y=t(94054),S=t(50135),C=t(33841),Z=t(30638),I=t(23599),w=t(10586),T=t(50720),D=t(67971),k=t(27484),E=t.n(k),P={src:"/_next/static/media/download.0a4876ec.svg",height:30,width:30,blurWidth:0,blurHeight:0};function DownloadButton(){let[e,n]=(0,p.useState)(!1),[t,a]=(0,p.useState)(!1),[r,i]=(0,p.useState)(E()()),[l,o]=(0,p.useState)(E()()),[c,u]=(0,p.useState)(""),[h,x]=(0,p.useState)(""),[j,m]=(0,p.useState)(""),{signature:v,expiryTimestamp:b}=(0,_.O)(),f=(0,p.useCallback)(async()=>{let e=r?"&startTime=".concat(r.toISOString()):"",n=l?"&endTime=".concat(l.toISOString()):"",t=c?"&maxLogs=".concat(c):"",s=h&&"all"!==h?"&moduleName=".concat(h):"",i=j&&"all"!==j?'&level="'.concat(j,'"'):"";a(!0);try{if(!b||!v){console.error("Missing expiryTimestamp or signature");return}let r=await fetch("/logs?".concat(e).concat(n).concat(t).concat(s).concat(i),{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({expiryTimestamp:b,signature:v})}),l=await r.json();if(l){let e="data:application/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(l)),n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download","LogsData.json"),document.body.appendChild(n),n.click(),n.remove()}a(!1)}catch(e){console.error(e),a(!1)}},[r,l,c,h,j]);return(0,s.jsxs)("div",{className:g().column,children:[(0,s.jsx)(N.Z,{type:"button",onClick:()=>n(!e),children:"Download Logs"}),e&&(0,s.jsxs)("div",{className:g().filters,children:[(0,s.jsxs)(T._,{dateAdapter:w.y,children:[(0,s.jsx)(y.Z,{fullWidth:!0,margin:"normal",children:(0,s.jsx)(D.x,{label:"Start Date",value:r,onChange:e=>i(e)})}),(0,s.jsx)(y.Z,{fullWidth:!0,margin:"normal",children:(0,s.jsx)(D.x,{label:"End Date",value:l,onChange:e=>o(e)})})]}),(0,s.jsx)(S.Z,{label:"Max Logs",type:"number",value:c,onChange:e=>u(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),(0,s.jsxs)(y.Z,{fullWidth:!0,margin:"normal",children:[(0,s.jsx)(C.Z,{id:"select-module-name-label",children:"Module Name"}),(0,s.jsxs)(Z.Z,{labelId:"select-module-name-label",label:"Module Name",id:"module-name",value:h,onChange:e=>x(e.target.value),children:[(0,s.jsx)(I.Z,{value:"all",children:"all"}),(0,s.jsx)(I.Z,{value:"http",children:"http"}),(0,s.jsx)(I.Z,{value:"p2p",children:"p2p"}),(0,s.jsx)(I.Z,{value:"indexer",children:"indexer"}),(0,s.jsx)(I.Z,{value:"reindexer",children:"reindexer"}),(0,s.jsx)(I.Z,{value:"provider",children:"provider"}),(0,s.jsx)(I.Z,{value:"database",children:"database"}),(0,s.jsx)(I.Z,{value:"config",children:"config"}),(0,s.jsx)(I.Z,{value:"core",children:"core"}),(0,s.jsx)(I.Z,{value:"OceanNode",children:"OceanNode"})]})]}),(0,s.jsxs)(y.Z,{fullWidth:!0,margin:"normal",children:[(0,s.jsx)(C.Z,{id:"select-level-label",children:"Level"}),(0,s.jsxs)(Z.Z,{labelId:"select-level-label",label:"Level",id:"level",value:j,onChange:e=>m(e.target.value),children:[(0,s.jsx)(I.Z,{value:"all",children:"all"}),(0,s.jsx)(I.Z,{value:"error",children:"error"}),(0,s.jsx)(I.Z,{value:"warn",children:"warn"}),(0,s.jsx)(I.Z,{value:"info",children:"info"}),(0,s.jsx)(I.Z,{value:"http",children:"http"}),(0,s.jsx)(I.Z,{value:"verbose",children:"verbose"}),(0,s.jsx)(I.Z,{value:"debug",children:"debug"}),(0,s.jsx)(I.Z,{value:"silly",children:"silly"})]})]}),(0,s.jsx)(N.Z,{type:"button",onClick:f,variant:"outlined",startIcon:(0,s.jsx)(d(),{src:P,alt:"download button",width:24,height:24}),disabled:t,children:"Download"})]})]})}function StopNode(){let[e,n]=(0,p.useState)(!1),{signature:t,expiryTimestamp:a}=(0,_.O)();async function stopNode(){n(!0);try{a&&t&&await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"stopNode",expiryTimestamp:a,signature:t})}),alert("The node has been stopped. The dashboard will no longer be displayed."),window.location.reload()}catch(e){console.error("error",e)}finally{n(!1)}}return(0,s.jsx)(N.Z,{onClick:stopNode,variant:"outlined",color:"error",children:e?(0,s.jsx)(()=>(0,s.jsx)("span",{className:g().loader}),{}):(0,s.jsx)("div",{children:"Stop Node"})})}var A=t(92321),O=t(31536);function NetworkSelector(e){let{chainId:n,setChainId:t}=e,{networks:a}=(0,_.O)();return(0,s.jsxs)(y.Z,{fullWidth:!0,margin:"normal",variant:"outlined",children:[(0,s.jsx)(C.Z,{id:"network-select-label",children:"Network"}),(0,s.jsx)(Z.Z,{labelId:"network-select-label",id:"network-select",value:n||"",onChange:e=>t(e.target.value),label:"Network",children:Object.values(a).map(e=>(0,s.jsx)(I.Z,{value:e.chainId.toString(),children:e.network},e.chainId))})]})}(a=r||(r={})).DELIVERED="DELIVERED",a.PENDING="PENDING",a.FAILURE="FAILURE",a.SUCCESS="SUCCESS";let checkJobPool=async function(e){try{let n=await fetch("/api/services/jobs/"+(e||""),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}),t=await n.json();return t.jobs}catch(e){console.error(e)}return[]};function getSeverityFromStatus(e){switch(e){case r.DELIVERED:return"info";case r.SUCCESS:return"success";case r.PENDING:return"warning";default:return"error"}}function isJobDone(e){return[r.SUCCESS,r.FAILURE].includes(e)}var R=t(8434);function JobStatusPanel(e){console.log("PROPS: ",e);let n=e.job?function(e){switch(e){case r.DELIVERED:return"DodgerBlue";case r.PENDING:return"LightSlateGrey";case r.SUCCESS:return"ForestGreen";case r.FAILURE:return"OrangeRed";default:return"black"}}(e.job.status):"black";return(0,s.jsx)("div",{children:null!==e.job&&(0,s.jsxs)(R.Z,{sx:{bgcolor:n},variant:"filled",severity:e.severity,onClose:()=>{},children:["Job with id ",(0,s.jsx)("strong",{children:e.job.jobId})," has status"," ",(0,s.jsx)("strong",{children:e.job.status})]})})}var W=t(602);function ReIndexChain(){let[e,n]=(0,p.useState)(!1),[t,a]=(0,p.useState)(!1),[i,l]=(0,p.useState)(),{signature:o,expiryTimestamp:d}=(0,_.O)(),[c,u]=(0,p.useState)("info"),[h,x]=(0,p.useState)(null),j=null;async function reIndex(){a(!0);try{if(d&&o&&i){let e=await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"reindexChain",chainId:i,expiryTimestamp:d,signature:o})});if(200===e.status){let t=await e.json();u(t.status===r.DELIVERED?"info":"error"),x(t),alert("Chain with ID ".concat(i," is now being reindexed."));let a=!1;j=setInterval(async()=>{let e=await checkJobPool(t.jobId);if(1===e.length){let n=e[0];u(getSeverityFromStatus(n.status)),a=isJobDone(n.status),x(n)}else x(null)},3e3),a&&j&&(0,W.clearInterval)(j),n(!1)}else alert("Error reindexing chain. Please try again.")}}catch(e){console.error("error",e)}finally{a(!1)}}return(0,s.jsxs)("div",{className:g().column,children:[(0,s.jsx)(N.Z,{type:"button",onClick:()=>n(!e),children:"ReIndex Chain"}),e&&(0,s.jsxs)("div",{className:g().filters,children:[(0,s.jsx)(NetworkSelector,{chainId:i,setChainId:l}),(0,s.jsx)(N.Z,{type:"button",onClick:reIndex,variant:"outlined",disabled:t,children:"ReIndex Chain"})]}),(0,s.jsx)(JobStatusPanel,{job:h,severity:c})]})}function ReIndexTransaction(){let[e,n]=(0,p.useState)(!1),[t,a]=(0,p.useState)(!1),[i,l]=(0,p.useState)(),[o,d]=(0,p.useState)(),{signature:c,expiryTimestamp:u}=(0,_.O)(),[h,x]=(0,p.useState)("info"),[j,m]=(0,p.useState)(null),v=null;async function reIndexTx(){a(!0);try{if(u&&c&&i&&o){let e=await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"reindexTx",chainId:i,txId:o,expiryTimestamp:u,signature:c})});if(200===e.status){let t=await e.json();x(t.status===r.DELIVERED?"info":"error"),m(t),alert("Transaction with TX ID ".concat(o," on chain ").concat(i," is now being reindexed."));let a=!1;v=setInterval(async()=>{let e=await checkJobPool(t.jobId);if(1===e.length){let n=e[0];x(getSeverityFromStatus(n.status)),a=isJobDone(n.status),m(n)}else m(null)},3e3),a&&v&&clearInterval(v),n(!1)}else alert("Error reindexing transaction. Please try again.")}}catch(e){console.error("error",e)}finally{a(!1)}}return(0,s.jsxs)("div",{className:g().column,children:[(0,s.jsx)(N.Z,{type:"button",onClick:()=>n(!e),children:"ReIndex Transaction"}),e&&(0,s.jsxs)("div",{className:g().filters,children:[(0,s.jsx)(NetworkSelector,{chainId:i,setChainId:l}),(0,s.jsx)(S.Z,{label:"Transaction ID",value:o,onChange:e=>d(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),(0,s.jsx)(N.Z,{type:"button",onClick:reIndexTx,variant:"outlined",disabled:t,children:"ReIndex Transaction"})]}),(0,s.jsx)(JobStatusPanel,{job:j,severity:h})]})}var L=t(58703),F=t(64666),B=t(37645),J=t(6514),U=t(58951),G=t(31425);function TransferFees(){let[e,n]=(0,p.useState)(!1),[t,a]=(0,p.useState)(!1),[r,i]=(0,p.useState)(""),[l,o]=(0,p.useState)(""),[d,c]=(0,p.useState)(""),[u,h]=(0,p.useState)(""),{signature:x,expiryTimestamp:j}=(0,_.O)(),[m,v]=(0,p.useState)(null),[b,f]=(0,p.useState)(!1),[y,C]=(0,p.useState)(!1),[Z,I]=(0,p.useState)(null),[w,T]=(0,p.useState)(null),validateInputs=()=>r&&l&&d&&u?isNaN(Number(d))?(v("Token amount must be a number."),!1):(v(null),!0):(v("All fields are required."),!1);async function transferFees(){if(validateInputs()){a(!0);try{let e=await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"collectFees",chainId:r,tokenAddress:l,tokenAmount:d,destinationAddress:u,expiryTimestamp:j,signature:x})});if(200===e.status){let t=await e.json();(null==t?void 0:t.tx)&&(null==t?void 0:t.message)&&(T(t.tx),I(t.message),C(!0),f(!0),n(!1))}else v("Error transferring fees. Please try again.")}catch(e){console.error("error",e),v("Error transferring fees. Please try again.")}finally{a(!1)}}}let handleDialogClose=()=>{C(!1)};return(0,s.jsxs)("div",{className:g().column,children:[(0,s.jsx)(N.Z,{variant:"text",onClick:()=>n(!e),children:"Transfer Fees"}),e&&(0,s.jsxs)("div",{className:g().filters,children:[(0,s.jsx)(S.Z,{label:"Chain ID",value:r,onChange:e=>i(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined",type:"number"}),(0,s.jsx)(S.Z,{label:"Token Address",value:l,onChange:e=>o(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),(0,s.jsx)(S.Z,{label:"Token Amount",value:d,onChange:e=>c(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined",type:"number"}),(0,s.jsx)(S.Z,{label:"Destination Address",value:u,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),m&&(0,s.jsx)(R.Z,{severity:"error",children:m}),(0,s.jsx)(N.Z,{type:"button",onClick:transferFees,variant:"outlined",disabled:t,fullWidth:!0,children:"Transfer Fees"})]}),(0,s.jsx)(L.Z,{open:b,autoHideDuration:6e3,onClose:()=>f(!1),message:"Fees successfully transferred!"}),(0,s.jsxs)(F.Z,{open:y,onClose:handleDialogClose,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,s.jsx)(B.Z,{id:"alert-dialog-title",children:"Transfer Successful"}),(0,s.jsx)(J.Z,{children:(0,s.jsx)(U.Z,{id:"alert-dialog-description",children:Z&&(0,s.jsxs)("span",{children:[Z," ",(0,s.jsx)("br",{}),(0,s.jsx)("strong",{style:{marginTop:"10px",display:"block"},children:"Transaction Hash:"})," ",w]})})}),(0,s.jsx)(G.Z,{children:(0,s.jsx)(N.Z,{onClick:handleDialogClose,autoFocus:!0,children:"Close"})})]})]})}function AdminActions(){let{generateSignature:e,signature:n,validTimestamp:t,admin:a}=(0,_.O)(),{isConnected:r}=(0,A.m)();return(0,s.jsxs)("div",{className:g().root,children:[(0,s.jsx)("div",{className:g().title,children:"ADMIN ACTIONS"}),!r&&(0,s.jsx)(x.NL,{}),r&&!a&&(0,s.jsx)("div",{className:g().unauthorised,children:"Your account does not have admin access"}),(!n||!t)&&r&&a&&(0,s.jsx)("button",{type:"button",className:g().unlockButton,onClick:e,children:"Unlock"}),r&&n&&t&&r&&a&&(0,s.jsxs)(O.Z,{spacing:2,direction:"column",children:[(0,s.jsx)(DownloadButton,{}),(0,s.jsx)(ReIndexChain,{}),(0,s.jsx)(ReIndexTransaction,{}),(0,s.jsx)(TransferFees,{}),(0,s.jsx)(StopNode,{})]})]})}var H=t(17044),Q=t.n(H);function Spinner(){return(0,s.jsx)("span",{className:Q().loader})}var M=t(85108),q=t.n(M),X=t(75368),V=t.n(X),K={src:"/_next/static/media/copy.63713a04.svg",height:16,width:15,blurWidth:0,blurHeight:0};function Copy(e){let{text:n}=e,[t,a]=(0,p.useState)(!1),copyToClipboard=e=>{let n=document.createElement("textarea");n.value=e,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)};return(0,p.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>{a(!1)},1e3);return()=>clearTimeout(e)},[t]),(0,s.jsxs)("div",{className:V().action,onClick:()=>{copyToClipboard(n),a(!0)},children:[(0,s.jsx)(d(),{src:K,alt:"icont-copy",className:V().icon}),t&&(0,s.jsx)("div",{className:V().feedback,children:"Copied!"})]})}function NodePeers(){let[e,n]=(0,p.useState)([]),[t,a]=(0,p.useState)(!0),fetchNodePeers=async()=>{a(!0);try{let e=await fetch("/getOceanPeers",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}),t=await e.json();n(t)}catch(e){console.error("error",e)}finally{a(!1)}};return(0,p.useEffect)(()=>{fetchNodePeers();let e=setInterval(()=>{fetchNodePeers()},12e4);return()=>clearInterval(e)},[]),(0,s.jsxs)("div",{className:q().nodes,children:[(0,s.jsxs)("div",{className:q().title24,children:["Connected Nodes (Total ",e.length,")"]}),t&&(0,s.jsx)("div",{className:q().loaderContainer,children:(0,s.jsx)(Spinner,{})}),e.length>0?e.map(e=>(0,s.jsxs)("div",{className:q().nodeAddress,children:[e," ",(0,s.jsx)(Copy,{text:e})]},e)):(0,s.jsx)("div",{children:"There are no nodes connected"})]})}function SupportedStorage(e){let{data:n}=e;return(0,s.jsxs)("div",{className:b().indexer,children:[(0,s.jsx)("div",{className:b().title29,children:"SUPPORTED STORAGE"}),(0,s.jsxs)("div",{className:b().provider,children:[(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsx)("b",{children:"arwave:"})}),(0,s.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.arwave.toString()," "]})]}),(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsx)("b",{children:"ipfs:"})}),(0,s.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.ipfs.toString()," "]})]}),(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsx)("b",{children:"url:"})}),(0,s.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.url.toString()," "]})]})]})]})}function SupportedNetworks_SupportedStorage(e){let{data:n}=e;return(0,s.jsxs)("div",{className:b().indexer,children:[(0,s.jsx)("div",{className:b().title29,children:"SUPPORTED Networks"}),(0,s.jsx)("div",{className:b().provider,children:null==n?void 0:n.provider.map(e=>(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsx)("b",{children:e.chainId})}),(0,s.jsxs)("div",{children:[e.network," "]})]}))})]})}var Y=t(93967),z=t.n(Y),$=t(72882),ee=t(7906),en=t(53184),et=t(53816),ea=t(53252),er=t(295),es=t(27061);function IndexQueue(){let[e,n]=(0,p.useState)([]),{networks:t}=(0,_.O)(),[a,r]=(0,p.useState)(!1),i=null;return(0,p.useEffect)(()=>{let fetchQueue=()=>{fetch("/api/services/indexQueue").then(e=>{400===e.status?(console.warn("Cannot fetch queue: Node is not running Indexer"),r(!0),i&&clearInterval(i)):e.json().then(e=>{let a=e.queue.map(e=>{let n=t.find(n=>n.chainId===e.chainId);return{txId:e.txId,chainId:e.chainId,chain:n?n.network:"Unknown Network"}});n(a)})}).catch(e=>{console.error("Error fetching queue:",e)})};fetchQueue();let e=1e4;return es.env.INDEXER_INTERVAL&&(e=Number(es.env.INDEXER_INTERVAL)),i=setInterval(fetchQueue,e),()=>{i&&clearInterval(i)}},[]),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:b().title24,style:{paddingTop:"55px",paddingBottom:"55px"},children:"Indexing Queue"}),e.length>0?(0,s.jsx)($.Z,{children:(0,s.jsxs)(ee.Z,{"aria-label":"simple table",children:[(0,s.jsx)(en.Z,{children:(0,s.jsxs)(et.Z,{children:[(0,s.jsx)(ea.Z,{children:(0,s.jsx)("b",{children:"Transaction ID"})}),(0,s.jsx)(ea.Z,{align:"right",children:(0,s.jsx)("b",{children:"Network"})})]})}),(0,s.jsx)(er.Z,{children:e.map((e,n)=>(0,s.jsxs)(et.Z,{children:[(0,s.jsx)(ea.Z,{component:"th",scope:"row",children:e.txId}),(0,s.jsx)(ea.Z,{align:"right",children:e.chain})]},n))})]})}):(0,s.jsx)("p",{children:"Indexing queue is empty."}),a&&(0,s.jsx)(R.Z,{className:b().indexerQueueAlert,severity:"warning",onClose:()=>{r(!1)},children:"Node is not running Indexer. No need to get queue at this point!"})]})}var ei=t(86886),el=t(66242);function Indexer(e){let{data:n}=e;return(0,s.jsxs)("div",{className:z()([b().indexer,b().borderBottom]),children:[(0,s.jsx)("div",{className:b().title29,children:"INDEXER"}),(0,s.jsx)(ei.ZP,{container:!0,spacing:2,children:null==n?void 0:n.indexer.map(e=>(0,s.jsx)(ei.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,s.jsxs)(el.Z,{className:z()([b().indexBlock,e.delayed&&b().delayed]),sx:{marginBottom:4,borderRadius:"8px",position:"relative"},children:[(0,s.jsx)("h5",{children:e.network}),(0,s.jsxs)("div",{children:["ChainID: ",e.chainId]}),(0,s.jsxs)("div",{children:["BLOCK: ",e.block]})]},e.block)},e.block))}),(0,s.jsx)(IndexQueue,{})]})}function AdminAccounts(){let{allAdmins:e}=(0,_.O)();return(0,s.jsxs)("div",{className:b().indexer,children:[(0,s.jsx)("div",{className:b().title29,children:"Admin Accounts"}),(0,s.jsx)("div",{className:b().provider,children:e.map((e,n)=>(0,s.jsx)("div",{className:b().providerRow,children:e},n))})]})}function NodePlatform(e){let{platformData:n}=e;return(0,s.jsxs)("div",{className:b().indexer,children:[(0,s.jsx)("div",{className:b().title29,children:"PLATFORM"}),(0,s.jsx)("div",{className:b().provider,children:n.map(e=>(0,s.jsxs)("div",{className:b().providerRow,children:[(0,s.jsx)("div",{className:b().providerTitle,children:(0,s.jsxs)("b",{children:[e.key,":"]})}),(0,s.jsxs)("div",{children:[e.value," "]})]},e.value))})]})}var eo=t(5616),ed=t(15861),ec=t(67720);function Dashboard(){let[e,n]=(0,p.useState)(),[t,a]=(0,p.useState)(!0),[r,i]=(0,p.useState)(""),{setAllAdmins:l,setNetworks:o}=(0,_.O)();(0,p.useEffect)(()=>{a(!0);try{fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"status"})}).then(e=>e.json()).then(e=>{n(e),l(e.allowedAdmins),o(e.indexer),a(!1)})}catch(e){a(!1),console.error("error",e)}},[]),(0,p.useEffect)(()=>{fetch("https://api.ipify.org?format=json").then(e=>e.json()).then(e=>{i(e.ip)}).catch(e=>{console.error("Failed to fetch IP address:",e)})},[]);let d=[{id:null==e?void 0:e.id,ip:r,indexerData:null==e?void 0:e.indexer}],c=[];return e&&Object.keys(null==e?void 0:e.platform).forEach(n=>{let t={key:n,value:JSON.stringify(null==e?void 0:e.platform[n])};c.push(t)}),(0,s.jsxs)("div",{className:b().root,children:[(0,s.jsx)(AdminActions,{}),(0,s.jsx)("div",{className:b().bodyContainer,children:t?(0,s.jsx)("div",{className:b().loaderContainer,children:(0,s.jsx)(Spinner,{})}):(0,s.jsxs)("div",{className:b().body,children:[(0,s.jsx)(()=>(0,s.jsxs)(eo.Z,{p:2,children:[(0,s.jsx)(ed.Z,{variant:"h5",gutterBottom:!0,children:"NETWORK"}),(0,s.jsx)(ec.Z,{}),(0,s.jsxs)(eo.Z,{mt:2,mb:2,children:[(0,s.jsx)(ed.Z,{variant:"h6",children:"HTTP Status"}),(0,s.jsxs)(ed.Z,{variant:"body1",children:["HTTP - ",(null==e?void 0:e.http)?"UP":"DOWN"]})]}),(0,s.jsx)(ec.Z,{}),(0,s.jsxs)(eo.Z,{mt:2,mb:2,children:[(0,s.jsx)(ed.Z,{variant:"h6",children:"P2P Status"}),(0,s.jsxs)(ed.Z,{variant:"body1",children:["P2P - ",(null==e?void 0:e.p2p)?"UP":"DOWN"]})]}),(0,s.jsx)(ec.Z,{}),(0,s.jsxs)(eo.Z,{mt:2,mb:2,children:[(0,s.jsx)(ed.Z,{variant:"h6",children:"NODE ID"}),d.map(e=>(0,s.jsxs)(eo.Z,{display:"flex",alignItems:"center",mb:1,children:[(0,s.jsx)(ed.Z,{variant:"body1",className:b().node,children:e.id}),(0,s.jsx)(Copy,{text:null==e?void 0:e.id})]},e.id))]}),(0,s.jsx)(ec.Z,{}),(0,s.jsxs)(eo.Z,{mt:2,mb:2,children:[(0,s.jsx)(ed.Z,{variant:"h6",children:"Address"}),(0,s.jsxs)(eo.Z,{display:"flex",alignItems:"center",children:[(0,s.jsx)(ed.Z,{variant:"body1",className:b().node,children:null==e?void 0:e.address}),(0,s.jsx)(Copy,{text:null==e?void 0:e.address})]})]}),(0,s.jsx)(ec.Z,{}),(0,s.jsx)(eo.Z,{mt:2,children:(0,s.jsx)(NodePeers,{})})]}),{}),(0,s.jsx)(Indexer,{data:e}),(0,s.jsx)(SupportedNetworks_SupportedStorage,{data:e}),(0,s.jsx)(SupportedStorage,{data:e}),(0,s.jsx)(AdminAccounts,{}),(0,s.jsx)(NodePlatform,{platformData:c})]})})]})}function Home(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l(),{children:[(0,s.jsx)("title",{children:"Ocean nodes"}),(0,s.jsx)("meta",{name:"description",content:"Ocean nodes dashboard"}),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,s.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,s.jsx)("header",{children:(0,s.jsx)(Navigation,{})}),(0,s.jsx)("main",{children:(0,s.jsx)(Dashboard,{})}),(0,s.jsx)("footer",{children:(0,s.jsx)(components_Footer,{})})]})}},46085:function(e){e.exports={download:"Admin_download__ZZ4G0",unlockButton:"Admin_unlockButton__ke4Fn",buttonIcon:"Admin_buttonIcon___M4VS",loader:"Admin_loader__3WuLo",rotation:"Admin_rotation__lknWO",rotationBack:"Admin_rotationBack__qlWG_",root:"Admin_root__Q70by",title:"Admin_title__Xr7QQ",unauthorised:"Admin_unauthorised__6u5Bb"}},75368:function(e){e.exports={icon:"Copy_icon__BB7bs",feedback:"Copy_feedback__Wse_F",action:"Copy_action__IlKRq",button:"Copy_button__zsJoM"}},11706:function(e){e.exports={root:"Dashboard_root__SCu4R",bodyContainer:"Dashboard_bodyContainer__Fs5NF",body:"Dashboard_body__kpkou",details:"Dashboard_details__TI_cX",columnP2P:"Dashboard_columnP2P__0zKqU",columnHTTP:"Dashboard_columnHTTP__lhw_5",nodes:"Dashboard_nodes__7r0Ge",indexerQueueAlert:"Dashboard_indexerQueueAlert__iCMHE",borderBottom:"Dashboard_borderBottom__5pTDi",title29:"Dashboard_title29__TBf_2",title24:"Dashboard_title24__q5w52",nodeAddress:"Dashboard_nodeAddress__jgxgu",node:"Dashboard_node__UCu0_",indexer:"Dashboard_indexer__PpMWp",indexBlock:"Dashboard_indexBlock__Ng0C_",delayed:"Dashboard_delayed__3Tj7O",provider:"Dashboard_provider__wMZ4i",providerRow:"Dashboard_providerRow__k2QJ8",providerTitle:"Dashboard_providerTitle__5DXbm",loaderContainer:"Dashboard_loaderContainer__CAGjT",loader:"Dashboard_loader__p4KHC",rotation:"Dashboard_rotation__RIDl3"}},94428:function(e){e.exports={footerContainer:"style_footerContainer___mKsH",footerLinks:"style_footerLinks__1vBvO"}},30378:function(e){e.exports={navbarParent:"style_navbarParent__OgqE_",logoWrapper:"style_logoWrapper__ARfWA",connectButtonWrapper:"style_connectButtonWrapper__G4TF7"}},85108:function(e){e.exports={title24:"style_title24__8ssRQ",loaderContainer:"style_loaderContainer__dYPch",nodes:"style_nodes__ioZOx",nodeAddress:"style_nodeAddress__t2M8E"}},17044:function(e){e.exports={loader:"style_loader__s3fCW",rotation:"style_rotation__wALkg"}}},function(e){e.O(0,[5679,9774,2888,179],function(){return e(e.s=48312)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/dist/dashboard/_next/static/DZ7A2dssjWN_TEV59eyAj/_buildManifest.js b/dist/dashboard/_next/static/tguH9XFdV8crMHbQ0v3kw/_buildManifest.js similarity index 64% rename from dist/dashboard/_next/static/DZ7A2dssjWN_TEV59eyAj/_buildManifest.js rename to dist/dashboard/_next/static/tguH9XFdV8crMHbQ0v3kw/_buildManifest.js index 794f96469..9cac78970 100644 --- a/dist/dashboard/_next/static/DZ7A2dssjWN_TEV59eyAj/_buildManifest.js +++ b/dist/dashboard/_next/static/tguH9XFdV8crMHbQ0v3kw/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/5679-bec633b225238aa1.js","static/css/a66f1c922ed6fd7f.css","static/chunks/pages/index-4b1dd2874fc68314.js"],"/_error":["static/chunks/pages/_error-e4216aab802f5810.js"],sortedPages:["/","/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/5679-bec633b225238aa1.js","static/css/a66f1c922ed6fd7f.css","static/chunks/pages/index-953c970d47270b0c.js"],"/_error":["static/chunks/pages/_error-e4216aab802f5810.js"],sortedPages:["/","/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/dist/dashboard/_next/static/DZ7A2dssjWN_TEV59eyAj/_ssgManifest.js b/dist/dashboard/_next/static/tguH9XFdV8crMHbQ0v3kw/_ssgManifest.js similarity index 100% rename from dist/dashboard/_next/static/DZ7A2dssjWN_TEV59eyAj/_ssgManifest.js rename to dist/dashboard/_next/static/tguH9XFdV8crMHbQ0v3kw/_ssgManifest.js diff --git a/dist/dashboard/index.html b/dist/dashboard/index.html index b81d10a2d..a7171a1f9 100644 --- a/dist/dashboard/index.html +++ b/dist/dashboard/index.html @@ -1 +1 @@ -Ocean nodes
Ocean Node Logo
ADMIN ACTIONS
\ No newline at end of file +Ocean nodes
Ocean Node Logo
ADMIN ACTIONS
\ No newline at end of file diff --git a/scripts/dashboard.hash b/scripts/dashboard.hash index ca171722e..2324e10c7 100644 --- a/scripts/dashboard.hash +++ b/scripts/dashboard.hash @@ -1 +1 @@ -11466e91597cc7803ca6ee0879e951179e5d915b6579acc6f1e0de4a8410e7a1 \ No newline at end of file +1a060b6266e317f35dc7fa3e16c034c7a8747807e48dbcd0d0b616a66dd10183 \ No newline at end of file