1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-26 01:04:06 +08:00
ContextOS/usr/up.html
2018-05-22 22:13:34 +08:00

86 lines
1.7 KiB
HTML

<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<style>
th {
cursor:pointer;
background-color:lightgray;
}
.time {
padding-right:20px;
}
.size {
text-align:right;
padding-right:20px;
}
.name {
padding-left:10px;
text-align:left;
}
code {
font-size:14px;
}
</style>
</head>
<body>
<form method="POST" action="/upload" enctype="multipart/form-data">
<fieldset><legend>upload</legend>
<input type="file" name="file"><input type="submit">
</fieldset>
<fieldset><legend>message</legend>
<pre>{{index . "message"}}</pre>
</fieldset>
<fieldset><legend>branch</legend>
<pre>{{index . "branch"}}</pre>
</fieldset>
<fieldset><legend>status</legend>
<pre>{{index . "status"}}</pre>
</fieldset>
</form>
<table>
<colgroup>{{range .append}}<col class="{{.}}">{{end}}</colgroup>
<tr>{{range .append}}<th class="{{.}}" onclick="list('{{.}}')">{{.}}</th>{{end}}</tr>
{{$meta := .}} {{$first := index .append 0}}
{{range $i, $k := index . $first}}
<tr>
{{range $key := index $meta "append"}}
{{if eq $key "name"}}
<td class="{{$key}}">
<a href="/upload?file={{index $meta "file" 0}}/{{index $meta $key $i}}"><code>{{index $meta $key $i}}</code></a>
</td>
{{else}}
<td class="{{$key}}">
<code>{{index $meta $key $i}}</code>
</td>
{{end}}
{{end}}
</tr>
{{end}}
</table>
<script>
function Cookie(name, value) {
if (value == undefined) {
var pattern = new RegExp(name+"=([^;]*);?");
var result = pattern.exec(document.cookie);
if (result && result.length > 0) {
return result[1];
}
return ""
}
document.cookie = name+"="+value;
return Cookie(name);
}
function list(what) {
Cookie("list", what);
Cookie("order", Cookie("order")*1 + 1)
location.assign(location.href)
}
</script>
</body>