seaweedfs/weed/server/filer_ui/templates.go

81 lines
1.7 KiB
Go
Raw Normal View History

2016-07-18 16:28:24 +08:00
package master_ui
import (
"html/template"
)
var StatusTpl = template.Must(template.New("status").Parse(`<!DOCTYPE html>
<html>
<head>
<title>SeaweedFS Filer</title>
<link rel="icon" href="http://7viirv.com1.z0.glb.clouddn.com/seaweed_favicon.png" sizes="32x32" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="page-header">
<h1>
<img src="http://7viirv.com1.z0.glb.clouddn.com/seaweed50x50.png"></img>
SeaweedFS Filer
</h1>
</div>
<div class="row">
2018-05-25 14:42:13 +08:00
{{ range $entry := .Breadcrumbs }}
<a href={{ $entry.Link }} >
{{ $entry.Name }}
</a>
{{ end }}
2016-07-18 16:28:24 +08:00
</div>
<div class="row">
2018-05-25 14:21:12 +08:00
<table width="90%">
2016-07-18 16:28:24 +08:00
{{$path := .Path }}
2018-05-14 14:56:16 +08:00
{{ range $entry_index, $entry := .Entries }}
2018-05-25 14:21:12 +08:00
<tr>
<td>
2018-05-14 14:56:16 +08:00
{{if $entry.IsDirectory}}
<img src="https://www.w3.org/TR/WWWicn/folder.gif" width="20" height="23">
<a href={{ print $path "/" $entry.Name "/"}} >
{{ $entry.Name }}
</a>
{{else}}
<a href={{ print $path "/" $entry.Name }} >
{{ $entry.Name }}
</a>
{{end}}
2018-05-25 14:21:12 +08:00
</td>
<td align="right">
{{if $entry.IsDirectory}}
{{else}}
{{ $entry.Mime }}
{{end}}
</td>
<td align="right">
{{if $entry.IsDirectory}}
2018-05-25 14:21:12 +08:00
{{else}}
{{ $entry.Size }} bytes
&nbsp;&nbsp;&nbsp;
2018-05-25 14:21:12 +08:00
{{end}}
</td>
<td>
{{ $entry.Timestamp.Format "2006-01-02 15:04" }}
</td>
</tr>
2016-07-18 16:28:24 +08:00
{{ end }}
2018-05-25 14:21:12 +08:00
</table>
2016-07-18 16:28:24 +08:00
</div>
2018-05-06 05:41:40 +08:00
{{if .ShouldDisplayLoadMore}}
2016-07-18 16:28:24 +08:00
<div class="row">
2018-05-06 05:41:40 +08:00
<a href={{ print .Path "?limit=" .Limit "&lastFileName=" .LastFileName}} >
Load more
</a>
2016-07-18 16:28:24 +08:00
</div>
{{end}}
</div>
</body>
</html>
`))