cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 74036d0
Date Mon, 20 Feb 2017 11:57:47 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master dafd3938f -> 74036d01c


CLOUDSTACK-9228: Network update with mistmatch in services require forced option

Added a confirmation dialog box to check whether to make force update or not.
The dialog appears only for the Admin. Only admin can make force update.
The new dialog appears after the first CIDR unchanged confirmation dialog.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c1bc47c1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c1bc47c1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c1bc47c1

Branch: refs/heads/master
Commit: c1bc47c10bd0df5cf8a430e00277a375892aad67
Parents: 13bfdd7
Author: Nitin Kumar Maharana <nitin.maharana@gmail.com>
Authored: Mon Jan 25 11:28:24 2016 +0530
Committer: Nitin Kumar Maharana <nitinkumar.maharana@accelerite.com>
Committed: Wed Feb 15 01:09:59 2017 +0530

----------------------------------------------------------------------
 ui/l10n/en.js         |   1 +
 ui/scripts/network.js | 119 +++++++++++++++++++++++++++++----------------
 2 files changed, 79 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1bc47c1/ui/l10n/en.js
----------------------------------------------------------------------
diff --git a/ui/l10n/en.js b/ui/l10n/en.js
index 136ca15..f25e0b7 100644
--- a/ui/l10n/en.js
+++ b/ui/l10n/en.js
@@ -1965,6 +1965,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
 "message.confirm.enable.provider":"Please confirm that you would like to enable this provider",
 "message.confirm.enable.vnmc.provider":"Please confirm you would like to enable the VNMC
provider.",
 "message.confirm.enable.vpc.offering":"Are you sure you want to enable this VPC offering?",
+"message.confirm.force.update":"Do you want to make a force update?",
 "message.confirm.join.project":"Please confirm you wish to join this project.",
 "message.confirm.migrate.volume":"Do you want to migrate this volume?",
 "message.confirm.refresh.blades":"Please confirm that you want to refresh blades.",

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1bc47c1/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 78c90e1..b224ece 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -965,53 +965,15 @@
                                         if (args.context.networks[0].type == "Isolated")
{ //Isolated network
                                             cloudStack.dialog.confirm({
                                                 message: 'message.confirm.current.guest.CIDR.unchanged',
-                                                action: function() { //"Yes"    button is
clicked
-                                                    $.extend(data, {
-                                                        changecidr: false
-                                                    });
-
-                                                    $.ajax({
-                                                        url: createURL('updateNetwork'),
-                                                        data: data,
-                                                        success: function(json) {
-                                                            var jid = json.updatenetworkresponse.jobid;
-                                                            args.response.success({
-                                                                _custom: {
-                                                                    jobId: jid,
-                                                                    getUpdatedItem: function(json)
{
-                                                                        var item = json.queryasyncjobresultresponse.jobresult.network;
-                                                                        return {
-                                                                            data: item
-                                                                        };
-                                                                    }
-                                                                }
-                                                            });
-                                                        }
-                                                    });
+                                                action: function() { //"Yes" button is clicked
+                                                    getForcedInfoAndUpdateNetwork(data);
                                                 },
                                                 cancelAction: function() { //"Cancel" button
is clicked
                                                     $.extend(data, {
                                                         changecidr: true
                                                     });
 
-                                                    $.ajax({
-                                                        url: createURL('updateNetwork'),
-                                                        data: data,
-                                                        success: function(json) {
-                                                            var jid = json.updatenetworkresponse.jobid;
-                                                            args.response.success({
-                                                                _custom: {
-                                                                    jobId: jid,
-                                                                    getUpdatedItem: function(json)
{
-                                                                        var item = json.queryasyncjobresultresponse.jobresult.network;
-                                                                        return {
-                                                                            data: item
-                                                                        };
-                                                                    }
-                                                                }
-                                                            });
-                                                        }
-                                                    });
+                                                    getForcedInfoAndUpdateNetwork(data);
                                                 }
                                             });
                                             return;
@@ -6735,4 +6697,79 @@
         return data;
     }
 
+    function getForcedInfoAndUpdateNetwork(data) {
+        if (isAdmin()) {
+            cloudStack.dialog.confirm({
+                message: "message.confirm.force.update",
+                action: function() {
+                    $.extend(data, {
+                        forced: true
+                    });
+
+                    $.ajax({
+                        url: createURL('updateNetwork'),
+                        async: false,
+                        data: data,
+                        success: function(json) {
+                            var jid = json.updatenetworkresponse.jobid;
+                            args.response.success({
+                                _custom: {
+                                    jobId: jid,
+                                    getUpdatedItem: function(json) {
+                                        var item = json.queryasyncjobresultresponse.jobresult.network;
+                                        return {
+                                            data: item
+                                        };
+                                    }
+                                }
+                            });
+                        }
+                    });
+                },
+                cancelAction: function() {
+                    $.ajax({
+                        url: createURL('updateNetwork'),
+                        async: false,
+                        data: data,
+                        success: function(json) {
+                            var jid = json.updatenetworkresponse.jobid;
+                            args.response.success({
+                                _custom: {
+                                    jobId: jid,
+                                    getUpdatedItem: function(json) {
+                                        var item = json.queryasyncjobresultresponse.jobresult.network;
+                                        return {
+                                            data: item
+                                        };
+                                    }
+                                }
+                            });
+                        }
+                    });
+                }
+            });
+        }
+        else {
+            $.ajax({
+                url: createURL('updateNetwork'),
+                async: false,
+                data: data,
+                success: function(json) {
+                    var jid = json.updatenetworkresponse.jobid;
+                    args.response.success({
+                        _custom: {
+                            jobId: jid,
+                            getUpdatedItem: function(json) {
+                                var item = json.queryasyncjobresultresponse.jobresult.network;
+                                return {
+                                    data: item
+                                };
+                            }
+                        }
+                    });
+                }
+            });
+        }
+    }
+
 })(cloudStack, jQuery);


Mime
View raw message