const map_flow = function()

in source/html/js/app/mappers/nodes/mediaconnect.js [26:105]


        const map_flow = function(cache_entry) {
            const flow = JSON.parse(cache_entry.data);
            const name = flow.Name;
            const id = flow.FlowArn;
            const nodes = model.nodes;
            const rgb = "#99ff33";
            const node_type = "MediaConnect Flow";
            let node_data = {
                "overlay": "informational",
                "cache_update": cache_entry.updated,
                "id": id,
                "region": cache_entry.region,
                "shape": "image",
                "image": {
                    "unselected": null,
                    "selected": null
                },
                "header": "<b>" + node_type + ":</b> " + name,
                "data": flow,
                "title": node_type,
                "name": name,
                "size": 55,
                "render": {
                    normal_unselected: (function() {
                        let local_node_type = node_type;
                        let local_name = name;
                        let local_rgb = rgb;
                        let local_id = id;
                        return function() {
                            return svg_node.unselected(local_node_type, local_name, local_rgb, local_id);
                        };
                    })(),
                    normal_selected: (function() {
                        let local_node_type = node_type;
                        let local_name = name;
                        let local_rgb = rgb;
                        let local_id = id;
                        return function() {
                            return svg_node.selected(local_node_type, local_name, local_rgb, local_id);
                        };
                    })(),
                    alert_unselected: (function() {
                        let local_node_type = node_type;
                        let local_name = name;
                        let local_id = id;
                        return function() {
                            return svg_node.unselected(local_node_type, local_name, "#ff0000", local_id);
                        };
                    })(),
                    alert_selected: (function() {
                        let local_node_type = node_type;
                        let local_name = name;
                        let local_id = id;
                        return function() {
                            return svg_node.selected(local_node_type, local_name, "#ff0000", local_id);
                        };
                    })()
                },
                "console_link": (function() {
                    let split_id = id.split(":");
                    let region = split_id[3];
                    return function() {
                        let html = `https://${region}.console.aws.amazon.com/mediaconnect/home?region=${region}#/flows/${id}`;
                        return html;
                    };
                })(),
                "cloudwatch_link": (function() {
                    let split_id = id.split(":");
                    let region = split_id[3];
                    let name = split_id[split_id.length - 1];
                    return function() {
                        let html = `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#metricsV2:graph=~();query=~'*7bAWS*2fMediaConnect*2cFlowARN*7d*20${name}`;
                        return html;
                    };
                })()
            };
            node_data.image.selected = node_data.render.normal_selected();
            node_data.image.unselected = node_data.render.normal_unselected();
            nodes.update(node_data);
        };