Skip to content

Commit e53d497

Browse files
[WIP] Staking dashboard (#2353)
new Dashboard tab
1 parent 82e05d0 commit e53d497

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2901
-225
lines changed

packages/admin-ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"@types/react-dom": "^18.3.0",
6565
"nodemon": "^3.1.4",
6666
"prettier": "^1.16.4",
67-
"ts-node": "^10.9.2"
67+
"ts-node": "^10.9.2",
68+
"vite-plugin-svgr": "^4.5.0"
6869
},
6970
"optionalDependencies": {
7071
"@rollup/rollup-linux-x64-gnu": "4.18.0"

packages/admin-ui/src/__mock-backend__/index.ts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,44 @@ export const otherCalls: Omit<Routes, keyof typeof namedSpacedCalls> = {
5656
progress: 0.83027522935
5757
}
5858
],
59+
nodeStatusGetByNetwork: async () => ({
60+
mainnet: {
61+
ec: {
62+
name: "Nethermind",
63+
dnp: "nethermind.dnp.dappnode.eth",
64+
isSynced: true,
65+
currentBlock: 23648945,
66+
progress: 100,
67+
peers: 50
68+
},
69+
cc: {
70+
name: "Nimbus",
71+
dnp: "nimbus.dnp.dappnode.eth",
72+
isSynced: true,
73+
currentBlock: 12875373,
74+
progress: 100,
75+
peers: 40
76+
}
77+
},
78+
hoodi: {
79+
ec: {
80+
name: "besu",
81+
dnp: "besu-hoodi.dnp.dappnode.eth",
82+
isSynced: true,
83+
currentBlock: 1480848,
84+
progress: 100,
85+
peers: 30
86+
},
87+
cc: {
88+
name: "Prysm",
89+
dnp: "prysm-hoodi.dnp.dappnode.eth",
90+
isSynced: false,
91+
currentBlock: 1592925,
92+
progress: 100,
93+
peers: 20
94+
}
95+
}
96+
}),
5997
changeIpfsTimeout: async () => {},
6098
cleanCache: async () => {},
6199
cleanDb: async () => {},
@@ -411,6 +449,12 @@ export const otherCalls: Omit<Routes, keyof typeof namedSpacedCalls> = {
411449
gnosis: "prysm-gnosis.dnp.dappnode.eth"
412450
};
413451
},
452+
executionClientsGetByNetworks: async () => {
453+
return {
454+
mainnet: "geth.dnp.dappnode.eth",
455+
gnosis: "nethermind-xdai.dnp.dappnode.eth"
456+
};
457+
},
414458
premiumBeaconBackupActivate: async () => {},
415459
premiumBeaconBackupDeactivate: async () => {},
416460
premiumBeaconBackupStatus: async (): Promise<Record<string, BeaconBackupNetworkStatus>> => {
@@ -433,6 +477,43 @@ export const otherCalls: Omit<Routes, keyof typeof namedSpacedCalls> = {
433477
mainnet: { validators: ["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"] },
434478
hoodi: { validators: [] },
435479
gnosis: null
480+
}),
481+
482+
validatorsDataByNetwork: async () => ({
483+
mainnet: {
484+
active: { validators: ["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"] },
485+
attesting: { validators: ["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"] },
486+
balances: {
487+
balances: {
488+
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef": "32000000000"
489+
}
490+
}
491+
},
492+
hoodi: {
493+
active: { validators: [] },
494+
attesting: { validators: [] },
495+
balances: { balances: {} }
496+
},
497+
gnosis: {
498+
active: null,
499+
attesting: null,
500+
balances: null
501+
}
502+
}),
503+
504+
signerByNetworkGet: async () => ({
505+
mainnet: {
506+
isInstalled: true,
507+
brainRunning: true
508+
},
509+
hoodi: {
510+
isInstalled: true,
511+
brainRunning: false
512+
},
513+
gnosis: {
514+
isInstalled: false,
515+
brainRunning: false
516+
}
436517
})
437518
};
438519

packages/admin-ui/src/components/Loading.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import React, { useState, useEffect } from "react";
22
import logoAnimated from "img/dappNodeAnimation.gif";
33
import "./loading.scss";
44

5-
export default function Loading({ steps }: { steps: string[] }) {
5+
export default function Loading({ steps, small }: { steps?: string[]; small?: boolean }) {
66
const [index, setIndex] = useState(0);
77
useEffect(() => {
88
const interval = setInterval(() => setIndex((i) => i + 1), 3000);
99
return () => clearInterval(interval);
1010
}, []);
1111

1212
return (
13-
<div className="loading-view">
13+
<div className={`loading-view ${small && "small"}`}>
1414
<img src={logoAnimated} alt="Loading icon" />
15-
<p className="steps">{steps[index] || steps[steps.length - 1]}...</p>
15+
{steps && <p className="steps">{steps[index] || steps[steps.length - 1]}...</p>}
1616
</div>
1717
);
1818
}

packages/admin-ui/src/components/loading.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@
1212
p {
1313
opacity: 0.6;
1414
}
15+
16+
&.small {
17+
margin: 1rem 0px;
18+
img {
19+
width: 50px;
20+
height: 50px;
21+
margin: 0px;
22+
}
23+
}
1524
}

0 commit comments

Comments
 (0)