Updates the Hub tooltip content using a web component and adds an option to disable Hub button

This commit is contained in:
Massimiliano D 2023-07-19 16:56:05 +02:00 committed by GitHub
parent 48de3b0230
commit e29da5ad65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 67 additions and 92 deletions

View file

@ -22,7 +22,8 @@ var (
BuildDate = "I don't remember exactly"
// StartDate holds the start date of traefik.
StartDate = time.Now()
// UUID instance uuid.
// DisableDashboardAd disables ad in the dashboard.
DisableDashboardAd = false
)
// Handler expose version routes.
@ -37,14 +38,16 @@ func (v Handler) Append(router *mux.Router) {
router.Methods(http.MethodGet).Path("/api/version").
HandlerFunc(func(response http.ResponseWriter, request *http.Request) {
v := struct {
Version string
Codename string
StartDate time.Time `json:"startDate"`
UUID string `json:"uuid,omitempty"`
Version string
Codename string
StartDate time.Time `json:"startDate"`
UUID string `json:"uuid,omitempty"`
DisableDashboardAd bool `json:"disableDashboardAd,omitempty"`
}{
Version: Version,
Codename: Codename,
StartDate: StartDate,
Version: Version,
Codename: Codename,
StartDate: StartDate,
DisableDashboardAd: DisableDashboardAd,
}
if err := templatesRenderer.JSON(response, http.StatusOK, v); err != nil {