diff --git a/src/freenet/clients/http/WelcomeToadlet.java b/src/freenet/clients/http/WelcomeToadlet.java index 944ba16bb6..044ae5d03b 100644 --- a/src/freenet/clients/http/WelcomeToadlet.java +++ b/src/freenet/clients/http/WelcomeToadlet.java @@ -3,6 +3,7 @@ * http://www.gnu.org/ for further details of the GPL. */ package freenet.clients.http; +import freenet.clients.http.utils.PebbleUtils; import freenet.config.InvalidConfigValueException; import freenet.config.NodeNeedRestartException; import freenet.node.*; @@ -13,6 +14,7 @@ import java.io.File; import java.io.IOException; import java.net.URI; +import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -522,6 +524,9 @@ public void handleMethodGET(URI uri, HTTPRequest request, ToadletContext ctx) th if (ctx.isAllowedFullAccess()) { contentNode.addChild(ctx.getAlertManager().createSummary()); } + + page.addCustomStyleSheet("/static/core-operations-interface.css"); + this.putCoreOperationsInterface(ctx, contentNode); if (node.config.get("fproxy").getBoolean("fetchKeyBoxAboveBookmarks")) { this.putFetchKeyBox(ctx, contentNode); @@ -583,7 +588,20 @@ public void handleMethodGET(URI uri, HTTPRequest request, ToadletContext ctx) th this.writeHTMLReply(ctx, 200, "OK", pageNode.generate()); } - private void putFetchKeyBox(ToadletContext ctx, HTMLNode contentNode) { + private void putCoreOperationsInterface(ToadletContext ctx, HTMLNode contentNode) throws IOException { + HTMLNode coreOperationsBox = ctx.getPageMaker().getInfobox("infobox-normal", l10n("nodeOperationLabel"), contentNode, "node-operation", true); + coreOperationsBox.addAttribute("id", "coreNodeOperation"); + + HashMap model = new HashMap<>(); + model.put("formPassword", node.clientCore.getToadletContainer().getFormPassword()); + PebbleUtils.addChild( + coreOperationsBox, + "core-operations-interface", + model, + "WelcomeToadlet"); + } + + private void putFetchKeyBox(ToadletContext ctx, HTMLNode contentNode) { // Fetch-a-key box HTMLNode fetchKeyContent = ctx.getPageMaker().getInfobox("infobox-normal", l10n("fetchKeyLabel"), contentNode, "fetch-key", true); fetchKeyContent.addAttribute("id", "keyfetchbox"); diff --git a/src/freenet/clients/http/staticfiles/core-operations-interface.css b/src/freenet/clients/http/staticfiles/core-operations-interface.css new file mode 100644 index 0000000000..82ad8dfb17 --- /dev/null +++ b/src/freenet/clients/http/staticfiles/core-operations-interface.css @@ -0,0 +1,8 @@ +.core-operations-interface--container { + display: flex; + flex-direction: row; + width: 100%; +} +.core-operations-interface--column { + flex-grow: 1; +} diff --git a/src/freenet/clients/http/templates/core-operations-interface.html b/src/freenet/clients/http/templates/core-operations-interface.html new file mode 100644 index 0000000000..44466a02eb --- /dev/null +++ b/src/freenet/clients/http/templates/core-operations-interface.html @@ -0,0 +1,10 @@ +
+
+ Messaging +
+
+ Invite +
+ + +
diff --git a/src/freenet/l10n/freenet.l10n.en.properties b/src/freenet/l10n/freenet.l10n.en.properties index 0d5da8d495..c7a971a7b3 100644 --- a/src/freenet/l10n/freenet.l10n.en.properties +++ b/src/freenet/l10n/freenet.l10n.en.properties @@ -2259,6 +2259,7 @@ WelcomeToadlet.confirmFIN=Do you want to insert the following Frost message? WelcomeToadlet.disabledAlert=Disabled alert WelcomeToadlet.extVersion=Freenet-ext Build #${build} r${rev} WelcomeToadlet.fetch=Fetch +WelcomeToadlet.nodeOperationLabel=Core node operation WelcomeToadlet.fetchKeyLabel=Visit a freesite or download a file (if you know the key) WelcomeToadlet.finInsertSuccessWithKey=The message has been inserted successfully into ${key}. WelcomeToadlet.finInsertedTitle=Insertion