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 $('#ncs_server_credentials').DataTable( {
13 "order": [[ 0, "asc" ]]
21 <div class="well well-sm">
22 <h3>NCS Server Credentials</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 <% if(priv == 'A'){ %>
55 <div class="actions" style="padding:15px 0px;">
56 <button class="btn btn-primary" data-toggle="modal" data-target="#add_ncs_credentials">
62 <table id="ncs_server_credentials" class="table table-hover table-condensed">
65 <th>*Customer Name</th>
68 <% if(priv == 'A'){ %>
74 <% rows.forEach( function(row) { %>
76 <td><%= row.customer_name %></td>
77 <td><%= row.ncs_username %></td>
79 <% if(priv == 'A') { %>
81 <button type="button" class="btn btn-default btn-xs"
82 onclick="updateNcsCredentials('<%= row.customer_name %>','<%= row.ncs_username %>','<%= row.ncs_password %>');">Update</button>
83 <button type="button" class="btn btn-default btn-xs"
84 onclick="deleteNcsCredentials('<%= row.customer_name %>');">Delete</button>
95 <% include ../partials/ncs_credentials %>
97 <% include ../partials/footer %>
100 <script type="text/javascript">
101 function submitNcsCredentials(form)
104 var customer_name = '';
105 var ncs_username = '';
106 var ncs_password = '';
107 var confirm_ncs_password = '';
109 if ( form.name == 'addForm' )
111 customer_name = form.nf_customer_name;
112 ncs_username = form.nf_ncs_username;
113 ncs_password = form.nf_ncs_password;
114 confirm_ncs_password = form.nf_confirm_ncs_password;
116 if ( (customer_name.value == null) || (customer_name.value == "") || isblank(customer_name.value) )
118 errorMsg += 'Customer Name is required.<br>';
120 if( errorMsg.length > 0 ) {
121 bootbox.alert(errorMsg);
124 if ( ncs_password.value != confirm_ncs_password.value )
126 bootbox.alert('Passwords do not match.');
132 customer_name = form.uf_customer_name;
133 ncs_username = form.uf_ncs_username;
134 ncs_password = form.uf_ncs_password;
135 confirm_ncs_password = form.uf_confirm_ncs_password;
136 if ( ncs_password.value != confirm_ncs_password.value )
138 bootbox.alert('Passwords do not match.');
145 function updateNcsCredentials(customer_name,ncs_username,ncs_password) {
147 document.getElementById('uf_customer_name').value=customer_name;
148 document.getElementById('uf_ncs_username').value=ncs_username;
149 document.getElementById('uf_ncs_password').value=ncs_password;
151 $('#update_ncs_credentials').modal('show');
154 function deleteNcsCredentials(customer_name) {
157 message: "Are you sure you want to delete NCS Credentials [ " + customer_name + " ]",
158 callback: function(result) {
161 location.assign("/ucpe/deleteNcsCredentials?customer_name=" + customer_name);