mirror of https://github.com/midoks/mdserver-web
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
2.9 KiB
91 lines
2.9 KiB
6 years ago
|
function gaePost(method,args,callback){
|
||
|
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||
|
$.post('/plugins/run', {name:'gae', func:method, args:JSON.stringify(args)}, function(data) {
|
||
|
layer.close(loadT);
|
||
|
if (!data.status){
|
||
|
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
if(typeof(callback) == 'function'){
|
||
|
callback(data);
|
||
|
}
|
||
|
},'json');
|
||
|
}
|
||
|
|
||
|
function projectList(page, search){
|
||
|
var _data = {};
|
||
|
_data['page_size'] = 10;
|
||
|
if (typeof(search) != 'undefined'){
|
||
|
_data['search'] = search;
|
||
|
}
|
||
|
|
||
|
if (typeof(page) != 'undefined'){
|
||
|
_data['page'] = page;
|
||
|
setCookie('gaeProjectListPage',page);
|
||
|
} else {
|
||
|
_data['page'] = 1;
|
||
|
cookie_page = getCookie('gaeProjectListPage')
|
||
|
if (cookie_page >0){
|
||
|
_data['page'] = cookie_page;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
gaePost('project_list', _data, function(data){
|
||
|
|
||
|
var rdata = $.parseJSON($.trim(data.data));
|
||
|
// console.log(rdata);
|
||
|
|
||
|
content = '<div><input class="bt-input-text mr5" type="text" placeholder="查找项目" id="project_find" style="height: 28px; border-radius: 3px;width: 435px;">';
|
||
|
content += '<button class="btn btn-success btn-sm" onclick="projectListFind();">查找</button></div>';
|
||
|
|
||
|
content += '<div class="divtable" style="margin-top:5px;"><table class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0">';
|
||
|
content += '<thead><tr>';
|
||
|
content += '<th>项目名</th>';
|
||
|
content += '<th>地址</th>';
|
||
|
content += '<th>操作</th>';
|
||
|
content += '</tr></thead>';
|
||
|
content += '<tbody>';
|
||
|
|
||
|
|
||
|
ulist = rdata.data;
|
||
|
for (i in ulist){
|
||
|
content += '<tr><td>'+ulist[i]['name']+'</td>'+
|
||
|
'<td>'+ulist[i]['dir']+'</td><td>'+
|
||
|
'<a class="btlink" onclick="gaeSetProject(\''+ulist[i]['name']+'\')">设置</a> | ' +
|
||
|
'<a class="btlink" onclick="csvnAclProject(\''+ulist[i]['name']+'\')">同步</a> | ' +
|
||
|
'<a class="btlink" target="_blank" href="' + '' +'">查看命令</a>' +
|
||
|
'</td></tr>';
|
||
|
}
|
||
|
|
||
|
content += '</tbody>';
|
||
|
content += '</table></div>';
|
||
|
|
||
|
page = '<div class="dataTables_paginate paging_bootstrap pagination" style="margin-top:0px;"><ul id="softPage" class="page"><div>';
|
||
|
page += rdata.list;
|
||
|
page += '</div></ul></div>';
|
||
|
|
||
|
content += page;
|
||
|
$(".soft-man-con").html(content);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function projectListFind(){
|
||
|
var search = $('#project_find').val();
|
||
|
if (search == ''){
|
||
|
layer.msg('查找字符不能为空!',{icon:0,time:2000,shade: [0.3, '#000']});
|
||
|
return;
|
||
|
}
|
||
|
projectList(1, search);
|
||
|
}
|
||
|
|
||
|
function gaeSetProject(name){
|
||
|
gaePost('project_list_set', '', function(data){
|
||
|
console.log
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|