Added ability to customise ports transit/peering/core/custom descr

This commit is contained in:
laf 2015-05-24 20:07:37 +01:00
parent 26ee1cbeb7
commit 1503013344
3 changed files with 23 additions and 0 deletions

View File

@ -235,6 +235,15 @@ if ($_SESSION['userlevel'] >= '5')
if ($config['int_peering']) { echo(' <li><a href="iftype/type=peering/"><i class="fa fa-user-plus fa-fw fa-lg"></i> Peering</a></li>'); $ifbreak = 1; }
if ($config['int_peering'] && $config['int_transit']) { echo(' <li><a href="iftype/type=peering,transit/"><i class="fa fa-user-secret fa-fw fa-lg"></i> Peering + Transit</a></li>'); $ifbreak = 1; }
if ($config['int_core']) { echo(' <li><a href="iftype/type=core/"><i class="fa fa-anchor fa-fw fa-lg"></i> Core</a></li>'); $ifbreak = 1; }
if (is_array($config['custom_descr']) === FALSE) {
$config['custom_descr'] = array($config['custom_descr']);
}
foreach ($config['custom_descr'] as $custom_type) {
if (!empty($custom_type)) {
echo ' <li><a href="iftype/type=' . strtolower($custom_type) . '"><i class="fa fa-connectdevelop fa-fw fa-lg"></i> ' . ucfirst($custom_type) . '</a></li>';
$ifbreak = 1;
}
}
}
if ($ifbreak) {

View File

@ -7,6 +7,16 @@ if ($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg = "#ffffff"; }
$type_where = " (";
foreach (explode(",", $vars['type']) as $type)
{
if (is_array($config[$type."_descr"]) === FALSE) {
$config[$type."_descr"] = array($config[$type."_descr"]);
}
foreach ($config[$type."_descr"] as $additional_type) {
if(!empty($additional_type)) {
$type_where .= " $or `port_descr_type` = ?";
$or = "OR";
$type_param[] = $additional_type;
}
}
$type_where .= " $or `port_descr_type` = ?";
$or = "OR";
$type_param[] = $type;

View File

@ -129,6 +129,10 @@ $config['old_graphs'] = 1; // RRDfiles from before the great rra r
$config['int_customers'] = 1; # Enable Customer Port Parsing
$config['customers_descr'] = 'cust';
$config['transit_descr'] = ""; // Add custom transit descriptions (can be an array)
$config['peering_descr'] = ""; // Add custom peering descriptions (can be an array)
$config['core_descr'] = ""; // Add custom core descriptions (can be an array)
$config['custom_descr'] = ""; // Add custom interface descriptions (can be an array)
$config['int_transit'] = 1; # Enable Transit Types
$config['int_peering'] = 1; # Enable Peering Types
$config['int_core'] = 1; # Enable Core Port Types