From 0a9870bcaa01bc504a401af5660ee6eac29012b0 Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Wed, 14 Aug 2024 15:13:38 +0300 Subject: [PATCH] update warning style --- dashboard/src/components/Dashboard/index.module.css | 4 ++++ dashboard/src/components/IndexQueue.tsx | 2 +- dist/dashboard/404.html | 2 +- .../_next/static/OL2H-xMUVaVdnDIJzldH2/_buildManifest.js | 1 - .../_next/static/OL2H-xMUVaVdnDIJzldH2/_ssgManifest.js | 1 - .../_next/static/chunks/pages/index-69c892f26c09a1c8.js | 1 - .../dashboard/_next/static/chunks/webpack-b1325787ad71f8a6.js | 1 - dist/dashboard/_next/static/css/1ba71e685b597d17.css | 1 - dist/dashboard/index.html | 2 +- scripts/dashboard.hash | 2 +- 10 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 dist/dashboard/_next/static/OL2H-xMUVaVdnDIJzldH2/_buildManifest.js delete mode 100644 dist/dashboard/_next/static/OL2H-xMUVaVdnDIJzldH2/_ssgManifest.js delete mode 100644 dist/dashboard/_next/static/chunks/pages/index-69c892f26c09a1c8.js delete mode 100644 dist/dashboard/_next/static/chunks/webpack-b1325787ad71f8a6.js delete mode 100644 dist/dashboard/_next/static/css/1ba71e685b597d17.css diff --git a/dashboard/src/components/Dashboard/index.module.css b/dashboard/src/components/Dashboard/index.module.css index 29441acda..e6793f9f6 100644 --- a/dashboard/src/components/Dashboard/index.module.css +++ b/dashboard/src/components/Dashboard/index.module.css @@ -58,6 +58,10 @@ line-height: 140%; /* 25.2px */ } +.indexerQueueAlert{ + width: 640 +} + .borderBottom { border-bottom: 1.5px solid #eef1f5; } diff --git a/dashboard/src/components/IndexQueue.tsx b/dashboard/src/components/IndexQueue.tsx index 15080f021..9152095bf 100644 --- a/dashboard/src/components/IndexQueue.tsx +++ b/dashboard/src/components/IndexQueue.tsx @@ -104,7 +104,7 @@ export default function IndexQueue() { )} {avoidAskQueue && ( { setAvoidAskQueue(false) diff --git a/dist/dashboard/404.html b/dist/dashboard/404.html index 788c39b77..7da9d78cb 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/OL2H-xMUVaVdnDIJzldH2/_buildManifest.js b/dist/dashboard/_next/static/OL2H-xMUVaVdnDIJzldH2/_buildManifest.js deleted file mode 100644 index 73f0d581e..000000000 --- a/dist/dashboard/_next/static/OL2H-xMUVaVdnDIJzldH2/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/2477-ff31ed06ca3bb6b0.js","static/css/1ba71e685b597d17.css","static/chunks/pages/index-69c892f26c09a1c8.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/OL2H-xMUVaVdnDIJzldH2/_ssgManifest.js b/dist/dashboard/_next/static/OL2H-xMUVaVdnDIJzldH2/_ssgManifest.js deleted file mode 100644 index 0511aa895..000000000 --- a/dist/dashboard/_next/static/OL2H-xMUVaVdnDIJzldH2/_ssgManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB(); \ No newline at end of file diff --git a/dist/dashboard/_next/static/chunks/pages/index-69c892f26c09a1c8.js b/dist/dashboard/_next/static/chunks/pages/index-69c892f26c09a1c8.js deleted file mode 100644 index 4cb620a42..000000000 --- a/dist/dashboard/_next/static/chunks/pages/index-69c892f26c09a1c8.js +++ /dev/null @@ -1 +0,0 @@ -(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(32323)}])},32323:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Home}});var s,a,r=t(85893),i=t(9008),o=t.n(i),l=t(25675),d=t.n(l),c={src:"/_next/static/media/logo-nodes.249ea9ed.svg",height:283,width:425,blurWidth:0,blurHeight:0},h=t(30378),u=t.n(h),x=t(89192),Navigation=()=>(0,r.jsxs)("div",{className:u().navbarParent,children:[(0,r.jsx)("div",{className:u().logoWrapper,children:(0,r.jsx)(d(),{src:c,alt:"Ocean Node Logo",height:70})}),(0,r.jsx)("div",{className:u().connectButtonWrapper,children:(0,r.jsx)(x.NL,{})})]}),j=t(94428),v=t.n(j),components_Footer=()=>{let e=new Date().getFullYear();return(0,r.jsxs)("div",{className:v().footerContainer,children:[(0,r.jsxs)("p",{children:["@ ",e,", Ocean Nodes"]}),(0,r.jsxs)("div",{className:v().footerLinks,children:[(0,r.jsx)("a",{href:"https://oceanprotocol.com/",target:"_blank",children:"Website"}),(0,r.jsx)("a",{href:"https://github.com/oceanprotocol/ocean-node",target:"_blank",children:"GitHub"}),(0,r.jsx)("a",{href:"https://discord.com/invite/TnXjkR5",target:"_blank",children:"Discord"})]})]})},m=t(67294),p=t(93967),_=t.n(p),b=t(11706),N=t.n(b);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),s=e.slice(-n);return"".concat(t,"....").concat(s)}return e};var f=t(59581),g=t(46085),y=t.n(g),S=t(69417),C=t(94054),I=t(50135),w=t(33841),D=t(30638),k=t(23599),T=t(10586),E=t(50720),Z=t(93624),P=t(27484),A=t.n(P),O={src:"/_next/static/media/download.0a4876ec.svg",height:30,width:30,blurWidth:0,blurHeight:0};function DownloadButton(){let[e,n]=(0,m.useState)(!1),[t,s]=(0,m.useState)(!1),[a,i]=(0,m.useState)(A()()),[o,l]=(0,m.useState)(A()()),[c,h]=(0,m.useState)(""),[u,x]=(0,m.useState)(""),[j,v]=(0,m.useState)(""),{signature:p,expiryTimestamp:_}=(0,f.O)(),b=(0,m.useCallback)(async()=>{let e=a?"&startTime=".concat(a.toISOString()):"",n=o?"&endTime=".concat(o.toISOString()):"",t=c?"&maxLogs=".concat(c):"",r=u&&"all"!==u?"&moduleName=".concat(u):"",i=j&&"all"!==j?'&level="'.concat(j,'"'):"";s(!0);try{if(!_||!p){console.error("Missing expiryTimestamp or signature");return}let a=await fetch("/logs?".concat(e).concat(n).concat(t).concat(r).concat(i),{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({expiryTimestamp:_,signature:p})}),o=await a.json();if(o){let e="data:application/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(o)),n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download","LogsData.json"),document.body.appendChild(n),n.click(),n.remove()}s(!1)}catch(e){console.error(e),s(!1)}},[a,o,c,u,j]);return(0,r.jsxs)("div",{className:y().column,children:[(0,r.jsx)(S.Z,{type:"button",onClick:()=>n(!e),children:"Download Logs"}),e&&(0,r.jsxs)("div",{className:y().filters,children:[(0,r.jsxs)(E._,{dateAdapter:T.y,children:[(0,r.jsx)(C.Z,{fullWidth:!0,margin:"normal",children:(0,r.jsx)(Z.x,{label:"Start Date",value:a,onChange:e=>i(e)})}),(0,r.jsx)(C.Z,{fullWidth:!0,margin:"normal",children:(0,r.jsx)(Z.x,{label:"End Date",value:o,onChange:e=>l(e)})})]}),(0,r.jsx)(I.Z,{label:"Max Logs",type:"number",value:c,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),(0,r.jsxs)(C.Z,{fullWidth:!0,margin:"normal",children:[(0,r.jsx)(w.Z,{id:"select-module-name-label",children:"Module Name"}),(0,r.jsxs)(D.Z,{labelId:"select-module-name-label",label:"Module Name",id:"module-name",value:u,onChange:e=>x(e.target.value),children:[(0,r.jsx)(k.Z,{value:"all",children:"all"}),(0,r.jsx)(k.Z,{value:"http",children:"http"}),(0,r.jsx)(k.Z,{value:"p2p",children:"p2p"}),(0,r.jsx)(k.Z,{value:"indexer",children:"indexer"}),(0,r.jsx)(k.Z,{value:"reindexer",children:"reindexer"}),(0,r.jsx)(k.Z,{value:"provider",children:"provider"}),(0,r.jsx)(k.Z,{value:"database",children:"database"}),(0,r.jsx)(k.Z,{value:"config",children:"config"}),(0,r.jsx)(k.Z,{value:"core",children:"core"}),(0,r.jsx)(k.Z,{value:"OceanNode",children:"OceanNode"})]})]}),(0,r.jsxs)(C.Z,{fullWidth:!0,margin:"normal",children:[(0,r.jsx)(w.Z,{id:"select-level-label",children:"Level"}),(0,r.jsxs)(D.Z,{labelId:"select-level-label",label:"Level",id:"level",value:j,onChange:e=>v(e.target.value),children:[(0,r.jsx)(k.Z,{value:"all",children:"all"}),(0,r.jsx)(k.Z,{value:"error",children:"error"}),(0,r.jsx)(k.Z,{value:"warn",children:"warn"}),(0,r.jsx)(k.Z,{value:"info",children:"info"}),(0,r.jsx)(k.Z,{value:"http",children:"http"}),(0,r.jsx)(k.Z,{value:"verbose",children:"verbose"}),(0,r.jsx)(k.Z,{value:"debug",children:"debug"}),(0,r.jsx)(k.Z,{value:"silly",children:"silly"})]})]}),(0,r.jsx)(S.Z,{type:"button",onClick:b,variant:"outlined",startIcon:(0,r.jsx)(d(),{src:O,alt:"download button",width:24,height:24}),disabled:t,children:"Download"})]})]})}function StopNode(){let[e,n]=(0,m.useState)(!1),{signature:t,expiryTimestamp:s}=(0,f.O)();async function stopNode(){n(!0);try{s&&t&&await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"stopNode",expiryTimestamp:s,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,r.jsx)(S.Z,{onClick:stopNode,variant:"outlined",color:"error",children:e?(0,r.jsx)(()=>(0,r.jsx)("span",{className:y().loader}),{}):(0,r.jsx)("div",{children:"Stop Node"})})}var R=t(92321),L=t(31536);function NetworkSelector(e){let{chainId:n,setChainId:t}=e,{networks:s}=(0,f.O)();return(0,r.jsxs)(C.Z,{fullWidth:!0,margin:"normal",variant:"outlined",children:[(0,r.jsx)(w.Z,{id:"network-select-label",children:"Network"}),(0,r.jsx)(D.Z,{labelId:"network-select-label",id:"network-select",value:n||"",onChange:e=>t(e.target.value),label:"Network",children:Object.values(s).map(e=>(0,r.jsx)(k.Z,{value:e.chainId.toString(),children:e.network},e.chainId))})]})}(s=a||(a={})).DELIVERED="DELIVERED",s.PENDING="PENDING",s.FAILURE="FAILURE",s.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 a.DELIVERED:return"info";case a.SUCCESS:return"success";case a.PENDING:return"warning";default:return"error"}}function isJobDone(e){return[a.SUCCESS,a.FAILURE].includes(e)}var B=t(8434);function JobStatusPanel(e){let n=e.job?function(e){switch(e){case a.DELIVERED:return"DodgerBlue";case a.PENDING:return"LightSlateGrey";case a.SUCCESS:return"ForestGreen";case a.FAILURE:return"OrangeRed";default:return"black"}}(e.job.status):"black";return(0,r.jsx)("div",{children:null!==e.job&&(0,r.jsxs)(B.Z,{sx:{bgcolor:n},variant:"filled",severity:e.severity,onClose:()=>{},children:["Job with id ",(0,r.jsx)("strong",{children:e.job.jobId})," has status"," ",(0,r.jsx)("strong",{children:e.job.status})]})})}var W=t(602);function ReIndexChain(){let[e,n]=(0,m.useState)(!1),[t,s]=(0,m.useState)(!1),[i,o]=(0,m.useState)(),{signature:l,expiryTimestamp:d}=(0,f.O)(),[c,h]=(0,m.useState)("info"),[u,x]=(0,m.useState)(null),j=null;async function reIndex(){s(!0);try{if(d&&l&&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:l})});if(200===e.status){let t=await e.json();h(t.status===a.DELIVERED?"info":"error"),x(t),alert("Chain with ID ".concat(i," is now being reindexed."));let s=!1;j=setInterval(async()=>{let e=await checkJobPool(t.jobId);if(1===e.length){let n=e[0];h(getSeverityFromStatus(n.status)),s=isJobDone(n.status),x(n)}else x(null)},3e3),s&&j&&(0,W.clearInterval)(j),n(!1)}else alert("Error reindexing chain. Please try again.")}}catch(e){console.error("error",e)}finally{s(!1)}}return(0,r.jsxs)("div",{className:y().column,children:[(0,r.jsx)(S.Z,{type:"button",onClick:()=>n(!e),children:"ReIndex Chain"}),e&&(0,r.jsxs)("div",{className:y().filters,children:[(0,r.jsx)(NetworkSelector,{chainId:i,setChainId:o}),(0,r.jsx)(S.Z,{type:"button",onClick:reIndex,variant:"outlined",disabled:t,children:"ReIndex Chain"})]}),(0,r.jsx)(JobStatusPanel,{job:u,severity:c})]})}function ReIndexTransaction(){let[e,n]=(0,m.useState)(!1),[t,s]=(0,m.useState)(!1),[i,o]=(0,m.useState)(),[l,d]=(0,m.useState)(),{signature:c,expiryTimestamp:h}=(0,f.O)(),[u,x]=(0,m.useState)("info"),[j,v]=(0,m.useState)(null),p=null;async function reIndexTx(){s(!0);try{if(h&&c&&i&&l){let e=await fetch("/directCommand",{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({command:"reindexTx",chainId:i,txId:l,expiryTimestamp:h,signature:c})});if(200===e.status){let t=await e.json();x(t.status===a.DELIVERED?"info":"error"),v(t),alert("Transaction with TX ID ".concat(l," on chain ").concat(i," is now being reindexed."));let s=!1;p=setInterval(async()=>{let e=await checkJobPool(t.jobId);if(1===e.length){let n=e[0];x(getSeverityFromStatus(n.status)),s=isJobDone(n.status),v(n)}else v(null)},3e3),s&&p&&clearInterval(p),n(!1)}else alert("Error reindexing transaction. Please try again.")}}catch(e){console.error("error",e)}finally{s(!1)}}return(0,r.jsxs)("div",{className:y().column,children:[(0,r.jsx)(S.Z,{type:"button",onClick:()=>n(!e),children:"ReIndex Transaction"}),e&&(0,r.jsxs)("div",{className:y().filters,children:[(0,r.jsx)(NetworkSelector,{chainId:i,setChainId:o}),(0,r.jsx)(I.Z,{label:"Transaction ID",value:l,onChange:e=>d(e.target.value),fullWidth:!0,margin:"normal",variant:"outlined"}),(0,r.jsx)(S.Z,{type:"button",onClick:reIndexTx,variant:"outlined",disabled:t,children:"ReIndex Transaction"})]}),(0,r.jsx)(JobStatusPanel,{job:j,severity:u})]})}function AdminActions(){let{generateSignature:e,signature:n,validTimestamp:t,admin:s}=(0,f.O)(),{isConnected:a}=(0,R.m)();return(0,r.jsxs)("div",{className:y().root,children:[(0,r.jsx)("div",{className:y().title,children:"ADMIN ACTIONS"}),!a&&(0,r.jsx)(x.NL,{}),a&&!s&&(0,r.jsx)("div",{className:y().unauthorised,children:"Your account does not have admin access"}),(!n||!t)&&a&&s&&(0,r.jsx)("button",{type:"button",className:y().unlockButton,onClick:e,children:"Unlock"}),a&&n&&t&&a&&s&&(0,r.jsxs)(L.Z,{spacing:2,direction:"column",children:[(0,r.jsx)(DownloadButton,{}),(0,r.jsx)(ReIndexChain,{}),(0,r.jsx)(ReIndexTransaction,{}),(0,r.jsx)(StopNode,{})]})]})}var F=t(17044),J=t.n(F);function Spinner(){return(0,r.jsx)("span",{className:J().loader})}var U=t(85108),G=t.n(U),H=t(75368),Q=t.n(H),M={src:"/_next/static/media/copy.63713a04.svg",height:16,width:15,blurWidth:0,blurHeight:0};function Copy(e){let{text:n}=e,[t,s]=(0,m.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,m.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>{s(!1)},1e3);return()=>clearTimeout(e)},[t]),(0,r.jsxs)("div",{className:Q().action,onClick:()=>{copyToClipboard(n),s(!0)},children:[(0,r.jsx)(d(),{src:M,alt:"icont-copy",className:Q().icon}),t&&(0,r.jsx)("div",{className:Q().feedback,children:"Copied!"})]})}function NodePeers(){let[e,n]=(0,m.useState)([]),[t,s]=(0,m.useState)(!0),fetchNodePeers=async()=>{s(!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{s(!1)}};return(0,m.useEffect)(()=>{fetchNodePeers();let e=setInterval(()=>{fetchNodePeers()},12e4);return()=>clearInterval(e)},[]),(0,r.jsxs)("div",{className:G().nodes,children:[(0,r.jsx)("div",{className:G().title24,children:"Connected Nodes"}),t&&(0,r.jsx)("div",{className:G().loaderContainer,children:(0,r.jsx)(Spinner,{})}),e.length>0?e.map(e=>(0,r.jsxs)("div",{className:G().nodeAddress,children:[truncateString(e,12)," ",(0,r.jsx)(Copy,{text:e})]},e)):(0,r.jsx)("div",{children:"There are no nodes connected"})]})}function SupportedStorage(e){let{data:n}=e;return(0,r.jsxs)("div",{className:N().indexer,children:[(0,r.jsx)("div",{className:N().title29,children:"SUPPORTED STORAGE"}),(0,r.jsxs)("div",{className:N().provider,children:[(0,r.jsxs)("div",{className:N().providerRow,children:[(0,r.jsx)("div",{className:N().providerTitle,children:(0,r.jsx)("b",{children:"arwave:"})}),(0,r.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.arwave.toString()," "]})]}),(0,r.jsxs)("div",{className:N().providerRow,children:[(0,r.jsx)("div",{className:N().providerTitle,children:(0,r.jsx)("b",{children:"ipfs:"})}),(0,r.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.ipfs.toString()," "]})]}),(0,r.jsxs)("div",{className:N().providerRow,children:[(0,r.jsx)("div",{className:N().providerTitle,children:(0,r.jsx)("b",{children:"url:"})}),(0,r.jsxs)("div",{children:[null==n?void 0:n.supportedStorage.url.toString()," "]})]})]})]})}function SupportedNetworks_SupportedStorage(e){let{data:n}=e;return(0,r.jsxs)("div",{className:N().indexer,children:[(0,r.jsx)("div",{className:N().title29,children:"SUPPORTED Networks"}),(0,r.jsx)("div",{className:N().provider,children:null==n?void 0:n.provider.map(e=>(0,r.jsxs)("div",{className:N().providerRow,children:[(0,r.jsx)("div",{className:N().providerTitle,children:(0,r.jsx)("b",{children:e.chainId})}),(0,r.jsxs)("div",{children:[e.network," "]})]}))})]})}var q=t(72882),X=t(7906),V=t(53184),K=t(53816),Y=t(53252),z=t(295),$=t(27061);function IndexQueue(){let[e,n]=(0,m.useState)([]),{networks:t}=(0,f.O)(),[s,a]=(0,m.useState)(!1),i=null;return(0,m.useEffect)(()=>{let fetchQueue=()=>{fetch("/api/services/indexQueue").then(e=>{400===e.status?(console.warn("Cannot fetch queue: Node is not running Indexer"),a(!0),i&&clearInterval(i)):e.json().then(e=>{let s=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(s)})}).catch(e=>{console.error("Error fetching queue:",e)})};fetchQueue();let e=1e4;return $.env.INDEXER_INTERVAL&&(e=Number($.env.INDEXER_INTERVAL)),i=setInterval(fetchQueue,e),()=>{i&&clearInterval(i)}},[]),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:N().title24,style:{paddingTop:"55px",paddingBottom:"55px"},children:"Indexing Queue"}),e.length>0?(0,r.jsx)(q.Z,{children:(0,r.jsxs)(X.Z,{"aria-label":"simple table",children:[(0,r.jsx)(V.Z,{children:(0,r.jsxs)(K.Z,{children:[(0,r.jsx)(Y.Z,{children:(0,r.jsx)("b",{children:"Transaction ID"})}),(0,r.jsx)(Y.Z,{align:"right",children:(0,r.jsx)("b",{children:"Network"})})]})}),(0,r.jsx)(z.Z,{children:e.map((e,n)=>(0,r.jsxs)(K.Z,{children:[(0,r.jsx)(Y.Z,{component:"th",scope:"row",children:e.txId}),(0,r.jsx)(Y.Z,{align:"right",children:e.chain})]},n))})]})}):(0,r.jsx)("p",{children:"Indexing queue is empty."}),s&&(0,r.jsx)(B.Z,{style:{width:640},severity:"warning",onClose:()=>{a(!1)},children:"Node is not running Indexer. No need to get queue at this point!"})]})}var ee=t(86886),en=t(66242);function Indexer(e){let{data:n}=e;return(0,r.jsxs)("div",{className:_()([N().indexer,N().borderBottom]),children:[(0,r.jsx)("div",{className:N().title29,children:"INDEXER"}),(0,r.jsx)(ee.ZP,{container:!0,spacing:2,children:null==n?void 0:n.indexer.map(e=>(0,r.jsx)(ee.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,r.jsxs)(en.Z,{className:_()([N().indexBlock,e.delayed&&N().delayed]),sx:{marginBottom:4,borderRadius:"8px",position:"relative"},children:[(0,r.jsx)("h5",{children:e.network}),(0,r.jsxs)("div",{children:["ChainID: ",e.chainId]}),(0,r.jsxs)("div",{children:["BLOCK: ",e.block]})]},e.block)},e.block))}),(0,r.jsx)(IndexQueue,{})]})}function AdminAccounts(){let{allAdmins:e}=(0,f.O)();return(0,r.jsxs)("div",{className:N().indexer,children:[(0,r.jsx)("div",{className:N().title29,children:"Admin Accounts"}),(0,r.jsx)("div",{className:N().provider,children:e.map((e,n)=>(0,r.jsx)("div",{className:N().providerRow,children:e},n))})]})}function NodePlatform(e){let{platformData:n}=e;return(0,r.jsxs)("div",{className:N().indexer,children:[(0,r.jsx)("div",{className:N().title29,children:"PLATFORM"}),(0,r.jsx)("div",{className:N().provider,children:n.map(e=>(0,r.jsxs)("div",{className:N().providerRow,children:[(0,r.jsx)("div",{className:N().providerTitle,children:(0,r.jsxs)("b",{children:[e.key,":"]})}),(0,r.jsxs)("div",{children:[e.value," "]})]},e.value))})]})}function Dashboard(){let[e,n]=(0,m.useState)(),[t,s]=(0,m.useState)(!0),[a,i]=(0,m.useState)(""),{setAllAdmins:o,setNetworks:l}=(0,f.O)();(0,m.useEffect)(()=>{s(!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),o(e.allowedAdmins),l(e.indexer),s(!1)})}catch(e){s(!1),console.error("error",e)}},[]),(0,m.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:a,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,r.jsxs)("div",{className:N().root,children:[(0,r.jsx)(AdminActions,{}),(0,r.jsx)("div",{className:N().bodyContainer,children:t?(0,r.jsx)("div",{className:N().loaderContainer,children:(0,r.jsx)(Spinner,{})}):(0,r.jsxs)("div",{className:N().body,children:[(0,r.jsx)(()=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:N().title29,children:"NETWORK"}),(0,r.jsx)("div",{className:N().details,children:(0,r.jsxs)("div",{className:N().details,children:[(0,r.jsxs)("div",{className:N().columnP2P,children:[(0,r.jsxs)("div",{className:_()([N().title24,N().borderBottom]),children:["P2P - ",(null==e?void 0:e.p2p)?"UP":"DOWN"]}),(0,r.jsxs)("div",{className:N().nodes,children:[(0,r.jsx)("div",{className:N().title24,children:"NODE ID"}),d.map(e=>(0,r.jsxs)("div",{className:N().node,children:[(0,r.jsx)("div",{className:N().nodeAddress,children:(0,r.jsx)("div",{className:N().node,children:truncateString(e.id,12)})}),(0,r.jsx)(Copy,{text:null==e?void 0:e.id})]},e.id))]}),(0,r.jsxs)("div",{className:N().nodes,children:[(0,r.jsx)("div",{className:N().title24,children:"Address"}),(0,r.jsxs)("div",{className:N().node,children:[truncateString(null==e?void 0:e.address,12),(0,r.jsx)(Copy,{text:null==e?void 0:e.address})]})]}),(0,r.jsx)(NodePeers,{})]}),(0,r.jsxs)("div",{className:N().columnHTTP,children:[(0,r.jsxs)("div",{className:_()([N().title24,N().borderBottom]),children:["HTTP - ",(null==e?void 0:e.http)?"UP":"DOWN"]}),(0,r.jsx)("div",{className:N().nodes,children:(0,r.jsxs)("div",{className:N().nodeAddress,children:[(0,r.jsx)("h5",{className:N().title24,children:"IP : "}),(0,r.jsx)("div",{className:N().nodeAddress,children:a}),(0,r.jsx)(Copy,{text:a})]})})]})]})})]}),{}),(0,r.jsx)(Indexer,{data:e}),(0,r.jsx)(SupportedNetworks_SupportedStorage,{data:e}),(0,r.jsx)(SupportedStorage,{data:e}),(0,r.jsx)(AdminAccounts,{}),(0,r.jsx)(NodePlatform,{platformData:c})]})})]})}function Home(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o(),{children:[(0,r.jsx)("title",{children:"Ocean nodes"}),(0,r.jsx)("meta",{name:"description",content:"Ocean nodes dashboard"}),(0,r.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,r.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,r.jsx)("header",{children:(0,r.jsx)(Navigation,{})}),(0,r.jsx)("main",{children:(0,r.jsx)(Dashboard,{})}),(0,r.jsx)("footer",{children:(0,r.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",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,[2477,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/chunks/webpack-b1325787ad71f8a6.js b/dist/dashboard/_next/static/chunks/webpack-b1325787ad71f8a6.js deleted file mode 100644 index c01874671..000000000 --- a/dist/dashboard/_next/static/chunks/webpack-b1325787ad71f8a6.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var e,r,_,t,c,a,n,u,i,f={},b={};function __webpack_require__(e){var r=b[e];if(void 0!==r)return r.exports;var _=b[e]={id:e,loaded:!1,exports:{}},t=!0;try{f[e].call(_.exports,_,_.exports,__webpack_require__),t=!1}finally{t&&delete b[e]}return _.loaded=!0,_.exports}__webpack_require__.m=f,__webpack_require__.amdO={},e=[],__webpack_require__.O=function(r,_,t,c){if(_){c=c||0;for(var a=e.length;a>0&&e[a-1][2]>c;a--)e[a]=e[a-1];e[a]=[_,t,c];return}for(var n=1/0,a=0;a=c&&Object.keys(__webpack_require__.O).every(function(e){return __webpack_require__.O[e](_[i])})?_.splice(i--,1):(u=!1,ch5{color:#3d4551;font-family:Helvetica;font-size:18px;font-style:normal;font-weight:700;line-height:150%;min-width:55px}.Dashboard_root__SCu4R{display:flex;flex-direction:row;gap:28px;position:relative;min-height:550px}.Dashboard_bodyContainer__Fs5NF{position:relative;width:100%}.Dashboard_body__kpkou{padding:40px 72px;border-radius:12px;background:#fff;width:100%}.Dashboard_details__TI_cX{display:flex;flex-direction:row;width:100%}.Dashboard_columnP2P__0zKqU{border-right:1.5px solid #eef1f5}.Dashboard_columnHTTP__lhw_5,.Dashboard_columnP2P__0zKqU{border-bottom:1.5px solid #eef1f5;width:50%}.Dashboard_columnP2P__0zKqU>div{padding:18px 18px 18px 0}.Dashboard_columnHTTP__lhw_5>div{padding:18px}.Dashboard_nodes__7r0Ge{display:flex;flex-direction:column;gap:15px;color:var(--Gray-Gray-500,#718096);font-family:Helvetica;font-size:18px;font-style:normal;font-weight:400;line-height:140%}.Dashboard_borderBottom__5pTDi{border-bottom:1.5px solid #eef1f5}.Dashboard_title29__TBf_2{font-size:20px;margin-bottom:38px}.Dashboard_title24__q5w52,.Dashboard_title29__TBf_2{color:#3d4551;font-family:Helvetica;font-style:normal;font-weight:700;line-height:140%}.Dashboard_title24__q5w52{font-size:18px}.Dashboard_nodeAddress__jgxgu{display:flex;flex-direction:row;gap:18px}.Dashboard_nodeAddress__jgxgu>h5{color:#3d4551;font-family:Helvetica;font-size:18px;font-style:normal;font-weight:700;line-height:150%;min-width:55px}.Dashboard_node__UCu0_{display:flex;flex-direction:row;gap:18px}.Dashboard_node__UCu0_:hover{color:#333;cursor:pointer}.Dashboard_indexer__PpMWp{padding-bottom:55px;padding-top:55px}.Dashboard_indexBlock__Ng0C_{display:flex;flex-direction:column;gap:9px;padding:24px 28px;border-radius:8px;border:1px solid rgba(78,203,113,.7);border-top:10px solid rgba(38,194,81,.7);min-width:240px;color:#3d4551;font-family:Helvetica;font-size:16px;font-style:normal;font-weight:400;line-height:140%}.Dashboard_indexBlock__Ng0C_ h5{margin-bottom:18px;color:#3d4551;font-family:Helvetica;font-size:18px;font-style:normal;font-weight:700;line-height:150%}.Dashboard_delayed__3Tj7O{border:1px solid rgba(234,89,47,.9);border-top:10px solid rgba(234,89,47,.9)}.Dashboard_provider__wMZ4i{display:flex;flex-direction:column;gap:10px}.Dashboard_providerRow__k2QJ8{display:flex;flex-direction:row;gap:4px;font-weight:500}.Dashboard_providerTitle__5DXbm{min-width:100px}.Dashboard_loaderContainer__CAGjT{position:absolute;width:100%;height:100%;background-color:rgba(51,51,51,.2);display:flex;flex-direction:row;justify-content:center;align-items:center;border-radius:12px}.Dashboard_loader__p4KHC{width:48px;height:48px;border:2px solid #fff;border-radius:50%;display:inline-block;position:relative;box-sizing:border-box;animation:Dashboard_rotation__RIDl3 1s linear infinite}.Dashboard_loader__p4KHC:after,.Dashboard_loader__p4KHC:before{content:"";box-sizing:border-box;position:absolute;left:0;top:0;background:#ff3d00;width:6px;height:6px;transform:translate(150%,150%);border-radius:50%}.Dashboard_loader__p4KHC:before{left:auto;top:auto;right:0;bottom:0;transform:translate(-150%,-150%)}@keyframes Dashboard_rotation__RIDl3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@media screen and (max-width:700px){.Dashboard_root__SCu4R{flex-direction:column}.Dashboard_body__kpkou{max-width:none;width:90vw;margin:0 auto;padding:20px}.Dashboard_details__TI_cX{flex-direction:column}.Dashboard_columnHTTP__lhw_5{width:100%}.Dashboard_columnP2P__0zKqU{width:100%;border-right:0}} \ No newline at end of file diff --git a/dist/dashboard/index.html b/dist/dashboard/index.html index 0e7f8d98c..94245c612 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 d458293bb..3d03311d7 100644 --- a/scripts/dashboard.hash +++ b/scripts/dashboard.hash @@ -1 +1 @@ -4b553b37e6793a76230e26f6b340611ecb2e5ebd366de2365cb27d56abf334e2 \ No newline at end of file +8447f7fca994fedf80cf9ba8b1209020b9048ada4b437e6dd5703e5161682642 \ No newline at end of file