Added root-only mode for share button

This commit is contained in:
Marco van Dijk 2022-03-04 13:44:27 +01:00
parent a55d422ded
commit 686b19c7c4
3 changed files with 10 additions and 3 deletions

View File

@ -59,7 +59,7 @@ const Grafana = (obj) => {
</div> </div>
<div className="stroke roundedOpaque" style={{ borderRadius: "1em", backgroundColor: "#111217" }}> <div className="stroke roundedOpaque" style={{ borderRadius: "1em", backgroundColor: "#111217" }}>
<div className="row" style={{ paddingLeft: "1em", paddingRight: "1em" }}> <div className="row" style={{ paddingLeft: "1em", paddingRight: "1em" }}>
<Orchestrator thisOrchestrator={livepeer.thisOrchestrator} /> <Orchestrator thisOrchestrator={livepeer.thisOrchestrator} rootOnly={true} />
</div> </div>
<div className="flexContainer" style={{ justifyContent: "center" }}> <div className="flexContainer" style={{ justifyContent: "center" }}>
<iframe className="fullGrafana" src="https://grafana.stronk.tech/d-solo/71b6OZ0Gz/orchestrator-overview?orgId=1&refresh=5s&theme=dark&panelId=23763572056" height="200" frameBorder="0"></iframe> <iframe className="fullGrafana" src="https://grafana.stronk.tech/d-solo/71b6OZ0Gz/orchestrator-overview?orgId=1&refresh=5s&theme=dark&panelId=23763572056" height="200" frameBorder="0"></iframe>

View File

@ -153,7 +153,7 @@ const Livepeer = (obj) => {
<img alt="" src="livepeer.png" width="100em" height="100em" /> <img alt="" src="livepeer.png" width="100em" height="100em" />
</button> </button>
<div className="row" style={{ alignItems: 'stretch', height: '100%', flex: 2, padding: '1em' }}> <div className="row" style={{ alignItems: 'stretch', height: '100%', flex: 2, padding: '1em' }}>
<Orchestrator thisOrchestrator={thisOrchObj} /> <Orchestrator thisOrchestrator={thisOrchObj} rootOnly={false} />
</div> </div>
<div className="stroke metaSidebar" style={{ padding: 0, flex: 1 }}> <div className="stroke metaSidebar" style={{ padding: 0, flex: 1 }}>
<div className="row" style={{ margin: 0, padding: 0 }}> <div className="row" style={{ margin: 0, padding: 0 }}>

View File

@ -59,6 +59,13 @@ const Orchestrator = (obj) => {
thisUrl = "https://explorer.livepeer.org/accounts/" + thisID; thisUrl = "https://explorer.livepeer.org/accounts/" + thisID;
} }
let shareUrl;
if (obj.rootOnly){
shareUrl = window.location.href;
}else{
shareUrl = window.location.href + "?orchAddr=" + thisID;
}
return ( return (
<div className="hostInfo"> <div className="hostInfo">
<div className="strokeSmollLeft" style={{ display: "flex" }}> <div className="strokeSmollLeft" style={{ display: "flex" }}>
@ -74,7 +81,7 @@ const Orchestrator = (obj) => {
<Stat header={"Total Stake"} content={totalStake + " LPT"} /> <Stat header={"Total Stake"} content={totalStake + " LPT"} />
<Stat header={"Self Stake"} content={selfStake + " LPT(" + selfStakeRatio + ")%"} /> <Stat header={"Self Stake"} content={selfStake + " LPT(" + selfStakeRatio + ")%"} />
<button className="homeButton" onClick={() => { <button className="homeButton" onClick={() => {
copyLink(window.location.href + "?orchAddr=0x847791cbf03be716a7fe9dc8c9affe17bd49ae5e"); copyLink(shareUrl);
}}> }}>
<img alt="" src="clipboard.svg" width="20em" height="20em" /> <img alt="" src="clipboard.svg" width="20em" height="20em" />
</button> </button>