@@ -73,7 +99,7 @@
return (statusIndicator.textContent = "STATUS: INVALID_RESPONSE");
statusIndicator.textContent = "STATUS: Connected";
- statusIndicator.style.color = "#00ff66";
+ statusIndicator.style.color = "rgb(77, 91, 83)";
const torrents = document.getElementById("torrents");
currentTorrentsData = r.result.torrents;
From d13abcda6b9c1b2725157bcc339cf5cbd8c8c330 Mon Sep 17 00:00:00 2001
From: wipedlifepotato <60944239+wipedlifepotato@users.noreply.github.com>
Date: Sat, 5 Sep 2026 04:25:55 +0300
Subject: [PATCH 2/3] torrent-add by magnet
---
contrib/webconsole/torrent-rpc.js | 13 +++++++++++
contrib/webconsole/torrent_client.html | 7 ++++++
contrib/webconsole/torrents_client_2000.css | 25 +++++++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 contrib/webconsole/torrents_client_2000.css
diff --git a/contrib/webconsole/torrent-rpc.js b/contrib/webconsole/torrent-rpc.js
index bfc3f1bc..f596c5dc 100644
--- a/contrib/webconsole/torrent-rpc.js
+++ b/contrib/webconsole/torrent-rpc.js
@@ -33,6 +33,19 @@ class TorrentClient {
return (bytesPerSec / 1024).toFixed(2) + ' KB/s';
}
+ async addTorrentByMagnet(magnet)
+ {
+ // TODO: check link
+ const magnetRegex = /^magnet:\?xt=urn:btih:[a-f0-9]{40}(&.+)?$/i;
+ if(!magnetRegex.test(magnet)) return false;
+ const res = await fetch(this.getEndpoint(), {
+ method: "POST",
+ body: JSON.stringify({ 'method': 'torrent-add', 'arguments': { 'filename': magnet } }),
+ headers: { 'Content-Type': 'application/json' }
+ });
+ return res.json();
+
+ }
async addTorrent(b64metainfo) {
const res = await fetch(this.getEndpoint(), {
method: "POST",
diff --git a/contrib/webconsole/torrent_client.html b/contrib/webconsole/torrent_client.html
index cf6383fd..424340f9 100644
--- a/contrib/webconsole/torrent_client.html
+++ b/contrib/webconsole/torrent_client.html
@@ -27,6 +27,7 @@