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.

78 lines
2.0 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>Disk Stats</h2>
  19. <table class="table table-condensed table-striped">
  20. {{ range .DiskStatuses }}
  21. <tr>
  22. <th>{{ .Dir }}</th>
  23. <td>{{ .Free }}</td>
  24. </tr>
  25. {{ end }}
  26. </table>
  27. </div>
  28. <div class="col-sm-6">
  29. <h2>System Stats</h2>
  30. <table class="table table-condensed table-striped">
  31. <tr>
  32. <th>Master</th>
  33. <td><a href="http://{{.Master}}/ui/index.html">{{.Master}}</a></td>
  34. </tr>
  35. {{ range $key, $val := .Stats }}
  36. <tr>
  37. <th>{{ $key }}</th>
  38. <td>{{ $val }}</td>
  39. </tr>
  40. {{ end }}
  41. </table>
  42. </div>
  43. </div>
  44. <div class="row">
  45. <h2>Volumes</h2>
  46. <table class="table table-striped">
  47. <thead>
  48. <tr>
  49. <th>Id</th>
  50. <th>Size</th>
  51. <th>Files</th>
  52. <th>Trash</th>
  53. <th>TTL</th>
  54. </tr>
  55. </thead>
  56. <tbody>
  57. {{ range .Volumes }}
  58. <tr>
  59. <td><code>{{ .Id }}</code></td>
  60. <td>{{ .Size }}</td>
  61. <td>{{ .FileCount }}</td>
  62. <td>{{ .DeleteCount }} / {{.DeletedByteCount}} Bytes</td>
  63. <td>{{ .Ttl }}</td>
  64. </tr>
  65. {{ end }}
  66. </tbody>
  67. </table>
  68. </div>
  69. </div>
  70. </body>
  71. </html>
  72. `))