Changeset 1997be37


Ignore:
Timestamp:
Feb 18, 2012 3:28:19 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3131e65
Parents:
ab1ee37 (diff), 3af2577c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

propagate from branch 'i2p.i2p' (head 0a3db5b65f8fdc3e91000c9dff9e679401b52f72)

to branch 'i2p.i2p.zzz.homepage' (head 73d71bde13883d204e50f497efe264d8643fb8fa)

Files:
9 added
6 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigNavHelper.java

    rab1ee37 r1997be37  
    1212    /** configX.jsp */
    1313    private static final String pages[] =
    14                                           {"", "net", "ui", "service", "update", "tunnels",
     14                                          {"", "net", "ui", "home", "service", "update", "tunnels",
    1515                                           "clients", "peer", "keyring", "logging", "stats",
    1616                                           "reseed", "advanced" };
    1717
    1818    private static final String titles[] =
    19                                           {_x("Bandwidth"), _x("Network"), _x("UI"), _x("Service"), _x("Update"), _x("Tunnels"),
     19                                          {_x("Bandwidth"), _x("Network"), _x("UI"), _x("Home Page"),
     20                                           _x("Service"), _x("Update"), _x("Tunnels"),
    2021                                           _x("Clients"), _x("Peers"), _x("Keyring"), _x("Logging"), _x("Stats"),
    2122                                           _x("Reseeding"), _x("Advanced") };
  • apps/routerconsole/java/src/net/i2p/router/web/NavHelper.java

    rab1ee37 r1997be37  
    3737    /**
    3838     *  Translated string is loaded by PluginStarter
     39     *  @param ctx unused
    3940     */
    4041    public static String getClientAppLinks(I2PAppContext ctx) {
     
    5657        return buf.toString();
    5758    }
     59   
     60    /**
     61     *  For HomeHelper
     62     *  @param ctx unused
     63     *  @return non-null, possibly empty
     64     *  @since 0.9
     65     */
     66    static List<HomeHelper.App> getClientApps(I2PAppContext ctx) {
     67        if (_apps.isEmpty())
     68            return Collections.EMPTY_LIST;
     69        List<HomeHelper.App> rv = new ArrayList(_apps.size());
     70        for (Map.Entry<String, String> e : _apps.entrySet()) {
     71            String name = e.getKey();
     72            String path = e.getValue();
     73            if (path == null)
     74                continue;
     75            String tip = _tooltips.get(name);
     76            if (tip == null)
     77                tip = "";
     78            // hardcoded hack
     79            String icon;
     80            if (path.equals("/i2pbote/index.jsp"))
     81                icon = "/themes/console/images/email.png";
     82            else
     83                icon = "/themes/console/images/plugin.png";
     84            HomeHelper.App app = new HomeHelper.App(name, tip, path, icon);
     85            rv.add(app);
     86        }
     87        return rv;
     88    }
    5889}
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java

    rab1ee37 r1997be37  
    267267        buf.setLength(0);
    268268
    269 
    270         boolean anotherLine = false;
    271         if (_helper.showFirewallWarning()) {
    272             buf.append("<h4><a href=\"/confignet\" target=\"_top\" title=\"")
    273                .append(_("Help with firewall configuration"))
    274                .append("\">")
    275                .append(_("Check network connection and NAT/firewall"))
    276                .append("</a></h4>");
    277             anotherLine = true;
    278         }
    279 
    280         boolean reseedInProgress = Boolean.valueOf(System.getProperty("net.i2p.router.web.ReseedHandler.reseedInProgress")).booleanValue();
    281         // If showing the reseed link is allowed
    282         if (_helper.allowReseed()) {
    283             if (reseedInProgress) {
    284                 // While reseed occurring, show status message instead
    285                 buf.append("<i>").append(System.getProperty("net.i2p.router.web.ReseedHandler.statusMessage","")).append("</i><br>");
    286             } else {
    287                 // While no reseed occurring, show reseed link
    288                 long nonce = _context.random().nextLong();
    289                 String prev = System.getProperty("net.i2p.router.web.ReseedHandler.nonce");
    290                 if (prev != null) System.setProperty("net.i2p.router.web.ReseedHandler.noncePrev", prev);
    291                 System.setProperty("net.i2p.router.web.ReseedHandler.nonce", nonce+"");
    292                 String uri = _helper.getRequestURI();
    293                 buf.append("<p><form action=\"").append(uri).append("\" method=\"POST\">\n");
    294                 buf.append("<input type=\"hidden\" name=\"reseedNonce\" value=\"").append(nonce).append("\" >\n");
    295                 buf.append("<button type=\"submit\" class=\"reload\" value=\"Reseed\" >").append(_("Reseed")).append("</button></form></p>\n");
    296             }
    297             anotherLine = true;
    298         }
    299         // If a new reseed ain't running, and the last reseed had errors, show error message
    300         if (!reseedInProgress) {
    301             String reseedErrorMessage = System.getProperty("net.i2p.router.web.ReseedHandler.errorMessage","");
    302             if (reseedErrorMessage.length() > 0) {
    303                 buf.append("<i>").append(reseedErrorMessage).append("</i><br>");
    304                 anotherLine = true;
    305             }
    306         }
    307         if (anotherLine)
    308             buf.append("<hr>");
    309 
     269        buf.append(_helper.getFirewallAndReseedStatus());
    310270
    311271        buf.append("<h3><a href=\"/config\" title=\"")
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java

    rab1ee37 r1997be37  
    663663    }
    664664
     665    /**
     666     *  The firewall status and reseed status/buttons
     667     *  @since 0.9 moved from SummaryBarRenderer
     668     */
     669    public String getFirewallAndReseedStatus() {
     670        StringBuilder buf = new StringBuilder(256);
     671        if (showFirewallWarning()) {
     672            buf.append("<h4><a href=\"/confignet\" target=\"_top\" title=\"")
     673               .append(_("Help with firewall configuration"))
     674               .append("\">")
     675               .append(_("Check network connection and NAT/firewall"))
     676               .append("</a></h4>");
     677        }
     678
     679        boolean reseedInProgress = Boolean.valueOf(System.getProperty("net.i2p.router.web.ReseedHandler.reseedInProgress")).booleanValue();
     680        // If showing the reseed link is allowed
     681        if (allowReseed()) {
     682            if (reseedInProgress) {
     683                // While reseed occurring, show status message instead
     684                buf.append("<i>").append(System.getProperty("net.i2p.router.web.ReseedHandler.statusMessage","")).append("</i><br>");
     685            } else {
     686                // While no reseed occurring, show reseed link
     687                long nonce = _context.random().nextLong();
     688                String prev = System.getProperty("net.i2p.router.web.ReseedHandler.nonce");
     689                if (prev != null) System.setProperty("net.i2p.router.web.ReseedHandler.noncePrev", prev);
     690                System.setProperty("net.i2p.router.web.ReseedHandler.nonce", nonce+"");
     691                String uri = getRequestURI();
     692                buf.append("<p><form action=\"").append(uri).append("\" method=\"POST\">\n");
     693                buf.append("<input type=\"hidden\" name=\"reseedNonce\" value=\"").append(nonce).append("\" >\n");
     694                buf.append("<button type=\"submit\" class=\"reload\" value=\"Reseed\" >").append(_("Reseed")).append("</button></form></p>\n");
     695            }
     696        }
     697        // If a new reseed ain't running, and the last reseed had errors, show error message
     698        if (!reseedInProgress) {
     699            String reseedErrorMessage = System.getProperty("net.i2p.router.web.ReseedHandler.errorMessage","");
     700            if (reseedErrorMessage.length() > 0) {
     701                buf.append("<i>").append(reseedErrorMessage).append("</i><br>");
     702            }
     703        }
     704        if (buf.length() <= 0)
     705            return "";
     706        buf.append("<hr>");
     707        return buf.toString();
     708    }
     709
    665710    /** output the summary bar to _out */
    666711    public void renderSummaryBar() throws IOException {
  • apps/routerconsole/jsp/index.jsp

    rab1ee37 r1997be37  
    1 <%@page contentType="text/html"%>
     1<%@page contentType="text/plain"%>
    22<%@page pageEncoding="UTF-8"%>
    3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    4 
    5 <html><head>
    6 <%@include file="css.jsi" %>
    7 <%=intl.title("home")%>
    8 </head><body>
    93<%
    10     String consoleNonce = System.getProperty("router.consoleNonce");
    11     if (consoleNonce == null) {
    12         consoleNonce = Long.toString(new java.util.Random().nextLong());
    13         System.setProperty("router.consoleNonce", consoleNonce);
    14     }
     4    response.setStatus(302, "Moved");
     5    String req = request.getRequestURI();
     6    if (req.endsWith("index"))
     7        req = req.substring(0, req.length() - 5);
     8    else if (req.endsWith("index.jsp"))
     9        req = req.substring(0, req.length() - 9);
     10    if (!req.endsWith("/"))
     11        req += '/';
     12    boolean oldHome = net.i2p.I2PAppContext.getGlobalContext().getBooleanProperty("routerconsole.oldHomePage");
     13    if (oldHome)
     14        req += "console";
     15    else
     16        req += "home";
     17    response.setHeader("Location", req);
    1518%>
    16 
    17 <%@include file="summary.jsi" %><h1><%=intl._("I2P Router Console")%></h1>
    18 <div class="news" id="news">
    19  <jsp:useBean class="net.i2p.router.web.NewsHelper" id="newshelper" scope="request" />
    20  <jsp:setProperty name="newshelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    21 <%
    22    if (newshelper.shouldShowNews()) {
    23        java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml");
    24 %>
    25  <jsp:setProperty name="newshelper" property="page" value="<%=fpath.getAbsolutePath()%>" />
    26  <jsp:setProperty name="newshelper" property="maxLines" value="300" />
    27  <jsp:getProperty name="newshelper" property="content" />
    28  <hr>
    29 <%
    30    }  // shouldShowNews()
    31 %>
    32  <jsp:useBean class="net.i2p.router.web.ConfigUpdateHelper" id="updatehelper" scope="request" />
    33  <jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    34  <jsp:getProperty name="updatehelper" property="newsStatus" /><br>
    35 </div><div class="main" id="main">
    36  <jsp:useBean class="net.i2p.router.web.ContentHelper" id="contenthelper" scope="request" />
    37  <div class="welcome">
    38   <div class="langbox">
    39     <a href="/?lang=en&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=us" title="English" alt="English"></a>
    40     <a href="/?lang=ar&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=lang_ar" title="عربية" alt="عربية"></a>
    41     <a href="/?lang=zh&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=cn" title="中文" alt="中文"></a>
    42     <a href="/?lang=cs&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=cs" title="Czech" alt="Czech"></a>
    43     <a href="/?lang=da&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=dk" title="Danish" alt="Danish"></a>
    44     <a href="/?lang=de&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=de" title="Deutsch" alt="Deutsch"></a>
    45     <a href="/?lang=ee&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=ee" title="Eesti" alt="Eesti"></a>
    46     <a href="/?lang=es&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=es" title="Español" alt="Español"></a>
    47     <a href="/?lang=fi&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=fi" title="Suomi" alt="Suomi"></a>
    48     <a href="/?lang=fr&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=fr" title="Français" alt="Français"></a><br>
    49     <a href="/?lang=it&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=it" title="Italiano" alt="Italiano"></a>
    50     <a href="/?lang=nl&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=nl" title="Nederlands" alt="Nederlands"></a>
    51     <a href="/?lang=pl&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=pl" title="Polski" alt="Polski"></a>
    52     <a href="/?lang=pt&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=pt" title="Português" alt="Português"></a>
    53     <a href="/?lang=ru&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=ru" title="Русский" alt="Русский"></a>
    54     <a href="/?lang=sv&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=se" title="Svenska" alt="Svenska"></a>
    55     <a href="/?lang=uk&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=ua" title="Ukrainian" alt="Ukrainian"></a>
    56     <a href="/?lang=vi&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=vn" title="Tiếng Việt" alt="Tiếng Việt"></a>
    57   </div>
    58   <a name="top"></a>
    59   <h2><%=intl._("Welcome to I2P")%></h2>
    60  </div>
    61  <% java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getBaseDir(), "docs/readme.html"); %>
    62  <jsp:setProperty name="contenthelper" property="page" value="<%=fpath.getAbsolutePath()%>" />
    63  <jsp:setProperty name="contenthelper" property="maxLines" value="300" />
    64  <jsp:setProperty name="contenthelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
    65  <jsp:getProperty name="contenthelper" property="content" />
    66 </div></body></html>
  • installer/resources/themes/console/light/console.css

    rab1ee37 r1997be37  
    636636}
    637637
     638div.search table {
     639     background: none;
     640     margin: 20px;
     641     padding: 8px;
     642     width: auto;
     643}
     644
    638645img.app {
     646     height: 40px;
     647     width: 40px;
     648     padding: 8px;
     649}
     650
     651img.app2p {
    639652     height: 48px;
    640      width: 48px;
    641      padding: 8px;
     653     padding: 3px 8px;
    642654}
    643655
Note: See TracChangeset for help on using the changeset viewer.