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.

90 lines
2.5 KiB

  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 .Peers }}
  33. <li><a href="https://{{ . }}">{{ . }}</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. {{ range $key, $val := .Stats }}
  44. <tr>
  45. <th>{{ $key }}</th>
  46. <td>{{ $val }}</td>
  47. </tr>
  48. {{ end }}
  49. </table>
  50. </div>
  51. </div>
  52. <div class="row">
  53. <h2>Topology</h2>
  54. <table class="table table-striped">
  55. <thead>
  56. <tr>
  57. <th>Data Center</th>
  58. <th>Rack</th>
  59. <th>RemoteAddr</th>
  60. <th>#Volumes</th>
  61. <th>Max</th>
  62. </tr>
  63. </thead>
  64. <tbody>
  65. {{ range $dc_index, $dc := .Topology.DataCenters }}
  66. {{ range $rack_index, $rack := $dc.Racks }}
  67. {{ range $dn_index, $dn := $rack.DataNodes }}
  68. <tr>
  69. <td><code>{{ $dc.Id }}</code></td>
  70. <td>{{ $rack.Id }}</td>
  71. <td><a href="http://{{ $dn.Url }}/ui/index.html">{{ $dn.Url }}</a></td>
  72. <td>{{ $dn.Volumes }}</td>
  73. <td>{{ $dn.Max }}</td>
  74. </tr>
  75. {{ end }}
  76. {{ end }}
  77. {{ end }}
  78. </tbody>
  79. </table>
  80. </div>
  81. </div>
  82. </body>
  83. </html>
  84. `))