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.

74 lines
1.6 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. {{ range $entry := .Breadcrumbs }}
  22. <a href={{ $entry.Link }} >
  23. {{ $entry.Name }}
  24. </a>
  25. {{ end }}
  26. </div>
  27. <div class="row">
  28. <table width="90%">
  29. {{$path := .Path }}
  30. {{ range $entry_index, $entry := .Entries }}
  31. <tr>
  32. <td>
  33. {{if $entry.IsDirectory}}
  34. <img src="https://www.w3.org/TR/WWWicn/folder.gif" width="20" height="23">
  35. <a href={{ print $path "/" $entry.Name "/"}} >
  36. {{ $entry.Name }}
  37. </a>
  38. {{else}}
  39. <a href={{ print $path "/" $entry.Name }} >
  40. {{ $entry.Name }}
  41. </a>
  42. {{end}}
  43. </td>
  44. <td align="right">
  45. {{if $entry.IsDirectory}}
  46. {{else}}
  47. {{ $entry.Size }} bytes
  48. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  49. {{end}}
  50. </td>
  51. <td>
  52. {{ $entry.Timestamp.Format "2006-01-02 15:04" }}
  53. </td>
  54. </tr>
  55. {{ end }}
  56. </table>
  57. </div>
  58. {{if .ShouldDisplayLoadMore}}
  59. <div class="row">
  60. <a href={{ print .Path "?limit=" .Limit "&lastFileName=" .LastFileName}} >
  61. Load more
  62. </a>
  63. </div>
  64. {{end}}
  65. </div>
  66. </body>
  67. </html>
  68. `))