Adding an option to (de)activate Pilot integration into the Traefik dashboard
Co-authored-by: Jean-Baptiste Doumenjou <925513+jbdoumenjou@users.noreply.github.com>
This commit is contained in:
parent
06fc2c505f
commit
1e716a93ff
8 changed files with 50 additions and 12 deletions
|
@ -24,6 +24,8 @@ var (
|
|||
StartDate = time.Now()
|
||||
// UUID instance uuid.
|
||||
UUID string
|
||||
// PilotEnabled activate integration of pilot into the dashboard.
|
||||
PilotEnabled bool
|
||||
)
|
||||
|
||||
// Handler expose version routes.
|
||||
|
@ -38,15 +40,17 @@ 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"`
|
||||
PilotEnabled bool `json:"pilotEnabled"`
|
||||
}{
|
||||
Version: Version,
|
||||
Codename: Codename,
|
||||
StartDate: StartDate,
|
||||
UUID: UUID,
|
||||
Version: Version,
|
||||
Codename: Codename,
|
||||
StartDate: StartDate,
|
||||
UUID: UUID,
|
||||
PilotEnabled: PilotEnabled,
|
||||
}
|
||||
|
||||
if err := templatesRenderer.JSON(response, http.StatusOK, v); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue