diff --git a/class/core/config.py b/class/core/config.py index 1e09465f6..6f29b502a 100644 --- a/class/core/config.py +++ b/class/core/config.py @@ -46,12 +46,13 @@ class config: self.initDB() self.initInitD() self.initRoute() + self.startDebug() app.wsgi_app = MiddleWare(app.wsgi_app) return app def startDebug(self): - app.debug = True - app.config.version = self.__version + str(time.time()) + self.__app.debug = True + self.__app.config.version = self.__version + str(time.time()) def initDB(self): try: diff --git a/route/database.py b/route/database.py deleted file mode 100644 index 61d7847d2..000000000 --- a/route/database.py +++ /dev/null @@ -1,17 +0,0 @@ -# coding:utf-8 - -from flask import Flask -from flask import Blueprint, render_template - - -database = Blueprint('database', __name__, template_folder='templates') - - -@database.route("/") -def index(): - return render_template('default/database.html') - - -@database.route("/count") -def count(): - return "0" diff --git a/route/firewall.py b/route/firewall.py index b7d2948d2..604a30180 100644 --- a/route/firewall.py +++ b/route/firewall.py @@ -54,7 +54,7 @@ def getSshInfo(): data['port'] = port data['status'] = True data['ping'] = True - if public.getOs() == 'draim': + if public.isAppleSystem(): data['firewall_status'] = False else: data['firewall_status'] = True diff --git a/static/app/files.js b/static/app/files.js index cb8d66cfb..c3a1f7260 100755 --- a/static/app/files.js +++ b/static/app/files.js @@ -316,15 +316,16 @@ function Set_Recycle_bin(db){ //取数据 function getFiles(Path) { - // console.log(Path); + console.log(Path); var searchtype = Path; if(isNaN(Path)){ var p = '1'; - Path = encodeURIComponent(Path) + Path = encodeURIComponent(Path); }else{ var p = Path; Path = getCookie('open_dir_path'); } + console.log(Path); var search = ''; var searchV = $("#SearchValue").val(); diff --git a/static/app/firewall.js b/static/app/firewall.js index 7d3fb35ab..e69948513 100755 --- a/static/app/firewall.js +++ b/static/app/firewall.js @@ -16,7 +16,7 @@ setTimeout(function(){ $(function(){ // start $.post('/firewall/get_www_path',function(data){ - var html ='Web日志:点击进入目录\ + var html ='Web日志:点击进入日志目录\ 0KB\ '; $('#firewall_weblog').html(html); @@ -56,27 +56,35 @@ $("#firewalldType").change(function(){ function getSshInfo(){ - $.post('/firewall/get_ssh_info', '',function(rdata){ - console.log(rdata); + $.post('/firewall/get_ssh_info', '', function(rdata){ + // console.log(rdata); var SSHchecked = '' if(rdata.status){ - SSHchecked = "" - }else{ - SSHchecked = "" - $("#mstscSubmit").attr('disabled','disabled') - $("#mstscPort").attr('disabled','disabled') + SSHchecked = ""; + } else { + SSHchecked = ""; + $("#mstscSubmit").attr('disabled','disabled'); + $("#mstscPort").attr('disabled','disabled'); } - $("#in_safe").html(SSHchecked) - $("#mstscPort").val(rdata.port) - var isPint = "" + $("#in_safe").html(SSHchecked); + $("#mstscPort").val(rdata.port); + var isPint = ''; if(rdata.ping){ - isPing = "" + isPing = ""; }else{ - isPing = "" + isPing = ""; } - - $("#isPing").html(isPing) + $("#is_ping").html(isPing); + + // console.log(rdata.firewall_status); + var fStatus = ''; + if (rdata.firewall_status){ + fStatus = ""; + }else{ + fStatus = ""; + } + $("#firewall_status").html(fStatus); },'json'); } @@ -134,12 +142,10 @@ function ping(status){ },function(){ if(status == 1){ $("#noping").prop("checked",true); - } - else{ + } else { $("#noping").prop("checked",false); - } } - ) + }) } @@ -174,7 +180,7 @@ function SetMstscStatus(){ else{ $("#sshswitch").prop("checked",true); } - }) + }); } /** diff --git a/static/app/public.js b/static/app/public.js index f60102f91..111f4bbcd 100755 --- a/static/app/public.js +++ b/static/app/public.js @@ -399,7 +399,7 @@ function showMsg(msg, callback ,icon, time){ function openPath(a) { setCookie("open_dir_path", a); - window.location.href = "/files" + window.location.href = "/files/" } function onlineEditFile(k, f) { diff --git a/static/app/site.js b/static/app/site.js index fa2ac3e05..c784b9969 100755 --- a/static/app/site.js +++ b/static/app/site.js @@ -2155,7 +2155,7 @@ function rewrite(siteName){ var rewriteName = $(this).val(); // var info = syncPost('/site/get_rewrite_conf', {siteName:siteName}); if(rewriteName == lan.site.rewritename){ - rpath = filename + rpath = filename; }else{ rpath = '/www/server/panel/rewrite/' + getCookie('serverType')+'/' + rewriteName + '.conf'; } diff --git a/templates/default/files.html b/templates/default/files.html index 994cfc127..fb1ac224e 100755 --- a/templates/default/files.html +++ b/templates/default/files.html @@ -62,7 +62,7 @@ setTimeout(function() { getDisk(); }, 500); -var xPath = getCookie('Path'); +var xPath = getCookie('open_dir_path'); setTimeout(function() { getFiles((xPath != undefined ? xPath : '/www/wwwroot')); }, 800); @@ -76,16 +76,16 @@ $("#set_icon").click(function() { setCookie('rank', 'b'); $(this).addClass("active"); $("#set_list").removeClass("active"); - getFiles(getCookie('Path')); + getFiles(getCookie('open_dir_path')); }); $("#set_list").click(function() { setCookie('rank', 'a'); $(this).addClass("active"); $("#set_icon").removeClass("active"); - getFiles(getCookie('Path')); + getFiles(getCookie('open_dir_path')); }) $(".refreshBtn").click(function() { - getFiles(getCookie('Path')); + getFiles(getCookie('open_dir_path')); }) {% endblock %} \ No newline at end of file diff --git a/templates/default/firewall.html b/templates/default/firewall.html index 3becdff11..9d3c46221 100755 --- a/templates/default/firewall.html +++ b/templates/default/firewall.html @@ -60,8 +60,8 @@