From 50acb670b0a3687a0be8162a6853f6c4feba0a44 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello <8296030+Piccirello@users.noreply.github.com> Date: Mon, 30 Sep 2024 05:34:37 -0400 Subject: [PATCH] WebUI: Support updating RSS feed URL PR #21371. Signed-off-by: Thomas Piccirello --- src/webui/www/private/editfeedurl.html | 91 ++++++++++++++++++++++++++++++++++ src/webui/www/private/views/rss.html | 23 ++++++++- src/webui/www/webui.qrc | 1 + 3 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 src/webui/www/private/editfeedurl.html diff --git a/src/webui/www/private/editfeedurl.html b/src/webui/www/private/editfeedurl.html new file mode 100644 index 000000000..b0087e980 --- /dev/null +++ b/src/webui/www/private/editfeedurl.html @@ -0,0 +1,91 @@ + + + + + + QBT_TR(Please type a RSS feed URL)QBT_TR[CONTEXT=RSSWidget] + + + + + + + + +
+ + +
+ +
+
+ + + diff --git a/src/webui/www/private/views/rss.html b/src/webui/www/private/views/rss.html index 19f27ff87..625132dae 100644 --- a/src/webui/www/private/views/rss.html +++ b/src/webui/www/private/views/rss.html @@ -156,6 +156,7 @@
  • QBT_TR(Update)QBT_TR[CONTEXT=RSSWidget] QBT_TR(Update)QBT_TR[CONTEXT=RSSWidget]
  • QBT_TR(Mark items read)QBT_TR[CONTEXT=RSSWidget] QBT_TR(Mark items read)QBT_TR[CONTEXT=RSSWidget]
  • QBT_TR(Rename...)QBT_TR[CONTEXT=RSSWidget] QBT_TR(Rename...)QBT_TR[CONTEXT=RSSWidget]
  • +
  • QBT_TR(Edit feed URL...)QBT_TR[CONTEXT=RSSWidget] QBT_TR(Edit feed URL...)QBT_TR[CONTEXT=RSSWidget]
  • QBT_TR(Delete)QBT_TR[CONTEXT=RSSWidget] QBT_TR(Delete)QBT_TR[CONTEXT=RSSWidget]
  • QBT_TR(New subscription...)QBT_TR[CONTEXT=RSSWidget] QBT_TR(New subscription...)QBT_TR[CONTEXT=RSSWidget]
  • @@ -236,6 +237,10 @@ rename: (el) => { moveItem(rssFeedTable.getRow(rssFeedTable.selectedRows[0]).full_data.dataPath); }, + edit: (el) => { + const data = rssFeedTable.getRow(rssFeedTable.selectedRows[0]).full_data; + editUrl(data.dataPath, data.dataUrl); + }, delete: (el) => { const selectedDatapaths = rssFeedTable.selectedRows .filter((rowID) => rowID !== "0") @@ -499,7 +504,8 @@ match = true; for (let i = 0; i < flattenedResp.length; ++i) { if (((flattenedResp[i].uid ? flattenedResp[i].uid : "") !== rssFeedRows[i + 1].full_data.dataUid) - || (flattenedResp[i].fullName !== rssFeedRows[i + 1].full_data.dataPath)) { + || (flattenedResp[i].fullName !== rssFeedRows[i + 1].full_data.dataPath) + || (flattenedResp[i].url !== rssFeedRows[i + 1].full_data.dataUrl)) { match = false; break; } @@ -729,6 +735,21 @@ }); }; + const editUrl = (path, url) => { + new MochaUI.Window({ + id: "editFeedURL", + icon: "images/qbittorrent-tray.svg", + title: "QBT_TR(Please type a RSS feed URL)QBT_TR[CONTEXT=RSSWidget]", + loadMethod: "iframe", + contentURL: new URI("editfeedurl.html").setData("path", path).setData("url", url).toString(), + scrollbars: false, + resizable: false, + maximizable: false, + width: 350, + height: 100 + }); + }; + const removeItem = (paths) => { const encodedPaths = paths.map((path) => encodeURIComponent(path)); new MochaUI.Window({ diff --git a/src/webui/www/webui.qrc b/src/webui/www/webui.qrc index 2a602c7fc..d944cd7f6 100644 --- a/src/webui/www/webui.qrc +++ b/src/webui/www/webui.qrc @@ -18,6 +18,7 @@ private/css/Window.css private/download.html private/downloadlimit.html + private/editfeedurl.html private/edittracker.html private/editwebseed.html private/images/3-state-checkbox.gif -- 2.11.4.GIT