summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2024-05-16 16:07:47 +0000
committerAndrew Dolgov <[email protected]>2024-05-16 16:07:47 +0000
commit8b037e81d8163104bfb535ce3dff3b24f5e9adcc (patch)
tree1c0fe2f7c4a00beb2e85bd95e6079b68b4d745b5
parente2e161dece498190413d814233db21eeeca97707 (diff)
parent5e7713a65818154470c2afab7798ebf65bacadc3 (diff)
Merge branch 'feature/debug-feeds-with-update-errors' into 'master'HEADmaster
Add option to debug feeds in 'Feeds with update errors' dialog. See merge request tt-rss/tt-rss!32
-rw-r--r--classes/Feeds.php4
-rw-r--r--js/CommonDialogs.js24
2 files changed, 26 insertions, 2 deletions
diff --git a/classes/Feeds.php b/classes/Feeds.php
index 41351fbde..64674b2d2 100644
--- a/classes/Feeds.php
+++ b/classes/Feeds.php
@@ -453,7 +453,7 @@ class Feeds extends Handler_Protected {
if ($num_errors > 0) {
$reply['content'] .= "<br/>";
- $reply['content'] .= "<a class=\"text-muted\" href=\"#\" onclick=\"CommonDialogs.showFeedsWithErrors()\">" .
+ $reply['content'] .= "<a class=\"text-muted\" href=\"#\" onclick=\"CommonDialogs.showFeedsWithErrors(); return false\">" .
__('Some feeds have update errors (click for details)') . "</a>";
}
$reply['content'] .= "</span></p></div>";
@@ -603,7 +603,7 @@ class Feeds extends Handler_Protected {
if ($num_errors > 0) {
$reply['headlines']['content'] .= "<br/>";
- $reply['headlines']['content'] .= "<a class=\"text-muted\" href=\"#\" onclick=\"CommonDialogs.showFeedsWithErrors()\">".
+ $reply['headlines']['content'] .= "<a class=\"text-muted\" href=\"#\" onclick=\"CommonDialogs.showFeedsWithErrors(); return false\">".
__('Some feeds have update errors (click for details)')."</a>";
}
$reply['headlines']['content'] .= "</span></p>";
diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js
index 989a61539..f666eda36 100644
--- a/js/CommonDialogs.js
+++ b/js/CommonDialogs.js
@@ -251,6 +251,27 @@ const CommonDialogs = {
alert(__("No feeds selected."));
}
},
+ debugSelected: function() {
+ const sel_rows = this.getSelectedFeeds();
+
+ if (sel_rows.length > 0) {
+ if (confirm(__("Debug selected feeds?"))) {
+ Notify.progress("Opening debugger for selected feeds...", true);
+
+ for (let i = 0; i < sel_rows.length; i++) {
+ /* global __csrf_token */
+ App.postOpenWindow("backend.php", {
+ op: "Feeds",
+ method: "updatedebugger",
+ feed_id: sel_rows[i],
+ csrf_token: __csrf_token,
+ });
+ }
+ }
+ } else {
+ alert(__("No feeds selected."));
+ }
+ },
content: `
<div dojoType="fox.Toolbar">
<div dojoType="fox.form.DropDownButton">
@@ -290,6 +311,9 @@ const CommonDialogs = {
<button style='float : left' class='alt-danger' dojoType='dijit.form.Button' onclick='App.dialogOf(this).removeSelected()'>
${__('Unsubscribe from selected feeds')}
</button>
+ <button style='float : left' class='alt-info' dojoType='dijit.form.Button' onclick='App.dialogOf(this).debugSelected()'>
+ ${__('Debug selected feeds')}
+ </button>
<button dojoType='dijit.form.Button' class='alt-primary' type='submit'>
${__('Close this window')}
</button>