* Console:

- Move the console css from default.css in the .war to docs/themes/console/console.css,
        and support console themes in the main console with routerconsole.theme=foo
This commit is contained in:
zzz
2009-06-11 18:05:05 +00:00
parent 11ad98e7bd
commit d9cb4e2620
27 changed files with 70 additions and 35 deletions

View File

@ -75,8 +75,9 @@
<ant target="war" />
</target>
<target name="war" depends="precompilejsp">
<!-- Don't include the css in the war, the main build.xml will copy it to docs/themes/console/ -->
<war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml"
basedir="../jsp/" excludes="web.xml, *.java, *.jsp, web-fragment.xml">
basedir="../jsp/" excludes="web.xml, *.css, *.java, *.jsp, web-fragment.xml">
</war>
</target>
<target name="precompilejsp" unless="precompilejsp.uptodate">

View File

@ -0,0 +1,20 @@
package net.i2p.router.web;
/**
* Copied and modded from I2PTunnel IndexBean (GPL)
* @author zzz
*/
public class CSSHelper extends HelperBase {
public CSSHelper() {}
public static final String PROP_THEME_NAME = "routerconsole.theme";
private static final String BASE = "/themes/console/";
public String getTheme() {
String url = BASE;
String theme = _context.getProperty(PROP_THEME_NAME);
if (theme != null)
url += theme + "/";
return url;
}
}

View File

@ -3,7 +3,7 @@
<html><head>
<title>I2P Router Console - config networking</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config advanced</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config clients</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
<style type='text/css'>
button span.hide{
display:none;

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config keyring</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config logging</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<jsp:useBean class="net.i2p.router.web.ConfigLoggingHelper" id="logginghelper" scope="request" />
<jsp:setProperty name="logginghelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config peers</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config service</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config stats</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
<script type="text/javascript">
function init()
{

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config tunnels</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - config update</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -0,0 +1,20 @@
<%
/*
* This should be included inside <head>...</head>,
* as it sets the stylesheet.
*/
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
// the above will b0rk if the servlet engine has already flushed
// the response prior to including this file, so it should be
// near the top
if (request.getParameter("i2p.contextId") != null) {
session.setAttribute("i2p.contextId", request.getParameter("i2p.contextId"));
}
%>
<jsp:useBean class="net.i2p.router.web.CSSHelper" id="cssHelper" scope="request" />
<jsp:setProperty name="cssHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
<link href="<%=cssHelper.getTheme()%>console.css" rel="stylesheet" type="text/css" />

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - graphs</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - help</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -5,7 +5,7 @@
<html><head>
<title>I2P Router Console - home</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
<link rel="shortcut icon" href="favicon.ico" />
</head><body>
<%

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - job queue</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - logs</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -1,15 +1,4 @@
<%@page import="java.io.File" %>
<% response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
// the above will b0rk if the servlet engine has already flushed
// the response prior to including nav.jsp, so nav should be
// near the top
if (request.getParameter("i2p.contextId") != null) {
session.setAttribute("i2p.contextId", request.getParameter("i2p.contextId"));
}%>
<div class="logo">
<a href="index.jsp"><img src="i2plogo.png" alt="Router Console" width="187" height="35" /></a><br />
</div>
@ -35,7 +24,9 @@
<a href="graphs.jsp">Graphs</a> |
<a href="oldstats.jsp">Stats</a> <!-- |
<a href="oldconsole.jsp">Internals</a> -->
<% } %>
<% }
// the following is unused and a candidate for removal
%>
<jsp:useBean class="net.i2p.router.web.NavHelper" id="navhelper" scope="request" />
<jsp:setProperty name="navhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
<jsp:getProperty name="navhelper" property="clientAppLinks" />

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - network database summary</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - internals</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - statistics</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - peer connections</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - peer profiles</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -50,7 +50,7 @@
}
}
%>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head>
<body style="margin: 0;">

View File

@ -4,7 +4,7 @@
<html><head>
<title>I2P Router Console - tunnel summary</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<%@include file="css.jsp" %>
</head><body>
<%@include file="nav.jsp" %>

View File

@ -371,6 +371,9 @@
<copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
<!-- New readme_*.html files - For one release only -->
<copy file="readme_zh.html" todir="pkg-temp/docs/" />
<!-- CSS now in docs/, not in the .war -->
<copy file="apps/routerconsole/jsp/default.css" tofile="pkg-temp/docs/themes/console/console.css" />
<copy file="apps/routerconsole/jsp/default.css" tofile="pkg-temp/docs/themes/console/defCon1/console.css" />
</target>
<target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
<copy file="build/i2p.jar" todir="pkg-temp/lib/" />