This commit is contained in:
parent
a63bf8c39a
commit
7bd49e6de1
|
|
@ -3,7 +3,10 @@
|
|||
<div class="bt-w-menu">
|
||||
<p class="bgw" onclick="pluginService('go-fastdfs');">服务</p>
|
||||
<p onclick="pluginInitD('go-fastdfs');">自启动</p>
|
||||
<p onclick="pluginLogs('go-fastdfs','','run_log');">日志</p>
|
||||
<p onclick="pluginConfig('go-fastdfs');">配置文件</p>
|
||||
<p onclick="gfConfigSet()">配置修改</p>
|
||||
<p onclick="pluginLogs('go-fastdfs','','run_log');">运行日志</p>
|
||||
<p onclick="pluginLogs('go-fastdfs','','breakpoint_log');">断点日志</p>
|
||||
<p onclick="pRead()">说明</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ def getLog():
|
|||
return getServerDir() + "/log/fileserver.log"
|
||||
|
||||
|
||||
def gfBreakpointLog():
|
||||
return getServerDir() + "/log/tusd.log"
|
||||
|
||||
|
||||
def getArgs():
|
||||
args = sys.argv[2:]
|
||||
tmp = {}
|
||||
|
|
@ -158,6 +162,37 @@ def initdUinstall():
|
|||
return 'ok'
|
||||
|
||||
|
||||
def gfConf():
|
||||
return getServerDir() + "/conf/cfg.json"
|
||||
|
||||
|
||||
def gfConfSet():
|
||||
gets = [
|
||||
{'name': 'addr', 'type': -1, 'ps': '绑定端口'},
|
||||
{'name': 'peer_id', 'type': -1, 'ps': '集群内唯一,请使用0-9的单字符'},
|
||||
{'name': 'host', 'type': -1, 'ps': '本主机地址'},
|
||||
{'name': 'group', 'type': -1, 'ps': '组号'},
|
||||
{'name': 'support_group_manage', 'type': 0, 'ps': '是否支持按组(集群)管理'},
|
||||
{'name': 'enable_merge_small_file', 'type': 0, 'ps': '是否合并小文件'},
|
||||
{'name': 'refresh_interval', 'type': 1, 'ps': '重试同步失败文件的时间'},
|
||||
{'name': 'rename_file', 'type': 0, 'ps': '是否自动重命名'},
|
||||
{'name': 'enable_web_upload', 'type': 0, 'ps': '是否支持web上传,方便调试'},
|
||||
{'name': 'enable_custom_path', 'type': 0, 'ps': '是否支持非日期路径'},
|
||||
{'name': 'enable_migrate', 'type': 0, 'ps': '是否启用迁移'},
|
||||
{'name': 'enable_cross_origin', 'type': 0, 'ps': '是否开启跨站访问'},
|
||||
{'name': 'enable_tus', 'type': 0, 'ps': '是否开启断点续传'}
|
||||
]
|
||||
data = public.readFile(gfConf())
|
||||
result = json.loads(data)
|
||||
|
||||
ret = []
|
||||
for g in gets:
|
||||
if g['name'] in result:
|
||||
g['value'] = result[g['name']]
|
||||
ret.append(g)
|
||||
|
||||
return public.getJson(ret)
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
|
|
@ -178,5 +213,9 @@ if __name__ == "__main__":
|
|||
print initdUinstall()
|
||||
elif func == 'run_log':
|
||||
print getLog()
|
||||
elif func == 'conf':
|
||||
print gfConf()
|
||||
elif func == 'gf_conf_set':
|
||||
print gfConfSet()
|
||||
else:
|
||||
print 'error'
|
||||
|
|
|
|||
|
|
@ -37,6 +37,57 @@ function pPost(method,args,callback, title){
|
|||
}
|
||||
|
||||
|
||||
|
||||
function gfConfigSet(){
|
||||
pPost('gf_conf_set', '', function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
var mlist = '';
|
||||
for (var i = 0; i < rdata.length; i++) {
|
||||
var w = '140';
|
||||
if (rdata[i].name == 'error_reporting') w = '250';
|
||||
var ibody = '<input style="width: ' + w + 'px;" class="bt-input-text mr5" name="' + rdata[i].name + '" value="' + rdata[i].value + '" type="text" >';
|
||||
switch (rdata[i].type) {
|
||||
case 0:
|
||||
var selected_1 = (rdata[i].value == 1) ? 'selected' : '';
|
||||
var selected_0 = (rdata[i].value == 0) ? 'selected' : '';
|
||||
ibody = '<select class="bt-input-text mr5" name="' + rdata[i].name + '" style="width: ' + w + 'px;">\
|
||||
<option value="1" ' + selected_1 + '>开启</option>\
|
||||
<option value="0" ' + selected_0 + '>关闭</option>\
|
||||
</select>';
|
||||
break;
|
||||
case 1:
|
||||
var selected_1 = (rdata[i].value == 'On') ? 'selected' : '';
|
||||
var selected_0 = (rdata[i].value == 'Off') ? 'selected' : '';
|
||||
ibody = '<select class="bt-input-text mr5" name="' + rdata[i].name + '" style="width: ' + w + 'px;">\
|
||||
<option value="On" ' + selected_1 + '>开启</option>\
|
||||
<option value="Off" ' + selected_0 + '>关闭</option></select>'
|
||||
break;
|
||||
case 2:
|
||||
var selected_1 = (rdata[i].value == 'true') ? 'selected' : '';
|
||||
var selected_0 = (rdata[i].value == 'false') ? 'selected' : '';
|
||||
ibody = '<select class="bt-input-text mr5" name="' + rdata[i].name + '" style="width: ' + w + 'px;">\
|
||||
<option value="true" ' + selected_1 + '>开启</option>\
|
||||
<option value="false" ' + selected_0 + '>关闭</option></select>'
|
||||
break;
|
||||
}
|
||||
mlist += '<p><span>' + rdata[i].name + '</span>' + ibody + ', <font>' + rdata[i].ps + '</font></p>'
|
||||
}
|
||||
var html = '<style>.conf_p p{margin-bottom: 2px}</style><div class="conf_p" style="margin-bottom:0">\
|
||||
' + mlist + '\
|
||||
<div style="margin-top:10px; padding-right:15px" class="text-right">\
|
||||
<button class="btn btn-success btn-sm mr5" onclick="gogsSetConfig()">刷新</button>\
|
||||
<button class="btn btn-success btn-sm" onclick="submitGogsConf()">保存</button></div>\
|
||||
</div>';
|
||||
$(".soft-man-con").html(html);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function pRead(){
|
||||
var readme = '<ul class="help-info-text c7">';
|
||||
readme += '<li>使用默认solr端口,如有需要自行修改</li>';
|
||||
|
|
|
|||
Loading…
Reference in New Issue