diff options
-rw-r--r-- | src/assets/images/speedTest-icon-light.svg | 39 | ||||
-rw-r--r-- | src/assets/images/speedTest-icon.svg | 1 | ||||
-rw-r--r-- | src/assets/javascripts/services.js | 3 | ||||
-rw-r--r-- | src/config.json | 23 | ||||
-rw-r--r-- | src/pages/options/index.js | 18 | ||||
-rw-r--r-- | src/pages/stylesheets/styles.css | 2 |
6 files changed, 73 insertions, 13 deletions
diff --git a/src/assets/images/speedTest-icon-light.svg b/src/assets/images/speedTest-icon-light.svg new file mode 100644 index 00000000..bcee17f6 --- /dev/null +++ b/src/assets/images/speedTest-icon-light.svg @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + height="24" + viewBox="0 96 960 960" + width="24" + version="1.1" + id="svg4" + sodipodi:docname="speedTest-icon-light.svg" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs8" /> + <sodipodi:namedview + id="namedview6" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + showgrid="false" + inkscape:zoom="32.416667" + inkscape:cx="8.2365039" + inkscape:cy="12" + inkscape:window-width="1888" + inkscape:window-height="1060" + inkscape:window-x="32" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg4" /> + <path + d="M418 716q24 24 62 23.5t56-27.5l224-336-336 224q-27 18-28.5 55t22.5 61Zm62-460q59 0 113.5 16.5T696 322l-76 48q-33-17-68.5-25.5T480 336q-133 0-226.5 93.5T160 656q0 42 11.5 83t32.5 77h552q23-38 33.5-79t10.5-85q0-36-8.5-70T766 516l48-76q30 47 47.5 100T880 650q1 57-13 109t-41 99q-11 18-30 28t-40 10H204q-21 0-40-10t-30-28q-26-45-40-95.5T80 656q0-83 31.5-155.5t86-127Q252 319 325 287.5T480 256Zm7 313Z" + id="path2" + style="fill:#ffffff" /> +</svg> diff --git a/src/assets/images/speedTest-icon.svg b/src/assets/images/speedTest-icon.svg new file mode 100644 index 00000000..d2c8d4df --- /dev/null +++ b/src/assets/images/speedTest-icon.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 96 960 960" width="24"><path d="M418 716q24 24 62 23.5t56-27.5l224-336-336 224q-27 18-28.5 55t22.5 61Zm62-460q59 0 113.5 16.5T696 322l-76 48q-33-17-68.5-25.5T480 336q-133 0-226.5 93.5T160 656q0 42 11.5 83t32.5 77h552q23-38 33.5-79t10.5-85q0-36-8.5-70T766 516l48-76q30 47 47.5 100T880 650q1 57-13 109t-41 99q-11 18-30 28t-40 10H204q-21 0-40-10t-30-28q-26-45-40-95.5T80 656q0-83 31.5-155.5t86-127Q252 319 325 287.5T480 256Zm7 313Z"/></svg> \ No newline at end of file diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 61d033c0..eedbc2b6 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -719,7 +719,8 @@ const defaultInstances = { 'gothub': ['https://gh.odyssey346.dev'], 'mikuInvidious': ['https://mikuinv.resrv.org'], "tent": ['https://tent.sny.sh'], - "wolfreeAlpha": ['https://gqq.gitlab.io', 'https://uqq.gitlab.io'] + "wolfreeAlpha": ['https://gqq.gitlab.io', 'https://uqq.gitlab.io'], + "libreSpeed": ['https://librespeed.org'] } function initDefaults() { diff --git a/src/config.json b/src/config.json index 32dec362..15c53019 100644 --- a/src/config.json +++ b/src/config.json @@ -774,6 +774,29 @@ "imageType": "svg", "embeddable": false, "url": "https://www.wolframalpha.com" + }, + "speedTest": { + "frontends": { + "libreSpeed": { + "name": "LibreSpeed", + "instanceList": true, + "url": "https://github.com/librespeed/speedtest" + } + }, + "targets": [ + "^https?:\\/{2}speedtest\\.libredirect\\.invalid", + "^https?:\\/{2}(www\\.)?fast\\.com\\/", + "^https?:\\/{2}(www\\.)?speedtest\\.net\\/" + ], + "name": "Speed Test", + "options": { + "enabled": false, + "unsupportedUrls": "bypass", + "frontend": "libreSpeed" + }, + "imageType": "svgMono", + "embeddable": false, + "url": "https://speedtest.libredirect.invalid" } } } \ No newline at end of file diff --git a/src/pages/options/index.js b/src/pages/options/index.js index c8eb500d..9480f9a7 100644 --- a/src/pages/options/index.js +++ b/src/pages/options/index.js @@ -53,7 +53,6 @@ async function changeFrontendsSettings(service) { } if (document.getElementById(`${service}-redirectType`)) { const frontend = options[service].frontend - console.log(frontend) if (config.services[service].frontends[frontend].embeddable) { document.getElementById(`${service}-redirectType`).innerHTML = ` <option value="both" data-localise="__MSG_both__">both</options> @@ -161,8 +160,8 @@ async function calcCustomInstances(frontend) { <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" /> </svg> </button> - </div> - <hr>` + </div> + <hr>` ) .join("\n") for (const item of customInstances) { @@ -237,7 +236,8 @@ function createList(frontend, networks, document, redirects, blacklist) { const warnings = [cloudflare].join(" ") return `<div class="frontend"> <x> - <a href="${x}" target="_blank">${x}</a>${warnings} + <a href="${x}" target="_blank">${x}</a> + ${warnings} </x> <button class="add add-${x}"> <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -291,17 +291,13 @@ async function ping(frontend) { if (time < 5000) { text = `${time}ms` - if (time <= 1000) { color = "green" } + if (time <= 1000) color = "green" else if (time <= 2000) color = "orange" } else if (time >= 5000) { color = "red" - if (time == 5000) { - text = "5000ms+" - } - if (time > 5000) { - text = `Error: ${time - 5000}` - } + if (time == 5000) text = "5000ms+" + if (time > 5000) text = `Error: ${time - 5000}` } else { color = "red" diff --git a/src/pages/stylesheets/styles.css b/src/pages/stylesheets/styles.css index f8eed255..8c854e33 100644 --- a/src/pages/stylesheets/styles.css +++ b/src/pages/stylesheets/styles.css @@ -119,7 +119,7 @@ section.links { flex-wrap: wrap; flex-direction: column; width: 300px; - max-height: 720px; + max-height: 750px; } section.links div { |