operation history fix 93/6893/4
authorlombardofr <lombardo@everyup.it>
Fri, 16 Nov 2018 08:44:36 +0000 (09:44 +0100)
committerlombardofr <lombardo@everyup.it>
Mon, 19 Nov 2018 14:12:58 +0000 (15:12 +0100)
Change-Id: I6d743f1a19558b3ad69293d8d055213a351b2796
Signed-off-by: lombardofr <lombardo@everyup.it>
instancehandler/template/instance_list.html
instancehandler/template/instance_operations_list.html
static/TopologyComposer/js/model_graph_editor.js
static/src/descriptorhandler/composer.js

index 97eac57..4ba6fe0 100644 (file)
                             '         <i class="fa fa-magic"></i> Exec NS Primitive</a></li>' +
                             '     <li>' +
                             '         <a href="/instances/ns/' +row["_id"] +'/operation">' +
-                            '             <i class="fa fa-list"></i> Active operations</a></li>' +
+                            '             <i class="fa fa-list"></i> History of operations</a></li>' +
                             '     <li class="divider"></li>' +
                             '     <li><a href="#"' +
                             '            onclick="javascript:newAlarmNs(\''+ row["short-name"] +'\', \''+row["_id"]+'\')">' +
index 7e84658..c4b352f 100644 (file)
@@ -28,7 +28,7 @@
 {% block breadcrumb_body %}
     {{ block.super }}
     <li><a href="{% url 'instances:list'  type=type %}">Instances</a></li>
-    <li><a href="#">Operations</a></li>
+    <li><a href="#">History of Operations</a></li>
 {% endblock %}
 
 {% block content_body %}
@@ -40,7 +40,7 @@
 
             <div class="box">
                 <div class="box-header with-border">
-                    <h3 class="box-title">Active operations</h3>
+                    <h3 class="box-title">History of operations</h3>
 
                 </div>
                 <div class="box-body">
                 },
                 {
                     "render": function (data, type, row) {
-                        return row["startTime"];
+                        return moment.unix(row['startTime']).format('YYYY-MM-DD hh:mm:ss a')
                     },
                     "targets": 3
                 },
                 {
                     "render": function (data, type, row) {
-                        return row["statusEnteredTime"];
+                        return moment.unix(row['statusEnteredTime']).format('YYYY-MM-DD hh:mm:ss a')
                     },
                     "targets": 4
                 },
index fd80822..4afc955 100644 (file)
@@ -180,10 +180,12 @@ TCD3.ModelGraphEditor = (function () {
      * @returns {boolean}
      */
     ModelGraphEditor.prototype.updateDataNode = function (node, args, success, error) {
-        console.log(node)
+        console.log(node);
+        var self = this;
         var controller = new  TCD3.OsmController();
-        controller.updateNode(this,node, args, function(){
-
+        controller.updateNode(this,node, args, function(result){
+            self.updateData(result);
+            success && success();
         }, error);
     };
 
@@ -195,7 +197,7 @@ TCD3.ModelGraphEditor = (function () {
     ModelGraphEditor.prototype.updateGraphParams = function (args, success, error) {
         var controller = new  TCD3.OsmController();
         controller.updateGraphParams(args, function(){
-
+            success && success();
         }, error);
     };
 
index 175f46b..d56e22f 100644 (file)
@@ -72,13 +72,18 @@ $(document).ready(function () {
         form_data.forEach(function (value, key) {
             formDataJson[key] = value;
         });
+        var dialog = bootbox.dialog({
+            message: '<div class="text-center"><i class="fa fa-spin fa-spinner"></i> Updating...</div>',
+            closeButton: true
+        });
         if (graph_editor._selected_node) {
             graph_editor.updateDataNode(graph_editor._selected_node, formDataJson, function () {
-
+                dialog.modal('hide');
             }, function (result) {
                 var data = result.responseJSON;
                 var title = "Error " + (data && data.code ? data.code : 'unknown');
                 var message = data && data.detail ? data.detail : 'No detail available.';
+                dialog.modal('hide');
                 bootbox.alert({
                     title: title,
                     message: message
@@ -86,11 +91,12 @@ $(document).ready(function () {
             })
         } else {
             graph_editor.updateGraphParams(formDataJson, function () {
-
+                dialog.modal('hide');
             }, function (result) {
                 var data = result.responseJSON;
                 var title = "Error " + (data && data.code ? data.code : 'unknown');
                 var message = data && data.detail ? data.detail : 'No detail available.';
+                dialog.modal('hide');
                 bootbox.alert({
                     title: title,
                     message: message