From 9df9322f189d624d2389845e8badd107c698d452 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Sat, 5 Mar 2022 03:01:18 +0100 Subject: [PATCH] Tooltip toegevoegd aand orch viewer meer grafana dashboards --- package.json | 1 + src/OrchAddressViewer.js | 30 ++++++++++++++++++++++++++++++ src/grafana.js | 8 ++++++-- src/livepeer.js | 2 +- src/orchestratorViewer.js | 28 +++++++++++++++++----------- 5 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 src/OrchAddressViewer.js diff --git a/package.json b/package.json index b95fe8a..ef759a9 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "react-redux": "^7.2.6", "react-router-dom": "^6.0.2", "react-scripts": "3.2.0", + "react-tooltip": "^4.2.21", "redux": "^4.1.2", "redux-thunk": "^2.4.1", "styled-components": "^5.3.3" diff --git a/src/OrchAddressViewer.js b/src/OrchAddressViewer.js new file mode 100644 index 0000000..c805b70 --- /dev/null +++ b/src/OrchAddressViewer.js @@ -0,0 +1,30 @@ +import React from "react"; +import ReactTooltip from "react-tooltip"; + +const Address = (obj) => { + return ( +
+ +
+ + {obj.address} +
+
+ + {"https://explorer.livepeer.org/accounts/" + obj.address} + +
+ ) +} + +export default Address; + +{/*
+ + + + + + + {eventCaller} +
*/} diff --git a/src/grafana.js b/src/grafana.js index 0c2b8eb..531738b 100644 --- a/src/grafana.js +++ b/src/grafana.js @@ -60,8 +60,12 @@ const Grafana = (obj) => {
-
- +
+ + +
+
+
diff --git a/src/livepeer.js b/src/livepeer.js index 08017f8..4d46f70 100644 --- a/src/livepeer.js +++ b/src/livepeer.js @@ -135,7 +135,7 @@ const Livepeer = (obj) => { }}> -
+
diff --git a/src/orchestratorViewer.js b/src/orchestratorViewer.js index e4f1a72..ab1561d 100644 --- a/src/orchestratorViewer.js +++ b/src/orchestratorViewer.js @@ -1,6 +1,8 @@ import React from "react"; import ScrollContainer from "react-indiana-drag-scroll"; import Stat from "./statViewer"; +import ReactTooltip from "react-tooltip"; +import Address from "./OrchAddressViewer"; function updateClipboard(newClip) { navigator.clipboard.writeText(newClip).then( @@ -60,11 +62,11 @@ const Orchestrator = (obj) => { } let shareUrl; - if (obj.rootOnly){ + if (obj.rootOnly) { shareUrl = window.location.href; - }else{ + } else { let thisFullPath = window.location.href; - if (thisFullPath.lastIndexOf("?") > -1){ + if (thisFullPath.lastIndexOf("?") > -1) { thisFullPath = thisFullPath.substring(0, thisFullPath.lastIndexOf("?")); } shareUrl = thisFullPath + "?orchAddr=" + thisID; @@ -76,7 +78,7 @@ const Orchestrator = (obj) => { @@ -84,11 +86,16 @@ const Orchestrator = (obj) => { - +
+ + + Copy to clipboard + +
@@ -101,8 +108,7 @@ const Orchestrator = (obj) => { delegators.map((delObj, idx) => { return (
- - {delObj.id.substr(0, 12) + "..."} +

{parseFloat(delObj.bondedAmount).toFixed(2)} LPT since round {delObj.startRound}