upgrade toopie.html

This commit is contained in:
idk
2020-01-12 17:51:30 -05:00
parent 14fe263e24
commit 12b5f8e7cc
4 changed files with 132 additions and 9 deletions

View File

@@ -241,6 +241,7 @@ fmt:
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
find . -path ./node_modules -prune -o -name '*.js' -exec prettier --write {} \;
find . -path ./node_modules -prune -o -name '*.json' -exec prettier --write {} \;

View File

@@ -196,3 +196,5 @@ for updates, you can download the identical plugin from this repository's
releases page. The latest AMO Plugin will always be identical to the latest
github release, except for the version number, which must be incremented for
submission to AMO.
moz-extension://d63582fc-09fc-445a-b8aa-1c888ee2ffc0/toopie.html

View File

@@ -15,7 +15,7 @@ function makeid(length) {
function send(message) {
async function postData(url = "", data = {}) {
// Default options are marked with *
console.log("(i2pcontrol)")
console.log("(i2pcontrol)");
let requestBody = JSON.stringify(data);
let opts = {
method: "POST", // *GET, POST, PUT, DELETE, etc.
@@ -83,7 +83,7 @@ function Echo(message) {
function UpdateEchoElementByID(Query, ID) {
function updateelement(update) {
console.log("(i2pcontrol)", update)
console.log("(i2pcontrol)", update);
document.getElementById(ID).innerText = update;
}
let net = Echo(Query);
@@ -109,7 +109,7 @@ function GetRate(Query) {
function UpdateGetRateElementByID(Query, ID) {
function updateelement(update) {
console.log("(i2pcontrol)", update)
console.log("(i2pcontrol)", update);
document.getElementById(ID).innerText = update;
}
let net = GetRate(Query);
@@ -134,7 +134,7 @@ function I2PControl(Query) {
function UpdateI2PControlElementByID(Query, ID) {
function updateelement(update) {
console.log("(i2pcontrol)", update)
console.log("(i2pcontrol)", update);
document.getElementById(ID).innerText = update;
}
let net = I2PControl(Query);
@@ -159,7 +159,12 @@ function RouterInfo(Query) {
function UpdateRouterInfoElementByID(Query, ID) {
function updateelement(update) {
console.log("(i2pcontrol)", update.result[Query], ID, document.getElementById(ID))
console.log(
"(i2pcontrol)",
update.result[Query],
ID,
document.getElementById(ID)
);
document.getElementById(ID).innerText = update.result[Query];
}
let net = RouterInfo(Query);
@@ -184,7 +189,7 @@ function RouterManager(Query) {
function UpdateRouterManagerElementByID(Query, ID) {
function updateelement(update) {
console.log("(i2pcontrol)", update)
console.log("(i2pcontrol)", update);
document.getElementById(ID).innerText = update;
}
let net = RouterManage(Query);
@@ -209,14 +214,64 @@ function NetworkSetting(Query) {
function UpdateNetworkSettingElementByID(Query, ID) {
function updateelement(update) {
console.log("(i2pcontrol)", update)
console.log("(i2pcontrol)", update);
document.getElementById(ID).innerText = update;
}
let net = NetworkSetting(Query);
net.then(updateleement);
}
UpdateRouterInfoElementByID("i2p.router.status", "router-status")
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"
);
}
UpdateContents();
/*setInterval(function() {
UpdateContents();
}, 750);*/
//var done = Echo(hello);
//done.then(Done);

View File

@@ -6,7 +6,72 @@
</head>
<body>
<h1>I2P Router Information</h1>
<div id="router-status">Replace with Router Status</div>
<ul>
<li>
<div id="label-router-status">Router Status:</div>
<div id="router-status">Replace with Router Status</div>
</li>
<li>
<div id="label-router-uptime">Router Uptime(Ms):</div>
<div id="router-uptime">Replace with Router Uptime</div>
</li>
<li>
<div id="label-router-version">Router Version:</div>
<div id="router-version">Replace with Router Version</div>
</li>
<li>
<ul>
<li>
<div id="label-router-bw-outbound-1s">Outbound bw 1s:</div>
<div id="router-net-bw-outbound-1s">Replace with Router Bandwidth Outbound 1s</div>
</li>
<li>
<div id="label-router-bw-outbound-15s">Outbound bw 15s:</div>
<div id="router-net-bw-outbound-15s">Replace with Router Bandwidth Outbound 15s</div>
</li>
<li>
<div id="label-router-bw-inbound-1s">Inbound bw 1s:</div>
<div id="router-net-bw-inbound-1s">Replace with Router Bandwidth Inbound 1s</div>
</li>
<li>
<div id="label-router-bw-inbound-15s">Inbound bw 15s:</div>
<div id="router-net-bw-inbound-15s">Replace with Router Bandwidth Outbound 15s</div>
</li>
</ul>
</li>
<!--<li>
<div id="label-router-net-status">Network Status:</div>
<div id="router-net-status">Replace with Router Network Status</div>
</li>-->
<li>
<ul>
<li>
<div id="label-router-net-tunnels-participating">Participating Tunnels:</div>
<div id="router-net-tunnels-participating">Replace with Router Participating Tunnel Count</div>
</li>
<li>
<div id="label-router-activepeers">Active Peers:</div>
<div id="router-netdb-activepeers">Replace with Router Active Peers</div>
</li>
<li>
<div id="label-router-netdb-fastpeers">Fast Peers:</div>
<div id="router-netdb-fastpeers">Replace with Router Fast Peers</div>
</li>
<li>
<div id="label-router-netdb-highcapacitypeers">High Capacity Peers:</div>
<div id="router-netdb-highcapacitypeers">Replace with High Capacity Peers</div>
</li>
<li>
<div id="label-router-netdb-isreseeding">Reseed status:</div>
<div id="router-netdb-isreseeding">Replace with Router netDB Reseeding Status</div>
</li>
<li>
<div id="label-router-netdb-knownpeers">Known Peers:</div>
<div id="router-netdb-knownpeers">Replace with Router Known Peers</div>
</li>
</ul>
</li>
</ul>
<script src="i2pcontrol/i2pcontrol.js"></script>
</body>
</html>