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 $('#site').DataTable( {
13 "order": [[ 0, "asc" ]]
21 <div class="well well-sm">
25 <div class="actions" style="padding:0px 25px;">
30 <% if ( typeof result != 'undefined' ) {
31 if (result.code.length > 0) {
32 if ( result.code == 'success' ) { %>
33 <div class='alert alert-success' role='alert'>
35 for ( x in result.msg ){ %>
36 <div><%= result.msg[x] %></div>
40 <div class='alert alert-danger' role='danger'>
42 for ( x in result.msg ){ %>
43 <div><%= result.msg[x] %></div>
50 <% if( typeof privilege != 'undefined'){
51 var priv = privilege.privilege;
56 <div class="container-fluid">
57 <table id="site" class="table table-hover table-condensed">
63 <th>OAM Gateway Address</th>
65 <th>VCenter Passwd</th>
69 <% if(priv == 'A') { %>
75 <% rows.forEach( function(row) { %>
77 <td><%= row.name %></td>
78 <td><%= row.aic_site_id %></td>
79 <td><%= row.vcenter_url %></td>
80 <td><%= row.oam_gateway_addr %></td>
81 <td><%= row.vcenter_username %></td>
83 <td><%= row.city %></td>
84 <td><%= row.state %></td>
85 <td><%= row.operational_status %></td>
86 <% if(priv == 'A') { %>
88 <button type="button" class="btn btn-default btn-xs"
89 onclick="updateAicSite('<%= row.name %>','<%=row.aic_site_id %>',
90 '<%= row.vcenter_url %>','<%= JSON.stringify(row.vcenter_username).replace(/\"/g,'') %>',
91 '<%= row.vcenter_passwd %>', '<%= row.city %>','<%= row.state %>',
92 '<%= row.operational_status %>', '<%= row.oam_gateway_addr %>');">Update</button>
93 <button type="button" class="btn btn-default btn-xs"
94 onclick="deleteSite('<%=row.aic_site_id %>');">Delete</button>
103 <% if(priv == 'A') { %>
104 <div class="actions" style="padding:0px 25px;">
105 <form method="POST" action="/gamma/uploadAicSite" 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>
111 <% if(priv == 'A') { %>
112 <button type="button" class="btn btn-default"
113 onclick="uploadFile(this.form);">Upload File</button>
115 <button type="button" class="btn btn-default disabled"
116 onclick="uploadFile(this.form);">Upload File</button>
124 <% include ../partials/update_aic_site %>
126 <% include ../partials/footer %>
129 <script type="text/javascript">
130 function updateAicSite(name,aic_site_id,vcenter_url,vcenter_username,vcenter_passwd,city,state,operational_status,oam_gateway_addr)
132 document.getElementById('uf_name').value=name
133 document.getElementById('uf_aic_site_id').value=aic_site_id;
134 document.getElementById('uf_vcenter_url').value=vcenter_url;
135 document.getElementById('uf_vcenter_username').value=vcenter_username;
136 document.getElementById('uf_vcenter_passwd').value=vcenter_passwd;
137 document.getElementById('uf_city').value=city;
138 document.getElementById('uf_state').value=state;
139 document.getElementById('uf_operational_status').value=operational_status;
140 document.getElementById('uf_oam_gateway_addr').value=oam_gateway_addr;
142 document.getElementById('uf_key_aic_site_id').value=aic_site_id;
143 $('#update_aic_site_modal').modal('show');
146 function deleteSite(siteId) {
149 message: "Their may be SERVICE_HOMING entry pointing to this site. Are you sure you want to delete site [" + siteId + "] ?",
150 callback: function(result) {
153 location.assign("/gamma/deleteSite?siteid=" + siteId);