Initial commit for OpenECOMP SDN-C OA&M
[sdnc/oam.git] / admportal / views / gamma / listVplspePool.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     $('#vplspe_pool').DataTable( {
14         "order": [[ 0, "asc" ]]
15     } );
16 } );
17 </script>
18
19 </head>
20 <body>
21
22 <div class="well well-sm">
23 <h3>VPLSPE Pool</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         <table id="vplspe_pool" class="table table-hover table-condensed">
54       <thead>
55         <tr>
56           <th>VPLSPE Name</th>
57           <th>AIC Site ID</th>
58           <th>Availability Zone</th>
59                   <th>Interface Name</th>
60           <th>Interface Speed</th>
61           <th>Interface Units</th>
62           <th>Loopback IPV4 Address</th>
63           <th>VLAN ID Outer</th>
64           <th>VPLSPE UUID</th>
65           <th>Image Filename</th>
66           <th>Prov Status</th>
67           <th>Vendor</th>
68                   <% if(priv == 'A'){ %>
69                   <th>Action</th>
70                   <% } %>
71         </tr>
72       </thead>
73       <tbody>
74       <% rows.forEach( function(row) { %> 
75         <tr>
76             <td><%= row.vplspe_name %></td>
77             <td><%= row.aic_site_id %></td>
78             <td><%= row.availability_zone %></td>
79             <td><%= row.physical_intf_name %></td>
80             <td><%= row.physical_intf_speed %></td>
81             <td><%= row.physical_intf_units %></td>
82             <td><%= row.loopback0_ipv4_address %></td>
83             <td><%= row.vlan_id_outer %></td>
84             <td><%= row.vplspe_uuid %></td>
85             <td><%= row.image_filename %></td>
86             <td><%= row.provisioning_status %></td>
87             <td><%= row.vendor %></td>
88                         <% if(priv == 'A') { %>
89             <td>
90                                 <button type="button" class="btn btn-default btn-xs"
91                     onclick="updateVplspePool('<%=row.aic_site_id %>','<%= row.availability_zone %>','<%= row.vplspe_name %>','<%= row.physical_intf_name %>','<%= row.physical_intf_speed %>','<%= row.physical_intf_units %>','<%= row.loopback0_ipv4_address %>','<%= row.vlan_id_outer %>','<%= row.vplspe_uuid %>','<%= row.image_filename %>','<%= row.provisioning_status %>','<%= row.vendor %>');">Update</button>
92                                 <button type="button" class="btn btn-default btn-xs"
93                    onclick="deleteVplspePool('<%= row.vplspe_name %>','<%=row.aic_site_id %>','<%= row.availability_zone %>','<%= row.physical_intf_name %>');">Delete</button>
94             </td>
95             <% } %>
96
97         </tr>
98     <% }); %>
99       </tbody>
100     </table>
101
102 <!--
103         <% if(priv == 'A'){ %>
104         <div class="actions" style="padding:0px 25px;">
105         <form method="POST" action="/gamma/uploadVplspePool" enctype="multipart/form-data">
106                 <div class="form-group">
107                 <label for="dest">File input</label>
108                 <input name="filename" type="file" id="dest">
109                 <p class="help-block">Choose a file to upload.</p>
110                 </div>
111                 <% if(priv == 'A') { %>
112             <button type="button" class="btn btn-default"
113                 onclick="uploadFile(this.form);">Upload File</button>
114         <% } else { %>
115             <button type="button" class="btn btn-default disabled"
116                 onclick="uploadFile(this.form);">Upload File</button>
117         <% } %>
118
119         </form>
120         </div>
121         <% } %>
122 -->
123 </div>
124
125 <% include ../partials/update_vplspe_pool %>
126 <footer>
127     <% include ../partials/footer %>
128 </footer>
129
130 <script type="text/javascript">
131 function updateVplspePool(aic_site_id,availability_zone,vplspe_name,physical_intf_name,physical_intf_speed,physical_intf_units,loopback0_ipv4_address,vlan_id_outer,vplspe_uuid,image_filename,provisioning_status,vendor) {
132
133     document.getElementById('uf_aic_site_id').value=aic_site_id;
134     document.getElementById('uf_availability_zone').value=availability_zone
135     document.getElementById('uf_vplspe_name').value=vplspe_name;
136     document.getElementById('uf_physical_intf_name').value=physical_intf_name;
137     document.getElementById('uf_physical_intf_speed').value=physical_intf_speed;
138     document.getElementById('uf_physical_intf_units').value=physical_intf_units;
139     document.getElementById('uf_loopback0_ipv4_address').value=loopback0_ipv4_address;
140     document.getElementById('uf_vlan_id_outer').value=vlan_id_outer;
141     document.getElementById('uf_vplspe_uuid').value=vplspe_uuid;
142     document.getElementById('uf_image_filename').value=image_filename;
143     document.getElementById('uf_provisioning_status').value=provisioning_status;
144     document.getElementById('uf_vendor').value=vendor;
145
146     document.getElementById('uf_key_aic_site_id').value=aic_site_id;
147     document.getElementById('uf_key_vplspe_name').value=vplspe_name;
148     document.getElementById('uf_key_availability_zone').value=availability_zone
149     document.getElementById('uf_key_physical_intf_name').value=physical_intf_name;
150     $('#update_vplspe_pool_modal').modal('show');
151 }
152
153 function deleteVplspePool(vplspe_name,aic_site_id,availability_zone,physical_intf_name) {
154
155     bootbox.confirm({
156         message: "Are you sure you want to delete VPLSPE [" + vplspe_name + "][" + aic_site_id + "][" + availability_zone + "][" + physical_intf_name + "] ?",
157         callback: function(result) {
158             if ( result )
159             {
160                 location.assign("/gamma/deleteVplspePool?aic_site_id=" + aic_site_id + "&vplspe_name=" + vplspe_name + "&availability_zone=" + availability_zone + "&physical_intf_name=" + physical_intf_name);
161             }
162             return;
163         },
164         buttons: {
165             cancel: {
166                 label: "Cancel"
167             },
168             confirm: {
169                 label: "Yes"
170             }
171         }
172     });
173 }
174 </script>
175
176 </body>
177 </html>
178