pull/559/head
Mr Chen 1 year ago
parent 040ef6e22b
commit 2cd37b988f
  1. 6
      class/core/mw.py
  2. 19
      route/static/app/files.js

@ -1611,6 +1611,12 @@ def sortFileList(path, ftype = 'mtime', sort = 'desc'):
flist = sorted(flist, key=lambda f: os.path.getsize(os.path.join(path,f)), reverse=True)
if sort == 'asc':
flist = sorted(flist, key=lambda f: os.path.getsize(os.path.join(path,f)), reverse=False)
if ftype == 'fname':
if sort == 'desc':
flist = sorted(flist, key=lambda f: os.path.join(path,f), reverse=True)
if sort == 'asc':
flist = sorted(flist, key=lambda f: os.path.join(path,f), reverse=False)
return flist

@ -566,17 +566,22 @@ function getFiles(Path) {
mtime_icon = '<span class="glyphicon glyphicon-option-horizontal" style="top:3px;margin-left:5px;color:#bbb">';
}
var fname_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
if (post['order'] == 'fname desc'){
fname_icon = '<span class="glyphicon glyphicon-triangle-bottom" style="margin-left:5px;color:#bbb">';
} else if (post['order'] == 'fname asc'){
fname_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
} else {
fname_icon = '<span class="glyphicon glyphicon-option-horizontal" style="top:3px;margin-left:5px;color:#bbb">';
}
var tablehtml = '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table table-hover">\
<thead>\
<tr>\
<th width="30"><input type="checkbox" id="setBox" placeholder=""></th>\
<th>文件名</th>\
<th onclick="listFileOrder(\'size\',this)" style="cursor: pointer;">大小\
'+size_icon+'\
</th>\
<th onclick="listFileOrder(\'mtime\',this)" style="cursor: pointer;">修改时间\
'+mtime_icon+'\
</th>\
<th onclick="listFileOrder(\'fname\',this)" style="cursor: pointer;">文件名'+fname_icon+'</th>\
<th onclick="listFileOrder(\'size\',this)" style="cursor: pointer;">大小'+size_icon+'</th>\
<th onclick="listFileOrder(\'mtime\',this)" style="cursor: pointer;">修改时间'+mtime_icon+'</th>\
<th>权限</th>\
<th>所有者</th>\
<th style="text-align: right;" width="330">操作</th>\

Loading…
Cancel
Save