1
0
Fork 0

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

@ -104,9 +104,10 @@ type ServersTransport struct {
// API holds the API configuration.
type API struct {
Insecure bool `description:"Activate API directly on the entryPoint named traefik." json:"insecure,omitempty" toml:"insecure,omitempty" yaml:"insecure,omitempty" export:"true"`
Dashboard bool `description:"Activate dashboard." json:"dashboard,omitempty" toml:"dashboard,omitempty" yaml:"dashboard,omitempty" export:"true"`
Debug bool `description:"Enable additional endpoints for debugging and profiling." json:"debug,omitempty" toml:"debug,omitempty" yaml:"debug,omitempty" export:"true"`
Insecure bool `description:"Activate API directly on the entryPoint named traefik." json:"insecure,omitempty" toml:"insecure,omitempty" yaml:"insecure,omitempty" export:"true"`
Dashboard bool `description:"Activate dashboard." json:"dashboard,omitempty" toml:"dashboard,omitempty" yaml:"dashboard,omitempty" export:"true"`
Debug bool `description:"Enable additional endpoints for debugging and profiling." json:"debug,omitempty" toml:"debug,omitempty" yaml:"debug,omitempty" export:"true"`
DisableDashboardAd bool `description:"Disable ad in the dashboard." json:"disableDashboardAd,omitempty" toml:"disableDashboardAd,omitempty" yaml:"disableDashboardAd,omitempty" export:"true"`
// TODO: Re-enable statistics
// Statistics *types.Statistics `description:"Enable more detailed statistics." json:"statistics,omitempty" toml:"statistics,omitempty" yaml:"statistics,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
}

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 {