diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-24 01:14:30 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-24 01:37:24 +0100 |
commit | 4d843d2bde236ec23810d0904dfb8aebbc53a37b (patch) | |
tree | 84c01452f01620cedb7bf6bcb608a0eade82161b /lib/agent/apiv1.go | |
parent | 38c0c21a969e621c725245ce91c78e77076c5ce7 (diff) |
New dashboard improvements.
- add build buttons
- add build settings support and backup into project clientData
- improved async alert
- fixed project dropdown
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/apiv1.go')
-rw-r--r-- | lib/agent/apiv1.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/agent/apiv1.go b/lib/agent/apiv1.go index 3e742f5..36e5a54 100644 --- a/lib/agent/apiv1.go +++ b/lib/agent/apiv1.go @@ -8,7 +8,7 @@ import ( "github.com/iotbzh/xds-agent/lib/xdsconfig" ) -const apiBaseUrl = "/api/v1" +const apiBaseURL = "/api/v1" // APIService . type APIService struct { @@ -21,7 +21,7 @@ type APIService struct { func NewAPIV1(ctx *Context) *APIService { s := &APIService{ Context: ctx, - apiRouter: ctx.webServer.router.Group(apiBaseUrl), + apiRouter: ctx.webServer.router.Group(apiBaseURL), serverIndex: 0, } @@ -34,6 +34,7 @@ func NewAPIV1(ctx *Context) *APIService { s.apiRouter.GET("/projects", s.getProjects) s.apiRouter.GET("/projects/:id", s.getProject) + s.apiRouter.PUT("/projects/:id", s.updateProject) s.apiRouter.POST("/projects", s.addProject) s.apiRouter.POST("/projects/sync/:id", s.syncProject) s.apiRouter.DELETE("/projects/:id", s.delProject) @@ -80,7 +81,7 @@ func (s *APIService) AddXdsServer(cfg xdsconfig.XDSServerConf) (*XdsServer, erro // Create a new server object if cfg.APIBaseURL == "" { - cfg.APIBaseURL = apiBaseUrl + cfg.APIBaseURL = apiBaseURL } if cfg.APIPartialURL == "" { cfg.APIPartialURL = "/server/" + strconv.Itoa(s.serverIndex) |