bug 12806

After configuring swift, disable (hide) swift button after leaving
zone page. Note that the button will still be visble until them, in
case the user needs to re-configure (i.e., because of a typo)

status 12806: resolved fixed
This commit is contained in:
bfederle 2012-02-01 10:38:48 -08:00
parent ea512c2829
commit df8553b807
2 changed files with 26 additions and 3 deletions

View File

@ -119,6 +119,21 @@
}
});
if (userValid && isAdmin()) {
$.ajax({
url: createURL("listSwifts"),
dataType: "json",
async: false,
success: function(json) {
var items = json.listswiftsresponse.swift;
if(items != null && items.length > 0)
havingSwift = true;
}
});
} else {
havingSwift = false;
}
return userValid ? {
user: {
userid: g_userid,
@ -233,7 +248,7 @@
dataType: "json",
async: false,
success: function(json) {
var items = json.ListSwiftresponse.swift;
var items = json.listswiftsresponse.swift;
if(items != null && items.length > 0)
havingSwift = true;
}

View File

@ -2905,9 +2905,9 @@
enableSwift: {
label: 'Configure Swift',
isHeader: true,
addRow: false,
preFilter: function(args) {
var swiftEnabled = false;
$.ajax({
url: createURL('listConfigurations'),
data: {
@ -2915,8 +2915,16 @@
},
async: false,
success: function(json) {
swiftEnabled = json.listconfigurationsresponse.configuration[0].value == 'true' ?
swiftEnabled = json.listconfigurationsresponse.configuration[0].value == 'true' && !havingSwift ?
true : false;
cloudStack.dialog.notice({
message: 'Swift configured. Note: When you leave this page, you will not be able to re-configure Swift again.'
});
},
error: function(json) {
cloudStack.dialog.notice({ message: parseXMLHttpResponse(json) });
}
});