Add new page for background feeds refresh

This commit is contained in:
Frédéric Guillot 2023-10-18 19:57:02 -07:00
parent 23d2cfe0f9
commit c60b3f52a5
21 changed files with 85 additions and 26 deletions

View File

@ -452,5 +452,7 @@
"Website unreachable, the request timed out after %d seconds": "Webseite nicht erreichbar, die Anfrage endete nach %d Sekunden", "Website unreachable, the request timed out after %d seconds": "Webseite nicht erreichbar, die Anfrage endete nach %d Sekunden",
"You are not authorized to access this resource (invalid username/password)": "Sie sind nicht berechtigt, auf diese Ressource zuzugreifen (Benutzername/Passwort ungültig)", "You are not authorized to access this resource (invalid username/password)": "Sie sind nicht berechtigt, auf diese Ressource zuzugreifen (Benutzername/Passwort ungültig)",
"Unable to fetch this resource (Status Code = %d)": "Ressource konnte nicht abgerufen werden (code=%d)", "Unable to fetch this resource (Status Code = %d)": "Ressource konnte nicht abgerufen werden (code=%d)",
"Resource not found (404), this feed doesn't exist anymore, check the feed URL": "Ressource nicht gefunden (404), dieses Abonnement existiert nicht mehr, überprüfen Sie die Abonnement-URL" "Resource not found (404), this feed doesn't exist anymore, check the feed URL": "Ressource nicht gefunden (404), dieses Abonnement existiert nicht mehr, überprüfen Sie die Abonnement-URL",
"page.background_feed_refresh.title": "Hintergrundaktualisierung",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"πριν %d έτος", "πριν %d έτος",
"πριν %d έτη" "πριν %d έτη"
] ],
"page.background_feed_refresh.title": "Background feed refresh",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"%d year ago", "%d year ago",
"%d years ago" "%d years ago"
] ],
"page.background_feed_refresh.title": "Background feed refresh",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"hace %d año", "hace %d año",
"hace %d años" "hace %d años"
] ],
"page.background_feed_refresh.title": "Background feed refresh",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"%d vuosi sitten", "%d vuosi sitten",
"%d vuotta sitten" "%d vuotta sitten"
] ],
"page.background_feed_refresh.title": "Background feed refresh",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -452,5 +452,7 @@
"Website unreachable, the request timed out after %d seconds": "Site web injoignable, la requête à échouée après %d secondes", "Website unreachable, the request timed out after %d seconds": "Site web injoignable, la requête à échouée après %d secondes",
"You are not authorized to access this resource (invalid username/password)": "Vous n'êtes pas autorisé à accéder à cette ressource (nom d'utilisateur / mot de passe incorrect)", "You are not authorized to access this resource (invalid username/password)": "Vous n'êtes pas autorisé à accéder à cette ressource (nom d'utilisateur / mot de passe incorrect)",
"Unable to fetch this resource (Status Code = %d)": "Impossible de récupérer cette ressource (code=%d)", "Unable to fetch this resource (Status Code = %d)": "Impossible de récupérer cette ressource (code=%d)",
"Resource not found (404), this feed doesn't exist anymore, check the feed URL": "Page introuvable (404), cet abonnement n'existe plus, vérifiez l'adresse du flux" "Resource not found (404), this feed doesn't exist anymore, check the feed URL": "Page introuvable (404), cet abonnement n'existe plus, vérifiez l'adresse du flux",
"page.background_feed_refresh.title": "Actualisation des abonnements en arrière-plan",
"alert.background_feed_refresh": "Les abonnements sont en cours d'actualisation en arrière-plan. Vous pouvez continuer à naviguer dans l'application."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"%d साल पहले", "%d साल पहले",
"%d वर्षों पहले" "%d वर्षों पहले"
] ],
"page.background_feed_refresh.title": "फ़ीड रीफ़्रेश किया जा रहा है",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -443,5 +443,7 @@
"Website unreachable, the request timed out after %d seconds": "Situs tidak dapat tersambung, permintaan galat setelah %d detik", "Website unreachable, the request timed out after %d seconds": "Situs tidak dapat tersambung, permintaan galat setelah %d detik",
"You are not authorized to access this resource (invalid username/password)": "Anda tidak memiliki izin yang cukup untuk mengakses umpan ini (nama pengguna/kata sandi tidak valid)", "You are not authorized to access this resource (invalid username/password)": "Anda tidak memiliki izin yang cukup untuk mengakses umpan ini (nama pengguna/kata sandi tidak valid)",
"Unable to fetch this resource (Status Code = %d)": "Tidak bisa mengambil umpan ini (Kode Status = %d)", "Unable to fetch this resource (Status Code = %d)": "Tidak bisa mengambil umpan ini (Kode Status = %d)",
"Resource not found (404), this feed doesn't exist anymore, check the feed URL": "Umpan tidak ditemukan (404), umpan ini tidak ada lagi, periksa URL umpan" "Resource not found (404), this feed doesn't exist anymore, check the feed URL": "Umpan tidak ditemukan (404), umpan ini tidak ada lagi, periksa URL umpan",
"page.background_feed_refresh.title": "Memuat ulang umpan di latar belakang",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"%d anno fa", "%d anno fa",
"%d anni fa" "%d anni fa"
] ],
"page.background_feed_refresh.title": "Aggiornamento in background",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"%d 年前", "%d 年前",
"%d 年前" "%d 年前"
] ],
"page.background_feed_refresh.title": "バックグラウンドでフィードを更新中",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -450,5 +450,7 @@
"This web page is empty": "Deze webpagina is leeg", "This web page is empty": "Deze webpagina is leeg",
"Invalid SSL certificate (original error: %q)": "Ongeldig SSL-certificaat (originele error: %q)", "Invalid SSL certificate (original error: %q)": "Ongeldig SSL-certificaat (originele error: %q)",
"This website is unreachable (original error: %q)": "Deze website is onbereikbaar (originele error: %q)", "This website is unreachable (original error: %q)": "Deze website is onbereikbaar (originele error: %q)",
"Website unreachable, the request timed out after %d seconds": "Website onbereikbaar, de request gaf een timeout na %d seconden" "Website unreachable, the request timed out after %d seconds": "Website onbereikbaar, de request gaf een timeout na %d seconden",
"page.background_feed_refresh.title": "Achtergrond vernieuwen",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -458,5 +458,7 @@
"This web page is empty": "Ta strona jest pusta", "This web page is empty": "Ta strona jest pusta",
"Invalid SSL certificate (original error: %q)": "Certyfikat SSL jest nieprawidłowy (błąd: %q)", "Invalid SSL certificate (original error: %q)": "Certyfikat SSL jest nieprawidłowy (błąd: %q)",
"This website is unreachable (original error: %q)": "Ta strona jest niedostępna (błąd: %q)", "This website is unreachable (original error: %q)": "Ta strona jest niedostępna (błąd: %q)",
"Website unreachable, the request timed out after %d seconds": "Strona internetowa nieosiągalna, żądanie wygasło po %d sekundach" "Website unreachable, the request timed out after %d seconds": "Strona internetowa nieosiągalna, żądanie wygasło po %d sekundach",
"page.background_feed_refresh.title": "Odświeżanie kanałów w tle",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"há %d ano", "há %d ano",
"há %d anos" "há %d anos"
] ],
"page.background_feed_refresh.title": "Atualização de fonte em segundo plano",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -441,5 +441,7 @@
"%d год назад", "%d год назад",
"%d года назад", "%d года назад",
"%d лет назад" "%d лет назад"
] ],
"page.background_feed_refresh.title": "Обновление подписок",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -433,5 +433,7 @@
"time_elapsed.years": [ "time_elapsed.years": [
"%d yıl önce", "%d yıl önce",
"%d yıl önce" "%d yıl önce"
] ],
"page.background_feed_refresh.title": "Arka plan beslemesi yenileme",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -442,5 +442,7 @@
"%d рік тому", "%d рік тому",
"%d роки тому", "%d роки тому",
"%d років тому" "%d років тому"
] ],
"page.background_feed_refresh.title": "Оновлення стрічок в фоновому режимі",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -443,5 +443,7 @@
"This web page is empty": "该网页是空的", "This web page is empty": "该网页是空的",
"Invalid SSL certificate (original error: %q)": "无效的 SSL 证书 (原始错误: %q)", "Invalid SSL certificate (original error: %q)": "无效的 SSL 证书 (原始错误: %q)",
"This website is unreachable (original error: %q)": "该网站永久不可达 (原始错误: %q)", "This website is unreachable (original error: %q)": "该网站永久不可达 (原始错误: %q)",
"Website unreachable, the request timed out after %d seconds": "网站不可达, 请求已在 %d 秒后超时" "Website unreachable, the request timed out after %d seconds": "网站不可达, 请求已在 %d 秒后超时",
"page.background_feed_refresh.title": "后台更新",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -451,5 +451,7 @@
"This web page is empty": "該網頁是空的", "This web page is empty": "該網頁是空的",
"Invalid SSL certificate (original error: %q)": "無效的 SSL 憑證 (錯誤: %q)", "Invalid SSL certificate (original error: %q)": "無效的 SSL 憑證 (錯誤: %q)",
"This website is unreachable (original error: %q)": "該網站永久無法訪問(原始錯誤: %q)", "This website is unreachable (original error: %q)": "該網站永久無法訪問(原始錯誤: %q)",
"Website unreachable, the request timed out after %d seconds": "網站無法訪問, 請求已在 %d 秒後超時" "Website unreachable, the request timed out after %d seconds": "網站無法訪問, 請求已在 %d 秒後超時",
"page.background_feed_refresh.title": "背景更新",
"alert.background_feed_refresh": "All feeds are being refreshed in the background. You can continue to use Miniflux while this process is running."
} }

View File

@ -0,0 +1,11 @@
{{ define "title"}}{{ t "page.background_feed_refresh.title" }}{{ end }}
{{ define "content"}}
<section class="page-header">
<h1>{{ t "page.background_feed_refresh.title" }}</h1>
{{ template "feed_menu" }}
</section>
<p class="alert alert-success">{{ t "alert.background_feed_refresh" }}</p>
{{ end }}

View File

@ -11,6 +11,8 @@ import (
"miniflux.app/v2/internal/http/response/html" "miniflux.app/v2/internal/http/response/html"
"miniflux.app/v2/internal/http/route" "miniflux.app/v2/internal/http/route"
feedHandler "miniflux.app/v2/internal/reader/handler" feedHandler "miniflux.app/v2/internal/reader/handler"
"miniflux.app/v2/internal/ui/session"
"miniflux.app/v2/internal/ui/view"
) )
func (h *handler) refreshFeed(w http.ResponseWriter, r *http.Request) { func (h *handler) refreshFeed(w http.ResponseWriter, r *http.Request) {
@ -30,6 +32,13 @@ func (h *handler) refreshFeed(w http.ResponseWriter, r *http.Request) {
func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) { func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) {
userID := request.UserID(r) userID := request.UserID(r)
user, err := h.store.UserByID(userID)
if err != nil {
html.ServerError(w, r, err)
return
}
jobs, err := h.store.NewUserBatch(userID, h.store.CountFeeds(userID)) jobs, err := h.store.NewUserBatch(userID, h.store.CountFeeds(userID))
if err != nil { if err != nil {
html.ServerError(w, r, err) html.ServerError(w, r, err)
@ -44,5 +53,12 @@ func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) {
go h.pool.Push(jobs) go h.pool.Push(jobs)
html.Redirect(w, r, route.Path(h.router, "feeds")) sess := session.New(h.store, request.SessionID(r))
view := view.New(h.tpl, r, sess)
view.Set("menu", "feeds")
view.Set("user", user)
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
html.OK(w, r, view.Render("feed_background_refresh"))
} }

View File

@ -204,14 +204,10 @@ function markEntryAsRead(element) {
// Send the Ajax request to refresh all feeds in the background // Send the Ajax request to refresh all feeds in the background
function handleRefreshAllFeeds() { function handleRefreshAllFeeds() {
let url = document.body.dataset.refreshAllFeedsUrl; let url = document.body.dataset.refreshAllFeedsUrl;
let request = new RequestBuilder(url);
request.withCallback(() => { if (url) {
window.location.reload(); window.location.href = url;
}); }
request.withHttpMethod("GET");
request.execute();
} }
// Send the Ajax request to change entries statuses. // Send the Ajax request to change entries statuses.