mirror of
https://github.com/openziti/zrok.git
synced 2025-01-08 23:20:04 +01:00
more random junk at the wall (#221)
This commit is contained in:
parent
fe97b6d4cd
commit
492e53bbae
@ -37,18 +37,16 @@ const AgentUi = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const newStatus = (err, data) => {
|
||||
if(err) {
|
||||
console.log("newState", err);
|
||||
setOverview([]);
|
||||
} else {
|
||||
setOverview(buildOverview(data));
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
let interval = setInterval(() => {
|
||||
getAgentApi().agentStatus(newStatus);
|
||||
getAgentApi().agentStatus((err, data) => {
|
||||
if(err) {
|
||||
console.log("agentStatus", err);
|
||||
setOverview([]);
|
||||
} else {
|
||||
setOverview(structuredClone(buildOverview(data)));
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
return () => {
|
||||
clearInterval(interval);
|
||||
|
@ -12,11 +12,11 @@ const Overview = (props) => {
|
||||
props.overview.forEach((row) => {
|
||||
switch(row.type) {
|
||||
case "share":
|
||||
cards.push(<ShareCard releaseShare={props.releaseShare} share={row.v} />);
|
||||
cards.push(<ShareCard key={row.v.token} releaseShare={props.releaseShare} share={row.v} />);
|
||||
break;
|
||||
|
||||
case "access":
|
||||
cards.push(<AccessCard releaseAccess={props.releaseAccess} access={row.v} />);
|
||||
cards.push(<AccessCard key={row.v.frontendToken} releaseAccess={props.releaseAccess} access={row.v} />);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
@ -5,7 +5,7 @@ import {Card} from "@mui/material";
|
||||
const ShareCard = (props) => {
|
||||
let frontends = [];
|
||||
props.share.frontendEndpoint.map((fe) => {
|
||||
frontends.push(<a href={fe.toString()} target={"_"}>{fe}</a>);
|
||||
frontends.push(<a key={props.share.token} href={fe.toString()} target={"_"}>{fe}</a>);
|
||||
})
|
||||
|
||||
const releaseClicked = () => {
|
||||
@ -15,11 +15,11 @@ const ShareCard = (props) => {
|
||||
return (
|
||||
<Card>
|
||||
<h2>{props.share.token} [<ShareIcon />]</h2>
|
||||
<p>({props.share.shareMode}, {props.share.backendMode})</p>
|
||||
<p>
|
||||
{props.share.backendEndpoint} → {frontends}
|
||||
({props.share.shareMode}, {props.share.backendMode}) <br/>
|
||||
{props.share.backendEndpoint} → {frontends} <br/>
|
||||
<DeleteIcon onClick={releaseClicked}/>
|
||||
</p>
|
||||
<p><DeleteIcon onClick={releaseClicked}/></p>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user