mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
walle ok
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
<div class="bt-w-menu">
|
<div class="bt-w-menu">
|
||||||
<p class="bgw" onclick="pluginService('walle');">服务</p>
|
<p class="bgw" onclick="pluginService('walle');">服务</p>
|
||||||
<p onclick="pluginInitD('walle');">自启动</p>
|
<p onclick="pluginInitD('walle');">自启动</p>
|
||||||
|
<p onclick="pluginConfig('walle','', 'prod_conf');">配置[Python]</p>
|
||||||
|
<p onclick="pluginCmd();">命令</p>
|
||||||
<p onclick="pluginLogs('walle','','run_log');">日志</p>
|
<p onclick="pluginLogs('walle','','run_log');">日志</p>
|
||||||
<p onclick="pRead()">说明</p>
|
<p onclick="pRead()">说明</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -165,6 +165,21 @@ def initdUinstall():
|
|||||||
os.remove(initd_bin)
|
os.remove(initd_bin)
|
||||||
return 'ok'
|
return 'ok'
|
||||||
|
|
||||||
|
|
||||||
|
def prodConf():
|
||||||
|
return getServerDir() + "/code/walle/config/settings_prod.py"
|
||||||
|
|
||||||
|
|
||||||
|
def initEnv():
|
||||||
|
cmd = "cd " + getServerDir() + "/code" + " && sh admin.sh init"
|
||||||
|
data = public.execShell(cmd)
|
||||||
|
return "shell:<br>" + data[0] + "<br>" + " error:<br>" + data[1]
|
||||||
|
|
||||||
|
|
||||||
|
def initData():
|
||||||
|
cmd = "cd " + getServerDir() + "/code" + " && sh admin.sh migration"
|
||||||
|
data = public.execShell(cmd)
|
||||||
|
return "shell:<br>" + data[0] + "<br>" + " error:<br>" + data[1]
|
||||||
# rsyncdReceive
|
# rsyncdReceive
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
func = sys.argv[1]
|
func = sys.argv[1]
|
||||||
@@ -186,5 +201,11 @@ if __name__ == "__main__":
|
|||||||
print initdUinstall()
|
print initdUinstall()
|
||||||
elif func == 'run_log':
|
elif func == 'run_log':
|
||||||
print getLog()
|
print getLog()
|
||||||
|
elif func == 'prod_conf':
|
||||||
|
print prodConf()
|
||||||
|
elif func == 'init_env':
|
||||||
|
print initEnv()
|
||||||
|
elif func == 'init_data':
|
||||||
|
print initData()
|
||||||
else:
|
else:
|
||||||
print 'error'
|
print 'error'
|
||||||
|
|||||||
@@ -61,10 +61,37 @@ function pPostCallbak(method, version, args,callback){
|
|||||||
},'json');
|
},'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initEnv(){
|
||||||
|
pPost('init_env', {}, function(data){
|
||||||
|
layer.msg(data.data,{icon:1,time:6000,shade: [0.3, '#000']});
|
||||||
|
},'初始化环境');
|
||||||
|
}
|
||||||
|
|
||||||
|
function initData(){
|
||||||
|
pPost('init_data', {}, function(data){
|
||||||
|
layer.msg(data.data,{icon:1,time:6000,shade: [0.3, '#000']});
|
||||||
|
},'初始化数据');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function pluginCmd(){
|
||||||
|
var serviceCon ='<p class="status">当前可以运行的命令:<span></span><span style="color: #20a53a;margin-left: 3px;" class="glyphicon"></span></p>\
|
||||||
|
<div class="sfm-opt">\
|
||||||
|
<button class="btn btn-default btn-sm" onclick="initEnv()">初始化环境</button>\
|
||||||
|
<button class="btn btn-default btn-sm" onclick="initData()">初始化数据</button>\
|
||||||
|
</div>';
|
||||||
|
$(".soft-man-con").html(serviceCon);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function pRead(){
|
function pRead(){
|
||||||
var readme = '<ul class="help-info-text c7">';
|
var readme = '<ul class="help-info-text c7">';
|
||||||
readme += '<li>使用默认walle端口5000,如有需要自行修改</li>';
|
readme += '<li>使用默认walle端口5000,如有需要自行修改</li>';
|
||||||
|
readme += '<li>修改配置正确后:</li>';
|
||||||
|
readme += '<li>手动[初始化环境]:sh admin.sh init</li>';
|
||||||
|
readme += '<li>手动[初始化数据]:sh admin.sh migration</li>';
|
||||||
readme += '<li><a target="_blank" href="https://walle-web.io/docs/installation_docker.html">官方文档</a></li>';
|
readme += '<li><a target="_blank" href="https://walle-web.io/docs/installation_docker.html">官方文档</a></li>';
|
||||||
readme += '</ul>';
|
readme += '</ul>';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user