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.

80 lines
1.7 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.Mime }}
  48. {{end}}
  49. </td>
  50. <td align="right">
  51. {{if $entry.IsDirectory}}
  52. {{else}}
  53. {{ $entry.Size }} bytes
  54. &nbsp;&nbsp;&nbsp;
  55. {{end}}
  56. </td>
  57. <td>
  58. {{ $entry.Timestamp.Format "2006-01-02 15:04" }}
  59. </td>
  60. </tr>
  61. {{ end }}
  62. </table>
  63. </div>
  64. {{if .ShouldDisplayLoadMore}}
  65. <div class="row">
  66. <a href={{ print .Path "?limit=" .Limit "&lastFileName=" .LastFileName}} >
  67. Load more
  68. </a>
  69. </div>
  70. {{end}}
  71. </div>
  72. </body>
  73. </html>
  74. `))