Skip to content

Commit

Permalink
Working on the replacement of the old legacy dashboard/surveillance view
Browse files Browse the repository at this point in the history
  • Loading branch information
christianpape committed Feb 20, 2015
1 parent 469d0d3 commit a4b5edd
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import org.opennms.features.vaadin.surveillanceviews.config.SurveillanceViewProvider;
Expand All @@ -52,33 +53,47 @@ public class SurveillanceViewsUI extends UI {

@Override
protected void init(VaadinRequest request) {

VerticalLayout rootLayout = new VerticalLayout();
rootLayout.setSpacing(true);
rootLayout.setSizeFull();
//rootLayout.setSizeFull();

String viewName = request.getParameter("viewName") == null ? "default" : request.getParameter("viewName");
boolean dashboard = request.getParameter("dashboard") != null && "true".equals(request.getParameter("dashboard"));

View view = SurveillanceViewProvider.getInstance().getView("default");

SurveillanceViewTable surveillanceViewTable = new SurveillanceViewTable(view, m_surveillanceViewService);
/*
for (Map.Entry<String, String[]> entry : request.getParameterMap().entrySet()) {
rootLayout.addComponent(new Label("Key: '" + entry.getKey() + "'"));
}
*/
rootLayout.addComponent(new Label("viewName=" + viewName));
rootLayout.addComponent(new Label("dashboard=" + dashboard));

rootLayout.addComponent(surveillanceViewTable);

VerticalLayout secondLayout = new VerticalLayout();
secondLayout.setSpacing(true);
if (dashboard) {
VerticalLayout secondLayout = new VerticalLayout();
secondLayout.setSpacing(true);

SurveillanceViewAlarmTable surveillanceViewAlarmTable = new SurveillanceViewAlarmTable(m_surveillanceViewService);
SurveillanceViewNotificationTable surveillanceViewNotificationTable = new SurveillanceViewNotificationTable(m_surveillanceViewService);
SurveillanceViewNodeRtcTable surveillanceViewNodeRtcTable = new SurveillanceViewNodeRtcTable(m_surveillanceViewService);

SurveillanceViewAlarmTable surveillanceViewAlarmTable = new SurveillanceViewAlarmTable(m_surveillanceViewService);
SurveillanceViewNotificationTable surveillanceViewNotificationTable = new SurveillanceViewNotificationTable(m_surveillanceViewService);
SurveillanceViewNodeRtcTable surveillanceViewNodeRtcTable = new SurveillanceViewNodeRtcTable(m_surveillanceViewService);
secondLayout.addComponent(surveillanceViewAlarmTable);
secondLayout.addComponent(surveillanceViewNotificationTable);
secondLayout.addComponent(surveillanceViewNodeRtcTable);

secondLayout.addComponent(surveillanceViewAlarmTable);
secondLayout.addComponent(surveillanceViewNotificationTable);
secondLayout.addComponent(surveillanceViewNodeRtcTable);
surveillanceViewTable.addDetailsTable(surveillanceViewAlarmTable);
surveillanceViewTable.addDetailsTable(surveillanceViewNotificationTable);
surveillanceViewTable.addDetailsTable(surveillanceViewNodeRtcTable);

surveillanceViewTable.addDetailsTable(surveillanceViewAlarmTable);
surveillanceViewTable.addDetailsTable(surveillanceViewNotificationTable);
surveillanceViewTable.addDetailsTable(surveillanceViewNodeRtcTable);
rootLayout.addComponent(secondLayout);
rootLayout.setExpandRatio(secondLayout, 1.0f);
}

rootLayout.addComponent(secondLayout);
rootLayout.setExpandRatio(secondLayout, 1.0f);
setContent(rootLayout);
}

Expand Down
17 changes: 11 additions & 6 deletions opennms-webapp/src/main/webapp/WEB-INF/dispatcher-servlet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,16 @@
<property name="url" value="dashboards.htm" />
<property name="entries">
<list>
<bean class="org.opennms.web.navigate.LocationBasedNavBarEntry">
<property name="name" value="Legacy Dashboard"/>
<property name="url" value="legacy-dashboard.jsp"/>
<property name="locationMatch" value="legacy-dashboard"/>
</bean>
<bean class="org.opennms.web.navigate.LocationBasedNavBarEntry">
<property name="name" value="Dashboard"/>
<property name="url" value="dashboard.jsp"/>
<property name="locationMatch" value="dashboard"/>
</bean>
<bean class="org.opennms.web.navigate.LocationBasedNavBarEntry">
<property name="name" value="Vaadin Surveillance Views"/>
<property name="url" value="vaadin-surveillance-views.jsp"/>
<property name="locationMatch" value="vaadin-surveillance-views"/>
</bean>
<bean class="org.opennms.web.navigate.LocationBasedNavBarEntry">
<property name="name" value="Ops Board"/>
<property name="url" value="vaadin-wallboard"/>
Expand Down Expand Up @@ -429,11 +429,16 @@
<property name="locationMatch" value="outage"/>
</bean>
<bean class="org.opennms.web.navigate.SurveillanceViewNavBarEntry">
<property name="name" value="Surveillance"/>
<property name="name" value="Legacy Surveillance"/>
<property name="url" value=""/>
<property name="locationMatch" value="surveillance"/>
<property name="surveillanceViewConfigDao" ref="surveillanceViewConfigDao"/>
</bean>
<bean class="org.opennms.web.navigate.LocationBasedNavBarEntry">
<property name="name" value="Surveillance"/>
<property name="url" value="surveillance-view.jsp"/>
<property name="locationMatch" value="surveillance-view"/>
</bean>
<bean class="org.opennms.web.navigate.DistributedStatusNavBarEntry">
<property name="name" value="Distributed Status"/>
<property name="url" value="distributedStatusSummary.htm"/>
Expand Down
74 changes: 18 additions & 56 deletions opennms-webapp/src/main/webapp/dashboard.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,64 +29,26 @@
--%>

<%@page language="java" contentType="text/html" session="true" %>

<jsp:include page="/includes/bootstrap.jsp" flush="false">
<jsp:param name="title" value="Dashboard" />
<jsp:param name="location" value="dashboard" />
<jsp:param name="meta">
<jsp:attribute name="value">
<meta name='gwt:module' content='org.opennms.dashboard.Dashboard' />
</jsp:attribute>
</jsp:param>
<jsp:param name="meta">
<jsp:attribute name="value">
<link media="screen" href="css/dashboard.css" type="text/css" rel="stylesheet">
</jsp:attribute>
</jsp:param>

<%@page language="java"
contentType="text/html"
session="true"
%>

<jsp:include page="/includes/bootstrap.jsp" flush="false" >
<jsp:param name="title" value="Vaadin Surveillance Views" />
<jsp:param name="headTitle" value="Vaadin Surveillance Views" />
<jsp:param name="location" value="vaadin-surveillance-views" />
<jsp:param name="vaadinEmbeddedStyles" value="true" />
</jsp:include>

<script type="text/javascript" src='dashboard/dashboard.nocache.js'></script>

<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<div class="dashletCell"id="surveillanceView"></div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="alarms"></div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="notifications"></div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="nodeStatus"></div>
</div>
</div>
<%
String viewName = "";
<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="graphs"></div>
</div>
</div>
if (request.getParameterMap().containsKey("viewName")) {
viewName = "&viewName=" + request.getParameter("viewName");
}
%>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="outages"></div>
</div>
</div>
</div>
</div>
<iframe src="osgi/vaadin-surveillance-views?dashboard=true<%= viewName %>" frameborder="0" style="height:100%; width:100%;"></iframe>
<jsp:include page="/includes/bootstrap-footer.jsp" flush="true"/>

<jsp:include page="/includes/bootstrap-footer.jsp" flush="false" />
92 changes: 92 additions & 0 deletions opennms-webapp/src/main/webapp/legacy-dashboard.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<%--
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2002-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(R) is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* OpenNMS(R) 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with OpenNMS(R). If not, see:
* http://www.gnu.org/licenses/
*
* For more information contact:
* OpenNMS(R) Licensing <license@opennms.org>
* http://www.opennms.org/
* http://www.opennms.com/
*******************************************************************************/
--%>

<%@page language="java" contentType="text/html" session="true" %>

<jsp:include page="/includes/bootstrap.jsp" flush="false">
<jsp:param name="title" value="Dashboard" />
<jsp:param name="location" value="dashboard" />
<jsp:param name="meta">
<jsp:attribute name="value">
<meta name='gwt:module' content='org.opennms.dashboard.Dashboard' />
</jsp:attribute>
</jsp:param>
<jsp:param name="meta">
<jsp:attribute name="value">
<link media="screen" href="css/dashboard.css" type="text/css" rel="stylesheet">
</jsp:attribute>
</jsp:param>

</jsp:include>

<script type="text/javascript" src='dashboard/dashboard.nocache.js'></script>

<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<div class="dashletCell"id="surveillanceView"></div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="alarms"></div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="notifications"></div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="nodeStatus"></div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="graphs"></div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="dashletCell" id="outages"></div>
</div>
</div>
</div>
</div>

<jsp:include page="/includes/bootstrap-footer.jsp" flush="false" />
46 changes: 0 additions & 46 deletions opennms-webapp/src/main/webapp/vaadin-surveillance-views.jsp

This file was deleted.

0 comments on commit a4b5edd

Please sign in to comment.