Ignore:
Timestamp:
Mar 23, 2019 4:42:37 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
64039ee
Parents:
fea5bd4
Message:

SusiDNS: Add import feature (ticket #2447)
Box overlap issue remains todo, see ticket #2419

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/susidns/src/jsp/addressbook.jsp

    rfea5bd4 rce043943  
    3535    response.setHeader("Accept-Ranges", "none");
    3636
    37 %>
    38 <%@page pageEncoding="UTF-8"%>
    39 <%@ page contentType="text/html"%>
    40 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
     37%><%@page pageEncoding="UTF-8" contentType="text/html" import="net.i2p.servlet.RequestWrapper"
     38%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    4139<jsp:useBean id="version" class="i2p.susi.dns.VersionBean" scope="application" />
    4240<jsp:useBean id="book" class="i2p.susi.dns.NamingServiceBean" scope="session" />
    4341<jsp:useBean id="intl" class="i2p.susi.dns.Messages" scope="application" />
     42<%
     43   String importMessages = null;
     44   if (intl._t("Import").equals(request.getParameter("action"))) {
     45       RequestWrapper wrequest = new RequestWrapper(request);
     46       importMessages = book.importFile(wrequest);
     47   }
     48%>
    4449<jsp:setProperty name="book" property="*" />
    4550<jsp:setProperty name="book" property="resetDeletionMarks" value="1"/>
     
    7681</div>
    7782
    78 <div id="messages">${book.messages}</div>
     83<div id="messages">${book.messages}<%
     84   if (importMessages != null) {
     85       %><%=importMessages%><%
     86   }
     87%></div>
    7988
    8089${book.loadBookMessages}
     
    255264</form>
    256265
     266<% if (!book.getBook().equals("published")) { %>
     267<form method="POST" action="addressbook" enctype="multipart/form-data" accept-charset="UTF-8">
     268<input type="hidden" name="book" value="${book.book}">
     269<input type="hidden" name="serial" value="<%=susiNonce%>">
     270<input type="hidden" name="begin" value="0">
     271<input type="hidden" name="end" value="49">
     272<div id="import">
     273<h3><%=intl._t("Import from hosts.txt file")%></h3>
     274<table>
     275<tr>
     276<td><b><%=intl._t("File")%></b></td>
     277<td><input name="file" type="file" accept=".txt" value="" /></td>
     278</tr>
     279</table>
     280<p class="buttons">
     281<input class="cancel" type="reset" value="<%=intl._t("Cancel")%>" >
     282<input class="download" type="submit" name="action" value="<%=intl._t("Import")%>" >
     283</p>
     284</div>
     285</form>
     286<% } %>
     287
    257288<div id="footer">
    258289<hr>
Note: See TracChangeset for help on using the changeset viewer.