update
This commit is contained in:
parent
17e6703c07
commit
b7da91f92b
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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['status'] = True
|
||||
data['ping'] = True
|
||||
if public.getOs() == 'draim':
|
||||
if public.isAppleSystem():
|
||||
data['firewall_status'] = False
|
||||
else:
|
||||
data['firewall_status'] = True
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ setTimeout(function(){
|
|||
$(function(){
|
||||
// start
|
||||
$.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>\
|
||||
<button class="btn btn-default btn-sm" onclick="closeLogs();">清空</button>';
|
||||
$('#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 = "<input class='btswitch btswitch-ios' id='sshswitch' type='checkbox' checked><label class='btswitch-btn' for='sshswitch' onclick='SetMstscStatus()'></label>"
|
||||
}else{
|
||||
SSHchecked = "<input class='btswitch btswitch-ios' id='sshswitch' type='checkbox'><label class='btswitch-btn' for='sshswitch' onclick='SetMstscStatus()'></label>"
|
||||
$("#mstscSubmit").attr('disabled','disabled')
|
||||
$("#mstscPort").attr('disabled','disabled')
|
||||
SSHchecked = "<input class='btswitch btswitch-ios' id='sshswitch' type='checkbox' checked><label class='btswitch-btn' for='sshswitch' onclick='SetMstscStatus()'></label>";
|
||||
} else {
|
||||
SSHchecked = "<input class='btswitch btswitch-ios' id='sshswitch' type='checkbox'><label class='btswitch-btn' for='sshswitch' onclick='SetMstscStatus()'></label>";
|
||||
$("#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 = "<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{
|
||||
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>";
|
||||
}
|
||||
|
||||
$("#isPing").html(isPing)
|
||||
$("#is_ping").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');
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
@ -60,8 +60,8 @@
|
|||
<div class="mr20 pull-left" style="border-right: 1px solid #ccc; padding-right: 20px;">
|
||||
<div class="ss-text pull-left">
|
||||
<em>启用禁ping</em>
|
||||
<div class='ssh-item' id="isPing">
|
||||
<input class='btswitch btswitch-ios' id='noping' type='checkbox' checked><label class='btswitch-btn noping' for='noping' ></label>
|
||||
<div class='ssh-item' id="is_ping">
|
||||
<input class='btswitch btswitch-ios' id='noping' type='checkbox'><label class='btswitch-btn noping' for='noping' ></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -70,8 +70,8 @@
|
|||
<form>
|
||||
<div class="ss-text pull-left">
|
||||
<em>启用防火墙</em>
|
||||
<div class='ssh-item' id="in_safe">
|
||||
<input class='btswitch btswitch-ios' id='firewall_switch' type='checkbox' checked><label class='btswitch-btn sshswitch' for='firewall_switch' ></label>
|
||||
<div class='ssh-item' id="firewall_status">
|
||||
<input class='btswitch btswitch-ios' id='firewall_status' type='checkbox'><label class='btswitch-btn sshswitch' for='firewall_status' ></label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Reference in New Issue