mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
correctly ordered folders in initial listing
This commit is contained in:
parent
ed6c683922
commit
0fcbcdd08c
|
@ -12,6 +12,7 @@ import string
|
||||||
import socket
|
import socket
|
||||||
import ctypes
|
import ctypes
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from operator import itemgetter
|
||||||
import calendar
|
import calendar
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -1533,8 +1534,9 @@ class HttpCli(object):
|
||||||
def tx_md(self, fs_path):
|
def tx_md(self, fs_path):
|
||||||
logmsg = "{:4} {} ".format("", self.req)
|
logmsg = "{:4} {} ".format("", self.req)
|
||||||
|
|
||||||
if "edit" in self.uparam or "edit2" in self.uparam and not self.can_write:
|
if not self.can_write:
|
||||||
return self.tx_404()
|
if "edit" in self.uparam or "edit2" in self.uparam:
|
||||||
|
return self.tx_404()
|
||||||
|
|
||||||
tpl = "mde" if "edit2" in self.uparam else "md"
|
tpl = "mde" if "edit2" in self.uparam else "md"
|
||||||
html_path = os.path.join(E.mod, "web", "{}.html".format(tpl))
|
html_path = os.path.join(E.mod, "web", "{}.html".format(tpl))
|
||||||
|
@ -2149,6 +2151,11 @@ class HttpCli(object):
|
||||||
self.reply(ret.encode("utf-8", "replace"), mime="application/json")
|
self.reply(ret.encode("utf-8", "replace"), mime="application/json")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
for d in dirs:
|
||||||
|
d["name"] += "/"
|
||||||
|
|
||||||
|
dirs.sort(key=itemgetter('name'))
|
||||||
|
|
||||||
j2a["files"] = dirs + files
|
j2a["files"] = dirs + files
|
||||||
j2a["logues"] = logues
|
j2a["logues"] = logues
|
||||||
j2a["taglist"] = taglist
|
j2a["taglist"] = taglist
|
||||||
|
|
Loading…
Reference in a new issue