Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/web.go')
-rw-r--r--web/web.go26
1 files changed, 15 insertions, 11 deletions
diff --git a/web/web.go b/web/web.go
index 9080f899..c7a2ce1f 100644
--- a/web/web.go
+++ b/web/web.go
@@ -266,6 +266,11 @@ func (s *Server) initRouter() (*gin.Engine, error) {
s.panel = controller.NewXUIController(g)
s.api = controller.NewAPIController(g)
+ // Chrome DevTools endpoint for debugging web apps
+ engine.GET("/.well-known/appspecific/com.chrome.devtools.json", func(c *gin.Context) {
+ c.JSON(http.StatusOK, gin.H{})
+ })
+
// Add a catch-all route to handle undefined paths and return 404
engine.NoRoute(func(c *gin.Context) {
c.AbortWithStatus(http.StatusNotFound)
@@ -314,17 +319,16 @@ func (s *Server) startTask() {
// Run once a month, midnight, first of month
s.cron.AddJob("@monthly", job.NewPeriodicTrafficResetJob("monthly"))
- // LDAP sync scheduling
- if ldapEnabled, _ := s.settingService.GetLdapEnable(); ldapEnabled {
- runtime, err := s.settingService.GetLdapSyncCron()
- if err != nil || runtime == "" {
- runtime = "@every 1m"
- }
- j := job.NewLdapSyncJob()
- // job has zero-value services with method receivers that read settings on demand
- s.cron.AddJob(runtime, j)
- }
-
+ // LDAP sync scheduling
+ if ldapEnabled, _ := s.settingService.GetLdapEnable(); ldapEnabled {
+ runtime, err := s.settingService.GetLdapSyncCron()
+ if err != nil || runtime == "" {
+ runtime = "@every 1m"
+ }
+ j := job.NewLdapSyncJob()
+ // job has zero-value services with method receivers that read settings on demand
+ s.cron.AddJob(runtime, j)
+ }
// Make a traffic condition every day, 8:30
var entry cron.EntryID