mirror of
https://github.com/iv-org/invidious-redirect.git
synced 2024-07-01 08:31:35 +00:00
Add support for listing Tor/onion and i2p invidious instances.
This commit is contained in:
parent
029859082e
commit
cc68db743d
|
@ -37,6 +37,7 @@ html(lang="en")
|
||||||
table
|
table
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
|
th(scope="col") Type
|
||||||
th(scope="col") Region
|
th(scope="col") Region
|
||||||
th(scope="col") Domain
|
th(scope="col") Domain
|
||||||
th(scope="col") Health
|
th(scope="col") Health
|
||||||
|
|
16
src/main.js
16
src/main.js
|
@ -56,15 +56,27 @@
|
||||||
healthKnown
|
healthKnown
|
||||||
}
|
}
|
||||||
}).filter(entry => {
|
}).filter(entry => {
|
||||||
return entry.details.type === "https" && entry.health > 0
|
return entry.health > 0
|
||||||
}).sort((a, b) => {
|
}).sort((a, b) => {
|
||||||
return b.health - a.health
|
return b.health - a.health
|
||||||
}).forEach(entry => {
|
}).forEach(entry => {
|
||||||
let target = entry.details.uri.replace(/\/*$/, "") + destinationPath
|
let address = entry.details.uri.replace(/\/*$/, "")
|
||||||
|
let target = address + destinationPath
|
||||||
const healthUnknown = entry.healthKnown ? "" : "health-unknown "
|
const healthUnknown = entry.healthKnown ? "" : "health-unknown "
|
||||||
|
let type = "default"
|
||||||
|
switch(address.substr(address.lastIndexOf('.')+1))
|
||||||
|
{
|
||||||
|
case "onion":
|
||||||
|
type = "onion"
|
||||||
|
break
|
||||||
|
case "i2p":
|
||||||
|
type = "i2p"
|
||||||
|
break
|
||||||
|
}
|
||||||
const health = entry.healthKnown ? entry.health.toFixed(0) : "(unknown)"
|
const health = entry.healthKnown ? entry.health.toFixed(0) : "(unknown)"
|
||||||
q("#instances-tbody").appendChild(
|
q("#instances-tbody").appendChild(
|
||||||
createElement("tr", {}, [
|
createElement("tr", {}, [
|
||||||
|
createElement("td", {className: "column-center", textContent: type}),
|
||||||
createElement("td", {textContent: `${entry.details.flag} ${entry.details.region}`}),
|
createElement("td", {textContent: `${entry.details.flag} ${entry.details.region}`}),
|
||||||
createElement("td", {textContent: entry.name}),
|
createElement("td", {textContent: entry.name}),
|
||||||
createElement("td", {className: "column-center "+healthUnknown, textContent: health}),
|
createElement("td", {className: "column-center "+healthUnknown, textContent: health}),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user