You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.6 KiB

10 years ago
10 years ago
  1. package master_ui
  2. import (
  3. "html/template"
  4. )
  5. var StatusTpl = template.Must(template.New("status").Parse(`<!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title>Seaweed File System {{ .Version }}</title>
  9. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
  10. </head>
  11. <body>
  12. <div class="container">
  13. <div class="page-header">
  14. <h1>Seaweed File System <small>{{ .Version }}</small></h1>
  15. </div>
  16. <div class="row">
  17. <div class="col-sm-6">
  18. <h2>Cluster status</h2>
  19. <table class="table">
  20. <tbody>
  21. <tr>
  22. <th>Free</th>
  23. <td>{{ .Topology.Free }}</td>
  24. </tr>
  25. <tr>
  26. <th>Max</th>
  27. <td>{{ .Topology.Max }}</td>
  28. </tr>
  29. <tr>
  30. <td class="col-sm-2 field-label"><label>Peers:</label></td>
  31. <td class="col-sm-10"><ul class="list-unstyled">
  32. {{ range $k, $p := .Peers }}
  33. <li><a href="{{ $p.ConnectionString }}">{{ $p.Name }}</a></li>
  34. {{ end }}
  35. </ul></td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. <div class="col-sm-6">
  41. <h2>System Stats</h2>
  42. <table class="table table-condensed table-striped">
  43. <tr>
  44. <th>Concurrent Connections</th>
  45. <td>{{ .Counters.Connections.WeekCounter.Count }}</td>
  46. </tr>
  47. {{ range $key, $val := .Stats }}
  48. <tr>
  49. <th>{{ $key }}</th>
  50. <td>{{ $val }}</td>
  51. </tr>
  52. {{ end }}
  53. </table>
  54. </div>
  55. </div>
  56. <div class="row">
  57. <h2>Topology</h2>
  58. <table class="table table-striped">
  59. <thead>
  60. <tr>
  61. <th>Data Center</th>
  62. <th>Rack</th>
  63. <th>RemoteAddr</th>
  64. <th>#Volumes</th>
  65. <th>Max</th>
  66. </tr>
  67. </thead>
  68. <tbody>
  69. {{ range $dc_index, $dc := .Topology.DataCenters }}
  70. {{ range $rack_index, $rack := $dc.Racks }}
  71. {{ range $dn_index, $dn := $rack.DataNodes }}
  72. <tr>
  73. <td><code>{{ $dc.Id }}</code></td>
  74. <td>{{ $rack.Id }}</td>
  75. <td><a href="http://{{ $dn.Url }}/ui/index.html">{{ $dn.Url }}</a></td>
  76. <td>{{ $dn.Volumes }}</td>
  77. <td>{{ $dn.Max }}</td>
  78. </tr>
  79. {{ end }}
  80. {{ end }}
  81. {{ end }}
  82. </tbody>
  83. </table>
  84. </div>
  85. </div>
  86. </body>
  87. </html>
  88. `))