Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core operations interface WIP #846

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/freenet/clients/http/WelcomeToadlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
ArneBab marked this conversation as resolved.
Show resolved Hide resolved

HashMap<String, Object> 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");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.core-operations-interface--container {
display: flex;
flex-direction: row;
width: 100%;
}
.core-operations-interface--column {
flex-grow: 1;
}
10 changes: 10 additions & 0 deletions src/freenet/clients/http/templates/core-operations-interface.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="core-operations-interface--container">
<div class="core-operations-interface--column core-operations-interface--friend-messages">
Messaging
</div>
<div class="core-operations-interface--column core-operations-interface--invite">
Invite
</div>
<!--<input name="formPassword" type="hidden" value="{{ formPassword }}">-->
<!--{{ l10n("networkSecurityPageTitle") }}-->
</div>
1 change: 1 addition & 0 deletions src/freenet/l10n/freenet.l10n.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading