|
|
@ -5,12 +5,18 @@ |
|
|
|
function memcachedStatus() { |
|
|
|
function memcachedStatus() { |
|
|
|
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); |
|
|
|
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); |
|
|
|
$.post('/plugins/run', {name:'memcached', func:'run_info'}, function(data) { |
|
|
|
$.post('/plugins/run', {name:'memcached', func:'run_info'}, function(data) { |
|
|
|
if (!data.status){ |
|
|
|
layer.close(loadT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!data.status){ |
|
|
|
showMsg(data.msg, function(){}, null,13000); |
|
|
|
showMsg(data.msg, function(){}, null,13000); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
layer.close(loadT); |
|
|
|
|
|
|
|
var rdata = $.parseJSON(data.data); |
|
|
|
var rdata = $.parseJSON(data.data); |
|
|
|
|
|
|
|
if ($.isEmptyObject(rdata)){ |
|
|
|
|
|
|
|
showMsg('memcached服务没有启动!', function(){}, undefined, 3000); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
var Con = '<div class="divtable">\ |
|
|
|
var Con = '<div class="divtable">\ |
|
|
|
<table class="table table-hover table-bordered" style="width: 490px;">\ |
|
|
|
<table class="table table-hover table-bordered" style="width: 490px;">\ |
|
|
|
<thead><th>字段</th><th>当前值</th><th>说明</th></thead>\ |
|
|
|
<thead><th>字段</th><th>当前值</th><th>说明</th></thead>\ |
|
|
@ -38,17 +44,29 @@ function memcachedStatus() { |
|
|
|
//memcached性能调整
|
|
|
|
//memcached性能调整
|
|
|
|
function memcachedCache() { |
|
|
|
function memcachedCache() { |
|
|
|
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); |
|
|
|
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); |
|
|
|
$.get('/ajax?action=GetMemcachedStatus', function(rdata) { |
|
|
|
$.post('/plugins/run', {name:'memcached', func:'run_info'}, function(data) { |
|
|
|
layer.close(loadT); |
|
|
|
layer.close(loadT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!data.status){ |
|
|
|
|
|
|
|
showMsg(data.msg, function(){}, null,13000); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rdata = $.parseJSON(data.data); |
|
|
|
|
|
|
|
if ($.isEmptyObject(rdata)){ |
|
|
|
|
|
|
|
showMsg('memcached服务没有启动!', function(){}, undefined, 3000); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var memCon = '<div class="conf_p" style="margin-bottom:0">\ |
|
|
|
var memCon = '<div class="conf_p" style="margin-bottom:0">\ |
|
|
|
<p><span>BindIP</span><input style="width: 120px;" class="bt-input-text mr5" name="membind" value="' + rdata.bind + '" type="text" ><font>监听IP,请勿随意修改</font></p>\ |
|
|
|
<p><span>BindIP</span><input style="width: 120px;" class="bt-input-text mr5" name="membind" value="' + rdata.bind + '" type="text" ><font>监听IP,请勿随意修改</font></p>\ |
|
|
|
<p><span>PORT</span><input style="width: 120px;" class="bt-input-text mr5" max="65535" name="memport" value="' + rdata.port + '" type="number" ><font>监听端口,一般无需修改</font></p>\ |
|
|
|
<p><span>PORT</span><input style="width: 120px;" class="bt-input-text mr5" max="65535" name="memport" value="' + rdata.port + '" type="number" ><font>监听端口,一般无需修改</font></p>\ |
|
|
|
<p><span>CACHESIZE</span><input style="width: 120px;" class="bt-input-text mr5" name="memcachesize" value="' + rdata.cachesize + '" type="number" >MB,<font>缓存大小,建议不要大于512M</font></p>\ |
|
|
|
<p><span>CACHESIZE</span><input style="width: 120px;" class="bt-input-text mr5" name="memcachesize" value="' + rdata.cachesize + '" type="number" >MB,<font>缓存大小,建议不要大于512M</font></p>\ |
|
|
|
<p><span>MAXCONN</span><input style="width: 120px;" class="bt-input-text mr5" name="memmaxconn" value="' + rdata.maxconn + '" type="number" ><font>最大连接数,建议不要大于40960</font></p>\ |
|
|
|
<p><span>MAXCONN</span><input style="width: 120px;" class="bt-input-text mr5" name="memmaxconn" value="' + rdata.maxconn + '" type="number" ><font>最大连接数,建议不要大于40960</font></p>\ |
|
|
|
<div style="margin-top:10px; padding-right:230px" class="text-right"><button class="btn btn-success btn-sm" onclick="SetMemcachedConf()">' + lan.public.save + '</button></div>\ |
|
|
|
<div style="margin-top:10px; padding-right:230px" class="text-right"><button class="btn btn-success btn-sm" onclick="setMemcachedConf()">保存</button></div>\ |
|
|
|
</div>' |
|
|
|
</div>' |
|
|
|
$(".soft-man-con").html(memCon); |
|
|
|
$(".soft-man-con").html(memCon); |
|
|
|
}); |
|
|
|
},'json'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//memcached提交配置
|
|
|
|
//memcached提交配置
|
|
|
@ -79,9 +97,10 @@ function setMemcachedConf() { |
|
|
|
layer.msg('最大连接数过小', { icon: 2 }); |
|
|
|
layer.msg('最大连接数过小', { icon: 2 }); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var loadT = layer.msg('正在保存...', { icon: 16, time: 0, shade: 0.3 }); |
|
|
|
var loadT = layer.msg('正在保存...', { icon: 16, time: 0, shade: 0.3 }); |
|
|
|
$.post('/ajax?action=SetMemcachedCache', data, function(rdata) { |
|
|
|
$.post('/plugins/run', {name:'memcached', func:'save_conf',args:JSON.stringify(data) }, function(rdata) { |
|
|
|
layer.close(loadT); |
|
|
|
layer.close(loadT); |
|
|
|
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); |
|
|
|
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); |
|
|
|
}); |
|
|
|
},'json'); |
|
|
|
} |
|
|
|
} |