pull/109/head
Mr Chen 6 years ago
parent e5774b5646
commit 188773deea
  1. 5
      class/core/config.py
  2. 17
      route/database.py
  3. 2
      route/firewall.py
  4. 5
      static/app/files.js
  5. 46
      static/app/firewall.js
  6. 2
      static/app/public.js
  7. 2
      static/app/site.js
  8. 8
      templates/default/files.html
  9. 8
      templates/default/firewall.html

@ -46,12 +46,13 @@ class config:
self.initDB() self.initDB()
self.initInitD() self.initInitD()
self.initRoute() self.initRoute()
self.startDebug()
app.wsgi_app = MiddleWare(app.wsgi_app) app.wsgi_app = MiddleWare(app.wsgi_app)
return app return app
def startDebug(self): def startDebug(self):
app.debug = True self.__app.debug = True
app.config.version = self.__version + str(time.time()) self.__app.config.version = self.__version + str(time.time())
def initDB(self): def initDB(self):
try: try:

@ -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"

@ -54,7 +54,7 @@ def getSshInfo():
data['port'] = port data['port'] = port
data['status'] = True data['status'] = True
data['ping'] = True data['ping'] = True
if public.getOs() == 'draim': if public.isAppleSystem():
data['firewall_status'] = False data['firewall_status'] = False
else: else:
data['firewall_status'] = True data['firewall_status'] = True

@ -316,15 +316,16 @@ function Set_Recycle_bin(db){
//取数据 //取数据
function getFiles(Path) { function getFiles(Path) {
// console.log(Path); console.log(Path);
var searchtype = Path; var searchtype = Path;
if(isNaN(Path)){ if(isNaN(Path)){
var p = '1'; var p = '1';
Path = encodeURIComponent(Path) Path = encodeURIComponent(Path);
}else{ }else{
var p = Path; var p = Path;
Path = getCookie('open_dir_path'); Path = getCookie('open_dir_path');
} }
console.log(Path);
var search = ''; var search = '';
var searchV = $("#SearchValue").val(); var searchV = $("#SearchValue").val();

@ -16,7 +16,7 @@ setTimeout(function(){
$(function(){ $(function(){
// start // start
$.post('/firewall/get_www_path',function(data){ $.post('/firewall/get_www_path',function(data){
var html ='<span>Web日志:</span><a href="javascript:openPath(\''+data['path']+'\');">点击进入目录</a>\ var html ='<span>Web日志:</span><a href="javascript:openPath(\''+data['path']+'\');">点击进入日志目录</a>\
<em id="logSize">0KB</em>\ <em id="logSize">0KB</em>\
<button class="btn btn-default btn-sm" onclick="closeLogs();">清空</button>'; <button class="btn btn-default btn-sm" onclick="closeLogs();">清空</button>';
$('#firewall_weblog').html(html); $('#firewall_weblog').html(html);
@ -56,27 +56,35 @@ $("#firewalldType").change(function(){
function getSshInfo(){ function getSshInfo(){
$.post('/firewall/get_ssh_info', '',function(rdata){ $.post('/firewall/get_ssh_info', '', function(rdata){
console.log(rdata); // console.log(rdata);
var SSHchecked = '' var SSHchecked = ''
if(rdata.status){ if(rdata.status){
SSHchecked = "<input class='btswitch btswitch-ios' id='sshswitch' type='checkbox' checked><label class='btswitch-btn' for='sshswitch' onclick='SetMstscStatus()'></label>" SSHchecked = "<input class='btswitch btswitch-ios' id='sshswitch' type='checkbox' checked><label class='btswitch-btn' for='sshswitch' onclick='SetMstscStatus()'></label>";
}else{ } else {
SSHchecked = "<input class='btswitch btswitch-ios' id='sshswitch' type='checkbox'><label class='btswitch-btn' for='sshswitch' onclick='SetMstscStatus()'></label>" SSHchecked = "<input class='btswitch btswitch-ios' id='sshswitch' type='checkbox'><label class='btswitch-btn' for='sshswitch' onclick='SetMstscStatus()'></label>";
$("#mstscSubmit").attr('disabled','disabled') $("#mstscSubmit").attr('disabled','disabled');
$("#mstscPort").attr('disabled','disabled') $("#mstscPort").attr('disabled','disabled');
} }
$("#in_safe").html(SSHchecked) $("#in_safe").html(SSHchecked);
$("#mstscPort").val(rdata.port) $("#mstscPort").val(rdata.port);
var isPint = "" var isPint = '';
if(rdata.ping){ if(rdata.ping){
isPing = "<input class='btswitch btswitch-ios' id='noping' type='checkbox'><label class='btswitch-btn' for='noping' onclick='ping(0)'></label>" isPing = "<input class='btswitch btswitch-ios' id='noping' type='checkbox'><label class='btswitch-btn' for='noping' onclick='ping(0)'></label>";
}else{ }else{
isPing = "<input class='btswitch btswitch-ios' id='noping' type='checkbox' checked><label class='btswitch-btn' for='noping' onclick='ping(1)'></label>" isPing = "<input class='btswitch btswitch-ios' id='noping' type='checkbox' checked><label class='btswitch-btn' for='noping' onclick='ping(1)'></label>";
} }
$("#is_ping").html(isPing);
$("#isPing").html(isPing)
// console.log(rdata.firewall_status);
var fStatus = '';
if (rdata.firewall_status){
fStatus = "<input class='btswitch btswitch-ios' id='firewall_status' type='checkbox' checked><label class='btswitch-btn' for='firewall_status' ></label>";
}else{
fStatus = "<input class='btswitch btswitch-ios' id='firewall_status' type='checkbox'><label class='btswitch-btn' for='firewall_status' ></label>";
}
$("#firewall_status").html(fStatus);
},'json'); },'json');
} }
@ -134,12 +142,10 @@ function ping(status){
},function(){ },function(){
if(status == 1){ if(status == 1){
$("#noping").prop("checked",true); $("#noping").prop("checked",true);
} } else {
else{
$("#noping").prop("checked",false); $("#noping").prop("checked",false);
}
} }
) })
} }
@ -174,7 +180,7 @@ function SetMstscStatus(){
else{ else{
$("#sshswitch").prop("checked",true); $("#sshswitch").prop("checked",true);
} }
}) });
} }
/** /**

@ -399,7 +399,7 @@ function showMsg(msg, callback ,icon, time){
function openPath(a) { function openPath(a) {
setCookie("open_dir_path", a); setCookie("open_dir_path", a);
window.location.href = "/files" window.location.href = "/files/"
} }
function onlineEditFile(k, f) { function onlineEditFile(k, f) {

@ -2155,7 +2155,7 @@ function rewrite(siteName){
var rewriteName = $(this).val(); var rewriteName = $(this).val();
// var info = syncPost('/site/get_rewrite_conf', {siteName:siteName}); // var info = syncPost('/site/get_rewrite_conf', {siteName:siteName});
if(rewriteName == lan.site.rewritename){ if(rewriteName == lan.site.rewritename){
rpath = filename rpath = filename;
}else{ }else{
rpath = '/www/server/panel/rewrite/' + getCookie('serverType')+'/' + rewriteName + '.conf'; rpath = '/www/server/panel/rewrite/' + getCookie('serverType')+'/' + rewriteName + '.conf';
} }

@ -62,7 +62,7 @@
setTimeout(function() { setTimeout(function() {
getDisk(); getDisk();
}, 500); }, 500);
var xPath = getCookie('Path'); var xPath = getCookie('open_dir_path');
setTimeout(function() { setTimeout(function() {
getFiles((xPath != undefined ? xPath : '/www/wwwroot')); getFiles((xPath != undefined ? xPath : '/www/wwwroot'));
}, 800); }, 800);
@ -76,16 +76,16 @@ $("#set_icon").click(function() {
setCookie('rank', 'b'); setCookie('rank', 'b');
$(this).addClass("active"); $(this).addClass("active");
$("#set_list").removeClass("active"); $("#set_list").removeClass("active");
getFiles(getCookie('Path')); getFiles(getCookie('open_dir_path'));
}); });
$("#set_list").click(function() { $("#set_list").click(function() {
setCookie('rank', 'a'); setCookie('rank', 'a');
$(this).addClass("active"); $(this).addClass("active");
$("#set_icon").removeClass("active"); $("#set_icon").removeClass("active");
getFiles(getCookie('Path')); getFiles(getCookie('open_dir_path'));
}) })
$(".refreshBtn").click(function() { $(".refreshBtn").click(function() {
getFiles(getCookie('Path')); getFiles(getCookie('open_dir_path'));
}) })
</script> </script>
{% endblock %} {% endblock %}

@ -60,8 +60,8 @@
<div class="mr20 pull-left" style="border-right: 1px solid #ccc; padding-right: 20px;"> <div class="mr20 pull-left" style="border-right: 1px solid #ccc; padding-right: 20px;">
<div class="ss-text pull-left"> <div class="ss-text pull-left">
<em>启用禁ping</em> <em>启用禁ping</em>
<div class='ssh-item' id="isPing"> <div class='ssh-item' id="is_ping">
<input class='btswitch btswitch-ios' id='noping' type='checkbox' checked><label class='btswitch-btn noping' for='noping' ></label> <input class='btswitch btswitch-ios' id='noping' type='checkbox'><label class='btswitch-btn noping' for='noping' ></label>
</div> </div>
</div> </div>
</div> </div>
@ -70,8 +70,8 @@
<form> <form>
<div class="ss-text pull-left"> <div class="ss-text pull-left">
<em>启用防火墙</em> <em>启用防火墙</em>
<div class='ssh-item' id="in_safe"> <div class='ssh-item' id="firewall_status">
<input class='btswitch btswitch-ios' id='firewall_switch' type='checkbox' checked><label class='btswitch-btn sshswitch' for='firewall_switch' ></label> <input class='btswitch btswitch-ios' id='firewall_status' type='checkbox'><label class='btswitch-btn sshswitch' for='firewall_status' ></label>
</div> </div>
</div> </div>
</form> </form>

Loading…
Cancel
Save