mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -134,6 +134,16 @@ class config_api:
|
||||
public.restartMw()
|
||||
return public.returnJson(True, '修改成功!')
|
||||
|
||||
def closePanelApi(self):
|
||||
filename = 'data/close.pl'
|
||||
if os.path.exists(filename):
|
||||
os.remove(filename)
|
||||
return public.returnJson(True, '开启成功')
|
||||
public.writeFile(filename, 'True')
|
||||
public.execShell("chmod 600 " + filename)
|
||||
public.execShell("chown root.root " + filename)
|
||||
return public.returnJson(True, '面板已关闭!')
|
||||
|
||||
##### ----- end ----- ###
|
||||
|
||||
def getVersion(self):
|
||||
|
||||
@@ -14,6 +14,21 @@ $(".set-submit").click(function(){
|
||||
});
|
||||
|
||||
|
||||
//关闭面板
|
||||
function closePanel(){
|
||||
layer.confirm('关闭面板会导致您无法访问面板 ,您真的要关闭宝塔Linux面板吗?',{title:'关闭面板',closeBtn:2,icon:13,cancel:function(){
|
||||
$("#closePl").prop("checked",false);
|
||||
}}, function() {
|
||||
$.post('/config/close_panel','',function(rdata){
|
||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
||||
setTimeout(function(){window.location.reload();},1000);
|
||||
},'json');
|
||||
},function(){
|
||||
$("#closePl").prop("checked",false);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function modifyAuthPath() {
|
||||
var auth_path = $("#admin_path").val();
|
||||
btn = "<button type='button' class='btn btn-success btn-sm' onclick=\"bindBTName(1,'b')\">确定</button>";
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<em>关闭面板</em>
|
||||
<div class="ssh-item">
|
||||
<input class="btswitch btswitch-ios" id="closePl" type="checkbox">
|
||||
<label class="btswitch-btn" for="closePl" onclick="ClosePanel()"></label>
|
||||
<label class="btswitch-btn" for="closePl" onclick="closePanel()"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user