1
0
Fork 0

Refactoring REST API to handle multiple providers.

I changed what I think is needed and I have done manual testing on this.

I tried to keep the changes to a minimun.

The changes are approx:

* HTML output now includes the provider name in parenthesis.
  * I'm not versed in bootstrap, should the output group providers in a
  * table?
* PUT is only enabled on /api/web.
* GET on /api returns a map containing all providers configuration
* GET on /api/{provider} will return the config as before on that
* provider.
This commit is contained in:
Thorhallur Sverrisson 2015-09-22 23:17:21 +00:00
parent 55a50c5ab7
commit a07e395181
2 changed files with 34 additions and 40 deletions

View file

@ -27,9 +27,10 @@
<div class="col-md-6">
<!-- <div class="panel-heading">Frontends</div>
<div class="panel-body"> -->
{{range $keyFrontends, $valueFrontends := .Configuration.Frontends}}
{{range $keyProviders, $valueProviders := .Configurations}}
{{range $keyFrontends, $valueFrontends := $valueProviders.Frontends}}
<div class="panel panel-primary">
<div class="panel-heading">{{$keyFrontends}}</div>
<div class="panel-heading">{{$keyFrontends}} - ({{$keyProviders}})</div>
<div class="panel-body">
<a class="btn btn-info" role="button" data-toggle="collapse" href="#{{$valueFrontends.Backend}}" aria-expanded="false">
{{$valueFrontends.Backend}}
@ -51,14 +52,16 @@
</table>
</div>
{{end}}
{{end}}
<!-- </div> -->
</div>
<div class="col-md-6">
<!-- <div class="panel-heading">Backends</div>
<div class="panel-body"> -->
{{range $keyBackends, $valueBackends := .Configuration.Backends}}
{{range $keyProviders, $valueProviders := .Configurations}}
{{range $keyBackends, $valueBackends := $valueProviders.Backends}}
<div class="panel panel-primary" id="{{$keyBackends}}">
<div class="panel-heading">{{$keyBackends}}</div>
<div class="panel-heading">{{$keyBackends}}({{$keyProviders}})</div>
<div class="panel-body">
{{with $valueBackends.LoadBalancer}}
<a class="btn btn-info" role="button">
@ -87,6 +90,7 @@
</table>
</div>
{{end}}
{{end}}
<!-- </div> -->
</div>