mirror of
https://github.com/miniflux/v2.git
synced 2025-08-31 18:31:01 +00:00
Add Prometheus exporter
This commit is contained in:
parent
16b7b3bc3e
commit
c394a61a4e
61 changed files with 809 additions and 96 deletions
|
@ -7,8 +7,8 @@ package ui // import "miniflux.app/ui"
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/ui/session"
|
||||
"miniflux.app/ui/view"
|
||||
"miniflux.app/version"
|
||||
|
@ -28,7 +28,7 @@ func (h *handler) showAboutPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("about"))
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ func (h *handler) showCreateAPIKeyPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("create_api_key"))
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ func (h *handler) showAPIKeysPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("api_keys"))
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ func (h *handler) saveAPIKey(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
if err := apiKeyForm.Validate(); err != nil {
|
||||
view.Set("errorMessage", err.Error())
|
||||
|
|
|
@ -52,7 +52,7 @@ func (h *handler) showStarredPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "starred")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("bookmark_entries"))
|
||||
|
|
|
@ -25,7 +25,7 @@ func (h *handler) showCreateCategoryPage(w http.ResponseWriter, r *http.Request)
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("create_category"))
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ func (h *handler) showEditCategoryPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("edit_category"))
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ func (h *handler) showCategoryEntriesPage(w http.ResponseWriter, r *http.Request
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
view.Set("showOnlyUnreadEntries", true)
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ func (h *handler) showCategoryEntriesAllPage(w http.ResponseWriter, r *http.Requ
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
view.Set("showOnlyUnreadEntries", false)
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ func (h *handler) showCategoryFeedsPage(w http.ResponseWriter, r *http.Request)
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("category_feeds"))
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ package ui // import "miniflux.app/ui"
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/ui/session"
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/ui/view"
|
||||
)
|
||||
|
||||
|
@ -33,7 +33,7 @@ func (h *handler) showCategoryListPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("categories"))
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ package ui // import "miniflux.app/ui"
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/http/route"
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/logger"
|
||||
"miniflux.app/model"
|
||||
"miniflux.app/ui/form"
|
||||
|
@ -32,7 +32,7 @@ func (h *handler) saveCategory(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
if err := categoryForm.Validate(); err != nil {
|
||||
view.Set("errorMessage", err.Error())
|
||||
|
|
|
@ -44,7 +44,7 @@ func (h *handler) updateCategory(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
if err := categoryForm.Validate(); err != nil {
|
||||
view.Set("errorMessage", err.Error())
|
||||
|
|
|
@ -77,7 +77,7 @@ func (h *handler) showStarredEntryPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "starred")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("entry"))
|
||||
|
|
|
@ -80,7 +80,7 @@ func (h *handler) showCategoryEntryPage(w http.ResponseWriter, r *http.Request)
|
|||
view.Set("menu", "categories")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("entry"))
|
||||
|
|
|
@ -80,7 +80,7 @@ func (h *handler) showFeedEntryPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("entry"))
|
||||
|
|
|
@ -67,7 +67,7 @@ func (h *handler) showReadEntryPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "history")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("entry"))
|
||||
|
|
|
@ -80,7 +80,7 @@ func (h *handler) showSearchEntryPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "search")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("entry"))
|
||||
|
|
|
@ -84,7 +84,7 @@ func (h *handler) showUnreadEntryPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "unread")
|
||||
view.Set("user", user)
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
// Fetching the counter here avoid to be off by one.
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
|
|
|
@ -65,7 +65,7 @@ func (h *handler) showEditFeedPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("defaultUserAgent", client.DefaultUserAgent)
|
||||
view.Set("hasProxyConfigured", config.Opts.HasHTTPClientProxyConfigured())
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ func (h *handler) showFeedEntriesPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
view.Set("showOnlyUnreadEntries", true)
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ func (h *handler) showFeedEntriesAllPage(w http.ResponseWriter, r *http.Request)
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
view.Set("showOnlyUnreadEntries", false)
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ func (h *handler) showFeedsPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("feeds"))
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ func (h *handler) updateFeed(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("defaultUserAgent", client.DefaultUserAgent)
|
||||
|
||||
if err := feedForm.ValidateModification(); err != nil {
|
||||
|
|
|
@ -50,7 +50,7 @@ func (h *handler) showHistoryPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "history")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("history_entries"))
|
||||
|
|
|
@ -59,7 +59,7 @@ func (h *handler) showIntegrationPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasPocketConsumerKeyConfigured", config.Opts.PocketConsumerKey("") != "")
|
||||
|
||||
html.OK(w, r, view.Render("integrations"))
|
||||
|
|
|
@ -25,7 +25,7 @@ func (h *handler) showImportPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("import"))
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ func (h *handler) uploadOPML(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
if fileHeader.Size == 0 {
|
||||
view.Set("errorMessage", "error.empty_file")
|
||||
|
@ -86,7 +86,7 @@ func (h *handler) fetchOPML(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
clt := client.NewClientWithConfig(url, config.Opts)
|
||||
resp, err := clt.Get()
|
||||
|
|
|
@ -54,7 +54,7 @@ func (h *handler) showSearchEntriesPage(w http.ResponseWriter, r *http.Request)
|
|||
view.Set("menu", "search")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("search_entries"))
|
||||
|
|
|
@ -36,7 +36,7 @@ func (h *handler) showSessionsPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("sessions"))
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ func (h *handler) showSettingsPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("settings"))
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ package ui // import "miniflux.app/ui"
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/http/route"
|
||||
"miniflux.app/locale"
|
||||
"miniflux.app/logger"
|
||||
|
@ -43,7 +43,7 @@ func (h *handler) updateSettings(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
if err := settingsForm.Validate(); err != nil {
|
||||
view.Set("errorMessage", err.Error())
|
||||
|
|
|
@ -45,7 +45,7 @@ func (h *handler) sharedEntries(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "history")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("shared_entries"))
|
||||
|
|
|
@ -36,7 +36,7 @@ func (h *handler) showAddSubscriptionPage(w http.ResponseWriter, r *http.Request
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("defaultUserAgent", client.DefaultUserAgent)
|
||||
view.Set("form", &form.SubscriptionForm{CategoryID: 0})
|
||||
view.Set("hasProxyConfigured", config.Opts.HasHTTPClientProxyConfigured())
|
||||
|
|
|
@ -39,7 +39,7 @@ func (h *handler) bookmarklet(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("defaultUserAgent", client.DefaultUserAgent)
|
||||
view.Set("hasProxyConfigured", config.Opts.HasHTTPClientProxyConfigured())
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ func (h *handler) showChooseSubscriptionPage(w http.ResponseWriter, r *http.Requ
|
|||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("defaultUserAgent", client.DefaultUserAgent)
|
||||
|
||||
subscriptionForm := form.NewSubscriptionForm(r)
|
||||
|
|
|
@ -39,7 +39,7 @@ func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) {
|
|||
v.Set("menu", "feeds")
|
||||
v.Set("user", user)
|
||||
v.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
v.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
v.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
v.Set("defaultUserAgent", client.DefaultUserAgent)
|
||||
v.Set("hasProxyConfigured", config.Opts.HasHTTPClientProxyConfigured())
|
||||
|
||||
|
@ -102,7 +102,7 @@ func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) {
|
|||
v.Set("menu", "feeds")
|
||||
v.Set("user", user)
|
||||
v.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
v.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
v.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
v.Set("hasProxyConfigured", config.Opts.HasHTTPClientProxyConfigured())
|
||||
|
||||
html.OK(w, r, v.Render("choose_subscription"))
|
||||
|
|
|
@ -55,7 +55,7 @@ func (h *handler) showUnreadPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "unread")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", countUnread)
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("unread_entries"))
|
||||
|
|
|
@ -33,7 +33,7 @@ func (h *handler) showCreateUserPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("create_user"))
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ func (h *handler) showEditUserPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("edit_user"))
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ package ui // import "miniflux.app/ui"
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/ui/session"
|
||||
"miniflux.app/ui/view"
|
||||
)
|
||||
|
@ -40,7 +40,7 @@ func (h *handler) showUsersPage(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("users"))
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ui // import "miniflux.app/ui"
|
||||
package ui // import "miniflux.app/ui"
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/http/request"
|
||||
"miniflux.app/http/response/html"
|
||||
"miniflux.app/http/route"
|
||||
"miniflux.app/logger"
|
||||
"miniflux.app/ui/form"
|
||||
|
@ -35,7 +35,7 @@ func (h *handler) saveUser(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("form", userForm)
|
||||
|
||||
if err := userForm.ValidateCreation(); err != nil {
|
||||
|
|
|
@ -47,7 +47,7 @@ func (h *handler) updateUser(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
||||
view.Set("selected_user", selectedUser)
|
||||
view.Set("form", userForm)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue