4 <meta charset="UTF-8" />
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <% include ../partials/head %>
7 <% include ../partials/header %>
8 <script type="text/javascript" src="/javascripts/admportal.js" async></script>
9 <title>SDN-C AdminPortal</title>
11 $(document).ready(function() {
12 $('#max_port_speed').DataTable( {
13 "order": [[ 0, "asc" ]]
21 <div class="well well-sm">
22 <h3>Max Port Speed</h3>
25 <% if ( typeof result != 'undefined' ) {
26 if (result.code.length > 0) {
27 if ( result.code == 'success' ) { %>
28 <div class='alert alert-success' role='alert'>
30 for ( x in result.msg ){ %>
31 <div><%= result.msg[x] %></div>
35 <div class='alert alert-danger' role='danger'>
37 for ( x in result.msg ){ %>
38 <div><%= result.msg[x] %></div>
45 <% if( typeof privilege != 'undefined'){
46 var priv = privilege.privilege;
52 <div class="container-fluid">
54 <% if (priv == 'A'){ %>
55 <div class="actions" style="padding:15px 0px;">
56 <button class="btn btn-primary" data-toggle="modal" data-target="#add_max_port_speed">
62 <table id="max_port_speed" class="table table-hover table-condensed">
66 <th>*Image File Name</th>
67 <th>*End Point Position</th>
68 <th>*Interface Name</th>
71 <% if(priv == 'A'){ %>
77 <% rows.forEach( function(row) { %>
79 <td><%= row.max_port_speed_id %></td>
80 <td><%= row.image_file_name %></td>
81 <td><%= row.end_point_position %></td>
82 <td><%= row.interface_name %></td>
83 <td><%= row.max_speed %></td>
84 <td><%= row.unit %></td>
85 <% if(priv == 'A') { %>
87 <button type="button" class="btn btn-default btn-xs"
88 onclick="updateMaxPortSpeed('<%=row.max_port_speed_id %>','<%= row.image_file_name %>','<%= row.end_point_position %>','<%= row.interface_name %>','<%= row.max_speed %>','<%= row.unit %>');">Update</button>
89 <button type="button" class="btn btn-default btn-xs"
90 onclick="deleteMaxPortSpeed('<%= row.max_port_speed_id %>');">Delete</button>
101 <% include ../partials/max_port_speed %>
103 <% include ../partials/footer %>
106 <script type="text/javascript">
107 function submitMaxPortSpeed(form)
110 var image_file_name = '';
111 var end_point_position = '';
112 var interface_name = '';
116 if ( form.name == 'addForm' )
118 image_file_name = form.nf_image_file_name;
119 end_point_position = form.nf_end_point_position;
120 interface_name = form.nf_interface_name;
121 max_speed = form.nf_max_speed;
126 image_file_name = form.uf_image_file_name;
127 end_point_position = form.uf_end_point_position;
128 interface_name = form.uf_interface_name;
129 max_speed = form.uf_max_speed;
134 if ( (image_file_name.value == null) || (image_file_name.value == "") || isblank(image_file_name.value) )
136 errorMsg += 'Image File Name is required.<br>';
138 if ( (end_point_position.value == null) || (end_point_position.value == "") || isblank(end_point_position.value) )
140 errorMsg += 'End Point Position is required.<br>';
142 if ( (interface_name.value == null) || (interface_name.value == "") || isblank(interface_name.value) ){
143 errorMsg += 'Interface Name is required.<br>';
145 if ( (max_speed.value == null) || (max_speed.value == "") || isblank(max_speed.value) ){
146 errorMsg += 'Max Speed is required.<br>';
148 if ( (unit.value == null) || (unit.value == "") || isblank(unit.value) ){
149 errorMsg += 'Unit is required.<br>';
151 if( errorMsg.length > 0 ) {
152 bootbox.alert(errorMsg);
156 if ( !isDigit(max_speed.value) )
158 bootbox.alert('Max Speed must be a number.');
165 function updateMaxPortSpeed(max_port_speed_id,image_file_name,end_point_position,interface_name,max_speed,unit) {
167 document.getElementById('uf_max_port_speed_id').value=max_port_speed_id;
168 document.getElementById('uf_image_file_name').value=image_file_name;
169 document.getElementById('uf_end_point_position').value=end_point_position;
170 document.getElementById('uf_interface_name').value=interface_name;
171 document.getElementById('uf_max_speed').value=max_speed;
172 document.getElementById('uf_unit').value=unit;
174 document.getElementById('uf_key_max_port_speed_id').value=max_port_speed_id;
176 $('#update_max_port_speed').modal('show');
179 function deleteMaxPortSpeed(max_port_speed_id) {
182 message: "Are you sure you want to delete MAX_PORT_SPEED [" + max_port_speed_id + "]",
183 callback: function(result) {
186 location.assign("/resalloc/deleteMaxPortSpeed?max_port_speed_id=" + max_port_speed_id);