diff --git a/plugins/php/index.py b/plugins/php/index.py index 5d4e60d6f..ec5c1f22d 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -525,6 +525,10 @@ def getLibConf(version): libs.append(lib) return public.returnJson(True, 'OK!', libs) + +def installLib(version): + return version, 'ok' + if __name__ == "__main__": if len(sys.argv) < 3: @@ -574,5 +578,7 @@ if __name__ == "__main__": print getPhpinfo(version) elif func == 'get_lib_conf': print getLibConf(version) + elif func == 'install_lib': + print installLib(version) else: print "fail" diff --git a/plugins/php/js/php.js b/plugins/php/js/php.js index 48fee0f7a..7c444f95b 100755 --- a/plugins/php/js/php.js +++ b/plugins/php/js/php.js @@ -383,24 +383,22 @@ function getPHPInfo(version) { function phpLibConfig(version){ phpPost('get_lib_conf', version, '', function(data){ - console.log(data); - var rdata = $.parseJSON(data.data); - console.log(rdata.data); + var rdata = $.parseJSON(data.data); var libs = rdata.data; - var body = "" - var opt = "" + var body = ""; + var opt = ""; for (var i = 0; i < libs.length; i++) { if (libs[i].versions.indexOf(version) == -1) continue; if (libs[i]['task'] == '-1' && libs[i].phpversions.indexOf(version) != -1) { - opt = '' + lan.soft.the_install + '' + opt = '安装' } else if (libs[i]['task'] == '0' && libs[i].phpversions.indexOf(version) != -1) { - opt = '' + lan.soft.sleep_install + '' + opt = '等待安装...' } else if (libs[i].status) { - opt = '' + lan.soft.uninstall + '' + opt = '卸载' } else { - opt = '' + lan.soft.install + '' + opt = '安装' } body += '' + @@ -417,17 +415,21 @@ function phpLibConfig(version){ '' + '' + '' + - '' + - '' + - '' + - '' + - '' + + '' + + '' + + '' + + '' + + '' + '' + '' + '' + body + '' + '
' + lan.soft.php_ext_name + '' + lan.soft.php_ext_type + '' + lan.soft.php_ext_ps + '' + lan.soft.php_ext_status + '' + lan.public.action + '名称类型说明状态操作
' + '' + - ''; + ''; $('.soft-man-con').html(con); }); @@ -516,11 +518,11 @@ function setPHPConfig(version, pathinfo, go) { } //安装扩展 -function InstallPHPLib(version, name, title, pathinfo) { - layer.confirm(lan.soft.php_ext_install_confirm.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() { +function installPHPLib(version, name, title, pathinfo) { + layer.confirm('您真的要安装{1}吗?'.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() { name = name.toLowerCase(); var data = "name=" + name + "&version=" + version + "&type=1"; - var loadT = layer.msg(lan.soft.add_install, { icon: 16, time: 0, shade: [0.3, '#000'] }); + var loadT = layer.msg('正在添加到安装器...', { icon: 16, time: 0, shade: [0.3, '#000'] }); $.post('/files?action=InstallSoft', data, function(rdata) { setTimeout(function() { layer.close(loadT); @@ -533,13 +535,13 @@ function InstallPHPLib(version, name, title, pathinfo) { fly("bi-btn"); InstallTips(); - GetTaskCount(); + getTaskCount(); }); } //卸载扩展 -function UninstallPHPLib(version, name, title, pathinfo) { - layer.confirm(lan.soft.php_ext_uninstall_confirm.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() { +function uninstallPHPLib(version, name, title, pathinfo) { + layer.confirm('您真的要安装{1}吗?'.replace('{1}', name), { icon: 3, closeBtn: 2 }, function() { name = name.toLowerCase(); var data = 'name=' + name + '&version=' + version; var loadT = layer.msg(lan.public.the, { icon: 16, time: 0, shade: [0.3, '#000'] }); diff --git a/plugins/simdht/workers/simdht_worker.py b/plugins/simdht/workers/simdht_worker.py index dc4624f6a..150fb2d66 100755 --- a/plugins/simdht/workers/simdht_worker.py +++ b/plugins/simdht/workers/simdht_worker.py @@ -410,20 +410,6 @@ class Master(Thread): self.queue.put([address, binhash, 'lt']) -def announce(info_hash, address): - binhash = info_hash.decode('hex') - master.log_announce(binhash, address) - return 'ok' - - -def rpc_server(): - rpcserver = SimpleXMLRPCServer.SimpleXMLRPCServer( - ('localhost', 8004), logRequests=False) - rpcserver.register_function(announce, 'announce') - print 'Starting xml rpc server...' - rpcserver.serve_forever() - - class DBCheck(Master): def __init__(self, master): @@ -467,6 +453,20 @@ class DBCheck(Master): self.check_db_size() time.sleep(DB_SIZE_TICK) + +def announce(info_hash, address): + binhash = info_hash.decode('hex') + master.log_announce(binhash, address) + return 'ok' + + +def rpc_server(): + rpcserver = SimpleXMLRPCServer.SimpleXMLRPCServer( + ('localhost', 8004), logRequests=False) + rpcserver.register_function(announce, 'announce') + print 'Starting xml rpc server...' + rpcserver.serve_forever() + if __name__ == "__main__": # max_node_qsize bigger, bandwith bigger, spped higher master = Master()