diff --git a/contrib/webconsole/torrent-rpc.js b/contrib/webconsole/torrent-rpc.js
index f596c5dc..1faadff2 100644
--- a/contrib/webconsole/torrent-rpc.js
+++ b/contrib/webconsole/torrent-rpc.js
@@ -69,7 +69,7 @@ class TorrentClient {
method: "POST",
body: JSON.stringify({
'method': 'torrent-get',
- 'arguments': { "fields": ["id", "name", "status", "rateDownload", "rateUpload", "totalSize", "percentDone", "files", "peers", "trackers", "trackerStats"] }
+ 'arguments': { "fields": ["id", "name", "status", "rateDownload", "rateUpload", "totalSize", "percentDone", "files", "peers", "trackers", "trackerStats","hashString"] }
}),
headers: { 'Content-Type': 'application/json' }
});
diff --git a/contrib/webconsole/torrent_client.html b/contrib/webconsole/torrent_client.html
index 3791db0e..b2e907f0 100644
--- a/contrib/webconsole/torrent_client.html
+++ b/contrib/webconsole/torrent_client.html
@@ -45,6 +45,7 @@
+
Files:
Peers (0):
@@ -67,7 +68,7 @@
{
const r = await window.tjs.getTorrents()
//console.log(`torrents: ${r}`)
- if (!r?.arguments?.torrents) return;
+ if (!r?.result?.torrents) return;
r.arguments.torrents.forEach(async (t) => {
console.log(`stop torrent => ${t.id}`)
await window.tjs.stopTorrent([t.id]);
@@ -82,7 +83,7 @@
{
const r = await window.tjs.getTorrents()
//console.log(`torrents: ${r}`)
- if (!r?.arguments?.torrents) return;
+ if (!r?.result?.torrents) return;
r.arguments.torrents.forEach( async (t) =>{
console.log(`start torrent => ${t.id}`)
await window.tjs.startTorrent([t.id]);
@@ -97,9 +98,10 @@
try {
const r = await window.tjs.getTorrents();
- if (!r?.arguments?.torrents)
+ console.log(r)
+ if (!r?.result == "success")
return (statusIndicator.textContent = "STATUS: INVALID_RESPONSE");
-
+
statusIndicator.textContent = "STATUS: Connected";
statusIndicator.style.color = "rgb(77, 91, 83)";
@@ -171,6 +173,7 @@
statusIndicator.textContent =
"STATUS: ERROR_WITH_DATA (f12, check your console and write issue)";
statusIndicator.style.color = "#ff3333";
+ console.log(err)
}
}, 1000);
@@ -207,6 +210,9 @@
document.getElementById("modal_torrent_title").textContent =
`DETAILS: ${torrent.name} (#${torrent.id})`;
+ document.getElementById("modal_torrent_hash").textContent =
+ `InfoHash: ${torrent.hashString}`;
+
const filesList = document.getElementById("modal_files_list");
filesList.innerHTML = "";