5 <meta charset="UTF-8" />
6 <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 <% include ../partials/head %>
8 <% include ../partials/header %>
9 <script type="text/javascript" src="/javascripts/admportal.js" async></script>
10 <title>SDNC-MLC AdminPortal</title>
14 $(document).ready(function() {
15 $('#linkLatencyMaster').DataTable( {
16 "order": [[ 0, "asc" ]]
24 <div class="well well-sm">
25 <h3>Link Latency Master</h3>
28 <% if ( typeof result != 'undefined' ) {
29 if (result.code.length > 0) {
30 if ( result.code == 'success' ) { %>
31 <div class='alert alert-success' role='alert'>
33 for ( x in result.msg ){ %>
34 <div><%= result.msg[x] %></div>
38 <div class='alert alert-danger' role='danger'>
40 for ( x in result.msg ){ %>
41 <div><%= result.msg[x] %></div>
48 <% if( typeof privilege != 'undefined'){
49 var priv = privilege.privilege;
55 <div class="container-fluid">
57 <% if(priv == 'A'){ %>
58 <div class="actions" style="padding:15px 0px;">
59 <button class="btn btn-primary btn-md" data-toggle="modal" data-target="#add_link_latency_master">Add Link Latency</button>
63 <table id="linkLatencyMaster" class="table table-hover table-condensed">
66 <th>*Src CRS Name</th>
67 <th>*Dest CRS Name</th>
70 <th>*Intra Inter SNRC</th>
71 <th>*Final Latency</th>
73 <% if(priv == 'A'){ %>
79 <% rows.forEach( function(row) { %>
81 <td><%= row.source_crs_name %></td>
82 <td><%= row.destination_crs_name %></td>
83 <td><%= row.bundle_name %></td>
84 <td><%= row.latency %></td>
85 <td><%= row.intra_inter_snrc %></td>
86 <td><%= row.final_latency %></td>
87 <td><%= row.augmentable %></td>
88 <% if(priv == 'A') { %>
90 <button type="button" class="btn btn-default btn-xs" onclick="updateLinkLatencyMaster('<%= row.source_crs_name %>', '<%= row.destination_crs_name %>', '<%= row.bundle_name %>', '<%= row.latency %>', '<%= row.intra_inter_snrc %>', '<%= row.final_latency %>', '<%= row.augmentable %>');">Update</button>
91 <button type="button" class="btn btn-default btn-xs" onclick="deleteLinkLatencyMaster('<%= row.source_crs_name %>','<%= row.destination_crs_name %>','<%= row.bundle_name %>');">Delete</button>
99 <% if(priv == 'A'){ %>
100 <div class="actions" style="padding:0px 25px;">
101 <form method="POST" action="/tunnel/uploadLinkLatencyMaster" enctype="multipart/form-data">
102 <div class="form-group">
103 <label for="dest">File input</label>
104 <input name="filename" type="file" id="dest">
105 <p class="help-block">Choose a file to upload.</p>
107 <button type="button" class="btn btn-default" onclick="uploadFile(this.form);">Upload File</button>
114 <% include ../partials/link_latency_master %>
116 <% include ../partials/footer %>
119 <script type="text/javascript">
120 function submitLinkLatencyMaster(form)
123 var source_crs_name = '';
124 var destination_crs_name = '';
125 var bundle_name = '';
127 var intra_inter_snrc = '';
128 var final_latency = '';
129 var augmentable = '';
131 if ( form.name == 'addForm' )
133 source_crs_name = form.nf_source_crs_name;
134 destination_crs_name = form.nf_destination_crs_name;
135 bundle_name = form.nf_bundle_name;
136 latency = form.nf_latency;
137 intra_inter_snrc = form.nf_intra_inter_snrc;
138 final_latency = form.nf_final_latency;
139 augmentable = form.nf_augmentable;
143 source_crs_name = form.uf_source_crs_name;
144 destination_crs_name = form.uf_destination_crs_name;
145 bundle_name = form.uf_bundle_name;
146 latency = form.uf_latency;
147 intra_inter_snrc = form.uf_intra_inter_snrc;
148 final_latency = form.uf_final_latency;
149 augmentable = form.uf_augmentable;
152 if ( (source_crs_name.value == null) || (source_crs_name.value == "") || isblank(source_crs_name.value) )
154 errorMsg += 'Source CRS Name is required.<br>';
156 if ( (destination_crs_name.value == null) || (destination_crs_name.value == "") || isblank(destination_crs_name.value) )
158 errorMsg += 'Destination CRS Name is required.<br>';
160 if ( (bundle_name.value == null) || (bundle_name.value == "") || isblank(bundle_name.value) )
162 errorMsg += 'Bundle Name is required.<br>';
164 if ( (latency.value == null) || (latency.value == "") || isblank(latency.value) )
166 errorMsg += 'Latency is required.<br>';
168 if ( (intra_inter_snrc.value == null) || (intra_inter_snrc.value == "") || isblank(intra_inter_snrc.value) )
170 errorMsg += 'Intra Inter SNRC is required.<br>';
172 if ( (final_latency.value == null) || (final_latency.value == "") || isblank(final_latency.value) )
174 errorMsg += 'Final Latency is required.<br>';
176 if ( (augmentable.value == null) || (augmentable.value == "") || isblank(augmentable.value) )
178 errorMsg += 'Augmentable is required.<br>';
180 if( errorMsg.length > 0 ) {
181 bootbox.alert(errorMsg);
185 if (augmentable.value != 'Y' && augmentable.value != 'N'){
186 bootbox.alert('Augmentable must be Y or N');
193 function updateLinkLatencyMaster(source_crs_name,destination_crs_name,bundle_name,latency,intra_inter_snrc,final_latency,augmentable) {
195 document.getElementById('uf_source_crs_name').value=source_crs_name;
196 document.getElementById('uf_destination_crs_name').value=destination_crs_name;
197 document.getElementById('uf_bundle_name').value=bundle_name;
198 document.getElementById('uf_latency').value=latency;
199 document.getElementById('uf_intra_inter_snrc').value=intra_inter_snrc;
200 document.getElementById('uf_final_latency').value=final_latency;
201 document.getElementById('uf_augmentable').value=augmentable;
203 document.getElementById('uf_key_source_crs_name').value=source_crs_name;
204 document.getElementById('uf_key_destination_crs_name').value=destination_crs_name;
205 document.getElementById('uf_key_bundle_name').value=bundle_name;
207 $('#update_link_latency_master').modal('show');
210 function deleteLinkLatencyMaster(source_crs_name,destination_crs_name,bundle_name) {
212 var url_string = encodeURI("/tunnel/deleteLinkLatencyMaster?source_crs_name=" + source_crs_name
213 + "&destination_crs_name=" + destination_crs_name
214 + "&bundle_name=" + bundle_name);
217 message: "Are you sure you want to delete this Link Latency entry? [" + source_crs_name + ":" + destination_crs_name + ":" + bundle_name + "]",
218 callback: function(result) {
221 location.assign(url_string);