📄 list.jsp
字号:
<!--//// This file is part of the OpenNMS(R) Application.//// OpenNMS(R) is Copyright (C) 2002-2003 The OpenNMS Group, Inc. All rights reserved.// OpenNMS(R) is a derivative work, containing both original code, included code and modified// code that was published under the GNU General Public License. Copyrights for modified // and included code are below.//// OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.//// Modifications://// 2004 Feb 11: remove the extra 'limit' parameter in the base URL.// 2003 Sep 04: Added a check to allow for deleted node events to display.// 2003 Feb 07: Fixed URLEncoder issues.// 2002 Nov 26: Fixed breadcrumbs issue.// 2002 Nov 10: Removed the "http://" from UEIs and references to bluebird.// 2002 Nov 09: Removed borders around events.// // Original code base Copyright (C) 1999-2001 Oculan Corp. All rights reserved.//// This program 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 2 of the License, or// (at your option) 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, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.//// For more information contact:// OpenNMS Licensing <license@opennms.org>// http://www.opennms.org/// http://www.opennms.com///--><%@page language="java" contentType="text/html" session="true" import="org.opennms.web.event.*,java.util.*,java.sql.SQLException,org.opennms.web.authenticate.Authentication,org.opennms.web.event.filter.*" %><%-- This page is written to be the display (view) portion of the EventQueryServlet at the /event/list URL. It will not work by itself, as it requires two request attributes be set: 1) events: the list of org.opennms.web.element.Event instances to display 2) parms: an org.opennms.web.event.EventQueryParms object that holds all the parameters used to make this query--%><% //required attributes Event[] events = (Event[])request.getAttribute( "events" ); EventQueryParms parms = (EventQueryParms)request.getAttribute( "parms" ); if( events == null || parms == null ) { throw new ServletException( "Missing either the events or parms request attribute." ); } String action = null; if( parms.ackType == EventFactory.AcknowledgeType.UNACKNOWLEDGED ) { action = AcknowledgeEventServlet.ACKNOWLEDGE_ACTION; } else if( parms.ackType == EventFactory.AcknowledgeType.ACKNOWLEDGED ) { action = AcknowledgeEventServlet.UNACKNOWLEDGE_ACTION; } int eventCount = EventFactory.getEventCount( parms.ackType, parms.getFilters() ); //useful constant strings String addPositiveFilterString = "[+]"; String addNegativeFilterString = "[-]"; String addBeforeDateFilterString = "[>]"; String addAfterDateFilterString = "[<]"; %><html><head> <title> List | Events | OpenNMS Web Console</title> <base href="<%=org.opennms.web.Util.calculateUrlBase( request )%>" /> <link rel="stylesheet" type="text/css" href="includes/styles.css" /> <style type="text/css"> a.filterLink { color:black ; text-decoration:none; }; a.filterLink:visited { color:black ; text-decoration:none; }; </style> <script language="Javascript" type="text/javascript"> function checkAllCheckboxes() { if( document.acknowledge_form.event.length ) { for( i = 0; i < document.acknowledge_form.event.length; i++ ) { document.acknowledge_form.event[i].checked = true } } else { document.acknowledge_form.event.checked = true } } function submitForm(anAction) { var isChecked = false var numChecked = 0; if (document.acknowledge_form.event.length) { for( i = 0; i < document.acknowledge_form.event.length; i++ ) { //make sure something is checked before proceeding if (document.acknowledge_form.event[i].checked) { isChecked=true; numChecked+=1; } } if (isChecked && document.acknowledge_form.multiple) { if (numChecked == parseInt(document.acknowledge_form.event.length)) { var newPageNum = parseInt(document.acknowledge_form.multiple.value) - 1; var findVal = "multiple=" + document.acknowledge_form.multiple.value; var replaceWith = "multiple=" + newPageNum; var tmpRedirect = document.acknowledge_form.redirectParms.value; document.acknowledge_form.redirectParms.value = tmpRedirect.replace(findVal, replaceWith); document.acknowledge_form.submit(); } else { document.acknowledge_form.submit(); } } else if (isChecked) { document.acknowledge_form.submit(); } else { alert("Please check the events that you would like to " + anAction + "."); } } else { if (document.acknowledge_form.event.checked) { document.acknowledge_form.submit(); } else { alert("Please check the events that you would like to " + anAction + "."); } } } </script></head><body marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0"><% String breadcrumb1 = "<a href= 'event/index.jsp' title='Events System Page'>Events</a>"; %><% String breadcrumb2 = "List"; %><jsp:include page="/includes/header.jsp" flush="false" > <jsp:param name="title" value="Event List" /> <jsp:param name="breadcrumb" value="<%=breadcrumb1%>" /> <jsp:param name="breadcrumb" value="<%=breadcrumb2%>" /></jsp:include><br/><!-- Body --><table width="100%" border="0" cellspacing="0" cellpadding="2" > <tr> <td> </td> <td> <!-- menu --> <a href="<%=this.makeLink( parms, new ArrayList())%>" title="Remove all search constraints" >View all events</a> <a href="event/advsearch.jsp" title="More advanced searching and sorting options">Advanced Search</a> <a href="javascript: void window.open('<%=org.opennms.web.Util.calculateUrlBase(request)%>/event/severity.jsp','', 'fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=yes,directories=no,location=no,width=525,height=158')" title="Open a window explaining the event severities">Severity Legend</a> <% if( parms.ackType == EventFactory.AcknowledgeType.UNACKNOWLEDGED ) { %> <a href="javascript: void document.acknowledge_by_filter_form.submit()" onclick="return confirm('Are you sure you want to acknowledge all events in the current search including those not shown on your screen? (<%=eventCount%> total events)')" title="Acknowledge all events that match the current search constraints, even those not shown on the screen">Acknowledge entire search</a> <% } else { %> <a href="javascript: void document.acknowledge_by_filter_form.submit()" onclick="return confirm('Are you sure you want to unacknowledge all events in the current search including those not shown on your screen)? (<%=eventCount%> total events)')" title="Unacknowledge all events that match the current search constraints, even those not shown on the screen">Unacknowledge entire search</a> <% } %> <!-- end menu --> <!-- hidden form for acknowledging the result set --> <form action="event/acknowledgeByFilter" method="POST" name="acknowledge_by_filter_form"> <input type="hidden" name="redirectParms" value="<%=request.getQueryString()%>" /> <input type="hidden" name="action" value="<%=action%>" /> <%=org.opennms.web.Util.makeHiddenTags(request)%> </form> <table width="100%" border="0" cellspacing="2" cellpadding="0" > <tr> <td width="50%" valign="top"> <jsp:include page="/event/querypanel.jsp" flush="false" /> <% if( eventCount > 0 ) { %> <% String baseUrl = this.makeLink(parms); %> <jsp:include page="/includes/resultsIndex.jsp" flush="false" > <jsp:param name="count" value="<%=eventCount%>" /> <jsp:param name="baseurl" value="<%=baseUrl%>" /> <jsp:param name="limit" value="<%=parms.limit%>" /> <jsp:param name="multiple" value="<%=parms.multiple%>" /> </jsp:include> <% } %> </td> <td width="50%" valign="top"> <% if( parms.filters.size() > 0 || parms.ackType == EventFactory.AcknowledgeType.UNACKNOWLEDGED || parms.ackType == EventFactory.AcknowledgeType.ACKNOWLEDGED ) { %> <% int length = parms.filters.size(); %> <p>Current search constraints: <ol> <% if( parms.ackType == EventFactory.AcknowledgeType.UNACKNOWLEDGED ) { %> <li> event is outstanding <a href="<%=this.makeLink(parms, EventFactory.AcknowledgeType.ACKNOWLEDGED)%>" title="Show acknowledged events"><nobr>[Show acknowledged]</nobr></a> </li> <% } else if( parms.ackType == EventFactory.AcknowledgeType.ACKNOWLEDGED ) { %> <li> event is acknowledged <a href="<%=this.makeLink(parms, EventFactory.AcknowledgeType.UNACKNOWLEDGED)%>" title="Show outstanding events"><nobr>[Show outstanding]</nobr></a> </li> <% } %> <% for( int i=0; i < length; i++ ) { %> <% org.opennms.web.event.filter.Filter filter = (org.opennms.web.event.filter.Filter)parms.filters.get(i); %> <li> <%=filter.getTextDescription()%> <a href="<%=this.makeLink( parms, filter, false)%>" title="Remove filter">[Remove]</a> </li> <% } %> </ol> </p> <% } %> </td> </tr> </table> <form action="event/acknowledge" method="POST" name="acknowledge_form"> <input type="hidden" name="redirectParms" value="<%=request.getQueryString()%>" /> <input type="hidden" name="action" value="<%=action%>" /> <%=org.opennms.web.Util.makeHiddenTags(request)%> <table width="100%" cellspacing="1" cellpadding="2" border="0" bordercolor="black"> <tr bgcolor="#999999"> <% if ( parms.ackType == EventFactory.AcknowledgeType.UNACKNOWLEDGED ) { %> <td width="1%"><b>Ack</b></td> <% } else { %> <td width="1%"><b>UnAck</b></td> <% } %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -