Initial commit for OpenECOMP SDN-C OA&M
[sdnc/oam.git] / admportal / views / gamma / nbVlanPool.ejs
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
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>
10
11 <script class="init">
12     $(document).ready(function() {
13     $('#nb_vlan_pool').DataTable( {
14         "order": [[ 0, "asc" ]]
15     } );
16 } );
17 </script>
18
19 </head>
20 <body>
21
22 <div class="well well-sm">
23 <h3>NetBond VLAN Pools</h3>
24 </div>
25
26 <% if ( typeof result != 'undefined' ) {
27                 if (result.code.length > 0) { 
28                         if ( result.code == 'success' ) { %>
29                                 <div class='alert alert-success' role='alert'>
30                                 <%
31                                 for ( x in result.msg ){ %>
32                                         <div><%= result.msg[x] %></div>
33                                 <% } %>
34                                 </div>
35                         <% } else { %> 
36                                 <div class='alert alert-danger' role='danger'>
37                                 <%
38                                 for ( x in result.msg ){ %>
39                                         <div><%= result.msg[x] %></div>
40                                 <% } %>
41                                 </div>
42                         <% } %>
43                 <% } %>
44 <% } %>
45
46 <% if( typeof privilege != 'undefined'){ 
47     var priv = privilege.privilege;
48 } else {
49     var priv = 'A';
50 } %>
51
52 <div class="container-fluid">
53
54         <table id="nb_vlan_pool" class="table table-hover table-condensed">
55       <thead>
56         <tr>
57           <th>AIC Site Id</th>
58           <th>Availability Zone</th>
59                   <th>VLAN Plan Id</th>
60                   <th>Plan Type</th>
61                   <th>Purpose</th>
62                   <th>VLAN Id</th>
63               <th>Status</th>
64                   <% if(priv == 'A'){ %>
65                   <th>Action</th>
66                   <% } %>
67         </tr>
68       </thead>
69       <tbody>
70       <% rows.forEach( function(row) { %> 
71         <tr>
72             <td><%= row.aic_site_id %></td>
73             <td><%= row.availability_zone %></td>
74             <td><%= row.vlan_plan_id %></td>
75             <td><%= row.plan_type %></td>
76             <td><%= row.purpose %></td>
77             <td><%= row.vlan_id %></td>
78             <td><%= row.status %></td>
79                         <% if(priv == 'A') { %>
80             <td>
81                 <button type="button" class="btn btn-default btn-xs" 
82                                         onclick="updateNbVlanPool('<%= row.aic_site_id %>', '<%= row.availability_zone %>',
83                                                 '<%= row.vlan_plan_id %>', '<%= row.plan_type %>', '<%= row.purpose %>', 
84                                                 '<%= row.vlan_id %>', '<%= row.status %>');">Update</button>
85             </td>
86             <% } else { %>
87                                 <td>&nbsp;</td>
88                         <% } %>
89         </tr>
90     <% }); %>
91       </tbody>
92     </table>
93 </div>
94
95 <% include ../partials/nb_vlan_pool %>
96 <footer>
97     <% include ../partials/footer %>
98 </footer>
99
100 <script type="text/javascript">
101
102 function updateNbVlanPool(aic_site_id,availability_zone,vlan_plan_id,plan_type,purpose,vlan_id,pstatus) {
103
104     document.getElementById('uf_key_aic_site_id').value=aic_site_id;
105     document.getElementById('uf_key_availability_zone').value=availability_zone;
106     document.getElementById('uf_key_vlan_plan_id').value=vlan_plan_id;
107     document.getElementById('uf_key_plan_type').value=plan_type;
108     document.getElementById('uf_key_purpose').value=purpose;
109     document.getElementById('uf_key_vlan_id').value=vlan_id;
110     document.getElementById('uf_status').value=pstatus;
111
112     $('#update_nb_vlan_pool').modal('show');
113 }
114
115 function saveNbVlanPool(form)
116 {
117         form.submit();
118 }
119
120 </script>
121
122 </body>
123 </html>
124