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>
12 $(document).ready(function() {
13 $('#network_profile').DataTable( {
14 "order": [[ 0, "asc" ]]
22 <div class="well well-sm">
23 <h3>Network Profile</h3>
26 <% if ( typeof result != 'undefined' ) {
27 if (result.code.length > 0) {
28 if ( result.code == 'success' ) { %>
29 <div class='alert alert-success' role='alert'>
31 for ( x in result.msg ){ %>
32 <div><%= result.msg[x] %></div>
36 <div class='alert alert-danger' role='danger'>
38 for ( x in result.msg ){ %>
39 <div><%= result.msg[x] %></div>
46 <% if( typeof privilege != 'undefined'){
47 var priv = privilege.privilege;
53 <div class="container-fluid">
55 <% if(priv == 'A'){ %>
56 <div class="actions" style="padding:15px 0px;">
57 <button class="btn btn-primary btn-md" data-toggle="modal" data-target="#add_network_profile">
63 <table id="network_profile" class="table table-hover table-condensed">
66 <th>*Network Type</th>
68 <% if(priv == 'A'){ %>
74 <% rows.forEach( function(row) { %>
76 <td><%= row.network_type %></td>
77 <td><%= row.technology %></td>
78 <% if(priv == 'A') { %>
80 <% if (priv == 'A') { %>
81 <button type="button" class="btn btn-default btn-xs" onclick="updateNetworkProfile('<%= row.network_type %>', '<%= row.technology %>');">Update</button>
82 <button type="button" class="btn btn-default btn-xs" onclick="deleteNetworkProfile('<%= row.network_type %>');">Delete</button>
93 <% include ../partials/network_profile %>
95 <% include ../partials/footer %>
98 <script type="text/javascript">
99 function saveNetworkProfile(form)
102 var network_type = '';
105 if ( form.name == 'addForm' )
107 network_type = form.nf_network_type;
108 technology = form.nf_technology;
112 network_type = form.uf_network_type;
113 technology = form.uf_technology;
117 if ( (network_type.value == null) || (network_type.value == "") || isblank(network_type.value) )
119 errorMsg += 'Network Type is required.<br>';
121 if( errorMsg.length > 0 ) {
122 bootbox.alert(errorMsg);
128 function updateNetworkProfile(network_type,technology) {
130 document.getElementById('uf_network_type').value=network_type;
131 document.getElementById('uf_technology').value=technology;
133 document.getElementById('uf_key_network_type').value=network_type;
135 $('#update_network_profile').modal('show');
138 function deleteNetworkProfile(network_type) {
141 message: "Are you sure you want to delete this Network Profile [" + network_type + "]",
142 callback: function(result) {
145 location.assign("/gamma/deleteNetworkProfile?network_type=" + network_type);