Merge pull request #307 from vmarmol/root

Add "Docker containers are here" link to the main page.
This commit is contained in:
Rohit Jnagal 2014-11-13 11:23:27 -08:00
commit a4e25f056b
3 changed files with 7 additions and 0 deletions

View File

@ -276,6 +276,7 @@ func serveContainersPage(m manager.Manager, w http.ResponseWriter, u *url.URL) e
Spec: cont.Spec,
Stats: cont.Stats,
MachineInfo: machineInfo,
IsRoot: cont.Name == "/",
ResourcesAvailable: cont.Spec.HasCpu || cont.Spec.HasMemory || cont.Spec.HasNetwork || cont.Spec.HasFilesystem,
CpuAvailable: cont.Spec.HasCpu,
MemoryAvailable: cont.Spec.HasMemory,

View File

@ -47,6 +47,11 @@ const containersHtmlTemplate = `
{{end}}
</ol>
</div>
{{if .IsRoot}}
<div class="col-sm-12">
<h4><a href="/docker">Docker Containers</a></h4>
</div>
{{end}}
{{if .Subcontainers}}
<div class="col-sm-12">
<div class="page-header">

View File

@ -28,6 +28,7 @@ type pageData struct {
Spec info.ContainerSpec
Stats []*info.ContainerStats
MachineInfo *info.MachineInfo
IsRoot bool
ResourcesAvailable bool
CpuAvailable bool
MemoryAvailable bool