mirror of https://github.com/apache/cloudstack.git
bug 6545: Global Settings page - mask value for configuration whose name contains "password" word.
This commit is contained in:
parent
f932ebf58f
commit
45b1867367
|
|
@ -70,27 +70,51 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- global setting grid template (begin) -->
|
||||
|
||||
<div id="globalsetting_template" class="grid_rows even" style="display:none; position:none;">
|
||||
<div class="grid_row_cell" style="width: 35%; border:none;">
|
||||
<div class="row_celltitles" id="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 23%; border:none; padding:1px;">
|
||||
<div class="row_celltitles" id="value">
|
||||
</div>
|
||||
<input class="text" id="value_edit" style="width: 120px; display: none;" type="text" />
|
||||
<div id="value_edit_errormsg">
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 40%; border:none;">
|
||||
<div class="row_celltitles" id="description">description
|
||||
</div>
|
||||
<!-- global setting grid template - text type (begin) -->
|
||||
<div id="globalsetting_template_text" class="grid_rows even" style="display: none; position: none;">
|
||||
<div class="grid_row_cell" style="width: 35%; border: none;">
|
||||
<div class="row_celltitles" id="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 23%; border: none; padding: 1px;">
|
||||
<div class="row_celltitles" id="value">
|
||||
</div>
|
||||
<input class="text" id="value_edit" style="width: 120px; display: none;" type="text" />
|
||||
<div id="value_edit_errormsg">
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 40%; border: none;">
|
||||
<div class="row_celltitles" id="description">
|
||||
description
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- global setting grid template - text type (end) -->
|
||||
|
||||
<!-- global setting grid template (end) -->
|
||||
<!-- global setting grid template - password type (begin) -->
|
||||
<div id="globalsetting_template_password" class="grid_rows even" style="display: none; position: none;">
|
||||
<div class="grid_row_cell" style="width: 35%; border: none;">
|
||||
<div class="row_celltitles" id="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 23%; border: none; padding: 1px;">
|
||||
<div class="row_celltitles" id="value" style="display:none">
|
||||
</div>
|
||||
<div class="row_celltitles" id="password_mask">
|
||||
********
|
||||
</div>
|
||||
<input class="text" id="value_edit" style="width: 120px; display: none;" type="password" />
|
||||
<div id="value_edit_errormsg">
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 40%; border: none;">
|
||||
<div class="row_celltitles" id="description">
|
||||
description
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- global setting grid template - password type (end) -->
|
||||
|
||||
<div id="dialog_alert_restart_management_server" title="Alert" style="display:none">
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -44,10 +44,15 @@ function populateGlobalSettingGrid() {
|
|||
success: function(json) {
|
||||
var items = json.listconfigurationsresponse.configuration;
|
||||
$container = $("#tab_content_details").find("#grid_content").empty();
|
||||
$template = $("#globalsetting_template");
|
||||
$templateText = $("#globalsetting_template_text");
|
||||
$templatePassword = $("#globalsetting_template_password");
|
||||
if(items != null && items.length > 0) {
|
||||
for(var i=0; i<items.length; i++) {
|
||||
var $newTemplate = $template.clone();
|
||||
var $newTemplate;
|
||||
if(items[i].name.toLowerCase().indexOf("password") == -1)
|
||||
$newTemplate = $templateText.clone();
|
||||
else
|
||||
$newTemplate = $templatePassword.clone();
|
||||
globalsettingJSONToTemplate(items[i], $newTemplate);
|
||||
$container.append($newTemplate.show());
|
||||
}
|
||||
|
|
@ -69,7 +74,7 @@ function globalsettingJSONToTemplate(jsonObj, template) {
|
|||
|
||||
function doEditGlobalSetting() {
|
||||
var $detailsTab = $("#right_panel_content #tab_content_details");
|
||||
var $readonlyFields = $detailsTab.find("#value");
|
||||
var $readonlyFields = $detailsTab.find("#globalsetting_template_text #value, #globalsetting_template_password #password_mask");
|
||||
var $editFields = $detailsTab.find("#value_edit");
|
||||
|
||||
$readonlyFields.hide();
|
||||
|
|
@ -89,7 +94,9 @@ function doEditGlobalSetting() {
|
|||
}
|
||||
|
||||
function doEditGlobalSetting2($readonlyFields, $editFields) {
|
||||
$("#right_panel_content #tab_content_details").find("#globalsetting_template").each(function(index) {
|
||||
var isChanged = false;
|
||||
|
||||
$("#right_panel_content #tab_content_details").find("#globalsetting_template_text,#globalsetting_template_password").each(function(index) {
|
||||
var $thisRow =$(this);
|
||||
|
||||
if($thisRow.find("#value_edit").val() != $thisRow.find("#value").text()) {
|
||||
|
|
@ -109,14 +116,16 @@ function doEditGlobalSetting2($readonlyFields, $editFields) {
|
|||
success: function(json) {
|
||||
var jsonObj = json.updateconfigurationresponse.configuration;
|
||||
globalsettingJSONToTemplate(jsonObj, $thisRow);
|
||||
|
||||
$editFields.hide();
|
||||
$readonlyFields.show();
|
||||
$("#save_button, #cancel_button").hide();
|
||||
|
||||
$("#dialog_alert_restart_management_server").dialog("open");
|
||||
isChanged = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$editFields.hide();
|
||||
$readonlyFields.show();
|
||||
$("#save_button, #cancel_button").hide();
|
||||
|
||||
if(isChanged == true)
|
||||
$("#dialog_alert_restart_management_server").dialog("open");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue