mirror of https://github.com/apache/cloudstack.git
new UI - event page, alert page, account page, volume page, snapshot page - add 2nd row to middle menu item
This commit is contained in:
parent
19f7d75660
commit
daa01b9f75
|
|
@ -614,8 +614,8 @@ long milliseconds = new Date().getTime();
|
|||
|
||||
<div class="midmenu_list" id="midmenu_item" style="display: none;">
|
||||
<div class="midmenu_content" id="content">
|
||||
<div class="midmenu_icons" id="icon_container">
|
||||
<img id="icon" src="images/status_gray.png" /></div>
|
||||
<div class="midmenu_icons" id="icon_container" style="display:none">
|
||||
<img id="icon"/></div>
|
||||
<div class="midmenu_textbox">
|
||||
<p>
|
||||
<strong id="first_row"> </strong>
|
||||
|
|
|
|||
|
|
@ -58,16 +58,17 @@ $(document).ready(function() {
|
|||
});
|
||||
|
||||
|
||||
function jsonToMidmenu(jsonObj, $midmenuItem1, descriptionProperty, toRightPanelFn) {
|
||||
function jsonToMidmenu(jsonObj, $midmenuItem1, propertyForFirstRow, propertyForSecondRow, toRightPanelFn) {
|
||||
$midmenuItem1.attr("id", ("midmenuItem_"+jsonObj.id));
|
||||
$midmenuItem1.data("id", jsonObj.id);
|
||||
$midmenuItem1.data("jsonObj", jsonObj);
|
||||
$midmenuItem1.find("#first_row").text(jsonObj[descriptionProperty].substring(0,25));
|
||||
$midmenuItem1.find("#first_row").text(jsonObj[propertyForFirstRow].substring(0,25));
|
||||
$midmenuItem1.find("#second_row").text(jsonObj[propertyForSecondRow].substring(0,25));
|
||||
$midmenuItem1.data("toRightPanelFn", toRightPanelFn);
|
||||
}
|
||||
|
||||
var $midmenuItem = $("#midmenu_item");
|
||||
function listMidMenuItems(leftmenuId, apiName, jsonResponse1, jsonResponse2, descriptionProperty, rightPanelJSP, toRightPanelFn) {
|
||||
function listMidMenuItems(leftmenuId, apiName, jsonResponse1, jsonResponse2, propertyForFirstRow, propertyForSecondRow, rightPanelJSP, toRightPanelFn) {
|
||||
$("#"+leftmenuId).bind("click", function(event) {
|
||||
$("#right_panel").load(rightPanelJSP);
|
||||
|
||||
|
|
@ -81,12 +82,8 @@ $(document).ready(function() {
|
|||
if(items != null && items.length > 0) {
|
||||
for(var i=0; i<items.length;i++) {
|
||||
var item = items[i];
|
||||
var $midmenuItem1 = $midmenuItem.clone();
|
||||
|
||||
jsonToMidmenu(item, $midmenuItem1, descriptionProperty, toRightPanelFn);
|
||||
//$midmenuItem1.data("jsonObj", item);
|
||||
//$midmenuItem1.find("#description").text(item[descriptionProperty].substring(0,25));
|
||||
|
||||
var $midmenuItem1 = $midmenuItem.clone();
|
||||
jsonToMidmenu(item, $midmenuItem1, propertyForFirstRow, propertyForSecondRow, toRightPanelFn);
|
||||
$midmenuContainer.append($midmenuItem1.show());
|
||||
}
|
||||
}
|
||||
|
|
@ -96,11 +93,11 @@ $(document).ready(function() {
|
|||
return false;
|
||||
});
|
||||
}
|
||||
listMidMenuItems("leftmenu_event", "listEvents", "listeventsresponse", "event", "description", "jsp/event.jsp", loadEventToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_alert", "listAlerts", "listalertsresponse", "alert", "description", "jsp/alert.jsp", loadAlertToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_account", "listAccounts", "listaccountsresponse", "account", "name", "jsp/account.jsp", loadAccountToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_volume", "listVolumes", "listvolumesresponse", "volume", "name", "jsp/volume.jsp", loadVolumeToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_snapshot", "listSnapshots", "listsnapshotsresponse", "snapshot", "name", "jsp/snapshot.jsp", loadSnapshotToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_event", "listEvents", "listeventsresponse", "event", "description", "type", "jsp/event.jsp", loadEventToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_alert", "listAlerts", "listalertsresponse", "alert", "description", "type", "jsp/alert.jsp", loadAlertToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_account", "listAccounts", "listaccountsresponse", "account", "name", "domain", "jsp/account.jsp", loadAccountToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_volume", "listVolumes", "listvolumesresponse", "volume", "name", "type", "jsp/volume.jsp", loadVolumeToRigntPanelFn);
|
||||
listMidMenuItems("leftmenu_snapshot", "listSnapshots", "listsnapshotsresponse", "snapshot", "name", "volumename", "jsp/snapshot.jsp", loadSnapshotToRigntPanelFn);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -337,17 +337,20 @@ function clickInstanceGroupHeader($arrowIcon) {
|
|||
midmenuItem.find("#icon").attr("src", "images/status_gray.png");
|
||||
}
|
||||
|
||||
function vmJsonToMidmenu(json, $midmenuItem1) {
|
||||
$midmenuItem1.data("jsonObj", json);
|
||||
$midmenuItem1.data("toRightPanelFn", vmMidmenuToRightPanel);
|
||||
$midmenuItem1.attr("id", ("midmenuItemVm_"+json.id));
|
||||
$midmenuItem1.data("id", json.id);
|
||||
function vmJsonToMidmenu(json, $midmenuItem) {
|
||||
$midmenuItem.data("jsonObj", json);
|
||||
$midmenuItem.data("toRightPanelFn", vmMidmenuToRightPanel);
|
||||
$midmenuItem.attr("id", ("midmenuItemVm_"+json.id));
|
||||
$midmenuItem.data("id", json.id);
|
||||
|
||||
$midmenuItem.find("#icon").attr("src", "images/status_gray.png");
|
||||
$midmenuItem.find("#icon_container").show();
|
||||
var vmName = getVmName(json.name, json.displayname);
|
||||
$midmenuItem1.find("#first_row").text(vmName);
|
||||
$midmenuItem1.find("#second_row_label").text("IP Address:");
|
||||
$midmenuItem1.find("#second_row").text(json.ipaddress);
|
||||
updateVirtualMachineStateInMidMenu(json, $midmenuItem1);
|
||||
$midmenuItem1.bind("click", function(event) {
|
||||
$midmenuItem.find("#first_row").text(vmName);
|
||||
//$midmenuItem.find("#second_row_label").text("IP Address:");
|
||||
$midmenuItem.find("#second_row").text(json.ipaddress);
|
||||
updateVirtualMachineStateInMidMenu(json, $midmenuItem);
|
||||
$midmenuItem.bind("click", function(event) {
|
||||
var $t = $(this);
|
||||
vmMidmenuToRightPanel($t);
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue