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 $('#reference_data').DataTable( {
13 "order": [[ 0, "asc" ]]
21 <div class="well well-sm">
22 <h3>uCPE Reference Data</h3>
25 <% if ( typeof result != 'undefined' ) {
26 if (result.code.length > 0) {
27 if ( result.code == 'success' ) { %>
28 <div class='alert alert-success' role='alert'>
30 for ( x in result.msg ){ %>
31 <div><%= result.msg[x] %></div>
35 <div class='alert alert-danger' role='danger'>
37 for ( x in result.msg ){ %>
38 <div><%= result.msg[x] %></div>
45 <% if( typeof privilege != 'undefined'){
46 var priv = privilege.privilege;
52 <div class="container-fluid">
54 <table id="reference_data" class="table table-hover table-condensed">
62 <% if(priv == 'A'){ %>
68 <% var i=0; retData.forEach( function(rowObj) { %>
70 <td><%= rowObj.row.reference_id %></td>
71 <td><%= rowObj.row.status %></td>
73 <a data-toggle="collapse"
74 href="#collapseExample<%= i %>" aria-expanded="false"
75 aria-controls="collapseExample"><%= rowObj.row.filename %>
77 <div class="collapse" id="collapseExample<%= i %>">
79 <pre><%= rowObj.filecontent %></pre>
83 <td><%= rowObj.row.attuid %></td>
84 <td><%= rowObj.row.ts %></td>
85 <% if(priv == 'A' ) { %>
87 <% if ( rowObj.row.status == 'pending' ) { %>
88 <button type="button" class="btn btn-default btn-xs"
89 onclick="importReferenceData('<%= rowObj.row.reference_id %>','<%= rowObj.row.status %>','<%= rowObj.row.filename %>','<%= rowObj.row.ts %>');">Import</button>
91 <button type="button" class="btn btn-default btn-xs"
92 onclick="deleteReferenceData('<%= rowObj.row.reference_id %>','<%= rowObj.row.filename %>');">Delete</button>
100 <% if(priv == 'A'){ %>
101 <div class="actions" style="padding:0px 25px;">
102 <form method="POST" action="/ucpe/uploadReferenceData" enctype="multipart/form-data">
103 <div class="form-group">
104 <label for="dest">File input</label>
105 <input name="filename" type="file" id="dest">
106 <p class="help-block">Choose a file to upload.</p>
108 <button type="button" class="btn btn-default"
109 onclick="uploadFile(this.form);">Upload File</button>
116 <% include ../partials/footer %>
119 <script type="text/javascript">
121 function getVnfData(vnf_name,vnf_type,svc_request_id)
123 location.assign("/mobility/viewVnfData?vnf_name=" + vnf_name + "&vnf_type=" + vnf_type );
126 function importReferenceData(reference_id,status,filename,ts)
128 var alertMessage = '';
129 if ( status != 'pending' )
131 bootbox.alert("Upload Status must be in 'pending' state.");
134 if ( filename.substring(0,11) == 'ucpedevice_' ){
135 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_MAPPED_SERVICE_PORT and UCPE_SERVICE_PORT tables?";
136 }else if ( filename.substring(0,14) == 'ucpeapilogins_' ){
137 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_VNF_LOGINS, UCPE_PHYSICAL_DEVICE_LOGINS and UCPE_API_LOGINS tables?";
138 }else if ( filename.substring(0,17) == 'ucpenminterfaces_' ){
139 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_VNF_NM_INTERFACES and UCPE_NM_INTERFACES tables?";
140 }else if ( filename.substring(0,15) == 'ucpephsservers_' ){
141 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_PHS_SERVERS table?";
142 }else if ( filename.substring(0,15) == 'ucpencsservers_' ){
143 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_CUSTOMER_NCS_SERVERS table?";
144 }else if ( filename.substring(0,15) == 'ucpevnfcatalog_' ){
145 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_VNF_MODELS, UCPE_VNF_MODEL_SOFTWARE and UCPE_VNF_MODEL_FEATURES tables?";
146 }else if ( filename.substring(0,16) == 'ucpemcapservers_' ){
147 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_MCAP_SERVERS table?";
148 }else if ( filename.substring(0,23) == 'ucpechainingtopologies_' ){
149 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_CHAINING_TOPOLOGIES table?";
150 }else if ( filename.substring(0,16) == 'ucpevnfportinfo_' ){
151 alertMessage = "Are you sure you want to import file:" + filename + " and replace the UCPE_VNF_PORT and UCPE_MAP_TO_DEVICE tables?";
153 bootbox.alert('Invalid Filename in database: ' + filename);
157 message: alertMessage,
158 callback: function(result) {
161 if ( filename.substring(0,11) == 'ucpedevice_' ){
162 location.assign("/ucpe/importUcpeDevices?id=" + reference_id + "&filename=" + filename + "&status=" + status);
163 }else if ( filename.substring(0,14) == 'ucpeapilogins_' ){
164 location.assign("/ucpe/importApiLogins?id=" + reference_id + "&filename=" + filename + "&status=" + status);
165 }else if ( filename.substring(0,17) == 'ucpenminterfaces_' ){
166 location.assign("/ucpe/importNmInterfaces?id=" + reference_id + "&filename=" + filename + "&status=" + status);
167 }else if ( filename.substring(0,15) == 'ucpephsservers_' ){
168 location.assign("/ucpe/importPhsServers?id=" + reference_id + "&filename=" + filename + "&status=" + status);
169 }else if ( filename.substring(0,15) == 'ucpencsservers_' ){
170 location.assign("/ucpe/importNcsServers?id=" + reference_id + "&filename=" + filename + "&status=" + status);
171 }else if ( filename.substring(0,15) == 'ucpevnfcatalog_' ){
172 location.assign("/ucpe/importVnfCatalog?id=" + reference_id + "&filename=" + filename + "&status=" + status);
173 }else if ( filename.substring(0,16) == 'ucpemcapservers_' ){
174 location.assign("/ucpe/importMcapServers?id=" + reference_id + "&filename=" + filename + "&status=" + status);
175 }else if ( filename.substring(0,23) == 'ucpechainingtopologies_' ){
176 location.assign("/ucpe/importChainTopo?id=" + reference_id + "&filename=" + filename + "&status=" + status);
177 }else if ( filename.substring(0,16) == 'ucpevnfportinfo_' ){
178 location.assign("/ucpe/importVnfPortInfo?id=" + reference_id + "&filename=" + filename + "&status=" + status);
180 bootbox.alert('Invalid Filename: ' + filename);
197 function deleteReferenceData(reference_id,filename)
201 message: "Are you sure you want to delete uploaded file [" + filename + "]? (This action will not effect the database.)",
202 callback: function(result) {
205 location.assign("/ucpe/deleteReferenceData?id=" + reference_id + "&filename=" + filename);