web provider

This commit is contained in:
emile 2015-09-08 22:03:31 +02:00
parent e894ae9f0a
commit 03a45f08e2
2 changed files with 56 additions and 20 deletions

View file

@ -27,28 +27,61 @@
</div> </div>
</nav> </nav>
<div class="panel panel-default"> <div class="container">
<div class="panel-heading">Backends</div> <div class="row">
<div class="panel panel-default col-md-5">
<div class="panel-body"> <div class="panel-heading">Backends</div>
{{range $keyBackends, $valueBackends := .Configuration.Backends}} <div class="panel-body">
<div class="panel panel-default"> {{range $keyBackends, $valueBackends := .Configuration.Backends}}
<div class="panel-heading">Backend {{$keyBackends}}</div> <div class="panel panel-primary">
<div class="panel-body"> <div class="panel-heading">{{$keyBackends}}</div>
{{range $keyServers, $valueServers := $valueBackends.Servers}} <table class="table table-striped table-hover">
<div class="panel panel-default"> <tr>
<div class="panel-heading">Server {{$keyServers}}</div> <td><em>Server</em></td>
<div class="panel-body"> <td><em>URL</em></td>
Url: {{$valueServers.Url}} </tr>
{{range $keyServers, $valueServers := $valueBackends.Servers}}
<tr>
<td>{{$keyServers}}</td>
<td><code>{{$valueServers.Url}}</code></td>
</tr>
{{end}}
</table>
</div> </div>
{{end}}
</div>
</div>
<div class="panel panel-default col-md-5 col-md-offset-2">
<div class="panel-heading">Routes</div>
<div class="panel-body">
{{range $keyRoutes, $valueRoutes := .Configuration.Routes}}
<div class="panel panel-primary">
<div class="panel-heading">{{$keyRoutes}}</div>
<div class="panel-body">
{{range $backend := $valueRoutes.Backends}}
<button type="button" class="btn btn-info">{{$backend}}</button>
{{end}}
</div>
<table class="table table-striped table-hover">
<tr>
<td><em>Rule</em></td>
<td><em>Category</em></td>
<td><em>Value</em></td>
</tr>
{{range $keyRules, $valueRules := $valueRoutes.Rules}}
<tr>
<td>{{$keyRules}}</td>
<td>{{$valueRules.Category}}</td>
<td>{{$valueRules.Value}}</td>
</tr>
{{end}}
</table>
</div>
{{end}}
</div> </div>
{{end}}
</div> </div>
</div> </div>
{{end}}
</div>
</div> </div>
</body> </body>
</html> </html>

View file

@ -15,10 +15,13 @@ watch = true
url = "http://172.17.0.2:80" url = "http://172.17.0.2:80"
[backends.backend1.servers.server2] [backends.backend1.servers.server2]
url = "http://172.17.0.3:80" url = "http://172.17.0.3:80"
[backends.backend2]
[backends.backend2.servers.server1]
url = "http://172.17.0.2:80"
[routes] [routes]
[routes.route1] [routes.route1]
backends = ["backend1"] backends = ["backend1", "backend2"]
[routes.route1.rules.test_zenika_1] [routes.route1.rules.test_zenika_1]
category = "Host" category = "Host"
value = "test.zenika.fr" value = "test.zenika.fr"