Beispiel #1
0
                $status = updatecdu($template, $status);
                $status = updatesensor($template, $status);
            }
            if ($status == __("Updated")) {
                $status = $template->ExportTemplate() ? __("Exported") : __("Error");
            }
            break;
        default:
            // do nothing if the value isn't one we expect
    }
}
$templateList = $template->GetTemplateList();
$ManufacturerList = $manufacturer->GetManufacturerList();
$ManufacturerListByID = $manufacturer->GetManufacturerList(true);
$mtList = MediaTypes::GetMediaTypeList();
$ccList = ColorCoding::GetCodeList();
$dcaList = DeviceCustomAttribute::GetDeviceCustomAttributeList();
$imageselect = '<div id="preview"></div><div id="filelist">';
$path = './pictures';
$dir = scandir($path);
foreach ($dir as $i => $f) {
    if (is_file($path . DIRECTORY_SEPARATOR . $f)) {
        // Suppress the getimagesize because it will error out on non-image files
        @($imageinfo = getimagesize($path . DIRECTORY_SEPARATOR . $f));
        if (preg_match('/^image/i', $imageinfo['mime'])) {
            $imageselect .= "<span>{$f}</span>\n";
        }
    }
}
$imageselect .= "</div>";
?>
Beispiel #2
0
        $response['powerport'][$pp->PortNumber] = $pp;
    } else {
        $response['powerport'] = $pp->getPorts();
    }
    echoResponse(200, $response);
});
//
//	URL:	/api/v1/colorcode
//	Method:	GET
//	Params:	none
//	Returns:  All defined color codes
//
$app->get('/colorcode', function () {
    $response['error'] = false;
    $response['errorcode'] = 200;
    $response['colorcode'] = ColorCoding::GetCodeList();
    echoResponse(200, $response);
});
//
//	URL:	/api/v1/colorcode/:colorid
//	Method:	GET
//	Params:	colorid (passed in URL)
//	Returns:  All defined color codes matching :colorid
//
$app->get('/colorcode/:colorid', function ($colorid) {
    $cc = new ColorCoding();
    $cc->ColorID = $colorid;
    if (!$cc->GetCode()) {
        $response['error'] = true;
        $response['errorcode'] = 404;
        $response['message'] = __("No color code found with ColorID") . " {$cc->ColorID}";
Beispiel #3
0
} else {
    $devarray = array('Server' => __("Server"), 'Appliance' => __("Appliance"), 'Storage Array' => __("Storage Array"), 'Switch' => __("Switch"), 'Chassis' => __("Chassis"), 'Patch Panel' => __("Patch Panel"), 'Physical Infrastructure' => __("Physical Infrastructure"), 'CDU' => __("CDU"), 'Sensor' => __("Sensor"));
}
if ($config->ParameterArray["mDate"] == "now") {
    if ($dev->MfgDate <= "1970-01-01") {
        $dev->MfgDate = date("Y-m-d");
    }
}
if ($config->ParameterArray["wDate"] == "now") {
    if ($dev->WarrantyExpire <= "1970-01-01") {
        $dev->WarrantyExpire = date("Y-m-d");
    }
}
$portList = DevicePorts::getPortList($dev->DeviceID);
$mediaTypes = MediaTypes::GetMediaTypeList();
$colorCodes = ColorCoding::GetCodeList();
$templateList = $templ->GetTemplateList();
$escTimeList = $escTime->GetEscalationTimeList();
$escList = $esc->GetEscalationList();
$deptList = $Dept->GetDepartmentList();
$templ->TemplateID = $dev->TemplateID;
$templ->GetTemplateByID();
$title = $dev->Label != '' ? "{$dev->Label} :: {$dev->DeviceID}" : __("openDCIM Device Maintenance");
function buildESXtable($DeviceID)
{
    $ESX = new ESX();
    $ESX->DeviceID = $DeviceID;
    $vmList = $ESX->GetDeviceInventory();
    print "\n<div class=\"table border\"><div><div>" . __("VM Name") . "</div><div>" . __("Status") . "</div><div>" . __("Owner") . "</div><div>" . __("Last Updated") . "</div></div>\n";
    foreach ($vmList as $vmRow) {
        $onOff = preg_match('/off/i', $vmRow->vmState) ? 'off' : 'on';