web provider

This commit is contained in:
emile 2015-09-08 22:41:14 +02:00
parent 03a45f08e2
commit 182a829284
3 changed files with 22 additions and 16 deletions

View file

@ -29,11 +29,12 @@
<div class="container">
<div class="row">
<div class="panel panel-default col-md-5">
<div class="panel-default col-md-6">
<div class="panel-heading">Backends</div>
<div class="panel-body">
{{range $keyBackends, $valueBackends := .Configuration.Backends}}
<div class="panel panel-primary">
<div class="panel panel-primary" id="{{$keyBackends}}">
<div class="panel-heading">{{$keyBackends}}</div>
<table class="table table-striped table-hover">
<tr>
@ -52,7 +53,7 @@
</div>
</div>
<div class="panel panel-default col-md-5 col-md-offset-2">
<div class="panel-default col-md-6">
<div class="panel-heading">Routes</div>
<div class="panel-body">
{{range $keyRoutes, $valueRoutes := .Configuration.Routes}}
@ -60,7 +61,10 @@
<div class="panel-heading">{{$keyRoutes}}</div>
<div class="panel-body">
{{range $backend := $valueRoutes.Backends}}
<button type="button" class="btn btn-info">{{$backend}}</button>
<!--<button type="button" class="btn btn-info">{{$backend}}</button>-->
<a class="btn btn-info" role="button" data-toggle="collapse" href="#{{$backend}}" aria-expanded="false">
{{$backend}}
</a>
{{end}}
</div>
<table class="table table-striped table-hover">
@ -81,7 +85,9 @@
{{end}}
</div>
</div>
</div>
</div>
</body>
</html>

View file

@ -1,16 +1,16 @@
[backends]{{range .Containers}}
[backends.{{.Config.Hostname}}]
[backends.{{.Config.Hostname}}.servers.{{.Config.Hostname}}]
[backends.backend-{{.Config.Hostname}}]
[backends.backend-{{.Config.Hostname}}.servers.server-{{.Config.Hostname}}]
url = "http://{{.NetworkSettings.IPAddress}}:80"
{{end}}
[routes]{{range .Containers}}
[routes.{{.Config.Hostname}}]
backends = ["{{.Config.Hostname}}"]
[routes.{{.Config.Hostname}}.rules.{{.Config.Hostname}}-hostname]
[routes.route-{{.Config.Hostname}}]
backends = ["backend-{{.Config.Hostname}}"]
[routes.route-{{.Config.Hostname}}.rules.rule-{{.Config.Hostname}}-hostname]
category = "Host"
value = "{{.Config.Hostname}}.zenika.fr"
[routes.{{.Config.Hostname}}.rules.{{.Config.Hostname}}-name]
[routes.route-{{.Config.Hostname}}.rules.rule-{{.Config.Hostname}}-name]
category = "Host"
value = "{{.Name | replace "/"}}.zenika.fr"
{{end}}

View file

@ -1,13 +1,13 @@
#[docker]
#endpoint = "unix:///var/run/docker.sock"
#watch = true
[docker]
endpoint = "unix:///var/run/docker.sock"
watch = true
[web]
address = ":8010"
[file]
filename = "tortuous.toml"
watch = true
#[file]
#filename = "tortuous.toml"
#watch = true
[backends]
[backends.backend1]