JWS-121 & JWS-109 Service Status now gives an indication of the health of service...
authorFábio Madeira <fmmarquesmadeira@dundee.ac.uk>
Fri, 2 Jun 2017 14:13:27 +0000 (15:13 +0100)
committerFábio Madeira <fmmarquesmadeira@dundee.ac.uk>
Fri, 2 Jun 2017 14:13:27 +0000 (15:13 +0100)
website/refresh_service_status.sh [deleted file]
website/service_status.jsp [deleted file]
website/template_footer.jsp
website/template_header.jsp
website/usage_statistics.jsp [deleted file]

diff --git a/website/refresh_service_status.sh b/website/refresh_service_status.sh
deleted file mode 100644 (file)
index 4d730bb..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env bash
-
-# run command as ./refresh_service_status.sh http://gjb-www-3.cluster.lifesci.dundee.ac.uk:9507/jabaws/ServiceStatus 15 cached_service_status.html &
-# the command starts executing, but continues to run forever
-
-# Host URL $1 (example: http://gjb-www-3.cluster.lifesci.dundee.ac.uk:9507/jabaws/ServiceStatus)
-# Host URL $1 (example: http://gjb-www-3.cluster.lifesci.dundee.ac.uk:9507/jabaws/PublicAnnualStat)
-if [ -z "$1" ]
-  then
-    echo "Hostname needs to be passed as 1st argument! (example http://compbio.lifesci.dundee.ac.uk/jabaws/ServiceStatus)"
-    exit 1
-fi
-
-# Refresh Time $2 (minutes)
-if [ -z "$2" ]
-  then
-    echo "Refresh Time (min) needs to be passed as 2nd argument! (example 15)"
-    exit 1
-fi
-
-# Output-file $3 (html) (example: cached_service_status.html)
-# Output-file $3 (html) (example: cached_usage_statistics.html)
-if [ -z "$3" ]
-  then
-    echo "Outputfile (html) needs to be passed as 3rd argument! (example: cached_service_status.html)"
-    exit 1
-fi
-
-# gets the file as a tmp
-while :; do echo "Fetching from $1:" `date "+%d/%m/%Y %H:%M:%S"`; wget -q $1 -O "tmp_cache.html"; mv "tmp_cache.html" $3; sleep $2m; done
diff --git a/website/service_status.jsp b/website/service_status.jsp
deleted file mode 100644 (file)
index 94873d9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
-
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>
-
-
-<%@ page errorPage="ServiceStatus" %>
-<jsp:include page="/cached_service_status.html" />
index d5c2d57..973cd1f 100644 (file)
                         <a href="${pageContext.request.contextPath}/about.jsp#citing">Citing JABAWS</a>
                     </li>
                     <li>
-                        <a href="${pageContext.request.contextPath}/service_status.jsp" >Service Status</a>
+                        <a href="${pageContext.request.contextPath}/ServiceStatus" >Service Status</a>
                     </li>
 
                     <li>
-                        <a href="${pageContext.request.contextPath}/usage_statistics.jsp" >Usage Statistics</a>
+                        <a href="${pageContext.request.contextPath}/PublicAnnualStat" >Usage Statistics</a>
                     </li>
                     <li>
                         <a href="${pageContext.request.contextPath}/about.jsp#funding">Funding</a>
index fff4c81..f7be117 100644 (file)
@@ -1,3 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>
+
 <!DOCTYPE html>
 <html lang="en">
 
                     </ul>
                 </li>
                 <li>
-                    <a href="${pageContext.request.contextPath}/service_status.jsp" >
+                    <c:set var="status" value='${applicationScope["serviceStatusAllGood"]}' />
+                    <c:if test="${ empty status }">
+                        <a href="${pageContext.request.contextPath}/ServiceStatus" >
                         <i class="fa fa-cogs" aria-hidden="true"></i> Service Status</a>
+                    </c:if>
+                    <c:if test="${ !empty status }">
+                        <c:if test="${status=='true'}">
+                            <a href="${pageContext.request.contextPath}/ServiceStatus" >
+                                <i class="fa fa-heartbeat" aria-hidden="true" style="color: green"></i> Service Status</a>
+                        </c:if>
+                        <c:if test="${status=='false'}">
+                            <a href="${pageContext.request.contextPath}/ServiceStatus" >
+                                <i class="fa fa-heartbeat" aria-hidden="true" style="color: red"></i> Service Status</a>
+                        </c:if>
+                    </c:if>
                 </li>
                 <li>
-                    <a href="${pageContext.request.contextPath}/usage_statistics.jsp" >
+                    <a href="${pageContext.request.contextPath}/PublicAnnualStat" >
                         <i class="fa fa-bar-chart" aria-hidden="true"></i> Usage Statistics</a>
                 </li>
                 <!--Includes funding and contacts (v2.2)-->
diff --git a/website/usage_statistics.jsp b/website/usage_statistics.jsp
deleted file mode 100644 (file)
index 5171b3c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
-
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %>
-
-
-<%@ page errorPage="PublicAnnualStat" %>
-<jsp:include page="/cached_usage_statistics.html" />