list.jsp

来自「opennms得相关源码 请大家看看」· JSP 代码 · 共 355 行 · 第 1/2 页

JSP
355
字号
<!--//// 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://// 2003 Feb 07: Fixed URLEncoder issues.// 2002 Nov 26: Fixed breadcrumbs issue.// // 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.vulnerability.*,java.util.*,java.text.*,java.sql.SQLException,org.opennms.web.authenticate.Authentication,org.opennms.web.vulnerability.filter.*,org.opennms.web.Util,org.opennms.web.element.ElementUtil" %><%--  This page is written to be the display (view) portion of the VulnerabilityQueryServlet  at the /vulnerability/list URL.  It will not work by itself, as it requires two request  attributes be set:    1) vuls: the list of org.opennms.web.vulnerability.Vulnerability instances to display  2) parms: an org.opennms.web.vulnerability.VulnerabilityQueryParms object that holds all the      parameters used to make this query--%><%!    //useful constant strings    public static final String ZOOM_IN_ICON = "[+]";    public static final String DISCARD_ICON = "[-]";    public static final String BEFORE_ICON  = "[&gt;]";    public static final String AFTER_ICON   = "[&lt;]";        public static final DateFormat DATE_FORMAT = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);%><%    //required attributes vuls & parms    Vulnerability[] vuls = (Vulnerability[])request.getAttribute( "vuls" );    VulnerabilityQueryParms parms = (VulnerabilityQueryParms)request.getAttribute( "parms" );    if( vuls == null || parms == null ) {        throw new ServletException( "Missing either the vuls or parms request attribute." );    }         int vulCount = VulnerabilityFactory.getVulnerabilityCount( parms.resType, parms.getFilters() );            %><html><head>  <title>List | Vulnerabilities | OpenNMS Web Console</title>  <base href="<%=org.opennms.web.Util.calculateUrlBase( request )%>" />  <link href="includes/styles.css" rel="stylesheet" />  </head><body marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0"><% String breadcrumb1 = "<a href='vulnerability/index.jsp' title='Vulnerabilities System Page'>Vulnerabilities</a>"; %><% String breadcrumb2 = "List"; %><jsp:include page="/includes/header.jsp" flush="false" >  <jsp:param name="title" value="Vulnerability List" />  <jsp:param name="breadcrumb" value="<%=breadcrumb1%>" />  <jsp:param name="breadcrumb" value="<%=breadcrumb2%>" /></jsp:include><!-- Body --><table width="100%" border="0" cellspacing="0" cellpadding="2" >  <tr>    <td>&nbsp;</td>    <td>      <!-- secondary menu -->      <a href="<%=VulnerabilityUtil.makeLink( request, parms, new ArrayList())%>" title="Remove all search constraints" >View All Vulnerabilities</a>      <%--&nbsp;&nbsp;&nbsp;<a href="event/advsearch.jsp" title="More advanced searching and sorting options">Advanced Search</a>--%>                                      <!-- end secondary menu -->                  <% if( vulCount > 0 ) { %>        <!-- pagination controls -->        <table width="100%" border="0" cellspacing="2" cellpadding="0">          <tr>            <td width="50%" valign="top">              <% String baseUrl = VulnerabilityUtil.makeLink(request, parms); %>              <jsp:include page="/includes/resultsIndex.jsp" flush="false" >                <jsp:param name="count"    value="<%=vulCount%>"     />                <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">                        <jsp:include page="/vulnerability/search-constraints-box.jsp" />                          </td>          </tr>        </table>        <!-- end pagination controls -->      <% } %>            <!-- Body -->      <table width="100%" cellspacing="0" cellpadding="2" border="1" bordercolor="black">              <!-- List Header Row -->        <tr bgcolor="#999999">          <td width="5%"> <%=this.makeSortLink(request, parms, VulnerabilityFactory.SortStyle.ID, VulnerabilityFactory.SortStyle.REVERSE_ID, "id", "ID")%></td>          <td width="10%"><%=this.makeSortLink(request, parms, VulnerabilityFactory.SortStyle.SEVERITY, VulnerabilityFactory.SortStyle.REVERSE_SEVERITY, "severity", "Severity")%></td>          <td width="20%"><%=this.makeSortLink(request, parms, VulnerabilityFactory.SortStyle.NODE, VulnerabilityFactory.SortStyle.REVERSE_NODE, "node", "Node")%></td>          <td width="20%"><%=this.makeSortLink(request, parms, VulnerabilityFactory.SortStyle.INTERFACE, VulnerabilityFactory.SortStyle.REVERSE_INTERFACE, "interface", "Interface")%></td>          <td width="2%"> <%=this.makeSortLink(request, parms, VulnerabilityFactory.SortStyle.PORT, VulnerabilityFactory.SortStyle.REVERSE_PORT, "port", "Port")%></td>          <td width="3%"> <%=this.makeSortLink(request, parms, VulnerabilityFactory.SortStyle.PROTOCOL, VulnerabilityFactory.SortStyle.REVERSE_PROTOCOL, "protocol", "Protocol")%></td>          <td width="20%"><%=this.makeSortLink(request, parms, VulnerabilityFactory.SortStyle.CREATE_TIME, VulnerabilityFactory.SortStyle.REVERSE_CREATE_TIME, "discovery time", "Discovered")%></td>          <td width="20%"><%=this.makeSortLink(request, parms, VulnerabilityFactory.SortStyle.RESOLVED_TIME, VulnerabilityFactory.SortStyle.REVERSE_RESOLVED_TIME, "resolution time", "Resolved")%></td>        </tr>                          <% for( int i=0; i < vuls.length; i++ ) { %>          <tr valign="top" bgcolor="<%=(i%2 == 0) ? "white" : "#cccccc"%>">                                <!-- vulnerability id -->                          <td valign="top" rowspan="2" bgcolor="<%=VulnerabilityUtil.getSeverityColor(vuls[i].getSeverity())%>">              <a href="vulnerability/detail.jsp?id=<%=vuls[i].getId()%>"><%=vuls[i].getId()%></a>            </td>            <!-- severity -->            <td valign="top" rowspan="2" bgcolor="<%=VulnerabilityUtil.getSeverityColor(vuls[i].getSeverity())%>">              <%=VulnerabilityUtil.getSeverityLabel(vuls[i].getSeverity())%>                            <% org.opennms.web.vulnerability.filter.Filter severityFilter = new SeverityFilter(vuls[i].getSeverity()); %>                          <% if( !parms.filters.contains( severityFilter )) { %>                <nobr>                  <a href="<%=VulnerabilityUtil.makeLink( request, parms, severityFilter, true)%>" title="Show only vulnerabilities with this severity"><%=ZOOM_IN_ICON%></a>                  <a href="<%=VulnerabilityUtil.makeLink( request, parms, new NegativeSeverityFilter(vuls[i].getSeverity()), true)%>" title="Do not show vulnerabilities with this severity"><%=DISCARD_ICON%></a>                              </nobr>              <% } else { %>                            &nbsp;              <% } %>                        </td>                                      <!-- node -->            <td>              <% if(vuls[i].getNodeId() != null ) { %>                             <% String longLabel  = vuls[i].getNodeLabel(); %>                <% String shortLabel = ElementUtil.truncateLabel(longLabel, 22); %>                <a href="element/node.jsp?node=<%=vuls[i].getNodeId()%>" title="<%=longLabel%>"><%=shortLabel%></a>                                <% if(vuls[i].getNodeId() != null ) { %>                  <% org.opennms.web.vulnerability.filter.Filter nodeFilter = new NodeFilter(vuls[i].getNodeId().intValue()); %>                    <% if( !parms.filters.contains(nodeFilter) ) { %>                    <nobr>                      <a href="<%=VulnerabilityUtil.makeLink( request, parms, nodeFilter, true)%>" title="Show only vulnerabilities on this node"><%=ZOOM_IN_ICON%></a>                      <a href="<%=VulnerabilityUtil.makeLink( request, parms, new NegativeNodeFilter(vuls[i].getNodeId().intValue()), true)%>" title="Do not show vulnerabilities for this node"><%=DISCARD_ICON%></a>                                  </nobr>                  <% } else { %>                        

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?