Compare commits

..

No commits in common. "JKDevelop" and "master" have entirely different histories.

483 changed files with 5091 additions and 38278 deletions

3
.gitignore vendored
View File

@ -6,8 +6,6 @@ yarn-debug.log*
yarn-error.log*
yarn.lock
package-lock.json*
# Runtime data
pids
*.pid
@ -88,4 +86,3 @@ typings/
.DS_Store
.idea/*

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<h3>前端react环境安装</h3>
<p>1、 安装node v12.10.x此安装包含了node和npm。</p>
<p>1、 安装node v6.9.x此安装包含了node和npm。</p>
<p>2、 安装cnpm命令行 npm install -g cnpm --registry=https://registry.npm.taobao.org</p>
<p>3、 安装依赖的js库public/react目录下<即项目package.json所在目录>,开启命令行): cnpm install</p>
<p>4、 如果你的ruby服务使用的是3000端口则需要在package.json中修改"port"参数的值</p>

34
add.txt Normal file
View File

@ -0,0 +1,34 @@
新版tpi改动的文件
Index.js
contex/TPIContextProvider.js
page/main/LeftViewContainer.js
taskList/TaskList.js
TPMIndexHOC.js
App.js
CodeRepositoryViewContainer.js
Index.js
choose={context.chooses}
TPIContextProvider.js
LeftViewContainer.js
TaskList.js
TPMIndexHOC.js
MainContentContainer
rep_content返回值多了一层 {content: '...'}
TODO
待同步
1、timer图标样式更换
index.html
WebSSHTimer.css
WebSSHTimer.js

View File

@ -101,13 +101,9 @@ module.exports = {
extensions: [".web.js", ".mjs", ".js", ".json", ".web.jsx", ".jsx"],
alias: {
educoder: __dirname + "/../src/common/educoder.js",
src: path.join(paths.appSrc), // 整个源代码目录
forge: path.join(paths.appSrc, 'forge'),
military: path.join(paths.appSrc, 'military'),
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
"react-native": "react-native-web",
'react-dom': '@hot-loader/react-dom',
},
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
@ -154,7 +150,7 @@ module.exports = {
{
libraryName: "antd",
libraryDirectory: "es",
style: true,
style: "css",
},
],
],
@ -212,23 +208,6 @@ module.exports = {
},
],
},
{
test: /\.less$/,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader', // translates CSS into CommonJS
}, {
loader: 'less-loader', // compiles Less to CSS
options: {
modifyVars: {
'primary-color': '#4154f1',
'link-color': '#4154f1',
},
javascriptEnabled: true,
},
}]
},
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.

View File

@ -19,7 +19,8 @@ const getClientEnvironment = require("./env");
let publicPath = "/react/build/";
const publicUrl = publicPath.slice(0, -1);
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false";
// const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false";
const shouldUseSourceMap = process.env.NODE_ENV !== "production";
const env = getClientEnvironment(publicPath);
// This is the production configuration.
@ -54,7 +55,8 @@ module.exports = {
},
bail: true,
mode: "production",
devtool: false, //测试版
// devtool: false, //测试版
devtool: shouldUseSourceMap?'source-map':false,
entry: [require.resolve("./polyfills"), paths.appIndexJs],
output: {
path: paths.appBuild,
@ -87,9 +89,6 @@ module.exports = {
extensions: [".web.js", ".mjs", ".js", ".json", ".web.jsx", ".jsx"],
alias: {
educoder: __dirname + "/../src/common/educoder.js",
src: path.join(paths.appSrc),
forge: path.join(paths.appSrc, 'forge'),
military: path.join(paths.appSrc, 'military'),
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
"react-native": "react-native-web",
@ -148,7 +147,7 @@ module.exports = {
{
libraryName: "antd",
libraryDirectory: "es",
style: true,
style: "css",
},
],
],
@ -211,23 +210,6 @@ module.exports = {
},
],
},
{
test: /\.less$/,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader', // translates CSS into CommonJS
}, {
loader: 'less-loader', // compiles Less to CSS
options: {
modifyVars: {
'primary-color': '#4154f1',
'link-color': '#4154f1',
},
javascriptEnabled: true,
},
}]
},
// "file" loader makes sure assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// This loader doesn't use a "test" so it will catch all modules

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"educoder": ["./src/common/educoder.js"],
"forge":["./src/forge"],
"military":["./src/military"],
}
},
"exclude": [
"node_modules",
"build"
]
}

5341
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
"antd": "^3.26.15",
"array-flatten": "^2.1.2",
"autoprefixer": "7.1.6",
"axios": "^0.24.0",
"axios": "^0.18.1",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
"babel-loader": "7.1.2",
@ -24,11 +24,11 @@
"classnames": "^2.2.5",
"clipboard": "^2.0.8",
"code-prettify": "^0.1.0",
"codemirror": "^5.64.0",
"codemirror": "^5.53.0",
"connected-react-router": "4.4.1",
"cross-port-killer": "^1.0.1",
"cross-env": "^7.0.3",
"css-loader": "^3.5.2",
"dompurify": "^2.3.3",
"dompurify": "^2.0.15",
"dotenv": "4.0.0",
"dotenv-expand": "4.2.0",
"echarts": "^4.9.0",
@ -51,7 +51,7 @@
"js-base64": "^2.5.2",
"js2wordcloud": "^1.1.12",
"katex": "^0.11.1",
"lodash": "^4.17.21",
"lodash": "^4.17.15",
"loglevel": "^1.6.8",
"marked": "^1.0.0",
"material-ui": "^1.0.0-beta.40",
@ -84,8 +84,6 @@
"react-color": "^2.18.0",
"react-content-loader": "^3.1.1",
"react-cookies": "^0.1.1",
"react-countup": "^6.1.0",
"react-cropper": "^2.1.8",
"react-datepicker": "^2.14.1",
"react-dev-utils": "^9.2.0-next.80",
"react-dom": "^16.13.1",
@ -116,7 +114,6 @@
"styled-components": "^4.4.1",
"sw-precache-webpack-plugin": "0.11.4",
"url-loader": "0.6.2",
"wangeditor-for-react": "^1.4.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"webpack-manifest-plugin": "^2.2.0",
@ -194,7 +191,6 @@
"port": "3007",
"devDependencies": {
"@babel/runtime": "7.0.0-beta.51",
"@hot-loader/react-dom": "^16.14.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-plugin-import": "^1.13.0",
@ -205,10 +201,7 @@
"babel-preset-stage-2": "^6.24.1",
"compression-webpack-plugin": "^1.1.12",
"concat": "^1.0.3",
"cross-env": "^5.1.1",
"happypack": "^5.0.1",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"mockjs": "^1.1.0",
"node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",

View File

@ -1,5 +1,6 @@
/*头部导航条样式---2018-03-19--by-cs*/
.newHeader {
background: #24292D !important;
width: 100%;
height: 60px !important;
min-width: 1200px;

View File

@ -1268,17 +1268,11 @@ a.shixun-task-btn {
/*-----------实训配置、评测脚本-------------*/
@font-face {
font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1631773579834') format('woff2'),
url('iconfont.woff?t=1631773579834') format('woff'),
url('iconfont.ttf?t=1631773579834') format('truetype');
}
html body {
font-size: 14px;
line-height: 2.0;
background: #fafafa;
font-family: "iconfont";
font-family: "Microsoft YaHei", "SimSun";
color: #05101a;
height: 100%;
position: relative;
@ -3945,13 +3939,9 @@ html>body #ajax-indicator {
margin-left: 10px;
color: #2FC25B;
}
.privateTag.red{
color: #FF6832;
border:1px solid #FF6832;
}
.head-nav {
text-align: center;
height: 58px;
height: 70px;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
@ -3963,21 +3953,18 @@ html>body #ajax-indicator {
position: absolute;
top: 0px;
z-index: 3;
height: 58px;
height: 70px;
box-sizing: border-box;
}
.head-nav ul#header-nav li {
float: left;
height: 58px;
line-height: 58px;
height: 70px;
line-height: 70px;
cursor: pointer;
position: relative;
font-size: 16px;
margin-right: 40px;
}
.head-nav ul#header-nav li:first-child{
margin-left: 20px;
padding-right:40px;
}
.head-nav ul#header-nav li a {
@ -3988,30 +3975,18 @@ html>body #ajax-indicator {
font-size: 16px;
}
.publicNav ul#header-nav li a {
color: #fff!important;
}
.publicNav .head-right i{
color: #fff!important;
}
.head-nav ul#header-nav li a:hover,.head-nav ul#header-nav li.active a {
color: #5091FF;
}
.head-nav ul#header-nav li.active a:after {
content: "";
width: 50%;
height: 2px;
background-color: #1484ef;
left: 50%;
margin-left: -25%;
bottom: 8px;
position: absolute;
}
.head-nav ul#header-nav li:last-child {
margin-right: 0px
}
.head-nav ul#header-nav li.active{
/* background-color: #3B3B3B; */
}
.head-nav ul#header-nav li p:hover {
color: #cccccc;

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1644907653340') format('woff2'),
url('iconfont.woff?t=1644907653340') format('woff'),
url('iconfont.ttf?t=1644907653340') format('truetype');
src: url('iconfont.woff2?t=1634881729644') format('woff2'),
url('iconfont.woff?t=1634881729644') format('woff'),
url('iconfont.ttf?t=1634881729644') format('truetype');
}
.iconfont {
@ -13,198 +13,6 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-icon2:before {
content: "\e912";
}
.icon-a-21:before {
content: "\e913";
}
.icon-a-2:before {
content: "\e90f";
}
.icon-a-3:before {
content: "\e910";
}
.icon-icon1:before {
content: "\e911";
}
.icon-ioon:before {
content: "\e90e";
}
.icon-shanchu_tc_icon1:before {
content: "\e90c";
}
.icon-zhuanjiaicon:before {
content: "\e90d";
}
.icon-shengming:before {
content: "\e90b";
}
.icon-chenggong1:before {
content: "\e907";
}
.icon-a-bitian2x1:before {
content: "\e908";
}
.icon-xiala1:before {
content: "\e909";
}
.icon-xiala2:before {
content: "\e90a";
}
.icon-jiantou1:before {
content: "\e905";
}
.icon-zhangjieicon:before {
content: "\e8fe";
}
.icon-chengyuan1:before {
content: "\e903";
}
.icon-a-shangchuan2x:before {
content: "\e8f9";
}
.icon-shanchu7:before {
content: "\e8fa";
}
.icon-zuohuabeifen:before {
content: "\e8fb";
}
.icon-a-bianji11:before {
content: "\e8f4";
}
.icon-a-bitian2x:before {
content: "\e8f5";
}
.icon-a-zuohua2x:before {
content: "\e8f7";
}
.icon-lianjie3:before {
content: "\e8f8";
}
.icon-zhishitupu:before {
content: "\e8fc";
}
.icon-jisuanji1:before {
content: "\e8fd";
}
.icon-dianzi1:before {
content: "\e8ff";
}
.icon-junshililun1:before {
content: "\e900";
}
.icon-ruanjiangongcheng1:before {
content: "\e901";
}
.icon-yixue1:before {
content: "\e902";
}
.icon-tongxin1:before {
content: "\e904";
}
.icon-zhengcefagui1:before {
content: "\e906";
}
.icon-dashuju:before {
content: "\e8f3";
}
.icon-rengongzhineng:before {
content: "\e8f6";
}
.icon-a-shuangyinhao12x:before {
content: "\e8f2";
}
.icon-dingbu:before {
content: "\e8ee";
}
.icon-bangzhu1:before {
content: "\e8ef";
}
.icon-yijianfankui2:before {
content: "\e8f0";
}
.icon-fenxiang:before {
content: "\e8f1";
}
.icon-dizhi:before {
content: "\e8eb";
}
.icon-youxiang1:before {
content: "\e8ec";
}
.icon-dianhuaicon:before {
content: "\e8ed";
}
.icon-tianjiaicon:before {
content: "\e8e8";
}
.icon-lingshengicon:before {
content: "\e8ea";
}
.icon-gengduoicon:before {
content: "\e8e5";
}
.icon-shijianicon:before {
content: "\e8e7";
}
.icon-mimaicon:before {
content: "\e8e1";
}
.icon-gouicon:before {
content: "\e8e2";
}
.icon-zhankaiicon:before {
content: "\e8e3";
}
.icon-wenjian7:before {
content: "\e8e0";
}

File diff suppressed because one or more lines are too long

View File

@ -5,342 +5,6 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "27299393",
"name": "icon",
"font_class": "icon2",
"unicode": "e912",
"unicode_decimal": 59666
},
{
"icon_id": "27299394",
"name": "2",
"font_class": "a-21",
"unicode": "e913",
"unicode_decimal": 59667
},
{
"icon_id": "27200759",
"name": "2",
"font_class": "a-2",
"unicode": "e90f",
"unicode_decimal": 59663
},
{
"icon_id": "27200760",
"name": "3",
"font_class": "a-3",
"unicode": "e910",
"unicode_decimal": 59664
},
{
"icon_id": "27200761",
"name": "icon",
"font_class": "icon1",
"unicode": "e911",
"unicode_decimal": 59665
},
{
"icon_id": "27041503",
"name": "ioon",
"font_class": "ioon",
"unicode": "e90e",
"unicode_decimal": 59662
},
{
"icon_id": "26470602",
"name": "shanchu_tc_icon",
"font_class": "shanchu_tc_icon1",
"unicode": "e90c",
"unicode_decimal": 59660
},
{
"icon_id": "26470603",
"name": "专家icon",
"font_class": "zhuanjiaicon",
"unicode": "e90d",
"unicode_decimal": 59661
},
{
"icon_id": "12505154",
"name": "声明",
"font_class": "shengming",
"unicode": "e90b",
"unicode_decimal": 59659
},
{
"icon_id": "26470597",
"name": "成功",
"font_class": "chenggong1",
"unicode": "e907",
"unicode_decimal": 59655
},
{
"icon_id": "26470599",
"name": "必填@2x",
"font_class": "a-bitian2x1",
"unicode": "e908",
"unicode_decimal": 59656
},
{
"icon_id": "26470600",
"name": "下拉",
"font_class": "xiala1",
"unicode": "e909",
"unicode_decimal": 59657
},
{
"icon_id": "26470601",
"name": "下拉2",
"font_class": "xiala2",
"unicode": "e90a",
"unicode_decimal": 59658
},
{
"icon_id": "26363219",
"name": "箭头",
"font_class": "jiantou1",
"unicode": "e905",
"unicode_decimal": 59653
},
{
"icon_id": "26359564",
"name": "章节icon ",
"font_class": "zhangjieicon",
"unicode": "e8fe",
"unicode_decimal": 59646
},
{
"icon_id": "26359565",
"name": "成员",
"font_class": "chengyuan1",
"unicode": "e903",
"unicode_decimal": 59651
},
{
"icon_id": "26325702",
"name": "上传@2x",
"font_class": "a-shangchuan2x",
"unicode": "e8f9",
"unicode_decimal": 59641
},
{
"icon_id": "26325703",
"name": "删除 ",
"font_class": "shanchu7",
"unicode": "e8fa",
"unicode_decimal": 59642
},
{
"icon_id": "26325704",
"name": "左滑备份",
"font_class": "zuohuabeifen",
"unicode": "e8fb",
"unicode_decimal": 59643
},
{
"icon_id": "26325698",
"name": "编辑 (1)",
"font_class": "a-bianji11",
"unicode": "e8f4",
"unicode_decimal": 59636
},
{
"icon_id": "26325699",
"name": "必填@2x",
"font_class": "a-bitian2x",
"unicode": "e8f5",
"unicode_decimal": 59637
},
{
"icon_id": "26325700",
"name": "左滑@2x",
"font_class": "a-zuohua2x",
"unicode": "e8f7",
"unicode_decimal": 59639
},
{
"icon_id": "26325701",
"name": "链接",
"font_class": "lianjie3",
"unicode": "e8f8",
"unicode_decimal": 59640
},
{
"icon_id": "25748537",
"name": "知识图谱",
"font_class": "zhishitupu",
"unicode": "e8fc",
"unicode_decimal": 59644
},
{
"icon_id": "25748551",
"name": "计算机",
"font_class": "jisuanji1",
"unicode": "e8fd",
"unicode_decimal": 59645
},
{
"icon_id": "25748553",
"name": "电子",
"font_class": "dianzi1",
"unicode": "e8ff",
"unicode_decimal": 59647
},
{
"icon_id": "25748554",
"name": "军事理论",
"font_class": "junshililun1",
"unicode": "e900",
"unicode_decimal": 59648
},
{
"icon_id": "25748555",
"name": "软件工程",
"font_class": "ruanjiangongcheng1",
"unicode": "e901",
"unicode_decimal": 59649
},
{
"icon_id": "25748556",
"name": "医学",
"font_class": "yixue1",
"unicode": "e902",
"unicode_decimal": 59650
},
{
"icon_id": "25748558",
"name": "通信",
"font_class": "tongxin1",
"unicode": "e904",
"unicode_decimal": 59652
},
{
"icon_id": "25748560",
"name": "政策法规",
"font_class": "zhengcefagui1",
"unicode": "e906",
"unicode_decimal": 59654
},
{
"icon_id": "25748528",
"name": "大数据",
"font_class": "dashuju",
"unicode": "e8f3",
"unicode_decimal": 59635
},
{
"icon_id": "25748531",
"name": "人工智能",
"font_class": "rengongzhineng",
"unicode": "e8f6",
"unicode_decimal": 59638
},
{
"icon_id": "25733167",
"name": "双引号(1)@2x",
"font_class": "a-shuangyinhao12x",
"unicode": "e8f2",
"unicode_decimal": 59634
},
{
"icon_id": "25701947",
"name": "顶部",
"font_class": "dingbu",
"unicode": "e8ee",
"unicode_decimal": 59630
},
{
"icon_id": "25701948",
"name": "帮助",
"font_class": "bangzhu1",
"unicode": "e8ef",
"unicode_decimal": 59631
},
{
"icon_id": "25701949",
"name": "意见反馈",
"font_class": "yijianfankui2",
"unicode": "e8f0",
"unicode_decimal": 59632
},
{
"icon_id": "25701950",
"name": "分享",
"font_class": "fenxiang",
"unicode": "e8f1",
"unicode_decimal": 59633
},
{
"icon_id": "25580217",
"name": "地址",
"font_class": "dizhi",
"unicode": "e8eb",
"unicode_decimal": 59627
},
{
"icon_id": "25580218",
"name": "邮箱",
"font_class": "youxiang1",
"unicode": "e8ec",
"unicode_decimal": 59628
},
{
"icon_id": "25580219",
"name": "电话icon",
"font_class": "dianhuaicon",
"unicode": "e8ed",
"unicode_decimal": 59629
},
{
"icon_id": "25284174",
"name": "添加icon",
"font_class": "tianjiaicon",
"unicode": "e8e8",
"unicode_decimal": 59624
},
{
"icon_id": "25284175",
"name": "铃声icon",
"font_class": "lingshengicon",
"unicode": "e8ea",
"unicode_decimal": 59626
},
{
"icon_id": "25204490",
"name": "更多icon",
"font_class": "gengduoicon",
"unicode": "e8e5",
"unicode_decimal": 59621
},
{
"icon_id": "25204491",
"name": "时间icon",
"font_class": "shijianicon",
"unicode": "e8e7",
"unicode_decimal": 59623
},
{
"icon_id": "25188228",
"name": "密码icon",
"font_class": "mimaicon",
"unicode": "e8e1",
"unicode_decimal": 59617
},
{
"icon_id": "25188229",
"name": "钩icon",
"font_class": "gouicon",
"unicode": "e8e2",
"unicode_decimal": 59618
},
{
"icon_id": "25188230",
"name": "展开icon",
"font_class": "zhankaiicon",
"unicode": "e8e3",
"unicode_decimal": 59619
},
{
"icon_id": "24656750",
"name": "文件",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -2,11 +2,10 @@
<html lang="zh-CN" class="notranslate translated-ltr" translate="no">
<head>
<meta charset="utf-8">
<title>红山开源社区</title>
<meta name="keywords" content="红山开源,创客空间,群智共享">
<meta name="keywords" content="红山开源社区,开源开放,众创,论坛">
<meta name="keywords" content="issue,bug,tracker">
<meta name="description" content="红山开源是一个依托互联网群体智慧实现世界范围内资源深度融合、开放共享和协同创新的开源社区" />
<meta name=”Keywords” Content=”trustie,trustieforge,forge,确实让创建更美好,协同开发平台″>
<meta name=”Keywords” Content=”TrustieOpenSourceProject″>
<meta name=”Keywords” Content=”issue,bug,tracker,软件工程,课程实践″>
<meta name=”Description” Content=”持续构建协同、共享、可信的软件创建生态开源创作与软件生产相结合,支持大规模群体开展软件协同创新活动”>
<meta name="theme-color" content="#000000">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">

172
readme.txt Normal file
View File

@ -0,0 +1,172 @@
其他的文档位置:
/educoder/public/react/public/js/readme.txt 关于js_min_all
/educoder/educoder/public/react/scripts/readme-cdn.txt 关于CDN
/educoder/public/react/src/modules/page/readme.txt 关于TPI
/educoder/public/editormd/lib/readme-marked.txt 关于md编辑器 marked.js
1、 安装node v6.9.x此安装包含了node和npm。
2、 安装cnpm命令行 npm install -g cnpm --registry=https://registry.npm.taobao.org
3、 安装依赖的js库public/react目录下<即项目package.json所在目录>,开启命令行): cnpm install
4、 如果你的ruby服务使用的是3000端口则需要在package.json中修改"port"参数的值
5、 启动服务(命令行-目录同3 npm start
6、 build初始化 npm run build
注意:
1、cnpm install 之前先需要修改下ruby mine的一个settings防止ruby mine对node_modules目录里的内容建索引详情见线上文档-react开发环境搭建
线上文档-react开发环境搭建 地址: https://www.trustie.net/boards/6862/topics/46425
2、package.json中配置
"proxy": "http://localhost:3000",
"port": "3007"
目前暂时必须写为和上面的一样ruby服务端口为3000node服务端口为3007当当前端口为3007时程序会将axios发出的请求转到localhost:3000上进行跨域请求。
3、静态js加载问题
editormd源码改动注释掉了564行 加载codemirror/codemirror.min的js代码。因为codemirror 已经加载了codemirror对象会带有插件重复加载会覆盖全局codemirror对象使得之前加载的插件失效
----------------------------------------------------------------------------------------------
React开发相关知识点
需要了解的ES6的知识 https://www.trustie.net/boards/6862/topics/46427
----------------------------------------------------------------------------------------------
新加入的lib有 axios、material-ui、lodash、classnames、moment、immutability-helper
rc-tree、rc-form 、rc-rate、rc-pagination、rc-select 、showdown
考虑替代删除确认弹出框的组件http://react-component.github.io/tooltip/examples/onVisibleChange.html
----------------------------------------------------------------------------------------------
TPI State整理 START
----------------------------------------------------------------------------------------------
TPIContextProvider 详情接口的所有state
Index.js
taskListLoading
challenges
challengesDrawerOpen
MainContentContainer.js
repositoryCode: '',
currentPath: '', // 当前所选的path可能是一个只读的path只读path的话challenge.athIndex为-1
isEditablePath // 是否是可以编辑的path
open: false, // 繁忙等级等提示用Dialog TODO 考虑重构封装到根组件
gameBuilding: false, // 评测中标志
codeStatus: 2, // 0 已修改 1 保存中 2 已保存 3 保存失败
codeLoading: false, // code加载中
resetCodeDialogOpen: false, // TODO考虑重构封装到根组件
resetPassedCodeDialogOpen: false, // TODO考虑重构封装到根组件
LeftViewContainer.js
tabIndex: 0, 页签index
dialogOpen: false,
gameAnswer: '', 答案
snackbarOpen: false,
comments: [], 评论
comment_count_without_reply: 0, 评论数量 TODO 和详情接口字段重复
// 默认pageSize为10
currentPage: 1, 评论分页
loadingComments: true, 评论加载中
gotNewReply: false, 新的回复
CodeRepositoryViewContainer.js
drawerOpen: false,
loadingFirstRepoFiles: false, drawer里的loading状态
fileTreeData: "", 文件树
codeRepositoryViewExpanded: false, 展开状态
CodeEvaluateView.js
testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0), 测试集是否初始化标志
evaluateViewExpanded: false,
tabIndex: 1, 页签index
----------------------------------------------------------------------------------------------
TPI State整理 END
----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
重要TPI实现时修改的js库的记录 START
----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
重要TPI实现时修改的js库的记录 END
----------------------------------------------------------------------------------------------
create_kindeditor.js __isR 表示是react环境react环境下采用事件通知react组件来处理
if (window['__isR'] === true) {
$(document).trigger("onReply", { commentContent:tContents, id:id, editor:params.editor } );
} else {
params.form.submit();
}
editormd.min.js 直接注释掉了codemirror.min的加载应该改成有codeMirror了则不加载
// codemirror 已经加载了codemirror会有插件重复加载会使得之前加载的插件失效
// editormd.loadScript(loadPath + "codemirror/codemirror.min", function() {
对应提交项
Revision: 73d95ce266d5d7e55a3a88d08d1247b3a08c7caf
Date: 2018/4/2 16:12:21
Message: 切下一题时更新左侧editormd里的内容更新右侧codemirror内容。
js_min_all.js 最后面手动加入了若干js代码还没做分离、再合并处理 date:180507
is_cdn_link tpi_html_show方法
----------------------------------------------------------------------------------------------
TPM使用react实现的利弊 START
----------------------------------------------------------------------------------------------
1、全部使用react重写
做法第一屏使用新接口之前的js脚本还是继续使用有必要的话需要局部刷新的将部分jquery实现改为react实现
利:
tpi中评论组件、文件树组件方便复用
js、css库管理方便
暂时不依赖于react的状态管理
之前的ajax请求还是可以暂时复用
弊:
接口评估?
rails模板要改成jsx语法
头部功能区域、底部静态链接区域会存在重复代码 react版和非react版
codemirror等组件的使用会不会有问题
学习成本
目前决定新页面或者评论组件所在页面使用react实现
----------------------------------------------------------------------------------------------
TPM使用react实现的利弊 END
----------------------------------------------------------------------------------------------
其他方式comments组件build到新入口后将代码copy到rails页面
----------------------------------------------------------------------------------------------
不错的库 START
----------------------------------------------------------------------------------------------
https://livicons.com/icons-original -- 收费 动画icon
https://github.com/maxwellito/vivus -- 让SVG标签动起来
http://ianlunn.github.io/Hover/ -- hover 动画
https://github.com/legomushroom/mojs
https://github.com/juliangarnier/anime --js动画
https://codepen.io/juliangarnier/pen/gmOwJX
https://github.com/daneden/animate.css
A responsive tour snippet, with a step-by-step guide(onboarding) to help users understand how to use your website.
https://github.com/sorich87/bootstrap-tour
https://github.com/linkedin/hopscotch
https://github.com/Robophil/Product-Tour
code editor
https://microsoft.github.io/monaco-editor/

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,10 @@ import { broadcastChannelOnmessage, isDev, queryString } from 'educoder';
import { notification } from 'antd';
import './index.css';
let message501 = false;
let message501 = false;
broadcastChannelOnmessage('refreshPage', () => {
window.location.reload()
window.location.reload();
})
function locationurl(list) {
@ -25,19 +25,18 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || 'admin'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {
// 判断网络是否连接
initOnlineOfflineListener();
// var proxy = "http://192.168.1.40:3000";
var proxy = "http://111.8.36.180:8000";
var proxy = "https://testforgeplus.trustie.net";
//响应前的设置
axios.interceptors.request.use(
config => {
if(config.url.substr(0, 4) === "http") {
if(config.url.indexOf("http") !== -1) {
return config
}
requestProxy(config);
@ -69,8 +68,6 @@ export function initAxiosInterceptors(props) {
if (response.data.status === -1) {
if (window.location.pathname.startsWith('/tasks/')) {
props.showSnackbar(response.data.message || '服务器异常,请联系管理员。')
} else if(window.location.pathname.startsWith('/login') || window.location.pathname.startsWith('/register') || window.location.pathname.startsWith('/resetPassword')) {
return response;
} else {
notification.open({
message: "提示",

View File

@ -9,20 +9,7 @@ class Loading extends Component {
}
render() {
return (
<div className="App" style={{ minHeight: '800px', width: "100%" }}>
<style>
{
`
.margintop{
margin-top:20%;
}
`
}
</style>
<Spin size="large" className={"margintop"} />
</div>
);
return ""
}
}

File diff suppressed because it is too large Load Diff

View File

@ -39,59 +39,64 @@ export function getNextHalfHourOfMoment(moment) {
return moment
}
export function formatSeconds(value) {
 export function formatSeconds(value) {
var theTime = parseInt(value);// 秒
var middle = 0;// 分
var hour = 0;// 小时
if (theTime > 60) {
middle = parseInt(theTime / 60);
theTime = parseInt(theTime % 60);
if (middle > 60) {
hour = parseInt(middle / 60);
middle = parseInt(middle % 60);
}
}
var result = "" + parseInt(theTime) + "秒";
if (middle > 0) {
if (hour > 0) {
result = "" + parseInt(middle) + "分";
} else {
result = "" + parseInt(middle) + "分" + result;
}
}
if (hour > 0) {
result = "" + parseInt(hour) + "小时" + result;
}
return result;
}
        var theTime = parseInt(value);// 秒
        var middle= 0;// 分
        var hour= 0;// 小时
    
        if(theTime > 60) {
            middle= parseInt(theTime/60);
            theTime = parseInt(theTime%60);
            if(middle> 60) {
                hour= parseInt(middle/60);
                middle= parseInt(middle%60);
            }
        }
        var result = ""+parseInt(theTime)+"秒";
        if(middle > 0) {
if(hour>0){
result = ""+parseInt(middle)+"分";
}else{
result = ""+parseInt(middle)+"分"+result;
}
            
        }
        if(hour> 0) {
            result = ""+parseInt(hour)+"小时"+result;
        }
        return result;
    }
export function formatDuring(s) {
s = Math.abs(s);
let days = Math.floor(s / (60 * 60 * 24));
let hours = Math.floor((s % (60 * 60 * 24)) / (60 * 60));
let minutes = Math.floor((s % (60 * 60)) / (60));
let second = Math.floor(s % 60);
export function formatDuring(mss){
var days = parseInt(mss / (1000 * 60 * 60 * 24));
var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60));
// console.log("formatDuringformatDuring");
// console.log(days);
// console.log(hours);
// console.log(minutes);
// console.log(Math.abs(days));
// console.log(Math.abs(hours));
// console.log(Math.abs(minutes));
if (days) {
if(hours){
return days + "天" + hours + "小时";
}
return days + "天";
}
if (hours) {
if(minutes){
return hours + "小时" + minutes + "分";
}
return hours + "小时" ;
}
if (minutes) {
return minutes + "分";
}
return second + "秒";
try {
days = Math.abs(days);
} catch (e) {
}
try {
hours = Math.abs(hours);
} catch (e) {
}
try {
minutes = Math.abs(minutes);
} catch (e) {
}
return days + "天" + hours + "小时" + minutes + "分";
}
/*

View File

@ -3,6 +3,6 @@ export function isDev() {
}
// const isMobile
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|honor|huawei|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
// const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));

View File

@ -1,30 +1,15 @@
import { queryString } from "educoder";
import { queryString } from 'educoder'
export function updatePageParams(pageNum, props) {
const url = props.match.url;
const url = props.match.url
const _search = props.location.search;
let parsed = {};
if (_search) {
parsed = queryString.parse(_search);
}
const _search = props.location.search;
let parsed = {};
if (_search) {
parsed = queryString.parse(_search);
}
// 修改page參數
parsed.page = pageNum;
// 修改page參數
parsed.page = pageNum
props.history.push(`${url}?${queryString.stringify(parsed)}`);
}
export function goUser(login) {
const main_web_site_url =
localStorage.chromesetting &&
JSON.parse(localStorage.chromesetting).main_web_site_url;
window.location.href = `${main_web_site_url}/accounts/${login}`;
}
export function goUserMes(user_id) {
const main_web_site_url =
localStorage.chromesetting &&
JSON.parse(localStorage.chromesetting).main_web_site_url;
const login =sessionStorage.current_user &&JSON.parse(sessionStorage.current_user).login;
window.location.href = `${main_web_site_url}/users/${login}/message_detail?user_id=${user_id}`;
props.history.push(`${url}?${queryString.stringify(parsed)}`)
}

View File

@ -68,11 +68,8 @@ export function appendFileSizeToUploadFile(item) {
return `${item.title}${uploadNameSizeSeperator}${item.filesize}`
}
export function appendFileSizeToUploadFileAll(fileList) {
return fileList && fileList.map(item => {
if(!item.name)item.name=item.fileName;
if(!item.uid)item.uid="rc-upload" + item.id;
if(!item.size)item.size=item.fileSize;
if ((item.name).indexOf(uploadNameSizeSeperator) == -1) {
return fileList.map(item => {
if (item.name.indexOf(uploadNameSizeSeperator) === -1) {
return Object.assign({}, item, { name: `${item.name}${uploadNameSizeSeperator}${bytesToSize(item.size)}` })
}
return item

View File

@ -1,22 +1,20 @@
import React from "react";
import md5 from 'md5';
import { Input } from "antd";
import {Input} from "antd";
const { Search } = Input;
const $ = window.$;
const isDev = window.location.port == 3007;
const isdev2= window.location.hostname ==='www.educoder.net'
export const TEST_HOST = "http://111.8.36.180:8000";
export const TEST_HOST = "https://testforgeplus.trustie.net/"
export function getImageUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
// const local = 'http://39.105.176.215:49999';
const local = 'http://111.8.36.180:8000';
// const local = 'http://localhost:3000'
const local = 'https://testforgeplus.trustie.net';
if (isDev) {
return `${local}/${path}`
}
path && !path.startsWith('/') && (path = '/'.concat(path));
return `${path}`;
}
@ -38,65 +36,50 @@ export function numFormat(num, digits){
}
export function getImage(path) {
const local = 'http://111.8.36.180:8000';
if (path&&path.indexOf("http://") === -1) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://testforgeplus.trustie.net/';
if(path.indexOf("http://")===-1){
if (isDev) {
return `${local}/images/${path}`
}
return `/${path}`;
} else {
}else{
return path;
}
}
export function getTestImage(path) {
const local = 'http://111.8.36.180:8000';
if (path && path.indexOf("http://") === -1) {
if (isDev) {
return `${local}${path}`
}
return `${path}`;
} else {
return path;
}
}
export function getLogoImageUrl(path) {
const local = 'http://111.8.36.180:8000';
if (isDev) {
return `${local}/${path}`
}
return `/${path}`;
}
export function getcdnImageUrl(path) {
const testlocal = 'https://testali-cdn.educoder.net'
const local = 'https://ali-cdn.educoder.net'
let firstStr = path.substr(0, 1);
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const testlocal = 'https://testali-cdn.educoder.net'
const local='https://ali-cdn.educoder.net'
let firstStr=path.substr(0,1);
if (isdev2) {
return `${local}/${path}`;
} else {
if (firstStr == "/") {
}else{
if(firstStr=="/"){
return `${path}`
} else {
}else{
return `/${path}`
}
}
// return `${local}/${path}`;
}
export function setcndImagesUrl(path) {
export function setcndImagesUrl(path){
const testlocal = 'https://testali-cdn.educoder.net'
const local = 'https://ali-cdn.educoder.net'
let firstStr = path.substr(0, 1);
if (firstStr == "/") {
const local='https://ali-cdn.educoder.net'
let firstStr=path.substr(0,1);
if(firstStr=="/"){
if (!isdev2) {
return `${path}`
}
return `${local}${path}`;
//return isDev?`${testlocal}${path}`:`${local}${path}`;
} else {
//return isDev?`${testlocal}${path}`:`${local}${path}`;
}else{
if (!isdev2) {
return `/${path}`
}
@ -107,31 +90,31 @@ export function setcndImagesUrl(path) {
export function setImagesUrl(path) {
export function setImagesUrl(path){
const testlocal = 'https://testali-cdn.educoder.net'
const local = 'https://ali-cdn.educoder.net'
let firstStr = path.substr(0, 1);
if (firstStr == "/") {
const local='https://ali-cdn.educoder.net'
let firstStr=path.substr(0,1);
if(firstStr=="/"){
if (!isdev2) {
return `${path}`
}
return `${local}${path}`;
// return isDev?`${testlocal}${path}`:`${path}`;
} else {
}else{
if (!isdev2) {
return `/${path}`
}
return `${local}/${path}`;
//return isDev?`${testlocal}/${path}`:`/${path}`;
//return isDev?`${testlocal}/${path}`:`/${path}`;
}
}
export function getUrl(path, goTest) {
const local = TEST_HOST;
const local = 'https://testforgeplus.trustie.net'
if (isDev) {
return `${local}${path ? path : ''}`
return `${local}${path?path:''}`
}
return `${path ? path : ''}`;
return `${path ? path: ''}`;
}
export function getUrlmys(path, goTest) {
@ -145,9 +128,9 @@ export function getUrlmys(path, goTest) {
// const local = 'https://testeduplus2.educoder.net'
const local = 'https://test-jupyterweb.educoder.net'
if (isDev) {
return `${local}${path ? path : ''}`
return `${local}${path?path:''}`
}
return `${path ? path : ''}`;
return `${path ? path: ''}`;
}
export function getStaticUrl() {
const local = TEST_HOST;
@ -158,29 +141,27 @@ export function getStaticUrl() {
return ''
}
export function getUrl2(path, goTest) {
const local = 'http://localhost:3000'
const local = 'http://localhost:3000'
if (isDev) {
return `${local}${path ? path : ''}`
return `${local}${path?path:''}`
}
return `${path ? path : ''}`;
return `${path ? path: ''}`;
}
const newopens = "79e33abd4b6588941ab7622aed1e67e8";
const newopens ="79e33abd4b6588941ab7622aed1e67e8";
let newtimestamp;
let checkSubmitFlgs = false;
function railsgettimess(proxy) {
if (checkSubmitFlgs === false) {
$.ajax({
url: proxy,
async: false, success: function (data) {
if (data.status === 0) {
newtimestamp = data.message;
if(checkSubmitFlgs===false){
$.ajax({url:proxy,
async:false,success:function(data){
if(data.status===0){
newtimestamp=data.message;
checkSubmitFlgs = true;
}
}
})
}})
window.setTimeout(function () {
checkSubmitFlgs = false;
checkSubmitFlgs=false;
}, 2500);
}
}
@ -223,8 +204,8 @@ export function getUploadActionUrlOfAuth(id) {
}
export function getRandomNumber(type) {
let anewopens = md5(newopens + newtimestamp);
return type === true ? `randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`
let anewopens=md5(newopens+newtimestamp);
return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}`
}
export function test(path) {
@ -258,51 +239,14 @@ export function htmlEncode(str) {
return s;
}
export function publicSearchs(Placeholder, onSearch, onInputs, onChanges, loadings) {
return (<Search
placeholder={Placeholder || "请输入内容进行搜索"}
export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings) {
return(<Search
placeholder= { Placeholder || "请输入内容进行搜索" }
onSearch={onSearch}
// value={searchValue}
onInput={onInputs}
onChange={onChanges}
loading={loadings || false}
loading={loadings||false}
allowClear={true}
></Search>)
}
export function getUrlToken(name, str) {
const reg = new RegExp(`(^|&)${ name}=([^&]*)(&|$)`);
const r = str.substr(1).match(reg);
if (r != null) return decodeURIComponent(r[2]); return null;
}
export function turnbar(str){
let s = str;
if(s && s.length>0){
if(s.indexOf("%")>-1){
s = s.replaceAll('%','_25');
}
if(s.indexOf("#")>-1){
s = s.replaceAll('#','%23');
}
if(s.indexOf("/")>-1){
s = s.replaceAll('/','%2F');
}
}
return s;
}
export function returnbar(str){
let s = str;
if(s && s.length>0){
if(str.indexOf("_25")>-1){
s = s.replaceAll('_25','%');
}
if(s.indexOf("%23")>-1){
s = s.replaceAll('%23','#');
}
if(s.indexOf("%2F")>-1){
s = s.replaceAll('%2F','/');
}
}
return s;
}

View File

@ -6,8 +6,7 @@ export {
getUploadLogoActionUrl as getUploadLogoActionUrl,numFormat as numFormat,
getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,getTestImage as getTestImage,getLogoImageUrl as getLogoImageUrl,
turnbar,returnbar,getUrlToken as getUrlToken
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl
} from './UrlTool';
export { setmiyah as setmiyah } from './Component';
@ -20,7 +19,7 @@ export {
, broadcastChannelPostMessage, broadcastChannelOnmessage
} from './EventUtil';
export { updatePageParams as updatePageParams ,goUserMes,goUser} from './RouterUtil';
export { updatePageParams as updatePageParams } from './RouterUtil';
export { bytesToSize as bytesToSize } from './UnitUtil';

View File

@ -30,7 +30,7 @@ export default ({
cleanToc()
}
rs = rs.replace(/(__special_katext_id_\d+__)/g, (_match, capture) => {
const { type, expression } = math_expressions[capture];
const { type, expression } = math_expressions[capture]
return renderToString(_unescape(expression) || '', { displayMode: type === 'block', throwOnError: false, output: 'html' })
})
rs = rs.replace(/▁/g, "▁▁▁")

View File

@ -1,280 +0,0 @@
import React , { useEffect , useState } from 'react';
import { TPMIndexHOC} from '../../modules/tpm/TPMIndexHOC';
import { Timeline, Carousel } from 'antd';
import { getImageUrl } from 'educoder';
import CountUp from 'react-countup';
import axios from 'axios';
import './AboutUs.scss';
import subititle from './image/subtitle.png';
import achievements from './image/achievements.png';
import earth from './image/earth.png';
import computer from './image/computer.png';
import position from './image/position.png';
import quan1 from './image/quan1.png';
import quan2 from './image/quan2.png';
import fun1 from './image/fun1.png';
import fun2 from './image/fun2.png';
import fun3 from './image/fun3.png';
import fun4 from './image/fun4.png';
import fun5 from './image/fun5.png';
function AboutUs(){
const countUpProps = {
redraw: true,
start: 0,
duration: 2,
suffix: "+"
};
const [selectTitle, setSelectTitle] = useState(1);
//
const [flush, setFlush] = useState(false);
//
const [units, setUnits] = useState([]);
useEffect(()=>{
//
window.addEventListener('scroll', scrollListener);
//topics.json
axios.get(`/topics.json`, { params: { topic_type: "cooperator", limit: 20, group_size: 5}}).then(response=>{
response && setUnits(response.data.topics);
});
return ()=>window.removeEventListener('scroll', scrollListener);
},[])
function scrollListener(e){
const top = e.srcElement.scrollingElement.scrollTop;
//
top < 555 && setSelectTitle(1);
if (top > 2800 && top< 4000){
setFlush(true);
}else{
setFlush(false);
}
}
return(
<div className="aboutUs_body">
<div className="aboutUs_head df">
<p className="head_title">GitLink 确实开源</p>
<p className="head_cont font-20 mt36">新一代开源创新服务平台让您的创意在这里释放</p>
</div>
<div className="aboutUs_title df">
<a className={selectTitle === 1 ? "active" : ""} href="#value1" onClick={() => setSelectTitle(1)}>关于我们</a>
<a className={selectTitle === 2 ? "active" : ""} href="#value2" onClick={() => setSelectTitle(2)}>平台统计</a>
<a className={selectTitle === 3 ? "active" : ""} href="#value3" onClick={() => setSelectTitle(3)}>加入我们</a>
<a className={selectTitle === 4 ? "active" : ""} href="#value4" onClick={() => setSelectTitle(4)}>合作单位</a>
</div>
<div className="aboutUs">
<a id="value1" className="mao"></a>
{/* 关于我们 */}
<div className="about_us">
<div className="au_bg">
<div className="au_title">关于我们</div>
{/* 简介 */}
<div className="au_cont subt df">
<div className="cont1_introduction">
<p className="subtitle">简介</p>
<div className="font-16">GitLink确实开源是CCF官方指定的开源创新服务平台旨在以为开源创新服务为使命成为开源创新的汇聚地为愿景秉承创新开放协作共享的价值观致力于为大规模开源开放协同创新助力赋能打造创新成果孵化和新工科人才培养的开源创新生态</div>
</div>
<img src={subititle} className="subtitleImg"></img>
</div>
</div>
{/* 确实开源 一脉传承 */}
<div className="au_cont inherit pl30">
<p className="subtitle">确实开源&nbsp;&nbsp;一脉传承</p>
<div>本世纪以来随着软件创新需求和应用规模的飞速增长软件开发队伍开发资源可信评估呈现出规模化开放化持续化的新特点软件开发活动面临协同难复用难评估难的制约经典的工程化软件开发方法面临严峻挑战严重影响了软件开发效率和质量的提升在此背景下国防科技大学联合国内多所知名高校科研机构和软件企业围绕开源创新开展了持续性探索构建形成了以Trustie确实为代表的一系列开源创新服务基础设施自2006年以来Trustie经过三个阶段的演化发展于2021年迎来全面升级在中国计算机学会CCF的带领指导下共同推进产学研用深度融合共筑新一代开源创新服务平台GitLink</div>
<div className="inherit_items">
<img src={quan1} className="quan1Img"/>
<img src={quan2} className="quan2Img"/>
<Timeline>
<Timeline.Item dot={<i className="iconfont icon-a-yuanquan2x font-20"></i>}>
<div className="timeline_cont">
<p>Trustie 1.0阶段2006-2014</p>
<div>国防科技大学北京大学北京航空航天大学中国科学院软件研究所等单位合作开展了基于网络的软件开发群体化方法与技术研究揭示了以大众化协同开发开放式资源共享持续性可信评估为核心的互联网大规模协同机理与软件开发工程化方法相结合系统地提出了基于网络的软件开发群体化方法并于2008年发布了可信的国家软件资源共享与协同生产环境简称Trustie v1.0中文简称确实重点解决大规模软件协同开发可信评估运行监控和持续演化等问题</div>
</div>
</Timeline.Item>
<Timeline.Item dot={<i className="iconfont icon-a-yuanquan2x"></i>}>
<div className="timeline_cont">
<p>Trustie 2.0阶段2014-2020</p>
<div>在科技部项目的持续资助下国防科技大学联合国内多所知名高校科研机构和软件企业致力于系统研究新型软件开发方法为开源生态建设提供方法指导和实践指南支撑科教领域原始创新成果的开源孵化和开源人才培养并于2014年发布了面向软件创新和教育的开源社区Trustie v2.0重点探索协作开发社区知识分享社区应用服务社区等大外围软件涉众的联接以及基于开源大数据的智能化开发等技术</div>
</div>
</Timeline.Item>
<Timeline.Item dot={<i className="iconfont icon-a-yuanquan2x"></i>}>
<div className="timeline_cont">
<p>Trustie 3.0阶段 (2020年至今)</p>
<div>Trustie在已有的技术积累基础上进一步联合国内高等院校科研机构产业企业和开源组织等在中国计算机学会CCF的带领指导下共同推进产学研用深度融合致力于联接互联网海量群智资源探索开源创新成果开放与共享开源生态协作与共建的新模式和新方法升级形成了新一代开源创新服务平台GitLink力图破解软件开发群智范式背后的本质机理建立面向大外围开放创新的群智激发与汇聚关键机制实现面向大规模软件涉众的稳态群智激发与汇聚</div>
</div>
</Timeline.Item>
</Timeline>
</div>
</div>
{/* 特色功能 确实给力 */}
<div className="feature_function_bg">
<div className="au_cont">
<p className="au_title">特色功能&nbsp;&nbsp;确实给力</p>
<table><tr>
<td>
<div className="feat_func_cont">
<div className="feat_fun_img"><img src={fun1} /></div>
<div>
<p>分布式协作开发</p>
<div>支持在线文件编辑&nbsp;&nbsp;<br />分支管理贡献统计<br />仓库复刻合并请求&nbsp;&nbsp;&nbsp;</div>
</div>
</div>
</td>
<td>
<div className="feat_func_cont">
<div className="feat_fun_img"><img src={fun2} /></div>
<div>
<p>一站式过程管理</p>
<div>支持疑修里程碑&nbsp;&nbsp;&nbsp;<br />通知提醒标签归档Wiki文档组织管理&nbsp;&nbsp;&nbsp;</div>
</div>
</div>
</td>
<td>
<div className="feat_func_cont">
<div className="feat_fun_img"><img src={fun3} /></div>
<div>
<p>高效流水线运维</p>
<div>提供轻量级工作流引擎<br />并支持自定义配置&nbsp;&nbsp;&nbsp;<br/>静态扫描制品构建&nbsp;&nbsp;&nbsp;</div>
</div>
</div>
</td>
<td>
<div className="feat_func_cont">
<div className="feat_fun_img"><img src={fun4} /></div>
<div>
<p>多层次代码分析</p>
<div>支持代码溯源分析&nbsp;&nbsp;&nbsp;<br />许可证风险分析开源漏洞检测和加固建议&nbsp;&nbsp;&nbsp;</div>
</div>
</div>
</td>
<td>
<div className="feat_func_cont">
<div className="feat_fun_img"><img src={fun5} /></div>
<div>
<p>多维度用户画像</p>
<div>支持开发活动统计&nbsp;&nbsp;&nbsp;<br />贡献日历能力建模<br />角色与专业定位分析&nbsp;&nbsp;&nbsp;</div>
</div>
</div>
</td>
</tr></table>
</div>
</div>
{/* 成果作用,确实有效 */}
<div className="au_cont df pl30">
<img src={achievements} className="achievementsImg"></img>
<div className="cont1_achievements">
<p className="subtitle ml0">成果作用&nbsp;&nbsp;确实有效</p>
<div>GitLink确实开源为我国创新型软件产业发展提供了关键技术支撑和实践指南为各类开源创新活动以及我国军地开源社区建设提供了有效支撑为推动开源创新发展和创新人才培养发挥了重要作用<br/>通过10多年的发展GitLink平台显著提升了大型软件企业软件生产能力支持了我国航空航天国防等多个关键领域的可信软件生产为包括新一代人工智能启智社区ARM绿色计算社区科技部云计算与大数据木兰社区科技委可控开源创造行动红山社区等的建设提供关键技术支撑为我国关键领域开源社区生态建设发挥了重要作用</div>
</div>
</div>
</div>
{/* 平台统计 */}
<div className="about_us statistics">
<a id="value2" className="mao"></a>
<div className="au_title">平台统计</div>
<p>联接海量群智资源汇聚优秀开源组织孵化优质创新成果</p>
<img src={earth} className="earthImg"/>
<div className="statistics_cont df">
<div>
<CountUp {...countUpProps} start={0} end={50000} />
<p>开发者</p>
</div>
<div>
<CountUp {...countUpProps} end={1000} />
<p>组织</p>
</div>
<div>
<CountUp {...countUpProps} end={1400000} />
<p>仓库</p>
</div>
</div>
</div>
{/* 加入我们 */}
<div className="join_us_bg">
<a id="value3" className="mao"></a>
<div className="au_cont">
<div className="au_title">加入我们</div>
<p className="subtitle">探索你的未来</p>
<p>GitLink团队在寻找新的小伙伴期待着您的加入让我们一起为开源创新贡献力量</p>
<img src={computer} className="joinUsImg"/>
{/* 轮播图 */}
<Carousel autoplay easing="none">
<div className="df">
<div className="position">
<p className="df"><img src={position} /><span className="ml10">前端开发工程师</span></p>
<div>
1全日制本科及以上学历5年以上Web前端开发经验熟练使用GulpWebpack等构建工具<br />
2熟练掌握VUE或React编程有前端模块化组件化自动化开发经验者优先<br />
3精通jQueryAjaxJson等技术对VUENodeJs等技术有所涉及<br />
4熟悉前端开发技术(HTML5JSJSONXHTMLCSS3ES6)了解各项技术的相关标准并严格按照标准进行开发<br />
</div>
</div>
<div className="position right">
<p className="df"><img src={position} /><span className="ml10">后端开发工程师</span></p>
<div>
1全日制本科及以上学历计算机软件工程相关专业者优先<br />
23年以上Java开发相关经验扎实的Java编程基础参与过1个以上大/中型高并发高性能系统架构设计开发和调优<br />
3熟练掌握SpringSpringBootSpring MVCMyBatis等开源框架掌握MVC框架模式及BS架构<br />
4精通SQL熟练使用MySQLOracle等数据库并具有一定的SQL优化能力熟悉RedisMongoDB等常用NoSQL解决方案了解各自的优缺点以及使用场景者优先<br />
</div>
</div>
</div>
<div className="df">
<div className="position">
<p className="df"><img src={position} /><span className="ml10">软件测试工程师</span></p>
<div>
1熟悉主流开发技术框架具备软件工程的基本知识<br />
2熟练掌握各种测试理论和测试技术精通测试过程设计和用例设计方法<br />
3熟悉性能测试自动化测试安全测试其中一种或多种测试工具LoadRunnerJmeterSeleniumQTPRobotFirebugAppScanPyCharm等熟练运用工具从事过相关测试工作<br />
4熟悉掌握一种编程语言Java/Python/C++<br />
5熟悉Oracle/MySQL数据库并能熟练编写SQL语句熟练常用Linux命令<br />
6有整体质量意识测试管理经验<br />
</div>
</div>
<div className="position right">
<p className="df"><img src={position} /><span className="ml10">产品经理</span></p>
<div>
1计算机或相关专业本科以上学历3年以上工作经验<br />
2熟悉开源软件项目的管理流程了解软件需求的调研方法具备需求分析能力<br />
3能以专业的方式向客户提供技术咨询良好的方案设计能力和文字功底<br />
4具备良好的交流沟通和表达能力良好的方案演示和介绍技巧<br />
5了解互联网产品的基本思路及基础方法论能够基于数据提出产品优化策略<br />
6承受较强的工作压力强烈的团队合作意识与工作责任心<br />
7有良好人际交往能力工作积极主动自信心强有较强的学习能力<br />
</div>
</div>
</div>
</Carousel>
<p className="delivery">简历投递邮箱zengyt#csxjy.com.cn 曾先生 (@符号替换#)</p>
</div>
</div>
{/* 合作单位 */}
<div className="unit">
<a id="value4" className="mao"></a>
<div className="au_title">合作单位</div>
<table>
{units && units.map(group =>{
return (
<tr>
{group.map(item =>{
return(
<td><a href={item.url} target="_blank"><img src={getImageUrl(item.image)}></img></a></td>
)
})}
</tr>
)
})}
</table>
</div>
</div>
</div>
)
}
export default TPMIndexHOC(AboutUs);

View File

@ -1,338 +0,0 @@
.aboutUs_body{
font-size: 16px;
color: #182332;
font-family: PingFangSC-Regular, PingFang SC;
& table{
text-align: center;
margin: 0 auto;
}
& .df{
display: flex;
justify-content: space-around;
align-items: center;
}
& .join_us_bg, .feature_function_bg, .feat_fun_img, .aboutUs_head{
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
& .mao{
position: relative;
top: -70px;
}
}
.aboutUs_head.df{
flex-direction: column;
justify-content: center;
height: 500px;
line-height: 500px;
background-image: url('./image/banner.png');
& p{
text-align: center;
}
& .head_title{
line-height: 50px;
font-size: 48px;
font-weight: 600;
background-image: -webkit-linear-gradient(bottom,#4CDBF5,#5AACFF);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
& .head_cont{
line-height: 39px;
color: #FFFFFF;
opacity: 0.9;
}
}
.aboutUs_title{
width: 800px;
height: 62px;
margin: 0 auto;
&>table{
width: 800px;
font-weight: 400;
}
& a.active{
color: #466AFF;
height: 62px;
line-height: 62px;
border-bottom: 2px solid;
}
}
.aboutUs{
& .au_title{
font-size: 38px;
font-weight: 500;
color: #1E1E1E;
text-align: center;
padding-top: 50px;
// line-height: 53px;
}
& .subtitle{
font-size: 20px;
font-weight: bold;
color: #000000;
margin-bottom: 23px !important;
}
}
.about_us{
// 关于我们
& .au_cont.df{
justify-content: space-between;
}
& .au_bg{ background: linear-gradient(180deg, #F3F9FF 0%, rgba(255, 255, 255, 0) 100%);}
& .cont1_introduction{
width: 472px;
&>div{
line-height: 34px;
}
}
& .cont1_achievements{
width: 581px;
& .subtitle.ml0{margin-left: 0;}
&>div{
font-size: 15px;
line-height: 36px;
}
}
& .subtitleImg{
width: 650px;
height: 330px;
}
& .achievementsImg{
width: 507px;
height: 384px;
}
//时间轴
& .inherit_items{
position: relative;
& .quan1Img{
width: 140px;
height: 167px;
position: absolute;
left: -290px;
top: 90px;
}
& .quan2Img{
width: 100px;
height: 120px;
position: absolute;
right: -170px;
bottom: 80px;
}
}
.inherit{
& .icon-a-yuanquan2x{
color: #466aff;
}
& .ant-timeline-item-tail{
border-left: 2px solid rgba(108, 134, 172, 0.42);
height: calc(100% - -30px);
}
& .ant-timeline-item:last-child .ant-timeline-item-tail{
display: block;
height: calc(100% - 18px);
}
& .ant-timeline-item-content{
margin: 0 0 -15px 18px;
}
}
.timeline_cont{
margin-left: 35px;
&>p{
font-size: 20px;
font-weight: 500;
color: #466AFF;
margin: 45px 0 30px !important;
}
&>div{
width: 980px;
padding: 20px 35px;
background: #F5F7FA;
font-size: 15px;
font-weight: 400;
color: #182332;
line-height: 33px;
&:after,&:before{
content: "";
position: absolute;
left: 21px;
top: 100px;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 14px solid #F5F7FA;
}
}
}
//特色功能 确实给力
& .feature_function_bg{
position: relative;
height: 630px;
background-image: url(./image/funBg.png);
& .au_cont p.au_title{
font-size: 30px;
padding: 50px 0 70px;
color: #FFFFFF;
opacity: 0.9;
}
& table{
position: relative;
background: none;
width: 1200px;}
& .funBg2 {
width: 1600px;
left: 50%;
margin-left: -800px;
position: absolute;
bottom: -15px;
}
}
& .feat_func_cont{
width: 200px;
& .feat_fun_img{
height: 205px;
line-height: 205px;
background-image: url('./image/funBg3.png');
&:hover{background-image: url('./image/funBg4.png');}
}
& img{ width: 175px;}
& p{
font-size: 18px;
font-weight: 500;
color: #FFFFFF;
line-height: 28px;
background-image: -webkit-linear-gradient(bottom,#4FFDFF,#0183FF);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
& div>div{
margin: 10px auto;
width: 142px;
font-size: 14px;
line-height: 28px;
color: #FFFFFF;
opacity: 0.76;
}
}
// 平台统计
&.statistics{
text-align: center;
background: linear-gradient(180deg, #ECF3FF 0%, #FFFFFF 100%);
height: 640px;
overflow: hidden;
position: relative;
& .statistics_cont{
width: 1014px;
height: 203px;
background: #FFFFFF;
opacity: 0.83;
position: absolute;
top: 230px;
left: 50%;
margin-left: -500px;
& span{
font-size: 48px;
font-weight: bold;
color: #1338D1;
}
& p{
width: 111px;
height: 38px;
line-height: 38px;
border: 1px solid #182332;
margin: 0 auto;
font-size: 22px;
color: #1E1E1E;
}
}
& .earthImg{
width: 1500px;
margin-top: -120px;
animation: moving 60s linear infinite;
}
@keyframes moving {
0% { transform: rotate(0deg);}
50% { transform: rotate(180deg);}
100% { transform: rotate(360deg);}
}
}
}
// 加入我们
.join_us_bg{
height: 710px;
margin-top: 40px;
background-image: url(./image/joinUs.png);
& .au_cont{position: relative;}
& .joinUsImg{
width: 260px;
height: 265px;
position: absolute;
top: 27px;
right: 10px;
}
& .df{
display: flex !important;
margin-top: 30px;
}
& .position{
width: 540px;
&.right{ margin-right: -30px;}
& p{
justify-content: flex-start;
height: 60px;
background: #253DA0;
line-height: 60px;
padding-left: 20px;
& img{width: 30px;}
& span{
font-weight: 500;
color: #FFFFFF;
line-height: 22px;
}
}
& div{
height: 306px;
font-size: 14px;
line-height: 34px;
padding: 20px;
background: #FFFFFF;}
}
& .ant-carousel .slick-dots-bottom{bottom: -30px;}
& .ant-carousel .slick-dots li button{
width: 12px;
height: 12px;
border-radius: 10px;
background: #466AFF;
}
& .delivery{
height: 60px;
line-height: 60px;
margin-left: 35px;
}
}
//合作单位
.unit{
margin-bottom: 60px;
& table{
width: 1200px;
height: 550px;
margin-top: 15px;
border-collapse: separate;
border-spacing: 10px 10px;
& td{
width: 224px;
height: 122px;
box-shadow: 0px 1px 8px 1px rgba(0, 0, 0, 0.06);
border-radius: 6px;
border: 2px solid #FFFFFF;
&:hover{ border: 1px solid #466AFF;}
}
}
}
.au_cont{
width: 1200px;
margin: 50px auto;
&.pl30 .subtitle{ margin-left: -30px;}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 859 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

View File

@ -124,9 +124,7 @@ class Activity extends Component{
</Menu>
)
render(){
const { time , data , page , project_trends , isSpin ,
pr_count , new_pr_count , close_issues_count , open_issues_count , pr_all_count ,issues_count,
type,status } = this.state;
const { time , data , page , project_trends , isSpin , pr_count , new_pr_count , close_issues_count , open_issues_count , pr_all_count ,issues_count } = this.state;
let name = time ? ARRAY.filter(item=>item.id === parseInt(time)) :[{name:"全部"}];
const first_per = pr_all_count > 0 ? `${parseFloat(pr_count/pr_all_count).toFixed(2)*100}%` :"50%";
@ -152,25 +150,25 @@ class Activity extends Component{
<p className="percent_red" style={{width:`${third_per}`}}></p>
<p className="percent_green" style={{width:`${fourth_per}`}}></p>
</div>
<span>{data && data.issues_count}</span>
<span>{data && data.issues_count}</span>
</div>
</div>
<ul className="percentBox">
<li>
<span className="purple">{data && data.pr_count}</span>
<span className={type==="PullRequest" && status==="delay" ?`change active`:"change"} onClick={()=>this.changeTrends("PullRequest","delay")}>已处理的合并请求</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","delay")}>已处理的合并请求</span>
</li>
<li>
<span className="green">{data && data.new_pr_count}</span>
<span className={type==="PullRequest"&& status==="not_delay" ?`change active`:"change"} onClick={()=>this.changeTrends("PullRequest","not_delay")}>未处理的合并请求</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","not_delay")}>未处理的合并请求</span>
</li>
<li>
<span className="red">{data && data.close_issues_count}</span>
<span className={type==="Issue"&& status==="delay" ?`change active`:"change"} onClick={()=>this.changeTrends("Issue","delay")}>已关闭的</span>
<span className="change" onClick={()=>this.changeTrends("Issue","delay")}>已关闭的</span>
</li>
<li>
<span className="green">{data && data.open_issues_count}</span>
<span className={type==="Issue"&& status==="not_delay" ?`change active`:"change"} onClick={()=>this.changeTrends("Issue","not_delay")}>未处理的</span>
<span className="change" onClick={()=>this.changeTrends("Issue","not_delay")}>未处理的</span>
</li>
</ul>
</div>

View File

@ -14,20 +14,20 @@ class ActivityItem extends Component {
{/* 如果是版本发布 */}
{item.trend_type === "VersionRelease" ?
<p className="itemLine">
<Link to={`/${owner}/${projectsId}/releases`} className="font-16">{item.name}</Link>
<Link to={`/${owner}/${projectsId}/releases`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
:
// 如果是任务
item.trend_type === "Issue" ?
<p className="itemLine">
<Link to={`/${owner}/${projectsId}/issues/${item.trend_id}`} className="font-16">{item.name}</Link>
<Link to={`/${owner}/${projectsId}/issues/${item.trend_id}`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
:
// 如果是合并请求
<p className="itemLine">
<Link to={`/${owner}/${projectsId}/pulls/${item.trend_id}`} className="font-16">{item.name}</Link>
<Link to={`/${owner}/${projectsId}/pulls/${item.trend_id}`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
}

View File

@ -107,10 +107,6 @@
color: black;
cursor: pointer;
}
.change.active{
color: #466AFF !important;
}
.change:hover{
color: #466AFF;
color: #4183c4;
}

View File

@ -7,10 +7,10 @@ function CloneAddress({http_url , ssh_url , zip_url , tar_url}) {
const [ key , setKey ] = useState("HTTP");
return (
<div className="downMenu">
<div>
<div style={{borderBottom:"1px solid #eee"}}>
<Menu className="urlMenu" selectedKeys={[key]} mode={"horizontal"}>
<Menu.Item key="HTTP" onClick={(e)=>{setKey(e.key)}}>HTTP</Menu.Item>
{ssh_url && <Menu.Item key="SSH" onClick={(e)=>{setKey(e.key)}}>SSH</Menu.Item>}
<Menu.Item key="SSH" onClick={(e)=>{setKey(e.key)}}>SSH</Menu.Item>
</Menu>
<div className="gitAddressClone">
<input type="text" id="copy_rep_content" value={key==="HTTP" ? http_url:ssh_url} />
@ -18,8 +18,8 @@ function CloneAddress({http_url , ssh_url , zip_url , tar_url}) {
</div>
</div>
<Menu className="edu-txt-center">
{zip_url && <Menu.Item style={{borderTop:"1px solid #eee"}}><a href={zip_url}>下载 ZIP</a></Menu.Item>}
{tar_url && <Menu.Item><a href={tar_url}>下载 TAR.GZ</a></Menu.Item>}
<Menu.Item><a href={zip_url}>下载 ZIP</a></Menu.Item>
<Menu.Item><a href={tar_url}>下载 TAR.GZ</a></Menu.Item>
</Menu>
</div>
)

View File

@ -3,7 +3,6 @@ import { Dropdown} from 'antd';
import './branch.scss';
import SelectOverlay from './SelectOverlay';
import { findDOMNode } from 'react-dom';
import { turnbar } from 'educoder';
export default (({ projectsId , branch , owner , changeBranch , branchList , tagflag = true })=>{
const [ showValue , setShowValue ] = useState(branch);
@ -36,8 +35,7 @@ export default (({ projectsId , branch , owner , changeBranch , branchList , tag
function ChangeB(params) {
setVisible(false);
let en = turnbar(params);
changeBranch(en);
changeBranch(params);
}
const menu = (

View File

@ -66,10 +66,9 @@ function AddMember({getID,login,showNotification}){
};
function addCollaborator(){
if(source && source.length>0&&searchKey){
if(source && source.length>0){
getID && getID(id);
setSearchKey(undefined);
setID(undefined)
}else{
showNotification("请选择存在的用户!");
}

View File

@ -313,17 +313,17 @@ li.ant-menu-item{
}
}
.-task-sidebar>div {
height: 48px;
line-height: 48px;
height: 40px;
line-height: 40px;
box-sizing: border-box;
width: 48px;
width: 40px;
color: #999;
font-size: 20px;
text-align: center;
margin-bottom: 20px;
border-radius: 50%;
background: #FFFFFF;
box-shadow: 0px 0px 12px 5px rgba(208, 208, 208, 0.2);
box-shadow: 0px 0px 10px 1px #F1F1F1;
}
.-task-sidebar>div i {
@ -334,40 +334,36 @@ li.ant-menu-item{
color: #fff !important;
}
.-task-sidebar>div:hover{
background: #466AFF;
background: #1890FF;
box-shadow: 0px 0px 10px 2px #B6D0FC;
}
.helpBox{
width: 260px;
z-index: 103;
&.shareContent{
width: 160px;
}
.ant-popover-title{
font-size: 16px;
width: 200px;
}
.ant-popover-inner-content{
padding:0px;
}
p.titlecontent{
font-size: 16px;
font-size: 18px;
color: #333;
line-height: 20px;
padding:15px 20px;
}
.faqUl{
padding:10px 15px;
padding:0px 20px 10px;
max-height: 230px;
overflow-y: auto;
font-size: 13px;
li{
background: #F5F5F5;
border-radius: 20px;
padding:0px 15px;
padding:0px 20px;
color: #333;
height: 30px;
line-height: 30px;
margin-bottom: 3px !important;
height: 34px;
line-height: 34px;
margin-bottom: 10px;
a{
display: block;
overflow: hidden;
@ -383,18 +379,19 @@ li.ant-menu-item{
}
}
.shareUl{
padding:10px 0px;
display: flex;
align-items: center;
.titlecontent{
margin-right: 20px;
}
li > i{
font-size: 32px!important;
}
}
}
// tooltip样式
.tooltipBox .ant-tooltip-inner{
padding: 8px 12px;
font-size: 15px;
}
.-task-desc {
background: #494949;
@ -442,21 +439,3 @@ li.ant-menu-item{
border-left: 5px solid #494949;
border-bottom: 6px solid transparent
}
//头部输入框样式
.headSerach{
background: rgba(255, 255, 255, 0.1);
border-radius: 4px;
padding-left: 20px;
//修改antd输入框默认样式
.ant-input,.ant-input:focus{
border: none !important;
background-color: rgba(255, 255, 255, 0) !important;
}
&:hover{
padding: 2px 20px 2px 20px;
background: #FFF;
& i{
color: #333;
}
}
}

View File

@ -7,7 +7,7 @@ import './Component.scss';
import { getUser } from '../GetData/getData';
import axios from 'axios';
function Contributors({owner,projectsId,currentLogin}){
function Contributors({contributors,owner,projectsId,currentLogin}){
const [ menuList ,setMenuList ]= useState([]);
const [ list , setList ]= useState(undefined);
const [ total , setTotal ]= useState(0);
@ -16,18 +16,11 @@ function Contributors({owner,projectsId,currentLogin}){
const [ isSpin , setIsSpin ] = useState(false);
useEffect(()=>{
getData();
},[])
function getData(){
const url = `/${owner}/${projectsId}/contributors.json`;
axios.get(url).then(result=>{
if(result){
setTotal(result.data.total_count);
setList(result.data.list);
}
}).catch(error=>{})
}
if(contributors && contributors.total_count>0){
setTotal(contributors.total_count);
setList(contributors.list);
}
},[contributors])
useEffect(()=>{
if(login){
@ -155,15 +148,15 @@ function Contributors({owner,projectsId,currentLogin}){
}
return(
total > 0 ?
<div className="halfs">
<Link to={`/${owner}/${projectsId}/contribute`} className="font-16 color-ooo hoverA">
<span>贡献者</span>
{ total > 0 && <span className="infoCount">{total}</span>}
{ contributors && contributors.total_count > 0 && <span className="infoCount">{contributors.total_count}</span>}
</Link>
<div className="attrPerson" onMouseLeave={()=>setVisibleFunc(false)}>
{
list && list.length>0 && list.map((item,key)=>{
total > 0 ?
list.map((item,key)=>{
return(
<Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">
<Link key={key} to={`/${item.login}`}>
@ -172,9 +165,10 @@ function Contributors({owner,projectsId,currentLogin}){
</Popover>
)
})
:""
}
</div>
</div>:""
</div>
)
}
export default Contributors;

View File

@ -25,7 +25,7 @@ function DeleteBox({
>
<div className="desc">
<AlignCenter className="descMain"><i className="iconfont icon-shanchu_tc_icon mr10"></i>{content}</AlignCenter>
<p className="task-hide-2" style={{WebkitLineClamp:5}}>删除后未来事件将不会推送至此Webhook地址<span title={subTitle}>{subTitle}</span></p>
<p>{subTitle}</p>
</div>
</Modals>
)

View File

@ -1,10 +1,15 @@
import React, { useEffect, useState } from 'react';
import { Drawer , Tree , Spin } from 'antd';
import { turnbar} from 'educoder';
import './Component.scss';
import axios from 'axios';
const { TreeNode , DirectoryTree } = Tree;
function turnbar(str){
if(str && str.length>0 && str.indexOf("/")>-1){
return str.replaceAll('/','%2F');
}
return str;
}
function DrawerPanel({visible,onClose,branch,owner,projectsId,history, name , list}){
const [ treeData , setTreeData ] = useState(undefined);
const [ isSpin , setIsSpin ] = useState(true);

View File

@ -1,5 +1,3 @@
import React , { useState , useEffect } from 'react';
import { Select } from 'antd';
import axios from 'axios';
@ -59,6 +57,7 @@ const LANGUAGE = [
export default (({ language , select_language })=>{
const [ languages , setLanguage ] = useState(undefined);
// useEffect(()=>{
// const url = '/dev_ops/languages.json';
// axios.get(url).then(result=>{

View File

@ -5,7 +5,7 @@ import './Component.scss';
export default (()=>{
return(
<div className="handleBox">
<a href="https://www.osredm.com/forums/594/detail" target="_blank" >
<a href="https://forum.trustie.net/forums/3075/detail" target="_blank" >
<img src={Handbook} alt=""/>
</a>
</div>

View File

@ -32,7 +32,7 @@ export default ({history}) => {
/>
</div>
:
<i className="iconfont icon-sousuo font-18 ml30" style={{color:"#a5a5a5"}} onClick={() => {
<i className="iconfont icon-sousuo font-18 color-grey-6 ml30" onClick={() => {
setOpenSearch(true)
}} />
}

View File

@ -1,41 +1,18 @@
import React, { useEffect, useState } from 'react';
import { FlexAJ } from '../Component/layout';
import { Divider } from 'antd';
import axios from 'axios';
function LanguagePower({owner,projectsId}){
function LanguagePower({languages}){
const [ array , setArray ] = useState(undefined);
useEffect(()=>{
getData();
},[])
function getData(){
const url = `/${owner}/${projectsId}/languages.json`;
axios.get(url).then(result=>{
if(result){
let languages = result.data;
if(languages){
let arr = [];
Object.keys(languages).map((item,key)=>{
arr.push({name:item,percent:languages[item],color:getColor()});
})
setArray(arr);
}
}
}).catch(error=>{})
}
// useEffect(()=>{
// if(languages){
// let arr = [];
// Object.keys(languages).map((item,key)=>{
// arr.push({name:item,percent:languages[item],color:getColor()});
// })
// setArray(arr);
// }
// },[languages])
if(languages){
let arr = [];
Object.keys(languages).map((item,key)=>{
arr.push({name:item,percent:languages[item],color:getColor()});
})
setArray(arr);
}
},[languages])
 function getColor(){
let str = "#";
@ -47,9 +24,7 @@ function LanguagePower({owner,projectsId}){
return str;
}
return(
(array && array.length > 0) ?
<div>
<Divider />
<p className="font-16 color-ooo aboutSubTitle">开发语言</p>
<div className="progress">
{
@ -72,7 +47,8 @@ function LanguagePower({owner,projectsId}){
}
</FlexAJ>
}
</div>:""
</div>
)
}
export default LanguagePower;

View File

@ -29,12 +29,12 @@
font-weight: 500;
color: #FFFFFF;
margin-top: 60px;
padding-left: 20px;
}
.markdown-body{
box-shadow: 0px 0px 17px rgba(0,0,0,0.2);
border-radius: 4px;
margin-top: 17px!important;
color: white;
}
.nContent{
padding:20px 34px;

View File

@ -3,41 +3,25 @@ import { Modal , Button } from 'antd';
import './Index.scss';
import '../../css/index.scss';
import RenderHtml from '../../../components/render-html';
// import cookie from 'react-cookies';
import axios from 'axios';
import cookie from 'react-cookies';
function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice}){
function SystemNotice({system_notification,history}){
const [ visible , setVisible ] = useState(false);
useEffect(()=>{
if(system_notification && !system_notification.is_read && showNotice && login){
if(system_notification && !cookie.load('notice_stage')){
setVisible(true);
}
},[system_notification,login])
},[system_notification,history.location])
function sureContinue() {
if(login && ( system_notification && system_notification.id )){
const url = `/users/${login}/system_notification_histories.json`;
axios.post(url,{
system_notification_id:system_notification.id
}).then(result=>{
if(result){
setVisible(false);
hideSystemNotice();
}
}).catch(error=>{})
}else{
setVisible(false);
hideSystemNotice();
}
// cookie.remove('notice_stage');
cookie.remove('notice_stage');
// let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//
// // let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//
// cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" });
let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//
// let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//
cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" });
// setVisible(false);
setVisible(false);
}
return (

View File

@ -23,13 +23,9 @@ $(window).scroll(function () {
function SiderBar() {
const [ data , setData ] = useState([]);
const [ visible , setVisible ] = useState(false);
const [ login , setLogin ]= useState(false);
useEffect(()=>{
getFAQ();
getCurrentUser();
//页面加载完成之后隐藏回到顶点
$(".-task-sidebar .gotop").hide();
},[])
function getFAQ(){
@ -40,19 +36,9 @@ function SiderBar() {
}
}).catch(error=>{})
}
//获取当前登录账号信息->用于建议反馈
function getCurrentUser(){
let url = `/users/get_user_info.json`;
axios.get(url).then((response) => {
if (response && response.data && response.data.login) {
setLogin(response.data.login);
}
}).catch(error=>{})
}
function content(list){
return <div>
<p className="titlecontent">帮助</p>
<ul className="faqUl">
{
list && list.map((i,k)=>{
@ -73,46 +59,31 @@ function SiderBar() {
</ul>
</div>
}
return (
<div className={"-task-sidebar"} >
{/* 平台反馈 */}
<Tooltip title="意见反馈" placement={"left"} overlayClassName="tooltipBox">
<div className="consult">
<a href={login ? `/Gitlink/forgeplus/issues/new?type=feedback`:`/login?go_page=/Gitlink/forgeplus/issues/new?type=feedback`}>
<i className="iconfont icon-yijianfankui2"></i>
</a>
</div>
</Tooltip>
{/* 帮助 */}
<ShareModal visible={visible} urlValue={window.location.href} onCancel={()=>setVisible(false)}/>
{
data && data.length > 0 && (data[0] && data[0].question) ?
<Popover title="帮助" content={content(data)} overlayClassName="helpBox" placement={"left"}>
<Popover content={content(data)} overlayClassName="helpBox" placement={"left"}>
<div className="feedback">
<i className="iconfont icon-bangzhu1 font-22"></i>
<i className="iconfont icon-bangzhu font-22"></i>
</div>
</Popover>
:""
}
{/* 分享 */}
{/* <div className="scan pr" title="">
<span className="inline erweima"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
</div>*/}
<ShareModal visible={visible} urlValue={window.location.href} onCancel={()=>setVisible(false)}/>
<Popover content={shareContent()} overlayClassName="helpBox shareContent" placement={"left"}>
<div className="consult">
<i className="iconfont icon-fenxiang"></i>
<i className="iconfont icon-fenxiang1"></i>
</div>
</Popover>
{/* 返回顶部 */}
<Tooltip title="返回顶部" placement={"left"} overlayClassName="tooltipBox">
<div className="gotop">
<div className="gotop">
<Tooltip title="返回顶部" placement={"right"}>
<a><i className="iconfont icon-huidaodingbu1"></i></a>
</div>
</Tooltip>
</Tooltip>
</div>
</div>
)
}

View File

@ -17,9 +17,9 @@ function SiderBarShareModal({visible,urlValue,onCancel}) {
value={urlValue}
size={200}
fgColor="#000000"
style={{margin:"0 20px 20px"}}
style={{margin:"20px"}}
/>}
<p>打开微信扫一扫点击右上角菜单即可将网页分享至朋友圈</p>
<p>打开微信扫一扫,点击右上角菜单即可将网页分享至朋友圈</p>
</div>
</Modal>
)

View File

@ -5,7 +5,7 @@ const Nav = styled.div`{
background-color:#fff;
padding:20px 30px;
border-bottom:1px solid #eee;
font-size:18px;
font-size:16px;
color:#333;
display:flex;
justify-content: space-between;

View File

@ -7,8 +7,6 @@ export const Banner = styled.div`{
border-bottom:1px solid #eee;
background-color:#fff;
border-radius:5px 5px 0px 0px;
justify-content: space-between;
display: flex;
}`
export const AlignCenterBetween = styled.div`{
display:flex;

View File

@ -36,15 +36,15 @@ function About(props, ref) {
const [ disabled, setDisabled ] = useState(false);
const [ typeFlag, setTypeFlag] = useState(false);
const isPermission = props.projectDetail && props.projectDetail.permission && props.projectDetail.permission!=="Reporter";
const AuthorLogin = props.projectDetail && props.projectDetail.author && props.projectDetail.author.login;
const CurrentLogin = props.current_user && props.current_user.login;
useEffect(()=>{
if(isPermission){
if(CurrentLogin === AuthorLogin){
auth('get');
}else{
setIsSpining(false);
}
},[isPermission,CurrentLogin])
},[AuthorLogin,CurrentLogin])
function auth(type){
const url = `/${owner}/${projectsId}/ci_authorize.json`;
@ -167,17 +167,17 @@ function About(props, ref) {
<img src={activate} alt="" width="250px" />
<P>定义DevOps工作流帮助您检测bug发布代码</P>
{
!isPermission ?
CurrentLogin !== AuthorLogin ?
<div className="noOperation">DevOps开启功能暂未对项目创建者以外的角色开放可以联系项目创建者进行开启开启后便可查看构建信息</div>:""
}
<a href={"https://forum.trustie.net/forums/3110/detail"} target="_blank" style={{ color: "#5091FF"}}>
了解什么是DevOps
</a>
<a href={"https://forum.trustie.net/forums/3080/detail"} target="_blank" style={{ color: "#5091FF"}}>
如何使用引擎Engine功能
如何使用DevOps
</a>
{
isPermission ?
AuthorLogin === CurrentLogin ?
<React.Fragment>
{
step === 0 && !typeFlag ?

View File

@ -1,7 +1,6 @@
import React from 'react';
import { Table , Popconfirm } from 'antd';
import { Link } from 'react-router-dom';
import { turnbar } from "educoder";
// const STATUS = {
// running:"",
@ -11,6 +10,12 @@ import { turnbar } from "educoder";
// killed:"",
// pending:""
// }
function turnbar(str){
if(str && str.length>0 && str.indexOf("/")>-1){
return str.replaceAll('/','%2F');
}
return str;
}
function renderTableStatus(status) {
switch (status) {
case "running":

View File

@ -17,7 +17,7 @@ function Sure({datas , name , saveFunc , sureSubmit , loading}){
return(
<div>
<div style={{padding:"0px 15px 15px 15px"}}>
水线名称{name}
工作流名称{name}
</div>
<div className="editorBody" style={{marginTop:"0px"}}>
<Editors value={value} theme={"vs-grey"} height={"600px"} visible/>

View File

@ -5,7 +5,7 @@ import { AlignCenterBetween , Blueline , FlexAJ } from '../../Component/layout';
function head({manager , parameter}){
return(
<AlignCenterBetween>
<span className="font-20">引擎配置</span>
<span className="font-20">工作流配置</span>
<FlexAJ>
{
parameter && <Blueline onClick={parameter}>参数管理</Blueline>

View File

@ -66,7 +66,7 @@ export default ((props)=>{
{/* 原本的两种合为一个 */}
<Route path="/:owner/:projectsId/devops"
render={
(p) =>{return( p.location && p.location.state && p.location.state.open_devops?<Dispose {...props} {...p}/>:<About {...props} {...p}/>)}
(p) =>{return( p.location.state.open_devops?<Dispose {...props} {...p}/>:<About {...props} {...p}/>)}
}
></Route>
</Switch>

View File

@ -103,7 +103,7 @@ function Params(props){
<New visble={visible} successFunc={successFunc} CancelFunc={CancelFunc} editList={editList}/>
<Banner>
<FlexAJ>
<span className="font-18">引擎 - 参数管理</span>
<span className="font-18">工作流 - 参数管理</span>
<Link to={`/${owner}/${projectsId}/devops`} className="font-14 color-grey-9 ml20">返回</Link>
</FlexAJ>
</Banner>

View File

@ -126,7 +126,7 @@ function Mould(props){
<div>
<New wrappedComponentRef={(f) => childRef.current = f} ref={childRef} visible={visible} onCancel={()=>setVisible(false)} onOk={onOk}></New>
<Banner>
<FlexAJ><span>引擎 - 模板管理</span><Link to={`/${owner}/${projectsId}/devops`} className="font-14 color-grey-9">返回</Link></FlexAJ>
<FlexAJ><span>工作流 - 模板管理</span><Link to={`/${owner}/${projectsId}/devops`} className="font-14 color-grey-9">返回</Link></FlexAJ>
</Banner>
<Div className="disposeList">
<FlexAJ>

View File

@ -5,7 +5,7 @@ import { Menu, Popconfirm } from "antd";
import { TagsLine } from "../Component/OpsStatus";
import { Time } from "../Utils/Time";
import { truncateCommitId } from "../common/util";
import { getImageUrl } from 'educoder';
import { getUrl } from 'educoder';
const SubMenu = Menu.SubMenu;
const Img = styled.img`
@ -70,7 +70,7 @@ export default ({ data, repeatSet , chooseSteps }) => {
<div>
<FlexAJ className="leftheader">
<AlignCenter>
<Img src={getImageUrl(`/${data && data.author && data.author.image_url}`)} />
<Img src={getUrl(`/images/${data && data.author && data.author.image_url}`)} />
{data && data.started &&
<span className="nest">
开始时间<span> {data.started}</span>

View File

@ -12,7 +12,7 @@ function ServiceModal({sureModal}){
<div className="mt30" style={{textAlign:"center"}}>
<Radio.Group value={type} onChange={changeType}>
<Radio value={1}>自有服务器</Radio>
<Radio value={2}>GitLink服务器</Radio>
<Radio value={2}>Trustie服务器</Radio>
</Radio.Group>
<p className="mt30"><Button type="primary" onClick={()=>sureModal(type)}>下一步</Button></p>
</div>

View File

@ -2,84 +2,84 @@ import React, { useState , forwardRef, useEffect } from 'react';
import { Form , Modal , Input , Radio } from 'antd';
import Axios from 'axios';
import CheckProfile from '../Component/ProfileModal/Profile';
function AddProjectModal(props){
const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form;
const [ visible , setVisible ] = useState(false);
useEffect(()=>{
if(!visible){
setFieldsValue({
code:undefined,
role:"developer"
export default Form.create()(
forwardRef((props)=>{
const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form;
const [ visible , setVisible ] = useState(false);
useEffect(()=>{
if(!visible){
setFieldsValue({
code:undefined,
role:"developer"
})
}
},[visible])
function onOk() {
validateFields((error,values)=>{
if(!error){
const url = `/applied_projects.json`;
Axios.post(url,{
applied_project:{
...values
}
}).then(result=>{
if(result && result.data){
setVisible(false);
props.showNotification("申请加入项目成功,等待审核!");
}
}).catch(error=>{})
}
})
}
},[visible])
function onOk() {
validateFields((error,values)=>{
console.log(error)
if(!error){
const url = `/applied_projects.json`;
Axios.post(url,{
applied_project:{
...values
}
}).then(result=>{
if(result && result.data){
setVisible(false);
props.showNotification("申请加入项目成功,等待审核!");
}
}).catch(error=>{})
function checkValue(rule, value, callback){
if(!value){
callback();
}
})
}
function checkValue(rule, value, callback){
if(!value){
callback("请输入6位数的邀请码");
}else{
if(value.length < 6 || value.length > 6){
callback("请输入6位数的邀请码");
}
callback();
}
callback();
}
return(
<React.Fragment>
<Modal
title="加入项目"
width="480px"
visible={visible}
centered={true}
onOk={onOk}
onCancel={()=>setVisible(false)}
>
<Form layout={'inline'} className="inviteForm">
<Form.Item label="项目邀请码">
{getFieldDecorator("code",{
rules:[
{required:true,message:" "},
{validator:checkValue}
]
})(
<Input placeholder="请输入6位项目邀请码" autoComplete={"off"} maxLength={6} style={{width:"300px"}}/>
)}
</Form.Item>
<Form.Item label="选择角色">
{getFieldDecorator("role",{
rules:[{required:true,message:"请选择角色"}]
})(
<Radio.Group>
<Radio value="manager">管理员</Radio>
<Radio value="developer">开发者</Radio>
<Radio value="reporter">报告者</Radio>
</Radio.Group>
)}
</Form.Item>
</Form>
</Modal>
<CheckProfile {...props} sureFunc={()=>setVisible(true)}>加入项目</CheckProfile>
</React.Fragment>
)
}
export default Form.create()(forwardRef(AddProjectModal));
return(
<React.Fragment>
<Modal
title="加入项目"
width="480px"
visible={visible}
centered={true}
onOk={onOk}
onCancel={()=>setVisible(false)}
>
<Form layout={'inline'} className="inviteForm">
<Form.Item label="项目邀请码">
{getFieldDecorator("code",{
rules:[
{required:true,message:"请输入6位项目邀请码"},
{validator:checkValue}
]
})(
<Input placeholder="请输入6位项目邀请码" autoComplete={"off"} maxLength="6" style={{width:"300px"}}/>
)}
</Form.Item>
<Form.Item label="选择角色">
{getFieldDecorator("role",{
rules:[{required:true,message:"请选择角色"}]
})(
<Radio.Group defaultValue={"developer"}>
<Radio value="manager">管理员</Radio>
<Radio value="developer">开发者</Radio>
<Radio value="reporter">报告者</Radio>
</Radio.Group>
)}
</Form.Item>
</Form>
</Modal>
<CheckProfile {...props} sureFunc={()=>setVisible(true)}>加入项目</CheckProfile>
</React.Fragment>
)
})
)

View File

@ -19,45 +19,48 @@ function Footer(){
return(
<div>
<div style={{height:'107px'}}></div>
{value && showhtml(value)}
<div style={{height:"543px"}}></div>
<div className="newFooter edu-txt-center">
{value && showhtml(value)}
{/* <div className="footerInfos">
<ul>
<li>社区</li>
<li><a href={`/`} target="_blank">网站首页</a></li>
<li><a href={`https://www.trustie.net/agreement`} target="_blank">服务协议</a></li>
<li><a href={`https://forum.trustie.net/forums/1168/detail`} target="_blank">帮助中心</a></li>
<li><a href={`https://forum.trustie.net/`} target="_blank">问吧交流</a></li>
<li><a href={`https://www.trustie.net/cooperation`} target="_blank">合作伙伴</a></li>
</ul>
<ul>
<li>支持与服务</li>
<li><a href={`https://forgeplus.trustie.net/docs/api`} target="_blank">API文档</a></li>
<li><a href={`https://forum.trustie.net/forums/1168/detail`} target="_blank">帮助中心</a></li>
<li><a href={`https://git-scm.com`} target="_blank">Git常用命令</a></li>
<li><a href={`https://forum.trustie.net/forums/3080/detail`} target="_blank">DevOps使用文档</a></li>
<li><a href={`https://forgeplus.trustie.net/projects/jasder/forgeplus/tree/master/CHANGELOG.md`} target="_blank">日志更新</a></li>
</ul>
<ul>
<li>合作伙伴</li>
<li><a href={`http://www.sei.pku.edu.cn`} target="_blank">北京大学</a></li>
<li><a href={`http://scse.buaa.edu.cn`} target="_blank">北京航空航天大学</a></li>
<li><a href={`https://www.nju.edu.cn`} target="_blank">南京大学</a></li>
<li><a href={`https://www.xtu.edu.cn`} target="_blank">湘潭大学</a></li>
<li><a href={`http://www.iscas.ac.cn`} target="_blank">ISCAS</a></li>
<li><a href={`https://www.ucloud.cn`} target="_blank">UCloud优刻得</a></li>
<li><a href={`http://www.inforbus.com`} target="_blank">中创软件</a></li>
<li><a href={`https://www.inspur.com`} target="_blank">浪潮集团</a></li>
<li><a href={`http://www.copu.org.cn`} target="_blank">中国开源软件推进联盟</a></li>
<li><a href={`https://www.sjtu.edu.cn`} target="_blank">上海交通大学</a></li>
</ul>
<ul>
<li>合作伙伴</li>
<li><span>热线</span></li>
<li><span>QQ群1071514693</span></li>
</ul>
</div>
<p className="footerCopy">© Copyright 2007~2021 国防科技大学Trustie团队 & IntelliDE <a href="https://beian.miit.gov.cn">湘ICP备 17009477</a></p> */}
</div>
</div>
// {/* <div className="footEdition">
// <div className="footContent">
// <ul className="center">
// <img src={""} alt="Gitlink" height="29px"/>
// <p></p>
// </ul>
// <ul>
// <li className="thehead"></li>
// <li><a href="/"></a></li>
// <li><a href="https://forum.trustie.net/forums/1168/detail"></a></li>
// <li><a href="https://forum.trustie.net/"></a></li>
// <li><a href="https://www.trustie.net/cooperation"></a></li>
// </ul>
// <ul>
// <li className="thehead"></li>
// <li><a href="https://forgeplus.trustie.net/docs/api">API</a></li>
// <li><a href="https://git-scm.com">Git</a></li>
// <li><a href="https://forum.trustie.net/forums/3080/detail">DevOps使</a></li>
// <li><a href='https://www.trustie.net/agreement'></a></li>
// </ul>
// <ul>
// <li className="thehead"></li>
// <li className="theline">
// <div className="mr50">
// <li></li>
// <img src={"Img"} alt=""/>
// </div>
// <div>
// <li>QQ</li>
// <img src={"qqImg"} alt="QQ"/>
// </div>
// </li>
// </ul>
// </div>
// <p className="copyrightDesc">©Copyright 20072021 Gitlink & IntelliDE <br/>ICP 17009477</p>
// </div> */}
)
}
export default Footer;

View File

@ -2,8 +2,7 @@ import React, { Component } from 'react';
import AccountProfile from "../../modules/user/AccountProfile";
import { getImageUrl } from 'educoder'
import axios from 'axios';
import cookie from 'react-cookies';
import { notification , Dropdown ,Popover, Menu,Badge } from 'antd';
import { Input , notification , Dropdown ,Popover, Menu,Badge, Button } from 'antd';
import { Link } from 'react-router-dom';
import LoginDialog from '../../modules/login/LoginDialog';
@ -15,8 +14,10 @@ import CheckProfile from '../Component/ProfileModal/Profile';
import './header.scss';
import NoticeContent from './NoticeContent';
import MainLogo from './img/logo.png';
const $ = window.$
// TODO 这部分脚本从公共脚本中直接调用
const { Search } = Input;
let old_url;
window._header_componentHandler = null;
// 非trustie链接则新开页跳转
@ -42,8 +43,8 @@ class NewHeader extends Component {
setevaluatinghides: false,
occupation: 0,
mydisplay: false,
// headtypesonClickbool: false,
// headtypess: "/",
headtypesonClickbool: false,
headtypess: "/",
settings: null,
visiblemyss: false,
openSearch:false,
@ -54,6 +55,28 @@ class NewHeader extends Component {
this.geturlsdata();
window._header_componentHandler = this;
//下拉框的显示隐藏
var hoverTimeout;
var hoveredPanel;
$(".edu-menu-panel").hover(function () {
if (hoverTimeout) { // 一次只显示一个panel
if (hoveredPanel && hoveredPanel !== this) {
$(hoveredPanel).find(".edu-menu-list").hide()
}
clearTimeout(hoverTimeout);
hoverTimeout = null;
}
hoveredPanel = this;
$(this).find(".edu-menu-list").show();
}, function () {
var that = this;
// 延迟hide
hoverTimeout = setTimeout(function () {
$(that).find(".edu-menu-list").hide();
}, 800)
});
//获取游览器地址
try {
window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href))
} catch (e) {}
@ -75,17 +98,11 @@ class NewHeader extends Component {
educoderlogin = () => {
//登录账号
if(window.location.pathname === "/"){
window.location.href="/login";
}else{
this.setState({
isRender: true
})
}
this.setState({
isRender: true
})
}
educoderloginysl = () => {
//退出账号时清除登录页面的下次自动登录(用户再次打开登录页面时下次自动登录框不勾选)
cookie.remove("autologin");
//退出账号
var url = `/accounts/logout.json`;
axios.get((url)).then((result) => {
@ -137,12 +154,12 @@ class NewHeader extends Component {
AccountProfiletype: false
})
};
// headtypesonClick = (url, bool) => {
// this.setState({
// headtypess: url,
// headtypesonClickbool: bool,
// })
// }
headtypesonClick = (url, bool) => {
this.setState({
headtypess: url,
headtypesonClickbool: bool,
})
}
//获取数据为空的时候
gettablogourlnull = () => {
this.setState({
@ -182,7 +199,7 @@ class NewHeader extends Component {
geturlsdata = () => {
let url = "/setting.json";
axios.get(url).then((response) => {
if (response && response.data && response.data.setting) {
if (response && response.data) {
this.setState({ settings: response.data.setting });
localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
localStorage.setItem('chromesettingresponse', JSON.stringify(response));
@ -196,27 +213,12 @@ class NewHeader extends Component {
matchpaths = (url) => {
const { match } = this.props;
const hostname = window.location.hostname;
const port = window.location.port;
const isDev = window.location.port == 3007;
let isdev2= isDev ?'http://192.168.1.40:3000':`http://${hostname}`;
let str = "";
if(url.indexOf("http")>-1){
if(url.indexOf("https")>-1){
isdev2 = `https://${hostname}`;
if(url){
if (match.path.indexOf(url) > -1) {
return true
}else {
return false
}
if(port){
isdev2 += `:${port}`;
}
str = isdev2+match.path;
}else{
str = match.path;
}
if (url && str === url) {
return true
}else {
return false
}
}
@ -277,18 +279,96 @@ class NewHeader extends Component {
};
render() {
const { resetUserInfo ,showNotification,publicNav} = this.props;
const { match ,resetUserInfo ,showNotification} = this.props;
let current_user = this.props.user;
let {
AccountProfiletype,
user,
isRender,
headtypesonClickbool,
headtypess,
settings,
visible,
} = this.state;
/*用户名称 用户头像url*/
let activeIndex = false;
let activeForums = false;
let activeShixuns = false;
let activePaths = false;
let coursestype = false;
let activePackages = false;
let activeMoopCases = false;
let activeCompetitions = false;
if (match.path === '/forums') {
activeForums = true;
} else if (match.path.startsWith('/shixuns')) {
activeShixuns = true;
} else if (match.path.startsWith('/paths')) {
activePaths = true;
} else if (match.path.startsWith('/courses')) {
coursestype = true;
} else if (match.path.startsWith('/crowdsourcing')) {
activePackages = true;
} else if (match.path.startsWith('/moop_cases')) {
activeMoopCases = true;
} else if (match.path.startsWith('/competitions')) {
activeCompetitions = true;
} else {
activeIndex = true;
}
let headtypes = '/';
if (settings) {
if (settings.navbar) {
if (settings.navbar.length > 0) {
if (match.path === '/') {
if (headtypesonClickbool === false) {
headtypes = undefined;
} else {
headtypes = headtypess;
}
} else {
for (var i = 0; i < settings.navbar.length; i++) {
if (match.path === settings.navbar[i].link) {
headtypes = settings.navbar[i].link;
break;
}
}
}
}
}
}
let shixuntype = false;
let pathstype = false;
let coursestypes = false;
if (this.props && this.props.mygetHelmetapi != null) {
let shixun = "/shixuns";
let paths = "/paths";
let courses = "/courses";
this.props.mygetHelmetapi && this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item, key) => {
var reg = RegExp(item.link);
if (shixun.match(reg)) {
if (item.hidden === true) {
shixuntype = true
}
}
if (paths.match(reg)) {
if (item.hidden === true) {
pathstype = true
}
}
if (courses.match(reg)) {
if (item.hidden === true) {
coursestypes = true
}
}
})
}
let search_url = settings && settings.common && settings.common.search;
return (
<div className={publicNav ? `newHeaders publicNav`:`newHeaders`} id="nHeader">
<div className="newHeaders" id="nHeader">
<div className="headerContent">
{isRender === true ?
<LoginDialog
@ -303,49 +383,42 @@ class NewHeader extends Component {
{...this.props}
{...this.state}
/> : ""}
{/* <div style={{width:"78px"}}>
{
publicNav &&
<a href={'https://www.ccf.org.cn/'} className={"fl"}>
<img src={MainLogo} alt="ccf" />
</a>
}
</div> */}
{
settings && settings.nav_logo_url ?
<a href={settings && settings.new_course.default_url} className={"fl mr50"}>
<img alt="红山开源" className="logoimg" src={getImageUrl(`/${settings.nav_logo_url}`)}></img>
<a href={settings && settings.new_course.default_url} className={"fl mr50"} style={{minWidth:"45px"}}>
<img alt="可控开源社区" className="logoimg" style={{ heigth: "40px" }} src={getImageUrl(`/${settings.nav_logo_url}`)}></img>
</a>
:
""
}
<div id={"head-navpre1"} className={"head-nav pr"}>
<div className="head-nav pr" id={"head-navpre1"}>
{
settings && settings.navbar && settings.navbar.length > 0 ?
<ul id="header-nav">
{
settings.navbar && settings.navbar.map((item, key) => {
var new_link = item.link;
// var user_login = current_user && current_user.login;
var is_hidden = item.hidden;
// if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) {
// if (user_login) {
// if (new_link.indexOf("courses") > -1) {
// new_link = new_link.replace(/courses/g, user_login + "/courses")
// } else if (new_link.indexOf("contests") > -1) {
// new_link = new_link.replace(/contests/g, user_login + "/contests")
// }
// } else {
// is_hidden = true
// }
// }
// if (user_login && (new_link && new_link.indexOf("homes") > -1)) {
// new_link = new_link.replace(/homes/g, user_login + "/user_activities")
// }
var user_login = current_user && current_user.login;
var is_hidden = item.hidden
if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) {
if (user_login) {
if (new_link.indexOf("courses") > -1) {
new_link = new_link.replace(/courses/g, user_login + "/courses")
} else if (new_link.indexOf("contests") > -1) {
new_link = new_link.replace(/contests/g, user_login + "/contests")
}
} else {
is_hidden = true
}
}
if (user_login && (new_link && new_link.indexOf("homes") > -1)) {
new_link = new_link.replace(/homes/g, user_login + "/user_activities")
}
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
var wl = waiLian && waiLian.length>0;
return (
<li key={key} className={`${this.matchpaths(new_link) === true ? 'pr active' : 'pr'}`} style={{display:!is_hidden ? 'flex' : 'none'} }>
<li key={key} onClick={() => this.headtypesonClick(item.link, true)} className={`${this.matchpaths(item.link) === true ? 'pr active' : 'pr'}`} style={!is_hidden ? { display: 'flex' } : { display: 'none' }}>
<a href={new_link} target={wl ? "_self":"_blank"}>{item.name}</a>
</li>
)
@ -360,8 +433,7 @@ class NewHeader extends Component {
{
current_user && (current_user.main_site || current_user.login) && (settings && settings.add && settings.add.length>0)?
<Dropdown overlay={this.addMenu(settings && settings.add)} placement="bottomRight">
{/* <img src={require(`./img/add.png`)} alt="" width="16px" className="mr15 ml30"/> */}
<i className="iconfont icon-tianjiafangda ml15 mr15 color-grey-6 font-18"></i>
<i className="iconfont icon-tianjiafangda color-grey-6 ml30 mr15"></i>
</Dropdown>:""
}
@ -374,10 +446,9 @@ class NewHeader extends Component {
onVisibleChange={this.handleVisibleChange}
destroyTooltipOnHide
>
<Link to={"/settings/notice"} className="message-icon mt3">
<Link to={"/settings/notice"} className="message-icon">
{current_user && <Badge count={current_user.message_unread_total}>
{/* <img src={require(`./img/ring.png`)} alt="" width="16px" className="ml15 mr15"/> */}
<i className="iconfont icon-xiaoxilingdang ml15 mr15 color-grey-6 font-18"></i>
<i className="iconfont icon-xiaoxilingdang color-grey-6 ml15 mr15"></i>
</Badge>}
</Link>
</Popover>
@ -388,12 +459,8 @@ class NewHeader extends Component {
<span className="font-15 ml30">
<a onClick={() => this.educoderlogin()} className="mr5 color-grey-6">登录</a>
{
(settings && settings.common && settings.common.register) ?
publicNav ?
<a href='/register' className="regBtn">立即注册</a>
:
<span><em className="vertical-line"></em><a className="ml5 color-grey-6" href='/register'></a></span>
:""
settings && settings.common && settings.common.register &&
<span><em className="vertical-line"></em><a className="ml5 color-grey-6" href={`${settings.common.register}`} target="_blank"></a></span>
}
</span>
:

View File

@ -23,9 +23,6 @@ function NoticeContent({ visible, showNotification, resetUserInfo, current_user:
const [atPage, setAtPage] = useState(0);
const [atUnreadList, setAtUnreadList] = useState([]);//@
//
const [clickItem, setClickItem] = useState(undefined);
useEffect(() => {
resetUserInfo();
}, [noticeUnreadCount,atUnreadCount]);
@ -153,26 +150,23 @@ function NoticeContent({ visible, showNotification, resetUserInfo, current_user:
function changeReadMark(item) {
if (!clickItem || clickItem.id !== item.id){
if (item.type === "notification") {
let list = noticeUnreadList.slice();
let index = noticeUnreadList.indexOf(item);
if (list[index].status === 1 && noticeUnreadCount > 0) {
setNoticeUnreadCount(noticeUnreadCount - 1);
}
list[index].status = 2;
setNoticeUnreadList(list);
} else if (item.type === "atme") {
let list = atUnreadList.slice();
let index = atUnreadList.indexOf(item);
if (list[index].status === 1 && atUnreadCount > 0) {
setAtUnreadCount(atUnreadCount - 1);
}
list[index].status = 2;
setAtUnreadList(list);
if (item.type === "notification") {
let list = noticeUnreadList.slice();
let index = noticeUnreadList.indexOf(item);
list[index].status = 2;
setNoticeUnreadList(list);
if (noticeUnreadCount > 0) {
setNoticeUnreadCount(noticeUnreadCount - 1);
}
} else if (item.type === "atme") {
let list = atUnreadList.slice();
let index = atUnreadList.indexOf(item);
list[index].status = 2;
setAtUnreadList(list);
if (atUnreadCount > 0) {
setAtUnreadCount(atUnreadCount - 1);
}
}
setClickItem(item);
}
return (
@ -225,12 +219,12 @@ function NoticeContent({ visible, showNotification, resetUserInfo, current_user:
{atUnreadList.map(item => {
return (
<div key={item.id + Math.random()} className="noticeCont-back" onClick={() => { readItem(item) }}>
<div className={`noticeCont ${item.notification_url ? 'pointer' : ''}`}>
<div className="noticeCont">
<span style={{ visibility: item.status === 1 ? 'visible' : 'hidden' }}>
<Badge color="#FA2020" />
</span>
<div className="noticeCont-text">
<span className="content-span atme-cont-span" dangerouslySetInnerHTML={{ __html: item.content }}></span>
<span className="content-span atme-cont-span" dangerouslySetInnerHTML={{ __html: "<b>" + (item.sender ? item.sender.name : '') + "</b>&nbsp;&nbsp;&nbsp;" + item.content + " 中@我" }}></span>
<span className="timeSpan">{item.time_ago}</span>
</div>
</div>

View File

@ -77,7 +77,6 @@
min-width: 1200px;
z-index: 8;
left: 0px;
padding-bottom: 15px;
p {
margin-top: 0;
margin-bottom:0px !important;
@ -128,14 +127,10 @@
width: 110px;
text-align: right;
}
.ant-form-explain{
position: absolute;
}
}
// 右上角小铃铛单独样式
.notice-popover{
z-index: 1000001;
//popover小尖尖
.ant-popover-arrow{
display: none;
@ -185,7 +180,7 @@
.message-icon{
position: relative;
.ant-scroll-number{
// right:12px;
right:12px;
padding: 0 0px;
}
}
@ -268,100 +263,3 @@
.text-center{
text-align: center;
}
.footEdition{
background-color: #171B23;
.footContent{
display: flex;
align-items: flex-start;
padding:86px 0px;
justify-content: space-around;
width: 1200px;
margin:0px auto;
ul{
min-width: 120px;
text-align: left;
margin-right: 80px;
&.center{
text-align: center;
}
&>p{
height: 22px;
font-size: 16px;
font-weight: 400;
color: #FFFFFF;
line-height: 22px;
}
&>img{
width: 100px;
height: 100%;
margin-bottom: 30px;
margin-top: 25px;
border-radius: 10px;
}
li{
height: 20px;
font-size: 14px;
font-weight: 400;
line-height: 20px;
color: #BDC2D1;
margin-bottom: 15px!important;
a{
color: #BDC2D1!important;
&:hover{
text-decoration: underline;
}
}
&.thehead{
height: 25px;
font-size: 18px;
font-weight: 600;
color: #FFFFFF;
line-height: 25px;
margin-bottom: 20px!important;
}
}
.theline{
.imgCon{
width: 90px;
height: 90px;
padding:5px;
border-radius: 4px;
background-color: #fff;
img{
width: 100%;
border-radius: 3px;
}
}
}
}
}
}
.copyrightDesc{
font-size: 12px;
font-weight: 400;
color: #BDC2D1;
line-height: 28px;
padding:15px 0px;
text-align: center;
background-color: #1B212C;
a{
color: #BDC2D1!important;
}
}
.regBtn{
height: 40px;
background: #466AFF;
border-radius: 2px;
display: inline-block;
padding:0px 18px;
margin-left: 20px;
font-size: 14px;
font-weight: 400;
color: #FFFFFF!important;
line-height: 40px;
&:hover{
color: #FFFFFF!important;
background-color: #355CFF;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

View File

@ -11,7 +11,6 @@ import "./css/index.scss";
import Loadable from "react-loadable";
import Loading from "../Loading";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
import Handbook from "./Component/Handbook";
const ProjectNew = Loadable({
@ -23,10 +22,11 @@ const ProjectIndex = Loadable({
loading: Loading,
});
const ProjectHome = Loadable({
loader: () => import("./Main/projecthome/Index"),
loading: Loading,
});
// 项目详情放在用户和组织下作为二级菜单存在
// const ProjectDetail = Loadable({
// loader: () => import("./Main/Detail"),
// loading: Loading,
// });
class Index extends Component {
@ -41,7 +41,6 @@ class Index extends Component {
return (
<div className="newMain clearfix">
<Handbook/>
<Switch {...this.props}>
<Route
path="/projects/:projectsType/new/:OIdentifier"
@ -61,23 +60,23 @@ class Index extends Component {
<ProjectNew {...this.props} {...props} />
)}
></Route>
<Route
path="/projects"
{/* <Route
path="/:owner/:projectsId"
render={(props) => (
<ProjectIndex {...this.props} {...props} />
<ProjectDetail {...this.props} {...props} />
)}
></Route>
></Route> */}
<Route
path="/explore/all"
path="/explore"
render={(props) => (
<ProjectIndex {...this.props} {...props} />
)}
></Route>
<Route
path="/explore"
path="/"
render={(props) => (
<ProjectHome {...this.props} {...props} />
<ProjectIndex {...this.props} {...props} />
)}
></Route>
</Switch>
@ -91,3 +90,10 @@ export default withRouter(
parentSelector: ".newMain",
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index))))
);
// export default withRouter(
// ImageLayerOfCommentHOC({
// imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
// parentSelector: ".newMain",
// })(Index)
// );

View File

@ -1,7 +1,7 @@
import React , { useEffect , useState } from 'react';
import { WhiteBack , Box , LongWidth , ShortWidth , Gap , AlignCenter , FlexAJ } from '../Component/layout';
import { Dropdown , Menu , Divider , Spin, Button , Typography } from 'antd';
import { getImageUrl , turnbar , returnbar } from "educoder";
import { getImageUrl } from "educoder";
import { Link } from 'react-router-dom';
import { truncateCommitId } from "../common/util";
import CloneAddress from '../Branch/CloneAddress';
@ -26,6 +26,20 @@ import RenderHtml from '../../components/render-html';
/**
* projectDetail.type:0是托管项目1是镜像项目2是同步镜像项目(为2时不支持在线创建在线上传在线修改在线删除创建合并请求等功能)
*/
const { Paragraph } = Typography;
function turnbar(str){
if(str && str.length>0 && str.indexOf("/")>-1){
return str.replaceAll('/','%2F');
}
return str;
}
function returnbar(str){
if(str && str.length>0 && str.indexOf("%2F")>-1){
return str.replaceAll('%2F','/');
}
return str;
}
function CoderDepot(props){
const [ projectDetail , setProjectDetail ]= useState(undefined);
const [ inviteCode , setInviteCode ] = useState(undefined);
@ -108,10 +122,13 @@ function CoderDepot(props){
setTreeValue(url);
getFileInfo(url,branchName);
setType("file");
// getReadmeInfo(url,branchName);
// setReadme(undefined);
}else{
setTreeValue(undefined);
getDirInfo(branchName || defaultBranch);
setType("dir");
// getReadmeInfo('', branchName || defaultBranch);
}
}
},[projectsId,owner,pathname,defaultBranch])
@ -121,7 +138,7 @@ function CoderDepot(props){
if(result && result.data){
const release = {
"list":result.data.releases,
"total_count":result.data.releases && result.data.releases.length
"total_count":result.data.releases.length
}
setReleaseVersions(release);
}
@ -152,7 +169,7 @@ function CoderDepot(props){
const url = `/${owner}/${projectsId}/entries.json`;
axios.get(url, {
params: { ref:branch}
params: { ref: branch }
}).then((result) => {
if (result) {
setCommitCount(result.data.commits_count);
@ -180,7 +197,7 @@ function CoderDepot(props){
let ele = document.getElementById("ptxt");
if(ele){
let h = ele.offsetHeight;
if( h > 36 ) setHideBtn(true);
if( h > 35 ) setHideBtn(true);
}
}
},[projectDetail,lastCommit])
@ -222,9 +239,9 @@ function CoderDepot(props){
//
function changeBranch(value){
let checkvalue = value;
let u = `/${owner}/${projectsId}${checkvalue && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`;
props.history.push(u);
let checkvalue = turnbar(value);
let url = `/${owner}/${projectsId}${value && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`;
props.history.push(url);
}
//
@ -262,7 +279,6 @@ function CoderDepot(props){
//
function returnUlr(url){
let enBranch = turnbar(branchName);
setType('dir');
props.history.push(`/${owner}/${projectsId}/tree${enBranch?`/${enBranch}`:""}/${url}`);
}
//
@ -303,16 +319,16 @@ function CoderDepot(props){
const downloadMenu = (
<CloneAddress
http_url={projectDetail && projectDetail.clone_url}
ssh_url = {(projectDetail && props && props.platform) && projectDetail.ssh_url}
zip_url={(props && props.platform) && zip_url}
tar_url={(props && props.platform) && tar_url}
ssh_url = {projectDetail && projectDetail.ssh_url}
zip_url={zip_url}
tar_url={tar_url}
showNotification={props.showNotification}/>
)
// website
function okUpdate(d,w,l){
const url = `/${owner}/${projectsId}.json`;
axios.put(url,{
description:d,website:w || "",lesson_url:l||""
description:d,website:w,lesson_url:l
}).then(result=>{
if(result && result.data && result.data.id){
setDesc(result.data.description);
@ -321,21 +337,12 @@ function CoderDepot(props){
}
})
}
function createIssue(){
if(baseOper){
props.history.push(`/${owner}/${projectsId}/issues/new`);
}else{
props.showLoginDialog(`/${owner}/${projectsId}/issues/new`);
}
}
let n = fileInfo && fileInfo.name;
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
const { current_user } = props;
const baseOper = current_user && current_user.login && issuesFlag;
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type !== 2 && pullsFlag && props.platform;
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type !== 2 && pullsFlag;
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
return(
@ -385,7 +392,7 @@ function CoderDepot(props){
<span>分支<span className="color-grey-6">{branchName || defaultBranch}</span></span>
}
</div>
{
{
treeValuePath && treeValuePath.length > 0 ?
<Path
identifier={projectDetail && projectDetail.identifier}
@ -397,51 +404,34 @@ function CoderDepot(props){
:
<React.Fragment>
<AlignCenter className="mr20">
{
props.platform ?
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
<i className="iconfont icon-master_icon font-16"></i>
<span>分支</span>
<span>{projectDetail && projectDetail.branches_count}</span>
</Link>
:
<span>
<i className="iconfont icon-master_icon font-16 color-grey-6"></i>
<span className="ml3 color-grey-6">分支</span>
<span className="ml3">{projectDetail && projectDetail.branches_count}</span>
</span>
}
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
<i className="iconfont icon-master_icon font-16"></i>
<span>分支</span>
<span>{projectDetail && projectDetail.branches_count}</span>
</Link>
</AlignCenter>
<AlignCenter className="mr20">
{
props.platform ?
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn">
<i className="iconfont icon-biaoqianicon font-16"></i>
<span>标签</span>
<span>{projectDetail && projectDetail.tags_count}</span>
</Link>:
<span>
<i className="iconfont icon-biaoqianicon font-16 color-grey-6"></i>
<span className="ml3 color-grey-6">标签</span>
<span className="ml3">{projectDetail && projectDetail.tags_count}</span>
</span>
}
<i className="iconfont icon-biaoqianicon font-16"></i>
<span>标签</span>
<span>{projectDetail && projectDetail.tags_count}</span>
</Link>
</AlignCenter>
</React.Fragment>
}
</AlignCenter>
<AlignCenter className="depotBtn">
{
(baseOperate || baseOper) &&
<div className="addOptionBtn">
{
baseOperate &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/master...${turnbar(branchName || defaultBranch)}`)} >+ 合并请求</CheckProfile>
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/master...${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile>
}
<a onClick={createIssue}>+ 疑修</a>
{/* {
{
baseOper &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ </CheckProfile>
} */}
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ </CheckProfile>
}
</div>
}
{ fileOperate &&
@ -464,18 +454,12 @@ function CoderDepot(props){
(dirInfo && dirInfo.length>0) || fileInfo ?
<div className="listtable">
{
((lastCommit && lastCommit.message) || lastCommitAuthor) &&
lastCommit &&
<div className="listtablehead">
{
lastCommitAuthor &&
<User url={getImageUrl(`/${lastCommitAuthor.image_url}`)} name={lastCommitAuthor.name} id={lastCommitAuthor.id} login={lastCommitAuthor.login}/>
}
{
lastCommit.message &&
<div className={hideBtn && hide ? "ellipsistxt hidetxt" :"ellipsistxt"}>
<pre id="ptxt"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(lastCommit.sha)}`}><RenderHtml value={lastCommit.message}/></Link></pre>
</div>
}
<User url={getImageUrl(`/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} id={lastCommitAuthor && lastCommitAuthor.id} login={lastCommitAuthor && lastCommitAuthor.login}/>
<div className={hideBtn && hide ? "ellipsistxt hidetxt" :"ellipsistxt"}>
<pre id="ptxt"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(lastCommit.sha)}`}><RenderHtml value={lastCommit.message}/></Link></pre>
</div>
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
<span className="ml20 color-grey-6 font-12 mt3">{lastCommit.time_from_now}</span>
@ -497,7 +481,6 @@ function CoderDepot(props){
item={item}
projectsId={projectsId}
goToSubRoot={goToSubRoot}
platform={props.platform}
/>
)
})
@ -533,10 +516,10 @@ function CoderDepot(props){
<FlexAJ className="font-18 color-ooo mb20" style={{lineHeight:"28px"}}>关于
{
projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner" || projectDetail.permission==="Manager") &&
<i onClick={()=>setOpenModal(true)} className="iconfont icon-a-shezhi color-grey-9 font-15 pointer"></i>
<i onClick={()=>setOpenModal(true)} className="iconfont icon-a-shezhi color-grey-9 font-15"></i>
}
</FlexAJ>
{desc && <p className="font-14 color-grey-3 mb15 task-hide-2" style={{lineHeight:"24px",WebkitLineClamp:"4",textAlign:"justify",wordBreak:"break-all"}} title={desc}>{desc}</p>}
{desc && <p className="font-14 color-grey-3 mb15 task-hide-2" style={{lineHeight:"24px",WebkitLineClamp:"4",textAlign:"justify",wordBreak:"break-all"}}>{desc}</p>}
{
website &&
<div className="color-grey-6 df pinfos mb5">
@ -556,7 +539,7 @@ function CoderDepot(props){
projectDetail && projectDetail.license_name &&
<div className="pinfos">
<i className="iconfont icon-xieyiicon font-16 mr10"></i>
<Link to={`/${owner}/${projectsId}/tree/${turnbar(branchName || defaultBranch)}/LICENSE`} className="color-grey-6">{projectDetail.license_name}</Link>
<Link to={`/${owner}/${projectsId}/tree/${branchName || defaultBranch}/LICENSE`} className="color-grey-6">{projectDetail.license_name}</Link>
</div>
}
</div>
@ -577,7 +560,7 @@ function CoderDepot(props){
}
{/* 发布 */}
{
releaseVersions && props.platform &&
releaseVersions &&
<React.Fragment>
<Divider />
<Releases
@ -590,9 +573,17 @@ function CoderDepot(props){
</React.Fragment>
}
{/* 贡献者 */}
<Contributors owner={owner} projectsId={projectsId} />
{
projectDetail && projectDetail.contributors && projectDetail.contributors.total_count >0 &&
<Contributors contributors={projectDetail.contributors} owner={owner} projectsId={projectsId} />
}
{/* 语言 */}
<LanguagePower owner={owner} projectsId={projectsId}/>
{ projectDetail && projectDetail.languages &&
<React.Fragment>
<Divider />
<LanguagePower languages={projectDetail.languages}/>
</React.Fragment>
}
</Gap>
</ShortWidth>
}

View File

@ -8,18 +8,13 @@ const typeIco = {
"dir":"icon-wenjianjia4 font-15 color-blue_4C"
}
function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId , platform }){
function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){
return(
<li>
<span>
{
(!platform && item.image_type) ?
<span><i className={`iconfont ${typeIco[`${item.type}`]} mr8`}></i>{item.name}</span>
:
<a onClick={()=>goToSubRoot(item.path,item.type,item.name)} className={item.type === "submodule" && "submoduleStyle"}>
<i className={`iconfont ${typeIco[`${item.type}`]} mr8`}></i>{item.name}
</a>
}
<a onClick={()=>goToSubRoot(item.path,item.type,item.name)} className={item.type === "submodule" && "submoduleStyle"}>
<i className={`iconfont ${typeIco[`${item.type}`]} mr8`}></i>{item.name}
</a>
</span>
<span title="init project">
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>

View File

@ -41,7 +41,7 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
return(
<div className="commonBox readBox" id="readme">
<Anchor offsetTop={58}>
<Anchor offsetTop={70} targetOffset={160}>
<div className="commonBox-title boxTitle">
<AlignCenter>
<Dropdown overlay={menu()} trigger={['hover']} overlayClassName="menuslist">

View File

@ -3,10 +3,15 @@ import { Link } from "react-router-dom";
import { Dropdown , Menu , Icon , Tooltip , Spin } from 'antd';
import { truncateCommitId } from '../common/util';
import { getBranch } from '../GetData/getData';
import { turnbar } from "educoder";
import Nodata from '../Nodata';
import './list.scss';
function turnbar(str){
if(str && str.length>0 && str.indexOf("/")>-1){
return str.replaceAll('/','%2F');
}
return str;
}
export default ((props)=>{
const [ data , setData ] =useState(undefined);
const [ isSpin , setIsSpin ] =useState(true);
@ -68,6 +73,7 @@ export default ((props)=>{
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
</Menu>
)
return(
<React.Fragment>
<div className="main">

View File

@ -1,6 +1,6 @@
import React , { Component } from 'react';
import { Spin , Pagination, Timeline } from 'antd';
import { getImageUrl , returnbar } from 'educoder';
import { getImageUrl } from 'educoder';
import { truncateCommitId ,timeFormat } from '../common/util';
import { AlignTop } from '../Component/layout';
import SelectBranch from '../Branch/Select';
@ -15,6 +15,12 @@ import CopyTool from '../Component/CopyTool';
import './tree/Index.scss'
function returnbar(str){
if(str && str.length>0 && str.indexOf("%2F")>-1){
return str.replaceAll('%2F','/');
}
return str;
}
//代码库--提交页面
class CoderRootCommit extends Component{
@ -73,7 +79,7 @@ class CoderRootCommit extends Component{
isSpining:true,
page:realPage
})
this.getCommitList( returnbar(branchName) , realPage , limit );
this.getCommitList( branchName , realPage , limit );
}
getCommitList=(branch , page , limit)=>{
@ -127,7 +133,7 @@ class CoderRootCommit extends Component{
render(){
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
const { projectDetail, commit_class , defaultBranch , platform } = this.props;
const { projectDetail, commit_class , defaultBranch } = this.props;
const { projectsId , owner , branchName } = this.props.match.params;
let branch = returnbar(branchName || defaultBranch);
return(
@ -153,16 +159,7 @@ class CoderRootCommit extends Component{
<div className="commitList-item f-wrap-between">
<div>
<AlignTop>
<div className="commitDesc">
{
platform ?
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="font-14 color-grey-3 font-bd">
<RenderHtml value={item.message}/>
</Link>
:
<RenderHtml value={item.message}/>
}
</div>
<div className="commitDesc"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="font-14 color-grey-3 font-bd"><RenderHtml value={item.message}/></Link></div>
</AlignTop>
<p className="f-wrap-alignCenter mt15 pb5">
<User
@ -179,12 +176,7 @@ class CoderRootCommit extends Component{
<div>
<span className="treecopy-cont shadow">
<img src={Tree} alt="sha" width={"16px"}/>
{
platform ?
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`}>{truncateCommitId(`${item.sha}`)}</Link>
:
<span style={{color:"#466AFF",cursor:"default"}}>{truncateCommitId(`${item.sha}`)}</span>
}
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`}>{truncateCommitId(`${item.sha}`)}</Link>
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`}/>
</span>
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>

View File

@ -1,517 +0,0 @@
import React, { Component } from "react";
import { Menu, Spin } from "antd";
import { getImageUrl } from "educoder";
import { Link } from "react-router-dom";
import './list.css';
import SelectBranch from '../Branch/Select';
import CloneAddress from '../Branch/CloneAddress';
import RootTable from './RootTable';
import CoderRootFileDetail from './CoderRootFileDetail';
import { truncateCommitId } from '../common/util';
import RenderHtml from '../../components/render-html';
import Nodata from '../Nodata';
import { getBranch } from '../GetData/getData';
import axios from "axios";
/**
* address:http和SSHhttp_url(对应git地址)
* filePath:点击目录时当前目录的路径
* subfileType:保存当前点击目录的文件类型显示目录列表时才显示新建文件如果点击的是文件就不显示新建文件按钮
* readMeContent:根目录下面的readme文件内容
*/
function getPathUrl(array,index){
if(array && array.length>0 && index){
let str = "";
for(let i=0;i<index;i++){
str += `/${array[i]}`;
}
return str.substr(1);
}
}
class CoderRootDirectory extends Component {
constructor(props) {
super(props);
this.state = {
address: "http",
filePath: undefined,
subFileType: undefined,
readMeContent: undefined,
readMeFile: undefined,
isSpin: true,
branchList: undefined,
fileDetail: undefined,
branchLastCommit: undefined,
lastCommitAuthor: undefined,
rootList: undefined,
readOnly: true,
zip_url:undefined,
tar_url:undefined,
chooseType:undefined,
md:false,
treeValue:undefined
}
}
changeAddress = (address) => {
this.setState({
address,
});
};
componentDidMount = () => {
this.Init();
this.getBranchs();
};
// 获取分支列表
getBranchs=()=>{
const { projectsId , owner } = this.props.match.params;
axios.get(`/${owner}/${projectsId}/branches.json`).then(result=>{
this.setState({
branchList:result.data
})
}).catch((error)=>{})
}
componentDidUpdate = (prevState) => {
const { location } = this.props;
const prevlocation = prevState && prevState.location;
if (location !== prevlocation) {
this.setState({
isSpin: true,
});
this.Init();
}
};
Init = () => {
let { pathname } = this.props.history.location;
const { branchName , owner , projectsId } = this.props.match.params;
const { defaultBranch } = this.props;
let branch = branchName || defaultBranch;
if (pathname && (pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1)) {
let url = pathname.split(`/tree/${branchName}/`)[1];
this.setState({treeValue:url})
this.getFileDetail(decodeURI(url),branch);
} else {
this.getProjectRoot(branch);
}
};
// 页面地址返回到主目录
returnMain = (branch) => {
const { projectsId , owner , branchName } = this.props.match.params;
this.setState({
readOnly:true,
treeValue:undefined
})
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/tree/${branchName}`:""}`);
this.getProjectRoot(branch);
};
// 获取根目录
getProjectRoot = (branch) => {
const { projectsId , owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/entries.json`;
axios.get(url, { params: { ref: branch } })
.then((result) => {
if (result) {
let last_commit = result.data && result.data.last_commit;
let entries = result.data && result.data.entries;
this.setState({
filePath: undefined,
fileDetail: [],
isSpin: false,
branchLastCommit: last_commit && last_commit.commit,
lastCommitAuthor:
last_commit && (last_commit.author || (last_commit.commit && last_commit.commit.author)),
zip_url: result.data.zip_url,
tar_url: result.data.tar_url
});
if (entries && entries.length > 0) {
this.renderData(entries);
}
this.setState({
rootList: entries,
subFileType: true,
});
}
}).catch((error) => {});
};
ChangeFile = (arr, readOnly) => {
const { projectsId , owner } = this.props.match.params;
//点击直接跳转页面 加载一次路由
this.props.history.push(`/projects/${owner}/${projectsId}/tree/${arr.path}`);
this.setState({
readOnly: readOnly,
chooseType:"file"
});
};
// 获取子目录
getFileDetail = (path, ref) => {
this.setState({
filePath: decodeURI(path),
});
const { projectsId , owner , branchName } = this.props.match.params;
const { chooseType } = this.state;
const url = `/${owner}/${projectsId}/sub_entries.json`;
axios.get(url,{
params:{
filepath:path,
ref:ref || branchName,
type:chooseType
}
}).then((result)=>{
let entries = result.data && result.data.entries;
this.setState({
isSpin:false
})
if(result){
if(entries){
// 返回对象entries.type则是文件类型否则是文件夹
if(entries.type){
this.setState({
fileDetail:[entries],
rootList:[],
subFileType:false
})
}else{
this.setState({
fileDetail:[],
rootList:entries,
branchLastCommit:result.data.last_commit && result.data.last_commit.commit,
lastCommitAuthor:result.data.last_commit && (result.data.last_commit.author || (result.data.last_commit.commit && result.data.last_commit.commit.author))
})
this.renderData(entries);
}
}else{
this.setState({
fileDetail:[],
rootList:[],
isSpin:false,
subFileType:false
})
}
}
})
.catch((error) => {
this.setState({
isSpin:false
})
console.log(error);
});
};
renderData = (data) => {
const rootList = [];
const readMeContent = [];
const readMeFile = [];
data && data.map((item, key) => {
rootList.push({
key,
message: item.commit && item.commit.message,
...item,
});
if (item.is_readme_file) {
readMeContent.push({ ...item });
readMeFile.push({ ...item });
}
});
this.setState({
rootList: rootList,
readMeContent,
readMeFile,
});
};
// 点击跳转到子目录
goToSubRoot=(path,type,filename)=>{
this.setState({
chooseType:type
})
const { projectsId, owner , branchName } = this.props.match.params;
const { defaultBranch } = this.props;
this.props.history.push(`/projects/${owner}/${projectsId}${`/tree/${branchName || defaultBranch}`}${path?`/${path}`:""}`);
if(filename.substring(filename.length - 3) === ".md"){
this.setState({
md:true
})
}else{
this.setState({
md:false
})
}
};
// readme文件内容
renderReadMeContent = (readMeContent, permission) => {
const { fileDetail, readMeFile } = this.state;
if (fileDetail && fileDetail.length !== 0) {
return;
}
if (readMeContent && readMeContent.length > 0) {
return (
<div className="commonBox">
<div className="commonBox-title">
<span className="mr10">
<i className="iconfont icon-wenjian1 font-16 color-grey-9 fl mt3"></i>
</span>
<span className="commonBox-title-read">
{readMeContent[0].name}
</span>
{permission ?
<a
onClick={() => this.ChangeFile(readMeFile[0], false)}
className="ml20 pull-right"
>
<i className="iconfont icon-bianji6 font-16 color-blue"></i>
</a>
:
""
}
</div>
<div className="commonBox-info">
{readMeContent[0].content ?
<RenderHtml className="break_word_comments imageLayerParent" value={readMeContent[0].content} url={this.props.history.location}/>
:
<span>暂无~</span>
}
</div>
</div>
);
}
};
// 选择分支
changeBranch = (value) => {
const { projectsId , owner } = this.props.match.params;
const { treeValue } = this.state;
let url = `/projects/${owner}/${projectsId}${value && `/tree/${value}`}${treeValue ? `/${treeValue}`:""}`;
this.props.history.push(url);
}
// 子目录路径返回链接
returnUlr=(url)=>{
this.setState({
chooseType:"dir",
readOnly:true,
treeValue:url
})
const { projectsId , owner , branchName } = this.props.match.params;
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}/tree/${url}`);
}
onEdit=(readOnly)=>{
this.setState({
readOnly
})
}
downloadUrl = (zip_url,tar_url) => {
return(
<Menu>
{zip_url && (
<Menu.Item>
<a href={zip_url}>ZIP</a>
</Menu.Item>
)}
{tar_url && (
<Menu.Item>
<a href={tar_url}>TAR.GZ</a>
</Menu.Item>
)}
</Menu>
)
}
title = (branchLastCommit,lastCommitAuthor) => {
if (branchLastCommit) {
const { projectsId , owner } = this.props.match.params;
return (
<div className="f-wrap-alignCenter">
{lastCommitAuthor ? (
<React.Fragment>
{lastCommitAuthor.login ? (
<Link
to={`/users/${lastCommitAuthor.login}/projects`}
className="show-user-link"
>
<img
src={getImageUrl(`images/${lastCommitAuthor.image_url}`)}
className="radius mr10"
width="32"
height="32"
alt=""
/>
<span className="mr15">{lastCommitAuthor.name}</span>
</Link>
) : (
<span className="mr15">{lastCommitAuthor.name}</span>
)}
</React.Fragment>
) : (
""
)}
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${branchLastCommit.sha}`)}`} className="color-blue flex-1 hide-1">
{branchLastCommit.message}
</Link>
<span>{branchLastCommit.time_from_now}</span>
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${branchLastCommit.sha}`)}`} className="commitKey">
{truncateCommitId(branchLastCommit.sha)}
</Link>
</div>
);
}else{
return false;
}
}
render(){
const { branchLastCommit , lastCommitAuthor , rootList ,filePath , fileDetail , subFileType , readMeContent, isSpin , zip_url , tar_url , branchList} = this.state;
const { isManager , isDeveloper , projectDetail , platform , defaultBranch } = this.props;
const { projectsId , owner , branchName } = this.props.match.params;
let branch = branchName || defaultBranch;
const columns = [
{
key:"name",
dataIndex: 'name',
width:"30%",
render: (text,item) => (
<a onClick={()=>this.goToSubRoot(item.path,item.type,text)} className="ml12 task-hide" style={{ display: "block", maxWidth: "345px" }}>
<i className={ item.type === "file" ? "iconfont icon-wenjia font-15 color-green-file mr5" : "iconfont icon-wenjianjia1 color-green-file font-15 mr5"}></i>{text}
</a>
),
},
{
key:"message",
dataIndex: "message",
width: "60%",
render: (text, item) =>
item.commit && item.commit.message ?
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit.sha}`)}`} title={item.commit.message} className="task-hide" style={{ display: "block", maxWidth: "670px" }} >
{item.commit.message}
</Link>
: ""
},
{
key:"time_from_now",
dataIndex: "time_from_now",
width: "10%",
className: "edu-txt-right",
render: (text, item) =>
item.commit && item.commit.time_from_now ?
<a title={item.commit.created_at} className="mr12" style={{ cursor: "default", color: "#888" }} >
{item.commit.time_from_now}
</a>
:""
},
];
const urlRoot = filePath === undefined ? "" : `/${filePath}`;
let array = filePath && filePath.split("/");
return (
<Spin spinning={isSpin}>
<div className="main" style={{minHeight:'400px'}}>
<div className="f-wrap-between mb20">
<div className="f-wrap-alignCenter">
{
platform ?
<SelectBranch
repo_id={projectDetail && projectDetail.repo_id}
projectsId={projectsId}
branch={branch}
changeBranch={this.changeBranch}
owner={owner}
history={this.props.history}
branchList={branchList}
></SelectBranch>
:
<span>分支<span className="color-grey-6">master</span></span>
}
{filePath && (
<span className="ml20 font-16">
<a
onClick={() => this.returnMain(branch)}
className="color-blue"
>
{projectDetail && projectDetail.identifier}
</a>
{array &&
array.map((item, key) => {
return (
<React.Fragment>
{
key === array.length-1 ?
<span className="color-grey-6 subFileName" key={key}>{item}</span>
:
<a onClick={()=>this.returnUlr(`${getPathUrl(array,key+1)}`)} className="color-blue subFileName">{item}</a>
}
</React.Fragment>
);
})}
</span>
)}
</div>
<div className="f-wrap-alignCenter">
{subFileType && (projectDetail && parseInt(projectDetail.type)) !== 2 && (isManager || isDeveloper) && platform && (
<div>
<span>
<Link to={`/projects/${owner}/${projectsId}/${branch}/uploadfile${urlRoot}`} >
<span className="color-green mr30">上传文件</span>
</Link>
</span>
<span className="mr30">
<Link
to={`/projects/${owner}/${projectsId}/${branch}/newfile${urlRoot}`}
>
<span className="color-blue">新建文件</span>
</Link>
</span>
</div>
)}
{projectDetail && projectDetail.clone_url && (
<CloneAddress
http_url={projectDetail.clone_url}
downloadUrl={this.downloadUrl(zip_url,tar_url)}
showNotification={this.props.showNotification}
></CloneAddress>
)}
</div>
</div>
{/* 主目录列表 */}
{rootList && rootList.length > 0 && (
<RootTable
columns={columns}
data={rootList}
title={() => this.title(branchLastCommit,lastCommitAuthor)}
></RootTable>
)}
{/* 子目录列表、文件 */}
{fileDetail && fileDetail.length > 0 && (
<CoderRootFileDetail
detail={fileDetail[0]}
{...this.props}
{...this.state}
readOnly={this.state.readOnly}
onEdit={this.onEdit}
currentBranch={branch}
></CoderRootFileDetail>
)}
{
(rootList && rootList.length === 0) && (fileDetail && fileDetail.length === 0) && <Nodata _html="暂未发现文件!"/>
}
{ rootList && this.renderReadMeContent(readMeContent, isManager || isDeveloper)}
</div>
</Spin>
);
}
}
export default CoderRootDirectory;

Some files were not shown because too many files have changed in this diff Show More