purge toopie.html from the plugin
This commit is contained in:
1
Makefile
1
Makefile
@ -243,7 +243,6 @@ fmt-html:
|
||||
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes index.html > .index.html; mv .index.html index.html
|
||||
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes window.html > .window.html; mv .window.html window.html
|
||||
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes home.html > .home.html; mv .home.html home.html
|
||||
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes toopie.html > .toopie.html; mv .toopie.html toopie.html
|
||||
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes security.html > .security.html; mv .security.html security.html
|
||||
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes options/options.html > options/.options.html; mv options/.options.html options/options.html
|
||||
|
||||
|
10
content.js
10
content.js
@ -80,13 +80,3 @@ fetch("http://127.0.0.1:7657/themes/console/light/images/i2plogo.png")
|
||||
var consoleLinks = document.querySelectorAll(".application-info");
|
||||
hide(consoleLinks);
|
||||
});
|
||||
|
||||
fetch("http://127.0.0.1:7657/jsonrpc/")
|
||||
.then((myJson) => {
|
||||
var toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
unhide(toopieLinks);
|
||||
})
|
||||
.catch((error) => {
|
||||
var toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
hide(toopieLinks);
|
||||
});
|
||||
|
@ -63,10 +63,6 @@
|
||||
<p id="applicationExplain">These applications use I2P to provide them with security and privacy.</p>
|
||||
|
||||
<ul>
|
||||
<li class="application window-visit-toopie">
|
||||
<a class="applicationName window-visit-toopie" href="#" id="window-visit-toopie">Toopie</a> <span class="applicationDesc window-visit-toopie" id="toopie">For information about your I2P router status, go here:</span>
|
||||
</li>
|
||||
|
||||
<li class="application">
|
||||
<a class="applicationName" href="http://127.0.0.1:7657/" id="window-visit-router">Router Console</a> <span class="applicationDesc" id="routerConsole">The entrypoint for all other I2P applications is the I2P Router Console. To visit it, click here.</span>
|
||||
</li>
|
||||
|
@ -1,8 +0,0 @@
|
||||
toopie.html/i2pcontrol.js
|
||||
=========================
|
||||
|
||||
To enable toopie.html, the built in I2P monitoring system in this webextension,
|
||||
go to the [Web App Configuration page in the I2P Router and start I2PControl](http://127.0.0.1:7657/configwebapps).
|
||||
Click the "Start" button next to the menu item that says `jsonrpc`.
|
||||
|
||||
- 
|
@ -1,461 +0,0 @@
|
||||
/* eslint-disable multiline-ternary */
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
/* eslint-disable no-plusplus */
|
||||
/* eslint-disable max-params */
|
||||
/* eslint-disable no-inline-comments */
|
||||
/* eslint-disable line-comment-position */
|
||||
/* eslint-disable max-len */
|
||||
/* eslint-disable no-ternary */
|
||||
|
||||
if (browser.windows != undefined) {
|
||||
var hello = "hello i2pcontrol";
|
||||
|
||||
function makeid(length) {
|
||||
var result = "";
|
||||
var characters =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
var charactersLength = characters.length;
|
||||
for (var index = 0; index < length; index++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function send(
|
||||
message,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
async function postData(url = "", data = {}) {
|
||||
// Default options are marked with *
|
||||
let requestBody = JSON.stringify(data);
|
||||
//console.log("(i2pcontrol) sending request", requestBody);
|
||||
let opts = {
|
||||
method: "POST", // *GET, POST, PUT, DELETE, etc.
|
||||
mode: "cors", // no-cors, *cors, same-origin
|
||||
cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
|
||||
_credentials: "same-origin", // include, *same-origin, omit
|
||||
get credentials() {
|
||||
return this._credentials;
|
||||
},
|
||||
set credentials(value) {
|
||||
this._credentials = value;
|
||||
},
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
redirect: "follow", // manual, *follow, error
|
||||
referrerPolicy: "no-referrer", // no-referrer, *client
|
||||
body: requestBody // body data type must match "Content-Type" header
|
||||
};
|
||||
const response = await fetch(url, opts);
|
||||
return response.json(); // parses JSON response into native JavaScript objects
|
||||
}
|
||||
|
||||
//console.log("http://" + control_host + ":" + control_port + "/" + control_path)
|
||||
return postData(
|
||||
"http://" + control_host + ":" + control_port + "/" + control_path + "/",
|
||||
message
|
||||
);
|
||||
}
|
||||
|
||||
const authenticate = (
|
||||
password = "itoopie",
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) => {
|
||||
var json = {};
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "Authenticate";
|
||||
json["params"] = {};
|
||||
json["params"]["API"] = 1;
|
||||
json["params"]["Password"] = password;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
};
|
||||
|
||||
const GetToken = (
|
||||
password = "itoopie",
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) => {
|
||||
function gettoken(authtoken) {
|
||||
return authtoken.result.Token;
|
||||
}
|
||||
let me = authenticate(password, control_host, control_port, control_path);
|
||||
return me.then(gettoken);
|
||||
};
|
||||
|
||||
async function Echo(
|
||||
message,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function echo(token) {
|
||||
console.log("(i2pcontrol) testing I2PControl connection");
|
||||
var json = {};
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "Echo";
|
||||
json["params"] = {};
|
||||
json["params"]["Token"] = token;
|
||||
json["params"]["Echo"] = message;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(echo);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateEchoElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null) {
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
}
|
||||
let net = Echo(Query, control_host, control_port, control_path, password);
|
||||
net.then(updateelement);
|
||||
}
|
||||
|
||||
async function GetRate(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function getrate(token) {
|
||||
var json = {};
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "I2PControl";
|
||||
json["params"] = {};
|
||||
json["params"]["Token"] = token;
|
||||
json["params"]["Stat"] = Query;
|
||||
json["params"]["Period"] = 2000;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(getrate);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateGetRateElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null) {
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
}
|
||||
let net = GetRate(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateelement);
|
||||
}
|
||||
|
||||
async function I2PControl(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function i2pcontrol(token) {
|
||||
var json = {};
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "I2PControl";
|
||||
json["params"] = {};
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(i2pcontrol);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateI2PControlElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null) {
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
}
|
||||
let net = I2PControl(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateelement);
|
||||
}
|
||||
|
||||
async function RouterInfo(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function routerinfo(token) {
|
||||
var json = {};
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "RouterInfo";
|
||||
json["params"] = {};
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(routerinfo);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateRouterInfoElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
/*console.log(
|
||||
"(i2pcontrol) element",
|
||||
update.result[Query],
|
||||
ID,
|
||||
document.getElementById(ID)
|
||||
);*/
|
||||
if (document.getElementById(ID) !== null) {
|
||||
document.getElementById(ID).innerText = update.result[Query];
|
||||
}
|
||||
}
|
||||
|
||||
let net = RouterInfo(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateelement);
|
||||
}
|
||||
|
||||
async function RouterManager(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function routermanager(token) {
|
||||
var json = {};
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "RouterManager";
|
||||
json["params"] = {};
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(routermanager);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateRouterManagerElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null) {
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
}
|
||||
let net = RouterManager(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateelement);
|
||||
}
|
||||
|
||||
async function NetworkSetting(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function networksetting(token) {
|
||||
var json = {};
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "NetworkSetting";
|
||||
json["params"] = {};
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(networksetting);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateNetworkSettingElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
let net = NetworkSetting(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateelement);
|
||||
}
|
||||
|
||||
if (UpdateContents !== undefined) {
|
||||
UpdateContents();
|
||||
}
|
||||
|
||||
const minutes = 0.2;
|
||||
const interval = minutes * 60 * 1000;
|
||||
|
||||
setInterval(function () {
|
||||
if (UpdateContents !== undefined) {
|
||||
UpdateContents();
|
||||
}
|
||||
}, interval);
|
||||
|
||||
function UpdateContents() {
|
||||
UpdateRouterInfoElementByID("i2p.router.status", "router-status");
|
||||
UpdateRouterInfoElementByID("i2p.router.uptime", "router-uptime");
|
||||
UpdateRouterInfoElementByID("i2p.router.version", "router-version");
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.inbound.1s",
|
||||
"router-net-bw-inbound-1s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.inbound.15s",
|
||||
"router-net-bw-inbound-15s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.outbound.1s",
|
||||
"router-net-bw-outbound-1s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.outbound.15s",
|
||||
"router-net-bw-outbound-15s"
|
||||
);
|
||||
UpdateRouterInfoElementByID("i2p.router.net.status", "router-net-status");
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.tunnels.participating",
|
||||
"router-net-tunnels-participating"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.activepeers",
|
||||
"router-netdb-activepeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.fastpeers",
|
||||
"router-netdb-fastpeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.highcapacitypeers",
|
||||
"router-netdb-highcapacitypeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.isreseeding",
|
||||
"router-netdb-isreseeding"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.knownpeers",
|
||||
"router-netdb-knownpeers"
|
||||
);
|
||||
}
|
||||
|
||||
var done = Echo(hello);
|
||||
done.then(Done).catch(Done);
|
||||
|
||||
function Done(output) {
|
||||
function hide(elements) {
|
||||
var elementlist = elements.length ? elements : [elements];
|
||||
for (var index = 0; index < elementlist.length; index++) {
|
||||
if (elementlist[index].style !== undefined) {
|
||||
elementlist[index].classList.add("hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unhide(elements) {
|
||||
var elementlist = elements.length ? elements : [elements];
|
||||
for (var index = 0; index < elementlist.length; index++) {
|
||||
if (elementlist[index].style !== undefined) {
|
||||
elementlist[index].classList.remove("hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log("(i2pcontrol) I2PControl connection tested,", output.result.Result);
|
||||
var toopieLinks = "";
|
||||
if (output.result.Result == hello) {
|
||||
toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
unhide(toopieLinks);
|
||||
} else {
|
||||
toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
hide(toopieLinks);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 109 KiB |
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>I2P in Private Browsing Mode</title>
|
||||
<link rel="stylesheet" type="text/css" href="../home.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../sidebar.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 id="toopie.htmli2pcontrol.js">toopie.html/i2pcontrol.js</h1>
|
||||
<p>To enable toopie.html, the built in I2P monitoring system in this webextension, go to the <a href="http://127.0.0.1:7657/configwebapps">Web App Configuration page in the I2P Router and start I2PControl</a>. Click the "Start" button next to the menu item that says <code>jsonrpc</code>.</p>
|
||||
<ul>
|
||||
<li><img src="i2pcontrol.png" title="fig:" alt="i2pcontrol.png" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -122,12 +122,6 @@ them with the proxy enforced.</li>
|
||||
use</li>
|
||||
<li><img src="i2ptunnel.png" alt="Visiting i2ptunnel" title="" /></li>
|
||||
<li>[ready] <strong>Provide</strong> help in a variety of languages.</li>
|
||||
<li>[done] <strong>Monitor</strong> the health and readiness of the I2P router it is
|
||||
instructed to use. Currently the plugin checks whether the HTTP Proxy is
|
||||
working by fetching an image from "http://proxy.i2p" and displaying a result.
|
||||
A work-in-progress binding to i2pcontrol is available in ./i2pcontrol, it is
|
||||
inert at this time.</li>
|
||||
<li><img src="toopie.png" alt="Visiting toopie.html" title="" /></li>
|
||||
<li>[Done] <strong>Handle</strong> router console applications under their own origins and
|
||||
within their own contextual identity. (1) The router console is automatically
|
||||
confined to it's own container tab. (2) Use a custom protocol handler to
|
||||
|
15
info.js
15
info.js
@ -130,9 +130,6 @@ function clickHandler(clickEvent) {
|
||||
case "console":
|
||||
goConsole();
|
||||
break;
|
||||
case "toopie":
|
||||
goToopie();
|
||||
break;
|
||||
case "i2ptunnel":
|
||||
goTunnel();
|
||||
break;
|
||||
@ -266,18 +263,6 @@ function goHelp() {
|
||||
creating.then(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function goToopie() {
|
||||
function onTabError() {
|
||||
console.log("(info) Toopie tab created");
|
||||
}
|
||||
console.log("(info) visiting toopie");
|
||||
let creating = browser.sidebarAction.open();
|
||||
browser.sidebarAction.setPanel({
|
||||
panel: browser.runtime.getURL("/toopie.html"),
|
||||
});
|
||||
creating.then(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function onTabCreated() {
|
||||
console.log("(info) Tab Created");
|
||||
}
|
||||
|
@ -39,13 +39,6 @@
|
||||
"default_title": "__MSG_extensionName__",
|
||||
"default_popup": "window.html"
|
||||
},
|
||||
"sidebar_action": {
|
||||
"browser_style": true,
|
||||
"default_icon": "icons/i2plogo.png",
|
||||
"default_title": "__MSG_toopieName__",
|
||||
"default_panel": "toopie.html",
|
||||
"open_at_install": false
|
||||
},
|
||||
"page_action": {
|
||||
"browser_style": true,
|
||||
"default_title": "__MSG_toopieTLS__",
|
||||
|
@ -39,13 +39,6 @@
|
||||
"default_title": "__MSG_extensionName__",
|
||||
"default_popup": "window.html"
|
||||
},
|
||||
"sidebar_action": {
|
||||
"browser_style": true,
|
||||
"default_icon": "icons/i2plogo.png",
|
||||
"default_title": "__MSG_toopieName__",
|
||||
"default_panel": "toopie.html",
|
||||
"open_at_install": false
|
||||
},
|
||||
"page_action": {
|
||||
"browser_style": true,
|
||||
"default_title": "__MSG_toopieTLS__",
|
||||
|
@ -149,5 +149,4 @@ contentUpdateById("window-visit-router", "window-visit-router");
|
||||
contentUpdateById("window-visit-snark", "window-visit-snark");
|
||||
contentUpdateById("window-visit-sources", "window-visit-sources");
|
||||
contentUpdateById("window-visit-susimail", "window-visit-susimail");
|
||||
contentUpdateById("window-visit-toopie", "window-visit-toopie");
|
||||
contentUpdateById("window-visit-torrent", "window-visit-torrent");
|
||||
|
@ -54,30 +54,13 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="scheme-options control-options" id="control-options">
|
||||
<div>
|
||||
<div class="title">
|
||||
I2PControl RPC Client Options
|
||||
</div>
|
||||
|
||||
<p id="rpcHelpText">Configure your I2PControl options here.</p>
|
||||
<label id="rpcPortText">Control Host:</label> <input data="rpchost" id="rpchost" type="text" value="127.0.0.1">
|
||||
<br>
|
||||
<label id="rpcHostText">Control Port:</label> <input data="rpcport" id="rpcport" type="text" value="7657">
|
||||
<br>
|
||||
<label id="rpcPathText">Control Path:</label> <input data="rpcpath" id="rpcpath" type="text" value="jsonrpc">
|
||||
<br>
|
||||
<label id="rpcPassText">Control Password:</label> <input data="rpcpass" id="rpcpass" type="text" value="itoopie">
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="scheme-options transmission-options" id="transmission-options">
|
||||
<div>
|
||||
<div class="title">
|
||||
Bittorrent RPC Client Options
|
||||
</div>
|
||||
|
||||
<p id="rpcHelpText">Configure your Bittorrent options here.</p>
|
||||
<p id="btRpcHelpText">Configure your Bittorrent options here.</p>
|
||||
<label id="btRpcHostText">Torrent RPC Host:</label> <input data="btrpchost" id="btrpchost" type="text" value="127.0.0.1">
|
||||
<br>
|
||||
<label id="btRpcPortText">Torrent RPC Port:</label> <input data="btrpcport" id="btrpcport" type="text" value="7657">
|
||||
|
@ -176,66 +176,6 @@ function getFromHTMLValueControlPort() {
|
||||
return control_port;
|
||||
}
|
||||
|
||||
function getFromStorageRPCHost() {
|
||||
let rpc_host = getStringFromStorage("rpc_host", "127.0.0.1");
|
||||
console.info("(options)Got i2pcontrol rpc host:", rpc_host);
|
||||
return rpc_host;
|
||||
}
|
||||
|
||||
function getFromHTMLValueRPCHost() {
|
||||
let rpc_host = document.getElementById("rpchost").value;
|
||||
console.log("(options)Got i2pcontrol rpc host:", rpc_host);
|
||||
if (rpc_host == undefined) {
|
||||
return "127.0.0.1";
|
||||
}
|
||||
return rpc_host;
|
||||
}
|
||||
|
||||
function getFromStorageRPCPort() {
|
||||
let rpc_port = getStringFromStorage("rpc_port", "7657");
|
||||
console.info("(options)Got i2pcontrol rpc port:", rpc_port);
|
||||
return rpc_port;
|
||||
}
|
||||
|
||||
function getFromHTMLValueRPCPort() {
|
||||
let rpc_port = document.getElementById("rpcport").value;
|
||||
console.log("(options)Got i2pcontrol rpc port:", rpc_port);
|
||||
if (rpc_port == undefined) {
|
||||
return "7657";
|
||||
}
|
||||
return rpc_port;
|
||||
}
|
||||
|
||||
function getFromStorageRPCPath() {
|
||||
let rpc_path = getStringFromStorage("rpc_path", "jsonrpc");
|
||||
console.info("(options)Got i2pcontrol rpc path:", rpc_path);
|
||||
return rpc_path;
|
||||
}
|
||||
|
||||
function getFromHTMLValueRPCPath() {
|
||||
let rpc_path = document.getElementById("rpcpath").value;
|
||||
console.log("(options)Got i2pcontrol rpc path:", rpc_path);
|
||||
if (rpc_path == undefined) {
|
||||
return "jsonrpc";
|
||||
}
|
||||
return rpc_path;
|
||||
}
|
||||
|
||||
function getFromStorageRPCPass() {
|
||||
let rpc_pass = getStringFromStorage("rpc_pass", "itoopie");
|
||||
console.info("(options)Got i2pcontrol rpc password:", rpc_pass);
|
||||
return rpc_pass;
|
||||
}
|
||||
|
||||
function getFromHTMLValueRPCPass() {
|
||||
let rpc_pass = document.getElementById("rpcpass").value;
|
||||
console.log("(options)Got i2pcontrol rpc password:");
|
||||
if (rpc_pass == undefined) {
|
||||
return "itoopie";
|
||||
}
|
||||
return rpc_pass;
|
||||
}
|
||||
|
||||
function getFromStorageBTRPCHost() {
|
||||
let bt_rpc_host = getStringFromStorage("bt_rpc_host", "127.0.0.1");
|
||||
console.info("(options)Got torrent rpc host:", bt_rpc_host);
|
||||
@ -316,11 +256,6 @@ function checkStoredSettings(storedSettings) {
|
||||
settings.control_host =
|
||||
storedSettings.control_host || (host === "" ? "127.0.0.1" : host);
|
||||
settings.control_port = storedSettings.control_port || 7657;
|
||||
settings.rpc_host =
|
||||
storedSettings.rpc_host || (host === "" ? "127.0.0.1" : host);
|
||||
settings.rpc_port = storedSettings.rpc_port || 7657;
|
||||
settings.rpc_path = storedSettings.rpc_path || "jsonrpc";
|
||||
settings.rpc_pass = storedSettings.rpc_pass || "itoopie";
|
||||
settings.bt_rpc_host =
|
||||
storedSettings.bt_rpc_host || (host === "" ? "127.0.0.1" : host);
|
||||
settings.bt_rpc_port = storedSettings.bt_rpc_port || 7657;
|
||||
@ -347,10 +282,6 @@ function checkAndroidStoredSettings(settings) {
|
||||
proxyPort: 4444,
|
||||
controlHost: "127.0.0.1",
|
||||
controlPort: 7657,
|
||||
rpcHost: "127.0.0.1",
|
||||
rpcPort: 7657,
|
||||
rpcPath: "jsonrpc",
|
||||
rpcPass: "itoopie",
|
||||
btRpcHost: "127.0.0.1",
|
||||
btRpcPort: 7657,
|
||||
btRpcPath: "transmission/rpc",
|
||||
@ -378,17 +309,13 @@ function storeSettings() {
|
||||
storableSettings["proxy_port"] = getFromHTMLValuePort();
|
||||
storableSettings["control_host"] = getFromHTMLValueControlHost();
|
||||
storableSettings["control_port"] = getFromHTMLValueControlPort();
|
||||
storableSettings["rpc_host"] = getFromHTMLValueRPCHost();
|
||||
storableSettings["rpc_port"] = getFromHTMLValueRPCPort();
|
||||
storableSettings["rpc_path"] = getFromHTMLValueRPCPath();
|
||||
storableSettings["rpc_pass"] = getFromHTMLValueRPCPass();
|
||||
storableSettings["bt_rpc_host"] = getFromHTMLValueBTRPCHost();
|
||||
storableSettings["bt_rpc_port"] = getFromHTMLValueBTRPCPort();
|
||||
storableSettings["bt_rpc_path"] = getFromHTMLValueBTRPCPath();
|
||||
storableSettings["bt_rpc_pass"] = getFromHTMLValueBTRPCPass();
|
||||
storableSettings["base_url"] =
|
||||
"http://" +
|
||||
storableSettings["rpc_host"] +
|
||||
storableSettings["bt_rpc_host"] +
|
||||
":" +
|
||||
storableSettings["bt_rpc_port"] +
|
||||
"/" +
|
||||
@ -434,30 +361,6 @@ function updateUI(restoredSettings) {
|
||||
}
|
||||
//console.log("(options)showing control port:", controlportitem.value);
|
||||
|
||||
const rpchostitem = document.getElementById("rpchost");
|
||||
if (rpchostitem != undefined) {
|
||||
rpchostitem.value = restoredSettings.rpc_host;
|
||||
}
|
||||
//console.log("(options)showing rpc host:", rpchostitem.value);
|
||||
|
||||
const rpcportitem = document.getElementById("rpcport");
|
||||
if (rpcportitem != undefined) {
|
||||
rpcportitem.value = restoredSettings.rpc_port;
|
||||
}
|
||||
//console.log("(options)showing rpc port:", rpcportitem.value);
|
||||
|
||||
const rpcpathitem = document.getElementById("rpcpath");
|
||||
if (rpcpathitem != undefined) {
|
||||
rpcpathitem.value = restoredSettings.rpc_path;
|
||||
}
|
||||
//console.log("(options)showing rpc path:", rpcpathitem.value);
|
||||
|
||||
const rpcpassitem = document.getElementById("rpcpass");
|
||||
if (rpcpassitem != undefined) {
|
||||
rpcpassitem.value = restoredSettings.rpc_pass;
|
||||
}
|
||||
//console.log("(options)showing rpc pass:");
|
||||
|
||||
const btrpchostitem = document.getElementById("btrpchost");
|
||||
if (btrpchostitem != undefined) {
|
||||
btrpchostitem.value = restoredSettings.bt_rpc_host;
|
||||
|
16
proxyinfo.js
16
proxyinfo.js
@ -60,19 +60,3 @@ fetch("http://127.0.0.1:7657/themes/console/light/images/i2plogo.png")
|
||||
var consoleLinks = document.querySelectorAll(".application-info");
|
||||
hide(consoleLinks);
|
||||
});
|
||||
|
||||
fetch("http://127.0.0.1:7657/jsonrpc/")
|
||||
.then((myJson) => {
|
||||
console.log("(proxyinfo) json test pass", myJson);
|
||||
var toopieLinks = document.querySelectorAll("#window-visit-toopie");
|
||||
unhide(toopieLinks);
|
||||
var toopieIDLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
unhide(toopieIDLinks);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("(proxyinfo) json test fail", error);
|
||||
var toopieLinks = document.querySelectorAll("#window-visit-toopie");
|
||||
hide(toopieLinks);
|
||||
var toopieIDLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
hide(toopieIDLinks);
|
||||
});
|
||||
|
10
sidebar.css
10
sidebar.css
@ -2,13 +2,6 @@ li {
|
||||
width: 90%;
|
||||
margin-left: 0
|
||||
}
|
||||
li.toopie {
|
||||
width: fit-content;
|
||||
margin-left: 0;
|
||||
display: inline-table!important;
|
||||
min-width: 30%;
|
||||
max-width: 30%
|
||||
}
|
||||
ul {
|
||||
width: 100%
|
||||
}
|
||||
@ -27,7 +20,4 @@ button {
|
||||
}
|
||||
.hidden {
|
||||
display: none
|
||||
}
|
||||
.toopiebody {
|
||||
min-width: 400px
|
||||
}
|
89
toopie.html
89
toopie.html
@ -1,89 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>I2P Router Information</title>
|
||||
<link href="home.css" rel="stylesheet" type="text/css">
|
||||
<link href="sidebar.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<script src="i2pcontrol/i2pcontrol.js"></script>
|
||||
<script src="messages.js" type="text/javascript"></script>
|
||||
<script src="content.js"></script>
|
||||
<script src="proxyinfo.js" type="text/javascript"></script>
|
||||
<h1>I2P Router Information</h1>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="http://localhost:7657" target="_blank"><img alt="i2p router console" class="center" src="/icons/i2plogo.png"></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="button-list toopie">
|
||||
<li class="toopie"><button id="label-router-restart" target="_blank"><img alt="Restart:" id="label-router-shutdown" src="/images/restart.svg"></button>
|
||||
<br>
|
||||
<span id="router-restart">Gracefully restart router</span>
|
||||
</li>
|
||||
|
||||
<li class="toopie"><button id="label-router-shutdown" target="_blank"><img alt="Shutdown:" id="label-router-shutdown" src="/images/shutdown.svg"></button>
|
||||
<br>
|
||||
<span id="router-shutdown">Gracefully shutdown router</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><button id="label-router-status" target="_blank">Status</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="label-list" id="label-status-list">
|
||||
<li><span id="label-router-status">Router Status:</span> <span id="router-status">Replace with Router Status</span></li>
|
||||
|
||||
<li><span id="label-router-uptime">Router Uptime(Ms):</span> <span id="router-uptime">Replace with Router Uptime</span></li>
|
||||
|
||||
<li><span id="label-router-version">Router Version:</span> <span id="router-version">Replace with Router Version</span></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><button id="label-router-bandwidth" target="_blank">Bandwidth</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="label-list" id="label-bandwidth-list">
|
||||
<li><span id="label-router-bw-outbound-1s">Outbound bw 1s:</span> <span id="router-net-bw-outbound-1s">Replace with Router Bandwidth Outbound 1s</span></li>
|
||||
|
||||
<li><span id="label-router-bw-outbound-15s">Outbound bw 15s:</span> <span id="router-net-bw-outbound-15s">Replace with Router Bandwidth Outbound 15s</span></li>
|
||||
|
||||
<li><span id="label-router-bw-inbound-1s">Inbound bw 1s:</span> <span id="router-net-bw-inbound-1s">Replace with Router Bandwidth Inbound 1s</span></li>
|
||||
|
||||
<li><span id="label-router-bw-inbound-15s">Inbound bw 15s:</span> <span id="router-net-bw-inbound-15s">Replace with Router Bandwidth Outbound 15s</span></li>
|
||||
</ul>
|
||||
<!--<li>
|
||||
<span id="label-router-net-status">Network Status:</span>
|
||||
<span id="router-net-status">Replace with Router Network Status</span>
|
||||
</li>-->
|
||||
|
||||
<ul>
|
||||
<li><button id="label-router-peers" target="_blank">Peers</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="label-list" id="label-peers-list">
|
||||
<li><span id="label-router-net-tunnels-participating">Transit Tunnels:</span> <span id="router-net-tunnels-participating">Replace with Router Participating Tunnel Count</span></li>
|
||||
|
||||
<li><span id="label-router-activepeers">Active Peers:</span> <span id="router-netdb-activepeers">Replace with Router Active Peers</span></li>
|
||||
|
||||
<li><span id="label-router-netdb-fastpeers">Fast Peers:</span> <span id="router-netdb-fastpeers">Replace with Router Fast Peers</span></li>
|
||||
|
||||
<li><span id="label-router-netdb-highcapacitypeers">High Capacity Peers:</span> <span id="router-netdb-highcapacitypeers">Replace with High Capacity Peers</span></li>
|
||||
|
||||
<li><span id="label-router-netdb-isreseeding">Reseed status:</span> <span id="router-netdb-isreseeding">Replace with Router netDB Reseeding Status</span></li>
|
||||
|
||||
<li><span id="label-router-netdb-knownpeers">Known Peers:</span> <span id="router-netdb-knownpeers">Replace with Router Known Peers</span></li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -87,8 +87,6 @@
|
||||
|
||||
<li class="application"><button class="applicationName window-visit-console" href="#" id="window-visit-console" target="_blank">I2P Router Console</button> <span class="applicationDesc" id="aboutconsole">To access the homepage of the router console, go here:</span></li>
|
||||
|
||||
<li class="application window-visit-toopie"><button class="applicationName window-visit-toopie" href="#" id="window-visit-toopie" target="_blank">Toopie</button> <span class="applicationDesc window-visit-toopie" id="toopie">For information about your I2P router status, go here:</span></li>
|
||||
|
||||
<li class="application"><button class="applicationName" id="window-visit-i2ptunnel" target="_blank">Hidden Services Manager</button> <span class="applicationDesc" id="i2ptunnel">I2P has a web-based interface for configuring .i2p services like web sites, to set up your own web sites, go here:</span></li>
|
||||
|
||||
<li class="application"><button class="applicationName" id="window-visit-susimail" target="_blank">E-Mail</button> <span class="applicationDesc" id="susimail">I2P also bundles a webmail client which can be used to access in-I2P e-mail. To use it, go here:</span></li>
|
||||
|
Reference in New Issue
Block a user