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 $('#preload_vnf_data').DataTable( {
13 "order": [[ 0, "asc" ]]
22 <div class="well well-sm">
23 <h3>Pre-load VNF Network Data</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 <table id="preload_vnf_data" class="table table-hover table-condensed">
59 <th>SVC_REQUEST_ID</th>
63 <th>UPLOAD STATUS</th>
65 <th>IMPORT/UPLOAD TIMESTAMP</th>
66 <% if(priv == 'A'){ %>
72 <% var i=0; retData.forEach( function(rowObj) { %>
74 <td><%= rowObj.row.id %></td>
75 <td><a href="javascript:getVnfNetworkData('<%= rowObj.network_name %>','<%= rowObj.network_type %>');"><%= rowObj.row.svc_request_id %></a></td>
76 <td><%= rowObj.network_name %></td>
77 <td><%= rowObj.network_type %></td>
78 <td><%= rowObj.row.svc_action %></td>
79 <td><%= rowObj.row.status %></td>
81 <a data-toggle="collapse"
82 href="#collapseExample<%= i %>" aria-expanded="false"
83 aria-controls="collapseExample"><%= rowObj.row.filename %>
85 <div class="collapse" id="collapseExample<%= i %>">
87 <pre><%= JSON.stringify(rowObj.filecontent,null,4) %></pre>
92 <td><%= rowObj.row.ts %></td>
93 <% if(priv == 'A' ) { %>
95 <button type="button" class="btn btn-default btn-xs"
96 onclick="deleteVnfNetworkData('<%= rowObj.row.id %>','<%= rowObj.row.svc_request_id %>','<%= rowObj.row.filename %>','<%= rowObj.row.status %>','<%= rowObj.network_name %>','<%= rowObj.network_type %>');">Delete</button>
97 <% if (typeof rowObj.network_name != 'undefined' || typeof rowObj.network_type != 'undefined'){ %>
98 <button type="button" class="btn btn-default btn-xs"
99 onclick="loadVnfNetworkData('<%= rowObj.row.id %>','<%= rowObj.row.svc_request_id %>','<%= rowObj.row.svc_action %>','<%= rowObj.row.status %>','<%= rowObj.row.filename %>','<%= rowObj.row.ts %>');">Load Data</button>
108 <% if(priv == 'A'){ %>
110 <div class="col-md-8 col-md-push-4">
111 <form method="POST" action="/mobility/uploadVnfNetworkData" enctype="multipart/form-data">
112 <div class="form-group">
113 <label for="dest">Upload pre processed JSON file.</label>
114 <input name="filename" type="file" id="dest" />
115 <p class="help-block">Choose a JSON file to upload.</p>
116 <button type="button" class="btn btn-default"
117 data-toggle="tooltip" data-placement="bottom"
118 title="Upload a JSON file that has already been pre processed."
119 onclick="uploadFile(this.form);">Upload JSON File
124 <div class="col-md-4 col-md-pull-8">
125 <form method="POST" action="/preload/uploadNetworkCsv" enctype="multipart/form-data">
126 <div class="form-group">
127 <label for="dest">Upload Worksheet CSV files from the <%= preloadImportDirectory %> directory.</label>
128 <input name="filename" type="file" id="dest" multiple />
129 <p class="help-block">Choose Worksheet CSV files to upload.</p>
130 <button type="button" class="btn btn-default"
131 data-toggle="tooltip" data-placement="bottom"
132 title="Must upload all the VNF CSV files from <%= preloadImportDirectory %>"
133 onclick="importWorksheet(this.form);">Upload Network Worksheet CSV files
143 <% include ../partials/footer %>
146 <script type="text/javascript">
148 function importWorksheet(form)
150 if ( form.filename.value.length == 0)
152 bootbox.alert('Must select a file.');
158 message: "Are you sure you want to import Network WORKSHEET .csv files from <%= preloadImportDirectory %>",
159 callback: function(result) {
178 function getVnfNetworkData(network_name,network_type)
180 location.assign("/mobility/viewVnfNetworkData?network_name=" + network_name + "&network_type=" + network_type );
183 function loadVnfNetworkData(id,svc_request_id,svc_action,status,filename,ts)
185 if ( status != 'pending' )
187 bootbox.alert("Upload Status must be in 'pending' state.");
191 message: "Are you sure you want to load file [" + filename + "]? ",
192 callback: function(result) {
195 location.assign("/mobility/loadVnfNetworkData?id=" + id + "&svc_request_id=" + svc_request_id + "&filename=" + filename + "&status=" + status);
210 function deleteVnfNetworkData(id,svc_request_id,filename,status,network_name,network_type) {
213 message: "Are you sure you want to delete uploaded file [" + filename + "]? ",
214 callback: function(result) {
217 location.assign("/mobility/deleteVnfNetworkData?id="
219 + "&svc_request_id=" + svc_request_id
220 + "&filename=" + filename
221 + "&status=" + status
222 + "&network_name=" + network_name
223 + "&network_type=" + network_type);