From: Benjamin Diaz Date: Wed, 17 Apr 2019 18:36:03 +0000 (-0300) Subject: Removes metric and alarm operations from NS instance actions X-Git-Tag: v6.0.0~8 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F81%2F7481%2F1;p=osm%2FLW-UI.git Removes metric and alarm operations from NS instance actions Change-Id: I45c7dd28d7a9d84acd7c9796d9782c0720efed99 Signed-off-by: Benjamin Diaz --- diff --git a/instancehandler/template/instance_list.html b/instancehandler/template/instance_list.html index 9fddbc0..42b6fda 100644 --- a/instancehandler/template/instance_list.html +++ b/instancehandler/template/instance_list.html @@ -173,13 +173,6 @@ ' ' + ' History of operations' + '
  • ' + - '
  • ' + - ' New Alarm
  • ' + - '
  • ' + - ' Export metric
  • ' + - '
  • ' + '
  • ' + ' ' + ' Force delete
  • ' + diff --git a/instancehandler/template/modal/instance_export_metric.html b/instancehandler/template/modal/instance_export_metric.html deleted file mode 100644 index cd3d1b5..0000000 --- a/instancehandler/template/modal/instance_export_metric.html +++ /dev/null @@ -1,75 +0,0 @@ - diff --git a/instancehandler/template/modal/instance_new_alarm.html b/instancehandler/template/modal/instance_new_alarm.html deleted file mode 100644 index fe5fbfe..0000000 --- a/instancehandler/template/modal/instance_new_alarm.html +++ /dev/null @@ -1,83 +0,0 @@ - diff --git a/static/src/instancehandler/instance_list.js b/static/src/instancehandler/instance_list.js index d04f465..db22bc2 100644 --- a/static/src/instancehandler/instance_list.js +++ b/static/src/instancehandler/instance_list.js @@ -20,18 +20,6 @@ function performAction(instance_name, instance_id) { $('#modal_instance_new_action').modal('show'); } -function exportMetricNs(instance_name, instance_id) { - var url = '/instances/ns/'+instance_id+'/monitoring/metric'; - $("#formExportMetricNS").attr("action", url); - $('#modal_instance_export_metric').modal('show'); -} - -function newAlarmNs(instance_name, instance_id) { - var url = '/instances/ns/'+instance_id+'/monitoring/alarm'; - $("#formAlarmNS").attr("action", url); - $('#modal_instance_new_alarm').modal('show'); -} - function deleteNs(instance_name, instance_id, force) { var url = '/instances/ns/'+instance_id+'/delete'; bootbox.confirm("Are you sure want to delete " + instance_name + "?", function (result) { @@ -354,68 +342,4 @@ $(document).ready(function () { }); }); - $("#formAlarmNS").submit(function (event) { - event.preventDefault(); //prevent default action - var post_url = $(this).attr("action"); //get form action url - var request_method = $(this).attr("method"); //get form GET/POST method - var form_data = new FormData(this); //Encode form elements for submission - console.log(post_url); - $.ajax({ - url: post_url, - type: request_method, - data: form_data, - headers: { - "Accept": 'application/json' - }, - contentType: false, - processData: false - }).done(function (response, textStatus, jqXHR) { - $('#modal_instance_new_action').modal('hide'); - bootbox.alert({ - title: "Metric", - message: "Alarm created." - }); - }).fail(function (result) { - var data = result.responseJSON; - var title = "Error " + (data.code ? data.code : 'unknown'); - var message = data.detail ? data.detail : 'No detail available.'; - bootbox.alert({ - title: title, - message: message - }); - }); - }); - - $("#formExportMetricNS").submit(function (event) { - event.preventDefault(); //prevent default action - var post_url = $(this).attr("action"); //get form action url - var request_method = $(this).attr("method"); //get form GET/POST method - var form_data = new FormData(this); //Encode form elements for submission - console.log(post_url); - $.ajax({ - url: post_url, - type: request_method, - data: form_data, - headers: { - "Accept": 'application/json' - }, - contentType: false, - processData: false - }).done(function (response, textStatus, jqXHR) { - $('#modal_instance_new_action').modal('hide'); - bootbox.alert({ - title: "Metric", - message: "Metric exported." - }); - }).fail(function (result) { - var data = result.responseJSON; - var title = "Error " + (data.code ? data.code : 'unknown'); - var message = data.detail ? data.detail : 'No detail available.'; - bootbox.alert({ - title: title, - message: message - }); - }); - }); - }); \ No newline at end of file