mirror of https://github.com/apache/cloudstack.git
zone page - remove obsolete code (secondary storage tab).
This commit is contained in:
parent
63220aa74c
commit
65707fe7d1
182
ui/jsp/zone.jsp
182
ui/jsp/zone.jsp
|
|
@ -21,11 +21,7 @@
|
|||
</div>
|
||||
<div class="tabbox" style="margin-top: 15px;">
|
||||
<div class="content_tabs on" id="tab_details">
|
||||
<%=t.t("details")%></div>
|
||||
<!--
|
||||
<div class="content_tabs off" id="tab_secondarystorage">
|
||||
Secondary Storage</div>
|
||||
-->
|
||||
<%=t.t("details")%></div>
|
||||
<!--
|
||||
<div class="content_tabs off" id="tab_network">
|
||||
Network </div>
|
||||
|
|
@ -189,22 +185,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- Details tab (end)-->
|
||||
|
||||
<!-- Secondary Storage tab (start)-->
|
||||
<div id="tab_content_secondarystorage" style="display: none">
|
||||
<div id="tab_spinning_wheel" class="rightpanel_mainloader_panel" style="display: none;">
|
||||
<div class="rightpanel_mainloaderbox">
|
||||
<div class="rightpanel_mainloader_animatedicon">
|
||||
</div>
|
||||
<p>
|
||||
Loading …</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab_container">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Secondary Storage tab (end)-->
|
||||
|
||||
|
||||
<!-- Network tab (start)-->
|
||||
<div style="display: none;" id="tab_content_network">
|
||||
<div id="tab_spinning_wheel" class="rightpanel_mainloader_panel" style="display: none;">
|
||||
|
|
@ -287,15 +268,6 @@
|
|||
Add Primary Storage
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actionpanel_button_wrapper" id="add_secondarystorage_button">
|
||||
<div class="actionpanel_button">
|
||||
<div class="actionpanel_button_icons">
|
||||
<img src="images/addvm_actionicon.png" /></div>
|
||||
<div class="actionpanel_button_links">
|
||||
Add Secondary Storage
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="actionpanel_button_wrapper" id="add_vlan_button" style="display: none;">
|
||||
|
|
@ -399,48 +371,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- Add Pod Dialog (end) -->
|
||||
<!-- Add Secondary Storage Dialog (begin) -->
|
||||
<div id="dialog_add_secondarystorage" title="Add Secondary Storage" style="display: none">
|
||||
<p>
|
||||
Add a new storage for zone <b><span id="zone_name"></span></b>
|
||||
</p>
|
||||
<div class="dialog_formcontent">
|
||||
<form action="#" method="post" id="form1">
|
||||
<ol>
|
||||
<li>
|
||||
<label>
|
||||
NFS Server:</label>
|
||||
<input class="text" type="text" name="nfs_server" id="nfs_server" />
|
||||
<div id="nfs_server_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="path">
|
||||
Path:</label>
|
||||
<input class="text" type="text" name="path" id="path" />
|
||||
<div id="path_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</form>
|
||||
</div>
|
||||
<!--Loading box-->
|
||||
<div id="spinning_wheel" class="ui_dialog_loaderbox" style="display: none;">
|
||||
<div class="ui_dialog_loader">
|
||||
</div>
|
||||
<p>
|
||||
Adding....</p>
|
||||
</div>
|
||||
<!--Confirmation msg box-->
|
||||
<!--Note: for error msg, just have to add error besides everything for eg. add error(class) next to ui_dialog_messagebox error, ui_dialog_msgicon error, ui_dialog_messagebox_text error. -->
|
||||
<div id="info_container" class="ui_dialog_messagebox error" style="display: none;">
|
||||
<div id="icon" class="ui_dialog_msgicon error">
|
||||
</div>
|
||||
<div id="info" class="ui_dialog_messagebox_text error">
|
||||
(info)</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Add Secondary Storage Dialog (end) -->
|
||||
|
||||
<!-- Add VLAN IP Range Dialog for zone (begin) -->
|
||||
<div id="dialog_add_vlan_for_zone" title="Add VLAN IP Range" style="display: none">
|
||||
<p>
|
||||
|
|
@ -950,110 +881,3 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- VLAN Template (end) -->
|
||||
<!-- secondary storage tab template (begin) -->
|
||||
<div class="grid_container" id="secondary_storage_tab_template" style="display: none">
|
||||
<div class="grid_header">
|
||||
<div class="grid_header_title" id="title">
|
||||
</div>
|
||||
<div class="grid_actionbox" id="secondarystorage_action_link"> <p>Actions</p>
|
||||
<div class="grid_actionsdropdown_box" id="secondarystorage_action_menu" style="display: none;">
|
||||
<ul class="actionsdropdown_boxlist" id="action_list">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gridheader_loaderbox" id="spinning_wheel" style="display: none; height: 18px;">
|
||||
<div class="gridheader_loader" id="icon">
|
||||
</div>
|
||||
<p id="description">
|
||||
Waiting …
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows" id="after_action_info_container" style="display: none">
|
||||
<div class="grid_row_cell" style="width: 90%; border: none;">
|
||||
<div class="row_celltitles">
|
||||
<strong id="after_action_info">Message will appear here</strong></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows even">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
ID:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="id">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows odd">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
Name:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows even">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("zone")%>:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="zonename">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows odd">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("type")%>:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="type">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows even">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("ip.address")%>:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="ipaddress">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows odd">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("state")%>:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="state">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows even">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("version")%>:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="version">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows odd">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("last.disconnected")%>:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="disconnected">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- secondary storage tab template (end) -->
|
||||
|
|
@ -152,4 +152,51 @@ function doDeleteSecondaryStorage($actionLink, $detailsTab, $midmenuItem1) {
|
|||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
|
||||
function bindAddSecondaryStorageButton(zoneObj) {
|
||||
$("#add_secondarystorage_button").unbind("click").bind("click", function(event) {
|
||||
$("#dialog_add_secondarystorage").find("#zone_name").text(fromdb(zoneObj.name));
|
||||
$("#dialog_add_secondarystorage").find("#info_container").hide();
|
||||
|
||||
$("#dialog_add_secondarystorage")
|
||||
.dialog('option', 'buttons', {
|
||||
"Add": function() {
|
||||
var $thisDialog = $(this);
|
||||
|
||||
// validate values
|
||||
var isValid = true;
|
||||
isValid &= validateString("NFS Server", $thisDialog.find("#nfs_server"), $thisDialog.find("#nfs_server_errormsg"));
|
||||
isValid &= validatePath("Path", $thisDialog.find("#path"), $thisDialog.find("#path_errormsg"));
|
||||
if (!isValid)
|
||||
return;
|
||||
|
||||
$thisDialog.find("#spinning_wheel").show();
|
||||
|
||||
var zoneId = zoneObj.id;
|
||||
var nfs_server = trim($thisDialog.find("#nfs_server").val());
|
||||
var path = trim($thisDialog.find("#path").val());
|
||||
var url = nfsURL(nfs_server, path);
|
||||
|
||||
$.ajax({
|
||||
data: createURL("command=addSecondaryStorage&zoneId="+zoneId+"&url="+todb(url)),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
$thisDialog.find("#spinning_wheel").hide();
|
||||
$thisDialog.dialog("close");
|
||||
$("#zone_"+zoneId).find("#secondarystorage_header").click();
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
|
@ -24,15 +24,14 @@
|
|||
|
||||
initDialog("dialog_add_external_cluster_in_zone_page", 320);
|
||||
initDialog("dialog_add_pod", 370);
|
||||
initDialog("dialog_add_vlan_for_zone");
|
||||
initDialog("dialog_add_secondarystorage");
|
||||
initDialog("dialog_add_vlan_for_zone");
|
||||
initDialog("dialog_add_host_in_zone_page");
|
||||
initDialog("dialog_add_pool_in_zone_page");
|
||||
|
||||
//switch between different tabs in zone page
|
||||
var tabArray = [$("#tab_details"), $("#tab_secondarystorage"), $("#tab_network")];
|
||||
var tabContentArray = [$("#tab_content_details"), $("#tab_content_secondarystorage"), $("#tab_content_network")];
|
||||
var afterSwitchFnArray = [zoneJsonToDetailsTab, zoneJsonToSecondaryStorageTab, zoneJsonToNetworkTab];
|
||||
var tabArray = [$("#tab_details"), $("#tab_network")];
|
||||
var tabContentArray = [$("#tab_content_details"), $("#tab_content_network")];
|
||||
var afterSwitchFnArray = [zoneJsonToDetailsTab, zoneJsonToNetworkTab];
|
||||
switchBetweenDifferentTabs(tabArray, tabContentArray, afterSwitchFnArray);
|
||||
|
||||
$readonlyFields = $("#tab_content_details").find("#name, #dns1, #dns2, #internaldns1, #internaldns2, #vlan, #guestcidraddress");
|
||||
|
|
@ -54,8 +53,7 @@ function zoneJsonToRightPanel($leftmenuItem1) {
|
|||
bindEventHandlerToDialogAddVlanForZone();
|
||||
|
||||
bindAddPodButton($("#add_pod_button"), $leftmenuItem1);
|
||||
//bindAddVLANButton($("#add_vlan_button"), $leftmenuItem1);
|
||||
bindAddSecondaryStorageButton($leftmenuItem1.data("jsonObj"));
|
||||
//bindAddVLANButton($("#add_vlan_button"), $leftmenuItem1);
|
||||
|
||||
var pods;
|
||||
var zoneObj = $leftmenuItem1.data("jsonObj");
|
||||
|
|
@ -81,8 +79,7 @@ function zoneJsonToRightPanel($leftmenuItem1) {
|
|||
|
||||
function zoneJsonClearRightPanel() {
|
||||
zoneJsonClearDetailsTab();
|
||||
zoneJsonClearNetworkTab();
|
||||
zoneJsonClearSecondaryStorageTab();
|
||||
zoneJsonClearNetworkTab();
|
||||
}
|
||||
|
||||
function zoneJsonToDetailsTab() {
|
||||
|
|
@ -212,44 +209,6 @@ function zoneJsonClearDetailsTab() {
|
|||
$actionMenu.find("#action_list").append($("#no_available_actions").clone().show());
|
||||
}
|
||||
|
||||
function zoneJsonToSecondaryStorageTab() {
|
||||
var $leftmenuItem1 = $("#right_panel_content").data("$leftmenuItem1");
|
||||
if($leftmenuItem1 == null)
|
||||
return;
|
||||
|
||||
var jsonObj = $leftmenuItem1.data("jsonObj");
|
||||
if(jsonObj == null)
|
||||
return;
|
||||
|
||||
var $thisTab = $("#right_panel_content").find("#tab_content_secondarystorage");
|
||||
$thisTab.find("#tab_container").hide();
|
||||
$thisTab.find("#tab_spinning_wheel").show();
|
||||
|
||||
$.ajax({
|
||||
cache: false,
|
||||
data: createURL("command=listHosts&type=SecondaryStorage&zoneid="+jsonObj.id),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var items = json.listhostsresponse.host;
|
||||
var $container = $thisTab.find("#tab_container").empty();
|
||||
if (items != null && items.length > 0) {
|
||||
var $template = $("#secondary_storage_tab_template");
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
var $newTemplate = $template.clone(true);
|
||||
secondaryStorageJSONToTemplate(items[i], $newTemplate);
|
||||
$container.append($newTemplate.show());
|
||||
}
|
||||
}
|
||||
$thisTab.find("#tab_spinning_wheel").hide();
|
||||
$thisTab.find("#tab_container").show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function zoneJsonClearSecondaryStorageTab() {
|
||||
$("#right_panel_content").find("#tab_content_secondarystorage").empty();
|
||||
}
|
||||
|
||||
var $vlanContainer;
|
||||
function zoneJsonToNetworkTab(jsonObj) {
|
||||
var $leftmenuItem1 = $("#right_panel_content").data("$leftmenuItem1");
|
||||
|
|
@ -583,54 +542,6 @@ function bindAddVLANButton($button, $leftmenuItem1) {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
function bindAddSecondaryStorageButton(zoneObj) {
|
||||
$("#add_secondarystorage_button").unbind("click").bind("click", function(event) {
|
||||
$("#dialog_add_secondarystorage").find("#zone_name").text(fromdb(zoneObj.name));
|
||||
$("#dialog_add_secondarystorage").find("#info_container").hide();
|
||||
|
||||
$("#dialog_add_secondarystorage")
|
||||
.dialog('option', 'buttons', {
|
||||
"Add": function() {
|
||||
var $thisDialog = $(this);
|
||||
|
||||
// validate values
|
||||
var isValid = true;
|
||||
isValid &= validateString("NFS Server", $thisDialog.find("#nfs_server"), $thisDialog.find("#nfs_server_errormsg"));
|
||||
isValid &= validatePath("Path", $thisDialog.find("#path"), $thisDialog.find("#path_errormsg"));
|
||||
if (!isValid)
|
||||
return;
|
||||
|
||||
$thisDialog.find("#spinning_wheel").show();
|
||||
|
||||
var zoneId = zoneObj.id;
|
||||
var nfs_server = trim($thisDialog.find("#nfs_server").val());
|
||||
var path = trim($thisDialog.find("#path").val());
|
||||
var url = nfsURL(nfs_server, path);
|
||||
|
||||
$.ajax({
|
||||
data: createURL("command=addSecondaryStorage&zoneId="+zoneId+"&url="+todb(url)),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
$thisDialog.find("#spinning_wheel").hide();
|
||||
$thisDialog.dialog("close");
|
||||
$("#zone_"+zoneId).find("#secondarystorage_header").click();
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function bindAddPodButton($button, $leftmenuItem1) {
|
||||
$button.unbind("click").bind("click", function(event) {
|
||||
var zoneObj = $leftmenuItem1.data("jsonObj");
|
||||
|
|
@ -763,38 +674,6 @@ function bindAddPodButton($button, $leftmenuItem1) {
|
|||
});
|
||||
}
|
||||
|
||||
function secondaryStorageJSONToTemplate(json, template) {
|
||||
template.data("jsonObj", json);
|
||||
template.attr("id", "secondaryStorage_"+json.id).data("secondaryStorageId", json.id);
|
||||
template.find("#id").text(json.id);
|
||||
template.find("#title").text(fromdb(json.name));
|
||||
template.find("#name").text(fromdb(json.name));
|
||||
template.find("#zonename").text(fromdb(json.zonename));
|
||||
template.find("#type").text(json.type);
|
||||
template.find("#ipaddress").text(json.ipaddress);
|
||||
|
||||
setHostStateInRightPanel(fromdb(json.state), template.find("#state"))
|
||||
|
||||
template.find("#version").text(json.version);
|
||||
setDateField(json.disconnected, template.find("#disconnected"));
|
||||
|
||||
var $actionLink = template.find("#secondarystorage_action_link");
|
||||
$actionLink.bind("mouseover", function(event) {
|
||||
$(this).find("#secondarystorage_action_menu").show();
|
||||
return false;
|
||||
});
|
||||
$actionLink.bind("mouseout", function(event) {
|
||||
$(this).find("#secondarystorage_action_menu").hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
var $actionMenu = $actionLink.find("#secondarystorage_action_menu");
|
||||
$actionMenu.find("#action_list").empty();
|
||||
|
||||
buildActionLinkForSubgridItem("Delete Secondary Storage", secondarystorageActionMap, $actionMenu, template);
|
||||
}
|
||||
|
||||
|
||||
function bindEventHandlerToDialogAddVlanForZone() {
|
||||
//direct VLAN shows only "tagged" option while public VLAN shows both "tagged" and "untagged" option.
|
||||
var dialogAddVlanForZone = $("#dialog_add_vlan_for_zone");
|
||||
|
|
|
|||
Loading…
Reference in New Issue