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.

69 lines
1.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>SeaweedFS Filer</title>
  9. <link rel="icon" href="http://7viirv.com1.z0.glb.clouddn.com/seaweed_favicon.png" sizes="32x32" />
  10. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
  11. </head>
  12. <body>
  13. <div class="container">
  14. <div class="page-header">
  15. <h1>
  16. <img src="http://7viirv.com1.z0.glb.clouddn.com/seaweed50x50.png"></img>
  17. SeaweedFS Filer
  18. </h1>
  19. </div>
  20. <div class="row">
  21. {{.Path}}
  22. </div>
  23. <div class="row">
  24. <table width="90%">
  25. {{$path := .Path }}
  26. {{ range $entry_index, $entry := .Entries }}
  27. <tr>
  28. <td>
  29. {{if $entry.IsDirectory}}
  30. <img src="https://www.w3.org/TR/WWWicn/folder.gif" width="20" height="23">
  31. <a href={{ print $path "/" $entry.Name "/"}} >
  32. {{ $entry.Name }}
  33. </a>
  34. {{else}}
  35. <a href={{ print $path "/" $entry.Name }} >
  36. {{ $entry.Name }}
  37. </a>
  38. {{end}}
  39. </td>
  40. <td align="right">
  41. {{if $entry.IsDirectory}}
  42. {{else}}
  43. {{ $entry.Size }} bytes
  44. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  45. {{end}}
  46. </td>
  47. <td>
  48. {{ $entry.Timestamp.Format "2006-01-02 15:04" }}
  49. </td>
  50. </tr>
  51. {{ end }}
  52. </table>
  53. </div>
  54. {{if .ShouldDisplayLoadMore}}
  55. <div class="row">
  56. <a href={{ print .Path "?limit=" .Limit "&lastFileName=" .LastFileName}} >
  57. Load more
  58. </a>
  59. </div>
  60. {{end}}
  61. </div>
  62. </body>
  63. </html>
  64. `))