<?php require_once "db.inc.php"; require_once "facilities.inc.php"; $subheader = __("Data Center Statistics"); if (!isset($_GET["container"])) { // No soup for you. header('Location: ' . redirect()); exit; } $c = new Container(); $c->ContainerID = $_GET["container"]; $c->GetContainer(); $cStats = $c->GetContainerStatistics(); ?> <!doctype html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>openDCIM Data Center Information Management</title> <link rel="stylesheet" href="css/inventory.php" type="text/css"> <link rel="stylesheet" href="css/jquery-ui.css" type="text/css"> <!--[if lte IE 8]> <link rel="stylesheet" href="css/ie.css" type="text/css"> <script src="scripts/excanvas.js"></script> <![endif]--> <script type="text/javascript" src="scripts/jquery.min.js"></script> <script type="text/javascript" src="scripts/jquery-ui.min.js"></script> </head>
# mediaid to filter on. 0 for all. $mediaID = isset($_REQUEST['mediaid']) ? $_REQUEST['mediaid'] : -1; $graphname = "Network Map for "; $graphstr = ""; $devList = array(); # a list of colors recognized by graphviz. not all of them. $colorList = array("aquamarine", "bisque", "black", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dodgerblue", "fuchsia", "gold", "goldenrod", "gray", "green", "hotpink", "indianred", "indigo", "khaki", "lavender", "lawngreen", "lightblue", "lightcoral", "lightgoldenrod", "lightpink", "lightseagreen", "lightskyblue", "lightslateblue", "lightslategray", "lightsteelblue", "lime", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "navy", "olive", "orange", "orangered", "orchid", "palegreen", "palevioletred", "peachpuff", "peru", "plum", "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "seagreen", "silver", "skyblue", "slateblue", "springgreen", "steelblue", "tomato", "turquoise", "violet", "violetred", "yellow", "yellowgreen"); # decent default color palette for identifying device types $safeDeviceColors = array("cadetblue2", "deepskyblue4", "palegreen", "forestgreen", "lightpink", "red", "navajowhite", "darkorange", "plum", "purple", "khaki", "sienna", "black"); $deviceTypes = array('Server', 'Appliance', 'Storage Array', 'Switch', 'Chassis', 'Patch Panel', 'Physical Infrastructure', 'CDU', 'Sensor', 'WiFi AP', 'Router'); # handle the request variables and build the device lists. if (isset($_REQUEST['containerid'])) { $containerid = isset($_POST['containerid']) ? $_POST['containerid'] : $_GET['containerid']; $container = new Container(); $container->ContainerID = $containerid; $container->GetContainer(); $graphname .= "Container " . $container->Name; $dcList = $container->GetChildDCList(); foreach ($dcList as $dc) { $cabinet = new Cabinet(); $cabinet->DataCenterID = $dc->DataCenterID; foreach ($cabinet->ListCabinetsByDC(false, false) as $cab) { $device = new Device(); $device->Cabinet = $cab->CabinetID; foreach ($device->ViewDevicesByCabinet(true) as $dev) { if (!isset($devList[$dev->DeviceType])) { $devList[$dev->DeviceType] = array(); } $devList[$dev->DeviceType][$dev->DeviceID] = array(); } }
function UpdateContainer() { $this->MakeSafe(); $oldcontainer = new Container(); $oldcontainer->ContainerID = $this->ContainerID; $oldcontainer->GetContainer(); $sql = "UPDATE fac_Container SET Name=\"{$this->Name}\", ParentID={$this->ParentID}, \n\t\t\tDrawingFileName=\"{$this->DrawingFileName}\", MapX={$this->MapX}, MapY={$this->MapY} \n\t\t\tWHERE ContainerID={$this->ContainerID};"; if (!$this->query($sql)) { return false; } else { class_exists('LogActions') ? LogActions::LogThis($this, $oldcontainer) : ''; return true; } }