mirror of https://github.com/apache/cloudstack.git
bug 7861: add JavaScript file, JSP file for secondary storage page.
This commit is contained in:
parent
6ebbff60f4
commit
c0b520c596
|
|
@ -0,0 +1,93 @@
|
|||
<%@ page import="java.util.*" %>
|
||||
<%@ page import="com.cloud.utils.*" %>
|
||||
|
||||
<%
|
||||
Locale browserLocale = request.getLocale();
|
||||
CloudResourceBundle t = CloudResourceBundle.getBundle("resources/resource", browserLocale);
|
||||
%>
|
||||
|
||||
<div class="main_title" id="right_panel_header">
|
||||
|
||||
<div class="main_titleicon">
|
||||
<img src="images/title_secondarystorageicon.gif"/></div>
|
||||
|
||||
<h1>Secondary Storage
|
||||
</h1>
|
||||
</div>
|
||||
<div class="contentbox" id="right_panel_content">
|
||||
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||
<p id="after_action_info">
|
||||
</p>
|
||||
</div>
|
||||
<div class="tabbox" style="margin-top:15px;">
|
||||
<div class="content_tabs on">
|
||||
<%=t.t("Details")%></div>
|
||||
</div>
|
||||
<div id="tab_content_details">
|
||||
<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 class="grid_container">
|
||||
<div class="grid_header">
|
||||
<div id="grid_header_title" class="grid_header_title">
|
||||
(title)</div>
|
||||
<div class="grid_actionbox" id="action_link"><p>Actions</p>
|
||||
<div class="grid_actionsdropdown_box" id="action_menu" style="display: none;">
|
||||
<ul class="actionsdropdown_boxlist" id="action_list">
|
||||
<li>
|
||||
<%=t.t("no.available.actions")%></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gridheader_loaderbox" id="spinning_wheel" style="border: 1px solid #999;
|
||||
display: none;">
|
||||
<div class="gridheader_loader" id="icon">
|
||||
</div>
|
||||
<p id="description">
|
||||
Waiting …</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows odd">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("ID")%>:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="id">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows even">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("name")%>:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" id="name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- top buttons (begin) -->
|
||||
<div id="top_buttons">
|
||||
<div class="actionpanel_button_wrapper" id="add_secondarystorage_button">
|
||||
<div class="actionpanel_button">
|
||||
<div class="actionpanel_button_icons">
|
||||
<img src="images/addvm_actionicon.png" alt="Add Secondary Storage" /></div>
|
||||
<div class="actionpanel_button_links">
|
||||
Add Secondary Storage
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- top buttons (end) -->
|
||||
|
|
@ -114,6 +114,38 @@ function buildZoneTree() {
|
|||
return false;
|
||||
});
|
||||
|
||||
$("#secondarystorage_header").unbind("click").bind("click", function(event) {
|
||||
selectRowInZoneTree($(this));
|
||||
|
||||
clearMiddleMenu();
|
||||
hideMiddleMenu();
|
||||
|
||||
if(currentRightPanelJSP != "jsp/secondarystorage.jsp") {
|
||||
removeDialogs();
|
||||
|
||||
var $thisNode = $(this);
|
||||
$("#right_panel").load("jsp/secondarystorage.jsp", function(){
|
||||
currentRightPanelJSP = "jsp/secondarystorage.jsp";
|
||||
|
||||
/*
|
||||
$(this).data("onRefreshFn", function() {
|
||||
var zoneObj = $midmenuItem1.data("jsonObj");
|
||||
if(zoneObj == null)
|
||||
return;
|
||||
$("#zone_"+zoneObj.id).find("#secondarystorage_header").click();
|
||||
});
|
||||
*/
|
||||
|
||||
afterLoadSecondaryStorageJSP($thisNode);
|
||||
});
|
||||
}
|
||||
else {
|
||||
//secondarystoragePopulateMiddleMenu($(this));
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#network_header").unbind("click").bind("click", function(event) {
|
||||
selectRowInZoneTree($(this));
|
||||
|
||||
|
|
@ -308,8 +340,9 @@ function zoneJSONToTreeNode(jsonObj, $zoneNode) {
|
|||
var zoneid = jsonObj.id;
|
||||
$zoneNode.attr("id", "zone_" + zoneid);
|
||||
$zoneNode.data("jsonObj", jsonObj);
|
||||
$zoneNode.find("#secondarystorage_header").data("zoneObj", jsonObj);
|
||||
|
||||
if(jsonObj.networktype == "Advanced") {
|
||||
if(jsonObj.networktype == "Advanced") {
|
||||
$zoneNode.find("#network_header").show().data("jsonObj", jsonObj);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
|
||||
*
|
||||
* This software is licensed under the GNU General Public License v3 or later.
|
||||
*
|
||||
* It is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
function afterLoadSecondaryStorageJSP($midmenuItem1) {
|
||||
var $topButtonContainer = clearButtonsOnTop();
|
||||
$("#top_buttons").appendTo($topButtonContainer);
|
||||
|
||||
//initDialog("dialog_add_external_cluster_in_secondaryStorage_page", 320);
|
||||
|
||||
secondaryStorageRefreshDataBinding();
|
||||
}
|
||||
|
||||
function secondaryStorageRefreshDataBinding() {
|
||||
var $secondaryStorageNode = $selectedSubMenu;
|
||||
secondaryStorageJsonToRightPanel($secondaryStorageNode);
|
||||
}
|
||||
|
||||
function secondaryStorageJsonToRightPanel($midmenuItem1) {
|
||||
$("#right_panel_content").data("$midmenuItem1", $midmenuItem1);
|
||||
|
||||
/*
|
||||
bindEventHandlerToDialogAddVlanForZone();
|
||||
bindAddPodButton($("#add_pod_button"), $midmenuItem1);
|
||||
bindAddSecondaryStorageButton($("#add_secondarystorage_button"), $midmenuItem1);
|
||||
*/
|
||||
|
||||
secondaryStorageJsonToDetailsTab();
|
||||
}
|
||||
|
||||
function secondaryStorageJsonToDetailsTab() {
|
||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||
if($midmenuItem1 == null)
|
||||
return;
|
||||
|
||||
var zoneObj = $midmenuItem1.data("zoneObj");
|
||||
if(zoneObj == null)
|
||||
return;
|
||||
|
||||
var $thisTab = $("#right_panel_content").find("#tab_content_details");
|
||||
$thisTab.find("#tab_container").hide();
|
||||
$thisTab.find("#tab_spinning_wheel").show();
|
||||
|
||||
var jsonObj;
|
||||
$.ajax({
|
||||
data: createURL("command=listHosts&type=SecondaryStorage&zoneid="+zoneObj.id),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listhostsresponse.host;
|
||||
if(items != null && items.length > 0) {
|
||||
jsonObj = items[0];
|
||||
$midmenuItem1.data("jsonObj", jsonObj);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$thisTab.find("#id").text(fromdb(jsonObj.id));
|
||||
$thisTab.find("#grid_header_title").text(fromdb(jsonObj.name));
|
||||
$thisTab.find("#name").text(fromdb(jsonObj.name));
|
||||
|
||||
//actions ***
|
||||
var $actionLink = $thisTab.find("#action_link");
|
||||
$actionLink.bind("mouseover", function(event) {
|
||||
$(this).find("#action_menu").show();
|
||||
return false;
|
||||
});
|
||||
$actionLink.bind("mouseout", function(event) {
|
||||
$(this).find("#action_menu").hide();
|
||||
return false;
|
||||
});
|
||||
var $actionMenu = $thisTab.find("#action_link #action_menu");
|
||||
$actionMenu.find("#action_list").empty();
|
||||
//buildActionLinkForTab("Delete Secondary Storage", secondarystorageActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||
|
||||
$thisTab.find("#tab_spinning_wheel").hide();
|
||||
$thisTab.find("#tab_container").show();
|
||||
}
|
||||
|
||||
function secondaryStorageJsonClearRightPanel() {
|
||||
secondaryStorageJsonClearDetailsTab();
|
||||
}
|
||||
|
||||
function secondaryStorageJsonClearDetailsTab() {
|
||||
var $thisTab = $("#right_panel_content").find("#tab_content_details");
|
||||
$thisTab.find("#grid_header_title").text("");
|
||||
$thisTab.find("#id").text("");
|
||||
|
||||
$thisTab.find("#name").text("");
|
||||
|
||||
//actions ***
|
||||
var $actionMenu = $thisTab.find("#action_link #action_menu");
|
||||
$actionMenu.find("#action_list").empty();
|
||||
$actionMenu.find("#action_list").append($("#no_available_actions").clone().show());
|
||||
}
|
||||
Loading…
Reference in New Issue