diff --git a/plugins/csvn/index.html b/plugins/csvn/index.html index cf4155e7e..7d5a8bf5b 100755 --- a/plugins/csvn/index.html +++ b/plugins/csvn/index.html @@ -10,6 +10,7 @@

自启动

用户管理

项目管理

+

使用说明

@@ -20,4 +21,14 @@ diff --git a/plugins/csvn/index.py b/plugins/csvn/index.py index 4cdc2d166..00439f67a 100755 --- a/plugins/csvn/index.py +++ b/plugins/csvn/index.py @@ -253,6 +253,28 @@ def projectDel(): return 'fail' +def getHttpPort(): + http_main_conf = getServerDir() + '/data/conf/csvn_main_httpd.conf' + try: + if os.path.exists(http_main_conf): + content = public.readFile(http_main_conf) + return re.search('Listen\s(\d+)', content).groups()[0] + except Exception as e: + pass # print e + return '80' + + +def getCsvnPort(): + http_main_conf = getServerDir() + '/data/conf/csvn-wrapper.conf' + try: + if os.path.exists(http_main_conf): + content = public.readFile(http_main_conf) + return re.search('wrapper.java.additional.3=-Djetty.port=(\d+)', content).groups()[0] + except Exception as e: + pass # print e + return '3343' + + def projectList(): import math args = getArgs() @@ -266,10 +288,6 @@ def projectList(): filePath = path + '/' + filename if os.path.isdir(filePath): tmp['name'] = filename - verPath = filePath + '/format' - if os.path.exists(verPath): - ver = public.readFile(verPath).strip() - tmp['ver'] = ver dlist.append(tmp) page = 1 @@ -287,6 +305,9 @@ def projectList(): data['page'] = page data['page_size'] = page_size data['page_count'] = int(math.ceil(dlist_sum / page_size)) + data['ip'] = public.getLocalIp() + data['port'] = getHttpPort() + data['csvn_port'] = getCsvnPort() start = (page - 1) * page_size data['data'] = dlist[start:start + page_size] diff --git a/plugins/csvn/js/csvn.js b/plugins/csvn/js/csvn.js index d12c4184f..33fb5f562 100755 --- a/plugins/csvn/js/csvn.js +++ b/plugins/csvn/js/csvn.js @@ -152,29 +152,21 @@ function csvnAddUser(username){ layer.msg("操作成功!",{icon:1,time:3000,shade: [0.3, '#000']}); },'json'); }); - } function csvnModPwdUser(name){ - csvnAddUser(name); + csvnAddUser(name); } - function csvnProjectList(page){ - var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); var _data = {}; _data['page'] = page; _data['page_size'] = 10; - $.post('/plugins/run', {name:'csvn', func:'project_list', args:JSON.stringify(_data)}, function(data) { - layer.close(loadT); - - if (!data.status){ - layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']}); - return; - } + + csvnPost('project_list', _data, function(data){ var rdata = $.parseJSON($.trim(data.data)); - // console.log(rdata); + var csvn_mg = project_url = 'http://' +rdata['ip'] +(rdata['csvn_port'] == '80' ? '': ':'+rdata['csvn_port']); content = '
'; content += '
'; @@ -182,18 +174,21 @@ function csvnProjectList(page){ content += '
'; content += ''; content += ''; - content += ''; - content += ''; + content += ''; + content += ''; content += ''; - content += ''; + console.log(rdata); ulist = rdata.data; for (i in ulist){ + var project_url = 'http://' +rdata['ip'] +(rdata['port'] == '80' ? '': ':'+rdata['port'])+ '/svn/'+ulist[i]['name']; + var code_url = 'http://' +rdata['ip'] +(rdata['port'] == '80' ? '': ':'+rdata['port'])+ '/viewvc/'+ulist[i]['name']; content += ''+ - ''; } @@ -206,7 +201,7 @@ function csvnProjectList(page){ content += page; $(".soft-man-con").html(content); - },'json'); + }); } function csvnDelProject(name){ diff --git a/scripts/install.sh b/scripts/install.sh index e7aa0a115..a46049a9b 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -27,14 +27,12 @@ mv /tmp/mdserver-web-master /www/server/mdserver-web yum groupinstall -y "Development Tools" paces="wget python-devel python-imaging zip unzip openssl openssl-devel gcc libxml2 libxml2-dev libxslt* zlib zlib-devel libjpeg-devel libpng-devel libwebp libwebp-devel freetype freetype-devel lsof pcre pcre-devel vixie-cron crontabs" yum -y install $paces -yum -y lsof +yum -y lsof net-tools.x86_64 yum -y install epel-release python-pip python-devel pip install --upgrade pip pip install -r /www/server/mdserver-web/requirements.txt - - endTime=`date +%s` ((outTime=($endTime-$startTime)/60)) echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" \ No newline at end of file
项目名当前版本操作(添加)地址操作(添加) | 后台管理
'+ulist[i]['name']+''+ulist[i]['ver']+''+ + ''+project_url+''+ '删除 | ' + - '权限' + + '权限 | ' + + '源码' + '