cloudflare widget validation, handle multiple connections, fix translation file error, capitalize status

pull/868/head
Michael Shamoon 2 years ago
parent 2836ee1f3b
commit 89c6528f24

@ -430,7 +430,7 @@
"temp_bed": "Bed temp",
"job_completion": "Completion"
},
"cloudflared" {
"cloudflared": {
"origin_ip": "Origin IP",
"status": "Status"
}

@ -20,10 +20,12 @@ export default function Component({ service }) {
);
}
const originIP = statsData.result.connections?.origin_ip ?? statsData.result.connections[0]?.origin_ip;
return (
<Container service={service}>
<Block label="cloudflared.status" value={statsData.result.status} />
<Block label="cloudflared.origin_ip" value={statsData.result.connections.origin_ip} />
<Block label="cloudflared.status" value={statsData.result.status.charAt(0).toUpperCase() + statsData.result.status.slice(1)} />
<Block label="cloudflared.origin_ip" value={originIP} />
</Container>
);
}

@ -1,12 +1,16 @@
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
const widget = {
api: "https://api.cloudflare.com/client/v4/accounts/{accountid}/{endpoint}/{tunnelid}?",
api: "https://api.cloudflare.com/client/v4/accounts/{accountid}/{endpoint}/{tunnelid}",
proxyHandler: credentialedProxyHandler,
mappings: {
"cfd_tunnel": {
endpoint: "cfd_tunnel",
validate: [
"success",
"result"
]
},
},
};

Loading…
Cancel
Save