diff options
Diffstat (limited to 'openo-portal/portal-extsys')
-rw-r--r-- | openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html | 22 | ||||
-rw-r--r-- | openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js | 19 |
2 files changed, 17 insertions, 24 deletions
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html index e933c786..635cfb2d 100644 --- a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html +++ b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html @@ -32,13 +32,7 @@ <script type="text/javascript" src="js/bootstrap-table-filter-control.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
-
- var jsondata = loadControllerData();
-
- $('#controller').bootstrapTable({
- //Assigning data to table
- data: jsondata
- });
+ loadControllerData();
});
function operateFormatter(value, row, index) {
return ['<img class="siteDeleteImg" src="images/delete.png" href="javascript:void(0)" style="cursor: pointer" name="title" title="Delete" />']
@@ -48,8 +42,7 @@ window.operateEvents = {
'click .siteDeleteImg': function (e, value, row, index) {
// TO DO ajex call for delete
- deleteLink(row.id);
- console.log(value, row, index);
+ deleteController(row.id, row);
}
};
</script>
@@ -177,6 +170,15 @@ </span>
</div>
</th>
+ <th class="openo-table-state-default openo-table-th openo-table-disable-element leftHeaderAlign"
+ align="center" data-formatter="operateFormatter" data-events="operateEvents">
+ <div class="openo-table-th-border"></div>
+ <div class="DataTables_sort_wrapper openo-ellipsis ">
+ <span id="ctrler_nativeID_sorticon"
+ class="openo-table-th-sorticon overflow_elip leftHeaderAlign openo-table-disable-element ">Actions
+ </span>
+ </div>
+ </th>
</tr>
</thead>
<tbody>
@@ -299,7 +301,7 @@ </div>
<div class="modal-footer">
<button type="button" class="btn SDBtn" data-dismiss="modal" aria-hidden="true"
- id="createLink">
+ id="createController">
<span id="nfv-virtualApplication-iui-text-cancelBtn">OK</span>
</button>
<button type="button" class="btn button-previous SDBtn">
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js index 04437df9..df0fef51 100644 --- a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js +++ b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js @@ -13,11 +13,6 @@ * limitations under the License.
*/
-var url = "";
-$.getJSON("./conf/dataconfig.json", function (jsonData){
- url = jsonData.url +":"+ jsonData.port;
- console.log("URL = " + url);
-});
$('.siteDeleteImg').click(
function () {
@@ -35,7 +30,7 @@ $('.siteDeleteImg').click( });
function deleteController(objectId) {
- var requestUrl = url + "/openoapi/extsys/v1/sdncontrollers/" + objectId;
+ var requestUrl = "/openoapi/extsys/v1/sdncontrollers/" + objectId;
$.ajax({
type: "DELETE",
url: requestUrl,
@@ -54,14 +49,14 @@ function deleteController(objectId) { }
function loadControllerData() {
- var requestUrl = url + "/openoapi/extsys/v1/sdncontrollers";
+ var requestUrl = "/openoapi/extsys/v1/sdncontrollers";
$.ajax({
type: "GET",
url: requestUrl,
contentType: "application/json",
success: function (jsonobj) {
$('#controller').bootstrapTable({
- data: jsonobj.topologicalControllers
+ data: jsonobj
});
},
error: function (xhr, ajaxOptions, thrownError) {
@@ -150,11 +145,7 @@ $(function () { $('#createController').click(function () {
var formData = JSON.stringify($("#controllerForm").serializeObject());
var jsonobj = JSON.parse(formData);
- var newJson = {
- "topologicalController": jsonobj
- };
- formData = JSON.stringify(newJson);
- var requestUrl = url + "/openoapi/extsys/v1/sdncontrollers";
+ var requestUrl = "/openoapi/extsys/v1/sdncontrollers";
$.ajax({
type: "POST",
url: requestUrl,
@@ -163,7 +154,7 @@ $(function () { data: formData,
success: function (jsonResp) {
alert("Controller saved successfully!!!");
- jsonobj["id"] = jsonResp.topologicalController.id;
+ jsonobj["id"] = jsonResp.sdnControllerId;
$('#controller').bootstrapTable("append", jsonobj);
$('#vmAppDialog').removeClass('in').css('display', 'none');
|