Commit 7ef09f36 authored by 广宏伟's avatar 广宏伟

Merged in dev (pull request #110)

Dev
parents df159261 faeae592
import logging import logging
import json
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
...@@ -51,9 +51,9 @@ class SFTPVolume(BaseVolume): ...@@ -51,9 +51,9 @@ class SFTPVolume(BaseVolume):
"name": attr.filename, "name": attr.filename,
"hash": self._hash(path), "hash": self._hash(path),
"phash": self._hash(parent_path), "phash": self._hash(parent_path),
"ts": 0, "ts": attr.st_mtime,
"size": 'unknown', "size": attr.st_size,
"mime": "directory" if stat.S_ISDIR(attr.st_mode) else "file", "mime": "directory" if stat.S_ISDIR(attr.st_mode) else "",
"locked": 0, "locked": 0,
"hidden": 0, "hidden": 0,
"read": 1, "read": 1,
...@@ -151,7 +151,7 @@ class SFTPVolume(BaseVolume): ...@@ -151,7 +151,7 @@ class SFTPVolume(BaseVolume):
with self.sftp.open(remote_path, mode='w'): with self.sftp.open(remote_path, mode='w'):
pass pass
return self._info(parent_path) return self._info(path)
def rename(self, name, target): def rename(self, name, target):
""" Renames a file or directory. """ """ Renames a file or directory. """
......
...@@ -505,7 +505,8 @@ div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon { ...@@ -505,7 +505,8 @@ div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon {
margin-right: 5px; margin-right: 5px;
} }
div.elfinder-cwd-wrapper-list .ui-icon-grip-dotted-vertical { div.elfinder-cwd-wrapper-list .ui-icon-grip-dotted-vertical {
margin: 2px; margin: 1px;
float: right;
} }
.elfinder-cwd-view-list .elfinder-navbar-root-local td .elfinder-cwd-icon, .elfinder-cwd-view-list .elfinder-navbar-root-local td .elfinder-cwd-icon,
.elfinder-navbar-root-local .elfinder-cwd-icon, .elfinder-navbar-root-local .elfinder-cwd-icon,
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
['rm'], ['rm'],
['rename'], ['rename'],
['view'] ['view']
] ],
cwd : {oldSchool: true}
}, },
customData: {'sid': sid}, customData: {'sid': sid},
height: '100%', height: '100%',
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
'rm' 'rm'
], ],
cwd: [ cwd: [
'reload', 'back', '|', 'mkdir', 'mkfile', '|', 'reload', 'back', 'up', '|', 'mkdir', 'mkfile', '|',
'upload', 'paste' 'upload', 'paste'
], ],
files: [ files: [
......
...@@ -150,7 +150,7 @@ class SFTPServer(paramiko.SFTPServerInterface): ...@@ -150,7 +150,7 @@ class SFTPServer(paramiko.SFTPServerInterface):
request['su'] = su request['su'] = su
request['su_unique'] = True request['su_unique'] = True
else: else:
request['su'] = path.pop() if path else '' request['su'], path = (path[0], path[1:]) if path else ('', path)
request['dpath'] = '/'.join(path) request['dpath'] = '/'.join(path)
return request return request
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment