dhlaluku closed pull request #2818: Remote diagnosis ui
URL: https://github.com/apache/cloudstack/pull/2818
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ui/l10n/en.js b/ui/l10n/en.js
index e16031d9e8a..318c7af496f 100644
--- a/ui/l10n/en.js
+++ b/ui/l10n/en.js
@@ -276,6 +276,7 @@ var dictionary = {
 "label.action.restore.instance.processing":"Restoring Instance....",
 "label.action.revert.snapshot":"Revert to Snapshot",
 "label.action.revert.snapshot.processing":"Reverting to Snapshot...",
+"label.action.run.diagnostics":"Run Diagnostics"
 "label.action.secure.host":"Provision Host Security Keys",
 "label.action.start.instance":"Start Instance",
 "label.action.start.instance.processing":"Starting Instance....",
@@ -1484,6 +1485,9 @@ var dictionary = {
 "label.rule.number":"Rule Number",
 "label.rule.number.short": "#Rule",
 "label.rules":"Rules",
+"label.run.diagnostics.type":"Type",
+"label.run.diagnostics.destination":"Destination",
+"label.run.diagnostics.extra":"Extra Args",
 "label.running.vms":"Running VMs",
 "label.s3.access_key":"Access Key",
 "label.s3.bucket":"Bucket",
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 962c38e772b..42f78cbce6b 100755
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8857,6 +8857,75 @@
                                                         }
                                                     },
 
+                                                    diagnostics: {
+                                                        label: 
'label.action.run.diagnostics',
+//                                                        messages: {
+//                                                            notification: 
function (args) {
+//                                                                return 
'label.action.migrate.systemvm';
+//                                                            }
+//                                                        },
+//                                                        isHidden: function 
(args) {
+//                                                            return 
!isAdmin();
+//                                                        },
+                                                        createForm: {
+                                                            title: 
'label.action.run.diagnostics',
+                                                            desc: '',
+                                                            fields: {
+                                                                type: {
+                                                                    label: 
'label.run.diagnostics.type',
+                                                                    
validation: {
+                                                                        
required: true
+                                                                    },
+                                                                    select: 
function (args) {
+                                                                        var 
items = [];
+                                                                        
items.push({
+                                                                            
id: "ping",
+                                                                            
description: "Ping"
+                                                                        });
+                                                                        
items.push({
+                                                                            
id: "traceroute",
+                                                                            
description: "Traceroute"
+                                                                        });
+                                                                        
items.push({
+                                                                            
id: "arping",
+                                                                            
description: "Arping"
+                                                                        });
+                                                                        
args.response.success({
+                                                                            
data: items
+                                                                        });
+                                                                    }
+                                                                },
+                                                                destination: {
+                                                                    label: 
'label.run.diagnostics.destination',
+                                                                    
validation: {
+                                                                        
required: true
+                                                                    }
+                                                                },
+                                                                extra: {
+                                                                    label: 
'label.run.diagnostics.extra'
+                                                                }
+
+                                                            }
+                                                        },
+                                                        action: function 
(args) {
+                                                            $.ajax({
+                                                                url: 
createURL("runDiagnostics&targetid=" + args.data.id + "&ipaddress=" + 
args.data.destination + "&type=" + args.data.type + "&params=" + 
args.data.extra),
+                                                                dataType: 
"json",
+                                                                async: false,
+                                                                success: 
function(json) {
+                                                                    var item = 
json.rundiagnosticsresponse.exitCode;
+                                                                    
args.response.success({
+                                                                        data: 
item
+                                                                    });
+                                                                },
+                                                                error: 
function(json) {
+                                                                    
args.response.error(parseXMLHttpResponse(json));
+                                                                }
+                                                            }); //end ajax
+                                                        }
+                                                        //notification? nah
+                                                    },
+
                                                     scaleUp: {
                                                         label: 
'label.change.service.offering',
                                                         createForm: {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to