From cb6f1b619feb971f9c879b687e8c07cd9b46e39f Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 11 Jan 2012 14:38:10 -0800 Subject: [PATCH] bug 12910: cloudstack 3.0 new UI - network page - restart network - add checkbox "Clean up" on dialog box. --- ui/scripts/network.js | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 7fda00a1243..d90a526518b 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -302,10 +302,31 @@ }, 'restart': { - label: 'Restart network', - action: function(args) { + label: 'Restart network', + createForm: { + title: 'Restart network', + desc: 'Please confirm that you want to restart network', + fields: { + cleanup: { + label: 'Clean up', + isBoolean: true, + isChecked: false + } + } + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want to restart network'; + }, + notification: function(args) { + return 'Restarting network'; + } + }, + action: function(args) { + var array1 = []; + array1.push("&cleanup=" + (args.data.cleanup == "on")); $.ajax({ - url: createURL("restartNetwork&cleanup=true&id=" + args.context.networks[0].id), + url: createURL("restartNetwork&id=" + args.context.networks[0].id + array1.join("")), dataType: "json", async: true, success: function(json) { @@ -321,15 +342,7 @@ ); } }); - }, - messages: { - confirm: function(args) { - return 'Please confirm that you want to restart network'; - }, - notification: function(args) { - return 'Restarting network'; - } - }, + }, notification: { poll: pollAsyncJobResult }