$parms = $_SERVER["argv"]; array_shift($parms); if (sizeof($parms)) { /* setup defaults */ $graph_type = ""; $templateGraph = array(); $dsGraph = array(); $dsGraph["snmpFieldSpec"] = ""; $dsGraph["snmpQueryId"] = ""; $dsGraph["snmpQueryType"] = ""; $dsGraph["snmpField"] = ""; $dsGraph["snmpValue"] = ""; $dsGraph["reindex_method"] = DATA_QUERY_AUTOINDEX_BACKWARDS_UPTIME; $input_fields = array(); $values["cg"] = array(); $hosts = getHosts(); $graphTemplates = getGraphTemplates(); $graphTitle = ""; /* modify for multi user start */ $dataTitle = ""; /* modify for multi user end */ $cgInputFields = ""; $hostId = 0; $templateId = 0; $hostTemplateId = 0; $force = 0; $listHosts = FALSE; $listGraphTemplates = FALSE; $listSNMPFields = FALSE; $listSNMPValues = FALSE; $listQueryTypes = FALSE;
$useYAZ = false; } else { echo "invalid protocol '{$postVars['protocol']}' specified."; } } ## set cutter type flag if ($postVars[cutterType] == 'LoC') { require_once 'lookupCutterLoc.php'; } elseif ($postVars[cutterType] == 'CS3') { require_once 'lookupCutterCs3.php'; } else { echo "Invalid cutter type selection - '{$postVars['cutterType']}'. <br />"; } ## prepare list of hosts using LookupHost require_once REL(__FILE__, 'LookupHostsQuery.php'); getHosts(''); # results are in $postVars[hosts] & $postVars[numHosts] ## main body of code switch ($_REQUEST[mode]) { #-.-.-.-.-.-.-.-.-.-.-.-.- case 'getHosts': echo json_encode($postVars[hosts]); //echo json_encode($postVars); break; #-.-.-.-.-.-.-.-.-.-.-.-.- #-.-.-.-.-.-.-.-.-.-.-.-.- case 'getCutter': echo "{'cutter':'" . getCutter($_REQUEST[author]) . "'}"; break; #-.-.-.-.-.-.-.-.-.-.-.-.- #-.-.-.-.-.-.-.-.-.-.-.-.-
<?php /* This file is part of a copyrighted work; it is distributed with NO WARRANTY. * See the file COPYRIGHT.html for more details. */ require_once "../shared/common.php"; require_once REL(__FILE__, "../shared/logincheck.php"); require_once REL(__FILE__, "../functions/errorFuncs.php"); require_once REL(__FILE__, "LookupHosts.php"); require_once REL(__FILE__, 'LookupHostsQuery.php'); switch ($_REQUEST[mode]) { #-.-.-.-.-.-.-.-.-.-.-.-.- case 'getHosts': ## prepare list of hosts using LookupHost getHosts('all'); # results are in $postVars[hosts] & $postVars[numHosts] echo json_encode($postVars[hosts]); break; #-.-.-.-.-.-.-.-.-.-.-.-.- #-.-.-.-.-.-.-.-.-.-.-.-.- case 'addNew': ## add new host database entry echo insertHost($_POST); break; #-.-.-.-.-.-.-.-.-.-.-.-.- #-.-.-.-.-.-.-.-.-.-.-.-.- case 'update': ## update host database entry echo updateHost($_POST); //echo"post=";print_r($_POST); break;
function getHostsTable() { $hosts = getHosts(); foreach ($hosts as $host) { $tableData .= "<tr><td>" . $host['servername'] . "</td><td>" . $host['host_port'] . "</td><td><button type='button' class='btn btn-default' onclick='details(" . $host['host_id'] . ")'>Details</button></td></tr>"; } if (strlen($tableData) === 0) { $tableData = "<tr><td colspan=3>No hosts found, you can add a new one below.</td></tr>"; } return $tableData; }
function _getLookupServers() { global $postVars; getHosts('active'); return $postVars['hosts']; }
<ul id="menu"> <li class="tab" id="menu_scenario"><a href="scenario.php">Scenarios</a></li> <li class="tab" id="menu_vnf"><a href="vnfs.php">VNFs</a></li> <li class="tabselected" id="menu_physical"><a href="physical.php">Physical</a></li> </ul> </div> <div id="containerLogo">openmano-gui</div> <div id="logo"><img height="60" src="images/nfvlabs_.png" /></div> </div> <div id="containerDown2" > <div id="containerPVL"> <h3 style="text-align:center">Physical Infrastructure<br></h3><hr> <?php require 'config.php'; require 'get_hosts.php'; getConfig(); getHosts(); echo "<script>\n"; echo " mano_url_base='http://" . ($mano_domain != null ? "{$mano_domain}" : "'+window.location.host+'") . ":{$mano_port}{$mano_path}';\n"; #echo " mano_url_base='http://" . ($mano_domain!=null? "{$mano_domain}" : $_SERVER['HTTP_HOST']). ":{$mano_port}{$mano_path}';\n"; echo " mano_tenant='{$mano_tenant}';\n"; echo "</script>\n"; ?> </div> <div id="containerPVR" > </div> </div> </div> <script> var selected_item={}; selected_item["name"]=""; selected_item["uuid"]="";
$result['pages'][$k][$key] = $value; } $item = Utils::parseRequestTags($result['pages'][$k], $tagsFilter); if (!$item) { unset($result['pages'][$k]); } else { $result['pages'][$k] = $item; } } } } $result['pages'] = array_values($result['pages']); if ($request->isXmlHttpRequest()) { return $app->json($result); } else { $result['hosts'] = getHosts($app['db'], $serverName); $result['last_id'] = sizeof($result['pages']) ? $result['pages'][0]['id'] : 0; $result['last_timestamp'] = sizeof($result['pages']) ? $result['pages'][0]['timestamp'] : 0; $response = new Response(); $response->setContent($app['twig']->render('live.html.twig', $result)); $response->headers->addCacheControlDirective('no-cache', true); $response->headers->addCacheControlDirective('no-store', true); $response->headers->addCacheControlDirective('must-revalidate', true); $response->headers->set('Pragma', 'no-cache'); $response->headers->set('Expires', '0'); return $response; } })->method('GET|POST')->value('hostName', 'all')->bind('server_live'); function getTagsTimersForIds($conn, $ids) { if (!sizeof($ids)) {
else { \$('#bulkMsg').html('{$loc->getText('lookup_bulkStatusError')}'); } }); }; getStatus(); var updateStatus = setInterval(getStatus, 10000); </script> INNERHTML; include "../shared/footer.php"; } else { require_once "../shared/header.php"; // $cancelLocation = "../catalog/index.php"; // Find host. require_once dirname(__FILE__) . '/../lookup2/LookupHostsQuery.php'; getHosts('active'); $list = $postVars['hosts']; if (!is_array($list) || count($list) < 1) { $warning = "<h5 id=\"updateMsg\">" . $loc->getText('lookup_HostFail') . "</h5>"; } echo <<<INNERHTML <h1>{$navbar->getText('lookup_bulk')}</h1> {$warning} <form method="post" enctype="multipart/form-data" action="{$_SERVER["SCRIPT_NAME"]}"> <label for="upload">{$loc->getText('lookup_bulkNotes')}</label> <br /> <input type="file" name="upload" /> <input type="hidden" name="MAX_FILE_SIZE" value="10000"/> <input type="submit" name="submit" class="button" value="{$loc->getText('Import')}" /> </form> INNERHTML;