面板收藏功能完成2
This commit is contained in:
parent
77af5fcf7f
commit
b95804587c
|
|
@ -53,6 +53,26 @@ class config_api:
|
|||
public.M('panel').where('id=?', (mid,)).delete()
|
||||
return public.returnJson(True, '删除成功!')
|
||||
|
||||
# 修改面板资料
|
||||
def setPanelInfoApi(self):
|
||||
title = request.form.get('title', '')
|
||||
url = request.form.get('url', '')
|
||||
username = request.form.get('username', '')
|
||||
password = request.form.get('password', '')
|
||||
mid = request.form.get('id', '')
|
||||
# 校验是还是重复
|
||||
isSave = public.M('panel').where(
|
||||
'(title=? OR url=?) AND id!=?', (title, url, mid)).count()
|
||||
if isSave:
|
||||
return public.returnMsg(False, '备注或面板地址重复!')
|
||||
|
||||
# 更新到数据库
|
||||
isRe = public.M('panel').where('id=?', (mid,)).save(
|
||||
'title,url,username,password', (title, url, username, password))
|
||||
if isRe:
|
||||
return public.returnMsg(True, '修改成功!')
|
||||
return public.returnMsg(False, '修改失败!')
|
||||
|
||||
def syncDateApi(self):
|
||||
if public.isAppleSystem():
|
||||
return public.returnJson(True, '开发系统不必同步时间!')
|
||||
|
|
|
|||
|
|
@ -839,7 +839,7 @@ function listOrder(skey,type,obj){
|
|||
|
||||
|
||||
//获取关联列表
|
||||
function getBtpanelList(){
|
||||
function getPanelList(){
|
||||
var con ='';
|
||||
$.post("/config/get_panel_list",function(rdata){
|
||||
for(var i=0; i<rdata.length; i++){
|
||||
|
|
@ -889,7 +889,7 @@ function getBtpanelList(){
|
|||
});
|
||||
},'json');
|
||||
}
|
||||
getBtpanelList();
|
||||
getPanelList();
|
||||
|
||||
//添加面板快捷登录
|
||||
function bindPanel(a,type,ip,btid,url,user,pw){
|
||||
|
|
@ -920,14 +920,14 @@ function bindPanel(a,type,ip,btid,url,user,pw){
|
|||
return;
|
||||
}
|
||||
if(type=="c"){
|
||||
gurl = "/config?action=SetPanelInfo";
|
||||
gurl = "/config/set_panel_info";
|
||||
data = data+"&id="+btid;
|
||||
}
|
||||
$.post(gurl, data, function(b) {
|
||||
if(b.status) {
|
||||
layer.closeAll();
|
||||
layer.msg(b.msg, {icon: 1});
|
||||
getBtpanelList();
|
||||
getPanelList();
|
||||
} else {
|
||||
layer.msg(b.msg, {icon: 2})
|
||||
}
|
||||
|
|
@ -978,7 +978,7 @@ function bindPaneldel(id){
|
|||
$.post("/config/del_panel_info","id="+id,function(rdata){
|
||||
layer.closeAll();
|
||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
||||
getBtpanelList();
|
||||
getPanelList();
|
||||
},'json');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue