update
This commit is contained in:
parent
002639936e
commit
b07b6f0c94
|
|
@ -3,7 +3,7 @@
|
|||
<div class="bt-w-menu">
|
||||
<p class="bgw" onclick="pluginService('sphinx');">服务</p>
|
||||
<p onclick="pluginInitD('sphinx');">自启动</p>
|
||||
<p onclick="pluginConfigTpl('sphinx');">配置修改</p>
|
||||
<p onclick="pluginConfigTpl('sphinx','', 'conf','config_tpl','read_config_tpl',tryRebuildIndex);">配置修改</p>
|
||||
<p onclick="pluginLogs('sphinx','','run_log',30);">运行日志</p>
|
||||
<p onclick="pluginLogs('sphinx','','query_log', 30);">查询日志</p>
|
||||
<p onclick="runStatus();">运行状态</p>
|
||||
|
|
|
|||
|
|
@ -212,8 +212,8 @@ def rebuild():
|
|||
file = initDreplace()
|
||||
cmd = file + ' rebuild &'
|
||||
data = mw.execShell(cmd)
|
||||
if data[1] != '':
|
||||
return data[0]
|
||||
if data[0].find('successfully'):
|
||||
return data[0].replace("\n","<br/>")
|
||||
return 'ok'
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,11 +40,19 @@ function rebuildIndex(){
|
|||
if (data.data == 'ok'){
|
||||
layer.msg('重建成功!',{icon:1,time:2000,shade: [0.3, '#000']});
|
||||
} else {
|
||||
layer.msg(data.data,{icon:2,time:2000,shade: [0.3, '#000']});
|
||||
layer.msg(data.data,{icon:2,time:10000,shade: [0.3, '#000']});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function tryRebuildIndex(){
|
||||
layer.confirm("修改配置后,是否尝试重建索引。", {icon:3,closeBtn: 1} , function(){
|
||||
rebuildIndex();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function secToTime(s) {
|
||||
var t;
|
||||
if(s > -1){
|
||||
|
|
|
|||
|
|
@ -2255,7 +2255,7 @@ function pluginConfig(_name, version, func){
|
|||
|
||||
|
||||
//配置修改模版 --- start
|
||||
function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_func){
|
||||
function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_func, save_callback_func){
|
||||
if ( typeof(version) == 'undefined' ){
|
||||
version = '';
|
||||
}
|
||||
|
|
@ -2281,7 +2281,7 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_
|
|||
<textarea class="bt-input-text" style="height: 320px; line-height:18px;" id="textBody"></textarea>\
|
||||
<button id="onlineEditFileBtn" class="btn btn-success btn-sm" style="margin-top:10px;">保存</button>\
|
||||
<ul class="help-info-text c7 ptb15">\
|
||||
<li>此处为'+ _name + version +'主配置文件,若您不了解配置规则,请勿随意修改。</li>\
|
||||
<li>此处为【'+ _name + version +'】主配置文件,若您不了解配置规则,请勿随意修改。</li>\
|
||||
</ul>';
|
||||
$(".soft-man-con").html(con);
|
||||
|
||||
|
|
@ -2321,7 +2321,7 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_
|
|||
"Ctrl-H": "replaceAll",
|
||||
"Ctrl-S": function() {
|
||||
$("#textBody").text(editor.getValue());
|
||||
pluginConfigSave(fileName);
|
||||
pluginConfigSave(fileName,save_callback_func);
|
||||
}
|
||||
},
|
||||
lineNumbers: true,
|
||||
|
|
@ -2332,7 +2332,7 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_
|
|||
$("#onlineEditFileBtn").unbind('click');
|
||||
$("#onlineEditFileBtn").click(function(){
|
||||
$("#textBody").text(editor.getValue());
|
||||
pluginConfigSave(fileName);
|
||||
pluginConfigSave(fileName, save_callback_func);
|
||||
});
|
||||
},'json');
|
||||
}
|
||||
|
|
@ -2361,7 +2361,7 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_
|
|||
"Ctrl-H": "replaceAll",
|
||||
"Ctrl-S": function() {
|
||||
$("#textBody").text(editor.getValue());
|
||||
pluginConfigSave(fileName);
|
||||
pluginConfigSave(fileName,save_callback_func);
|
||||
}
|
||||
},
|
||||
lineNumbers: true,
|
||||
|
|
@ -2371,7 +2371,7 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_
|
|||
$(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0});
|
||||
$("#onlineEditFileBtn").click(function(){
|
||||
$("#textBody").text(editor.getValue());
|
||||
pluginConfigSave(fileName);
|
||||
pluginConfigSave(fileName,save_callback_func);
|
||||
});
|
||||
},'json');
|
||||
},'json');
|
||||
|
|
@ -2498,13 +2498,19 @@ function pluginConfigListTpl(_name, version, config_tpl_func, read_config_tpl_fu
|
|||
|
||||
|
||||
//配置保存
|
||||
function pluginConfigSave(fileName) {
|
||||
function pluginConfigSave(fileName, callback) {
|
||||
var data = encodeURIComponent($("#textBody").val());
|
||||
var encoding = 'utf-8';
|
||||
var loadT = layer.msg('保存中...', {icon: 16,time: 0});
|
||||
$.post('/files/save_body', 'data=' + data + '&path=' + fileName + '&encoding=' + encoding, function(rdata) {
|
||||
layer.close(loadT);
|
||||
layer.msg(rdata.msg, {icon: rdata.status ? 1 : 2});
|
||||
|
||||
showMsg(rdata.msg, function(){
|
||||
if ( rdata.status && typeof(callback) == 'function'){
|
||||
callback();
|
||||
}
|
||||
},{icon: rdata.status ? 1 : 2});
|
||||
|
||||
},'json');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue