synthetic 'selection.id', real identifiers on bespoke properties (#323)

This commit is contained in:
Michael Quigley 2023-05-18 13:10:12 -04:00
parent d205405aa0
commit 1b70c6e013
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
6 changed files with 16 additions and 15 deletions

View File

@ -5,7 +5,6 @@ import AccessDetail from "./access/AccessDetail";
const Detail = (props) => {
let detailComponent = <h1>{props.selection.id} ({props.selection.type})</h1>;
console.log("selection type", props.selection.type);
switch(props.selection.type) {
case "frontend":

View File

@ -12,7 +12,7 @@ const EnvironmentDetail = (props) => {
const [detail, setDetail] = useState({});
useEffect(() => {
getEnvironmentDetail(props.selection.id)
getEnvironmentDetail(props.selection.envZId)
.then(resp => {
setDetail(resp.data);
});

View File

@ -9,15 +9,15 @@ const MetricsTab = (props) => {
const [metrics1, setMetrics1] = useState(buildMetrics([]));
useEffect(() => {
metadata.getEnvironmentMetrics(props.selection.id)
metadata.getEnvironmentMetrics(props.selection.envZId)
.then(resp => {
setMetrics30(buildMetrics(resp.data));
});
metadata.getEnvironmentMetrics(props.selection.id, {duration: "168h"})
metadata.getEnvironmentMetrics(props.selection.envZId, {duration: "168h"})
.then(resp => {
setMetrics7(buildMetrics(resp.data));
});
metadata.getEnvironmentMetrics(props.selection.id, {duration: "24h"})
metadata.getEnvironmentMetrics(props.selection.envZId, {duration: "24h"})
.then(resp => {
setMetrics1(buildMetrics(resp.data));
});
@ -26,17 +26,17 @@ const MetricsTab = (props) => {
useEffect(() => {
let mounted = true;
let interval = setInterval(() => {
metadata.getEnvironmentMetrics(props.selection.id)
metadata.getEnvironmentMetrics(props.selection.envZId)
.then(resp => {
if(mounted) {
setMetrics30(buildMetrics(resp.data));
}
});
metadata.getEnvironmentMetrics(props.selection.id, {duration: "168h"})
metadata.getEnvironmentMetrics(props.selection.envZId, {duration: "168h"})
.then(resp => {
setMetrics7(buildMetrics(resp.data));
});
metadata.getEnvironmentMetrics(props.selection.id, {duration: "24h"})
metadata.getEnvironmentMetrics(props.selection.envZId, {duration: "24h"})
.then(resp => {
setMetrics1(buildMetrics(resp.data));
});

View File

@ -7,7 +7,7 @@ const SharesTab = (props) => {
const [detail, setDetail] = useState({});
useEffect(() => {
metadata.getEnvironmentDetail(props.selection.id)
metadata.getEnvironmentDetail(props.selection.envZId)
.then(resp => {
setDetail(resp.data);
});
@ -16,7 +16,7 @@ const SharesTab = (props) => {
useEffect(() => {
let mounted = true;
let interval = setInterval(() => {
metadata.getEnvironmentDetail(props.selection.id)
metadata.getEnvironmentDetail(props.selection.envZId)
.then(resp => {
if(mounted) {
setDetail(resp.data);

View File

@ -13,7 +13,7 @@ const ShareDetail = (props) => {
const [detail, setDetail] = useState({});
useEffect(() => {
metadata.getShareDetail(props.selection.id)
metadata.getShareDetail(props.selection.shrToken)
.then(resp => {
let detail = resp.data;
detail.envZId = props.selection.envZId;
@ -24,7 +24,7 @@ const ShareDetail = (props) => {
useEffect(() => {
let mounted = true;
let interval = setInterval(() => {
metadata.getShareDetail(props.selection.id)
metadata.getShareDetail(props.selection.shrToken)
.then(resp => {
if(mounted) {
let detail = resp.data;

View File

@ -36,7 +36,8 @@ export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
newOverview.forEach(env => {
let limited = !!env.limited;
let envNode = {
id: env.environment.zId,
id: 'env:' + env.environment.zId,
envZId: env.environment.zId,
label: env.environment.description,
type: "environment",
limited: !!env.environment.limited || accountNode.limited,
@ -55,7 +56,8 @@ export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
shrLabel = shr.backendProxyEndpoint;
}
let shrNode = {
id: shr.token,
id: 'shr:' + shr.token,
shrToken: shr.token,
envZId: env.environment.zId,
label: shrLabel,
type: "share",
@ -74,7 +76,7 @@ export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
if(env.frontends) {
env.frontends.forEach(fe => {
let feNode = {
id: "fe:" + fe.id,
id: 'ac:' + fe.id,
feId: fe.id,
target: fe.shrToken,
label: fe.shrToken,