1
0
mirror of https://github.com/containous/traefik.git synced 2024-12-22 13:34:03 +03:00

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>
</nav>
<div class="panel panel-default">
<div class="panel-heading">Backends</div>
<div class="panel-body">
{{range $keyBackends, $valueBackends := .Configuration.Backends}}
<div class="panel panel-default">
<div class="panel-heading">Backend {{$keyBackends}}</div>
<div class="panel-body">
{{range $keyServers, $valueServers := $valueBackends.Servers}}
<div class="panel panel-default">
<div class="panel-heading">Server {{$keyServers}}</div>
<div class="panel-body">
Url: {{$valueServers.Url}}
<div class="container">
<div class="row">
<div class="panel panel-default col-md-5">
<div class="panel-heading">Backends</div>
<div class="panel-body">
{{range $keyBackends, $valueBackends := .Configuration.Backends}}
<div class="panel panel-primary">
<div class="panel-heading">{{$keyBackends}}</div>
<table class="table table-striped table-hover">
<tr>
<td><em>Server</em></td>
<td><em>URL</em></td>
</tr>
{{range $keyServers, $valueServers := $valueBackends.Servers}}
<tr>
<td>{{$keyServers}}</td>
<td><code>{{$valueServers.Url}}</code></td>
</tr>
{{end}}
</table>
</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>
{{end}}
</div>
</div>
{{end}}
</div>
</div>
</body>
</html>

View File

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