Commit d80fe0ad authored by ibuler's avatar ibuler

[Update] 基本完成文件上传

parent 18ab2ac6
......@@ -10,15 +10,12 @@
<script type="text/javascript" charset="utf-8">
var socket = io.connect('/elfinder');
socket.on('connect', function () {
console.log("Connect")
console.log("Connect websocket done")
});
socket.on('data', function (msg) {
var sid = msg.sid;
init_elfinder(sid);
});
$().ready(function () {
$(window).trigger('resize');
});
function init_elfinder(sid) {
var elf;
var opts = {
......@@ -60,6 +57,7 @@
// Make elFinder (REQUIRED)
opts.lang = lng;
elf = $('#elfinder').elfinder(opts).elfinder('instance');
$(window).trigger('resize');
});
};
var load = function () {
......
......@@ -198,11 +198,9 @@ class ProxyNamespace(BaseNamespace):
class ElfinderNamespace(BaseNamespace):
def on_connect(self):
print("on connect")
self.emit('data', {"sid": str(request.sid)})
def on_disconnect(self):
print("On disconnect")
volume = get_cached_sftp(request.sid)
if volume:
volume.close()
sftp = get_cached_sftp(request.sid)
if sftp:
sftp.close()
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