18 changed files with 520 additions and 13 deletions
@ -1,8 +1,29 @@ |
|||
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= |
|||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= |
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
|||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= |
|||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
|||
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= |
|||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= |
|||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= |
|||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= |
|||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= |
|||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= |
|||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= |
|||
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= |
|||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= |
|||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= |
|||
github.com/schollz/progressbar/v3 v3.14.4 h1:W9ZrDSJk7eqmQhd3uxFNNcTr0QL+xuGNI9dEMrw0r74= |
|||
github.com/schollz/progressbar/v3 v3.14.4/go.mod h1:aT3UQ7yGm+2ZjeXPqsjTenwL3ddUiuZ0kfQ/2tHlyNI= |
|||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= |
|||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= |
|||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= |
|||
github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI= |
|||
github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM= |
|||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw= |
|||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk= |
|||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
|||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= |
|||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= |
|||
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= |
|||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= |
|||
|
|||
@ -0,0 +1,10 @@ |
|||
package web |
|||
|
|||
import "embed" |
|||
|
|||
//go:embed static
|
|||
// var CssFs embed.FS
|
|||
var StaticFs embed.FS |
|||
|
|||
//go:embed list.tmpl
|
|||
var ListPage string |
|||
@ -0,0 +1,195 @@ |
|||
<!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> |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,36 @@ |
|||
@charset "UTF-8"; |
|||
/* |
|||
* jQuery File Upload Plugin CSS 1.3.0 |
|||
* https://github.com/blueimp/jQuery-File-Upload |
|||
* |
|||
* Copyright 2013, Sebastian Tschan |
|||
* https://blueimp.net |
|||
* |
|||
* Licensed under the MIT license: |
|||
* http://www.opensource.org/licenses/MIT |
|||
*/ |
|||
|
|||
.fileinput-button { |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
.fileinput-button input { |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
margin: 0; |
|||
opacity: 0; |
|||
-ms-filter: 'alpha(opacity=0)'; |
|||
font-size: 200px; |
|||
direction: ltr; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
/* Fixes for IE < 8 */ |
|||
@media screen\9 { |
|||
.fileinput-button input { |
|||
filter: alpha(opacity=0); |
|||
font-size: 100%; |
|||
height: 100%; |
|||
} |
|||
} |
|||
@ -0,0 +1,97 @@ |
|||
.row-file { |
|||
height: 40px; |
|||
} |
|||
|
|||
.column-icon { |
|||
width: 40px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.column-name { |
|||
} |
|||
|
|||
.column-size { |
|||
width: 100px; |
|||
text-align: right; |
|||
} |
|||
|
|||
.column-move { |
|||
width: 40px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.column-delete { |
|||
width: 40px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.column-path { |
|||
} |
|||
|
|||
.column-progress { |
|||
width: 200px; |
|||
} |
|||
|
|||
.footer { |
|||
color: #999; |
|||
text-align: center; |
|||
font-size: 0.9em; |
|||
} |
|||
|
|||
#reload { |
|||
float: right; |
|||
} |
|||
|
|||
#create-input { |
|||
width: 50%; |
|||
height: 20px; |
|||
} |
|||
|
|||
#move-input { |
|||
width: 80%; |
|||
height: 20px; |
|||
} |
|||
|
|||
/* Bootstrap overrides */ |
|||
|
|||
.btn:focus { |
|||
outline: none; |
|||
} |
|||
|
|||
.btn-toolbar { |
|||
margin-top: 30px; |
|||
margin-bottom: 20px; |
|||
} |
|||
|
|||
.table .progress { |
|||
margin-top: 0px; |
|||
margin-bottom: 0px; |
|||
height: 16px; |
|||
} |
|||
|
|||
.panel-default > .panel-heading { |
|||
color: #555; |
|||
} |
|||
|
|||
.breadcrumb { |
|||
background-color: transparent; |
|||
border-radius: 0px; |
|||
margin-bottom: 0px; |
|||
padding: 0px; |
|||
} |
|||
|
|||
.breadcrumb > .active { |
|||
color: #555; |
|||
} |
|||
|
|||
.breadcrumb > li + li:before { |
|||
color: #999; |
|||
} |
|||
|
|||
.table > tbody > tr > td { |
|||
vertical-align: middle; |
|||
} |
|||
|
|||
.table > tbody > tr > td > p { |
|||
margin: 0px; |
|||
} |
|||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue