From b10c416f9e72da39fb5f7398c7c67faaab008a5e Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 24 Apr 2020 04:57:38 +0100 Subject: Use AJAX for notifications table (#10961) * Use AJAX for notifications table Signed-off-by: Andrew Thornton * move to separate js Signed-off-by: Andrew Thornton * placate golangci-lint Signed-off-by: Andrew Thornton * Add autoupdating notification count Signed-off-by: Andrew Thornton * Fix wipeall Signed-off-by: Andrew Thornton * placate tests Signed-off-by: Andrew Thornton * Try hidden Signed-off-by: Andrew Thornton * Try hide and hidden Signed-off-by: Andrew Thornton * More auto-update improvements Only run checker on pages that have a count Change starting checker to 10s with a back-off to 60s if there is no change Signed-off-by: Andrew Thornton * string comparison! Signed-off-by: Andrew Thornton * as per @silverwind Signed-off-by: Andrew Thornton * add configurability as per @6543 Signed-off-by: Andrew Thornton * Add documentation as per @6543 Signed-off-by: Andrew Thornton * Use CSRF header not query Signed-off-by: Andrew Thornton * Further JS improvements Fix @etzelia update notification table request Fix @silverwind comments Co-Authored-By: silverwind Signed-off-by: Andrew Thornton * Simplify the notification count fns Signed-off-by: Andrew Thornton Co-authored-by: silverwind --- modules/setting/setting.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'modules/setting/setting.go') diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 069a3556da..bf2ed6111e 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -181,6 +181,12 @@ var ( SearchRepoDescription bool UseServiceWorker bool + Notification struct { + MinTimeout time.Duration + TimeoutStep time.Duration + MaxTimeout time.Duration + } `ini:"ui.notification"` + Admin struct { UserPagingNum int RepoPagingNum int @@ -209,6 +215,15 @@ var ( DefaultTheme: `gitea`, Themes: []string{`gitea`, `arc-green`}, Reactions: []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`}, + Notification: struct { + MinTimeout time.Duration + TimeoutStep time.Duration + MaxTimeout time.Duration + }{ + MinTimeout: 10 * time.Second, + TimeoutStep: 10 * time.Second, + MaxTimeout: 60 * time.Second, + }, Admin: struct { UserPagingNum int RepoPagingNum int -- cgit v1.2.3