Simple Linux Panel
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.
mdserver-web/plugins/sphinx/js/sphinx.js

48 lines
1.2 KiB

6 years ago
function spPostMin(method, args, callback){
6 years ago
var req_data = {};
6 years ago
req_data['name'] = 'sphinx';
6 years ago
req_data['func'] = method;
6 years ago
if (typeof(args) != 'undefined' && args!=''){
6 years ago
req_data['args'] = JSON.stringify(args);
}
$.post('/plugins/run', req_data, function(data) {
if (!data.status){
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
return;
}
if(typeof(callback) == 'function'){
callback(data);
}
},'json');
}
6 years ago
function spPost(method, args, callback){
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
spPostMin(method,args,function(data){
layer.close(loadT);
if(typeof(callback) == 'function'){
callback(data);
}
6 years ago
});
}
6 years ago
function rebuild(){
var con = '<button class="btn btn-default btn-sm" onclick="rebuildIndex();">重建索引</button>';
6 years ago
$(".soft-man-con").html(con);
}
6 years ago
function rebuildIndex(){
spPost('rebuild', '', function(data){
if (data.data == 'ok'){
layer.msg('在重建中..',{icon:1,time:2000,shade: [0.3, '#000']});
} else {
layer.msg(data.data,{icon:1,time:2000,shade: [0.3, '#000']});
6 years ago
}
});
}