自动更新管控端
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.
 
 
 
 
 
 

195 lines
4.7 KiB

<!DOCTYPE html>
<html>
<head>
<title>File Transfer</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
}
.container {
max-width: 1000px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.center {
text-align: center;
}
h1, h2 {
text-align: center;
color: #333;
font-size: 2rem;
}
ul {
list-style-type: none;
padding: 0;
}
li {
padding: 10px;
border-bottom: 1px solid #ddd;
display: flex;
align-items: center;
font-size: 1.2rem;
}
li:last-child {
border-bottom: none;
}
a {
text-decoration: none;
color: #333;
}
.btn {
display: inline-block;
padding: 8px 16px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
margin-left: auto;
}
.btn:hover {
background-color: #0056b3;
}
.tips{
display:block;
text-align:right;
color:#ddd;
line-height:1.8;
margin-left:32px;
font-size:14px;
}
.folder-icon {
width: 24px;
height: 24px;
margin-right: 10px;
color:#ce911e;
}
.file-icon {
width: 24px;
height: 24px;
margin-right: 10px;
color:#a29c8d;
}
@media (max-width: 600px) {
.container {
padding: 10px;
}
}
</style>
<link rel="stylesheet" href="/static/static/css/bootstrap.css">
<script type="text/javascript" src="/static/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/static/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<p>主机名:{{ .DeviceName }}</p>
<hr>
{{ if .IsDir }}
<h2>{{ .DownloadPath }}</h2>
<form action="/sendZip" method="post" class="form-inline">
<div class="row">
<p class="lead">运行目录:{{ .DownloadPath }}</p>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<input id="all" class="form-control" type="checkbox"> 全选
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label for="sip">服务器ip</label>
<input type="text" name="serverip" class="form-control" id="sip" placeholder="eg:192.168.66.100:9099">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>相对路径</label>
<input type="text" class="form-control" disabled="disabled" name="curpath" value="{{ .UrlPath }}"/>
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<button class="btn btn-primary" type="submit">以压缩包模式发送文件</button>
<a class="btn btn-primary" type="buttton">单文件模式发送</a>
</div>
</div>
<div class="row">
<ul>
{{ range .Files }}
<li>
<input class="mfile" type="checkbox" name="zipfiles" value="{{.Name}}">
{{ if .IsDir }}
<svg class="folder-icon" viewBox="0 0 24 24">
<path fill="currentColor" d="M10 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V8C22 6.9 21.1 6 20 6H12L10 4Z" />
</svg>
<a href="{{ $.UrlPath }}/{{ .Name }}">{{ .Name }}</a>
{{ else }}
<svg class="file-icon" viewBox="0 0 24 24">
<path fill="currentColor" d="M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2M13 9V3.5L18.5 9H13Z" />
</svg>
{{ .Name }} <span class="tips">{{.Info.Size}}</span><span class="tips"> {{.Info.ModTime.Format "2006-01-02 15:04:05"}} </span>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</form>
</div>
</div>
<script>
var chkall = true;
var chknum=0;
$(function () {
//全选按钮设置点击事件
$("#all").click(function () {
//1、循环设置其它多选框选中状态,跟标识用的变量一样
$(".mfile").prop("checked", chkall);
// down button toggle
if(chkall ||chknum>2){
$("#tropt").show()
chknum +=1
}else{
$("#tropt").hide()
chknum -=1
}
//2、标识的变量取反
chkall = !chkall;
})
})
</script>
</body>
</html>