From 86b05f8661274e4bcf4a30caed2f8a105a392352 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Jun 2015 13:06:36 +0300 Subject: [PATCH] better feed debugger ui for f D --- classes/feeds.php | 51 +++++++++++++++++++++++++++++++++++++++++++---- css/utility.css | 5 +++++ js/tt-rss.js | 10 ++++++---- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/classes/feeds.php b/classes/feeds.php index 261538cd..37a7cc89 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -150,9 +150,6 @@ class Feeds extends Handler_Protected { $next_unread_feed, $offset, $vgr_last_feed = false, $override_order = false, $include_children = false) { - if (isset($_REQUEST["DevForceUpdate"])) - header("Content-Type: text/plain; charset=utf-8"); - $disable_cache = false; $reply = array(); @@ -179,7 +176,7 @@ class Feeds extends Handler_Protected { $last_updated = strtotime($this->dbh->fetch_result($result, 0, "last_updated")); $cache_images = sql_bool_to_bool($this->dbh->fetch_result($result, 0, "cache_images")); - if (!$cache_images && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) { + if (!$cache_images && time() - $last_updated > 120) { include "rssfuncs.php"; update_rss_feed($feed, true, true); } else { @@ -1167,6 +1164,52 @@ class Feeds extends Handler_Protected { "; } + function update_debugger() { + header("Content-type: text/html"); + + $feed_id = (int)$_REQUEST["feed_id"]; + @$do_update = $_REQUEST["action"] == "do_update"; + $csrf_token = $_REQUEST["csrf_token"]; + + $refetch_checked = isset($_REQUEST["force_refetch"]) ? "checked" : ""; + $rehash_checked = isset($_REQUEST["force_rehash"]) ? "checked" : ""; + + ?> + + + + Feed Debugger + + +

Feed Debugger:

+
+ + + + + + + > Force refetch
+ > Force rehash
+ +

+

+ +
+ +
+ + + diff --git a/css/utility.css b/css/utility.css index 85f136ad..77452a9a 100644 --- a/css/utility.css +++ b/css/utility.css @@ -9,6 +9,11 @@ body { max-width : 800px; } +body.small_margins { + margin : 1em; + max-width : none; +} + form { margin : 10px 0px 0px 0px; padding : 0px; diff --git a/js/tt-rss.js b/js/tt-rss.js index 08602c8e..602c953b 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -422,10 +422,12 @@ function init() { quickAddFeed(); }; hotkey_actions["feed_debug_update"] = function() { - window.open("backend.php?op=feeds&method=view&feed=" + getActiveFeedId() + - "&view_mode=adaptive&order_by=default&update=&m=ForceUpdate&cat=" + - activeFeedIsCat() + "&DevForceUpdate=1&debug=1&xdebug=1&csrf_token=" + - getInitParam("csrf_token")); + if (!activeFeedIsCat() && parseInt(getActiveFeedId()) > 0) { + window.open("backend.php?op=feeds&method=update_debugger&feed_id=" + getActiveFeedId() + + "&csrf_token=" + getInitParam("csrf_token")); + } else { + alert("You can't debug this kind of feed."); + } }; hotkey_actions["feed_edit"] = function() { if (activeFeedIsCat()) -- 2.39.5