modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDetailsView.java | 29 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 5 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/events/EventDetailsAction.java | 58 +- modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/events/data-plain.xhtml | 180 +++++++++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs-plain.xhtml | 123 ++++++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/measurement/data-plain.xhtml | 197 ++++++++++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml | 2 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/graphs-plain.xhtml | 19 9 files changed, 565 insertions(+), 50 deletions(-)
New commits: commit 03c0fa915be672fe82c8afd01c00e5ac1a5e6605 Author: Joseph Marques joseph@redhat.com Date: Thu Sep 23 20:57:46 2010 -0400
convert EventCompositeDetailsView into a singleton, update callers appropriately
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDetailsView.java index 343947b..3581a59 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDetailsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDetailsView.java @@ -45,31 +45,16 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; public class EventCompositeDetailsView extends VLayout implements BookmarkableView {
private int eventId; - private EventComposite composite; - private ViewId viewId;
- public EventCompositeDetailsView(int eventId) { - this.eventId = eventId; - } + private static EventCompositeDetailsView INSTANCE = new EventCompositeDetailsView();
- public EventCompositeDetailsView(EventComposite composite) { - this.composite = composite; + public static EventCompositeDetailsView getInstance() { + return INSTANCE; }
- @Override - protected void onDraw() { - super.onDraw(); - - for (Canvas child : getMembers()) { - child.destroy(); - } - - if (this.composite != null) { - show(composite); - } else { - show(eventId); - } + private EventCompositeDetailsView() { + // access through the static singleton only }
private void show(int eventId) { @@ -96,12 +81,10 @@ public class EventCompositeDetailsView extends VLayout implements BookmarkableVi }
if (this.viewId != null) { - viewId.getBreadcrumbs().get(0).setDisplayName("Event Details"); + viewId.getBreadcrumbs().get(0).setDisplayName("Details"); CoreGUI.refreshBreadCrumbTrail(); }
- this.composite = composite; - DynamicForm form = new DynamicForm(); form.setWidth100(); form.setHeight100(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java index b9434f0..d185f40 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java @@ -173,6 +173,6 @@ public class EventCompositeHistoryView extends TableSection {
@Override public Canvas getDetailsView(int eventId) { - return new EventCompositeDetailsView(eventId); + return EventCompositeDetailsView.getInstance(); } }
commit e17220ef6827775b472f95e1d81417d12d61f5f9 Author: Joseph Marques joseph@redhat.com Date: Thu Sep 23 20:57:41 2010 -0400
revert to old monitor>graphs page until new charting library chosen
* update embedded resource/group links * disabled embedded links to full-screen graph * update embedded links to event details
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 7236d4b..030eb2b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -53,7 +53,6 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.ResourceResourceGroupsView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.traits.TraitsView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView; @@ -213,7 +212,8 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo "/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()), true, true);
visible = hasMetricsOfType(this.resourceComposite, DataType.MEASUREMENT); - canvas = (visible) ? new GraphListView(this.monitoringTab.extendLocatorId("GraphListView"), resource) : null; + //canvas = (visible) ? new GraphListView(this.monitoringTab.extendLocatorId("GraphListView"), resource) : null; + canvas = (visible) ? new FullHTMLPane("/rhq/resource/monitor/graphs-plain.xhtml?id=" + resource.getId()) : null; updateSubTab(this.monitoringTab, this.monitorGraphs, canvas, visible, true); // visible = same test as above canvas = (visible) ? new FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId()) : null; @@ -221,6 +221,7 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo visible = hasMetricsOfType(this.resourceComposite, DataType.TRAIT); canvas = (visible) ? new TraitsView(this.monitoringTab.extendLocatorId("TraitsView"), resource.getId()) : null; updateSubTab(this.monitoringTab, this.monitorTraits, canvas, visible, true); + updateSubTab(this.monitoringTab, this.monitorAvail, new FullHTMLPane( "/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" + resource.getId()), true, true); updateSubTab(this.monitoringTab, this.monitorSched, new SchedulesView(monitoringTab diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/events/EventDetailsAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/events/EventDetailsAction.java index 8403297..df45f52 100755 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/events/EventDetailsAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/events/EventDetailsAction.java @@ -86,6 +86,7 @@ public class EventDetailsAction extends BaseAction { int groupId = WebUtility.getOptionalIntRequestParameter(request, ParamConstants.GROUP_ID_PARAM, -1); int parent = WebUtility.getOptionalIntRequestParameter(request, "parent", -1); int type = WebUtility.getOptionalIntRequestParameter(request, "type", -1); + String mode = WebUtility.getOptionalRequestParameter(request, "mode", "normal");
EventManagerLocal eventManager = LookupUtil.getEventManager();
@@ -124,7 +125,7 @@ public class EventDetailsAction extends BaseAction { } html.append(" ");
- createLinkForResource(resourceId, groupId, parent, type, html, event, ridBadChars(event + createLinkForResource(mode, resourceId, groupId, parent, type, html, event, ridBadChars(event .getEventDetail())); html.append("</li>"); } @@ -133,7 +134,7 @@ public class EventDetailsAction extends BaseAction { if (events.getTotalSize() > MAX_EVENTS_PER_DOT) { EventComposite event = events.get(events.size() - 1); // take the last one to initialize the list html.append("<p/>"); - createLinkForResource(resourceId, groupId, parent, type, html, event, res + createLinkForResource(mode, resourceId, groupId, parent, type, html, event, res .getMessage("resource.common.monitor.text.events.MoreEvents")); html.append("<p/>"); } @@ -149,30 +150,41 @@ public class EventDetailsAction extends BaseAction { return mapping.findForward(RetCodeConstants.SUCCESS_URL); }
- private void createLinkForResource(int resourceId, int groupId, int parent, int type, StringBuffer html, - EventComposite event, String text) { + private void createLinkForResource(String mode, int resourceId, int groupId, int parent, int type, + StringBuffer html, EventComposite event, String text) {
- //html.append("<a href="/resource/common/Events.do?mode=events&eventId="); - html.append("<a href="/rhq/resource/events/history.xhtml?eventId="); - html.append(event.getEventId()); - if (resourceId > -1) { - html.append("&id=").append(event.getResourceId()); - } else if (groupId > -1) { - html.append("&groupId=").append(groupId); + log.info("mode = " + mode); + if (mode.equals("plain")) { + String context = (resourceId > -1) ? "Resource/" : "ResourceGroup/"; + int contextId = (resourceId > -1) ? resourceId : groupId; + + html.append("<a target="_top" href="/coregui/CoreGUI.html#").append(context).append(contextId); + html.append("/Events/History/").append(event.getEventId()).append("">"); + html.append(text); + html.append("</a> "); } else { - html.append("&parent=").append(parent).append("&type=").append(type); - } - html.append("">"); - //html.append(event.getEventId()); - if (text.contains("\n")) { - text = text.substring(0, text.indexOf("\n")); - } - if (text.length() > DETAIL_MAX_LEN) { - text = text.substring(0, DETAIL_MAX_LEN - 1); + //html.append("<a href="/resource/common/Events.do?mode=events&eventId="); + html.append("<a href="/rhq/resource/events/history.xhtml?eventId="); + html.append(event.getEventId()); + if (resourceId > -1) { + html.append("&id=").append(event.getResourceId()); + } else if (groupId > -1) { + html.append("&groupId=").append(groupId); + } else { + html.append("&parent=").append(parent).append("&type=").append(type); + } + html.append("">"); + //html.append(event.getEventId()); + if (text.contains("\n")) { + text = text.substring(0, text.indexOf("\n")); + } + if (text.length() > DETAIL_MAX_LEN) { + text = text.substring(0, DETAIL_MAX_LEN - 1); + } + html.append(text); + html.append("</a>"); + html.append(" "); } - html.append(text); - html.append("</a>"); - html.append(" ");
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/events/data-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/events/data-plain.xhtml new file mode 100644 index 0000000..068f97b --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/events/data-plain.xhtml @@ -0,0 +1,180 @@ +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:rich="http://richfaces.ajax4jsf.org/rich" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function%22%3E + +ui:composition + +<script type="text/javascript" src="/js/monitorGraphs.js" /> +<!-- need to include this function directly in the facelet so that parameter resolution happens at render-time --> +<script type="text/javascript"> + function showEventsDetails(time, status) { + initEventDetails(); + eventsTime = time; + var detail = $('eventsSummary'); + detail.innerHTML = ""; + + if (status != null) + ajaxEngine.sendRequest( 'getEventDetails', + 'id=#{param.id}', + 'groupId=#{param.groupId}', + 'parent=#{param.parent}', + 'type=#{param.type}', + 'mode=plain', + 'begin=' + time, + 'status=' + status); + else + ajaxEngine.sendRequest( 'getEventDetails', + 'id=#{param.id}', + 'groupId=#{param.groupId}', + 'parent=#{param.parent}', + 'type=#{param.type}', + 'mode=plain', + 'begin=' + time); + + showEventsCallback(); + } +</script> + +<div id="overlay" class="overlay"></div> + +<table cellpadding="0" cellspacing="0" border="0" width="100%"> + + <c:if test="#{not empty EventsTimelineUIBean.data}"> + <tr> + <td colspan="62" style="height: 2px;"></td> + </tr> + + <tr style="height: 12px;"> + <td></td> + <c:forEach var="timeTick" items="#{EventsTimelineUIBean.data}" varStatus="status"> + <c:set var="count" value="#{status.index}"/> + <c:set var="icon" value="/images/no_event.gif"/> + <c:if test="#{not empty timeTick.severity}"> + <c:set var="sev" value="#{timeTick.severity.ordinal}"/> + <c:choose> + <c:when test="#{sev == 0 }"> + <c:set var="icon" value="/images/event_debug.gif"/> + </c:when> + <c:when test="#{sev == 1 }"> + <c:set var="icon" value="/images/event_info.gif"/> + </c:when> + <c:when test="#{sev == 2 }"> + <c:set var="icon" value="/images/event_warn.gif"/> + </c:when> + <c:when test="#{sev == 3 }"> + <c:set var="icon" value="/images/event_error.gif"/> + </c:when> + <c:when test="#{sev == 4 }"> + <c:set var="icon" value="/images/event_fatal.gif"/> + </c:when> + <c:otherwise> + <c:set var="icon" value="/images/no_event.gif"/> + </c:otherwise> + </c:choose> + </c:if> + + <!-- put onmousedown in table data element not the div, which gives the user a larger clickable area --> + <c:if test="#{empty timeTick.severity}"> + <td style="background-image: url(#{icon}); background-repeat:no-repeat;" align="center" valign="middle"> + </td> + </c:if> + + <c:if test="#{not empty timeTick.severity}"> + <ui:param name="formattedTimeTick" value="#{onf:formatTimestamp(timeTick.time)}"/> + <td style="background-image: url(#{icon}); background-repeat:no-repeat;" align="center" valign="middle" + onmousedown="detailsShowing=true;overlay.moveOverlay(this);overlay.showTimePopup('#{count}','#{formattedTimeTick}');showEventsDetails(#{timeTick.time});"> + </td> + </c:if> + + </c:forEach> + <td style="margin: 0 0 0 5;"> + <h:outputFormat value="#{msg['resource.common.monitor.label.elc']}" /> + </td> + </tr> + + <tr> + <td colspan="62" valign="top"> + <a name="eventDetail"></a> + <div id="eventDetailTable" + style="position: relative; height: 230px; display: none; "> + <div class="eventDetails"> + <table cellspacing="0" width="100%"> + <tr> + <td class="eventsTabOn" nowrap="nowrap"> + <h:outputFormat value="#{msg['resource.common.monitor.events.ListOfEvents']}" /> + </td> + <td valign="top" style="text-align: right; border-bottom: solid; border-width: 1px; border-color: #000000;"> + <img src="/images/dash-icon_delete.gif" + onclick="detailsShowing=false;new Effect.Fade($('eventDetailTable'), {afterFinish: function (obj) { maxIndicatorDivHeight(); overlay.moveOverlay(this); }})"/> + </td> + </tr> + <tr> + <td colspan="8"> + <div id="eventsSummary" style="height:200px; overflow:auto;"></div> + </td> + </tr> + </table> + </div> + </div> + </td> + </tr> + + <tr> + <td colspan="62" style="height: 3px;"></td> + </tr> + </c:if> + + <tr> + <td width="10"> + <div id="timetop"></div> + <img src="/images/timeline_ll.gif" height="10"/> + </td> + <c:forEach var="timeTick" items="#{EventsTimelineUIBean.data}" varStatus="status"> + <c:set var="count" value="#{status.index}"/> + <ui:param name="formattedTimeTick" value="#{onf:formatTimestamp(timeTick.time)}"/> + <td width="12"> + <div id="timePopup_#{count}" + onmouseover="overlay.moveOverlay(this);overlay.showTimePopup('#{count}','#{formattedTimeTick}')" > + <img src="/images/timeline_off.gif" height="10" width="9" + onmouseover="imageSwap(this, imagePath + 'timeline', '_on')" + onmouseout="imageSwap(this, imagePath + 'timeline', '_off');" + onmousedown="imageSwap(this, imagePath + 'timeline', '_down')" /> + </div> + </td> + </c:forEach> + <td width="100%"> + <img src="/images/timeline_lr.gif" height="10"/> + </td> + </tr> + + <tr> + <td></td> + <td colspan="30" valign="top"> + <h:outputText value="#{EventsTimelineUIBean.data[0].time}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + <div id="timePopup" class="timepopup" onmousedown="overlay.hideTimePopup()"></div> + </td> + <td colspan="30" align="right" valign="top"> + <h:outputText value="#{EventsTimelineUIBean.data[59].time}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </td> + <td></td> + </tr> +</table> + +</ui:composition> + +</html> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs-plain.xhtml new file mode 100644 index 0000000..acb697e --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs-plain.xhtml @@ -0,0 +1,123 @@ +<ui:composition + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <!-- chart actions --> + <tr class="BlockContent"> + <td align="right"> + <ui:include src="measurement/views.xhtml"/> + </td> + </tr> + + <tr class="BlockContent"> + <td> + <ui:include src="availability/data.xhtml"/> + </td> + </tr> + + <tr class="BlockContent"> + <td> + <div id="indicatorDiv" style="width: 750px; height: 400px; border: 1; overflow-x: hidden; overflow-y: scroll;"> + <ui:include src="measurement/data-plain.xhtml"/> + </div> + </td> + </tr> + +<tr class="BlockContent"> + <td width="550px"> + <div id="eventsDiv"> + <ui:include src="events/data-plain.xhtml"/> + </div> + </td> +</tr> + +<!-- spacer for date/time overlay, so it doesn't overlap metric display range --> +<tr class="BlockContent"> + <td> + <br /> + <br /> + </td> +</tr> + +<tr class="BlockContent"> + <td> + <h:form id="MetricComponentForm"> + <c:if test="#{IndicatorChartsUIBean.context.resourceId != -1}"> + <input type="hidden" name="id" value="#{IndicatorChartsUIBean.context.resourceId}" /> + </c:if> + <c:if test="#{IndicatorChartsUIBean.context.groupId != -1}"> + <input type="hidden" name="groupId" value="#{IndicatorChartsUIBean.context.groupId}" /> + </c:if> + <c:if test="#{IndicatorChartsUIBean.context.parentResourceId != -1}"> + <input type="hidden" name="parent" value="#{IndicatorChartsUIBean.context.parentResourceId}" /> + </c:if> + <c:if test="#{IndicatorChartsUIBean.context.resourceTypeId != -1}"> + <input type="hidden" name="type" value="#{IndicatorChartsUIBean.context.resourceTypeId}" /> + </c:if> + <table> + <tr> + <td><onc:metric optionList="m,h,d" /></td> + <td> + <h:commandLink rendered="#{not MetricComponentUtilityUIBean.readOnly}" + action="#{MetricComponentUtilityUIBean.update}" > + <img src="/images/dash-button_go-arrow.gif" alt="Apply Metric Settings "/> + </h:commandLink> + <h:commandLink rendered="#{MetricComponentUtilityUIBean.readOnly}" + action="#{MetricComponentUtilityUIBean.switchToSimpleMode}"> + <h:outputText value="Switch to Simple Mode" /> + </h:commandLink> + </td> + </tr> + </table> + </h:form> + </td> +</tr> + +<!-- footerDiv used purely for calculating the height for the overlay --> +<tr class="BlockContent"> + <td> + <div id="footerDiv"></div> + </td> +</tr> +</table> + +<script type="text/javascript"> + function maxIndicatorDivHeight() { + var indicatorDiv = getElementCrossBrowser("indicatorDiv"); + var eventsDiv = getElementCrossBrowser("eventsDiv"); + var footerDiv = getElementCrossBrowser("footerDiv"); + + //IE6 returns 0 for document.documentElement.clientHeight + var browserHeight = document.documentElement.clientHeight || document.body.clientHeight; + var indicatorTopPos = getElementTopPos(indicatorDiv); + var eventsTopPos = getElementTopPos(eventsDiv); + var footerTopPos = getElementTopPos(footerDiv) ; + var eventsDivHeight = footerTopPos - eventsTopPos; + + var newIndicatorDivHeight = browserHeight - indicatorTopPos - eventsDivHeight - 2; + + //accomodating for the IE measurement difficulties + if (Prototype.Browser.IE) { + newIndicatorDivHeight -= 4; + } + + //if the inidicator div would be too small, let the whole content pane scroll instead + if (newIndicatorDivHeight > 50) { + indicatorDiv.style.height = newIndicatorDivHeight + "px"; + } + } + + addWindowOnLoadEvent(maxIndicatorDivHeight); + addWindowOnResizeEvent(maxIndicatorDivHeight); +</script> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/measurement/data-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/measurement/data-plain.xhtml new file mode 100644 index 0000000..d944499 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/measurement/data-plain.xhtml @@ -0,0 +1,197 @@ +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:rich="http://richfaces.ajax4jsf.org/rich" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function%22%3E + +ui:composition + +<!-- NOTE: rico.js is used for the AJAX stuff below (i.e. the ajaxEngine object). --> +<a4j:loadScript src="/js/rico.js"/> + +<script language="JavaScript"> + + var baseUrl = "/resource/common/monitor/visibility/IndicatorCharts.do"; + baseUrl += '?'; + baseUrl += "#{onf:contextFragmentURLForIndicatorsChart()}" + baseUrl += '&view='; + baseUrl += "#{IndicatorChartsUIBean.view}"; + + // Register the remove metric chart method + ajaxEngine.registerRequest( 'indicatorCharts', baseUrl ); + + function addMetric(token) { + ajaxEngine.sendRequest( + 'indicatorCharts', + 'metric=' + token, + 'action=addChart', + 'view=' + '#{IndicatorChartsUIBean.view}'); + } + + function removeMetric(token) { + ajaxEngine.sendRequest( + 'indicatorCharts', + 'metric=' + token, + 'action=remove', + 'view=' + '#{IndicatorChartsUIBean.view}'); + new Effect.Fade(token); + } + + function moveMetricUp(token) { + ajaxEngine.sendRequest( + 'indicatorCharts', + 'metric=' + token, + 'action=moveUp', + 'view=' + '#{IndicatorChartsUIBean.view}'); + var root = $('root'); + var elem = $(token); + moveElementUp(elem, root); + } + + function moveMetricDown(token) { + ajaxEngine.sendRequest( + 'indicatorCharts', + 'metric=' + token, + 'action=moveDown', + 'view=' + '#{IndicatorChartsUIBean.view}'); + + var root = $('root'); + var elem = $(token); + moveElementDown(elem, root); + } + +</script> + +<form id="metricViewsForm"> + +<ul id="root" class="boxy"> + +<ui:param name="tableBorder" value="0" /> <!-- used for quick debugging --> +<ui:param name="context" value="#{IndicatorChartsUIBean.context}" /> +<c:forEach var="metric" varStatus="status" items="#{IndicatorChartsUIBean.data}"> + + <li id="#{metric.metricToken}"> + <table width="100%" border="#{tableBorder}" cellpadding="0" cellspacing="0"> + <tr> + <td> + <rich:panel bodyClass="BlockContent" style="border: 0px; margin: 0; padding: 0;"> + <font class="BoldText"> + ui:remove + <h:outputLink value="/resource/common/monitor/Visibility.do"> + <f:param name="m" value="#{metric.definitionId}"/> + <c:choose> + <c:when test="#{context.resourceTypeId > 0}"> + <f:param name="mode" value="chartSingleMetricMultiResource"/> + <f:param name="type" value="#{context.resourceTypeId}"/> + <f:param name="parent" value="#{context.parentResourceId}"/> + </c:when> + <c:when test="#{context.groupId > 0}"> + <f:param name="mode" value="chartSingleMetricMultiResource"/> + <f:param name="groupId" value="#{context.groupId}"/> + </c:when> + <c:otherwise> + <f:param name="mode" value="chartSingleMetricSingleResource"/> + <f:param name="id" value="#{context.resourceId}"/> + </c:otherwise> + </c:choose> + <h:outputText value="#{metric.label} " /> + </h:outputLink> + </ui:remove> + <h:outputText value="#{metric.label} " /> + + <c:choose> + <c:when test="#{context.groupId > 0}"> + <h:outputLink target="_top" value="/coregui/CoreGUI.html#ResourceGroup/#{metric.groupId}"> + <h:outputFormat value="#{msg['common.value.parenthesis']}"> + <f:param value="#{metric.metricSource}" /> + </h:outputFormat> + </h:outputLink> + </c:when> + <c:otherwise> + <h:outputLink target="_top" value="/coregui/CoreGUI.html#Resource/#{metric.metricSourceId}"> + <h:outputFormat value="#{msg['common.value.parenthesis']}"> + <f:param value="#{metric.metricSource}" /> + </h:outputFormat> + </h:outputLink> + </c:otherwise> + </c:choose> + </font> + <rich:toolTip followMouse="true" showDelay="500"> + <h:outputText value="#{metric.description}" rendered="#{not empty metric.description}" /> + <h:outputText value="No description of this metric available" rendered="#{empty metric.description}" /> + </rich:toolTip> + </rich:panel> + </td> + + <td width="400"> + <table cellpadding="0" cellspacing="0" border="#{tableBorder}" width="100%"> + <tr> + <td width="33%" nowrap="nowrap"> + <h:outputFormat style="font-weight: bold;" value="#{msg['resource.common.monitor.visibility.LowTH']}" />: + <h:outputText value="#{metric.minMetric.valueFmt}"/> + </td> + <td width="34%" nowrap="nowrap"> + <h:outputFormat style="font-weight: bold;" value="#{msg['resource.common.monitor.visibility.AvgTH']}" />: + <h:outputText value="#{metric.avgMetric.valueFmt}"/> + </td> + <td width="33%" nowrap="nowrap"> + <h:outputFormat style="font-weight: bold;" value="#{msg['resource.common.monitor.visibility.PeakTH']}" />: + <h:outputText value="#{metric.maxMetric.valueFmt}"/> + </td> + </tr> + </table> + </td> + + <td width="1"> + <table cellpadding="0" cellspacing="0" border="#{tableBorder}" width="100%" style="margin-right: 2px;"> + <tr> + <td width="33%"> + <a href="javascript:moveMetricUp('#{metric.metricToken}')"> + <img src="/images/dash_icon_up.gif" border="0"/> + </a> + </td> + <td width="33%"> + <a href="javascript:moveMetricDown('#{metric.metricToken}')"> + <img src="/images/dash_icon_down.gif" border="0"/> + </a> + </td> + <td width="34%"> + <a href="javascript:removeMetric('#{metric.metricToken}')"> + <img src="/images/dash-icon_delete.gif" border="0"/> + </a> + </td> + </tr> + </table> + </td> + </tr> + + <tr> + <td colspan="3"> + <h:graphicImage value="/resource/HighLowChart?#{onf:getChartURLParams(metric)}" + width="647" height="100" /> + </td> + </tr> + </table> + + </li> + +</c:forEach> + +</ul> + +</form> + +</ui:composition> + +</html> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml index 14f6b68..c2c594f 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml @@ -12,7 +12,7 @@
<ui:define name="content">
- <ui:include src="/rhq/common/monitor/graphs.xhtml" /> + <ui:include src="/rhq/common/monitor/graphs-plain.xhtml" />
</ui:define>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/graphs-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/graphs-plain.xhtml new file mode 100644 index 0000000..9aabd00 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/graphs-plain.xhtml @@ -0,0 +1,19 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:include src="/rhq/common/monitor/graphs-plain.xhtml" /> + + </ui:define> + +</ui:composition> \ No newline at end of file
rhq-commits@lists.fedorahosted.org