feat: NAPALM driver for HPE OfficeConnect 1820/1920S
These switches have no CLI at all — no SSH, no Telnet and no ArubaOS-Switch REST API — so the ProCurve driver cannot serve them despite the shared vendor. The only management surface is the web UI, which ships its table data as JavaScript array literals; those parse with ast.literal_eval, so the driver needs no HTML parser and no dependency beyond napalm/requests. Read-only by design: the platform exposes a single administrator account with no privilege levels, and serves HTTPS only after a certificate has been uploaded, so the polling credential is necessarily the admin credential over a plain channel. Implements get_facts, get_interfaces, get_vlans, get_vlans_detail and get_mac_address_table, plus HTTP/SNMP fingerprints for discovery. Tested against an HPE OfficeConnect 1820 8G PoE+ (65W), J9982A, PT.02.19.
This commit is contained in:
Vendored
+397
@@ -0,0 +1,397 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Dashboard</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">Dashboard</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/base/help_dashboard.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/base/dashboard.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table class="fp_page_table_class" id="table_1" cellpadding="0" cellspacing="0" >
|
||||
<tbody>
|
||||
|
||||
<!-- System Information -->
|
||||
<tr>
|
||||
<td colspan="3"><div class="fp_jqtds_h2 fp_sub_title fp_sub_title_first">System Information</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr> <!-- System Description -->
|
||||
<td class="ui-widget-content fp_data_label_25w">System Description</td>
|
||||
<td class="ui-widget-content fp_data_value" id="sys_descr">HPE OfficeConnect Switch 1820 8G PoE+ (65W) J9982A, PT.02.19, Linux 3.6.5, U-Boot 2012.10-00116 (Jul 30 2014 - 10:52:01)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- System Name -->
|
||||
<td class="ui-widget-content fp_data_label_25w">System Name</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="text" id="sys_name" name="sys_name" size="20" maxlength="64"
|
||||
value="testswitch"> (0 to 64 characters)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- System Location -->
|
||||
<td class="ui-widget-content fp_data_label_25w">System Location</td>
|
||||
<td class="ui-widget-content fp_data_value"><input class="fp_inputfield" type="text" id="sys_location" name="sys_location" size="20" maxlength="255"
|
||||
value="Testlab"> (0 to 255 characters)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- System Contact -->
|
||||
<td class="ui-widget-content fp_data_label_25w">System Contact</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="text" id="sys_contact" name="sys_contact" size="20" maxlength="255"
|
||||
value="netork"> (0 to 255 characters)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- System Object ID -->
|
||||
<td class="ui-widget-content fp_data_label_25w">System Object ID</td>
|
||||
<td class="ui-widget-content fp_data_value" id="sys_obj_id">1.3.6.1.4.1.11.2.3.7.11.170</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- System Up Time -->
|
||||
<td class="ui-widget-content fp_data_label_25w">System Up Time</td>
|
||||
<td class="ui-widget-content fp_data_value" id="sys_up_time">0 days, 18 hours, 44 mins, 40 secs</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Current Time -->
|
||||
<td class="ui-widget-content fp_data_label_25w">Current Time</td>
|
||||
<td class="ui-widget-content fp_data_value" id="curr_time">
|
||||
19:44:40</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Date -->
|
||||
<td class="ui-widget-content fp_data_label_25w">Date</td>
|
||||
<td class="ui-widget-content fp_data_value" id="curr_date">
|
||||
January 01, 1970</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table class="fp_page_table_class" id="table_2" cellpadding="0" cellspacing="0" >
|
||||
<tbody>
|
||||
|
||||
<!-- Device Information -->
|
||||
<tr>
|
||||
<td colspan="3"><div class="fp_jqtds_h2 fp_sub_title">Device Information</div></td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Software Version -->
|
||||
<td class="ui-widget-content fp_data_label_25w">Software Version</td>
|
||||
<td class="ui-widget-content fp_data_value" id="sw_version" colspan="2">PT.02.19</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Operating System -->
|
||||
<td class="ui-widget-content fp_data_label_25w">Operating System</td>
|
||||
<td class="ui-widget-content fp_data_value" id="operating_sys" colspan="2">Linux 3.6.5</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Serial Number -->
|
||||
<td class="ui-widget-content fp_data_label_25w">Serial Number</td>
|
||||
<td class="ui-widget-content fp_data_value" id="serial_number" colspan="2">CN0FIXTURE0</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table class="fp_page_table_class" id="table_3" cellpadding="0" cellspacing="0" >
|
||||
<tbody>
|
||||
|
||||
<!-- System Resource Usage -->
|
||||
<tr>
|
||||
<td colspan="3"><div class="fp_jqtds_h2 fp_sub_title">System Resource Usage</div></td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- CPU Utilization (60 Second Average) -->
|
||||
<td class="ui-widget-content fp_data_label">CPU Utilization (60 Second Average)</td>
|
||||
<td class="ui-widget-content fp_data_value" id="cpu_util">
|
||||
<div class="fp_progressbar" id="cpu_util_prog_bar"></div>
|
||||
<div class="ui-widget-content fp_progressbar_val" id="cpu_util_prog_bar_val">14 %</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Memory Usage -->
|
||||
<td class="ui-widget-content fp_data_label">Memory Usage</td>
|
||||
<td class="ui-widget-content fp_data_value" id="mem_util">
|
||||
<div class="fp_progressbar" id="mem_util_prog_bar"></div>
|
||||
<div class="ui-widget-content fp_progressbar_val" id="mem_util_prog_bar_val">36 %</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Logged in Users -->
|
||||
<tr>
|
||||
<td colspan="3"><div class="fp_jqtds_h2 fp_sub_title">Logged In Users</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div id="dynamic_dt1"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="submit" id="b_form1_submit" name="b_form1_submit" value="Apply" onclick="jslib_b_pressed_g='submit';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="reset" id="b_form1_cancel" name="b_form1_cancel" value="Cancel" onclick="jslib_b_pressed_g='cancel';">
|
||||
</div> <!-- fp_button_row -->
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var aDataSet = [
|
||||
['admin', '192.0.2.100', '00:03:51', '00:05:05']
|
||||
,
|
||||
['admin', '192.0.2.100', '00:00:00', '00:00:16']
|
||||
];
|
||||
|
||||
var aColumns = [
|
||||
{ "sTitle": "Username", "sType": "intf-sort", "sWidth": "10%" },
|
||||
{ "sTitle": "Connection From", "sType": "html", "sWidth": "10%" },
|
||||
{ "sTitle": "Idle Time", "sType": "html", "sWidth": "10%" },
|
||||
{ "sTitle": "Session Time", "sType": "html", "sWidth": "10%" }
|
||||
];
|
||||
|
||||
// Construct property objects for each input field in the form
|
||||
var prop =
|
||||
{
|
||||
sys_location: new FieldProp({ defval: "", dname: "System Location", formfield: "sys_location", max: 255, min: 0, optional: true, regex: /^[ -~]+$/, type: 2 }),
|
||||
sys_name: new FieldProp({ defval: "", dname: "System Name", formfield: "sys_name", max: 64, min: 0, optional: true, regex: /^[ -~]+$/, type: 2 }),
|
||||
sys_contact: new FieldProp({ defval: "", dname: "System Contact", formfield: "sys_contact", max: 255, min: 0, optional: true, regex: /^[ -~]+$/, type: 2 })
|
||||
};
|
||||
|
||||
jslib_form_validation_bind($('#form1')[0], prop);
|
||||
|
||||
prop.sys_contact.uservalidate = function(field)
|
||||
{
|
||||
// This is a simple example of doing user validation. In actuality,
|
||||
// it does not do anything (just passes through the value.)
|
||||
var re = /^./ ;
|
||||
|
||||
if (field.value.length > 0 && !re.test(field.value))
|
||||
{
|
||||
return { errmsg: jsmsg.invalid_chars };
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$("div .fp_progressbar").each(function()
|
||||
{
|
||||
var sel = "#" + this.id;
|
||||
var val = elem_get(this.id + "_val").innerHTML;
|
||||
$(sel).progressbar({ value: val });
|
||||
$(sel).css({ "background": "#eeeeee" });
|
||||
$(sel + " > div").css({ "background": "green" });
|
||||
});
|
||||
});
|
||||
|
||||
function progress_bar_update(id, val, lev1, lev2)
|
||||
{
|
||||
var barcolor = "#00b388";
|
||||
if (lev1 != null)
|
||||
{
|
||||
////lev1 = 101; lev2 = 0;
|
||||
// lev1 designates a two-color scheme
|
||||
barcolor = (val < lev1) ? "green" : "red";
|
||||
|
||||
if ((lev2 != null) && (lev1 < lev2) && (val >= lev1))
|
||||
{
|
||||
// lev1 and lev2 designates a three-color scheme
|
||||
// (note: if specified, lev2 must be greater than lev1)
|
||||
barcolor = (val < lev2) ? "yellow" : "red";
|
||||
}
|
||||
}
|
||||
$(id).progressbar("option", "value", val);
|
||||
$(id + " > div").css({ "background": barcolor });
|
||||
}
|
||||
|
||||
// define form field(s) to be updated through Ajax using the specified script file
|
||||
// - script must produce results in same order as those listed in the fields array
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#dynamic_dt1').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="sorttable1"><\/table>' );
|
||||
fp_dt_create("#sorttable1", { aaData: aDataSet, aoColumns: aColumns });
|
||||
$("#sorttable1").width("100%");
|
||||
|
||||
progress_bar_update("#cpu_util_prog_bar", 14);
|
||||
progress_bar_update("#mem_util_prog_bar", 36);
|
||||
var fn = setInterval(function()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
url: "/htdocs/lua/ajax/dashboard_ajax.lua",
|
||||
success: function(val)
|
||||
{
|
||||
var res = val.split("|");
|
||||
if (res != null)
|
||||
{
|
||||
elem_get("sys_up_time").innerHTML = res[0];
|
||||
|
||||
var cpu_util = Number(res[1]);
|
||||
elem_get("cpu_util_prog_bar_val").innerHTML = cpu_util + " %";
|
||||
progress_bar_update("#cpu_util_prog_bar", cpu_util);
|
||||
|
||||
var mem_util = Number(res[2]);
|
||||
elem_get("mem_util_prog_bar_val").innerHTML = mem_util + " %";
|
||||
progress_bar_update("#mem_util_prog_bar", mem_util);
|
||||
elem_get("curr_time").innerHTML = res[3];
|
||||
elem_get("curr_date").innerHTML = res[4];
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0], prop);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
check_error();
|
||||
focus_init("");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+226
@@ -0,0 +1,226 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>MAC Table</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">MAC Table</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/base/help_mac_address_table.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/base/mac_address_table.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table id="fp_page_table_content" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
|
||||
<tr> <!-- Max Entries supported -->
|
||||
<td class="ui-widget-content fp_data_label">Maximum Entries Supported</td>
|
||||
<td class="ui-widget-content fp_data_value">8000</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<hr class="first"></hr>
|
||||
<div class="fp_sub_container">
|
||||
<div id="dynamic_dt1"></div>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_primary_button" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
</div> <!-- fp_button_row -->
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var aDataSet = [
|
||||
['1', '00:11:22:33:44:01', '7', '7', 'Learned']
|
||||
,
|
||||
['10', '00:11:22:33:44:02', '4', '4', 'Learned']
|
||||
,
|
||||
['10', '00:11:22:33:44:03', '3', '3', 'Learned']
|
||||
,
|
||||
['10', '00:11:22:33:44:04', '8', '8', 'Learned']
|
||||
,
|
||||
['10', '00:11:22:33:44:05', 'CPU', '53', 'Management']
|
||||
,
|
||||
['10', '00:11:22:33:44:06', '8', '8', 'Learned']
|
||||
,
|
||||
['30', '00:11:22:33:44:07', '3', '3', 'Learned']
|
||||
,
|
||||
['30', '00:11:22:33:44:08', '4', '4', 'Learned']
|
||||
,
|
||||
['30', '00:11:22:33:44:09', '7', '7', 'Learned']
|
||||
,
|
||||
['50', '00:11:22:33:44:0A', '3', '3', 'Learned']
|
||||
,
|
||||
['50', '00:11:22:33:44:0B', '3', '3', 'Learned']
|
||||
,
|
||||
['50', '00:11:22:33:44:0C', '3', '3', 'Learned']
|
||||
,
|
||||
['50', '00:11:22:33:44:0D', '3', '3', 'Learned']
|
||||
,
|
||||
['50', '00:11:22:33:44:0E', '3', '3', 'Learned']
|
||||
,
|
||||
['50', '00:11:22:33:44:0F', '3', '3', 'Learned']
|
||||
,
|
||||
['50', '00:11:22:33:44:10', '6', '6', 'Learned']
|
||||
,
|
||||
['50', '00:11:22:33:44:09', '7', '7', 'Learned']
|
||||
];
|
||||
|
||||
var aColumns = [
|
||||
{ "sTitle": "VLAN ID", "sType": "natural-sort" },
|
||||
{ "sTitle": "MAC Address" },
|
||||
{ "sTitle": "Interface", "sType": "natural-sort" },
|
||||
{ "sTitle": "Interface Index", "sType": "natural-sort" },
|
||||
{ "sTitle": "Status" }
|
||||
];
|
||||
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
// table pagination and sorting
|
||||
$('#dynamic_dt1').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="sorttable1"><\/table>' );
|
||||
fp_dt_create("#sorttable1", { aaData: aDataSet, aoColumns: aColumns });
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0]);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
focus_init("focus_top");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+531
@@ -0,0 +1,531 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Get Connected</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">Get Connected</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/base/help_network_ipv4_cfg.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/base/network_ipv4_cfg.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table class="fp_page_table_class" id="table_1" cellpadding="0" cellspacing="0" >
|
||||
<tbody>
|
||||
|
||||
<!-- Network Details -->
|
||||
<tr>
|
||||
<td colspan="3"><div class="fp_jqtds_h2 fp_sub_title fp_sub_title_first">Network Details</div></td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Protocol Type -->
|
||||
<td class="ui-widget-content fp_data_label">Protocol Type</td>
|
||||
<td class="ui-widget-content fp_data_value" id="protocol_type">
|
||||
<input type="radio" name="protocol_type_sel[]" id="protocol_type_sel_static" value="static" checked="checked" class="fp_inputfield" onchange="net_config_change(this);">
|
||||
<label for="protocol_type_sel_static">Static </label>
|
||||
<input type="radio" name="protocol_type_sel[]" id="protocol_type_sel_dhcp" value="dhcp" class="fp_inputfield" onchange="net_config_change(this);">
|
||||
<label for="protocol_type_sel_dhcp">DHCP </label>
|
||||
|
||||
<button title="Refresh DHCP Lease" id="b_form1_refresh_dhcp" class="fp_button_icon ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" type="submit" onclick="jslib_b_pressed_g='refresh_dhcp';"> </button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- IP Address -->
|
||||
<td class="ui-widget-content fp_data_label">IP Address</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="text" id="ip_addr" name="ip_addr" size="15" maxlength="15"
|
||||
value="192.0.2.20"> (x.x.x.x)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Subnet Mask -->
|
||||
<td class="ui-widget-content fp_data_label">Subnet Mask</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="text" id="subnet_mask" name="subnet_mask" size="15" maxlength="15"
|
||||
value="255.255.255.0"> (x.x.x.x)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Gateway Address -->
|
||||
<td class="ui-widget-content fp_data_label">Gateway Address</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="text" id="gateway_address" name="gateway_address" size="15" maxlength="15"
|
||||
value="192.0.2.1"> (x.x.x.x)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- MAC Address -->
|
||||
<td class="ui-widget-content fp_data_label">MAC Address</td>
|
||||
<td class="ui-widget-content fp_data_value" id="mac_address">00:11:22:33:44:05</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table class="fp_page_table_class" id="table_2" cellpadding="0" cellspacing="0" >
|
||||
<tbody>
|
||||
|
||||
<!-- Web Parameters -->
|
||||
<tr>
|
||||
<td colspan="3"><div class="fp_jqtds_h2 fp_sub_title">Web Parameters</div></td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Session Timeout -->
|
||||
<td class="ui-widget-content fp_data_label">Session Timeout (Minutes)</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="text" id="session_timeout" name="session_timeout" size="15" maxlength="2"
|
||||
value="5"> (1 to 60)</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table class="fp_page_table_class" id="table_3" cellpadding="0" cellspacing="0" >
|
||||
<tbody>
|
||||
|
||||
<!-- Management Access -->
|
||||
<tr>
|
||||
<td colspan="3"><div class="fp_jqtds_h2 fp_sub_title">Management Access</div></td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Management VLAN ID -->
|
||||
<td class="ui-widget-content fp_data_label">Management VLAN ID</td>
|
||||
<td class="ui-widget-content fp_data_value" id="mvlan">
|
||||
<select name="mgmt_vlan_id_sel[]" id="mgmt_vlan_id_sel">
|
||||
<option id="mgmt_vlan_id_sel_1" value="1">1</option>
|
||||
<option id="mgmt_vlan_id_sel_10" value="10" selected="selected">10</option>
|
||||
<option id="mgmt_vlan_id_sel_20" value="20">20</option>
|
||||
<option id="mgmt_vlan_id_sel_30" value="30">30</option>
|
||||
<option id="mgmt_vlan_id_sel_40" value="40">40</option>
|
||||
<option id="mgmt_vlan_id_sel_50" value="50">50</option>
|
||||
<option id="mgmt_vlan_id_sel_60" value="60">60</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Management Port -->
|
||||
<td class="ui-widget-content fp_data_label">Management Port</td>
|
||||
<td class="ui-widget-content fp_data_value" id="mport">
|
||||
<select name="mgmt_port_sel[]" id="mgmt_port_sel">
|
||||
<option id="mgmt_port_sel_none" value="none" selected="selected">None</option>
|
||||
<option id="mgmt_port_sel_2" value="2">2</option>
|
||||
<option id="mgmt_port_sel_3" value="3">3</option>
|
||||
<option id="mgmt_port_sel_4" value="4">4</option>
|
||||
<option id="mgmt_port_sel_8" value="8">8</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table class="fp_page_table_class" id="table_4" cellpadding="0" cellspacing="0" >
|
||||
<tbody>
|
||||
|
||||
<!-- SNMP -->
|
||||
<tr>
|
||||
<td colspan="3"><div class="fp_jqtds_h2 fp_sub_title">SNMP</div></td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- SNMP -->
|
||||
<td class="ui-widget-content fp_data_label">SNMP</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input type="radio" name="snmp_sel[]" id="snmp_sel_enabled" value="enabled" checked="checked">
|
||||
<label for="snmp_sel_enabled">Enabled </label>
|
||||
<input type="radio" name="snmp_sel[]" id="snmp_sel_disabled" value="disabled">
|
||||
<label for="snmp_sel_disabled">Disabled </label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Community Name -->
|
||||
<td class="ui-widget-content fp_data_label">Community Name</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="text" id="community_name" name="community_name" size="15" maxlength="20"
|
||||
value="public"> (1 to 20 characters)</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="submit" id="b_form1_submit" name="b_form1_submit" value="Apply" onclick="jslib_b_pressed_g='submit';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="reset" id="b_form1_cancel" name="b_form1_cancel" value="Cancel" onclick="jslib_b_pressed_g='cancel';">
|
||||
</div> <!-- fp_button_row -->
|
||||
<input type="hidden" id="change_mvlan" name="change_mvlan" value="no">
|
||||
<input type="hidden" id="change_mport" name="change_mport" value="no">
|
||||
</form> <!-- form1 -->
|
||||
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var prop =
|
||||
{
|
||||
gateway_address: new FieldProp({ defval: "", dname: "Gateway Address", formfield: "gateway_address", max: 15, min: 7, optional: true, regex: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, type: 2 }),
|
||||
ip_addr: new FieldProp({ defval: "", dname: "IP Address", formfield: "ip_addr", max: 15, min: 7, optional: true, regex: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, type: 2 }),
|
||||
community_name: new FieldProp({ defval: "", dname: "Community Name", formfield: "community_name", max: 20, min: 1, regex: /^[ -~]+$/, type: 2 }),
|
||||
session_timeout: new FieldProp({ defval: "5", dname: "Session Timeout", formfield: "session_timeout", max: 60, min: 1, regex: /^\d+$/, type: 3 }),
|
||||
subnet_mask: new FieldProp({ defval: "", dname: "Subnet Mask", formfield: "subnet_mask", max: 15, min: 7, optional: true, regex: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, type: 2 })
|
||||
};
|
||||
jslib_form_validation_bind($('#form1').get(0), prop);
|
||||
|
||||
var errorMsg = "";
|
||||
|
||||
// individual form field validation function wrappers
|
||||
// (used for onChange and onSubmit events)
|
||||
//
|
||||
function ip_cfg_validate(field)
|
||||
{
|
||||
var proto = $("#protocol_type :checked").val();
|
||||
// Validate only for static
|
||||
if(proto !== "static")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (field.value.length > 0 && !ipv4_address_validate(field.value))
|
||||
{
|
||||
return { errmsg: "Improper address format" }
|
||||
}
|
||||
if (field.value.length === 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(field.name == 'ip_addr'){
|
||||
if(field.value == "255.255.255.255"){
|
||||
return { errmsg: "Invalid address" }
|
||||
}
|
||||
if (errorMsg == "The IP address and subnet mask combination is not valid"){
|
||||
return { errmsg: "Invalid address" }
|
||||
}
|
||||
}
|
||||
if(field.name == 'subnet_mask'){
|
||||
if (errorMsg == "The subnet mask is not valid"){
|
||||
return { errmsg: "Invalid address" }
|
||||
}
|
||||
}
|
||||
if(field.name == 'gateway_address'){
|
||||
if (errorMsg == "Gateway is not valid"){
|
||||
return { errmsg: "Invalid address" }
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
prop.ip_addr.uservalidate = ip_cfg_validate;
|
||||
prop.subnet_mask.uservalidate = ip_cfg_validate;
|
||||
prop.gateway_address.uservalidate = ip_cfg_validate;
|
||||
|
||||
prop.community_name.uservalidate = function(field) {
|
||||
if($('#snmp_sel_disabled').is(':checked'))
|
||||
return true;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
// Enable/disable network configuration entries: IP address, netmask and gateway
|
||||
// It depends on the selected network configuration protocol {'static', 'dhcp'}
|
||||
function net_conf_entries_update(net_cfg_proto)
|
||||
{
|
||||
if(net_cfg_proto !== "static")
|
||||
{
|
||||
// Show warning message for protocol change
|
||||
alert("Changing protocol mode will reset IP configuration!");
|
||||
}
|
||||
if (net_cfg_proto === "static")
|
||||
{
|
||||
$("#ip_addr, #subnet_mask, #gateway_address").prop("disabled", false);
|
||||
$("#ip_addr").val("192.0.2.20");
|
||||
$("#subnet_mask").val("255.255.255.0");
|
||||
$("#gateway_address").val("192.0.2.1");
|
||||
$("#b_form1_refresh_dhcp").button("disable");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#ip_addr, #subnet_mask, #gateway_address").prop("disabled", true);
|
||||
$("#b_form1_refresh_dhcp").button("enable");
|
||||
}
|
||||
}
|
||||
|
||||
// Issues request to refresh DHCP
|
||||
function dhcp_refresh()
|
||||
{
|
||||
$.get("/htdocs/lua/ajax/net_ipv4_dhcp_refresh_ajax.lua");
|
||||
}
|
||||
|
||||
// Enable/disable DHCP refresh button
|
||||
function dhcp_refresh_update(net_cfg_proto)
|
||||
{
|
||||
if (net_cfg_proto === "dhcp")
|
||||
{
|
||||
$("#b_form1_refresh_dhcp").button("enable");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#b_form1_refresh_dhcp").button("disable");
|
||||
}
|
||||
}
|
||||
|
||||
// select list onchange handlers (client-side)
|
||||
function net_config_change(field)
|
||||
{
|
||||
net_conf_entries_update(field.value);
|
||||
}
|
||||
|
||||
$("#mvlan").change(function() {
|
||||
var val = confirm("You are changing the management VLAN. If the management VLAN is not set correctly you may lose network connection.");
|
||||
|
||||
if (val == false) {
|
||||
$("#mgmt_vlan_id_sel_10").prop("selected", true);
|
||||
$("#change_mvlan").val("yes");
|
||||
}
|
||||
else {
|
||||
$("#change_mvlan").val("yes");
|
||||
$("#b_form1_submit").trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
$("#mport").change(function() {
|
||||
var val = confirm("You are changing the management port. If the management VLAN and port is not set correctly, you may lose network connection.");
|
||||
|
||||
if (val == false) {
|
||||
$("#mgmt_port_sel_none").prop("selected", true);
|
||||
$("#change_mport").val("no");
|
||||
}
|
||||
else {
|
||||
$("#change_mport").val("yes");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).ready( function ()
|
||||
{
|
||||
// Disable fields not related to DHCP
|
||||
if(false)
|
||||
{
|
||||
$('#ip_addr').prop('disabled', true);
|
||||
$('#subnet_mask').prop('disabled', true);
|
||||
$('#gateway_address').prop('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMsg = "";
|
||||
$('#ip_addr').change();
|
||||
$('#subnet_mask').change();
|
||||
$('#gateway_address').change();
|
||||
errorMsg = "";
|
||||
}
|
||||
|
||||
// Refresh DHCP Button Icon
|
||||
$("#b_form1_refresh_dhcp")
|
||||
.button({
|
||||
icons: { primary: "ui-icon-refresh" },
|
||||
text: false,
|
||||
disabled: true
|
||||
}).bind('click', dhcp_refresh);
|
||||
|
||||
// Update DHCP refresh button
|
||||
dhcp_refresh_update($("#protocol_type :checked").val());
|
||||
|
||||
// popup message if managment port select as none
|
||||
|
||||
$( "#mgmt_port_sel" ).change(function() {
|
||||
if($( "#mgmt_port_sel option:selected" ).val() == "none" && $( "#mgmt_vlan_id_sel option:selected" ).val() != 1){
|
||||
var retVal = confirm("The management VLAN is not the default VLAN and you are changing the management port to None. If the management VLAN and port is not set correctly, you may lose network connection.");
|
||||
if (retVal == false) {
|
||||
$("#mgmt_port_sel_none").prop("selected", true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$( "#b_form1_submit" ).click(function() {
|
||||
if($( "#mgmt_port_sel option:selected" ).val() == "none" && $( "#mgmt_vlan_id_sel option:selected" ).val() != 1){
|
||||
var retVal = confirm("The management VLAN is not the default VLAN and you are changing the management port to None. If the management VLAN and port is not set correctly, you may lose network connection.");
|
||||
if (retVal == false) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Add on reset handler
|
||||
$("#form1").bind("reset", function() {
|
||||
setTimeout(function() { // Need this delay so we read the reset values
|
||||
net_conf_entries_update($("#protocol_type :checked").val());
|
||||
}, 1);
|
||||
});
|
||||
|
||||
// specific to SNMP package
|
||||
if (false)
|
||||
{
|
||||
$('#community_name').val("");
|
||||
$('#community_name').prop('disabled', true);
|
||||
}
|
||||
$("#snmp_sel_disabled, #snmp_sel_enabled").change(function() {
|
||||
if ($(this).prop('id') === 'snmp_sel_disabled')
|
||||
{
|
||||
$('#community_name').val("");
|
||||
$('#community_name').prop('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#community_name').prop('disabled', false);
|
||||
var communityName = "public";
|
||||
if (communityName == '')
|
||||
{
|
||||
communityName = "public";
|
||||
}
|
||||
$('#community_name').val(communityName);
|
||||
}
|
||||
});
|
||||
$('#community_name').prop('disabled', false);
|
||||
});
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0], prop);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
check_error();
|
||||
focus_init("");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+248
@@ -0,0 +1,248 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Port Status</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">Port Status</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/base/help_port_summary.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/base/port_summary.lsp">
|
||||
<div class="fp_sub_container">
|
||||
<div id="dynamic_dt1"></div>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_primary_button" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_multi_edit" name="b_form1_dt_multi_edit" value="Edit" >
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_add" name="b_form1_dt_add" value="Edit All" >
|
||||
</div> <!-- fp_button_row -->
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var aDataSet = [
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_1" value="1"><label></label>', '1', '', 'Enabled', 'Normal', 'Link Down', 'Auto', '', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_2" value="2"><label></label>', '2', '', 'Enabled', 'Normal', 'Link Down', 'Auto', '', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_3" value="3"><label></label>', '3', '', 'Enabled', 'Normal', 'Link Up', 'Auto', '1000 Mbps', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_4" value="4"><label></label>', '4', '', 'Enabled', 'Normal', 'Link Up', 'Auto', '1000 Mbps', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_5" value="5"><label></label>', '5', '', 'Enabled', 'Normal', 'Link Down', 'Auto', '', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_6" value="6"><label></label>', '6', '', 'Enabled', 'Normal', 'Link Up', 'Auto', '100 Mbps Full Duplex', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_7" value="7"><label></label>', '7', '', 'Enabled', 'Normal', 'Link Up', 'Auto', '1000 Mbps', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_8" value="8"><label></label>', '8', '', 'Enabled', 'Normal', 'Link Up', 'Auto', '1000 Mbps', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_54" value="54"><label></label>', 'TRK1', '', 'Enabled', 'Normal', 'Link Down', 'Trunk', '', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_55" value="55"><label></label>', 'TRK2', '', 'Enabled', 'Normal', 'Link Down', 'Trunk', '', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_56" value="56"><label></label>', 'TRK3', '', 'Enabled', 'Normal', 'Link Down', 'Trunk', '', '1518']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_57" value="57"><label></label>', 'TRK4', '', 'Enabled', 'Normal', 'Link Down', 'Trunk', '', '1518']
|
||||
];
|
||||
|
||||
var aColumns = [
|
||||
{ "sTitle": '<input type="checkbox" class="chkall" name="chkall" id="chkall" value="chkall"><label></label>', "bSearchable": false, "bSortable": false, "sWidth": "2%" },
|
||||
{ "sTitle": "Interface", "sType": "intf-sort", "sWidth": "8%" },
|
||||
{ "sTitle": "Port Description", "sType": "html", "sWidth": "14%" },
|
||||
{ "sTitle": "Admin Mode", "sType": "html", "sWidth": "14%" },
|
||||
{ "sTitle": "Physical Type", "sType": "html", "sWidth": "14%" },
|
||||
{ "sTitle": "Port Status", "sType": "html", "sWidth": "14%" },
|
||||
{ "sTitle": "Physical Mode", "sType": "html", "sWidth": "14%" },
|
||||
{ "sTitle": "Link Speed", "sType": "natural-sort", "sWidth": "14%" },
|
||||
{ "sTitle": "MTU", "sType": "html", "sWidth": "6%" }
|
||||
];
|
||||
|
||||
// Edit button query string callback function -
|
||||
// This function name must be specified as the 'fn' parameter on 'modal_button_attrib'
|
||||
// for the correct button, in this case, the 'edit' button
|
||||
function fnEdit()
|
||||
{
|
||||
var qString = '';
|
||||
var queueStr = [];
|
||||
|
||||
$(".chkrow:checked").each(function(idx) {
|
||||
queueStr[idx] = $(this).val();
|
||||
});
|
||||
|
||||
qString = '?intf=' + queueStr;
|
||||
|
||||
return qString;
|
||||
}
|
||||
|
||||
function fnEditAll()
|
||||
{
|
||||
return '?intf=all';
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
// Add data table and set pagination and sorting
|
||||
$('#dynamic_dt1').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="sorttable1"><\/table>' );
|
||||
fp_dt_create("#sorttable1", { aaData: aDataSet, aoColumns: aColumns, dt_btn: true, multi_select: true, rw: true });
|
||||
|
||||
if ((12 == 0) || (false == true))
|
||||
{
|
||||
$("#b_form1_dt_add").button({ disabled: true });
|
||||
}
|
||||
});
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0]);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
// Bind to the click event for all the matching 'b_form1_dt_multi_edit' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_multi_edit"]').click( function() {
|
||||
var qStr = fnEdit();
|
||||
main_modal_page_open('/htdocs/pages/base/port_summary_modal.lsp' + qStr, 'Edit Port Configuration', '540', '400', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
// Bind to the click event for all the matching 'b_form1_dt_add' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_add"]').click( function() {
|
||||
var qStr = fnEditAll();
|
||||
main_modal_page_open('/htdocs/pages/base/port_summary_modal.lsp' + qStr, 'Edit Port Configuration', '520', '320', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
focus_init("focus_top");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Port Summary Statistics</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">Port Summary Statistics</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/base/help_port_summary_stats.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/base/port_summary_stats.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<div id="dynamic_dt1"></div>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_primary_button" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="submit" id="b_form1_dt_clear_all_ctrs" name="b_form1_dt_clear_all_ctrs" value="Clear All Counters" onclick="jslib_b_pressed_g='dt_clear_all_ctrs';">
|
||||
</div> <!-- fp_button_row -->
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var aDataSet = [
|
||||
['1', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['2', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['3', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['4', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['5', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['6', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['7', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['8', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['TRK1', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['TRK2', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['TRK3', '', '', '', '', '', '', '', '']
|
||||
,
|
||||
['TRK4', '', '', '', '', '', '', '', '']
|
||||
];
|
||||
|
||||
var aColumns = [
|
||||
{ "sTitle": "Interface", "sType": "natural-sort" },
|
||||
{ "sTitle": "Received Packets w/o Error", "sType": "natural-sort" },
|
||||
{ "sTitle": "Received Packets with Error", "sType": "natural-sort" },
|
||||
{ "sTitle": "Broadcast Received Packets", "sType": "natural-sort" },
|
||||
{ "sTitle": "Transmitted Packets w/o Error", "sType": "natural-sort" },
|
||||
{ "sTitle": "Transmitted Packets with Error", "sType": "natural-sort" },
|
||||
{ "sTitle": "Collisions", "sType": "natural-sort" },
|
||||
{ "sTitle": "Transmitted Pause Frames", "sType": "natural-sort" },
|
||||
{ "sTitle": "Received Pause Frames", "sType": "natural-sort" }
|
||||
];
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
//table pagination and sorting
|
||||
$('#dynamic_dt1').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="sorttable1"><\/table>' );
|
||||
fp_dt_create("#sorttable1", { aaData: aDataSet, aoColumns: aColumns, dt_btn: true, multi_select:true, rw: true });
|
||||
|
||||
});
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0]);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
var opt_btns = [
|
||||
{ id: 'btnPost', text: 'OK', msg: 'To proceed, click OK.'},
|
||||
{ id: 'btnClose', text: 'Close', msg: 'To return to the web page, click Close.'}
|
||||
];
|
||||
// Bind to the submit event for 'b_form1_dt_clear_all_ctrs' to open a modal confirm dialog
|
||||
$('#form1').submit( function(e) {
|
||||
var pattern = /dt_clear_all_ctrs/gi;
|
||||
if (jslib_b_pressed_g.match(pattern)) {
|
||||
e.preventDefault();
|
||||
main_confirm_dialog_open_optional_buttons('dt_clear_all_ctrs', 'Are you sure you want to clear all counters?', opt_btns); }
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
focus_init("focus_top");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+241
@@ -0,0 +1,241 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Password Manager</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">Password Manager</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/base/help_user_accounts.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<!-- ******************************* form1 ******************************* -->
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/base/user_accounts.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table id="fp_page_table_content" cellpadding="0" cellspacing="0" >
|
||||
<tbody>
|
||||
|
||||
<tr> <!-- User Name -->
|
||||
<td class="ui-widget-content fp_data_label">Username</td>
|
||||
<td class="fp_dialog ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="text" id="user_name" name="user_name" maxlength="64"
|
||||
value="admin"> (1 to 64 characters)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Current Password -->
|
||||
<td class="ui-widget-content fp_data_label">Current Password</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="password" id="current_password" name="current_password" maxlength="64"
|
||||
value=""> (8 to 64)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- New Password -->
|
||||
<td class="ui-widget-content fp_data_label">New Password</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="password" id="new_password" name="new_password" maxlength="64"
|
||||
value=""> (8 to 64)</td>
|
||||
</tr>
|
||||
|
||||
<tr> <!-- Confirm New Password -->
|
||||
<td class="ui-widget-content fp_data_label">Confirm New Password</td>
|
||||
<td class="ui-widget-content fp_data_value">
|
||||
<input class="fp_inputfield" type="password" id="confirm_new_passwd" name="confirm_new_passwd" maxlength="64"
|
||||
value=""> (8 to 64)</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="submit" id="b_form1_submit" name="b_form1_submit" value="Apply" onclick="jslib_b_pressed_g='submit';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default" type="reset" id="b_form1_cancel" name="b_form1_cancel" value="Cancel" onclick="jslib_b_pressed_g='cancel';">
|
||||
</div> <!-- fp_button_row -->
|
||||
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
// Construct property objects for each input field in the form
|
||||
var prop =
|
||||
{
|
||||
new_password: new FieldProp({ defval: "", dname: "New Password", formfield: "new_password", max: 64, min: 8, regex: /.*/, type: 2 }),
|
||||
user_name: new FieldProp({ defval: "", dname: "Username", formfield: "user_name", max: 64, min: 1, regex: /^[\w _\-\.]*$/, type: 2 }),
|
||||
current_password: new FieldProp({ defval: "", dname: "Current Password", formfield: "current_password", max: 64, min: 8, optional: true, regex: /.*/, type: 2 }),
|
||||
confirm_new_passwd: new FieldProp({ defval: "", dname: "Confirm New Password", formfield: "confirm_new_passwd", max: 64, min: 8, regex: /.*/, type: 2 })
|
||||
};
|
||||
|
||||
jslib_form_validation_bind($('#form1')[0], prop);
|
||||
|
||||
prop.confirm_new_passwd.uservalidate = function (field)
|
||||
{
|
||||
var pass = $("#new_password").val();
|
||||
var confirm_pass = field.value;
|
||||
|
||||
if (pass.match(/[?"]/g)) {
|
||||
return { errmsg: jsmsg.invalid_chars };
|
||||
} else if (pass !== confirm_pass) {
|
||||
return { errmsg: jsmsg.same_passwd };
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function local_validate()
|
||||
{
|
||||
if( jslib_b_pressed_g === 'submit')
|
||||
{
|
||||
var v1 = $('#user_name').val();
|
||||
if(v1 !== "admin")
|
||||
{
|
||||
var r = confirm("Changing the user name! To initiate a new web session you must log in using the newly defined user name. Do you wish to change the user name?");
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0], prop);
|
||||
if (page_is_valid) { page_is_valid = local_validate(); }
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
check_error();
|
||||
focus_init("focus_top");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Trunk Configuration</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">Trunk Configuration</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/switching/help_port_channel_summary.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/switching/port_channel_summary.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<div id="dynamic_dt1"></div>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_primary_button" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_edit" name="b_form1_dt_edit" value="Edit" >
|
||||
</div> <!-- fp_button_row -->
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var aDataSet = [
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_54" value="54"><label></label>', 'TRK1', 'TRK1', 'Static', 'Enabled', 'Down', '', '']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_55" value="55"><label></label>', 'TRK2', 'TRK2', 'Static', 'Enabled', 'Down', '', '']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_56" value="56"><label></label>', 'TRK3', 'TRK3', 'Static', 'Enabled', 'Down', '', '']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_57" value="57"><label></label>', 'TRK4', 'TRK4', 'Static', 'Enabled', 'Down', '', '']
|
||||
];
|
||||
|
||||
var aColumns = [
|
||||
{ "sTitle": '', "bSearchable": false, "bSortable": false, "sWidth": "2%" },
|
||||
{ "sTitle": "Trunk", "sType": "natural-sort" },
|
||||
{ "sTitle": "Name", "sType": "natural-sort" },
|
||||
{ "sTitle": "Type", "sType": "natural-sort" },
|
||||
{ "sTitle": "Admin Mode", "sType": "natural-sort" },
|
||||
{ "sTitle": "Link Status", "sType": "natural-sort" },
|
||||
{ "sTitle": "Members", "bSortable": false },
|
||||
{ "sTitle": "Active Ports", "bSortable": false }
|
||||
];
|
||||
|
||||
// Edit button query string callback function -
|
||||
// This function name must be specified as the 'fn' parameter on 'modal_button_attrib'
|
||||
// for the correct button, in this case, the 'edit' button
|
||||
function fnEdit()
|
||||
{
|
||||
var selected = fp_dt_get_selected($("#sorttable1"));
|
||||
var qString = '';
|
||||
|
||||
if (selected.length == 1)
|
||||
{
|
||||
qString = '?index=' + selected[0].cells[0].firstChild.value;
|
||||
}
|
||||
return qString;
|
||||
}
|
||||
$(document).ready(function()
|
||||
{
|
||||
// define sort technique for all permanent columns
|
||||
$('#dynamic_dt1').html( '<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="sorttable1"><\/table>' );
|
||||
fp_dt_create("#sorttable1", { aaData: aDataSet, aoColumns: aColumns, dt_btn: true, rw: true });
|
||||
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0]);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
// Bind to the click event for all the matching 'b_form1_dt_edit' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_edit"]').click( function() {
|
||||
var qStr = fnEdit();
|
||||
main_modal_page_open('/htdocs/pages/switching/port_channel_modal.lsp' + qStr, 'Edit Existing Trunk', '550', '520', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
focus_init("focus_top");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>VLAN Port Membership</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">VLAN Port Membership</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/switching/help_vlan_per_port.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/switching/vlan_per_port.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table id="fp_page_table_content" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
|
||||
<tr> <!-- VLAN ID -->
|
||||
<td class="ui-widget-content fp_data_label">VLAN ID</td>
|
||||
<td class="ui-widget-content fp_data_value" id="vlan">
|
||||
<select name="vlan_sel[]" id="vlan_sel" onchange="selector_change(this);">
|
||||
<option id="vlan_sel_1" value="1" selected="selected">1</option>
|
||||
<option id="vlan_sel_10" value="10">10</option>
|
||||
<option id="vlan_sel_20" value="20">20</option>
|
||||
<option id="vlan_sel_30" value="30">30</option>
|
||||
<option id="vlan_sel_40" value="40">40</option>
|
||||
<option id="vlan_sel_50" value="50">50</option>
|
||||
<option id="vlan_sel_60" value="60">60</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<hr class="first"></hr>
|
||||
<div class="fp_sub_container">
|
||||
<div id="dynamic_dt1"></div>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_primary_button" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_remove" name="b_form1_dt_remove" value="Edit" >
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_add" name="b_form1_dt_add" value="Edit All" >
|
||||
</div> <!-- fp_button_row -->
|
||||
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var aDataSet = [
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_1" value="1"><label></label>', '1', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_2" value="2"><label></label>', '2', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_3" value="3"><label></label>', '3', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_4" value="4"><label></label>', '4', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_5" value="5"><label></label>', '5', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_6" value="6"><label></label>', '6', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_7" value="7"><label></label>', '7', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_8" value="8"><label></label>', '8', 'Tagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_54" value="54"><label></label>', 'TRK1', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_55" value="55"><label></label>', 'TRK2', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_56" value="56"><label></label>', 'TRK3', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_57" value="57"><label></label>', 'TRK4', 'Untagged']
|
||||
];
|
||||
|
||||
var aColumns = [
|
||||
{ "sTitle": '<input type="checkbox" class="chkall" name="chkall" id="chkall" value="chkall"><label></label>', "bSearchable": false, "bSortable": false, "sWidth": "2%" },
|
||||
{ "sTitle": "Interface", "sType": "intf-sort" },
|
||||
{ "sTitle": "Participation/Tagging", "sType": "html" }
|
||||
];
|
||||
|
||||
// Select list onchange handler (client-side)
|
||||
function selector_change(field)
|
||||
{
|
||||
field.form.submit();
|
||||
}
|
||||
|
||||
// Edit button query string callback function
|
||||
// This function name is specified as the 'fn' parameter on 'modal_button_attrib' for the 'edit' button
|
||||
function fnEdit()
|
||||
{
|
||||
var qString = '';
|
||||
var intfStr = [];
|
||||
|
||||
$(".chkrow:checked").each(function(idx) {
|
||||
intfStr[idx] = $(this).val();
|
||||
});
|
||||
|
||||
qString = '?vlan='+$("#vlan_sel option:selected").val() + '&intfStr='+intfStr;
|
||||
return qString;
|
||||
}
|
||||
|
||||
// Edit All button query string callback function
|
||||
// This function name is specified as the 'fn' parameter on 'modal_button_attrib' for the 'editAll' button
|
||||
function fnEditAll()
|
||||
{
|
||||
return '?vlan='+$("#vlan_sel option:selected").val() + '&intfStr=all';
|
||||
}
|
||||
|
||||
$(document).ready( function ()
|
||||
{
|
||||
// Define datatable
|
||||
$('#dynamic_dt1').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="sorttable1"><\/table>' );
|
||||
fp_dt_create("#sorttable1", { aaData: aDataSet, aoColumns: aColumns, dt_btn: true, multi_select: true, rw: true });
|
||||
|
||||
var val = 0;
|
||||
if ((val != 0) || (false == true))
|
||||
{
|
||||
$("#b_form1_dt_add").button("disable");
|
||||
}
|
||||
});
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0]);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
// Bind to the click event for all the matching 'b_form1_dt_remove' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_remove"]').click( function() {
|
||||
var qStr = fnEdit();
|
||||
main_modal_page_open('/htdocs/pages/switching/vlan_per_port_modal.lsp' + qStr, 'Edit VLAN Port Membership', '750', '380', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
// Bind to the click event for all the matching 'b_form1_dt_add' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_add"]').click( function() {
|
||||
var qStr = fnEditAll();
|
||||
main_modal_page_open('/htdocs/pages/switching/vlan_per_port_modal.lsp' + qStr, 'Edit VLAN Port Membership', '750', '360', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
focus_init("focus_top");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>VLAN Port Membership</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">VLAN Port Membership</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/switching/help_vlan_per_port.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/switching/vlan_per_port.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<table id="fp_page_table_content" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
|
||||
<tr> <!-- VLAN ID -->
|
||||
<td class="ui-widget-content fp_data_label">VLAN ID</td>
|
||||
<td class="ui-widget-content fp_data_value" id="vlan">
|
||||
<select name="vlan_sel[]" id="vlan_sel" onchange="selector_change(this);">
|
||||
<option id="vlan_sel_1" value="1">1</option>
|
||||
<option id="vlan_sel_10" value="10" selected="selected">10</option>
|
||||
<option id="vlan_sel_20" value="20">20</option>
|
||||
<option id="vlan_sel_30" value="30">30</option>
|
||||
<option id="vlan_sel_40" value="40">40</option>
|
||||
<option id="vlan_sel_50" value="50">50</option>
|
||||
<option id="vlan_sel_60" value="60">60</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<hr class="first"></hr>
|
||||
<div class="fp_sub_container">
|
||||
<div id="dynamic_dt1"></div>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_primary_button" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_remove" name="b_form1_dt_remove" value="Edit" >
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_add" name="b_form1_dt_add" value="Edit All" >
|
||||
</div> <!-- fp_button_row -->
|
||||
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var aDataSet = [
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_1" value="1"><label></label>', '1', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_2" value="2"><label></label>', '2', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_3" value="3"><label></label>', '3', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_4" value="4"><label></label>', '4', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_5" value="5"><label></label>', '5', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_6" value="6"><label></label>', '6', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_7" value="7"><label></label>', '7', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_8" value="8"><label></label>', '8', 'Untagged']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_54" value="54"><label></label>', 'TRK1', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_55" value="55"><label></label>', 'TRK2', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_56" value="56"><label></label>', 'TRK3', 'Excluded']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_57" value="57"><label></label>', 'TRK4', 'Excluded']
|
||||
];
|
||||
|
||||
var aColumns = [
|
||||
{ "sTitle": '<input type="checkbox" class="chkall" name="chkall" id="chkall" value="chkall"><label></label>', "bSearchable": false, "bSortable": false, "sWidth": "2%" },
|
||||
{ "sTitle": "Interface", "sType": "intf-sort" },
|
||||
{ "sTitle": "Participation/Tagging", "sType": "html" }
|
||||
];
|
||||
|
||||
// Select list onchange handler (client-side)
|
||||
function selector_change(field)
|
||||
{
|
||||
field.form.submit();
|
||||
}
|
||||
|
||||
// Edit button query string callback function
|
||||
// This function name is specified as the 'fn' parameter on 'modal_button_attrib' for the 'edit' button
|
||||
function fnEdit()
|
||||
{
|
||||
var qString = '';
|
||||
var intfStr = [];
|
||||
|
||||
$(".chkrow:checked").each(function(idx) {
|
||||
intfStr[idx] = $(this).val();
|
||||
});
|
||||
|
||||
qString = '?vlan='+$("#vlan_sel option:selected").val() + '&intfStr='+intfStr;
|
||||
return qString;
|
||||
}
|
||||
|
||||
// Edit All button query string callback function
|
||||
// This function name is specified as the 'fn' parameter on 'modal_button_attrib' for the 'editAll' button
|
||||
function fnEditAll()
|
||||
{
|
||||
return '?vlan='+$("#vlan_sel option:selected").val() + '&intfStr=all';
|
||||
}
|
||||
|
||||
$(document).ready( function ()
|
||||
{
|
||||
// Define datatable
|
||||
$('#dynamic_dt1').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="sorttable1"><\/table>' );
|
||||
fp_dt_create("#sorttable1", { aaData: aDataSet, aoColumns: aColumns, dt_btn: true, multi_select: true, rw: true });
|
||||
|
||||
var val = 0;
|
||||
if ((val != 0) || (false == true))
|
||||
{
|
||||
$("#b_form1_dt_add").button("disable");
|
||||
}
|
||||
});
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0]);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
// Bind to the click event for all the matching 'b_form1_dt_remove' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_remove"]').click( function() {
|
||||
var qStr = fnEdit();
|
||||
main_modal_page_open('/htdocs/pages/switching/vlan_per_port_modal.lsp' + qStr, 'Edit VLAN Port Membership', '750', '380', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
// Bind to the click event for all the matching 'b_form1_dt_add' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_add"]').click( function() {
|
||||
var qStr = fnEditAll();
|
||||
main_modal_page_open('/htdocs/pages/switching/vlan_per_port_modal.lsp' + qStr, 'Edit VLAN Port Membership', '750', '360', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
focus_init("focus_top");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+259
@@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- Copyright © 2017-2022 Hewlett Packard Enterprise Development LP. -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>VLAN Configuration</title>
|
||||
<link rel="shortcut icon" href="/htdocs/login/favicon.ico?">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/jquery-ui-1.12.1.custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/css/jquery.dataTables_themeroller.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_datatables_custom.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_common_pages.css">
|
||||
<link type="text/css" media="screen" rel="stylesheet" href="/htdocs/static/bt1707389424/css/tabs.css">
|
||||
<!--[if ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7.css" type="text/css">
|
||||
<![endif]-->
|
||||
<!--[if gte ie 7]>
|
||||
<link rel="stylesheet" href="/htdocs/static/bt1707389424/css/style_browser_fixups_ie7plus.css" type="text/css">
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_3_5_1/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/jquery_ui_1_12_1/jquery-ui-1.12.1.min.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ui-state-default fp_jqtds_page_body fp_corner_bottom">
|
||||
<a name="focus_top" id="focus_top"></a>
|
||||
|
||||
<div id="fp_div_page_title_bar" class="fp_jqtds_h1">
|
||||
<div id="fp_div_page_title_text">VLAN Configuration</div>
|
||||
<div id="fp_div_title_bar_tooltip">
|
||||
<a class="fp_anchor_tooltip" href="/htdocs/lang/en_us/help/switching/help_vlan_status.lsp" target="_blank">
|
||||
<img src="/htdocs/static/bt1707389424/images/icon_help_black24-helpText.png" title="Help" alt="Help" border="0">
|
||||
</a>
|
||||
</div><!-- fp_div_title_bar_tooltip -->
|
||||
</div><!-- fp_div_page_title_bar -->
|
||||
|
||||
<div class="fp_page_container">
|
||||
|
||||
<form id="form1" name="form1" method="post" action="/htdocs/pages/switching/vlan_status.lsp">
|
||||
|
||||
<div class="fp_sub_container">
|
||||
<div id="dynamic_dt1"></div>
|
||||
</div> <!-- fp_sub_container -->
|
||||
|
||||
<div id="page_buttons" class="fp_button_row">
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_primary_button" type="submit" id="b_form1_refresh" name="b_form1_refresh" value="Refresh" onclick="jslib_b_pressed_g='refresh';">
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_add" name="b_form1_dt_add" value="Add" >
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="button" id="b_form1_dt_edit" name="b_form1_dt_edit" value="Edit" >
|
||||
|
||||
<input class="fp_button ui-button ui-widget ui-state-default fp_dt_button" type="submit" id="b_form1_dt_remove" name="b_form1_dt_remove" value="Remove" onclick="jslib_b_pressed_g='dt_remove';">
|
||||
</div> <!-- fp_button_row -->
|
||||
|
||||
</form> <!-- form1 -->
|
||||
|
||||
</div><!-- fp_page_container -->
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
var jslib_msgs = parent.jslib_msgs_tbl;
|
||||
-->
|
||||
</script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/js/web-utils-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/plugins/jquery-plugins-combo.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/static/bt1707389424/jquery/datatables_1_9_4/jquery.dataTables-plugins.js"></script>
|
||||
<script type="text/javascript" src="/htdocs/lang/en_us/culture/globalize.culture.en-US.20120606.js"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
||||
var aDataSet = [
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_1" value="1" disabled="disabled"><label></label>', '1', 'default', 'Default']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_10" value="10" disabled="disabled"><label></label>', '10', 'VLAN0010', 'Static']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_20" value="20"><label></label>', '20', 'VLAN0020', 'Static']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_30" value="30"><label></label>', '30', 'VLAN0030', 'Static']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_40" value="40"><label></label>', '40', 'VLAN0040', 'Static']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_50" value="50"><label></label>', '50', 'VLAN0050', 'Static']
|
||||
,
|
||||
['<input type="checkbox" class="chkrow" name="chkrow[]" id="chkrow_60" value="60"><label></label>', '60', 'VLAN0060', 'Static']
|
||||
];
|
||||
|
||||
var aColumns = [
|
||||
{ "sTitle": '<input type="checkbox" class="chkall" name="chkall" id="chkall" value="chkall"><label></label>', "bSearchable": false, "bSortable": false, "sWidth": "2%" },
|
||||
{ "sTitle": "VLAN ID", "sType": "natural-sort" },
|
||||
{ "sTitle": "Name", "sType": "html" },
|
||||
{ "sTitle": "Type", "sType": "html" }
|
||||
];
|
||||
|
||||
// Edit button query string callback function
|
||||
// This function name is specified as the 'fn' parameter on 'modal_button_attrib' for the 'edit' button
|
||||
function fnEdit()
|
||||
{
|
||||
var selected = fp_dt_get_selected($("#sorttable1"));
|
||||
var qString = '';
|
||||
|
||||
if (selected.length == 1)
|
||||
{
|
||||
qString = '?vlan=' + selected[0].cells[0].firstChild.value;
|
||||
}
|
||||
return qString;
|
||||
}
|
||||
|
||||
var vlan_count = 7;
|
||||
var vlan_max = 64;
|
||||
|
||||
// Add button query string callback function
|
||||
// This function name is specified as the 'fn' parameter on 'modal_button_attrib' for the 'add' button
|
||||
function fnAdd()
|
||||
{
|
||||
var qString = '';
|
||||
qString = '?vlancount=' + vlan_count;
|
||||
return qString;
|
||||
}
|
||||
|
||||
$(document).ready( function ()
|
||||
{
|
||||
// Define datatable
|
||||
$('#dynamic_dt1').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="sorttable1"><\/table>' );
|
||||
fp_dt_create("#sorttable1", { aaData: aDataSet, aoColumns: aColumns, dt_btn: true, multi_select: true, rw: true });
|
||||
|
||||
if (vlan_count >= vlan_max)
|
||||
{
|
||||
$("#b_form1_dt_add").button("disable");
|
||||
}
|
||||
|
||||
//Disable add button when we press the data table buttons when it reached to max vlans
|
||||
$("#sorttable1_paginate,#sorttable1_length,#sorttable1_filter").click(function() {
|
||||
if (vlan_count >= vlan_max)
|
||||
{
|
||||
$("#b_form1_dt_add").button("disable");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
$(document).ready( function()
|
||||
{
|
||||
var page_is_valid = true;
|
||||
|
||||
// format all culture-specific elements using the current locale
|
||||
culture_format(parent.culture);
|
||||
|
||||
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
var isIe = false;
|
||||
if (myNav.indexOf('msie') != -1)
|
||||
{
|
||||
var myVer = parseInt(myNav.split('msie')[1]);
|
||||
}
|
||||
|
||||
if ((isIe == true) && (myVer < 8)) {
|
||||
$('input[type=radio],[type=checkbox]').live('click', function () {
|
||||
this.blur();
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
$(':input').bind('keypress', function(e) {
|
||||
var key = (window.event) ? window.event.keyCode : e.which; // IE vs. FF
|
||||
var $this = $(this);
|
||||
if ( ($this.is(':not(:button, :submit, :reset, textarea)')) ) {
|
||||
return (key != 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(".fp_button").button();
|
||||
$(".fp_button_cancel").button();
|
||||
|
||||
$('form input[type="reset"]').click(function(e) {
|
||||
if( $('#sorttable1').length ){
|
||||
fp_dt_reset_handler("#sorttable1");
|
||||
}
|
||||
return jslib_form_reset(this.form);
|
||||
});
|
||||
|
||||
$(":submit,:button").click(function(e) {
|
||||
// remember which button was clicked last by storing into hidden field
|
||||
var button = $(this).attr("id");
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
if (form_id)
|
||||
{
|
||||
$("#b_"+form_id+"_clicked").val(button);
|
||||
}
|
||||
page_is_valid = jslib_form_validate(document.forms[0]);
|
||||
|
||||
return page_is_valid;
|
||||
});
|
||||
|
||||
// add a hidden field to each form to record which submit button
|
||||
// was clicked so that it gets presented in the POST data
|
||||
$("form").each(function() {
|
||||
var $this = $(this);
|
||||
var bid = "b_" + $this.attr("id") + "_clicked";
|
||||
var b_clicked = '<input type="hidden" id="' + bid + '" name="' + bid + '">';
|
||||
$(b_clicked).appendTo($this);
|
||||
});
|
||||
// Bind to the click event for all the matching 'b_form1_dt_add' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_add"]').click( function() {
|
||||
var qStr = fnAdd();
|
||||
main_modal_page_open('/htdocs/pages/switching/vlan_status_modal.lsp' + qStr, 'Add VLAN', '580', '290', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
// Bind to the click event for all the matching 'b_form1_dt_edit' buttons to open a page as a modal dialog
|
||||
$('[id*="b_form1_dt_edit"]').click( function() {
|
||||
var qStr = fnEdit();
|
||||
main_modal_page_open('/htdocs/pages/switching/vlan_status_edit_modal.lsp' + qStr, 'Edit VLAN Configuration', '520', '240', { btnPost : "Apply", btnClose : "Cancel" } );
|
||||
});
|
||||
|
||||
// Bind to the submit event for 'b_form1_dt_remove' to open a modal confirm dialog
|
||||
$('#form1').submit( function(e) {
|
||||
var pattern = /dt_remove/gi;
|
||||
if (jslib_b_pressed_g.match(pattern)) {
|
||||
e.preventDefault();
|
||||
main_confirm_dialog_open('dt_remove', 'Are you sure you want to remove the selected row(s)?'); }
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
if(this.resizeTO) clearTimeout(this.resizeTO);
|
||||
this.resizeTO = setTimeout(function() {
|
||||
$(this).trigger('resizeEnd');
|
||||
}, 500);
|
||||
});
|
||||
$(window).bind('resizeEnd', function() {
|
||||
iframe_auto_resize();
|
||||
});
|
||||
iframe_auto_resize();
|
||||
$('form input[type="submit"]').click(function(e) {
|
||||
var form_id = $(e.target).closest("form").attr("id");
|
||||
var f_s = "b_"+form_id+"_submit";
|
||||
var f_r = "b_"+form_id+"_refresh";
|
||||
var f_click = $("#b_"+form_id+"_clicked").val();
|
||||
if (((f_click == f_s) || (f_click == f_r)) && page_is_valid)
|
||||
{
|
||||
parent.progress_modal_open();
|
||||
}
|
||||
});
|
||||
parent.progress_modal_handler(parent.ple.PAGE_LOADED);
|
||||
|
||||
focus_init("focus_top");
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
"""Unit tests for the OfficeConnect HTTP client — no real device required."""
|
||||
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from napalm.base.exceptions import ConnectionClosedException, ConnectionException
|
||||
|
||||
from napalm_hpe_officeconnect.client import OfficeConnectClient
|
||||
|
||||
|
||||
def make_response(status_code=200, text="", json_data=None):
|
||||
resp = MagicMock()
|
||||
resp.status_code = status_code
|
||||
resp.text = text
|
||||
if json_data is None:
|
||||
resp.json.side_effect = ValueError("no json")
|
||||
else:
|
||||
resp.json.return_value = json_data
|
||||
return resp
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
with patch("napalm_hpe_officeconnect.client.requests.Session") as session_cls:
|
||||
c = OfficeConnectClient("192.0.2.20", "admin", "secret")
|
||||
c._session = session_cls.return_value
|
||||
yield c
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# base_url
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_base_url_defaults_to_http():
|
||||
"""These switches ship without a certificate, so HTTP is the default."""
|
||||
c = OfficeConnectClient("192.0.2.20", "admin", "secret")
|
||||
assert c.base_url == "http://192.0.2.20"
|
||||
|
||||
|
||||
def test_base_url_honours_https_opt_in():
|
||||
c = OfficeConnectClient("192.0.2.20", "admin", "secret", scheme="https")
|
||||
assert c.base_url == "https://192.0.2.20"
|
||||
|
||||
|
||||
def test_base_url_includes_non_default_port():
|
||||
c = OfficeConnectClient("192.0.2.20", "admin", "secret", port=8080)
|
||||
assert c.base_url == "http://192.0.2.20:8080"
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# login
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_login_posts_credentials_and_succeeds(client):
|
||||
client._session.get.return_value = make_response(text="login page")
|
||||
client._session.post.return_value = make_response(
|
||||
json_data={"redirect": "/htdocs/pages/main/main.lsp", "error": ""}
|
||||
)
|
||||
|
||||
client.login()
|
||||
|
||||
# The RID cookie is handed out by the login page, so it must be fetched first.
|
||||
client._session.get.assert_called_once()
|
||||
assert client._session.get.call_args[0][0].endswith("/htdocs/login/login.lsp")
|
||||
|
||||
(url,) = client._session.post.call_args[0]
|
||||
assert url.endswith("/htdocs/login/login.lua")
|
||||
assert client._session.post.call_args[1]["data"] == {
|
||||
"username": "admin",
|
||||
"password": "secret",
|
||||
}
|
||||
assert client.is_authenticated is True
|
||||
|
||||
|
||||
def test_login_raises_with_device_message_on_bad_credentials(client):
|
||||
client._session.get.return_value = make_response(text="login page")
|
||||
client._session.post.return_value = make_response(
|
||||
json_data={"redirect": "", "error": "Invalid username or password"}
|
||||
)
|
||||
|
||||
with pytest.raises(ConnectionException, match="Invalid username or password"):
|
||||
client.login()
|
||||
assert client.is_authenticated is False
|
||||
|
||||
|
||||
def test_login_raises_when_response_is_not_json(client):
|
||||
"""A firmware that redirects instead of answering must not look like success."""
|
||||
client._session.get.return_value = make_response(text="login page")
|
||||
client._session.post.return_value = make_response(status_code=303, text="")
|
||||
|
||||
with pytest.raises(ConnectionException):
|
||||
client.login()
|
||||
assert client.is_authenticated is False
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# fetch
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_fetch_returns_page_text(client):
|
||||
client._authenticated = True
|
||||
client._session.get.return_value = make_response(text="<html>data</html>")
|
||||
|
||||
assert client.fetch("/htdocs/pages/base/dashboard.lsp") == "<html>data</html>"
|
||||
|
||||
|
||||
def test_fetch_raises_when_session_expired(client):
|
||||
"""An expired session answers 303 to the login page rather than 401."""
|
||||
client._authenticated = True
|
||||
client._session.get.return_value = make_response(status_code=303, text="")
|
||||
|
||||
with pytest.raises(ConnectionClosedException):
|
||||
client.fetch("/htdocs/pages/base/dashboard.lsp")
|
||||
|
||||
|
||||
def test_fetch_requires_login_first(client):
|
||||
with pytest.raises(ConnectionException):
|
||||
client.fetch("/htdocs/pages/base/dashboard.lsp")
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# logout — must be reliable, the session table is small
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_logout_releases_the_session(client):
|
||||
client._authenticated = True
|
||||
client._session.get.return_value = make_response(status_code=303)
|
||||
|
||||
client.logout()
|
||||
|
||||
assert client._session.get.call_args[0][0].endswith("/htdocs/pages/main/logout.lsp")
|
||||
assert client.is_authenticated is False
|
||||
|
||||
|
||||
def test_logout_swallows_errors(client):
|
||||
"""close() runs logout on the failure path too; it must never mask the
|
||||
original exception, and an unreachable switch is not a new problem."""
|
||||
client._authenticated = True
|
||||
client._session.get.side_effect = OSError("network gone")
|
||||
|
||||
client.logout() # must not raise
|
||||
|
||||
assert client.is_authenticated is False
|
||||
|
||||
|
||||
def test_logout_is_a_noop_when_not_logged_in(client):
|
||||
client.logout()
|
||||
client._session.get.assert_not_called()
|
||||
@@ -0,0 +1,196 @@
|
||||
"""Unit tests for OfficeConnectDriver — fixture-driven, no real device."""
|
||||
|
||||
import pathlib
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from napalm_hpe_officeconnect.officeconnect import OfficeConnectDriver
|
||||
|
||||
FIXTURES = pathlib.Path(__file__).parent.parent / "fixtures"
|
||||
|
||||
PAGE_FOR_PATH = {
|
||||
OfficeConnectDriver.DASHBOARD: "base_dashboard",
|
||||
OfficeConnectDriver.PORT_SUMMARY: "base_port_summary",
|
||||
OfficeConnectDriver.MAC_TABLE: "base_mac_address_table",
|
||||
OfficeConnectDriver.VLAN_STATUS: "switching_vlan_status",
|
||||
}
|
||||
|
||||
|
||||
def fake_fetch(path: str) -> str:
|
||||
"""Serve a captured page for the requested path."""
|
||||
if path.startswith("/htdocs/pages/switching/vlan_per_port.lsp"):
|
||||
vlan = path.rsplit("=", 1)[-1]
|
||||
name = f"switching_vlan_per_port_{vlan if vlan == '10' else '1'}"
|
||||
else:
|
||||
name = PAGE_FOR_PATH[path]
|
||||
return (FIXTURES / f"{name}.html").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def driver():
|
||||
with patch("napalm_hpe_officeconnect.officeconnect.OfficeConnectClient") as client_cls:
|
||||
client = client_cls.return_value
|
||||
client.fetch.side_effect = fake_fetch
|
||||
client.is_authenticated = True
|
||||
d = OfficeConnectDriver("192.0.2.20", "admin", "secret")
|
||||
d._client = client
|
||||
yield d
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# Fingerprinting contract — consumed by netOrk discovery without a connection
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_driver_identity():
|
||||
assert OfficeConnectDriver.DRIVER_NAME == "hpe_officeconnect"
|
||||
assert OfficeConnectDriver.VENDOR == "HPE"
|
||||
|
||||
|
||||
def test_snmp_object_id_is_specific_enough_to_not_collide_with_procurve():
|
||||
"""The ProCurve driver claims 1.3.6.1.4.1.11 — the bare HPE arc. This
|
||||
driver must claim the longer OfficeConnect arc or the two compete."""
|
||||
assert OfficeConnectDriver.SNMP_OBJECT_ID_PREFIX == "1.3.6.1.4.1.11.2.3.7.11"
|
||||
assert "1.3.6.1.4.1.11.2.3.7.11.170".startswith(OfficeConnectDriver.SNMP_OBJECT_ID_PREFIX)
|
||||
|
||||
|
||||
def test_http_fingerprint_requires_officeconnect():
|
||||
mandatory = [r for r in OfficeConnectDriver.HTTP_FINGERPRINT if r.mandatory]
|
||||
assert [r.pattern for r in mandatory] == ["officeconnect"]
|
||||
|
||||
|
||||
def test_snmp_fingerprint_matches_real_sysdescr():
|
||||
"""sysDescr as returned by a J9982A over SNMPv2c."""
|
||||
sys_descr = (
|
||||
"hpe officeconnect switch 1820 8g poe+ (65w) j9982a, pt.02.19, "
|
||||
"linux 3.6.5-58b5074c, u-boot 2012.10-00116-g3ab515c (jul 30 2014 - 10:52:01)"
|
||||
)
|
||||
matched = [r.pattern for r in OfficeConnectDriver.SNMP_FINGERPRINT if r.pattern in sys_descr]
|
||||
assert "officeconnect" in matched
|
||||
assert "1820" in matched
|
||||
|
||||
|
||||
def test_snmp_fingerprint_has_no_mandatory_rule():
|
||||
"""HTTP already carries the hard requirement. A mandatory SNMP rule would
|
||||
disqualify the driver for any device answering SNMP but not HTTP."""
|
||||
assert not any(r.mandatory for r in OfficeConnectDriver.SNMP_FINGERPRINT)
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# Connection lifecycle
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_open_logs_in(driver):
|
||||
driver.open()
|
||||
driver._client.login.assert_called_once()
|
||||
|
||||
|
||||
def test_close_logs_out(driver):
|
||||
driver.close()
|
||||
driver._client.logout.assert_called_once()
|
||||
|
||||
|
||||
def test_is_alive_reflects_session_state(driver):
|
||||
assert driver.is_alive() == {"is_alive": True}
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# get_facts
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_get_facts(driver):
|
||||
facts = driver.get_facts()
|
||||
assert facts["vendor"] == "HPE"
|
||||
assert facts["hostname"] == "testswitch"
|
||||
assert facts["serial_number"] == "CN0FIXTURE0"
|
||||
assert facts["os_version"] == "PT.02.19"
|
||||
assert facts["model"] == "HPE OfficeConnect Switch 1820 8G PoE+ (65W) J9982A"
|
||||
assert facts["uptime"] == 67480
|
||||
assert facts["interface_list"][:3] == ["1", "2", "3"]
|
||||
assert "TRK1" in facts["interface_list"]
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# get_interfaces
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_get_interfaces_returns_ports_and_trunks(driver):
|
||||
interfaces = driver.get_interfaces()
|
||||
assert len(interfaces) == 12
|
||||
assert set(interfaces) >= {"1", "8", "TRK1", "TRK4"}
|
||||
|
||||
|
||||
def test_get_interfaces_link_state(driver):
|
||||
interfaces = driver.get_interfaces()
|
||||
assert interfaces["3"]["is_up"] is True
|
||||
assert interfaces["1"]["is_up"] is False
|
||||
# Admin state is independent of link state on this platform.
|
||||
assert interfaces["1"]["is_enabled"] is True
|
||||
|
||||
|
||||
def test_get_interfaces_speed_is_mbit(driver):
|
||||
interfaces = driver.get_interfaces()
|
||||
assert interfaces["3"]["speed"] == 1000.0
|
||||
assert interfaces["6"]["speed"] == 100.0 # "100 Mbps Full Duplex"
|
||||
assert interfaces["1"]["speed"] == 0.0 # link down — no speed reported
|
||||
|
||||
|
||||
def test_get_interfaces_mtu(driver):
|
||||
assert driver.get_interfaces()["1"]["mtu"] == 1518
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# get_vlans
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_get_vlans_lists_every_vlan(driver):
|
||||
vlans = driver.get_vlans()
|
||||
assert set(vlans) == {"1", "10", "20", "30", "40", "50", "60"}
|
||||
assert vlans["1"]["name"] == "default"
|
||||
assert vlans["10"]["name"] == "VLAN0010"
|
||||
|
||||
|
||||
def test_get_vlans_membership_excludes_non_members(driver):
|
||||
"""Participation is Untagged / Tagged / Excluded — only the first two
|
||||
make an interface a member."""
|
||||
vlans = driver.get_vlans()
|
||||
assert vlans["10"]["interfaces"] == ["2", "3", "4", "8"]
|
||||
|
||||
|
||||
def test_get_vlans_detail_splits_tagged_and_untagged(driver):
|
||||
detail = driver.get_vlans_detail()
|
||||
assert detail["1"]["untagged"] == ["1", "5", "7", "TRK1", "TRK2", "TRK3", "TRK4"]
|
||||
assert detail["1"]["tagged"] == ["8"]
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# get_mac_address_table
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_get_mac_address_table(driver):
|
||||
table = driver.get_mac_address_table()
|
||||
assert len(table) == 17
|
||||
first = table[0]
|
||||
assert first["mac"] == "00:11:22:33:44:01"
|
||||
assert first["interface"] == "7"
|
||||
assert first["vlan"] == 1
|
||||
assert first["static"] is False
|
||||
assert first["active"] is True
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# Deliberate gaps — documented, not silently faked
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_get_interfaces_counters_is_not_implemented(driver):
|
||||
"""port_summary_stats.lsp ships an empty dataset on PT.02.19; returning
|
||||
zeros would look like real counters. See README."""
|
||||
with pytest.raises(NotImplementedError):
|
||||
driver.get_interfaces_counters()
|
||||
@@ -0,0 +1,134 @@
|
||||
"""Unit tests for the OfficeConnect HTML/JS parsers.
|
||||
|
||||
Fixtures are real pages captured from an HPE OfficeConnect 1820 8G PoE+
|
||||
(J9982A, firmware PT.02.19), scrubbed of serial number, MAC addresses,
|
||||
IP addresses and hostname.
|
||||
"""
|
||||
|
||||
import pathlib
|
||||
|
||||
import pytest
|
||||
|
||||
from napalm_hpe_officeconnect import parsers
|
||||
|
||||
FIXTURES = pathlib.Path(__file__).parent.parent / "fixtures"
|
||||
|
||||
|
||||
def fixture(name: str) -> str:
|
||||
return (FIXTURES / f"{name}.html").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# extract_data_set — the DataTables payload every list page ships
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_extract_data_set_returns_one_row_per_port():
|
||||
"""port_summary carries 8 physical ports plus 4 trunk interfaces."""
|
||||
rows = parsers.extract_data_set(fixture("base_port_summary"))
|
||||
assert len(rows) == 12
|
||||
assert all(isinstance(r, list) for r in rows)
|
||||
|
||||
|
||||
def test_extract_data_set_preserves_cell_values():
|
||||
rows = parsers.extract_data_set(fixture("base_port_summary"))
|
||||
# Columns: [checkbox, interface, description, admin, phy type, status, ...]
|
||||
assert rows[0][1] == "1"
|
||||
assert rows[0][3] == "Enabled"
|
||||
assert rows[2][5] == "Link Up"
|
||||
assert rows[2][7] == "1000 Mbps"
|
||||
|
||||
|
||||
def test_extract_data_set_handles_rows_without_markup():
|
||||
"""mac_address_table rows are plain values, no embedded checkbox cell."""
|
||||
rows = parsers.extract_data_set(fixture("base_mac_address_table"))
|
||||
assert len(rows) == 17
|
||||
assert rows[0] == ["1", "00:11:22:33:44:01", "7", "7", "Learned"]
|
||||
|
||||
|
||||
def test_extract_data_set_handles_empty_cells():
|
||||
"""Counter columns are empty strings on a port that never linked up."""
|
||||
rows = parsers.extract_data_set(fixture("base_port_summary_stats"))
|
||||
assert rows[0] == ["1", "", "", "", "", "", "", "", ""]
|
||||
|
||||
|
||||
def test_extract_data_set_returns_empty_list_when_absent():
|
||||
assert parsers.extract_data_set("<html><body>nothing here</body></html>") == []
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# extract_column_titles — used to assert the firmware layout hasn't shifted
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_extract_column_titles():
|
||||
titles = parsers.extract_column_titles(fixture("switching_vlan_status"))
|
||||
assert titles == ["VLAN ID", "Name", "Type"]
|
||||
|
||||
|
||||
def test_extract_column_titles_skips_markup_only_header():
|
||||
"""The leading checkbox column has an <input> as its title, not text."""
|
||||
titles = parsers.extract_column_titles(fixture("base_mac_address_table"))
|
||||
assert titles == ["VLAN ID", "MAC Address", "Interface", "Interface Index", "Status"]
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# strip_markup — the checkbox cell must collapse to an empty string
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"raw,expected",
|
||||
[
|
||||
('<input type="checkbox" value="1"><label></label>', ""),
|
||||
("plain value", "plain value"),
|
||||
(" spaced&out ", "spaced&out"),
|
||||
("", ""),
|
||||
],
|
||||
)
|
||||
def test_strip_markup(raw, expected):
|
||||
assert parsers.strip_markup(raw) == expected
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# parse_uptime
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"raw,expected",
|
||||
[
|
||||
("0 days, 18 hours, 44 mins, 40 secs", 67480),
|
||||
("3 days, 0 hours, 0 mins, 0 secs", 259200),
|
||||
("0 days, 0 hours, 0 mins, 1 secs", 1),
|
||||
],
|
||||
)
|
||||
def test_parse_uptime(raw, expected):
|
||||
assert parsers.parse_uptime(raw) == expected
|
||||
|
||||
|
||||
def test_parse_uptime_returns_negative_one_when_unparseable():
|
||||
"""NAPALM's convention for 'uptime unknown' is -1, not 0."""
|
||||
assert parsers.parse_uptime("nonsense") == -1
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# parse_facts — dashboard.lsp
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def test_parse_facts():
|
||||
facts = parsers.parse_facts(fixture("base_dashboard"))
|
||||
assert facts["hostname"] == "testswitch"
|
||||
assert facts["serial_number"] == "CN0FIXTURE0"
|
||||
assert facts["os_version"] == "PT.02.19"
|
||||
assert facts["model"] == "HPE OfficeConnect Switch 1820 8G PoE+ (65W) J9982A"
|
||||
assert facts["uptime"] == 67480
|
||||
assert facts["sys_object_id"] == "1.3.6.1.4.1.11.2.3.7.11.170"
|
||||
|
||||
|
||||
def test_parse_facts_tolerates_missing_fields():
|
||||
facts = parsers.parse_facts("<html><body></body></html>")
|
||||
assert facts["hostname"] == ""
|
||||
assert facts["serial_number"] == ""
|
||||
assert facts["uptime"] == -1
|
||||
Reference in New Issue
Block a user