From 7b1ce603077d302bfeaf5d33a37a002424a8da6f Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 14 Feb 2019 02:11:48 +0800 Subject: [PATCH] up --- class/core/public.py | 14 ++------- route/static/app/files.js | 60 ++++++++++++++++++++------------------ route/static/app/public.js | 2 +- route/static/app/site.js | 6 ++-- 4 files changed, 38 insertions(+), 44 deletions(-) diff --git a/class/core/public.py b/class/core/public.py index 5b53472c0..e8e3bfa98 100755 --- a/class/core/public.py +++ b/class/core/public.py @@ -287,22 +287,12 @@ def writeLog(type, logMsg, args=()): import time import db import json - logMessage = json.loads( - readFile('static/language/' + getLanguage() + '/log.json')) - keys = logMessage.keys() - if logMsg in keys: - logMsg = logMessage[logMsg] - for i in range(len(args)): - rep = '{' + str(i + 1) + '}' - logMsg = logMsg.replace(rep, args[i]) - if type in keys: - type = logMessage[type] sql = db.Sql() mDate = time.strftime('%Y-%m-%d %X', time.localtime()) data = (type, logMsg, mDate) result = sql.table('logs').add('type,log,addtime', data) - except: - pass + except Exception as e: + print e def writeFile(filename, str): diff --git a/route/static/app/files.js b/route/static/app/files.js index 4cfe630ee..43ca0a663 100755 --- a/route/static/app/files.js +++ b/route/static/app/files.js @@ -13,7 +13,7 @@ function isDiskWidth(){ } //打开回收站 -function recycle_bin(type){ +function recycleBin(type){ $.post('/files?action=Get_Recycle_bin','',function(rdata){ var body = '' switch(type){ @@ -199,12 +199,12 @@ function recycle_bin(type){ \
\
\ -

'+lan.files.recycle_bin_type1+'

\ -

'+lan.files.recycle_bin_type2+'

\ -

'+lan.files.recycle_bin_type3+'

\ -

'+lan.files.recycle_bin_type4+'

\ -

'+lan.files.recycle_bin_type5+'

\ -

'+lan.files.recycle_bin_type6+'

\ +

全部

\ +

文件夹

\ +

'+lan.files.recycle_bin_type3+'

\ +

'+lan.files.recycle_bin_type4+'

\ +

'+lan.files.recycle_bin_type5+'

\ +

'+lan.files.recycle_bin_type6+'

\
\
\
\ @@ -231,10 +231,10 @@ function recycle_bin(type){ }); if(window.location.href.indexOf("database") != -1){ - Recycle_bin(6); + recycleBin(6); $(".re-con-menu p:last-child").addClass("on").siblings().removeClass("on"); }else{ - Recycle_bin(1); + recycleBin(1); } } $(".re-con-menu p").click(function(){ @@ -263,7 +263,7 @@ function reisImage(fileName){ function reRecycleBin(path,obj){ layer.confirm(lan.files.recycle_bin_re_msg,{title:lan.files.recycle_bin_re_title,closeBtn:2,icon:3},function(){ var loadT = layer.msg(lan.files.recycle_bin_re_the,{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/files?action=Re_Recycle_bin','path='+encodeURIComponent(path),function(rdata){ + $.post('/files?action=Re_recycleBin','path='+encodeURIComponent(path),function(rdata){ layer.close(loadT); layer.msg(rdata.msg,{icon:rdata.status?1:5}); $(obj).parents('tr').remove(); @@ -309,7 +309,7 @@ function Set_Recycle_bin(db){ $.post('/files?action=Recycle_bin',data,function(rdata){ layer.close(loadT); layer.msg(rdata.msg,{icon:rdata.status?1:5}); - }); + },'json'); } @@ -321,19 +321,23 @@ function getFiles(Path) { if(isNaN(Path)){ var p = '1'; Path = encodeURIComponent(Path); - }else{ - var p = Path; + console.log(1,Path); + } else { + var p = '1'; Path = getCookie('open_dir_path'); + console.log(2,Path); } console.log(Path); var search = ''; var searchV = $("#SearchValue").val(); - if(searchV.length > 1 && searchtype == "1"){ + if(searchV.length > 1 && searchtype == '1'){ search = "&search="+searchV; } var showRow = getCookie('showRow'); - if(!showRow) showRow = '100'; + if(!showRow) { + showRow = '100'; + } var Body = ''; var data = 'path=' + Path; var loadT = layer.load(); @@ -366,7 +370,7 @@ function getFiles(Path) { } } var timetext ='--'; - if(getCookie("rank") == "a"){ + if(getCookie('rank') == 'a'){ $("#set_list").addClass("active"); $("#set_icon").removeClass("active"); Body += "\ @@ -377,15 +381,14 @@ function getFiles(Path) { "+fmp[3]+"\ "+fmp[4]+"\ \ - "+lan.files.file_menu_copy+" | \ - "+lan.files.file_menu_mv+" | \ - "+lan.files.file_menu_rename+" | \ - "+lan.files.file_menu_auth+" | \ - "+lan.files.file_menu_zip+" | \ - "+lan.files.file_menu_del+"\ + 复制 | \ + 剪切 | \ + 重命名 | \ + 权限 | \ + 压缩 | \ + 删除\ "; - } - else{ + } else { $("#set_icon").addClass("active"); $("#set_list").removeClass("active"); Body += "