const map_device = function()

in source/html/js/app/mappers/nodes/medialive.js [244:318]


        const map_device = function(cache_entry) {
            const device = JSON.parse(cache_entry.data);
            const name = device.Id;
            const id = cache_entry.arn;
            const nodes = model.nodes;
            const rgb = "#D5DBDB";
            const node_type = "Elemental Link";
            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": device,
                "title": node_type,
                "name": name,
                "size": 55,
                "render": {
                    normal_unselected: (function() {
                        const local_node_type = node_type;
                        const local_name = name;
                        const local_rgb = rgb;
                        const local_id = id;
                        return function() {
                            return svg_node.unselected(local_node_type, local_name, local_rgb, local_id);
                        };
                    })(),
                    normal_selected: (function() {
                        const local_node_type = node_type;
                        const local_name = name;
                        const local_rgb = rgb;
                        const local_id = id;
                        return function() {
                            return svg_node.selected(local_node_type, local_name, local_rgb, local_id);
                        };
                    })(),
                    alert_unselected: (function() {
                        const local_node_type = node_type;
                        const local_name = name;
                        const local_id = id;
                        return function() {
                            return svg_node.unselected(local_node_type, local_name, "#ff0000", local_id);
                        };
                    })(),
                    alert_selected: (function() {
                        const local_node_type = node_type;
                        const local_name = name;
                        const local_id = id;
                        return function() {
                            return svg_node.selected(local_node_type, local_name, "#ff0000", local_id);
                        };
                    })()
                },
                "console_link": (function() {
                    const region = id.split(":")[3];
                    return function() {
                        const html = `https://${region}.console.aws.amazon.com/medialive/home?region=${region}#!/devices/${name}`;
                        return html;
                    };
                })(),
                "cloudwatch_link": (function() {
                    return function() {
                        return "https://console.aws.amazon.com/cloudwatch/";
                    };
                })()
            };
            node_data.image.selected = node_data.render.normal_selected();
            node_data.image.unselected = node_data.render.normal_unselected();
            nodes.update(node_data);
        };