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 $('#sla').DataTable( {
13 "order": [[ 0, "asc" ]]
21 <div class="well well-sm">
22 <h3>Service Logic Administration</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'><%=result.msg %></div>
30 <div class='alert alert-danger' role='danger'><%=result.msg %></div>
35 <% if( typeof privilege != 'undefined'){
36 var priv = privilege.privilege;
41 <div class="container-fluid">
42 <table id="sla" class="table table-hover table-condensed">
50 <% if(priv == 'A') { %>
51 <th>Activate/Deactive</th>
60 <% var i=0; rows.forEach( function(row) { %>
62 <td><%= row.module %></td>
63 <td><%= row.rpc %></td>
64 <td><%= row.version %></td>
65 <td><%= row.mode %></td>
66 <td><%= row.active %></td>
67 <% if ( priv == 'A' ) {
68 if (row.active == "Y") { %>
69 <td><button type="button" class="btn btn-default btn-xs" onclick="toggleState('deactivate','<%= row.module %>','<%= row.rpc %>','<%= row.version %>','<%= row.mode %>');" >Deactivate</button> </td>
71 <td><button type="button" class="btn btn-default btn-xs" onclick="toggleState('activate','<%= row.module %>','<%= row.rpc %>','<%= row.version %>','<%= row.mode %>');" >Activate</button></td>
75 <button type="button" class="btn btn-default btn-xs"
76 onclick='location.assign("/sla/printAsXml?module=<%= row.module %>&rpc=<%= row.rpc %>&version=<%= row.version %>&mode=<%= row.mode %>");'>XML code</button>
78 <% if ( priv == 'A' ) { %>
80 <button type="button" class="btn btn-default btn-xs"
81 onclick="deleteGraph('<%=row.module %>',
82 '<%=row.rpc %>', '<%=row.version %>','<%=row.mode %>');">Delete</button>
90 <% if(priv == 'A') { %>
91 <div class="actions" style="padding:0px 25px;">
92 <form method="POST" action="/sla/upload" enctype="multipart/form-data">
93 <div class="form-group">
94 <label for="dest">File input</label>
95 <input name="filename" type="file" id="dest" />
96 <input type="hidden" name="_csrf" value="<%= privilege.csrfToken %>" />
97 <p class="help-block">Choose a file to upload.</p>
99 <% if ( priv == 'A' ) { %>
100 <button type="button" class="btn btn-default"
101 onclick="uploadFile(this.form);">Upload File</button>
103 <button type="button" class="btn btn-default disabled"
104 onclick="uploadFile(this.form);">Upload File</button>
115 <% include ../partials/footer %>
118 <script type="text/javascript">
119 function deleteGraph(_module,rpc,version,mode) {
122 message: "Are you sure you want to delete Directed Graph [" + _module + "][" + rpc + "][" + version + "] ?",
123 callback: function(result) {
126 location.assign("/sla/deleteDG?module=" + _module
127 + "&rpc=" + rpc + "&version=" + version + "&mode=" + mode );
141 function toggleState(laction,_module,rpc,version,mode)
145 if(laction == 'activate'){
146 myprompt = "Are you sure you want to Activate Directed Graph [" + _module + "] ?";
147 myaction = "/sla/activate"
148 + "?module=" + _module
150 + "&version=" + version
153 myprompt = "Are you sure you want to Deactivate Directed Graph [" + _module + "] ?";
154 myaction = "/sla/deactivate"
155 + "?module=" + _module
157 + "&version=" + version
163 callback: function(result) {
166 location.assign(myaction);