pull/700/head
Mr Chen 3 months ago
parent a1d130a674
commit 334a3fb6fe
  1. 2
      plugins/ladp/index.html
  2. 16
      plugins/ladp/index.py
  3. 2
      plugins/ladp/install.sh
  4. 2
      plugins/ladp/js/ladp.js

@ -15,7 +15,7 @@
<p onclick="pluginInitD('ladp');">自启动</p> <p onclick="pluginInitD('ladp');">自启动</p>
<p onclick="pluginConfigTpl('ladp',$('.plugin_version').attr('version'));">配置修改</p> <p onclick="pluginConfigTpl('ladp',$('.plugin_version').attr('version'));">配置修改</p>
<!-- <p onclick="pluginConfig('ladp');">配置修改</p> --> <!-- <p onclick="pluginConfig('ladp');">配置修改</p> -->
<p onclick="getRedisConfig($('.plugin_version').attr('version'));">性能调整</p> <p onclick="getLadpConfig($('.plugin_version').attr('version'));">性能调整</p>
<p onclick="pluginLogs('ladp','','run_log');">运行日志</p> <p onclick="pluginLogs('ladp','','run_log');">运行日志</p>
<p onclick="ladpReadme();">相关说明</p> <p onclick="ladpReadme();">相关说明</p>

@ -110,7 +110,7 @@ def getPidFile():
return tmp.groups()[0].strip() return tmp.groups()[0].strip()
def status(): def status():
pid_file = getPidFile() pid_file = "/var/run/slapd/slapd.pid"
if not os.path.exists(pid_file): if not os.path.exists(pid_file):
return 'stop' return 'stop'
@ -179,7 +179,7 @@ def initDreplace():
return file_bin return file_bin
def redisOp(method): def ladpOp(method):
file = initDreplace() file = initDreplace()
current_os = mw.getOs() current_os = mw.getOs()
@ -190,27 +190,27 @@ def redisOp(method):
return data[1] return data[1]
if current_os.startswith("freebsd"): if current_os.startswith("freebsd"):
data = mw.execShell('service ' + getPluginName() + ' ' + method) data = mw.execShell('service slapd ' + method)
if data[1] == '': if data[1] == '':
return 'ok' return 'ok'
return data[1] return data[1]
data = mw.execShell('systemctl ' + method + ' ' + getPluginName()) data = mw.execShell('systemctl ' + method + ' slapd')
if data[1] == '': if data[1] == '':
return 'ok' return 'ok'
return data[1] return data[1]
def start(): def start():
return redisOp('start') return ladpOp('start')
def stop(): def stop():
return redisOp('stop') return ladpOp('stop')
def restart(): def restart():
status = redisOp('restart') status = ladpOp('restart')
log_file = runLog() log_file = runLog()
mw.execShell("echo '' > " + log_file) mw.execShell("echo '' > " + log_file)
@ -218,7 +218,7 @@ def restart():
def reload(): def reload():
return redisOp('reload') return ladpOp('reload')
def getPort(): def getPort():

@ -7,6 +7,8 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath") rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath")
sysName=`uname`
sysArch=`arch`
VERSION=$2 VERSION=$2

@ -54,7 +54,7 @@ function ladpPostCallbak(method, version, args,callback){
} }
//配置修改 //配置修改
function getRedisConfig(version) { function getLadpConfig(version) {
ladpPost('get_redis_conf', version,'',function(data){ ladpPost('get_redis_conf', version,'',function(data){
// console.log(data); // console.log(data);
var rdata = $.parseJSON(data.data); var rdata = $.parseJSON(data.data);

Loading…
Cancel
Save