зеркало из https://github.com/mozilla/mig.git
[minor] add API dashboard link to homepage
This commit is contained in:
Родитель
92c0246e7b
Коммит
dd8ef1a30a
|
@ -150,7 +150,22 @@ func getHome(respWriter http.ResponseWriter, request *http.Request) {
|
|||
ctx.Channels.Log <- mig.Log{OpID: opid, Desc: "leaving getHome()"}.Debug()
|
||||
}()
|
||||
|
||||
// List the creation URL. Those can be GET-ed to retrieve the creation templates
|
||||
resource.AddQuery(cljs.Query{
|
||||
Rel: "Get dashboard",
|
||||
Href: fmt.Sprintf("%s/dashboard", ctx.Server.BaseURL),
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
resource.AddQuery(cljs.Query{
|
||||
Rel: "Get agent dashboard",
|
||||
Href: fmt.Sprintf("%s/agent/dashboard", ctx.Server.BaseURL),
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = resource.AddLink(cljs.Link{
|
||||
Rel: "create action",
|
||||
Href: fmt.Sprintf("%s/action/create/", ctx.Server.BaseURL),
|
||||
|
@ -225,14 +240,6 @@ func getHome(respWriter http.ResponseWriter, request *http.Request) {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
resource.AddQuery(cljs.Query{
|
||||
Rel: "Get agent dashboard",
|
||||
Href: fmt.Sprintf("%s/agent/dashboard", ctx.Server.BaseURL),
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
respond(200, resource, respWriter, request, opid)
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче