Merge pull request '合并最新功能代码' (#206) from jasder/forgeplus-react:master into master
This commit is contained in:
commit
fe2318021e
1190
.idea/workspace.xml
1190
.idea/workspace.xml
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
|
@ -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,
|
||||
|
|
|
@ -1273,7 +1273,7 @@
|
|||
},
|
||||
"babel-cli": {
|
||||
"version": "6.26.0",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-cli/download/babel-cli-6.26.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz",
|
||||
"integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -1296,7 +1296,7 @@
|
|||
"dependencies": {
|
||||
"chokidar": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npm.taobao.org/chokidar/download/chokidar-1.7.0.tgz?cache=0&sync_timestamp=1602585438968&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-1.7.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
|
||||
"integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
|
@ -1314,7 +1314,7 @@
|
|||
},
|
||||
"source-map": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
|
||||
"dev": true
|
||||
}
|
||||
|
@ -1413,7 +1413,7 @@
|
|||
},
|
||||
"babel-helper-bindify-decorators": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-helper-bindify-decorators/download/babel-helper-bindify-decorators-6.24.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz",
|
||||
"integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -1476,7 +1476,7 @@
|
|||
},
|
||||
"babel-helper-explode-class": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-helper-explode-class/download/babel-helper-explode-class-6.24.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz",
|
||||
"integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -1676,7 +1676,7 @@
|
|||
},
|
||||
"babel-plugin-syntax-async-generators": {
|
||||
"version": "6.13.0",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-plugin-syntax-async-generators/download/babel-plugin-syntax-async-generators-6.13.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz",
|
||||
"integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=",
|
||||
"dev": true
|
||||
},
|
||||
|
@ -1687,7 +1687,7 @@
|
|||
},
|
||||
"babel-plugin-syntax-decorators": {
|
||||
"version": "6.13.0",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-plugin-syntax-decorators/download/babel-plugin-syntax-decorators-6.13.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz",
|
||||
"integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=",
|
||||
"dev": true
|
||||
},
|
||||
|
@ -1723,7 +1723,7 @@
|
|||
},
|
||||
"babel-plugin-transform-async-generator-functions": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-plugin-transform-async-generator-functions/download/babel-plugin-transform-async-generator-functions-6.24.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz",
|
||||
"integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -1755,7 +1755,7 @@
|
|||
},
|
||||
"babel-plugin-transform-decorators": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-plugin-transform-decorators/download/babel-plugin-transform-decorators-6.24.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz",
|
||||
"integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -2060,7 +2060,7 @@
|
|||
},
|
||||
"babel-plugin-transform-runtime": {
|
||||
"version": "6.23.0",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-plugin-transform-runtime/download/babel-plugin-transform-runtime-6.23.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz",
|
||||
"integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=",
|
||||
"requires": {
|
||||
"babel-runtime": "^6.22.0"
|
||||
|
@ -2077,7 +2077,7 @@
|
|||
},
|
||||
"babel-polyfill": {
|
||||
"version": "6.26.0",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-polyfill/download/babel-polyfill-6.26.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz",
|
||||
"integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
|
||||
"requires": {
|
||||
"babel-runtime": "^6.26.0",
|
||||
|
@ -2087,7 +2087,7 @@
|
|||
"dependencies": {
|
||||
"regenerator-runtime": {
|
||||
"version": "0.10.5",
|
||||
"resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.10.5.tgz?cache=0&sync_timestamp=1595456367497&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.10.5.tgz",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
|
||||
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
|
||||
}
|
||||
}
|
||||
|
@ -2131,7 +2131,7 @@
|
|||
},
|
||||
"babel-preset-es2015": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-preset-es2015/download/babel-preset-es2015-6.24.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz",
|
||||
"integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -2179,7 +2179,7 @@
|
|||
},
|
||||
"babel-preset-react": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-preset-react/download/babel-preset-react-6.24.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.24.1.tgz",
|
||||
"integrity": "sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A=",
|
||||
"requires": {
|
||||
"babel-plugin-syntax-jsx": "^6.3.13",
|
||||
|
@ -2212,7 +2212,7 @@
|
|||
},
|
||||
"babel-preset-stage-2": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-preset-stage-2/download/babel-preset-stage-2-6.24.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz",
|
||||
"integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -2224,7 +2224,7 @@
|
|||
},
|
||||
"babel-preset-stage-3": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-preset-stage-3/download/babel-preset-stage-3-6.24.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz",
|
||||
"integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -3425,9 +3425,9 @@
|
|||
"integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw=="
|
||||
},
|
||||
"clipboard": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
|
||||
"integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
|
||||
"version": "2.0.8",
|
||||
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.8.tgz",
|
||||
"integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==",
|
||||
"requires": {
|
||||
"good-listener": "^1.2.2",
|
||||
"select": "^1.1.2",
|
||||
|
@ -3507,7 +3507,7 @@
|
|||
},
|
||||
"code-prettify": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npm.taobao.org/code-prettify/download/code-prettify-0.1.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/code-prettify/-/code-prettify-0.1.0.tgz",
|
||||
"integrity": "sha1-RocMyMGlDQm61TmzOpg9vUqjSx4="
|
||||
},
|
||||
"codemirror": {
|
||||
|
@ -3875,6 +3875,52 @@
|
|||
"warning": "^4.0.3"
|
||||
}
|
||||
},
|
||||
"cross-env": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
|
||||
"integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
|
||||
"requires": {
|
||||
"cross-spawn": "^7.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"requires": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
"which": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"path-key": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
||||
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
|
||||
},
|
||||
"shebang-command": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
||||
"requires": {
|
||||
"shebang-regex": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"shebang-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cross-fetch": {
|
||||
"version": "3.1.4",
|
||||
"resolved": "https://registry.nlark.com/cross-fetch/download/cross-fetch-3.1.4.tgz",
|
||||
|
@ -11673,7 +11719,7 @@
|
|||
},
|
||||
"output-file-sync": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npm.taobao.org/output-file-sync/download/output-file-sync-1.1.2.tgz",
|
||||
"resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz",
|
||||
"integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -16586,6 +16632,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"save-dev": {
|
||||
"version": "0.0.1-security",
|
||||
"resolved": "https://registry.npmjs.org/save-dev/-/save-dev-0.0.1-security.tgz",
|
||||
"integrity": "sha512-k6knZTDNK8PKKbIqnvxiOveJinuw2LcQjqDoaorZWP9M5AR2EPsnpDeSbeoZZ0pHr5ze1uoaKdK8NBGQrJ34Uw=="
|
||||
},
|
||||
"sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
|
@ -19100,7 +19151,7 @@
|
|||
},
|
||||
"user-home": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npm.taobao.org/user-home/download/user-home-1.1.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz",
|
||||
"integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=",
|
||||
"dev": true
|
||||
},
|
||||
|
@ -19157,7 +19208,7 @@
|
|||
},
|
||||
"v8flags": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npm.taobao.org/v8flags/download/v8flags-2.1.1.tgz?cache=0&sync_timestamp=1590964281452&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fv8flags%2Fdownload%2Fv8flags-2.1.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz",
|
||||
"integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
|
|
@ -22,10 +22,11 @@
|
|||
"case-sensitive-paths-webpack-plugin": "2.1.1",
|
||||
"chalk": "1.1.3",
|
||||
"classnames": "^2.2.5",
|
||||
"clipboard": "^2.0.6",
|
||||
"clipboard": "^2.0.8",
|
||||
"code-prettify": "^0.1.0",
|
||||
"codemirror": "^5.53.0",
|
||||
"connected-react-router": "4.4.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^3.5.2",
|
||||
"dompurify": "^2.0.15",
|
||||
"dotenv": "4.0.0",
|
||||
|
@ -103,6 +104,7 @@
|
|||
"redux-thunk": "2.3.0",
|
||||
"rsuite": "^4.3.4",
|
||||
"sass-loader": "7.3.1",
|
||||
"save-dev": "0.0.1-security",
|
||||
"scroll-into-view": "^1.14.2",
|
||||
"showdown": "^1.9.1",
|
||||
"showdown-katex": "^0.8.0",
|
||||
|
@ -122,8 +124,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"start": "node --max_old_space_size=15360 scripts/start.js",
|
||||
"build": "NODE_ENV=production node --max_old_space_size=15360 scripts/build.js",
|
||||
"test-build": "NODE_ENV=testBuild node --max_old_space_size=15360 scripts/build.js",
|
||||
"build": "cross-env NODE_ENV=production node --max_old_space_size=15360 scripts/build.js",
|
||||
"test-build": "cross-env NODE_ENV=testBuild node --max_old_space_size=15360 scripts/build.js",
|
||||
"pre-build": "NODE_ENV=preBuild node --max_old_space_size=15360 scripts/build.js",
|
||||
"gen_stats": "NODE_ENV=production webpack --profile --config=./config/webpack.config.prod.js --json > stats.json",
|
||||
"ana": "webpack-bundle-analyzer ./stats.json",
|
||||
|
|
|
@ -114,14 +114,6 @@ a:visited {
|
|||
color: #898989;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #FF7500;
|
||||
}
|
||||
|
||||
a:hover.fa {
|
||||
color: #FF7500;
|
||||
}
|
||||
|
||||
input,
|
||||
textarea,
|
||||
select {
|
||||
|
|
|
@ -97,10 +97,6 @@ a:visited {
|
|||
color: #05101a;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #459be5;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
li {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@charset "utf-8";
|
||||
/* 头部 */
|
||||
.header {
|
||||
width: 100%;
|
||||
|
@ -1271,7 +1272,7 @@ html body {
|
|||
font-size: 14px;
|
||||
line-height: 2.0;
|
||||
background: #fafafa;
|
||||
font-family: "微软雅黑", "宋体";
|
||||
font-family: "Microsoft YaHei", "SimSun";
|
||||
color: #05101a;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
|
@ -1307,6 +1308,7 @@ td,
|
|||
span {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin-bottom: 0px!important;
|
||||
}
|
||||
|
||||
table,
|
||||
|
@ -1363,10 +1365,6 @@ a:visited {
|
|||
color: #05101a;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #459be5;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
li {
|
||||
|
@ -1473,7 +1471,7 @@ a.edu-txt-w80,
|
|||
|
||||
/*隐藏*/
|
||||
.none {
|
||||
display: none
|
||||
display: none!important;
|
||||
}
|
||||
|
||||
.block {
|
||||
|
@ -1522,7 +1520,15 @@ a.edu-txt-w80,
|
|||
.font-16 {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
.weight400{
|
||||
font-weight: 400;
|
||||
}
|
||||
.weight500{
|
||||
font-weight: 500;
|
||||
}
|
||||
.weight{
|
||||
font-weight: bold;
|
||||
}
|
||||
.font-17 {
|
||||
font-size: 17px !important;
|
||||
}
|
||||
|
@ -1542,6 +1548,9 @@ a.edu-txt-w80,
|
|||
.font-25 {
|
||||
font-size: 25px !important;
|
||||
}
|
||||
.font-26 {
|
||||
font-size: 26px !important;
|
||||
}
|
||||
|
||||
.font-24 {
|
||||
font-size: 24px !important;
|
||||
|
@ -1563,6 +1572,9 @@ a.edu-txt-w80,
|
|||
font-size: 36px !important;
|
||||
}
|
||||
|
||||
.font-40 {
|
||||
font-size: 40px !important;
|
||||
}
|
||||
.font-50 {
|
||||
font-size: 50px !important;
|
||||
}
|
||||
|
@ -1748,6 +1760,14 @@ a.decoration {
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.mb12 {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.mb13 {
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
|
||||
.mb14 {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
@ -2436,7 +2456,11 @@ a.hoverLine:hover{
|
|||
|
||||
|
||||
.color-grey-9 {
|
||||
color: #999999 !important;
|
||||
color: #999 !important;
|
||||
}
|
||||
|
||||
a:hover{
|
||||
color: #466AFF !important;
|
||||
}
|
||||
|
||||
.color-grey-98 {
|
||||
|
@ -2471,33 +2495,23 @@ a.hoverLine:hover{
|
|||
a.color-grey-name:hover,
|
||||
a.color-dark:hover,
|
||||
a.color-grey-6:hover,
|
||||
a.color-grey-3:hover {
|
||||
color: #4cacff !important;
|
||||
}
|
||||
|
||||
a.color-grey-9:hover,
|
||||
a.color-grey-8:hover,
|
||||
a.color-grey-c:hover {
|
||||
color: #111C24 !important;
|
||||
a.color-grey-3:hover,a.color-ooo:hover {
|
||||
color: #2A61FF !important;
|
||||
}
|
||||
|
||||
/*蓝色*/
|
||||
.color-blue {
|
||||
color: #4CACFF !important;
|
||||
color: #2A61FF !important;
|
||||
}
|
||||
.color-blue-file {
|
||||
color: #4598FA!important;
|
||||
}
|
||||
/* 绿色 */
|
||||
.color-green-file{
|
||||
color: #28BD6C;
|
||||
}
|
||||
/*主*/
|
||||
.color-blue_4C {
|
||||
color: #4CACFF !important;
|
||||
}
|
||||
|
||||
a.color-blue:hover,
|
||||
a.color-blue_4C:hover {
|
||||
color: #459BE6 !important;
|
||||
}
|
||||
|
||||
/*橙色*/
|
||||
.color-orange {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 2340181 */
|
||||
src: url('iconfont.woff2?t=1627870211301') format('woff2'),
|
||||
url('iconfont.woff?t=1627870211301') format('woff'),
|
||||
url('iconfont.ttf?t=1627870211301') format('truetype');
|
||||
src: url('iconfont.woff2?t=1632964996877') format('woff2'),
|
||||
url('iconfont.woff?t=1632964996877') format('woff'),
|
||||
url('iconfont.ttf?t=1632964996877') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
@ -13,6 +13,322 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-wenjian7:before {
|
||||
content: "\e8e0";
|
||||
}
|
||||
|
||||
.icon-xiangyoujiantou:before {
|
||||
content: "\e8de";
|
||||
}
|
||||
|
||||
.icon-xiangzuojiantou:before {
|
||||
content: "\e8df";
|
||||
}
|
||||
|
||||
.icon-a-liulanicon2x:before {
|
||||
content: "\e8dd";
|
||||
}
|
||||
|
||||
.icon-wenjianicon:before {
|
||||
content: "\e8dc";
|
||||
}
|
||||
|
||||
.icon-a-yuanquan2x:before {
|
||||
content: "\e8db";
|
||||
}
|
||||
|
||||
.icon-xiangmubiaoqian:before {
|
||||
content: "\e8da";
|
||||
}
|
||||
|
||||
.icon-icon:before {
|
||||
content: "\e8ce";
|
||||
}
|
||||
|
||||
.icon-tar:before {
|
||||
content: "\e8cf";
|
||||
}
|
||||
|
||||
.icon-a-fuzhi2:before {
|
||||
content: "\e8d0";
|
||||
}
|
||||
|
||||
.icon-fujian1:before {
|
||||
content: "\e8d1";
|
||||
}
|
||||
|
||||
.icon-a-bianji1:before {
|
||||
content: "\e8d2";
|
||||
}
|
||||
|
||||
.icon-banbenicon:before {
|
||||
content: "\e8d3";
|
||||
}
|
||||
|
||||
.icon-shanchuicon2:before {
|
||||
content: "\e8d4";
|
||||
}
|
||||
|
||||
.icon-a-lajitong_icon3x:before {
|
||||
content: "\e8d5";
|
||||
}
|
||||
|
||||
.icon-xialaanniu2:before {
|
||||
content: "\e8d6";
|
||||
}
|
||||
|
||||
.icon-xiazai-icon:before {
|
||||
content: "\e8d7";
|
||||
}
|
||||
|
||||
.icon-master_icon1:before {
|
||||
content: "\e8d8";
|
||||
}
|
||||
|
||||
.icon-shangchuanicon:before {
|
||||
content: "\e8d9";
|
||||
}
|
||||
|
||||
.icon-gerenziliao1:before {
|
||||
content: "\e8c7";
|
||||
}
|
||||
|
||||
.icon-lichengbeiicon:before {
|
||||
content: "\e885";
|
||||
}
|
||||
|
||||
.icon-cangkushezhiicon:before {
|
||||
content: "\e889";
|
||||
}
|
||||
|
||||
.icon-dongtaiicon:before {
|
||||
content: "\e88a";
|
||||
}
|
||||
|
||||
.icon-gongzuoliuicon:before {
|
||||
content: "\e88b";
|
||||
}
|
||||
|
||||
.icon-yixiuicon1:before {
|
||||
content: "\e89b";
|
||||
}
|
||||
|
||||
.icon-a-wikiicon1:before {
|
||||
content: "\e8c6";
|
||||
}
|
||||
|
||||
.icon-daimakuicon1:before {
|
||||
content: "\e8c5";
|
||||
}
|
||||
|
||||
.icon-wodetongzhi:before {
|
||||
content: "\e8c8";
|
||||
}
|
||||
|
||||
.icon-tongzhiguanli:before {
|
||||
content: "\e8c9";
|
||||
}
|
||||
|
||||
.icon-xuanzhong3:before {
|
||||
content: "\e8ca";
|
||||
}
|
||||
|
||||
.icon-xitongtongzhiicon:before {
|
||||
content: "\e8cb";
|
||||
}
|
||||
|
||||
.icon-xiaoxi2:before {
|
||||
content: "\e8cc";
|
||||
}
|
||||
|
||||
.icon-sshmiyue:before {
|
||||
content: "\e8cd";
|
||||
}
|
||||
|
||||
.icon-gerenziliao:before {
|
||||
content: "\e8c4";
|
||||
}
|
||||
|
||||
.icon-xinshouzhiyin:before {
|
||||
content: "\e8e4";
|
||||
}
|
||||
|
||||
.icon-xinjianxiangmu:before {
|
||||
content: "\e8e6";
|
||||
}
|
||||
|
||||
.icon-jiaruketang1:before {
|
||||
content: "\e8e9";
|
||||
}
|
||||
|
||||
.icon-xiangmugonggao:before {
|
||||
content: "\e8c2";
|
||||
}
|
||||
|
||||
.icon-chengguo:before {
|
||||
content: "\e8c3";
|
||||
}
|
||||
|
||||
.icon-chengjiaogonggao:before {
|
||||
content: "\e8c0";
|
||||
}
|
||||
|
||||
.icon-jishuzichan:before {
|
||||
content: "\e8c1";
|
||||
}
|
||||
|
||||
.icon-feibiaogonggao:before {
|
||||
content: "\e8bc";
|
||||
}
|
||||
|
||||
.icon-zhongbiaogonggao:before {
|
||||
content: "\e8bd";
|
||||
}
|
||||
|
||||
.icon-gengzhenggonggao:before {
|
||||
content: "\e8be";
|
||||
}
|
||||
|
||||
.icon-zhaobiaogonggao:before {
|
||||
content: "\e8bf";
|
||||
}
|
||||
|
||||
.icon-wenjian6:before {
|
||||
content: "\e8ba";
|
||||
}
|
||||
|
||||
.icon-wenjianjia4:before {
|
||||
content: "\e8bb";
|
||||
}
|
||||
|
||||
.icon-quxiaoguanzhu:before {
|
||||
content: "\e89a";
|
||||
}
|
||||
|
||||
.icon-dianzan_icon:before {
|
||||
content: "\e8a2";
|
||||
}
|
||||
|
||||
.icon-wenjian5:before {
|
||||
content: "\e896";
|
||||
}
|
||||
|
||||
.icon-wenjianjia3:before {
|
||||
content: "\e8a9";
|
||||
}
|
||||
|
||||
.icon-fuzhiicon:before {
|
||||
content: "\e886";
|
||||
}
|
||||
|
||||
.icon-zhuye-fill:before {
|
||||
content: "\e876";
|
||||
}
|
||||
|
||||
.icon-daimakuicon:before {
|
||||
content: "\e884";
|
||||
}
|
||||
|
||||
.icon-xinjian2:before {
|
||||
content: "\e8b0";
|
||||
}
|
||||
|
||||
.icon-xieyiicon:before {
|
||||
content: "\e870";
|
||||
}
|
||||
|
||||
.icon-neicunicon:before {
|
||||
content: "\e891";
|
||||
}
|
||||
|
||||
.icon-zishuwenjian_icon:before {
|
||||
content: "\e8a6";
|
||||
}
|
||||
|
||||
.icon-biaoqianicon:before {
|
||||
content: "\e882";
|
||||
}
|
||||
|
||||
.icon-a-bianji:before {
|
||||
content: "\e883";
|
||||
}
|
||||
|
||||
.icon-lianjieicon:before {
|
||||
content: "\e887";
|
||||
}
|
||||
|
||||
.icon-hebingqingqiuicon:before {
|
||||
content: "\e888";
|
||||
}
|
||||
|
||||
.icon-morendianzan_icon:before {
|
||||
content: "\e88e";
|
||||
}
|
||||
|
||||
.icon-muluicon:before {
|
||||
content: "\e894";
|
||||
}
|
||||
|
||||
.icon-a-shezhi:before {
|
||||
content: "\e899";
|
||||
}
|
||||
|
||||
.icon-tijiaoicon:before {
|
||||
content: "\e89e";
|
||||
}
|
||||
|
||||
.icon-morenguanzhu_ICON:before {
|
||||
content: "\e89f";
|
||||
}
|
||||
|
||||
.icon-xialaanniu1:before {
|
||||
content: "\e8a4";
|
||||
}
|
||||
|
||||
.icon-zuohuaicon:before {
|
||||
content: "\e8b5";
|
||||
}
|
||||
|
||||
.icon-master_icon:before {
|
||||
content: "\e8b6";
|
||||
}
|
||||
|
||||
.icon-morenfuke_icon:before {
|
||||
content: "\e8b7";
|
||||
}
|
||||
|
||||
.icon-a-wikiicon:before {
|
||||
content: "\e8b8";
|
||||
}
|
||||
|
||||
.icon-yixiuicon:before {
|
||||
content: "\e8b9";
|
||||
}
|
||||
|
||||
.icon-suofang:before {
|
||||
content: "\e87f";
|
||||
}
|
||||
|
||||
.icon-fangdaicon:before {
|
||||
content: "\e881";
|
||||
}
|
||||
|
||||
.icon-sousuo_icon1:before {
|
||||
content: "\e873";
|
||||
}
|
||||
|
||||
.icon-huanying_icon:before {
|
||||
content: "\e878";
|
||||
}
|
||||
|
||||
.icon-wenjianjia2:before {
|
||||
content: "\e879";
|
||||
}
|
||||
|
||||
.icon-shanchuicon1:before {
|
||||
content: "\e87a";
|
||||
}
|
||||
|
||||
.icon-qingqiuicon:before {
|
||||
content: "\e871";
|
||||
}
|
||||
|
@ -49,22 +365,10 @@
|
|||
content: "\e898";
|
||||
}
|
||||
|
||||
.icon-xialaanniu_icon:before {
|
||||
content: "\e89a";
|
||||
}
|
||||
|
||||
.icon-weixuanzhongqingqiuicon:before {
|
||||
content: "\e89b";
|
||||
}
|
||||
|
||||
.icon-xiezuozheguanliicon:before {
|
||||
content: "\e8a1";
|
||||
}
|
||||
|
||||
.icon-xuanzhongxiangyingicon:before {
|
||||
content: "\e8a2";
|
||||
}
|
||||
|
||||
.icon-xuanzhongfenzhiicon:before {
|
||||
content: "\e8a3";
|
||||
}
|
||||
|
@ -81,18 +385,6 @@
|
|||
content: "\e8af";
|
||||
}
|
||||
|
||||
.icon-xinzengmulu_xuantingicon:before {
|
||||
content: "\e884";
|
||||
}
|
||||
|
||||
.icon-xinzengyemian_morenicon:before {
|
||||
content: "\e885";
|
||||
}
|
||||
|
||||
.icon-zhankai_morenicon:before {
|
||||
content: "\e889";
|
||||
}
|
||||
|
||||
.icon-shanchu_tc_icon:before {
|
||||
content: "\e88c";
|
||||
}
|
||||
|
@ -101,26 +393,14 @@
|
|||
content: "\e88d";
|
||||
}
|
||||
|
||||
.icon-xinzengyemian_shubiaodianjiicon:before {
|
||||
content: "\e88e";
|
||||
}
|
||||
|
||||
.icon-daorumoban_icon:before {
|
||||
content: "\e86f";
|
||||
}
|
||||
|
||||
.icon-daochu_xuanfu:before {
|
||||
content: "\e870";
|
||||
}
|
||||
|
||||
.icon-cuowu:before {
|
||||
content: "\e872";
|
||||
}
|
||||
|
||||
.icon-chenggong1:before {
|
||||
content: "\e873";
|
||||
}
|
||||
|
||||
.icon-gengduo_icon:before {
|
||||
content: "\e874";
|
||||
}
|
||||
|
@ -129,26 +409,10 @@
|
|||
content: "\e875";
|
||||
}
|
||||
|
||||
.icon-fuzhi_icon:before {
|
||||
content: "\e876";
|
||||
}
|
||||
|
||||
.icon-shanchuicon:before {
|
||||
content: "\e877";
|
||||
}
|
||||
|
||||
.icon-a-lajitong_icon3x:before {
|
||||
content: "\e878";
|
||||
}
|
||||
|
||||
.icon-shouqi_morenicon:before {
|
||||
content: "\e879";
|
||||
}
|
||||
|
||||
.icon-huanying_icon:before {
|
||||
content: "\e87a";
|
||||
}
|
||||
|
||||
.icon-sousuo_shanchuicon:before {
|
||||
content: "\e87b";
|
||||
}
|
||||
|
@ -161,22 +425,10 @@
|
|||
content: "\e87e";
|
||||
}
|
||||
|
||||
.icon-wenjianjia_icon:before {
|
||||
content: "\e87f";
|
||||
}
|
||||
|
||||
.icon-xialaanniu:before {
|
||||
content: "\e880";
|
||||
}
|
||||
|
||||
.icon-xinzengmulu_morenicon:before {
|
||||
content: "\e882";
|
||||
}
|
||||
|
||||
.icon-xinzengmulu_shubiaodianjiicon:before {
|
||||
content: "\e883";
|
||||
}
|
||||
|
||||
.icon-erciqueren_icon:before {
|
||||
content: "\e867";
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,559 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "24656750",
|
||||
"name": "文件",
|
||||
"font_class": "wenjian7",
|
||||
"unicode": "e8e0",
|
||||
"unicode_decimal": 59616
|
||||
},
|
||||
{
|
||||
"icon_id": "630094",
|
||||
"name": "向右箭头",
|
||||
"font_class": "xiangyoujiantou",
|
||||
"unicode": "e8de",
|
||||
"unicode_decimal": 59614
|
||||
},
|
||||
{
|
||||
"icon_id": "630095",
|
||||
"name": "向左箭头",
|
||||
"font_class": "xiangzuojiantou",
|
||||
"unicode": "e8df",
|
||||
"unicode_decimal": 59615
|
||||
},
|
||||
{
|
||||
"icon_id": "24600282",
|
||||
"name": "浏览icon@2x",
|
||||
"font_class": "a-liulanicon2x",
|
||||
"unicode": "e8dd",
|
||||
"unicode_decimal": 59613
|
||||
},
|
||||
{
|
||||
"icon_id": "24567893",
|
||||
"name": "文件icon",
|
||||
"font_class": "wenjianicon",
|
||||
"unicode": "e8dc",
|
||||
"unicode_decimal": 59612
|
||||
},
|
||||
{
|
||||
"icon_id": "24527422",
|
||||
"name": "圆圈@2x",
|
||||
"font_class": "a-yuanquan2x",
|
||||
"unicode": "e8db",
|
||||
"unicode_decimal": 59611
|
||||
},
|
||||
{
|
||||
"icon_id": "24378423",
|
||||
"name": "项目标签",
|
||||
"font_class": "xiangmubiaoqian",
|
||||
"unicode": "e8da",
|
||||
"unicode_decimal": 59610
|
||||
},
|
||||
{
|
||||
"icon_id": "24368060",
|
||||
"name": "icon",
|
||||
"font_class": "icon",
|
||||
"unicode": "e8ce",
|
||||
"unicode_decimal": 59598
|
||||
},
|
||||
{
|
||||
"icon_id": "24368061",
|
||||
"name": "tar",
|
||||
"font_class": "tar",
|
||||
"unicode": "e8cf",
|
||||
"unicode_decimal": 59599
|
||||
},
|
||||
{
|
||||
"icon_id": "24289113",
|
||||
"name": "复制 (2)",
|
||||
"font_class": "a-fuzhi2",
|
||||
"unicode": "e8d0",
|
||||
"unicode_decimal": 59600
|
||||
},
|
||||
{
|
||||
"icon_id": "24289114",
|
||||
"name": "附件",
|
||||
"font_class": "fujian1",
|
||||
"unicode": "e8d1",
|
||||
"unicode_decimal": 59601
|
||||
},
|
||||
{
|
||||
"icon_id": "24289115",
|
||||
"name": "编 辑",
|
||||
"font_class": "a-bianji1",
|
||||
"unicode": "e8d2",
|
||||
"unicode_decimal": 59602
|
||||
},
|
||||
{
|
||||
"icon_id": "24289116",
|
||||
"name": "版本icon",
|
||||
"font_class": "banbenicon",
|
||||
"unicode": "e8d3",
|
||||
"unicode_decimal": 59603
|
||||
},
|
||||
{
|
||||
"icon_id": "24289117",
|
||||
"name": "删除icon",
|
||||
"font_class": "shanchuicon2",
|
||||
"unicode": "e8d4",
|
||||
"unicode_decimal": 59604
|
||||
},
|
||||
{
|
||||
"icon_id": "24289118",
|
||||
"name": "垃圾桶_icon@3x",
|
||||
"font_class": "a-lajitong_icon3x",
|
||||
"unicode": "e8d5",
|
||||
"unicode_decimal": 59605
|
||||
},
|
||||
{
|
||||
"icon_id": "24289119",
|
||||
"name": "下拉按钮",
|
||||
"font_class": "xialaanniu2",
|
||||
"unicode": "e8d6",
|
||||
"unicode_decimal": 59606
|
||||
},
|
||||
{
|
||||
"icon_id": "24289120",
|
||||
"name": "下载-icon",
|
||||
"font_class": "xiazai-icon",
|
||||
"unicode": "e8d7",
|
||||
"unicode_decimal": 59607
|
||||
},
|
||||
{
|
||||
"icon_id": "24289121",
|
||||
"name": "master_icon",
|
||||
"font_class": "master_icon1",
|
||||
"unicode": "e8d8",
|
||||
"unicode_decimal": 59608
|
||||
},
|
||||
{
|
||||
"icon_id": "24289122",
|
||||
"name": "上传icon",
|
||||
"font_class": "shangchuanicon",
|
||||
"unicode": "e8d9",
|
||||
"unicode_decimal": 59609
|
||||
},
|
||||
{
|
||||
"icon_id": "24059956",
|
||||
"name": "个人资料",
|
||||
"font_class": "gerenziliao1",
|
||||
"unicode": "e8c7",
|
||||
"unicode_decimal": 59591
|
||||
},
|
||||
{
|
||||
"icon_id": "24059409",
|
||||
"name": "里程碑icon",
|
||||
"font_class": "lichengbeiicon",
|
||||
"unicode": "e885",
|
||||
"unicode_decimal": 59525
|
||||
},
|
||||
{
|
||||
"icon_id": "24059410",
|
||||
"name": "仓库设置icon",
|
||||
"font_class": "cangkushezhiicon",
|
||||
"unicode": "e889",
|
||||
"unicode_decimal": 59529
|
||||
},
|
||||
{
|
||||
"icon_id": "24059411",
|
||||
"name": "动态icon",
|
||||
"font_class": "dongtaiicon",
|
||||
"unicode": "e88a",
|
||||
"unicode_decimal": 59530
|
||||
},
|
||||
{
|
||||
"icon_id": "24059412",
|
||||
"name": "工作流icon",
|
||||
"font_class": "gongzuoliuicon",
|
||||
"unicode": "e88b",
|
||||
"unicode_decimal": 59531
|
||||
},
|
||||
{
|
||||
"icon_id": "24059413",
|
||||
"name": "易修icon",
|
||||
"font_class": "yixiuicon1",
|
||||
"unicode": "e89b",
|
||||
"unicode_decimal": 59547
|
||||
},
|
||||
{
|
||||
"icon_id": "24059414",
|
||||
"name": "wiki icon",
|
||||
"font_class": "a-wikiicon1",
|
||||
"unicode": "e8c6",
|
||||
"unicode_decimal": 59590
|
||||
},
|
||||
{
|
||||
"icon_id": "24047186",
|
||||
"name": "代码库icon",
|
||||
"font_class": "daimakuicon1",
|
||||
"unicode": "e8c5",
|
||||
"unicode_decimal": 59589
|
||||
},
|
||||
{
|
||||
"icon_id": "24047189",
|
||||
"name": "我的通知",
|
||||
"font_class": "wodetongzhi",
|
||||
"unicode": "e8c8",
|
||||
"unicode_decimal": 59592
|
||||
},
|
||||
{
|
||||
"icon_id": "24047190",
|
||||
"name": "通知管理",
|
||||
"font_class": "tongzhiguanli",
|
||||
"unicode": "e8c9",
|
||||
"unicode_decimal": 59593
|
||||
},
|
||||
{
|
||||
"icon_id": "24047191",
|
||||
"name": "选中",
|
||||
"font_class": "xuanzhong3",
|
||||
"unicode": "e8ca",
|
||||
"unicode_decimal": 59594
|
||||
},
|
||||
{
|
||||
"icon_id": "24047192",
|
||||
"name": "系统通知icon",
|
||||
"font_class": "xitongtongzhiicon",
|
||||
"unicode": "e8cb",
|
||||
"unicode_decimal": 59595
|
||||
},
|
||||
{
|
||||
"icon_id": "24047193",
|
||||
"name": "消息",
|
||||
"font_class": "xiaoxi2",
|
||||
"unicode": "e8cc",
|
||||
"unicode_decimal": 59596
|
||||
},
|
||||
{
|
||||
"icon_id": "24047194",
|
||||
"name": "ssh密钥",
|
||||
"font_class": "sshmiyue",
|
||||
"unicode": "e8cd",
|
||||
"unicode_decimal": 59597
|
||||
},
|
||||
{
|
||||
"icon_id": "24014152",
|
||||
"name": "个人资料",
|
||||
"font_class": "gerenziliao",
|
||||
"unicode": "e8c4",
|
||||
"unicode_decimal": 59588
|
||||
},
|
||||
{
|
||||
"icon_id": "23655968",
|
||||
"name": "新手指引",
|
||||
"font_class": "xinshouzhiyin",
|
||||
"unicode": "e8e4",
|
||||
"unicode_decimal": 59620
|
||||
},
|
||||
{
|
||||
"icon_id": "23655969",
|
||||
"name": "新建项目",
|
||||
"font_class": "xinjianxiangmu",
|
||||
"unicode": "e8e6",
|
||||
"unicode_decimal": 59622
|
||||
},
|
||||
{
|
||||
"icon_id": "23658111",
|
||||
"name": "加入课堂",
|
||||
"font_class": "jiaruketang1",
|
||||
"unicode": "e8e9",
|
||||
"unicode_decimal": 59625
|
||||
},
|
||||
{
|
||||
"icon_id": "23791639",
|
||||
"name": "项目公告",
|
||||
"font_class": "xiangmugonggao",
|
||||
"unicode": "e8c2",
|
||||
"unicode_decimal": 59586
|
||||
},
|
||||
{
|
||||
"icon_id": "23791640",
|
||||
"name": "成果",
|
||||
"font_class": "chengguo",
|
||||
"unicode": "e8c3",
|
||||
"unicode_decimal": 59587
|
||||
},
|
||||
{
|
||||
"icon_id": "23791410",
|
||||
"name": "成交公告",
|
||||
"font_class": "chengjiaogonggao",
|
||||
"unicode": "e8c0",
|
||||
"unicode_decimal": 59584
|
||||
},
|
||||
{
|
||||
"icon_id": "23791411",
|
||||
"name": "技术资产",
|
||||
"font_class": "jishuzichan",
|
||||
"unicode": "e8c1",
|
||||
"unicode_decimal": 59585
|
||||
},
|
||||
{
|
||||
"icon_id": "23790928",
|
||||
"name": "废标公告",
|
||||
"font_class": "feibiaogonggao",
|
||||
"unicode": "e8bc",
|
||||
"unicode_decimal": 59580
|
||||
},
|
||||
{
|
||||
"icon_id": "23790929",
|
||||
"name": "中标公告",
|
||||
"font_class": "zhongbiaogonggao",
|
||||
"unicode": "e8bd",
|
||||
"unicode_decimal": 59581
|
||||
},
|
||||
{
|
||||
"icon_id": "23790930",
|
||||
"name": "更正公告",
|
||||
"font_class": "gengzhenggonggao",
|
||||
"unicode": "e8be",
|
||||
"unicode_decimal": 59582
|
||||
},
|
||||
{
|
||||
"icon_id": "23790931",
|
||||
"name": "招标公告",
|
||||
"font_class": "zhaobiaogonggao",
|
||||
"unicode": "e8bf",
|
||||
"unicode_decimal": 59583
|
||||
},
|
||||
{
|
||||
"icon_id": "23732532",
|
||||
"name": "文件",
|
||||
"font_class": "wenjian6",
|
||||
"unicode": "e8ba",
|
||||
"unicode_decimal": 59578
|
||||
},
|
||||
{
|
||||
"icon_id": "23732533",
|
||||
"name": "文件夹",
|
||||
"font_class": "wenjianjia4",
|
||||
"unicode": "e8bb",
|
||||
"unicode_decimal": 59579
|
||||
},
|
||||
{
|
||||
"icon_id": "23642443",
|
||||
"name": "取消关注",
|
||||
"font_class": "quxiaoguanzhu",
|
||||
"unicode": "e89a",
|
||||
"unicode_decimal": 59546
|
||||
},
|
||||
{
|
||||
"icon_id": "23642444",
|
||||
"name": "点赞_icon",
|
||||
"font_class": "dianzan_icon",
|
||||
"unicode": "e8a2",
|
||||
"unicode_decimal": 59554
|
||||
},
|
||||
{
|
||||
"icon_id": "23639530",
|
||||
"name": "文件",
|
||||
"font_class": "wenjian5",
|
||||
"unicode": "e896",
|
||||
"unicode_decimal": 59542
|
||||
},
|
||||
{
|
||||
"icon_id": "23639533",
|
||||
"name": "文件夹",
|
||||
"font_class": "wenjianjia3",
|
||||
"unicode": "e8a9",
|
||||
"unicode_decimal": 59561
|
||||
},
|
||||
{
|
||||
"icon_id": "23639440",
|
||||
"name": "复制icon",
|
||||
"font_class": "fuzhiicon",
|
||||
"unicode": "e886",
|
||||
"unicode_decimal": 59526
|
||||
},
|
||||
{
|
||||
"icon_id": "23639422",
|
||||
"name": "主页-fill",
|
||||
"font_class": "zhuye-fill",
|
||||
"unicode": "e876",
|
||||
"unicode_decimal": 59510
|
||||
},
|
||||
{
|
||||
"icon_id": "23639423",
|
||||
"name": "代码库icon",
|
||||
"font_class": "daimakuicon",
|
||||
"unicode": "e884",
|
||||
"unicode_decimal": 59524
|
||||
},
|
||||
{
|
||||
"icon_id": "23572260",
|
||||
"name": "新建",
|
||||
"font_class": "xinjian2",
|
||||
"unicode": "e8b0",
|
||||
"unicode_decimal": 59568
|
||||
},
|
||||
{
|
||||
"icon_id": "23567674",
|
||||
"name": "协议icon",
|
||||
"font_class": "xieyiicon",
|
||||
"unicode": "e870",
|
||||
"unicode_decimal": 59504
|
||||
},
|
||||
{
|
||||
"icon_id": "23567675",
|
||||
"name": "内存icon",
|
||||
"font_class": "neicunicon",
|
||||
"unicode": "e891",
|
||||
"unicode_decimal": 59537
|
||||
},
|
||||
{
|
||||
"icon_id": "23567676",
|
||||
"name": "自述文件_icon",
|
||||
"font_class": "zishuwenjian_icon",
|
||||
"unicode": "e8a6",
|
||||
"unicode_decimal": 59558
|
||||
},
|
||||
{
|
||||
"icon_id": "23472253",
|
||||
"name": "标签icon",
|
||||
"font_class": "biaoqianicon",
|
||||
"unicode": "e882",
|
||||
"unicode_decimal": 59522
|
||||
},
|
||||
{
|
||||
"icon_id": "23472254",
|
||||
"name": "编 辑",
|
||||
"font_class": "a-bianji",
|
||||
"unicode": "e883",
|
||||
"unicode_decimal": 59523
|
||||
},
|
||||
{
|
||||
"icon_id": "23472258",
|
||||
"name": "链接icon",
|
||||
"font_class": "lianjieicon",
|
||||
"unicode": "e887",
|
||||
"unicode_decimal": 59527
|
||||
},
|
||||
{
|
||||
"icon_id": "23472259",
|
||||
"name": "合并请求icon",
|
||||
"font_class": "hebingqingqiuicon",
|
||||
"unicode": "e888",
|
||||
"unicode_decimal": 59528
|
||||
},
|
||||
{
|
||||
"icon_id": "23472263",
|
||||
"name": "默认点赞_icon",
|
||||
"font_class": "morendianzan_icon",
|
||||
"unicode": "e88e",
|
||||
"unicode_decimal": 59534
|
||||
},
|
||||
{
|
||||
"icon_id": "23472265",
|
||||
"name": "目录icon",
|
||||
"font_class": "muluicon",
|
||||
"unicode": "e894",
|
||||
"unicode_decimal": 59540
|
||||
},
|
||||
{
|
||||
"icon_id": "23472267",
|
||||
"name": "设 置",
|
||||
"font_class": "a-shezhi",
|
||||
"unicode": "e899",
|
||||
"unicode_decimal": 59545
|
||||
},
|
||||
{
|
||||
"icon_id": "23472269",
|
||||
"name": "提交icon",
|
||||
"font_class": "tijiaoicon",
|
||||
"unicode": "e89e",
|
||||
"unicode_decimal": 59550
|
||||
},
|
||||
{
|
||||
"icon_id": "23472270",
|
||||
"name": "默认关注_ICON",
|
||||
"font_class": "morenguanzhu_ICON",
|
||||
"unicode": "e89f",
|
||||
"unicode_decimal": 59551
|
||||
},
|
||||
{
|
||||
"icon_id": "23472272",
|
||||
"name": "下拉按钮",
|
||||
"font_class": "xialaanniu1",
|
||||
"unicode": "e8a4",
|
||||
"unicode_decimal": 59556
|
||||
},
|
||||
{
|
||||
"icon_id": "23472276",
|
||||
"name": "左滑icon",
|
||||
"font_class": "zuohuaicon",
|
||||
"unicode": "e8b5",
|
||||
"unicode_decimal": 59573
|
||||
},
|
||||
{
|
||||
"icon_id": "23472277",
|
||||
"name": "master_icon",
|
||||
"font_class": "master_icon",
|
||||
"unicode": "e8b6",
|
||||
"unicode_decimal": 59574
|
||||
},
|
||||
{
|
||||
"icon_id": "23472278",
|
||||
"name": "默认复刻_icon",
|
||||
"font_class": "morenfuke_icon",
|
||||
"unicode": "e8b7",
|
||||
"unicode_decimal": 59575
|
||||
},
|
||||
{
|
||||
"icon_id": "23472279",
|
||||
"name": "wiki icon",
|
||||
"font_class": "a-wikiicon",
|
||||
"unicode": "e8b8",
|
||||
"unicode_decimal": 59576
|
||||
},
|
||||
{
|
||||
"icon_id": "23472280",
|
||||
"name": "易修icon",
|
||||
"font_class": "yixiuicon",
|
||||
"unicode": "e8b9",
|
||||
"unicode_decimal": 59577
|
||||
},
|
||||
{
|
||||
"icon_id": "23436350",
|
||||
"name": "缩放",
|
||||
"font_class": "suofang",
|
||||
"unicode": "e87f",
|
||||
"unicode_decimal": 59519
|
||||
},
|
||||
{
|
||||
"icon_id": "23436351",
|
||||
"name": "放大icon",
|
||||
"font_class": "fangdaicon",
|
||||
"unicode": "e881",
|
||||
"unicode_decimal": 59521
|
||||
},
|
||||
{
|
||||
"icon_id": "23384231",
|
||||
"name": "搜索_icon",
|
||||
"font_class": "sousuo_icon1",
|
||||
"unicode": "e873",
|
||||
"unicode_decimal": 59507
|
||||
},
|
||||
{
|
||||
"icon_id": "23384232",
|
||||
"name": "欢迎_icon",
|
||||
"font_class": "huanying_icon",
|
||||
"unicode": "e878",
|
||||
"unicode_decimal": 59512
|
||||
},
|
||||
{
|
||||
"icon_id": "23384233",
|
||||
"name": "文件夹",
|
||||
"font_class": "wenjianjia2",
|
||||
"unicode": "e879",
|
||||
"unicode_decimal": 59513
|
||||
},
|
||||
{
|
||||
"icon_id": "23384234",
|
||||
"name": "删除icon",
|
||||
"font_class": "shanchuicon1",
|
||||
"unicode": "e87a",
|
||||
"unicode_decimal": 59514
|
||||
},
|
||||
{
|
||||
"icon_id": "23261798",
|
||||
"name": "请求icon",
|
||||
|
@ -68,20 +621,6 @@
|
|||
"unicode": "e898",
|
||||
"unicode_decimal": 59544
|
||||
},
|
||||
{
|
||||
"icon_id": "23144154",
|
||||
"name": "下拉按钮_icon",
|
||||
"font_class": "xialaanniu_icon",
|
||||
"unicode": "e89a",
|
||||
"unicode_decimal": 59546
|
||||
},
|
||||
{
|
||||
"icon_id": "23144155",
|
||||
"name": "未选中请求icon",
|
||||
"font_class": "weixuanzhongqingqiuicon",
|
||||
"unicode": "e89b",
|
||||
"unicode_decimal": 59547
|
||||
},
|
||||
{
|
||||
"icon_id": "23144158",
|
||||
"name": "协作者管理icon",
|
||||
|
@ -89,13 +628,6 @@
|
|||
"unicode": "e8a1",
|
||||
"unicode_decimal": 59553
|
||||
},
|
||||
{
|
||||
"icon_id": "23144159",
|
||||
"name": "选中响应icon",
|
||||
"font_class": "xuanzhongxiangyingicon",
|
||||
"unicode": "e8a2",
|
||||
"unicode_decimal": 59554
|
||||
},
|
||||
{
|
||||
"icon_id": "23144160",
|
||||
"name": "选中分支icon",
|
||||
|
@ -124,27 +656,6 @@
|
|||
"unicode": "e8af",
|
||||
"unicode_decimal": 59567
|
||||
},
|
||||
{
|
||||
"icon_id": "23046282",
|
||||
"name": "新增目录_悬停icon",
|
||||
"font_class": "xinzengmulu_xuantingicon",
|
||||
"unicode": "e884",
|
||||
"unicode_decimal": 59524
|
||||
},
|
||||
{
|
||||
"icon_id": "23046283",
|
||||
"name": "新增页面_默认icon",
|
||||
"font_class": "xinzengyemian_morenicon",
|
||||
"unicode": "e885",
|
||||
"unicode_decimal": 59525
|
||||
},
|
||||
{
|
||||
"icon_id": "23046287",
|
||||
"name": "展开_默认icon",
|
||||
"font_class": "zhankai_morenicon",
|
||||
"unicode": "e889",
|
||||
"unicode_decimal": 59529
|
||||
},
|
||||
{
|
||||
"icon_id": "23046290",
|
||||
"name": "shanchu_tc_icon",
|
||||
|
@ -159,13 +670,6 @@
|
|||
"unicode": "e88d",
|
||||
"unicode_decimal": 59533
|
||||
},
|
||||
{
|
||||
"icon_id": "23046311",
|
||||
"name": "新增页面_鼠标点击icon",
|
||||
"font_class": "xinzengyemian_shubiaodianjiicon",
|
||||
"unicode": "e88e",
|
||||
"unicode_decimal": 59534
|
||||
},
|
||||
{
|
||||
"icon_id": "23046244",
|
||||
"name": "导入模版_icon",
|
||||
|
@ -173,13 +677,6 @@
|
|||
"unicode": "e86f",
|
||||
"unicode_decimal": 59503
|
||||
},
|
||||
{
|
||||
"icon_id": "23046247",
|
||||
"name": "导出_悬浮",
|
||||
"font_class": "daochu_xuanfu",
|
||||
"unicode": "e870",
|
||||
"unicode_decimal": 59504
|
||||
},
|
||||
{
|
||||
"icon_id": "23046252",
|
||||
"name": "错误",
|
||||
|
@ -187,13 +684,6 @@
|
|||
"unicode": "e872",
|
||||
"unicode_decimal": 59506
|
||||
},
|
||||
{
|
||||
"icon_id": "23046254",
|
||||
"name": "成功",
|
||||
"font_class": "chenggong1",
|
||||
"unicode": "e873",
|
||||
"unicode_decimal": 59507
|
||||
},
|
||||
{
|
||||
"icon_id": "23046255",
|
||||
"name": "更多_icon",
|
||||
|
@ -208,13 +698,6 @@
|
|||
"unicode": "e875",
|
||||
"unicode_decimal": 59509
|
||||
},
|
||||
{
|
||||
"icon_id": "23046262",
|
||||
"name": "复制_icon",
|
||||
"font_class": "fuzhi_icon",
|
||||
"unicode": "e876",
|
||||
"unicode_decimal": 59510
|
||||
},
|
||||
{
|
||||
"icon_id": "23046268",
|
||||
"name": "删除icon",
|
||||
|
@ -222,27 +705,6 @@
|
|||
"unicode": "e877",
|
||||
"unicode_decimal": 59511
|
||||
},
|
||||
{
|
||||
"icon_id": "23046269",
|
||||
"name": "垃圾桶_icon@3x",
|
||||
"font_class": "a-lajitong_icon3x",
|
||||
"unicode": "e878",
|
||||
"unicode_decimal": 59512
|
||||
},
|
||||
{
|
||||
"icon_id": "23046270",
|
||||
"name": "收起_默认icon",
|
||||
"font_class": "shouqi_morenicon",
|
||||
"unicode": "e879",
|
||||
"unicode_decimal": 59513
|
||||
},
|
||||
{
|
||||
"icon_id": "23046271",
|
||||
"name": "欢迎_icon",
|
||||
"font_class": "huanying_icon",
|
||||
"unicode": "e87a",
|
||||
"unicode_decimal": 59514
|
||||
},
|
||||
{
|
||||
"icon_id": "23046273",
|
||||
"name": "搜索_删除icon",
|
||||
|
@ -264,13 +726,6 @@
|
|||
"unicode": "e87e",
|
||||
"unicode_decimal": 59518
|
||||
},
|
||||
{
|
||||
"icon_id": "23046277",
|
||||
"name": "文件夹_icon",
|
||||
"font_class": "wenjianjia_icon",
|
||||
"unicode": "e87f",
|
||||
"unicode_decimal": 59519
|
||||
},
|
||||
{
|
||||
"icon_id": "23046278",
|
||||
"name": "下拉按钮",
|
||||
|
@ -278,20 +733,6 @@
|
|||
"unicode": "e880",
|
||||
"unicode_decimal": 59520
|
||||
},
|
||||
{
|
||||
"icon_id": "23046280",
|
||||
"name": "新增目录_默认icon",
|
||||
"font_class": "xinzengmulu_morenicon",
|
||||
"unicode": "e882",
|
||||
"unicode_decimal": 59522
|
||||
},
|
||||
{
|
||||
"icon_id": "23046281",
|
||||
"name": "新增目录_鼠标点击icon",
|
||||
"font_class": "xinzengmulu_shubiaodianjiicon",
|
||||
"unicode": "e883",
|
||||
"unicode_decimal": 59523
|
||||
},
|
||||
{
|
||||
"icon_id": "22906287",
|
||||
"name": "二次确认_icon",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3319,9 +3319,9 @@
|
|||
text = text.replace(emailReg, function ($1, $2, $3, $4) {
|
||||
return $1.replace(/@/g, "_#_@_#_");
|
||||
});
|
||||
|
||||
// " + editormd.urls.atLinkBase + "" + $2 + "
|
||||
text = text.replace(atLinkReg, function ($1, $2) {
|
||||
return "<a href=\"" + editormd.urls.atLinkBase + "" + $2 + "\" title=\"@" + $2 + "\" class=\"at-link\">" + $1 + "</a>";
|
||||
return "<span title=\"@" + $2 + "\" class=\"at-link\"> " + $1 + " </span>";
|
||||
}).replace(/_#_@_#_/g, "@");
|
||||
}
|
||||
|
||||
|
|
269
src/App.js
269
src/App.js
|
@ -3,7 +3,7 @@ import './App.css';
|
|||
import { ConfigProvider } from 'antd'
|
||||
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
||||
import {
|
||||
BrowserRouter as Router,
|
||||
// BrowserRouter as Router,
|
||||
Route,
|
||||
Switch
|
||||
} from 'react-router-dom';
|
||||
|
@ -19,7 +19,7 @@ import moment from 'moment'
|
|||
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
|
||||
import SiderBar from './forge/Component/SiderBar'
|
||||
|
||||
import { SnackbarHOC } from 'educoder'
|
||||
import { SnackbarHOC } from 'educoder';
|
||||
import { initAxiosInterceptors } from './AppConfig'
|
||||
import { Provider } from 'react-redux';
|
||||
import configureStore from './redux/stores/configureStore';
|
||||
|
@ -39,6 +39,11 @@ const Projects = Loadable({
|
|||
loader: () => import('./forge/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
// forge项目详情
|
||||
const ProjectDetail = Loadable({
|
||||
loader: () => import("./forge/Main/DetailAdaptor"),
|
||||
loading: Loading,
|
||||
});
|
||||
//forge安全设置
|
||||
const Security = Loadable({
|
||||
loader: () => import('./forge/SecuritySetting/Index'),
|
||||
|
@ -82,11 +87,24 @@ const Search = Loadable({
|
|||
loader: () => import('./modules/search/'),
|
||||
loading: Loading,
|
||||
})
|
||||
const WikiPreview = Loadable({
|
||||
loader: () => import('./forge/Wiki/Preview'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
const ProjectIndex = Loadable({
|
||||
loader: () => import("./forge/Index"),
|
||||
loading: Loading,
|
||||
loader: () => import("./forge/Index"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
// const CreateMerge = Loadable({
|
||||
// loader: () => import('./forge/Merge/NewMerge'),
|
||||
// loading: Loading,
|
||||
// })
|
||||
|
||||
// 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。
|
||||
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize"];
|
||||
|
||||
class App extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
@ -96,6 +114,51 @@ class App extends Component {
|
|||
mydisplay: false,
|
||||
occupation: 0,
|
||||
mygetHelmetapi: null,
|
||||
pathType: null,
|
||||
pathName: null,
|
||||
}
|
||||
}
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
initAxiosInterceptors(this.props);
|
||||
let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : '';
|
||||
pathname && this.getPathnameType(pathname);
|
||||
|
||||
// 添加路由监听,决定组织还是个人
|
||||
this.unlisten = this.props.history.listen((location) => {
|
||||
let newPathname = location.pathname.split('/')[1];
|
||||
if (this.state.pathName !== newPathname) {
|
||||
// this.setState({ pathType: '' });
|
||||
newPathname && this.getPathnameType(newPathname);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
// (!keyWord.includes(this.props.location.pathname.split('/')[1])) &&
|
||||
if (nextProps.location.pathname.split('/')[1] !== this.props.location.pathname.split('/')[1] && nextState.pathType === this.state.pathType) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
getPathnameType = (pathname) => {
|
||||
if (!keyWord.includes(pathname)) {
|
||||
let url = `/owners/${pathname}.json`;
|
||||
axios.get(url).then((response) => {
|
||||
if (response && response.status === 200) {
|
||||
this.setState({
|
||||
pathType: response.data.type || '404',
|
||||
pathName: pathname,
|
||||
})
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.setState({
|
||||
pathType: pathname,
|
||||
pathName: pathname,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,13 +178,19 @@ class App extends Component {
|
|||
|
||||
componentDidMount() {
|
||||
document.title = "loading...";
|
||||
initAxiosInterceptors(this.props);
|
||||
|
||||
this.getAppdata();
|
||||
|
||||
window.addEventListener('error', (event) => {
|
||||
const msg = `${event.type}: ${event.message}`;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.unlisten && this.unlisten(); // 执行解绑
|
||||
}
|
||||
|
||||
//修改登录方法
|
||||
Modifyloginvalue = () => {
|
||||
this.setState({
|
||||
|
@ -192,87 +261,139 @@ class App extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { mygetHelmetapi } = this.state;
|
||||
const { mygetHelmetapi, pathType} = this.state;
|
||||
let personal = mygetHelmetapi && mygetHelmetapi.personal;
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<ConfigProvider locale={zhCN}>
|
||||
<MuiThemeProvider theme={theme}>
|
||||
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
|
||||
<SiderBar/>
|
||||
<Router>
|
||||
<Switch>
|
||||
{/*项目*/}
|
||||
<Route
|
||||
path={"/projects/:owner/:projectId/devops/:opsId/detail"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OpsDetail {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
<Route
|
||||
path={"/settings"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Security {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
{/*项目*/}
|
||||
<Route
|
||||
path={"/projects"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Projects {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
<Route
|
||||
path="/register"
|
||||
render={
|
||||
(props) => {
|
||||
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
<SiderBar />
|
||||
{/* <Router> */}
|
||||
<Switch>
|
||||
{/* wiki预览 */}
|
||||
<Route path="/:owner/:projectsId/wiki/preview/:projectName/:projectId" render={
|
||||
(props) => {
|
||||
return (<WikiPreview {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
} />
|
||||
|
||||
{/* 项目PR */}
|
||||
<Route path="/:owner/:projectsId/compare"
|
||||
render={
|
||||
(props) => (<ProjectDetail {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
{/*项目*/}
|
||||
<Route
|
||||
path={"/:owner/:projectId/devops/:opsId/detail"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OpsDetail {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
/>
|
||||
{/*403*/}
|
||||
<Route path="/403" component={Shixunauthority} />
|
||||
}>
|
||||
</Route>
|
||||
<Route
|
||||
path={"/settings"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Security {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
<Route path="/500" component={http500} />
|
||||
<Route path={"/organize"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
{/*404*/}
|
||||
<Route path="/nopage" component={Shixunnopage} />
|
||||
<Route
|
||||
path="/register"
|
||||
render={
|
||||
(props) => {
|
||||
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}
|
||||
/>
|
||||
{/*403*/}
|
||||
<Route path="/403" component={Shixunauthority} />
|
||||
|
||||
{/* 查询 */}
|
||||
<Route path="/search" component={Search} />
|
||||
<Route path="/500" component={http500} />
|
||||
|
||||
{/* 个人主页 */}
|
||||
<Route path="/users/:username"
|
||||
render={
|
||||
(props) => {
|
||||
return (<InfosIndex {...this.props} {...this.state} />)
|
||||
}
|
||||
}></Route>
|
||||
<Route exact path="/"
|
||||
render={
|
||||
(props) => (
|
||||
personal && personal.length > 0 ?
|
||||
<InfosIndex {...this.props} {...props} />
|
||||
:
|
||||
{/*404*/}
|
||||
<Route path="/nopage" component={Shixunnopage} />
|
||||
|
||||
{/* 查询 */}
|
||||
<Route path="/search" component={Search} />
|
||||
|
||||
<Route exact path="/explore"
|
||||
render={
|
||||
(props) => (
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
{/* 组织 */}
|
||||
<Route path={"/organize"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
/>
|
||||
<Route component={Shixunnopage} />
|
||||
</Switch>
|
||||
</Router>
|
||||
}>
|
||||
</Route>
|
||||
|
||||
{/*新建项目等*/}
|
||||
<Route
|
||||
path={"/projects"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Projects {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
{/* 判断为用户/组织,并进入对应页面 */}
|
||||
{
|
||||
pathType === 'User' ?
|
||||
<Route exact path="/:username"
|
||||
render={
|
||||
(props) => {
|
||||
return (<InfosIndex {...this.props} {...this.state} />)
|
||||
}
|
||||
}
|
||||
/> : pathType === 'Organization' ? <Route path={"/:OIdentifier"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route> : pathType === '404' ? <Route component={Shixunnopage} />:
|
||||
<Route exact path="/"
|
||||
render={
|
||||
(props) => (
|
||||
personal && personal.length > 0 ?
|
||||
<InfosIndex {...this.props} {...props} />
|
||||
:
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
// <Route path="/" component={Loading} />
|
||||
// <Route path="/" component={Shixunnopage} />
|
||||
}
|
||||
|
||||
|
||||
|
||||
{/* 个人主页 */}
|
||||
<Route path="/:username"
|
||||
render={
|
||||
(props) => {
|
||||
return (<InfosIndex {...this.props} {...this.state} />)
|
||||
}
|
||||
}></Route>
|
||||
|
||||
|
||||
<Route component={Shixunnopage} />
|
||||
</Switch>
|
||||
{/* </Router> */}
|
||||
</MuiThemeProvider>
|
||||
</ConfigProvider>
|
||||
</Provider>
|
||||
|
|
|
@ -85,7 +85,10 @@ export function initAxiosInterceptors(props) {
|
|||
}
|
||||
|
||||
if (response.data.status === 404) {
|
||||
locationurl('/nopage');
|
||||
let responseURL = response.request ? response.request.responseURL:'';
|
||||
if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 ) {
|
||||
locationurl('/nopage');
|
||||
}
|
||||
}
|
||||
|
||||
if (response.data.status === 500) {
|
||||
|
|
|
@ -195,7 +195,7 @@ class College extends Component {
|
|||
align: 'center',
|
||||
className: "edu-txt-center font-14 maxnamewidth105",
|
||||
render: (text, record) => (
|
||||
<a href={`/users/${record.login}`} title={record.name} target="_blank" className="task-hide maxnamewidth105" style={{
|
||||
<a href={`/${record.login}`} title={record.name} target="_blank" className="task-hide maxnamewidth105" style={{
|
||||
color:'#007bff',
|
||||
|
||||
}}> {
|
||||
|
|
|
@ -218,7 +218,7 @@ a:hover {
|
|||
}
|
||||
|
||||
.color-blue {
|
||||
color: #4CACFF;
|
||||
color: #2A61FF;
|
||||
}
|
||||
|
||||
.color-huang {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import moment from "moment";
|
||||
import { number } from "prop-types";
|
||||
|
||||
// 处理整点 半点
|
||||
// 取传入时间往后的第一个半点
|
||||
|
@ -97,3 +98,41 @@ export function formatDuring(mss){
|
|||
}
|
||||
return days + "天" + hours + "小时" + minutes + "分";
|
||||
}
|
||||
|
||||
/*
|
||||
返回:多久以前
|
||||
backDate:以前的某个日期
|
||||
*/
|
||||
export function timeAgo(backDate) {
|
||||
try {
|
||||
moment(backDate);
|
||||
} catch (e) {
|
||||
return '刚刚';
|
||||
}
|
||||
if(typeof backDate ==='number'){
|
||||
backDate=backDate*1000
|
||||
}else{
|
||||
backDate= moment(backDate);
|
||||
}
|
||||
let time = new Date() - backDate;
|
||||
var days = Math.floor(time / (1000 * 60 * 60 * 24));
|
||||
var hours = Math.floor((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
||||
var minutes = Math.floor((time % (1000 * 60 * 60)) / (1000 * 60));
|
||||
var seconds = Math.floor((time % (1000 * 60 * 60)) / 1000);
|
||||
if (time <= 0) {
|
||||
return "刚刚";
|
||||
}
|
||||
if (days) {
|
||||
return days + "天前";
|
||||
}
|
||||
if (hours) {
|
||||
return hours + "小时前";
|
||||
}
|
||||
if (minutes) {
|
||||
return minutes + "分前";
|
||||
}
|
||||
if (seconds) {
|
||||
return seconds + "秒前";
|
||||
}
|
||||
return "刚刚";
|
||||
}
|
|
@ -69,7 +69,7 @@ export function appendFileSizeToUploadFile(item) {
|
|||
}
|
||||
export function appendFileSizeToUploadFileAll(fileList) {
|
||||
return fileList.map(item => {
|
||||
if (item.name.indexOf(uploadNameSizeSeperator) == -1) {
|
||||
if (item.name.indexOf(uploadNameSizeSeperator) === -1) {
|
||||
return Object.assign({}, item, { name: `${item.name}${uploadNameSizeSeperator}${bytesToSize(item.size)}` })
|
||||
}
|
||||
return item
|
||||
|
|
|
@ -18,6 +18,23 @@ export function getImageUrl(path) {
|
|||
return `${path}`;
|
||||
}
|
||||
|
||||
export function numFormat(num, digits){
|
||||
let d = digits || 1;
|
||||
var si = [
|
||||
{ value: 1, symbol: "" },
|
||||
{ value: 1E3, symbol: "k" },
|
||||
{ value: 1E4, symbol: "W" }
|
||||
];
|
||||
var rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
|
||||
var i;
|
||||
for (i = si.length - 1; i > 0; i--) {
|
||||
if (num >= si[i].value) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (num / si[i].value).toFixed(d).replace(rx, "$1") + si[i].symbol;
|
||||
}
|
||||
|
||||
export function getImage(path) {
|
||||
// https://www.educoder.net
|
||||
// https://testbdweb.trustie.net
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
|
||||
|
||||
export {
|
||||
getUploadLogoActionUrl as getUploadLogoActionUrl,
|
||||
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
|
||||
|
@ -27,7 +27,7 @@ export {
|
|||
markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension,
|
||||
downloadFile, sortDirections, validateLength, mdJSONParse, exportMdtoHtml
|
||||
} from './TextUtil'
|
||||
export { handleDateString, getNextHalfHourOfMoment, formatDuring, formatSeconds } from './DateUtil'
|
||||
export { handleDateString, getNextHalfHourOfMoment, formatDuring, formatSeconds ,timeAgo} from './DateUtil'
|
||||
|
||||
export { configShareForIndex, configShareForPaths, configShareForShixuns, configShareForCourses, configShareForCustom } from './util/ShareUtil'
|
||||
|
||||
|
|
|
@ -435,11 +435,11 @@ class TPIContextProvider extends Component {
|
|||
image_url: "avatars/User/1"
|
||||
login: "innov"
|
||||
name: "Coder"
|
||||
user_url: "/users/innov"
|
||||
user_url: "/innov"
|
||||
*/
|
||||
let user = resData.user;
|
||||
user.username = resData.user.name;
|
||||
user.user_url = `/users/${resData.user.login}`;
|
||||
user.user_url = `/${resData.user.login}`;
|
||||
// user.image_url = resData.image_url;
|
||||
user.is_teacher = resData.is_teacher;
|
||||
resData.user = user;
|
||||
|
|
|
@ -10,6 +10,10 @@ import ActivityItem from './ActivityItem';
|
|||
import axios from 'axios';
|
||||
const LIMIT = 15;
|
||||
const ARRAY = [
|
||||
{
|
||||
id:"",
|
||||
name:'全部'
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
name:'1天'
|
||||
|
@ -32,10 +36,15 @@ class Activity extends Component{
|
|||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
time:'30',
|
||||
time:undefined,
|
||||
type:undefined,
|
||||
state:undefined,
|
||||
page:1,
|
||||
pr_count:undefined,
|
||||
new_pr_count:undefined,
|
||||
close_issues_count:undefined,
|
||||
open_issues_count:undefined,
|
||||
pr_all_count:undefined,issues_count:undefined,
|
||||
|
||||
data:undefined,
|
||||
project_trends:undefined,
|
||||
|
@ -63,8 +72,15 @@ class Activity extends Component{
|
|||
this.setState({
|
||||
data:result.data,
|
||||
project_trends:result.data.project_trends,
|
||||
isSpin:false
|
||||
isSpin:false,
|
||||
pr_count:result.data.pr_count,
|
||||
new_pr_count:result.data.new_pr_count,
|
||||
close_issues_count:result.data.close_issues_count,
|
||||
open_issues_count:result.data.open_issues_count,
|
||||
pr_all_count:result.data.pr_all_count,
|
||||
issues_count:result.data.issues_count,
|
||||
})
|
||||
window.scrollTo(0,0);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
|
@ -74,19 +90,19 @@ class Activity extends Component{
|
|||
// 切换周期
|
||||
changeTime=(e)=>{
|
||||
this.setState({
|
||||
time:e.key,
|
||||
time:e.key ==="item_0"?undefined:e.key,
|
||||
isSpin:true
|
||||
})
|
||||
const { type,status,page } = this.state;
|
||||
this.getInfo(e.key,type,status,page);
|
||||
this.getInfo(e.key ==="item_0"?undefined:e.key,type,status,page);
|
||||
}
|
||||
//筛选
|
||||
changeTrends=(type,status)=>{
|
||||
this.setState({
|
||||
type,status
|
||||
type,status,page:1
|
||||
})
|
||||
const {time,page}=this.state;
|
||||
this.getInfo(time,type,status,page);
|
||||
const {time}=this.state;
|
||||
this.getInfo(time,type,status,1);
|
||||
}
|
||||
// 分页
|
||||
ChangePage=(page)=>{
|
||||
|
@ -108,12 +124,14 @@ class Activity extends Component{
|
|||
</Menu>
|
||||
)
|
||||
render(){
|
||||
const { time , data , page , project_trends , isSpin } = 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:"全部"}];
|
||||
|
||||
let name = time && ARRAY.filter(item=>item.id === parseInt(time)) ;
|
||||
const second_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%';
|
||||
const third_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%';
|
||||
const fourth_per = (parseInt(data && data.open_issues_count)/parseInt(data && data.issues_count)*100)+'%';
|
||||
const first_per = pr_all_count > 0 ? `${parseFloat(pr_count/pr_all_count).toFixed(2)*100}%` :"50%";
|
||||
const second_per =pr_all_count > 0 ? `${parseFloat(new_pr_count/pr_all_count).toFixed(2)*100}%` :"50%";
|
||||
const third_per =issues_count > 0 ?`${parseFloat(close_issues_count/issues_count).toFixed(2)*100}%` :"50%";
|
||||
const fourth_per =issues_count > 0 ?`${parseFloat(open_issues_count/issues_count).toFixed(2)*100}%` :"50%";
|
||||
|
||||
return(
|
||||
<div className="main">
|
||||
|
||||
|
@ -122,7 +140,7 @@ class Activity extends Component{
|
|||
<div className="orderInfo">
|
||||
<div>
|
||||
<div className="percentLine prPercent">
|
||||
<p className="percent_purple" style={{width:'100%'}}></p>
|
||||
<p className="percent_purple" style={{width:first_per}}></p>
|
||||
<p className="percent_green resetStyle" style={{width:`${second_per}`}}></p>
|
||||
</div>
|
||||
<span>{data && data.pr_all_count}合并请求</span>
|
||||
|
@ -132,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="change" onClick={()=>this.changeTrends("PullRequest","close")}>已处理的合并请求</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("PullRequest","delay")}>已处理的合并请求</span>
|
||||
</li>
|
||||
<li>
|
||||
<span className="green">{data && data.new_pr_count}</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("PullRequest","create")}>未处理的合并请求</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("PullRequest","not_delay")}>未处理的合并请求</span>
|
||||
</li>
|
||||
<li>
|
||||
<span className="red">{data && data.close_issues_count}</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("Issue","close")}>已关闭的任务</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("Issue","delay")}>已关闭的易修</span>
|
||||
</li>
|
||||
<li>
|
||||
<span className="green">{data && data.open_issues_count}</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("Issue","create")}>未处理的任务</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("Issue","not_delay")}>未处理的易修</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -14,25 +14,25 @@ class ActivityItem extends Component {
|
|||
{/* 如果是版本发布 */}
|
||||
{item.trend_type === "VersionRelease" ?
|
||||
<p className="itemLine">
|
||||
<Link to={`/projects/${owner}/${projectsId}/version`} className="color-blue 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={`/projects/${owner}/${projectsId}/issues/${item.trend_id}/detail`} className="color-blue 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={`/projects/${owner}/${projectsId}/pulls/${item.trend_id}/Messagecount`} className="color-blue 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 >
|
||||
}
|
||||
<p className="itemLine mt10">
|
||||
<Link to={`/users/${item && item.user_login}`} className="show-user-link">
|
||||
<Link to={`/${item && item.user_login}`} className="show-user-link">
|
||||
<img alt="" src={getImageUrl(`/${item.user_avatar}`)} className="createImage" />
|
||||
<span className="mr20">{item.user_name}</span>
|
||||
</Link>
|
||||
|
|
|
@ -1,28 +1,20 @@
|
|||
import React, { useState } from 'react';
|
||||
import { Dropdown, Menu, Tooltip } from 'antd';
|
||||
import { Menu } from 'antd';
|
||||
import "./branch.scss";
|
||||
import CopyTool from '../Component/CopyTool';
|
||||
|
||||
function CloneAddress({http_url , ssh_url , zip_url , tar_url}) {
|
||||
const [ key , setKey ] = useState("HTTP");
|
||||
// 点击按钮复制功能
|
||||
function jsCopy(){
|
||||
var e = document.getElementById("copy_rep_content");
|
||||
e.select();
|
||||
document.execCommand("Copy");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="downMenu">
|
||||
<div style={{padding:"10px 20px 20px 20px",borderBottom:"1px solid #eee"}}>
|
||||
<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>
|
||||
<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} />
|
||||
<Tooltip title="复制链接">
|
||||
<span className="color-blue" onClick={jsCopy}><i className="iconfont icon-fuzhi"></i></span>
|
||||
</Tooltip>
|
||||
<CopyTool inputId="copy_rep_content" className="copytool"/>
|
||||
</div>
|
||||
</div>
|
||||
<Menu className="edu-txt-center">
|
||||
|
|
|
@ -1,116 +1,65 @@
|
|||
import React , { useState , useEffect } from 'react';
|
||||
import { Popover , Input , Spin } from 'antd';
|
||||
import React , { useState , useEffect , useRef } from 'react';
|
||||
import { Dropdown} from 'antd';
|
||||
import './branch.scss';
|
||||
import { getBranch , getTag } from '../GetData/getData';
|
||||
|
||||
import SelectOverlay from './SelectOverlay';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
|
||||
export default (({ projectsId , branch , owner , changeBranch , branchList , tagflag = true })=>{
|
||||
const [ showValue , setShowValue ] = useState(branch);
|
||||
const [ inputValue , setInputValue] = useState(undefined);
|
||||
const [ nav , setNav ] = useState(0);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const [ flag , setFlag ] = useState(false);
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
|
||||
const [ data , setData ] = useState(undefined);
|
||||
const [ datas , setDatas ] = useState(undefined);
|
||||
const refFa = useRef(null);
|
||||
const refBox = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
document.addEventListener('click', clickMe , false);
|
||||
}, [])
|
||||
|
||||
const clickMe = ({ target }) => {
|
||||
// 查找父组件
|
||||
const faComponent = findDOMNode(refFa.current);
|
||||
const boxComponent = findDOMNode(refBox.current);
|
||||
|
||||
if (faComponent && boxComponent) {
|
||||
const isChild = faComponent.contains(target);
|
||||
const isBox = boxComponent.contains(target);
|
||||
if(!isChild && !isBox){
|
||||
setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
setShowValue(branch);
|
||||
},[branch])
|
||||
|
||||
useEffect(()=>{
|
||||
document.body.addEventListener('click', e => {
|
||||
let name = e.target.className;
|
||||
let turn = name === "ant-input OptionsInput" || name === "navli active"|| name === "navli" || name === "padding10 bor-bottom-greyE";
|
||||
if(turn){
|
||||
return;
|
||||
}else{
|
||||
setFlag(false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
useEffect(()=>{
|
||||
if(branchList){
|
||||
setData(branchList);
|
||||
setDatas(branchList);
|
||||
setIsSpin(false);
|
||||
}
|
||||
},[branchList])
|
||||
|
||||
|
||||
async function getBranchs(id,owner){
|
||||
let result = await getBranch(id,owner);
|
||||
setData(result);
|
||||
setDatas(result);
|
||||
setIsSpin(false);
|
||||
function ChangeB(params) {
|
||||
setVisible(false);
|
||||
changeBranch(params);
|
||||
}
|
||||
async function getTags(id,owner){
|
||||
let result = await getTag(id,owner);
|
||||
setData(result);
|
||||
setDatas(result);
|
||||
setIsSpin(false);
|
||||
}
|
||||
|
||||
function changeInputValue(e){
|
||||
setInputValue(e.target.value);
|
||||
let filter = e.target.value ? data && data.length>0 && data.filter(item=>item.name.indexOf(e.target.value)>-1) : data;
|
||||
setDatas(filter);
|
||||
}
|
||||
|
||||
function changeNav(nav){
|
||||
setNav(nav);
|
||||
setIsSpin(true);
|
||||
if(nav === 0){
|
||||
getBranchs(projectsId,owner);
|
||||
}else{
|
||||
getTags(projectsId,owner);
|
||||
}
|
||||
}
|
||||
function chooseitem(value){
|
||||
// setShowValue(value);
|
||||
changeBranch(value);
|
||||
}
|
||||
|
||||
|
||||
const menu = (
|
||||
<div>
|
||||
<div className="padding10 bor-bottom-greyE">
|
||||
<Input
|
||||
placeholder="请输入分支或标签名称搜索"
|
||||
autocomplete="off" className="OptionsInput" value={inputValue}
|
||||
onChange={changeInputValue} style={{width:"220px"}}
|
||||
/>
|
||||
<ul className="navUl">
|
||||
<li className={nav === 0?"navli active":"navli"} onClick={()=>changeNav(0)}><i className="iconfont icon-fenzhi1 font-14 mr3"></i>分支列表</li>
|
||||
{ tagflag && <li className={nav === 1?"navli active":"navli"} onClick={()=>changeNav(1)}><i className="iconfont icon-biaoqian3 font-14 mr3"></i>标签列表</li> }
|
||||
</ul>
|
||||
</div>
|
||||
<Spin spinning={isSpin}>
|
||||
<ul className="OptionsUl" id="ul-btn">
|
||||
{
|
||||
datas && datas.length>0 ?
|
||||
datas.map((item,key)=>{
|
||||
return(
|
||||
<li key={key} onClick={()=>chooseitem(item.name)}><a className="task-hide ulALink">{item.name}</a></li>
|
||||
)
|
||||
}):
|
||||
<p className="listTips">暂无{inputValue}{nav === 0 ?"分支":"标签"}~</p>
|
||||
}
|
||||
</ul>
|
||||
</Spin>
|
||||
<div ref={refFa}>
|
||||
<SelectOverlay
|
||||
visible={visible}
|
||||
changeBranch={ChangeB}
|
||||
tagflag={tagflag}
|
||||
projectsId={projectsId}
|
||||
owner={owner}
|
||||
branchList={branchList}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
return(
|
||||
<Popover placement='bottomLeft' visible={flag} content={menu} onClick={()=>setFlag(!flag)} overlayClassName="branch-tagBox-list">
|
||||
<div className="branch-tagBox">
|
||||
<Dropdown placement='bottomLeft' visible={visible} overlay={menu} overlayClassName="branch-tagBox-list" trigger={['click']} >
|
||||
<div className="branch-tagBox" ref={refBox} onClick={()=>setVisible(visible ? false : true)}>
|
||||
{/* {nav === 0 ?"分支":"标签"} */}
|
||||
<span className="color-grey-9 mr3 ml8"><i className="iconfont icon-fenzhi2 font-18"></i></span>
|
||||
<a className="ant-dropdown-link">
|
||||
<span className="ant-dropdown-link task-hide" style={{fontWeight:"500",minWidth:"45px",maxWidth:"270px"}}>
|
||||
{showValue}
|
||||
</a>
|
||||
<i className="showtag iconfont icon-xiajiantou font-14 color-grey-9 mr8" />
|
||||
</span>
|
||||
<i className="showtag iconfont icon-sanjiaoxing-down font-15 color-grey-9 mr5 ml5 mt1" />
|
||||
</div>
|
||||
</Popover>
|
||||
</Dropdown>
|
||||
)
|
||||
})
|
|
@ -0,0 +1,90 @@
|
|||
import React , { useState , useEffect } from 'react';
|
||||
import { Input , Spin , Menu } from 'antd';
|
||||
import { getBranch , getTag } from '../GetData/getData';
|
||||
|
||||
function SelectOverlay({ changeBranch , tagflag , projectsId , owner , visible }) {
|
||||
const [ inputValue , setInputValue] = useState(undefined);
|
||||
const [ nav , setNav ] = useState(0);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
|
||||
const [ data , setData ] = useState(undefined);
|
||||
const [ datas , setDatas ] = useState(undefined);
|
||||
const [ keys ,setKeys] = useState("branch");
|
||||
|
||||
useEffect(()=>{
|
||||
if(visible){
|
||||
setKeys("branch");
|
||||
getBranchs(projectsId,owner);
|
||||
setIsSpin(true);
|
||||
}
|
||||
},[visible])
|
||||
|
||||
async function getBranchs(id,owner){
|
||||
let result = await getBranch(id,owner);
|
||||
setData(result);
|
||||
setDatas(result);
|
||||
setIsSpin(false);
|
||||
}
|
||||
async function getTags(id,owner){
|
||||
let result = await getTag(id,owner);
|
||||
setData(result);
|
||||
setDatas(result);
|
||||
setIsSpin(false);
|
||||
}
|
||||
function chooseitem(value){
|
||||
changeBranch(value);
|
||||
}
|
||||
function changeInputValue(e){
|
||||
setInputValue(e.target.value);
|
||||
let filter = e.target.value ? data && data.length>0 && data.filter(item=>item.name.indexOf(e.target.value)>-1) : data;
|
||||
setDatas(filter);
|
||||
}
|
||||
|
||||
function changeNav(e){
|
||||
setKeys(e.key);
|
||||
setIsSpin(true);
|
||||
if(e.key === "branch"){
|
||||
getBranchs(projectsId,owner);
|
||||
setNav(0);
|
||||
}else{
|
||||
getTags(projectsId,owner);
|
||||
setNav(1);
|
||||
}
|
||||
}
|
||||
|
||||
return(
|
||||
<div className="overlayBranch">
|
||||
<div className="padding15" style={{paddingBottom:"0px"}}>
|
||||
<Input
|
||||
prefix={<i className="iconfont icon-sousuo_icon1 font-14"></i>}
|
||||
placeholder={`请输入分支${tagflag ? "或标签" :""}名称搜索`}
|
||||
autocomplete="off" className="OptionsInput"
|
||||
value={inputValue}
|
||||
onChange={changeInputValue}
|
||||
/>
|
||||
</div>
|
||||
<Menu mode="horizontal" className="navUl" selectedKeys={[keys]} onClick={changeNav}>
|
||||
<Menu.Item key={"branch"}>分支</Menu.Item>
|
||||
{ tagflag && <Menu.Item key={"tag"}>标签</Menu.Item> }
|
||||
</Menu>
|
||||
<Spin spinning={isSpin}>
|
||||
<ul className="OptionsUl" id="ul-btn">
|
||||
{
|
||||
datas && datas.length>0 &&
|
||||
datas.map((item,key)=>{
|
||||
return(
|
||||
<li key={key} onClick={()=>chooseitem(item.name)}><a className="task-hide ulALink">{item.name}</a></li>
|
||||
)
|
||||
})
|
||||
|
||||
}
|
||||
{
|
||||
datas && datas.length === 0 &&
|
||||
<p className="listTips">暂无{inputValue}{nav === 0 ?"分支":"标签"}~</p>
|
||||
}
|
||||
</ul>
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default SelectOverlay;
|
|
@ -23,14 +23,16 @@
|
|||
max-height: 300px;
|
||||
}
|
||||
.OptionsUl{
|
||||
min-height: 50px;
|
||||
max-height: 220px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.OptionsUl li{
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
cursor: pointer;
|
||||
padding:0px 10px;
|
||||
padding:0px 20px;
|
||||
margin:5px 0px;
|
||||
}
|
||||
.OptionsUl li:hover{
|
||||
background-color: #F0F0F0;
|
||||
|
@ -45,38 +47,56 @@
|
|||
width: 100%;
|
||||
}
|
||||
.branch-tagBox{
|
||||
border:1px solid #eee;
|
||||
border:1px solid #D0D0D0;
|
||||
border-radius: 3px;
|
||||
height: 40px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
min-width: 140px;
|
||||
min-width: 104px;
|
||||
}
|
||||
.branch-tagBox-list .ant-popover-arrow{
|
||||
display: none;
|
||||
.branch-tagBox:hover{
|
||||
background-color: #F3F4F6;
|
||||
}
|
||||
.branch-tagBox-list.ant-popover.ant-popover-placement-bottom{
|
||||
padding-top:0px;
|
||||
.branch-tagBox-list{
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5);
|
||||
border-radius: 4px;
|
||||
.ant-popover-arrow{
|
||||
display: none;
|
||||
}
|
||||
&.ant-popover.ant-popover-placement-bottom{
|
||||
padding-top:0px;
|
||||
}
|
||||
.branch-tagBox .ant-dropdown-link{
|
||||
display: block;
|
||||
flex:1;
|
||||
max-width: 105px;
|
||||
}
|
||||
.ant-popover-inner-content{
|
||||
padding:0px;
|
||||
}
|
||||
}
|
||||
.branch-tagBox .ant-dropdown-link{
|
||||
display: block;
|
||||
flex:1;
|
||||
}
|
||||
.branch-tagBox-list .ant-popover-inner-content{
|
||||
padding:0px;
|
||||
}
|
||||
.navUl{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.navUl li{
|
||||
cursor: pointer;
|
||||
}
|
||||
.navUl li.active{
|
||||
color:#5091FF;
|
||||
.overlayBranch{
|
||||
width: 325px;
|
||||
.navUl{
|
||||
margin-top: 8px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
li{
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding:0px 5px;
|
||||
margin-left: 20px!important;
|
||||
&.ant-menu-item-selected{
|
||||
border-color:#466aff!important;
|
||||
color:#466aff!important;
|
||||
}
|
||||
&.ant-menu-item-active{
|
||||
border-color:transparent ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.listTips{
|
||||
padding:20px 0px;
|
||||
|
@ -86,6 +106,7 @@
|
|||
.urlMenu{
|
||||
line-height: 30px;
|
||||
margin-bottom: 10px;
|
||||
padding:15px 20px 0px 20px;
|
||||
border-bottom: none;
|
||||
li.ant-menu-item{
|
||||
height: 30px;
|
||||
|
@ -96,10 +117,13 @@
|
|||
color: #333;
|
||||
}
|
||||
&.ant-menu-item-selected{
|
||||
border-color:#1890ff!important;
|
||||
border-color:#466aff!important;
|
||||
}
|
||||
&.ant-menu-item-active{
|
||||
border-color:transparent ;
|
||||
}
|
||||
}
|
||||
}
|
||||
.copytool{
|
||||
margin:0px 10px;
|
||||
}
|
|
@ -55,6 +55,7 @@ function AddGroup({organizeId,getGroupID}){
|
|||
|
||||
function addCollaborator(){
|
||||
getGroupID && getGroupID(id);
|
||||
setID(undefined);
|
||||
}
|
||||
|
||||
return(
|
||||
|
|
|
@ -113,7 +113,14 @@ li.ant-menu-item{
|
|||
z-index: 10000;
|
||||
}
|
||||
.laterest{
|
||||
color: #05690d;
|
||||
background-color: #EF3131;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
margin-left: 10px;
|
||||
padding:0px 5px;
|
||||
border-radius: 2px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1800px){
|
||||
|
@ -155,41 +162,112 @@ li.ant-menu-item{
|
|||
margin:0px 20px!important;
|
||||
}
|
||||
}
|
||||
|
||||
.hoverA{
|
||||
display:flex;
|
||||
align-items: center;
|
||||
max-width: 78px;
|
||||
&:hover a{
|
||||
color:#2A61FF !important ;
|
||||
}
|
||||
}
|
||||
.menuPanels{
|
||||
width: 240px;
|
||||
height: 180px;
|
||||
width: 295px;
|
||||
.leftline{
|
||||
position: relative;
|
||||
color: #666;
|
||||
height: 16px;
|
||||
margin-left: 14px;
|
||||
font-size: 12px;
|
||||
&::before{
|
||||
position: absolute;
|
||||
left: -7px;
|
||||
top:3px;
|
||||
height: 12px;
|
||||
width: 1px;
|
||||
background-color: #999;
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
.ant-btn{
|
||||
height: 36px;
|
||||
line-height: 34px;
|
||||
width: 83px;
|
||||
text-align: center;
|
||||
padding:0px ;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
&.currentBtn{
|
||||
cursor: default;
|
||||
color: #333;
|
||||
&:hover{
|
||||
color: #333;
|
||||
border-color: #d0d0d0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-btn-default{
|
||||
color: #333;
|
||||
border-color: #d0d0d0;
|
||||
&:hover{
|
||||
background: #F3F4F6;
|
||||
}
|
||||
}
|
||||
.ant-btn{
|
||||
width: 102px;
|
||||
height: 32px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.ant-btn-primary{
|
||||
color: #fff;
|
||||
background-color: #466AFF;
|
||||
border:none;
|
||||
&:hover{
|
||||
background-color: rgba(70,106,255,0.85);
|
||||
}
|
||||
}
|
||||
.focusPanelHeadInfo{
|
||||
padding:14px 16px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.ant-popover-content,.ant-popover-inner{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.ant-popover-inner-content{
|
||||
padding:0px;
|
||||
}
|
||||
}
|
||||
.halfs{
|
||||
margin-top: 24px;
|
||||
padding:24px 0px 0px 0px;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
.attrPerson{
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
}
|
||||
.aboutSubTitle{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.menuMaininfos{
|
||||
padding:10px 16px 14px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.menuinfos{
|
||||
padding:15px 0px;
|
||||
padding:10px 20px 16px;
|
||||
&>a{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
border-right: 1px solid #eee;
|
||||
flex: 1;
|
||||
& >span:first-child{
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 22px;
|
||||
}
|
||||
& >span:last-child{
|
||||
color: #666;
|
||||
}
|
||||
&:last-child{
|
||||
border-right: none;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { AlignCenter , FlexAJ } from '../Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Popover , Spin } from 'antd';
|
||||
import { Popover , Spin , Button } from 'antd';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import './Component.scss';
|
||||
import { getUser } from '../GetData/getData';
|
||||
import axios from 'axios';
|
||||
|
||||
function Contributors({contributors,owner,projectsId}){
|
||||
function Contributors({contributors,owner,projectsId,currentLogin}){
|
||||
const [ menuList ,setMenuList ]= useState([]);
|
||||
const [ list , setList ]= useState(undefined);
|
||||
const [ total , setTotal ]= useState(0);
|
||||
|
@ -46,46 +46,60 @@ function Contributors({contributors,owner,projectsId}){
|
|||
}
|
||||
}
|
||||
|
||||
function renderOrganize(list) {
|
||||
let str = "";
|
||||
list.map(i=>{
|
||||
str = str+i.name + "、";
|
||||
})
|
||||
return str && str.substr(0,str.length - 1);
|
||||
}
|
||||
|
||||
function setMenusFunc(data){
|
||||
if(data){
|
||||
let ele = (
|
||||
<Spin spinning={isSpin}>
|
||||
<FlexAJ>
|
||||
<FlexAJ className="menuMaininfos">
|
||||
<AlignCenter>
|
||||
<Link to={`/users/${data.login}`}><img src={getImageUrl(`/${data.image_url}`)} alt="" className="radius" width="38px" height="38px"/></Link>
|
||||
<Link to={`/users/${data.login}`} className="ml10">{data.name}</Link>
|
||||
</AlignCenter>
|
||||
{
|
||||
data.is_watch ? <a className="color-grey-9" onClick={()=>FocusFunc(false,data.login)}>取消关注</a>:<a className="color-blue" onClick={()=>FocusFunc(true,data.login)}>关注</a>
|
||||
}
|
||||
</FlexAJ>
|
||||
<AlignCenter className="menuinfos">
|
||||
<a href={data.projects_url}>
|
||||
<span>{data.projects_count}</span>
|
||||
<span>项目数</span>
|
||||
</a>
|
||||
<a href={data.followers_url}>
|
||||
<span>{data.followers_count}</span>
|
||||
<span>粉丝数</span>
|
||||
</a>
|
||||
<a href={data.following_url}>
|
||||
<span>{data.following_count}</span>
|
||||
<span>关注数</span>
|
||||
</a>
|
||||
</AlignCenter>
|
||||
{
|
||||
data.organizations && data.organizations.length > 0 ?
|
||||
<AlignCenter className="font-12 pt4 pb4">
|
||||
<span>所属组织:</span>
|
||||
<div className="task-hide flex1">
|
||||
{renderArray(data.organizations)}
|
||||
<Link to={`/${data.login}`}><img src={getImageUrl(`/${data.image_url}`)} alt="" className="radius" width="38px" height="38px"/></Link>
|
||||
|
||||
<div className="ml10">
|
||||
<Link to={`/${data.login}`}>{data.name}</Link>
|
||||
{ data.location && <span className="leftline">{data.location}</span> }
|
||||
{
|
||||
data.organizations && data.organizations.length>0&&
|
||||
<p className="task-hide" style={{maxWidth:"215px"}}>
|
||||
所属组织:{renderOrganize(data.organizations)}
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
</AlignCenter>
|
||||
:""
|
||||
}
|
||||
{
|
||||
data.location && <AlignCenter className="font-12 pt4 pb4"><span>所在地址:</span><span className="ml5">{data.location}</span></AlignCenter>
|
||||
}
|
||||
</FlexAJ>
|
||||
<AlignCenter className="menuinfos">
|
||||
<Link to={`/${data.login}/projects`}>
|
||||
<span>{data.projects_count}</span>
|
||||
<span>项目数</span>
|
||||
</Link>
|
||||
<Link to={`/${data.login}/followers`}>
|
||||
<span>{data.followers_count}</span>
|
||||
<span>粉丝数</span>
|
||||
</Link>
|
||||
<Link to={`/${data.login}/following`}>
|
||||
<span>{data.following_count}</span>
|
||||
<span>关注数</span>
|
||||
</Link>
|
||||
</AlignCenter>
|
||||
<div className={"pb20"} style={{display:"flex",justifyContent:'center'}}>
|
||||
{
|
||||
currentLogin && (currentLogin === data.login)
|
||||
?
|
||||
<Button className="currentBtn">当前用户</Button>
|
||||
:
|
||||
data.is_watch ?
|
||||
<Button type={"default"} onClick={()=>FocusFunc(false,data.login)}>已关注</Button>
|
||||
:
|
||||
<Button type={"primary"} onClick={()=>FocusFunc(true,data.login)}>关注TA</Button>
|
||||
}
|
||||
</div>
|
||||
</Spin>
|
||||
)
|
||||
setMenu(ele);
|
||||
|
@ -135,17 +149,17 @@ function Contributors({contributors,owner,projectsId}){
|
|||
|
||||
return(
|
||||
<div className="halfs">
|
||||
<FlexAJ>
|
||||
<AlignCenter><span className="font-16 color-grey-6">贡献者</span>{ contributors && contributors.total_count > 0 && <span className="infoCount">{contributors.total_count}</span>}</AlignCenter>
|
||||
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/contribute`}>全部</Link>
|
||||
</FlexAJ>
|
||||
<Link to={`/${owner}/${projectsId}/contribute`} className="font-16 color-ooo hoverA">
|
||||
<span>贡献者</span>
|
||||
{ contributors && contributors.total_count > 0 && <span className="infoCount">{contributors.total_count}</span>}
|
||||
</Link>
|
||||
<div className="attrPerson" onMouseLeave={()=>setVisibleFunc(false)}>
|
||||
{
|
||||
total > 0 ?
|
||||
list.map((item,key)=>{
|
||||
return(
|
||||
<Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">
|
||||
<Link key={key} to={`/users/${item.login}`}>
|
||||
<Link key={key} to={`/${item.login}`}>
|
||||
<img src={getImageUrl(`/${item.image_url}`)} alt="" onMouseOver={()=>setVisibleFunc(true,item.login,key)}/>
|
||||
</Link>
|
||||
</Popover>
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
import React, { useState, useCallback, memo } from 'react';
|
||||
import { Tooltip } from 'antd';
|
||||
|
||||
CopyTool.defaultProps = {
|
||||
beforeText: '复制链接', //浮动过去显示的文字
|
||||
afterText: '复制成功', //点击后显示的文字
|
||||
className: '', //传给svg的class
|
||||
inputId: 'copyText', //要复制的文本的ID
|
||||
timeOut:true, //复制后将浮动的文字改为beforeText
|
||||
};
|
||||
|
||||
|
||||
function CopyTool({ beforeText, afterText, className , inputId , timeOut }) {
|
||||
const [title, setTitle] = useState(() => {
|
||||
return beforeText;
|
||||
});
|
||||
|
||||
// 复制链接
|
||||
const copyUrl = useCallback(() => {
|
||||
const copyEle = document.querySelector(`#${inputId}`); // 获取要复制的节点
|
||||
if (!copyEle) {
|
||||
console.error("您的CopyTool未设置正确的inputId");
|
||||
return;
|
||||
}
|
||||
copyEle.select(); // 执行选中元素
|
||||
if (document.execCommand('copy')) {
|
||||
document.execCommand('copy');
|
||||
}
|
||||
document.getSelection().removeAllRanges();
|
||||
|
||||
setTitle(afterText);
|
||||
if(timeOut){
|
||||
setTimeout(function(){
|
||||
setTitle(beforeText);
|
||||
},1500)
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
placement="top"
|
||||
title={title}
|
||||
onVisibleChange={() => { setTitle(beforeText) }}
|
||||
>
|
||||
<i className={`iconfont icon-fuzhiicon ${className}`} style={{ color: '#466aff' }} onClick={copyUrl}></i>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export default memo(CopyTool);
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { AlignCenter } from '../layout';
|
||||
import { Modal , Button } from 'antd';
|
||||
import './Index.scss';
|
||||
import { Button } from 'antd';
|
||||
import Modals from '../PublicModal/Index';
|
||||
|
||||
function DeleteBox({
|
||||
visible ,
|
||||
|
@ -12,24 +12,22 @@ function DeleteBox({
|
|||
content
|
||||
}) {
|
||||
return(
|
||||
<Modal
|
||||
visible={visible}
|
||||
onCancel={onCancel}
|
||||
title={title}
|
||||
width="600px"
|
||||
className="deleteBox"
|
||||
footer={
|
||||
<Modals
|
||||
title={title}
|
||||
btn={
|
||||
<div>
|
||||
<Button size={'large'} onClick={onCancel}>取消</Button>
|
||||
<Button type={"danger"} size={"large"} onClick={onSuccess}>确认删除</Button>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
onCancel={onCancel}
|
||||
visible={visible}
|
||||
>
|
||||
<div className="desc">
|
||||
<AlignCenter className="descMain"><i className="iconfont icon-shanchu_tc_icon mr10"></i>{content}</AlignCenter>
|
||||
<p>{subTitle}</p>
|
||||
<p>{subTitle}</p>
|
||||
</div>
|
||||
</Modal>
|
||||
</Modals>
|
||||
)
|
||||
}
|
||||
export default DeleteBox;
|
|
@ -1,45 +0,0 @@
|
|||
.deleteBox{
|
||||
.ant-modal-header{
|
||||
background-color: #f8f8f8;
|
||||
border-bottom: none;
|
||||
.ant-modal-title{
|
||||
text-align: left;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
.ant-modal-body{
|
||||
padding:30px 50px;
|
||||
p{
|
||||
font-size: 16px;
|
||||
line-height: 26px;
|
||||
color:#666;
|
||||
word-break: break-all;
|
||||
}
|
||||
.desc{
|
||||
.descMain{
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
margin-bottom: 10px;
|
||||
i{
|
||||
font-size: 38px!important;
|
||||
color:#DF0002
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-modal-footer{
|
||||
border-top: none;
|
||||
text-align: center;
|
||||
padding-bottom: 40px;
|
||||
button{
|
||||
width: 120px;
|
||||
margin:0px 20px;
|
||||
&.ant-btn-danger{
|
||||
background-color: #fff;
|
||||
color: #DF0002;
|
||||
border-color: #D0D0D0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -78,7 +78,7 @@ function DrawerPanel({visible,onClose,branch,owner,projectsId,history, name , li
|
|||
if(dataref.type==="file"){
|
||||
onClose();
|
||||
let value = turnbar(branch);
|
||||
history.push(`/projects/${owner}/${projectsId}/tree/${value}/${dataref.path}`);
|
||||
history.push(`/${owner}/${projectsId}/tree/${value}/${dataref.path}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.ant-modal-mask{
|
||||
z-index: 1001;
|
||||
z-index: 1031;
|
||||
}
|
||||
.ant-modal-wrap{
|
||||
z-index: 1002;
|
||||
z-index: 1032;
|
||||
}
|
|
@ -25,7 +25,7 @@ function LanguagePower({languages}){
|
|||
}
|
||||
return(
|
||||
<div>
|
||||
<p className="font-16 color-grey-6">开发语言</p>
|
||||
<p className="font-16 color-ooo aboutSubTitle">开发语言</p>
|
||||
<div className="progress">
|
||||
{
|
||||
array && array.map((item,key)=>{
|
||||
|
|
|
@ -45,15 +45,15 @@ const Div = styled.div`{
|
|||
export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => {
|
||||
return (
|
||||
<Div>
|
||||
<Link to={`/users/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link>
|
||||
<Link to={`/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link>
|
||||
<div className="m-infos">
|
||||
<Link to={`/users/${user && user.login}`}><Name>{name}</Name></Link>
|
||||
<Link to={`/${user && user.login}`}><Name>{name}</Name></Link>
|
||||
<Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time>
|
||||
{
|
||||
is_current_user ?
|
||||
<Button type="default">当前用户</Button>
|
||||
:
|
||||
<FocusButton is_watch={focusStatus} id={login} successFunc={successFunc}/>
|
||||
<FocusButton is_watch={focusStatus} id={login} successFunc={successFunc} notReset={true}/>
|
||||
}
|
||||
</div>
|
||||
</Div>
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
/* eslint-disable react/jsx-no-duplicate-props */
|
||||
import React, { useState } from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import { Modal, Button } from 'antd';
|
||||
import './index.scss';
|
||||
|
||||
// 函数式调用删除、通知等模态框
|
||||
|
||||
InitModal.defaultProps = {
|
||||
okText: '确认', //确定按钮的文字
|
||||
cancelText: '取消', //取消按钮的文字
|
||||
className: '', //传入的模态框类名
|
||||
inputId: 'copyText', //要复制的文本的ID
|
||||
onCancel:()=>{}, //取消的回调
|
||||
onOk:()=>{}, //确认的回调
|
||||
title:'提示', //模态框名字
|
||||
contentTitle:'', //内容标题
|
||||
content:'', //详细内容
|
||||
afterClose:()=>{}, //关闭模态框以后的回调
|
||||
};
|
||||
|
||||
// 使用函数调用删除组件
|
||||
export default function DelModal(props) {
|
||||
renderModal({ ...props, type: 'delete' })
|
||||
}
|
||||
|
||||
// 使用函数调用选择模态框组件
|
||||
export function Confirm(props) {
|
||||
renderModal({ ...props, type: 'confirm' })
|
||||
}
|
||||
|
||||
function renderModal(props) {
|
||||
const { type, afterClose } = props;
|
||||
const div = document.createElement('div');
|
||||
document.body.appendChild(div);
|
||||
|
||||
function destroy() {
|
||||
afterClose && afterClose();
|
||||
const unmountResult = ReactDOM.unmountComponentAtNode(div);
|
||||
if (unmountResult && div.parentNode) {
|
||||
div.parentNode.removeChild(div);
|
||||
}
|
||||
}
|
||||
|
||||
function modalType(type) {
|
||||
if (type === 'delete') {
|
||||
return <InitModal
|
||||
title="删除"
|
||||
contentTitle="确定要删除吗?"
|
||||
okText="确认删除"
|
||||
{...props}
|
||||
|
||||
afterClose={destroy}
|
||||
contentTitle={<React.Fragment>
|
||||
<i className="red-circle iconfont icon-shanchu_tc_icon mr3"></i>
|
||||
{props.contentTitle}
|
||||
</React.Fragment>}
|
||||
/>
|
||||
} else if (type === 'confirm') {
|
||||
return <InitModal title="选择" afterClose={destroy} {...props} />
|
||||
} else {
|
||||
return <InitModal title="选择" afterClose={destroy} {...props} />
|
||||
}
|
||||
}
|
||||
|
||||
function render() {
|
||||
setTimeout(() => {
|
||||
ReactDOM.render(
|
||||
modalType(type),
|
||||
div,
|
||||
);
|
||||
});
|
||||
}
|
||||
render();
|
||||
}
|
||||
|
||||
// 选择模态框组件
|
||||
function InitModal({
|
||||
onCancel,
|
||||
onOk,
|
||||
title,
|
||||
contentTitle,
|
||||
content,
|
||||
okText,
|
||||
cancelText,
|
||||
afterClose,
|
||||
className,
|
||||
}) {
|
||||
|
||||
const [visible, setVisible] = useState(true);
|
||||
|
||||
function onCancelModal() {
|
||||
setVisible(false);
|
||||
onCancel && onCancel()
|
||||
}
|
||||
|
||||
function onSuccess() {
|
||||
setVisible(false);
|
||||
onOk && onOk();
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
visible={visible}
|
||||
onCancel={onCancelModal}
|
||||
afterClose={afterClose}
|
||||
title={title}
|
||||
className={`myself-modal ${className}`}
|
||||
centered
|
||||
footer={[
|
||||
<Button type="default" key="back" onClick={onCancelModal}>
|
||||
{cancelText}
|
||||
</Button>,
|
||||
<Button className="foot-submit" key="submit" onClick={onSuccess}>
|
||||
{okText}
|
||||
</Button>,
|
||||
]}
|
||||
>
|
||||
<div>
|
||||
{contentTitle && <p className="content-title">{contentTitle}</p>}
|
||||
<p className="content-descibe">{content}</p>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
.myself-modal {
|
||||
.ant-modal-header {
|
||||
padding: 9px 24px;
|
||||
background: #f8f8f8;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.ant-modal-title {
|
||||
text-align: left;
|
||||
}
|
||||
.ant-modal-close {
|
||||
top: 0px !important;
|
||||
}
|
||||
.ant-modal-close-x {
|
||||
font-size: 24px;
|
||||
}
|
||||
.ant-modal-body {
|
||||
text-align: center;
|
||||
}
|
||||
.content-title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 2rem 0 1rem !important;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
letter-spacing: 0;
|
||||
line-height: 29px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.red-circle {
|
||||
align-self: flex-start;
|
||||
color: #ca0002;
|
||||
font-size: 1.5rem !important;
|
||||
}
|
||||
.content-descibe {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 33px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.ant-modal-footer {
|
||||
padding: 2rem 0;
|
||||
text-align: center;
|
||||
border: 0;
|
||||
.ant-btn {
|
||||
width: 6rem;
|
||||
}
|
||||
}
|
||||
.foot-submit {
|
||||
margin-left: 3rem;
|
||||
color: #df0002;
|
||||
&:hover {
|
||||
border-color: #df0002;
|
||||
}
|
||||
}
|
||||
.ant-btn-default:hover,
|
||||
.ant-btn-default:active,
|
||||
.ant-btn-default:focus {
|
||||
background: #f3f4f6;
|
||||
color: #333;
|
||||
border-color: #d0d0d0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
.systemBox{
|
||||
.ant-modal-body{
|
||||
padding:1px 0px 0px 0px;
|
||||
.sysBox{
|
||||
background-image: url('./bg.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 334px;
|
||||
margin-top: -55px;
|
||||
}
|
||||
.sysnoticeBox{
|
||||
width: 100%;
|
||||
padding:80px 0px 34px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 780px;
|
||||
margin: 0px auto;
|
||||
p.ntitle{
|
||||
height: 33px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #31FFF7;
|
||||
line-height: 33px;
|
||||
text-align: center;
|
||||
}
|
||||
p.nSubtitle{
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
font-size: 18px;
|
||||
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;
|
||||
}
|
||||
.nContent{
|
||||
padding:20px 34px;
|
||||
background-color: #fff;
|
||||
line-height: 30px;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
.realmName{
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
ul{
|
||||
width: 50%;
|
||||
padding-left: 0px!important;
|
||||
li{
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
line-height: 32px;
|
||||
text-align: left;
|
||||
color: #000;
|
||||
list-style-type: none!important;
|
||||
&:first-child{
|
||||
color: #E65714;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.nSubdesc{
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
line-height: 31px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.nInfo{
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
text-align: right;
|
||||
margin-top: 25px;
|
||||
p{
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.nBtn{
|
||||
text-align: center;
|
||||
margin-top: 33px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Modal , Button } from 'antd';
|
||||
import './Index.scss';
|
||||
import '../../css/index.scss';
|
||||
import RenderHtml from '../../../components/render-html';
|
||||
import cookie from 'react-cookies';
|
||||
|
||||
function SystemNotice({system_notification,history}){
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
|
||||
useEffect(()=>{
|
||||
if(system_notification && !cookie.load('notice_stage')){
|
||||
setVisible(true);
|
||||
}
|
||||
},[system_notification,history.location])
|
||||
|
||||
function sureContinue() {
|
||||
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:"/" });
|
||||
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
visible = {visible}
|
||||
width="1000px"
|
||||
footer={false}
|
||||
title={false}
|
||||
centered={true}
|
||||
closable={false}
|
||||
wrapClassName={'systemBox'}
|
||||
>
|
||||
<div className="sysBox">
|
||||
<div className="sysnoticeBox">
|
||||
<p className="ntitle">{system_notification && system_notification.subject}</p>
|
||||
<p className="nSubtitle">{system_notification && system_notification.sub_subject}</p>
|
||||
{/* <div className="nContent">
|
||||
<div className="nMaindesc">
|
||||
为了给用户提供更加稳定、优质的服务,我们即将对平台门户首页、平台名称、平台域名进行一次全面升级与变更。原平台名称:Trustie(中文名:确实)将于2021年10月xx日统一更改为Gitlink(中文名:确实开源)。届时平台域名将统一进行更换,更换规则如下
|
||||
</div>
|
||||
<div className="realmName">
|
||||
<ul>
|
||||
<li>原域名:</li>
|
||||
<li>官网顶级域名https://www.trustie.net</li>
|
||||
<li>版本库子域名https://forgeplus.trustie.net</li>
|
||||
<li>论坛子域名https://forum.trustie.net/forums</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>更换后域名:</li>
|
||||
<li>官网顶级域名https://www.gitlink.org.cn</li>
|
||||
<li>版本库子域名https://www.git.gitlink.org.cn</li>
|
||||
<li>论坛子域名https://forum.gitlink.org.cn</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div className="nSubdesc">
|
||||
自2021年10月xx日起,旧域名将停止访问。因平台名称与域名变更给您带来的不便,我们深表歉意!非常感谢您一直以来对本平台的信任与支持,我们将一如既往地为您提供优质的服务。 特此通知!
|
||||
</div>
|
||||
<div className="nInfo">
|
||||
<p>Gitlink运营团队</p>
|
||||
<p>2021年10月xx日</p>
|
||||
</div>
|
||||
</div> */}
|
||||
<RenderHtml className="break_word_comments imageLayerParent" value={system_notification && system_notification.content} url={history.location}/>
|
||||
<div className="nBtn">
|
||||
<Button type="primary" className="btnblue" onClick={sureContinue}>确认并继续</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default SystemNotice;
|
Binary file not shown.
After Width: | Height: | Size: 280 KiB |
|
@ -0,0 +1,72 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import Modals from '../PublicModal/Index';
|
||||
import { Button } from 'antd';
|
||||
import axios from 'axios';
|
||||
|
||||
import ProfileImg from './images/profile.png';
|
||||
import './Index.scss';
|
||||
|
||||
function ProfileModal({visible,onCancel,history}) {
|
||||
const [ modalVis , setModalVis ] = useState(visible);
|
||||
const [ addMemberCheck , setAddMemberCheck ] = useState(false);
|
||||
|
||||
useEffect(()=>{
|
||||
axios.interceptors.response.use((response) => {
|
||||
if (response && (response.data.status === 411 || response.data.status === 412)) {
|
||||
setModalVis(true);
|
||||
if(response.data.status === 412){
|
||||
setAddMemberCheck(true);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}, (error) => {
|
||||
});
|
||||
},[])
|
||||
|
||||
useEffect(()=>{
|
||||
setModalVis(visible);
|
||||
},[visible])
|
||||
|
||||
function onOk(){
|
||||
onCancel();
|
||||
setModalVis(false);
|
||||
setTimeout(function(){
|
||||
window.open(`/settings/profile`,"_blank");
|
||||
},200)
|
||||
}
|
||||
|
||||
function onNo() {
|
||||
onCancel();
|
||||
setModalVis(false);
|
||||
}
|
||||
|
||||
return(
|
||||
<Modals
|
||||
title="完善资料"
|
||||
onCancel={onNo}
|
||||
visible={modalVis}
|
||||
btn={
|
||||
addMemberCheck?
|
||||
<div>
|
||||
<Button type={'primary'} size={"large"} onClick={onNo}>好的</Button>
|
||||
</div>
|
||||
:
|
||||
<div>
|
||||
<Button size={"large"} onClick={onNo}>暂不补充</Button>
|
||||
<Button type={'primary'} size={"large"} onClick={onOk}>好的</Button>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="contents">
|
||||
<img src={ProfileImg} alt=""/>
|
||||
{
|
||||
addMemberCheck ?
|
||||
<p>目标用户个人资料不完整,需提醒目标用户补充资料后以进行后续操作</p>
|
||||
:
|
||||
<p>您目前的个人资料不完整,需要补充资料以进行后续操作。是否前往补充个人信息?</p>
|
||||
}
|
||||
</div>
|
||||
</Modals>
|
||||
)
|
||||
}
|
||||
export default ProfileModal;
|
|
@ -0,0 +1,18 @@
|
|||
.contents{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin:10px auto 0px;
|
||||
img{
|
||||
margin-right: 13px;
|
||||
width: 44px;
|
||||
}
|
||||
p{
|
||||
line-height: 29px;
|
||||
max-width: 327px;
|
||||
font-size: 16px!important;
|
||||
}
|
||||
}
|
||||
.font-44{
|
||||
font-size: 44px!important;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
import React from 'react';
|
||||
|
||||
function Profile({children,sureFunc,showCompeleteDialog , completeProfile, className}) {
|
||||
|
||||
function checkProfile() {
|
||||
if(!completeProfile){
|
||||
showCompeleteDialog && showCompeleteDialog();
|
||||
}else{
|
||||
sureFunc();
|
||||
}
|
||||
}
|
||||
|
||||
return(
|
||||
<a className={className} onClick={checkProfile}>{children}</a>
|
||||
)
|
||||
}
|
||||
export default Profile;
|
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
|
@ -0,0 +1,20 @@
|
|||
import React from 'react';
|
||||
import { Modal } from 'antd';
|
||||
import './Index.scss';
|
||||
|
||||
function Modals({title,children,btn,onCancel,visible}) {
|
||||
return(
|
||||
<Modal
|
||||
visible={visible}
|
||||
onCancel={onCancel}
|
||||
title={title}
|
||||
width={"520px"}
|
||||
footer={btn}
|
||||
centered={true}
|
||||
wrapClassName={"deleteBox"}
|
||||
>
|
||||
{children}
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default Modals;
|
|
@ -0,0 +1,75 @@
|
|||
.deleteBox{
|
||||
z-index: 1033;
|
||||
.ant-modal-close-x{
|
||||
font-size: 17px!important;
|
||||
}
|
||||
.ant-modal-header{
|
||||
background-color: #f8f8f8;
|
||||
padding:10px 30px;
|
||||
.ant-modal-title{
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.ant-modal-close{
|
||||
top:0px !important;
|
||||
font-size: 24px !important;
|
||||
}
|
||||
.ant-modal-body{
|
||||
padding:30px 50px;
|
||||
p{
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
color:#666;
|
||||
word-break: break-all;
|
||||
}
|
||||
.desc{
|
||||
.descMain{
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
margin-bottom: 10px;
|
||||
i.red{
|
||||
color:#DF0002;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-modal-footer{
|
||||
border-top: none;
|
||||
text-align: center;
|
||||
padding-bottom: 40px;
|
||||
button,a{
|
||||
width: 96px;
|
||||
height: 32px;
|
||||
margin:0px 20px;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
&.ant-btn{
|
||||
border-color: #D0D0D0;
|
||||
color: #666;
|
||||
&:hover,&:active,&:focus{
|
||||
background: #f3f4f6;
|
||||
}
|
||||
}
|
||||
&.ant-btn-danger{
|
||||
background-color: #fff;
|
||||
color: #DF0002;
|
||||
border-color: #D0D0D0;
|
||||
&:hover,&:active,&:focus{
|
||||
border-color: #DF0002;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
&.ant-btn.ant-btn-primary{
|
||||
background-color: #466AFF;
|
||||
color: #fff;
|
||||
border-color: #466AFF;
|
||||
&:hover,&:focus,&:active{
|
||||
background-color: rgba(70,106,255,0.85);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,38 +1,35 @@
|
|||
import React from 'react';
|
||||
import { AlignCenter , AlignTop , FlexAJ } from '../Component/layout';
|
||||
import { AlignTop } from '../Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}){
|
||||
|
||||
function Releases({ owner, projectsId, releaseVersions, distribution }) {
|
||||
return(
|
||||
<div>
|
||||
<FlexAJ>
|
||||
<AlignCenter><span className="font-16 color-grey-6">发行版</span>
|
||||
{ releaseVersions && releaseVersions.total_count > 0 && <span className="infoCount">{releaseVersions.total_count}</span>}
|
||||
</AlignCenter>
|
||||
{ (releaseVersions && releaseVersions.total_count > 0) || projectType ===2 ?
|
||||
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/releases`}>全部</Link>
|
||||
:
|
||||
baseOperate && <Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||
}
|
||||
</FlexAJ>
|
||||
<Link to={`/${owner}/${projectsId}/releases`} className="font-16 color-ooo hoverA">
|
||||
<span>发行版</span>
|
||||
{ releaseVersions && releaseVersions.total_count > 0 && <span className="infoCount">{releaseVersions.total_count}</span>}
|
||||
</Link>
|
||||
{
|
||||
releaseVersions && releaseVersions.total_count>0 ?
|
||||
releaseVersions.list.map((item,key)=>{
|
||||
return(
|
||||
key === 0 &&<AlignTop className="mt10">
|
||||
<i className="iconfont icon-biaoqian3 color-grey-6 font-18 mr10"></i>
|
||||
<div>
|
||||
<p className="font-16 color-grey-6">
|
||||
<Link to={`/projects/${owner}/${projectsId}/releases`}>{item.name}</Link>
|
||||
<p className="font-16 color-grey-6" style={{display:'flex',alignItems:'center'}}>
|
||||
{/* 如果是点击最新则发行版列表页只展示最新的一个 */}
|
||||
<Link to={{pathname:`/${owner}/${projectsId}/releases`,query:{turnFromNew:true}}} style={{maxWidth:'200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis'}}>{item.name}</Link>
|
||||
<span className="font-12 laterest ml5">最新</span>
|
||||
</p>
|
||||
<p className="color-grey-9 font-13">{item.created_at}</p>
|
||||
<p className="color-grey-3 font-12">{item.created_at}</p>
|
||||
</div>
|
||||
</AlignTop>
|
||||
)
|
||||
})
|
||||
:""
|
||||
:
|
||||
<div className="mt8">
|
||||
您暂未发布任何版本
|
||||
{distribution && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}}}>创建新版本</Link>}
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
|
|
@ -2,9 +2,9 @@ import React from 'react';
|
|||
import {Popover} from 'antd';
|
||||
import './Component.scss';
|
||||
|
||||
export default (({menu , children})=>{
|
||||
export default (({menu , children, overlayClassName})=>{
|
||||
return(
|
||||
<Popover content={menu} trigger={['click']} placement='bottom'>
|
||||
<Popover content={menu} trigger={['click']} placement='bottom' overlayClassName={overlayClassName}>
|
||||
{children}
|
||||
</Popover>
|
||||
)
|
||||
|
|
|
@ -5,6 +5,7 @@ import { Link } from 'react-router-dom';
|
|||
export default ({ url , name , column , id , login })=>{
|
||||
const Img = styled.span`
|
||||
display:flex;
|
||||
font-weight: bold;
|
||||
${column && "flex-direction: column;text-align:center;"}
|
||||
align-items: center;
|
||||
& img{
|
||||
|
@ -20,7 +21,7 @@ export default ({ url , name , column , id , login })=>{
|
|||
`;
|
||||
return(
|
||||
id?
|
||||
<Link to={`/users/${login}`}>
|
||||
<Link to={`/${login}`}>
|
||||
<Img>
|
||||
{ url && <img src={url} alt=""/> }
|
||||
<span>{name}</span>
|
||||
|
|
|
@ -149,7 +149,7 @@ function About(props, ref) {
|
|||
axios.post(url).then(result=>{
|
||||
setIsSpining(false);
|
||||
if(result && result.data.status === 0){
|
||||
props.history.push(`/projects/${owner}/${projectsId}/devops/dispose`);
|
||||
props.history.push(`/${owner}/${projectsId}/devops`);
|
||||
// 需要将顶部的open_devops修改
|
||||
let { changeOpenDevops } = props;
|
||||
changeOpenDevops && changeOpenDevops(true);
|
||||
|
|
|
@ -96,7 +96,7 @@ function Dispose(props){
|
|||
setVisible(false);
|
||||
if(result && result.data){
|
||||
props.showNotification("流水线新增成功,请进行工作流配置!");
|
||||
props.history.push(`/projects/${owner}/${projectsId}/devops/dispose/${result.data.id}`);
|
||||
props.history.push(`/${owner}/${projectsId}/devops/${result.data.id}`);
|
||||
}else{
|
||||
props.showNotification("流水线新增失败,请稍后再试!");
|
||||
}
|
||||
|
@ -134,12 +134,12 @@ function Dispose(props){
|
|||
|
||||
// 模板管理
|
||||
function toModalManage(){
|
||||
props.history.push(`/projects/${owner}/${projectsId}/devops/mould`);
|
||||
props.history.push(`/${owner}/${projectsId}/devops/mould`);
|
||||
}
|
||||
|
||||
// 参数管理
|
||||
function toparameter(){
|
||||
props.history.push(`/projects/${owner}/${projectsId}/devops/params`);
|
||||
props.history.push(`/${owner}/${projectsId}/devops/params`);
|
||||
}
|
||||
|
||||
const operate = current_user && (permission && permission !== "Reporter");
|
||||
|
|
|
@ -73,7 +73,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
|||
render:(value,item)=>{
|
||||
let v = turnbar(item.branch);
|
||||
return(
|
||||
<Link to={`/projects/${owner}/${projectsId}/tree/${v}/${value}`} className="color-blue">{value}</Link>
|
||||
<Link to={`/${owner}/${projectsId}/tree/${v}/${value}`} className="color-blue">{value}</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
|
@ -117,7 +117,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
|||
return(
|
||||
<span>
|
||||
{ operate ?
|
||||
<Link to={`/projects/${owner}/${projectsId}/devops/dispose/${item.id}`} className="mr10 color-grey-6">
|
||||
<Link to={`/${owner}/${projectsId}/devops/${item.id}`} className="mr10 color-grey-6">
|
||||
<i className="iconfont icon-zaibianji font-13 mr3"></i>编辑</Link> :""
|
||||
}
|
||||
{ operate ?
|
||||
|
@ -125,7 +125,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
|||
<a className="mr10 color-grey-6"><i className="iconfont icon-lajitong font-13 mr3"></i>删除</a>
|
||||
</Popconfirm>:""
|
||||
}
|
||||
<Link to={`/projects/${owner}/${projectsId}/devops/list/${item.branch}`} className="color-grey-6"><i className="iconfont icon-yunhang font-13 mr3"></i>查看运行记录</Link>
|
||||
<Link to={`/${owner}/${projectsId}/devops/list/${item.branch}`} className="color-grey-6"><i className="iconfont icon-yunhang font-13 mr3"></i>查看运行记录</Link>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ function PipelineName({visible,onCancel,onOk,value ,branchList}){
|
|||
})
|
||||
}
|
||||
</Select>
|
||||
<Select mode="multiple" allowClear value={eventValue} dropdownClassName="chooseCon" style={{width:"180px",marginLeft:"10px"}} onChange={(e)=>{console.log(e);setEventValue(e)}}>
|
||||
<Select mode="multiple" allowClear value={eventValue} dropdownClassName="chooseCon" style={{width:"180px",marginLeft:"10px"}} onChange={(e)=>{setEventValue(e)}}>
|
||||
{
|
||||
EVENT.map((item,key)=>{
|
||||
return(
|
||||
|
|
|
@ -36,39 +36,37 @@ export default ((props)=>{
|
|||
return(
|
||||
<WhiteBack className="opsPanel">
|
||||
<Switch {...props}>
|
||||
<Route path="/projects/:owner/:projectsId/devops/dispose/:disposeId"
|
||||
render={
|
||||
(p) => (<New {...props} {...p}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/devops/params"
|
||||
|
||||
<Route path="/:owner/:projectsId/devops/params"
|
||||
render={
|
||||
(p) => (<Params {...props} {...p}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/devops/mould"
|
||||
<Route path="/:owner/:projectsId/devops/mould"
|
||||
render={
|
||||
(p) => (<Mould {...props} {...p}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/devops/dispose/new"
|
||||
<Route path="/:owner/:projectsId/devops/new"
|
||||
render={
|
||||
(p) => (<New {...props} {...p}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/devops/dispose"
|
||||
render={
|
||||
(p) => (<Dispose {...props} {...p}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/devops/list/:branch"
|
||||
|
||||
<Route path="/:owner/:projectsId/devops/list/:branch"
|
||||
render={
|
||||
(p) => (<Stucture {...props} {...p}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/devops"
|
||||
<Route path="/:owner/:projectsId/devops/:disposeId"
|
||||
render={
|
||||
(p) => (<About {...props} {...p}/>)
|
||||
(p) => (<New {...props} {...p}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 原本的两种合为一个 */}
|
||||
<Route path="/:owner/:projectsId/devops"
|
||||
render={
|
||||
(p) =>{return( p.location.state.open_devops?<Dispose {...props} {...p}/>:<About {...props} {...p}/>)}
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
|
|
|
@ -26,7 +26,7 @@ export default ((props)=>{
|
|||
return(
|
||||
<div className="disposePanel">
|
||||
<Banner>
|
||||
{ permission !=="Reporter" && <Link to={`/projects/${owner}/${props.match.params.projectsId}/devops/dispose`}>工作流配置</Link>}
|
||||
{ permission !=="Reporter" && <Link to={`/${owner}/${props.match.params.projectsId}/devops`}>工作流配置</Link>}
|
||||
</Banner>
|
||||
<Div>
|
||||
<Dispost {...props}/>
|
||||
|
|
|
@ -104,7 +104,7 @@ function Params(props){
|
|||
<Banner>
|
||||
<FlexAJ>
|
||||
<span className="font-18">工作流 - 参数管理</span>
|
||||
<Link to={`/projects/${owner}/${projectsId}/devops/dispose`} className="font-14 color-grey-9 ml20">返回</Link>
|
||||
<Link to={`/${owner}/${projectsId}/devops`} className="font-14 color-grey-9 ml20">返回</Link>
|
||||
</FlexAJ>
|
||||
</Banner>
|
||||
<Div className="disposeList">
|
||||
|
|
|
@ -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={`/projects/${owner}/${projectsId}/devops/dispose`} 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>
|
||||
|
|
|
@ -198,7 +198,7 @@ function Structure(props,ref){
|
|||
}
|
||||
|
||||
function clickRows(event,e){
|
||||
props.history.push(`/projects/${owner}/${projectsId}/devops/${e.number}/detail`);
|
||||
props.history.push(`/${owner}/${projectsId}/devops/${e.number}/detail`);
|
||||
}
|
||||
const column = [
|
||||
{
|
||||
|
@ -290,7 +290,7 @@ function Structure(props,ref){
|
|||
<Banner>
|
||||
<FlexAJ>
|
||||
<span>构建列表</span>
|
||||
<Link to={`/projects/${owner}/${projectsId}/devops/dispose`} className="font-15 color-grey-9">返回</Link>
|
||||
<Link to={`/${owner}/${projectsId}/devops`} className="font-15 color-grey-9">返回</Link>
|
||||
</FlexAJ>
|
||||
</Banner>
|
||||
<Div>
|
||||
|
|
|
@ -275,7 +275,7 @@ function disposePipeline(props){
|
|||
...params
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
props.history.push(`/projects/${owner}/${projectsId}/devops/dispose`);
|
||||
props.history.push(`/${owner}/${projectsId}/devops`);
|
||||
}
|
||||
setLoading(false);
|
||||
}).catch(error=>{
|
||||
|
|
|
@ -48,7 +48,7 @@ export default (props) => {
|
|||
axios.post(url).then((result) => {
|
||||
if (result && result.data) {
|
||||
props.showNotification("工作流正在重新构建!");
|
||||
props.history.push(`/projects/${owner}/${projectId}/devops/${result.data.number}/detail`);
|
||||
props.history.push(`/${owner}/${projectId}/devops/${result.data.number}/detail`);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -87,7 +87,7 @@ export default (props) => {
|
|||
</AlignCenter>
|
||||
<Link
|
||||
style={{ color: "#ddd" }}
|
||||
to={`/projects/${owner}/${projectId}/devops/dispose`}
|
||||
to={`/${owner}/${projectId}/devops`}
|
||||
>
|
||||
<i className="iconfont icon-yiguanbi font-15 mr5"></i>退出
|
||||
</Link>
|
||||
|
|
|
@ -24,7 +24,6 @@ function onLayout(term, el) {
|
|||
entry.target.offsetHeight,
|
||||
term,
|
||||
);
|
||||
console.log('cols, rows', cols, rows);
|
||||
term.resize(cols, rows);
|
||||
mediator.publish('ssh-xterm-resize', {
|
||||
columns: cols,
|
||||
|
@ -139,12 +138,10 @@ export default ({ sshConfigData, sid }) => {
|
|||
}, 1000);
|
||||
}
|
||||
isFirstConnected.current = true;
|
||||
console.log('event:', event);
|
||||
|
||||
const data = Base64.decode(event.data.toString());
|
||||
let w = term._core._renderService.dimensions.actualCellWidth || 9.5;
|
||||
|
||||
console.log('data:', data, w, term);
|
||||
term.write(data);
|
||||
};
|
||||
|
||||
|
|
|
@ -41,14 +41,15 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){
|
|||
// 确认转移
|
||||
function onOk(){
|
||||
validateFields((error,values)=>{
|
||||
console.log(...values);
|
||||
if(!error){
|
||||
const url = `/${owner}/${repo}/applied_transfer_projects.json`;
|
||||
Axios.post(url,{
|
||||
...values
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
if(result && result.data.id){
|
||||
onSuccess(result.data && result.data.owner);
|
||||
}else{
|
||||
onSuccess();
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
@ -104,7 +105,7 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){
|
|||
</ul>
|
||||
:
|
||||
<ul className="descUl">
|
||||
<li>仓库仅可以转移到您已经加入的组织中,不可以转移到未加入的组织中</li>
|
||||
<li>仓库仅可以转移到您具有管理权限的组织中</li>
|
||||
<li>涉及到仓库改名操作,请提前做好仓库备份并且在转移后对本地仓库的remote进行修改</li>
|
||||
<li>转移仓库到组织后,你和组织创建者/管理员同时拥有对该仓库的管理操作</li>
|
||||
</ul>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React, { useState , forwardRef, useEffect } from 'react';
|
||||
import { Form , Modal , Input , Radio } from 'antd';
|
||||
import Axios from 'axios';
|
||||
import CheckProfile from '../Component/ProfileModal/Profile';
|
||||
|
||||
export default Form.create()(
|
||||
forwardRef((props)=>{
|
||||
|
@ -77,7 +78,7 @@ export default Form.create()(
|
|||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
<a onClick={()=>setVisible(true)}>加入项目</a>
|
||||
<CheckProfile {...props} sureFunc={()=>setVisible(true)}>加入项目</CheckProfile>
|
||||
</React.Fragment>
|
||||
)
|
||||
})
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Icon } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import Nodata from '../Nodata';
|
||||
|
||||
|
||||
class PullRefresh extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
}
|
||||
this.pullRef = {};
|
||||
// 节流
|
||||
this.onScrollList = _.throttle(this.handleScroll, 200, {
|
||||
leading: false,
|
||||
trailing: true,
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
let dom = document.querySelector('.pull-refresh-wrap');
|
||||
dom && dom.addEventListener('scroll', this.onScrollList);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
let dom = document.querySelector('.pull-refresh-wrap');
|
||||
dom && dom.removeEventListener('scroll', this.onScrollList)
|
||||
}
|
||||
|
||||
|
||||
handleScroll = () => {
|
||||
if (this.props.count < this.props.pageSize) return;
|
||||
if (this.props.type === 1 || this.props.type === 2) return;
|
||||
const wrap = this.pullRef;
|
||||
const currentScroll = wrap.scrollTop + wrap.clientHeight
|
||||
|
||||
// 触底
|
||||
if (currentScroll >= (wrap.scrollHeight - 200)) {
|
||||
this.loadData()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
handleLoadClick = () => {
|
||||
this.loadData();
|
||||
}
|
||||
|
||||
loadData = () => {
|
||||
this.props.onPullRefresh()
|
||||
}
|
||||
|
||||
|
||||
renderLoading() {
|
||||
switch (this.props.type) {
|
||||
case 0: // 加载更多
|
||||
return <div className='text-center' onClick={this.handleLoadClick}>显示更多</div>
|
||||
case 1: // 加载中
|
||||
return (
|
||||
<div className='text-center'>
|
||||
<Icon type="loading" />
|
||||
<span className='text-center'>加载中...</span>
|
||||
</div>
|
||||
)
|
||||
case 2: // 无样式
|
||||
return <div className='text-center'>没有更多了</div>
|
||||
default:
|
||||
return <div className='text-center'>没有更多了</div>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { className, count, children } = this.props;
|
||||
return (
|
||||
<div
|
||||
className={`pull-refresh-wrap ${className}`}
|
||||
ref={dom => { this.pullRef = dom }}
|
||||
>
|
||||
|
||||
{children}
|
||||
|
||||
{
|
||||
count < 1 && <Nodata _html="暂无未读消息"/>
|
||||
}
|
||||
|
||||
{/* 大于分页数据才显示loading */}
|
||||
{/* {this.props.count >= this.props.pageSize ? this.renderLoading() : null} */}
|
||||
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
PullRefresh.propTypes = {
|
||||
className: PropTypes.string,
|
||||
children: PropTypes.any,
|
||||
onPullRefresh: PropTypes.func.isRequired,
|
||||
type: PropTypes.oneOf([0, 1, 2]),
|
||||
count: PropTypes.number.isRequired,
|
||||
pageSize: PropTypes.number.isRequired,
|
||||
}
|
||||
|
||||
|
||||
export default PullRefresh
|
|
@ -19,7 +19,7 @@ function Footer(){
|
|||
|
||||
return(
|
||||
<div>
|
||||
<div style={{height:"497px"}}></div>
|
||||
<div style={{height:"543px"}}></div>
|
||||
<div className="newFooter edu-txt-center">
|
||||
{value && showhtml(value)}
|
||||
{/* <div className="footerInfos">
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|||
import AccountProfile from "../../modules/user/AccountProfile";
|
||||
import { getImageUrl } from 'educoder'
|
||||
import axios from 'axios';
|
||||
import { Input , notification , Dropdown , Menu } from 'antd';
|
||||
import { Input , notification , Dropdown ,Popover, Menu,Badge, Button } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import LoginDialog from '../../modules/login/LoginDialog';
|
||||
|
@ -10,8 +10,10 @@ import HeadSearch from '../Component/HeadSearch';
|
|||
|
||||
import AddProjectModal from './AddProjectModal';
|
||||
import '../../modules/tpm/TPMIndex.css';
|
||||
import CheckProfile from '../Component/ProfileModal/Profile';
|
||||
|
||||
import './header.scss';
|
||||
import NoticeContent from './NoticeContent';
|
||||
const $ = window.$
|
||||
// TODO 这部分脚本从公共脚本中直接调用
|
||||
const { Search } = Input;
|
||||
|
@ -46,6 +48,7 @@ class NewHeader extends Component {
|
|||
settings: null,
|
||||
visiblemyss: false,
|
||||
openSearch:false,
|
||||
visible:false, //浮动消息框展示控制
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
|
@ -91,9 +94,6 @@ class NewHeader extends Component {
|
|||
this.setState({
|
||||
user: newProps.user
|
||||
})
|
||||
if (newProps.Headertop !== undefined) {
|
||||
old_url = newProps.Headertop.old_url
|
||||
}
|
||||
}
|
||||
|
||||
educoderlogin = () => {
|
||||
|
@ -120,7 +120,6 @@ class NewHeader extends Component {
|
|||
})
|
||||
};
|
||||
HideAddcoursestypess = (i) => {
|
||||
console.log("调用了");
|
||||
this.setState({
|
||||
Addcoursestypes: false,
|
||||
mydisplay: true,
|
||||
|
@ -222,6 +221,15 @@ class NewHeader extends Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkProfile=(url)=>{
|
||||
const { showCompeleteDialog , completeProfile } = this.props;
|
||||
if(!completeProfile){
|
||||
showCompeleteDialog && showCompeleteDialog();
|
||||
}else{
|
||||
window.location.href(url);
|
||||
}
|
||||
}
|
||||
|
||||
addMenu=(list)=>{
|
||||
return(
|
||||
|
@ -231,21 +239,27 @@ class NewHeader extends Component {
|
|||
{
|
||||
list.map((item,key)=>{
|
||||
return(
|
||||
(item.name !=="加入课堂" && item.name !=="加入开发项目") && <Menu.Item key={item.name+key}><a href={item.url}>{item.name}</a></Menu.Item>
|
||||
(item.name !=="加入课堂" && item.name !=="加入开发项目") &&
|
||||
<Menu.Item key={item.name+key}>
|
||||
<CheckProfile {...this.props} sureFunc={()=>{window.location.href=item.url}}>{item.name}</CheckProfile>
|
||||
</Menu.Item>
|
||||
)
|
||||
})
|
||||
}
|
||||
<Menu.Item><AddProjectModal showNotification={this.props.showNotification}/></Menu.Item>
|
||||
<Menu.Item>
|
||||
<AddProjectModal {...this.props} showNotification={this.props.showNotification}/>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
renderMenu=(personal)=>{
|
||||
const { current_user } = this.props;
|
||||
return(
|
||||
<Menu className="currentMenu">
|
||||
<Menu.Item>
|
||||
<span title={current_user && current_user.username}>{current_user && current_user.username}</span>
|
||||
<span className="currentName" title={current_user && current_user.username}>{current_user && current_user.username}</span>
|
||||
</Menu.Item>
|
||||
{
|
||||
personal && personal.length > 0 && personal.map((item,key)=>{
|
||||
|
@ -254,14 +268,18 @@ class NewHeader extends Component {
|
|||
)
|
||||
})
|
||||
}
|
||||
<li><Link to={`/settings/SSH`}>设置</Link></li>
|
||||
{/* <li><Link to={`/settings/profile`}>设置</Link></li> */}
|
||||
<Menu.Item><a onClick={() => this.educoderloginysl()}>退出</a></Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
}
|
||||
|
||||
handleVisibleChange = visible => {
|
||||
this.setState({ visible });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { match} = this.props;
|
||||
const { match ,resetUserInfo ,showNotification} = this.props;
|
||||
let current_user = this.props.user;
|
||||
let {
|
||||
AccountProfiletype,
|
||||
|
@ -270,6 +288,7 @@ class NewHeader extends Component {
|
|||
headtypesonClickbool,
|
||||
headtypess,
|
||||
settings,
|
||||
visible,
|
||||
} = this.state;
|
||||
/*用户名称 用户头像url*/
|
||||
let activeIndex = false;
|
||||
|
@ -347,8 +366,7 @@ class NewHeader extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
// let search_url = settings && settings.common && settings.common.search;
|
||||
let notice_url = settings && settings.common && settings.common.notice;
|
||||
let search_url = settings && settings.common && settings.common.search;
|
||||
return (
|
||||
<div className="newHeaders" id="nHeader">
|
||||
<div className="headerContent">
|
||||
|
@ -380,21 +398,21 @@ class NewHeader extends Component {
|
|||
{
|
||||
settings.navbar && settings.navbar.map((item, key) => {
|
||||
var new_link = item.link;
|
||||
var user_login = this.props.user && this.props.user.login;
|
||||
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, "users/" + user_login + "/courses")
|
||||
new_link = new_link.replace(/courses/g, user_login + "/courses")
|
||||
} else if (new_link.indexOf("contests") > -1) {
|
||||
new_link = new_link.replace(/contests/g, "users/" + user_login + "/contests")
|
||||
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, "users/" + user_login + "/user_activities")
|
||||
new_link = new_link.replace(/homes/g, user_login + "/user_activities")
|
||||
}
|
||||
|
||||
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
|
||||
|
@ -411,25 +429,30 @@ class NewHeader extends Component {
|
|||
}
|
||||
</div>
|
||||
<div className="head-right">
|
||||
{/* {search_url ? this.SearchInput(openSearch,search_url):""} */}
|
||||
<HeadSearch {...this.props}/>
|
||||
{ search_url && <HeadSearch {...this.props}/>}
|
||||
{
|
||||
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">
|
||||
<i className="iconfont icon-tianjiafangda color-grey-6 ml30"></i>
|
||||
<i className="iconfont icon-tianjiafangda color-grey-6 ml30 mr15"></i>
|
||||
</Dropdown>:""
|
||||
}
|
||||
|
||||
{this.props.user && this.props.user.login && notice_url ?
|
||||
<div className="ml30 edu-menu-panel">
|
||||
{user && user.login &&
|
||||
<a href={`${notice_url}`} style={{ position: 'relative' }}>
|
||||
<i className="iconfont icon-xiaoxilingdang color-grey-6"></i>
|
||||
<span className="newslight" style={{ display: this.props.Headertop === undefined ? "none" : this.props.Headertop.new_message === true ? "block" : "none" }}>
|
||||
</span>
|
||||
</a>
|
||||
}
|
||||
</div>:""
|
||||
{ (settings && settings.common && settings.common.notice) && (current_user && current_user.login)?
|
||||
<Popover
|
||||
overlayClassName="notice-popover"
|
||||
placement={`bottomRight`}
|
||||
content={<NoticeContent visible={visible} current_user={current_user} showNotification={showNotification} resetUserInfo={resetUserInfo}/>}
|
||||
visible={visible}
|
||||
onVisibleChange={this.handleVisibleChange}
|
||||
destroyTooltipOnHide
|
||||
>
|
||||
<Link to={"/settings/notice"} className="message-icon">
|
||||
{current_user && <Badge count={current_user.message_unread_total}>
|
||||
<i className="iconfont icon-xiaoxilingdang color-grey-6 ml15 mr15"></i>
|
||||
</Badge>}
|
||||
</Link>
|
||||
</Popover>
|
||||
: ""
|
||||
}
|
||||
</div>
|
||||
{!user || (user && !user.login) ?
|
||||
|
@ -442,7 +465,7 @@ class NewHeader extends Component {
|
|||
</span>
|
||||
:
|
||||
<Dropdown placement={`bottomRight`} overlay={this.renderMenu(settings && settings.personal)}>
|
||||
<a href={`/users/${this.props.current_user && this.props.current_user.login}`}>
|
||||
<a href={`/${this.props.current_user && this.props.current_user.login}`}>
|
||||
<img alt="头像" src={getImageUrl(`/${user.image_url}`)} className="currentImg"></img>
|
||||
</a>
|
||||
</Dropdown>
|
||||
|
|
|
@ -0,0 +1,262 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Badge, Menu } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import AppPullRefresh from './AppPullRefresh';
|
||||
import { noticeSourceType } from '../common/static';
|
||||
import './header.scss';
|
||||
import '../SecuritySetting/notice/manager/Index.scss';
|
||||
import '../SecuritySetting/Index.scss';
|
||||
import '../SecuritySetting/notice/myNotice/Index.scss';
|
||||
|
||||
|
||||
function NoticeContent({ visible, showNotification, resetUserInfo, current_user: { login } }) {
|
||||
const [initialize, setInitialize] = useState(true);
|
||||
const [noticeType, setNoticeType] = useState("notification");
|
||||
const [letterUnreadCount, setLetterUnreadCount] = useState(0);//未读私信数量
|
||||
|
||||
const [noticeUnreadCount, setNoticeUnreadCount] = useState(0);//未读系统通知数量
|
||||
const [noticePage, setNoticePage] = useState(0);
|
||||
const [noticeUnreadList, setNoticeUnreadList] = useState([]);//未读系统通知列表
|
||||
|
||||
const [atUnreadCount, setAtUnreadCount] = useState();//未读@我数量
|
||||
const [atPage, setAtPage] = useState(0);
|
||||
const [atUnreadList, setAtUnreadList] = useState([]);//未读@我列表
|
||||
|
||||
useEffect(() => {
|
||||
resetUserInfo();
|
||||
}, [noticeUnreadCount,atUnreadCount]);
|
||||
|
||||
useEffect(()=>{
|
||||
setNoticePage(0);
|
||||
setAtPage(0);
|
||||
},[visible])
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
type: noticeType,
|
||||
limit: 10,
|
||||
page: noticeType === "notification" ? noticePage : noticeType === "atme" ? atPage : "",
|
||||
status: 1,
|
||||
}
|
||||
getMessageList(params);
|
||||
}, [noticePage, atPage]);
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
type: noticeType,
|
||||
limit: 10,
|
||||
page: 0,
|
||||
status: 1,
|
||||
};
|
||||
if (initialize) {
|
||||
params.type = "atme"
|
||||
}
|
||||
visible && getMessageList(params);
|
||||
}, [visible]);
|
||||
|
||||
|
||||
function getMessageList(params) {
|
||||
axios.get(`/users/${login}/messages.json`, {
|
||||
params: params,
|
||||
}).then((response) => {
|
||||
if (response && response.data) {
|
||||
setNoticeUnreadCount(response.data.unread_notification);
|
||||
setAtUnreadCount(response.data.unread_atme);
|
||||
if (params.type === "notification") {
|
||||
let list = response.data.messages;
|
||||
if (params.page !== 0) {
|
||||
list = [...noticeUnreadList, ...list];
|
||||
}
|
||||
setNoticeUnreadList(list);
|
||||
if (initialize) {
|
||||
// 如果是第一次加载,根据数据量判断是否切换tab栏
|
||||
setInitialize(false);
|
||||
if (response.data.unread_notification === 0 && response.data.unread_atme !== 0) {
|
||||
setNoticeType("atme");
|
||||
}
|
||||
}
|
||||
} else if (params.type === "atme") {
|
||||
let list = response.data.messages;
|
||||
if (params.page !== 0) {
|
||||
list = [...atUnreadList, ...list];
|
||||
}
|
||||
setAtUnreadList(list);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function readAll() {
|
||||
axios.post(`/users/${login}/messages/read.json`, {
|
||||
type: noticeType,
|
||||
ids: [-1]
|
||||
}).then((response) => {
|
||||
let data = response.data;
|
||||
if (!data) return;
|
||||
if (data.status === 0) {
|
||||
changeReadMarkAll(noticeType);
|
||||
} else {
|
||||
showNotification(data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function changeReadMarkAll(noticeType) {
|
||||
if (noticeType === "notification") {
|
||||
let list = noticeUnreadList.slice();
|
||||
list.forEach(item => {
|
||||
item.status = 2;
|
||||
})
|
||||
setNoticeUnreadList(list);
|
||||
setNoticeUnreadCount(0);
|
||||
} else if (noticeType === "atme") {
|
||||
let list = atUnreadList.slice();
|
||||
list.forEach(item => {
|
||||
item.status = 2;
|
||||
})
|
||||
setAtUnreadList(list);
|
||||
setAtUnreadCount(0);
|
||||
}
|
||||
}
|
||||
|
||||
// const [letter_unread_list, setLetter_unread_list] = useState([
|
||||
// {
|
||||
// id: 122,
|
||||
// read: 0, //是否已读,0未读,1已读
|
||||
// send_name: "蒋宇航", //消息发送人
|
||||
// send_login: "jiangYuHang", //消息发送人的login,前端根据这个跳转到消息内页
|
||||
// content: "私信内容", //最近一条未读消息的内容
|
||||
// create_time: "2019-03-04 18:08", //发送时间
|
||||
// },
|
||||
// ]);
|
||||
|
||||
function readItem(item) {
|
||||
axios.post(`/users/${login}/messages/read.json`, {
|
||||
type: noticeType,
|
||||
ids: [item.id]
|
||||
}).then((response) => {
|
||||
let data = response.data;
|
||||
if (!data) return;
|
||||
if (data.status === 0) {
|
||||
changeReadMark(item);
|
||||
item.notification_url && window.open(item.notification_url);
|
||||
} else {
|
||||
showNotification(data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function changeReadMark(item) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="messageHoverDiv notice01">
|
||||
<div className="sshHead hoverNotice-head">
|
||||
<Menu mode="horizontal" selectedKeys={noticeType} onClick={(e) => setNoticeType(e.key)}>
|
||||
<Menu.Item key="notification"><Badge count={noticeUnreadCount}>系统通知</Badge></Menu.Item>
|
||||
{/* <Menu.Item key="1" id="item-private"><Badge count={letterUnreadCount}>私信</Badge></Menu.Item> */}
|
||||
<Menu.Item key="atme"><Badge count={atUnreadCount}>@我</Badge></Menu.Item>
|
||||
</Menu>
|
||||
</div>
|
||||
|
||||
{/* 系统通知 */}
|
||||
{noticeType === "notification" && <AppPullRefresh
|
||||
className='hoverNotice-body' // 外部添加className加以区分
|
||||
onPullRefresh={() => { setNoticePage(noticePage + 1); }} //触发加载ajax的function
|
||||
// type={2} // 传送加载组件的状态
|
||||
count={noticeUnreadList.length} // 数据当前的总数量
|
||||
pageSize={10} //
|
||||
>
|
||||
{
|
||||
noticeUnreadList.map(item => {
|
||||
return (
|
||||
<div key={item.id + Math.random()} className="noticeCont-back" onClick={() => { readItem(item) }}>
|
||||
<div className={`noticeCont ${item.notification_url?'pointer':''}`}>
|
||||
<span style={{ visibility: item.status === 1 ? 'visible' : 'hidden' }}>
|
||||
<Badge color="#FA2020" />
|
||||
</span>
|
||||
<i className={"iconfont " + noticeSourceType[item.source]}></i>
|
||||
<div className="noticeCont-text">
|
||||
<span className="content-span notice-cont-span" dangerouslySetInnerHTML={{ __html: item.content }}></span>
|
||||
<span className="timeSpan">{item.time_ago}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</AppPullRefresh>
|
||||
}
|
||||
|
||||
{/* @我 */}
|
||||
{noticeType === "atme" && <AppPullRefresh
|
||||
className='hoverNotice-body' // 外部添加className加以区分
|
||||
onPullRefresh={() => { setAtPage(atPage + 1); }} //触发加载ajax的function
|
||||
// type={1} // 传送加载组件的状态
|
||||
count={atUnreadList.length} // 数据当前的总数量
|
||||
pageSize={10} //
|
||||
>
|
||||
{atUnreadList.map(item => {
|
||||
return (
|
||||
<div key={item.id + Math.random()} className="noticeCont-back" onClick={() => { readItem(item) }}>
|
||||
<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: "<b>" + (item.sender ? item.sender.name : '') + "</b> " + item.content + " 中@我" }}></span>
|
||||
<span className="timeSpan">{item.time_ago}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</AppPullRefresh>
|
||||
}
|
||||
|
||||
{/* 私信 */}
|
||||
{/* {noticeType === "1" ? letter_unread_list.length > 0 ? letter_unread_list.map(item => {
|
||||
return (
|
||||
<div className="noticeCont-back">
|
||||
<div className="noticeCont" style={{ height: item.content.length >= 30 && item.content.length <= 34 ? '65px' : "" }}>
|
||||
<Badge color="#FA2020" />
|
||||
<div className="noticeCont-text">
|
||||
<span>{item.send_name}:</span>
|
||||
<span className="boldSpan" dangerouslySetInnerHTML={{ __html: item.content.length >= 50 ? item.content.substr(0, 50) + "..." : item.content }}></span>
|
||||
<span className="timeSpan">{item.create_time ? timeAgo(item.create_time) : "刚刚"}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}) : "暂无数据" : ""} */}
|
||||
<div className="hoverNotice-buttom">
|
||||
<Link to={{pathname:"/settings/notice",query:{noticeType:noticeType}}}>全部消息</Link>
|
||||
{noticeUnreadCount > 0 && noticeType === "notification" && <a onClick={readAll}>所有系统消息一键已读</a>}
|
||||
{atUnreadCount > 0 && noticeType === "atme" && <a onClick={readAll}>所有@我一键已读</a>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
export default NoticeContent;
|
|
@ -24,12 +24,20 @@
|
|||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: 50%;
|
||||
margin-left: 30px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.currentMenu{
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
padding:0px;
|
||||
.currentName{
|
||||
padding:0px 8px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
display: block;
|
||||
}
|
||||
li{
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
@ -119,4 +127,139 @@
|
|||
width: 110px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
// 右上角小铃铛单独样式
|
||||
.notice-popover{
|
||||
//popover小尖尖
|
||||
.ant-popover-arrow{
|
||||
display: none;
|
||||
}
|
||||
|
||||
//popover框
|
||||
.ant-popover-inner-content {
|
||||
width: 386px;
|
||||
height: 446px;
|
||||
box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5);
|
||||
border-radius: 4px;
|
||||
margin-top: -10px;
|
||||
padding: 12px 1px 12px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.messageHoverDiv .ant-menu-item{
|
||||
margin-right: 24px !important;
|
||||
}
|
||||
|
||||
.hoverNotice-head{
|
||||
margin-left: 18px;
|
||||
|
||||
& .ant-badge{
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
&>.ant-menu-horizontal {
|
||||
border-bottom: 1px solid #e8e8e8 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.hoverNotice-body{
|
||||
height: 342px;
|
||||
overflow-y: scroll;
|
||||
|
||||
& b{
|
||||
font-weight: 400;
|
||||
text-shadow: 0.5px 0 0 #333;
|
||||
}
|
||||
|
||||
.none_panels{
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.message-icon{
|
||||
position: relative;
|
||||
.ant-scroll-number{
|
||||
right:12px;
|
||||
padding: 0 0px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.hoverNotice-buttom{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 12px 18px;
|
||||
a{
|
||||
color: #466AFF;
|
||||
&:hover{
|
||||
opacity:0.85;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.noticeCont-back{
|
||||
.pointer{
|
||||
cursor: pointer;
|
||||
}
|
||||
&:hover{
|
||||
background: #F3F4F6;
|
||||
}
|
||||
}
|
||||
|
||||
.noticeCont{
|
||||
display: flex;
|
||||
margin: 0 16px 0 18px;
|
||||
padding: 12px 0 10px 0;
|
||||
line-height: 24px;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
cursor: default;
|
||||
i{
|
||||
font-size: 14px !important;
|
||||
margin-right: 6px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.boldSpan{
|
||||
font-weight: 400;
|
||||
text-shadow: 0.5px 0 0 #333;
|
||||
}
|
||||
|
||||
.noticeCont-text{
|
||||
display: flex;
|
||||
color:#333333;
|
||||
flex:auto;
|
||||
justify-content: space-between;
|
||||
|
||||
& .content-span{
|
||||
word-break: break-all;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
& .atme-cont-span{
|
||||
width: 272px;
|
||||
}
|
||||
|
||||
& .notice-cont-span{
|
||||
width: 255px;
|
||||
}
|
||||
|
||||
.timeSpan{
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.at-name{
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text-center{
|
||||
text-align: center;
|
||||
}
|
|
@ -12,8 +12,9 @@ import Loadable from "react-loadable";
|
|||
import Loading from "../Loading";
|
||||
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
|
||||
|
||||
|
||||
const ProjectNew = Loadable({
|
||||
loader: () => import("./New/Index"),
|
||||
loader: () => import("./New/Index"),
|
||||
loading: Loading,
|
||||
});
|
||||
const ProjectIndex = Loadable({
|
||||
|
@ -21,21 +22,23 @@ const ProjectIndex = Loadable({
|
|||
loading: Loading,
|
||||
});
|
||||
|
||||
const ProjectDetail = Loadable({
|
||||
loader: () => import("./Main/Detail"),
|
||||
loading: Loading,
|
||||
});
|
||||
// 项目详情放在用户和组织下作为二级菜单存在
|
||||
// const ProjectDetail = Loadable({
|
||||
// loader: () => import("./Main/Detail"),
|
||||
// loading: Loading,
|
||||
// });
|
||||
|
||||
class Index extends Component {
|
||||
|
||||
componentDidUpdate=()=>{
|
||||
this.props.history.listen(()=>{
|
||||
componentDidUpdate = () => {
|
||||
this.props.history.listen(() => {
|
||||
if (document.body.scrollTop || document.documentElement.scrollTop > 0) {
|
||||
window.scrollTo(0, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
render() {
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<Switch {...this.props}>
|
||||
|
@ -52,23 +55,24 @@ class Index extends Component {
|
|||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/projects/new"
|
||||
path="/projects/mirror/new"
|
||||
render={(props) => (
|
||||
<ProjectNew {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/projects/:owner/:projectsId"
|
||||
{/* <Route
|
||||
path="/:owner/:projectsId"
|
||||
render={(props) => (
|
||||
<ProjectDetail {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
></Route> */}
|
||||
<Route
|
||||
path="/projects"
|
||||
path="/explore"
|
||||
render={(props) => (
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/"
|
||||
render={(props) => (
|
||||
|
@ -86,3 +90,10 @@ export default withRouter(
|
|||
parentSelector: ".newMain",
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index))))
|
||||
);
|
||||
|
||||
// export default withRouter(
|
||||
// ImageLayerOfCommentHOC({
|
||||
// imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||
// parentSelector: ".newMain",
|
||||
// })(Index)
|
||||
// );
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { WhiteBack , Box , LongWidth , ShortWidth , Gap , AlignCenter , FlexAJ } from '../Component/layout';
|
||||
import { Dropdown , Menu , Divider , Spin, Button } from 'antd';
|
||||
import { Dropdown , Menu , Divider , Spin, Button , Typography } from 'antd';
|
||||
import { getImageUrl } from "educoder";
|
||||
import { Link } from 'react-router-dom';
|
||||
import { truncateCommitId } from "../common/util";
|
||||
import CloneAddress from '../Branch/CloneAddress';
|
||||
|
||||
import SelectBranch from '../Branch/Select';
|
||||
|
@ -20,10 +21,12 @@ import DrawerPanel from '../Component/DrawerPanel';
|
|||
import UpdateDescModal from './sub/UpdateDescModal';
|
||||
import Nodata from '../Nodata';
|
||||
import Invite from './sub/Invite';
|
||||
import CheckProfile from '../Component/ProfileModal/Profile';
|
||||
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');
|
||||
|
@ -65,6 +68,7 @@ function CoderDepot(props){
|
|||
const [ editReadme , setEditReadme ] = useState(false);
|
||||
const [ pullsFlag , setPullsFlag ] = useState(true);
|
||||
const [ issuesFlag , setIssuesFlag ] = useState(true);
|
||||
const [ releaseVersions , setReleaseVersions] = useState(undefined);
|
||||
|
||||
const owner = props.match.params.owner;
|
||||
const projectsId = props.match.params.projectsId;
|
||||
|
@ -72,7 +76,8 @@ function CoderDepot(props){
|
|||
branchName = returnbar(branchName);
|
||||
const details = props.projectDetail;
|
||||
let pathname = props.history.location.pathname;
|
||||
|
||||
//distribution:判断此用户是否可以创建发行版
|
||||
const distribution = details && details.type != 2 && (details.permission === "Admin" || details.permission === "Owner" || details.permission === "Manager");
|
||||
const { bannerList } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
|
@ -112,19 +117,52 @@ function CoderDepot(props){
|
|||
useEffect(()=>{
|
||||
if (projectsId && owner && defaultBranch){
|
||||
let b = turnbar(branchName) ;
|
||||
if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) {
|
||||
if(pathname.indexOf(`/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) {
|
||||
let url = pathname.split(`/tree/${b}/`)[1];
|
||||
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])
|
||||
|
||||
useEffect(()=>{
|
||||
axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{
|
||||
if(result && result.data){
|
||||
const release = {
|
||||
"list":result.data.releases,
|
||||
"total_count":result.data.releases.length
|
||||
}
|
||||
setReleaseVersions(release);
|
||||
}
|
||||
})
|
||||
},[])
|
||||
|
||||
// 获取readme信息
|
||||
function getReadmeInfo(path, ref) {
|
||||
axios.get(`/${owner}/${projectsId}/readme.json`, {
|
||||
params:{
|
||||
owner: owner,
|
||||
repo: projectsId,
|
||||
filepath:path,
|
||||
ref:ref || branchName
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
setReadme(result.data);
|
||||
} else {
|
||||
setReadme(undefined);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取主目录列表
|
||||
function getDirInfo(branch){
|
||||
setIsSpin(true);
|
||||
|
@ -144,9 +182,10 @@ function CoderDepot(props){
|
|||
setLastCommitAuthor(c && c.committer);
|
||||
setMainFlag(true);
|
||||
setReadOnly(true);
|
||||
setReadme(result.data.readme);
|
||||
// setReadme(result.data.readme);
|
||||
setEditReadme(false);
|
||||
setHide(true);
|
||||
getReadmeInfo('', branchName || defaultBranch);
|
||||
}
|
||||
setTimeout(function(){setIsSpin(false);},500);
|
||||
}).catch(error=>{setIsSpin(false);})
|
||||
|
@ -158,7 +197,7 @@ function CoderDepot(props){
|
|||
let ele = document.getElementById("ptxt");
|
||||
if(ele){
|
||||
let h = ele.offsetHeight;
|
||||
if( h > 18 ) setHideBtn(true);
|
||||
if( h > 35 ) setHideBtn(true);
|
||||
}
|
||||
}
|
||||
},[projectDetail,lastCommit])
|
||||
|
@ -179,15 +218,18 @@ function CoderDepot(props){
|
|||
setDirInfo(undefined);
|
||||
setFileInfo(en);
|
||||
setType(en.type);
|
||||
setReadme(undefined);
|
||||
}else{
|
||||
setFileInfo(undefined);
|
||||
setDirInfo(en);
|
||||
setType("dir");
|
||||
getReadmeInfo(path, branchName || defaultBranch);
|
||||
}
|
||||
let c = result.data.last_commit
|
||||
setLastCommit(c && c.commit);
|
||||
setLastCommitAuthor(c && c.committer);
|
||||
setMainFlag(false);
|
||||
setReadOnly(true);
|
||||
setReadOnly(!editReadme);
|
||||
setHide(true);
|
||||
}
|
||||
|
@ -198,7 +240,7 @@ function CoderDepot(props){
|
|||
// 切换分支或者标签
|
||||
function changeBranch(value){
|
||||
let checkvalue = turnbar(value);
|
||||
let url = `/projects/${owner}/${projectsId}${value && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`;
|
||||
let url = `/${owner}/${projectsId}${value && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`;
|
||||
props.history.push(url);
|
||||
}
|
||||
|
||||
|
@ -207,9 +249,13 @@ function CoderDepot(props){
|
|||
let b = branchName || defaultBranch;
|
||||
let checkvalue = turnbar(b);
|
||||
return (
|
||||
<Menu>
|
||||
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${checkvalue}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件</a></Menu.Item>
|
||||
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${checkvalue}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件</a></Menu.Item>
|
||||
<Menu className="fileMenu">
|
||||
<Menu.Item>
|
||||
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/${checkvalue}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件</CheckProfile>
|
||||
</Menu.Item>
|
||||
<Menu.Item>
|
||||
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/${checkvalue}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件</CheckProfile>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
}
|
||||
|
@ -228,12 +274,12 @@ function CoderDepot(props){
|
|||
setTreeValue(undefined);
|
||||
let branch = branchName || defaultBranch;
|
||||
let checkvalue = turnbar(branch);
|
||||
props.history.push(`/projects/${owner}/${projectsId}/tree/${checkvalue}`);
|
||||
props.history.push(`/${owner}/${projectsId}/tree/${checkvalue}`);
|
||||
};
|
||||
// 子目录路径返回链接
|
||||
function returnUlr(url){
|
||||
let enBranch = turnbar(branchName);
|
||||
props.history.push(`/projects/${owner}/${projectsId}/tree${enBranch?`/${enBranch}`:""}/${url}`);
|
||||
props.history.push(`/${owner}/${projectsId}/tree${enBranch?`/${enBranch}`:""}/${url}`);
|
||||
}
|
||||
// 点击跳转到子目录
|
||||
function goToSubRoot(path,type,filename){
|
||||
|
@ -241,7 +287,7 @@ function CoderDepot(props){
|
|||
let enBranch = branchName || defaultBranch;
|
||||
let checkvalue = turnbar(enBranch);
|
||||
setType(type);
|
||||
props.history.push(`/projects/${owner}/${projectsId}${`/tree/${checkvalue}`}${path?`/${path}`:""}`);
|
||||
props.history.push(`/${owner}/${projectsId}${`/tree/${checkvalue}`}${path?`/${path}`:""}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -253,7 +299,7 @@ function CoderDepot(props){
|
|||
//点击直接跳转页面 加载一次路由
|
||||
let enBranch = branchName || defaultBranch;
|
||||
let checkvalue = turnbar(enBranch);
|
||||
props.history.push(`/projects/${owner}/${projectsId}/tree/${checkvalue}/${path}`);
|
||||
props.history.push(`/${owner}/${projectsId}/tree/${checkvalue}/${path}`);
|
||||
setType("file");
|
||||
setEditReadme(true);
|
||||
};
|
||||
|
@ -295,8 +341,10 @@ function CoderDepot(props){
|
|||
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
|
||||
|
||||
const { current_user } = props;
|
||||
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter";
|
||||
const baseOper = current_user && current_user.login && issuesFlag;
|
||||
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(
|
||||
<WhiteBack>
|
||||
<UpdateDescModal desc={desc} website={website} lesson_url={lesson_url} visible={openModal} onCancel={()=>setOpenModal(false)} onOk={okUpdate}/>
|
||||
|
@ -315,7 +363,7 @@ function CoderDepot(props){
|
|||
list = {mainFlag ? dirInfo : undefined}
|
||||
/>
|
||||
<div className="drawerBtn" onClick={()=>setVisible(true)}>
|
||||
<i className="iconfont icon-youjiantou font-16"></i>
|
||||
<i className="iconfont icon-zuohuaicon font-14"></i>
|
||||
<span>目录</span>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
@ -328,7 +376,7 @@ function CoderDepot(props){
|
|||
<div className="panelmenu">
|
||||
<FlexAJ>
|
||||
<AlignCenter>
|
||||
<div className="mr20">
|
||||
<div className="mr30">
|
||||
{
|
||||
props && props.platform ?
|
||||
<SelectBranch
|
||||
|
@ -341,76 +389,89 @@ function CoderDepot(props){
|
|||
branchList={projectDetail && projectDetail.branches && projectDetail.branches.list}
|
||||
></SelectBranch>
|
||||
:
|
||||
<span>分支:<span className="color-grey-6">{branchName || defaultBranch}</span></span>
|
||||
<span>分支:<span className="color-grey-6">{branchName || defaultBranch}</span></span>
|
||||
}
|
||||
</div>
|
||||
<AlignCenter className="mr20">
|
||||
<Link to={`/projects/${owner}/${projectsId}/branchs`} className="color-grey-9">
|
||||
<i className="iconfont icon-fenzhi2 font-18 color-grey-9 mr3"></i>
|
||||
<span className="color-grey-6 mr3">{projectDetail && projectDetail.branches && projectDetail.branches.total_count}个</span>分支
|
||||
</Link>
|
||||
</AlignCenter>
|
||||
<AlignCenter className="mr20">
|
||||
<Link to={`/projects/${owner}/${projectsId}/tag`} className="color-grey-9">
|
||||
<i className="iconfont icon-biaoqian3 font-16 color-grey-9 mr3"></i>
|
||||
<span className="color-grey-6 mr3">{projectDetail && projectDetail.tags && projectDetail.tags.total_count}个</span>标签
|
||||
</Link>
|
||||
</AlignCenter>
|
||||
{
|
||||
treeValuePath && treeValuePath.length > 0 ?
|
||||
<Path
|
||||
identifier={projectDetail && projectDetail.identifier}
|
||||
treeValuePath={treeValuePath}
|
||||
returnUlr={returnUlr}
|
||||
returnMain={returnMain}
|
||||
getPathUrl={getPathUrl}
|
||||
/>
|
||||
:
|
||||
<React.Fragment>
|
||||
<AlignCenter className="mr20">
|
||||
<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">
|
||||
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn">
|
||||
<i className="iconfont icon-biaoqianicon font-16"></i>
|
||||
<span>标签</span>
|
||||
<span>{projectDetail && projectDetail.tags_count}</span>
|
||||
</Link>
|
||||
</AlignCenter>
|
||||
</React.Fragment>
|
||||
}
|
||||
</AlignCenter>
|
||||
<AlignCenter>
|
||||
<AlignCenter className="depotBtn">
|
||||
{
|
||||
baseOperate && ((projectDetail.type !== 2 && pullsFlag) || issuesFlag )&&
|
||||
<div className="mr20 addOptionBtn">
|
||||
(baseOperate || baseOper) &&
|
||||
<div className="addOptionBtn">
|
||||
{
|
||||
projectDetail.type !== 2 && pullsFlag &&
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||
baseOperate &&
|
||||
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/master...${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile>
|
||||
}
|
||||
{
|
||||
issuesFlag &&
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||
baseOper &&
|
||||
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 易修</CheckProfile>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
{ fileOperate &&
|
||||
<Dropdown overlay={fileMenu()} className="mr20" trigger={['click']}>
|
||||
<Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button>
|
||||
<Dropdown
|
||||
overlay={fileMenu()}
|
||||
className="mr10"
|
||||
trigger={['click']}
|
||||
getPopupContainer={document.parentNode}
|
||||
>
|
||||
<a>文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-6 mr-5"></i></a>
|
||||
</Dropdown>
|
||||
}
|
||||
|
||||
<Dropdown overlay={downloadMenu} placement="bottomRight" trigger={['click']}>
|
||||
<Button type={'primary'}>下载 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-white"></i></Button>
|
||||
<Button type={'primary'}>下载 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-white mr-3"></i></Button>
|
||||
</Dropdown>
|
||||
</AlignCenter>
|
||||
</FlexAJ>
|
||||
{
|
||||
dirInfo || fileInfo ?
|
||||
(dirInfo && dirInfo.length>0) || fileInfo ?
|
||||
<div className="listtable">
|
||||
{
|
||||
lastCommit &&
|
||||
<div className="listtablehead">
|
||||
<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">{lastCommit && lastCommit.message}</pre>
|
||||
<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="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
||||
{ commitCount ? <Link to={`/projects/${owner}/${projectsId}/commits/branch/${turnbar(branchName || defaultBranch)}`} className="ml12 color-grey-9">
|
||||
<i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交
|
||||
</Link>:"" }
|
||||
<span className="ml20 color-grey-6 font-12 mt3">{lastCommit.time_from_now}</span>
|
||||
{
|
||||
commitCount ?
|
||||
<Link to={`/${owner}/${projectsId}/commits/branch/${turnbar(branchName || defaultBranch)}`} className="ml20 color-grey-3"style={{height:"28px",lineHeight:"28px"}}>
|
||||
<i className="iconfont icon-tijiaoicon mr3 font-16"></i><span style={{fontWeight:"500"}}>{commitCount}次提交</span>
|
||||
</Link>:""
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<ul className="listtablebody">
|
||||
{
|
||||
treeValuePath && treeValuePath.length > 0 &&
|
||||
<Path
|
||||
identifier={projectDetail && projectDetail.identifier}
|
||||
treeValuePath={treeValuePath}
|
||||
returnUlr={returnUlr}
|
||||
returnMain={returnMain}
|
||||
getPathUrl={getPathUrl}
|
||||
/>
|
||||
}
|
||||
{
|
||||
dirInfo && dirInfo.length > 0 &&
|
||||
dirInfo.map((item,key)=>{
|
||||
|
@ -441,78 +502,80 @@ function CoderDepot(props){
|
|||
: ""
|
||||
}
|
||||
{
|
||||
(dirInfo && dirInfo.length === 0) && (fileInfo && fileInfo.length === 0) ? <Nodata _html="暂未发现文件"/> :""
|
||||
(dirInfo && dirInfo.length === 0) && !fileInfo ? <Nodata _html="暂未发现文件"/> :""
|
||||
}
|
||||
{/* readme文件显示(显示文件详情时不显示readme文件) */}
|
||||
{ dirInfo && (readme && readme.content) ? <ReadMe ChangeFile={ChangeFile} readme={readme} operate={props && (props.isManager || props.isDeveloper) && projectDetail.type !==2 } history={props.history} /> :"" }
|
||||
{ (readme && readme.content) ? <ReadMe ChangeFile={ChangeFile} readme={readme} operate={props && (props.isManager || props.isDeveloper) && projectDetail.type !==2 } history={props.history} /> :"" }
|
||||
</div>
|
||||
</LongWidth>
|
||||
{
|
||||
!fileInfo &&
|
||||
(!(treeValuePath && treeValuePath.length > 0) && !fileInfo) &&
|
||||
<ShortWidth>
|
||||
<Gap style={{paddingLeft:"30px"}}>
|
||||
<div className="panelmenu">
|
||||
<FlexAJ className="font-18 color-grey-6 mb20" style={{lineHeight:"28px"}}>简介
|
||||
{projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner") && <i onClick={()=>setOpenModal(true)} className="iconfont icon-anquanshezhi color-grey-9 font-15"></i>}
|
||||
<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"></i>
|
||||
}
|
||||
</FlexAJ>
|
||||
{desc && <p className="font-14 color-grey-9 mb15 task-hide-2" style={{lineHeight:"22px",WebkitLineClamp:"4",textAlign:"justify",wordBreak:"break-all"}}>{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 &&
|
||||
<p className="color-grey-6 df">
|
||||
<i className="iconfont icon-lianjie2 font-15 mr10 color-grey-9"></i>
|
||||
<a href={website} className="color-grey-6" target="_blank" style={{wordBreak:"break-all",lineHeight:"20px",marginTop:"5px",textDecoration:"underline"}}>{website}</a>
|
||||
</p>
|
||||
<div className="color-grey-6 df pinfos mb5">
|
||||
<i className="iconfont icon-lianjie2 font-15 mr10"></i>
|
||||
<a href={website} target="_blank" style={{wordBreak:"break-all",lineHeight:"20px",marginTop:"5px",textDecoration:"underline"}}>{website}</a>
|
||||
</div>
|
||||
}
|
||||
<p>
|
||||
<i className="iconfont icon-wenjian4 font-15 mr10 color-grey-9"></i>
|
||||
<a href="#readme" className="color-grey-6">README.md</a>
|
||||
</p>
|
||||
<p className="color-grey-6">
|
||||
<i className="iconfont icon-dataBase font-15 mr10 color-grey-6"></i>
|
||||
<div className="pinfos mb5">
|
||||
<i className="iconfont icon-zishuwenjian_icon font-15 mr10"></i>
|
||||
<a href="#readme">README.md</a>
|
||||
</div>
|
||||
<div className="color-grey-6 mb5">
|
||||
<i className="iconfont icon-neicunicon font-15 mr10"></i>
|
||||
<span>{projectDetail && projectDetail.size}</span>
|
||||
</p>
|
||||
</div>
|
||||
{
|
||||
projectDetail && projectDetail.license_name &&
|
||||
<p className="color-grey-6">
|
||||
<i className="iconfont icon-tianping font-16 mr10 color-grey-3"></i>
|
||||
<span>{projectDetail.license_name}</span>
|
||||
</p>
|
||||
<div className="pinfos">
|
||||
<i className="iconfont icon-xieyiicon font-16 mr10"></i>
|
||||
<Link to={`/${owner}/${projectsId}/tree/${branchName || defaultBranch}/LICENSE`} className="color-grey-6">{projectDetail.license_name}</Link>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
{
|
||||
inviteCode &&
|
||||
<div>
|
||||
<Divider />
|
||||
<Invite code={inviteCode} className={"detailsCode"}/>
|
||||
<Invite code={inviteCode}/>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
lesson_url &&
|
||||
<div>
|
||||
<Divider />
|
||||
<p className="font-16 color-grey-6">实践课程</p>
|
||||
<p className="font-16 color-ooo">实践课程</p>
|
||||
<a href={lesson_url} target="_blank" className="color-grey-6" style={{textDecoration:"underline",wordBreak:"break-all"}}>{lesson_url}</a>
|
||||
</div>
|
||||
}
|
||||
{/* 发布 */}
|
||||
{
|
||||
projectDetail && projectDetail.release_versions &&
|
||||
releaseVersions &&
|
||||
<React.Fragment>
|
||||
<Divider />
|
||||
<Releases
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
releaseVersions={projectDetail.release_versions}
|
||||
releaseVersions={releaseVersions}
|
||||
history={props.history}
|
||||
baseOperate={baseOperate}
|
||||
projectType={projectDetail.type}
|
||||
distribution={distribution}
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
{/* 贡献者 */}
|
||||
{
|
||||
projectDetail && projectDetail.contributors &&
|
||||
<Contributors contributors={projectDetail && projectDetail.contributors} owner={owner} projectsId={projectsId} />
|
||||
projectDetail && projectDetail.contributors && projectDetail.contributors.total_count >0 &&
|
||||
<Contributors contributors={projectDetail.contributors} owner={owner} projectsId={projectsId} />
|
||||
}
|
||||
{/* 语言 */}
|
||||
{ projectDetail && projectDetail.languages &&
|
||||
|
|
|
@ -4,8 +4,8 @@ import { truncateCommitId } from '../common/util';
|
|||
|
||||
const typeIco = {
|
||||
"submodule":"icon-file-submodule font-17",
|
||||
"file":'icon-wenjia font-15',
|
||||
"dir":"icon-wenjianjia1 font-15"
|
||||
"file":'icon-wenjian6 font-15 color-blue-file',
|
||||
"dir":"icon-wenjianjia4 font-15 color-blue_4C"
|
||||
}
|
||||
|
||||
function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){
|
||||
|
@ -13,15 +13,15 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){
|
|||
<li>
|
||||
<span>
|
||||
<a onClick={()=>goToSubRoot(item.path,item.type,item.name)} className={item.type === "submodule" && "submoduleStyle"}>
|
||||
<i className={`iconfont ${typeIco[`${item.type}`]} color-green-file mr5`}></i>{item.name}
|
||||
<i className={`iconfont ${typeIco[`${item.type}`]} mr8`}></i>{item.name}
|
||||
</a>
|
||||
</span>
|
||||
<span title="init project">
|
||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
|
||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
|
||||
{item.commit && item.commit.message}
|
||||
</Link>
|
||||
</span>
|
||||
<span>{item.commit && item.commit.time_from_now}</span>
|
||||
<span title={item.commit && item.commit.created_at}>{item.commit && item.commit.time_from_now}</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { result } from 'lodash';
|
||||
import React from 'react';
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import RenderHtml from '../../components/render-html';
|
||||
import { AlignCenter } from '../Component/layout';
|
||||
import { Dropdown , Menu , Spin } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Dropdown , Anchor , Spin } from 'antd';
|
||||
|
||||
import ReadmeCatelogue from './sub/ReadmeCatelogue';
|
||||
const $ = window.$;
|
||||
|
||||
function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
||||
|
@ -23,49 +24,45 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
|||
const anchor = el.id;
|
||||
const level = el.tagName.replace("H", "");
|
||||
const href = `#${anchor}`;
|
||||
return { href:`${path}${href}`,text:el.textContent , level:level }
|
||||
return { href:`${href}`,text:el.textContent , level:level }
|
||||
});
|
||||
setMenuList(items);
|
||||
},[content])
|
||||
|
||||
function menu(){
|
||||
if(menuList && menuList.length > 0){
|
||||
let hash = history.location.hash;
|
||||
return(
|
||||
<Menu className="menuslist">
|
||||
{
|
||||
menuList.map((item,key)=>{
|
||||
return(
|
||||
<Menu.Item key={item.id} className={decodeURI(hash).indexOf(item.text)>-1 ?"active":""}><Link to={`${item.href}`} style={{paddingLeft:`${item.level *10}px`}} title={item.text}>{item.text}</Link></Menu.Item>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Menu>
|
||||
<ReadmeCatelogue menuList={menuList} hash={history.location.hash}/>
|
||||
)
|
||||
}else{
|
||||
return <Spin />
|
||||
}
|
||||
}
|
||||
|
||||
return(
|
||||
<div className="commonBox" id="readme">
|
||||
<div className="commonBox-title boxTitle">
|
||||
<AlignCenter>
|
||||
<Dropdown overlay={menu()}>
|
||||
<span className="catelogue">
|
||||
<i className="iconfont icon-zhangjie1 font-14 mr5"></i>
|
||||
<span>目录</span>
|
||||
</span>
|
||||
</Dropdown>
|
||||
<span className="commonBox-title-read">README.md</span>
|
||||
</AlignCenter>
|
||||
{
|
||||
operate ?
|
||||
<a className="ml20 pull-right" onClick={() =>ChangeFile(readme && readme.path, false)}>
|
||||
<i className="iconfont icon-bianji6 font-16 color-blue"></i>
|
||||
</a>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
<div className="commonBox readBox" id="readme">
|
||||
<Anchor offsetTop={70} targetOffset={160}>
|
||||
<div className="commonBox-title boxTitle">
|
||||
<AlignCenter>
|
||||
<Dropdown overlay={menu()} trigger={['hover']} overlayClassName="menuslist">
|
||||
<span className="catelogue">
|
||||
<i className="iconfont icon-muluicon font-12 mr5"></i>
|
||||
<span>目录</span>
|
||||
</span>
|
||||
</Dropdown>
|
||||
|
||||
<span className="commonBox-title-read"><a href="#readme ">README.md</a></span>
|
||||
|
||||
</AlignCenter>
|
||||
{
|
||||
operate ?
|
||||
<a className="ml20 pull-right" onClick={() =>ChangeFile(readme && readme.path, false)}>
|
||||
<i className="iconfont icon-a-bianji font-17 color-grey-6"></i>
|
||||
</a>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
</Anchor>
|
||||
{
|
||||
content &&
|
||||
<div className="commonBox-info">
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Dropdown , Menu , Icon , Tooltip , Spin } from 'antd';
|
|||
import { truncateCommitId } from '../common/util';
|
||||
import { getBranch } from '../GetData/getData';
|
||||
import Nodata from '../Nodata';
|
||||
import './list.css';
|
||||
import './list.scss';
|
||||
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
import React , { Component } from 'react';
|
||||
import { Spin , Pagination } from 'antd';
|
||||
import { Spin , Pagination, Timeline } from 'antd';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import { truncateCommitId } from '../common/util';
|
||||
import { truncateCommitId ,timeFormat } from '../common/util';
|
||||
import { AlignTop } from '../Component/layout';
|
||||
import SelectBranch from '../Branch/Select';
|
||||
import Nodata from '../Nodata';
|
||||
|
||||
import User from '../Component/User';
|
||||
import RenderHtml from '../../components/render-html.jsx';
|
||||
import Tree from './img/tree.png';
|
||||
import axios from 'axios';
|
||||
import {Link} from "react-router-dom";
|
||||
import CopyTool from '../Component/CopyTool';
|
||||
|
||||
import './tree/Index.scss'
|
||||
|
||||
function returnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("%2F")>-1){
|
||||
|
@ -15,14 +21,16 @@ function returnbar(str){
|
|||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
//代码库--提交页面
|
||||
class CoderRootCommit extends Component{
|
||||
constructor(props){
|
||||
super(props)
|
||||
super(props);
|
||||
this.state={
|
||||
commitDatas:undefined,
|
||||
dataCount:undefined,
|
||||
limit:20,
|
||||
page:1,
|
||||
limit:10,
|
||||
page: 1,
|
||||
isSpining:false,
|
||||
branchList:undefined
|
||||
}
|
||||
|
@ -50,20 +58,34 @@ class CoderRootCommit extends Component{
|
|||
this.Init();
|
||||
}
|
||||
}
|
||||
|
||||
UrlParamHash(url){
|
||||
const params = {};
|
||||
let h;
|
||||
let hash = url.slice(url.indexOf('?')+1).split('&');
|
||||
for(let i = 0; i<hash.length;i++){
|
||||
h = hash[i].split('=');
|
||||
params[h[0]] = h[1];
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
Init =()=>{
|
||||
const { branchName } = this.props.match.params;
|
||||
const { page , limit } = this.state;
|
||||
const { limit } = this.state;
|
||||
const {search} = this.props.location;
|
||||
const realPage = (search && this.UrlParamHash(search).page) ? parseInt(this.UrlParamHash(search).page) : 1;
|
||||
this.setState({
|
||||
isSpining:true
|
||||
isSpining:true,
|
||||
page:realPage
|
||||
})
|
||||
this.getCommitList( branchName , page , limit );
|
||||
this.getCommitList( branchName , realPage , limit );
|
||||
}
|
||||
|
||||
getCommitList=(branch , page , limit)=>{
|
||||
this.setState({
|
||||
isSpining:true
|
||||
})
|
||||
console.log(returnbar(branch));
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/commits.json`;
|
||||
axios.get(url,{
|
||||
|
@ -86,7 +108,8 @@ class CoderRootCommit extends Component{
|
|||
image_url:item.author && item.author.image_url,
|
||||
sha:item.sha,
|
||||
time_from_now:item.time_from_now,
|
||||
message:item.message
|
||||
message:item.message,
|
||||
timestamp:item.timestamp
|
||||
})
|
||||
})
|
||||
this.setState({
|
||||
|
@ -101,14 +124,13 @@ class CoderRootCommit extends Component{
|
|||
// 切换分支 search:tag为根据标签搜索
|
||||
changeBranch=(value)=>{
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
this.props.history.push(`/projects/${owner}/${projectsId}/commits/branch/${value}`);
|
||||
this.props.history.push(`/${owner}/${projectsId}/commits/branch/${value}`);
|
||||
}
|
||||
|
||||
ChangePage=(page)=>{
|
||||
const { branchName } = this.props.match.params;
|
||||
const { limit } = this.state;
|
||||
this.getCommitList(branchName , page , limit);
|
||||
this.props.history.push({pathname: this.props.history.location.pathname,search: `page=${page}`})
|
||||
}
|
||||
|
||||
render(){
|
||||
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
||||
const { projectDetail, commit_class , defaultBranch } = this.props;
|
||||
|
@ -129,46 +151,50 @@ class CoderRootCommit extends Component{
|
|||
></SelectBranch>
|
||||
</div>
|
||||
<Spin spinning={isSpining}>
|
||||
<div className="commonBox">
|
||||
<div className="commonBox-title">
|
||||
<div className="f-wrap-between" style={{alignItems:"center"}}>
|
||||
<span className="font-16">{dataCount}次提交代码({branch})</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="commitList">
|
||||
{
|
||||
commitDatas && commitDatas.length > 0 && commitDatas.map((item,k)=>{
|
||||
return(
|
||||
<div key={k}>
|
||||
<AlignTop>
|
||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0,marginTop:"3px"}}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitDesc">{item.message}</Link>
|
||||
</AlignTop>
|
||||
<p className="f-wrap-alignCenter mt15">
|
||||
{
|
||||
item.id ?
|
||||
<Link to={`/users/${item.login}`} className="show-user-link">
|
||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
||||
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
|
||||
</Link>:
|
||||
<span className="show-user-link">
|
||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
||||
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
|
||||
</span>
|
||||
}
|
||||
|
||||
</p>
|
||||
<Timeline className="commitList">
|
||||
{
|
||||
commitDatas && commitDatas.length > 0 && commitDatas.map((item,k)=>{
|
||||
return(
|
||||
<Timeline.Item key={k} dot={page ===1 && k===0 ?<span className="new-conmmit">最新</span>:<i className="iconfont icon-a-yuanquan2x"></i>}>
|
||||
<div className="commitList-item f-wrap-between">
|
||||
<div>
|
||||
<AlignTop>
|
||||
<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
|
||||
id={item.id}
|
||||
url={(item.image_url && getImageUrl(`/${item.image_url}`)) || "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
||||
name={item.name}
|
||||
login={item.login}
|
||||
/>
|
||||
{item.timestamp && <label className="font-14 color-grey-3 ml3">提交于 {timeFormat(item.timestamp)}</label>}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<div className="treecopy">
|
||||
<div>
|
||||
<span className="treecopy-cont shadow">
|
||||
<img src={Tree} alt="sha" width={"16px"}/>
|
||||
<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}`}/>
|
||||
</div>
|
||||
<button className="btn-83" onClick={()=>{window.location.href=`/${owner}/${projectsId}/tree/${truncateCommitId(item.sha)}`}}>浏览文件</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
{commitDatas && commitDatas.length === 0 && <Nodata _html="暂无数据"/>}
|
||||
</div>
|
||||
</div>
|
||||
</Timeline.Item>
|
||||
)
|
||||
})
|
||||
}
|
||||
{commitDatas && commitDatas.length === 0 && <Nodata _html="暂无数据"/>}
|
||||
</Timeline>
|
||||
{
|
||||
dataCount > limit ?
|
||||
<div className="edu-txt-center pt30 mb30">
|
||||
<Pagination simple defaultCurrent={page} total={dataCount} pageSize={limit} onChange={this.ChangePage}></Pagination>
|
||||
<Pagination simple current={page} total={dataCount} pageSize={limit} onChange={this.ChangePage}></Pagination>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import React, { Component } from "react";
|
||||
import { Popconfirm , Select } from "antd";
|
||||
import "./list.css";
|
||||
import { Popconfirm , Select , Dropdown , Spin , Anchor } from "antd";
|
||||
import "./list.scss";
|
||||
import axios from "axios";
|
||||
import Meditor from "../Newfile/m_editor";
|
||||
import RenderHtml from "../../components/render-html";
|
||||
import ReadmeCatelogue from "./sub/ReadmeCatelogue";
|
||||
|
||||
const $ = window.$;
|
||||
function bytesToSize(bytes) {
|
||||
if (bytes === 0) return "0 B";
|
||||
let k = 1024,
|
||||
|
@ -19,11 +21,13 @@ class CoderRootFileDetail extends Component {
|
|||
value: undefined,
|
||||
language: undefined,
|
||||
languages: undefined,
|
||||
description: props.detail.content
|
||||
description: props.detail.content,
|
||||
menuList:undefined
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
window.scrollTo(0, 0);
|
||||
const { detail , mdFlag } = this.props;
|
||||
this.setState({
|
||||
value: detail.content,
|
||||
|
@ -149,7 +153,7 @@ class CoderRootFileDetail extends Component {
|
|||
.then((result) => {
|
||||
if (result) {
|
||||
this.props.showNotification("删除成功!");
|
||||
this.props.history.push(`/projects/${owner}/${projectsId}`);
|
||||
this.props.history.push(`/${owner}/${projectsId}`);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -169,6 +173,31 @@ class CoderRootFileDetail extends Component {
|
|||
});
|
||||
};
|
||||
|
||||
renderMenulist=()=>{
|
||||
const { description } = this.state;
|
||||
if(description){
|
||||
const items = $.map($("#files-md").find("h1,h2,h3,h4,h5,h6"), function (el, _) {
|
||||
const anchor = el.id;
|
||||
const level = el.tagName.replace("H", "");
|
||||
const href = `#${anchor}`;
|
||||
return { href:`${href}`,text:el.textContent , level:level }
|
||||
});
|
||||
return items;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
menu=()=>{
|
||||
const menuList = this.renderMenulist();
|
||||
if(menuList && menuList.length > 0){
|
||||
return(
|
||||
<ReadmeCatelogue menuList={menuList} hash={this.props.history.location.hash}/>
|
||||
)
|
||||
}else{
|
||||
return <Spin />
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
readOnly,
|
||||
|
@ -186,79 +215,88 @@ class CoderRootFileDetail extends Component {
|
|||
const Option = Select.Option;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="grid-item branchTitle">
|
||||
<div className="grid-item">
|
||||
<span className="ml20 color-grey-6 font-16">
|
||||
<Anchor className="griditemAnchor" offsetTop={70}>
|
||||
<div className="griditemCate">
|
||||
{
|
||||
md && readOnly &&
|
||||
<Dropdown overlay={this.menu()} trigger={['hover']} overlayClassName="menuslist">
|
||||
<span className="catelogue mr20">
|
||||
<i className="iconfont icon-muluicon font-12 mr5"></i>
|
||||
<span>目录</span>
|
||||
</span>
|
||||
</Dropdown>
|
||||
}
|
||||
<span className="color-grey-6 font-16">
|
||||
{bytesToSize(detail && detail.size)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-right">
|
||||
{flag && platform && (
|
||||
<div>
|
||||
{readOnly ? (
|
||||
<span>
|
||||
{
|
||||
!detail.direct_download?
|
||||
<span>
|
||||
<a onClick={() => this.DownLoadFile(detail.download_url)} className="ml20">
|
||||
<i className="iconfont icon-xiazai1 font-15 color-grey-6"></i>
|
||||
</a>
|
||||
{
|
||||
type !==2 &&
|
||||
<a onClick={() => this.EditFile(false)} className="ml20">
|
||||
<i className="iconfont icon-bianji1 font-15 color-grey-6"></i>
|
||||
{flag && platform && (
|
||||
<div>
|
||||
{readOnly ? (
|
||||
<span>
|
||||
{
|
||||
!detail.direct_download?
|
||||
<span>
|
||||
<a onClick={() => this.DownLoadFile(detail.download_url)} className="ml20">
|
||||
<i className="iconfont icon-xiazai1 font-15 color-grey-6"></i>
|
||||
</a>
|
||||
}
|
||||
</span>:""
|
||||
}
|
||||
</span>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<Select
|
||||
showSearch={true}
|
||||
placeholder={"请选择文本语言"}
|
||||
style={{ width: 200 }}
|
||||
value={language}
|
||||
onChange={this.select_language}
|
||||
>
|
||||
<Option value={undefined}>请选择文本语言</Option>
|
||||
{languages &&
|
||||
languages.map((item, key) => {
|
||||
return (
|
||||
<Option value={item} key={key}>
|
||||
{item}
|
||||
</Option>
|
||||
);
|
||||
})}
|
||||
</Select>
|
||||
<button
|
||||
type="button"
|
||||
className="ant-btn ant-btn-sm ml20"
|
||||
onClick={() => this.EditFile(true)}
|
||||
>
|
||||
<span>取 消</span>
|
||||
</button>
|
||||
</React.Fragment>
|
||||
)}
|
||||
{
|
||||
type !==2 &&
|
||||
<Popconfirm
|
||||
title="确认删除这个文件?"
|
||||
className="ml20"
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
onConfirm={this.deleteFile}
|
||||
>
|
||||
<a>
|
||||
<i className="iconfont icon-shanchu font-15 color-grey-6"></i>
|
||||
</a>
|
||||
</Popconfirm>
|
||||
}
|
||||
|
||||
</div>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
{
|
||||
type !==2 &&
|
||||
<a onClick={() => this.EditFile(false)} className="ml20">
|
||||
<i className="iconfont icon-bianji1 font-15 color-grey-6"></i>
|
||||
</a>
|
||||
}
|
||||
</span>:""
|
||||
}
|
||||
</span>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<Select
|
||||
showSearch={true}
|
||||
placeholder={"请选择文本语言"}
|
||||
style={{ width: 200 }}
|
||||
value={language}
|
||||
onChange={this.select_language}
|
||||
>
|
||||
<Option value={undefined}>请选择文本语言</Option>
|
||||
{languages &&
|
||||
languages.map((item, key) => {
|
||||
return (
|
||||
<Option value={item} key={key}>
|
||||
{item}
|
||||
</Option>
|
||||
);
|
||||
})}
|
||||
</Select>
|
||||
<button
|
||||
type="button"
|
||||
className="ant-btn ant-btn-sm ml20"
|
||||
onClick={() => this.EditFile(true)}
|
||||
>
|
||||
<span>取 消</span>
|
||||
</button>
|
||||
</React.Fragment>
|
||||
)}
|
||||
{
|
||||
type !==2 &&
|
||||
<Popconfirm
|
||||
title="确认删除这个文件?"
|
||||
className="ml20"
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
onConfirm={this.deleteFile}
|
||||
>
|
||||
<a>
|
||||
<i className="iconfont icon-shanchu font-15 color-grey-6"></i>
|
||||
</a>
|
||||
</Popconfirm>
|
||||
}
|
||||
|
||||
</div>
|
||||
)}
|
||||
</p>
|
||||
</Anchor>
|
||||
<div>
|
||||
{detail.image_type ? (
|
||||
<div className="edu-txt-center pt20 pb20">
|
||||
|
@ -272,7 +310,7 @@ class CoderRootFileDetail extends Component {
|
|||
</div>
|
||||
) : (
|
||||
md && readOnly ?
|
||||
<div className="files-md">
|
||||
<div className="files-md" id="files-md">
|
||||
<RenderHtml className="file-md imageLayerParent" value={description} url={this.props.history.location}/>
|
||||
</div>
|
||||
:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React , { Component } from 'react';
|
||||
import { Route , Switch } from 'react-router-dom';
|
||||
import Top from './DetailTop';
|
||||
// import Top from './DetailTop';
|
||||
import Loadable from 'react-loadable';
|
||||
import Loading from '../../Loading';
|
||||
import axios from 'axios';
|
||||
import './Index.scss';
|
||||
|
||||
const FileNew = Loadable({
|
||||
loader: () => import('../Newfile/Index'),
|
||||
|
@ -18,25 +18,25 @@ const CoderRootCommit = Loadable({
|
|||
loading: Loading,
|
||||
})
|
||||
const CoderRootBranch = Loadable({
|
||||
loader: () => import('./CoderRootBranch'),
|
||||
loader: () => import('./tree/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
const CoderRootTag = Loadable({
|
||||
loader: () => import('./CoderRootTag'),
|
||||
loader: () => import('./tag/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
const CoderRootVersion = Loadable({
|
||||
loader: () => import('../Version/version'),
|
||||
loading: Loading,
|
||||
})
|
||||
const CoderRootVersionNew = Loadable({
|
||||
loader: () => import('../Version/New'),
|
||||
loading: Loading,
|
||||
})
|
||||
const CoderRootVersionUpdate = Loadable({
|
||||
loader: () => import('../Version/New'),
|
||||
loader: () => import('./version/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
// const CoderRootVersionNew = Loadable({
|
||||
// loader: () => import('./version/New'),
|
||||
// loading: Loading,
|
||||
// })
|
||||
// const CoderRootVersionUpdate = Loadable({
|
||||
// loader: () => import('./version/New'),
|
||||
// loading: Loading,
|
||||
// })
|
||||
const Diff = Loadable({
|
||||
loader: () => import('./Diff'),
|
||||
loading: Loading,
|
||||
|
@ -50,94 +50,94 @@ class CoderRootIndex extends Component{
|
|||
}
|
||||
}
|
||||
|
||||
componentDidMount=()=>{
|
||||
this.Init();
|
||||
}
|
||||
componentDidUpdate=(prevProps)=>{
|
||||
const { location } = this.props;
|
||||
const prevlocation = prevProps && prevProps.location;
|
||||
if (location !== prevlocation) {
|
||||
this.Init();
|
||||
}
|
||||
}
|
||||
// componentDidMount=()=>{
|
||||
// this.Init();
|
||||
// }
|
||||
// componentDidUpdate=(prevProps)=>{
|
||||
// const { location } = this.props;
|
||||
// const prevlocation = prevProps && prevProps.location;
|
||||
// if (location !== prevlocation) {
|
||||
// this.Init();
|
||||
// }
|
||||
// }
|
||||
|
||||
Init=()=>{
|
||||
const { branchName } = this.props.match.params;
|
||||
const { defaultBranch } = this.props;
|
||||
this.getTopCount(branchName || defaultBranch);
|
||||
}
|
||||
// Init=()=>{
|
||||
// const { branchName } = this.props.match.params;
|
||||
// const { defaultBranch } = this.props;
|
||||
// this.getTopCount(branchName || defaultBranch);
|
||||
// }
|
||||
|
||||
// 获取<Top />组件里要显示的数据
|
||||
getTopCount=(branch)=>{
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/top_counts.json`;
|
||||
axios.get(url,{params:{
|
||||
ref:branch
|
||||
}}).then(result=>{
|
||||
if(result){
|
||||
this.setState({
|
||||
coderCount:result.data
|
||||
})
|
||||
}
|
||||
}).catch(error=>{console.log(error);})
|
||||
}
|
||||
// getTopCount=(branch)=>{
|
||||
// const { projectsId , owner } = this.props.match.params;
|
||||
// const url = `/${owner}/${projectsId}/top_counts.json`;
|
||||
// axios.get(url,{params:{
|
||||
// ref:branch
|
||||
// }}).then(result=>{
|
||||
// if(result){
|
||||
// this.setState({
|
||||
// coderCount:result.data
|
||||
// })
|
||||
// }
|
||||
// }).catch(error=>{console.log(error);})
|
||||
// }
|
||||
render(){
|
||||
return(
|
||||
<div>
|
||||
<Top {...this.props} {...this.state}/>
|
||||
<div className="coderSubPage">
|
||||
{/* <Top {...this.props} {...this.state}/> */}
|
||||
<Switch {...this.props}>
|
||||
{/* 新建文件 */}
|
||||
<Route path="/projects/:owner/:projectsId/:branch/newfile/:path"
|
||||
<Route path="/:owner/:projectsId/:branch/newfile/:path"
|
||||
render={
|
||||
(props) => (<FileNew {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/:branch/uploadfile"
|
||||
<Route path="/:owner/:projectsId/:branch/uploadfile"
|
||||
render={
|
||||
(props) => (<UploadFile {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/:branch/newfile"
|
||||
<Route path="/:owner/:projectsId/:branch/newfile"
|
||||
render={
|
||||
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
||||
(props) => (<FileNew {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
||||
<Route path="/:owner/:projectsId/commits/branch/:branchName"
|
||||
render={
|
||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
||||
<Route path="/:owner/:projectsId/commits/:sha"
|
||||
render={
|
||||
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/commits"
|
||||
<Route path="/:owner/:projectsId/commits"
|
||||
render={
|
||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/releases/:versionId/update"
|
||||
{/* <Route path="/:owner/:projectsId/releases/:versionId/update"
|
||||
render={
|
||||
(props) => (<CoderRootVersionUpdate {...this.props} {...this.state} {...props} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/releases/new"
|
||||
<Route path="/:owner/:projectsId/releases/new"
|
||||
render={
|
||||
() => (<CoderRootVersionNew {...this.props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/releases"
|
||||
></Route> */}
|
||||
<Route path="/:owner/:projectsId/releases"
|
||||
render={
|
||||
() => (<CoderRootVersion {...this.props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/tag"
|
||||
<Route path="/:owner/:projectsId/tags"
|
||||
render={
|
||||
() => (<CoderRootTag {...this.props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/branchs"
|
||||
<Route path="/:owner/:projectsId/branches"
|
||||
render={
|
||||
() => (<CoderRootBranch {...this.props} {...this.state} />)
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ export default (( props, { projectDetail }) => {
|
|||
<div className="div_table">
|
||||
<ul className="ul_thead">
|
||||
<li>
|
||||
<span className="flex1">标签名</span>
|
||||
<span className="flex1">标记名</span>
|
||||
<span>提交信息</span>
|
||||
<span className="ul_tbody_forth">下载</span>
|
||||
</li>
|
||||
|
@ -49,7 +49,7 @@ export default (( props, { projectDetail }) => {
|
|||
<span className="font-16">{item.name}</span>
|
||||
</span>
|
||||
<span className="ul_tbody_third">
|
||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.id}`)}`} className="commitKey" style={{ "marginLeft": 0 }}>{truncateCommitId(`${item.id}`)}</Link>
|
||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.id}`)}`} className="commitKey" style={{ "marginLeft": 0 }}>{truncateCommitId(`${item.id}`)}</Link>
|
||||
</span>
|
||||
<span className="ul_tbody_forth">
|
||||
<a href={item.tarball_url} style={{ color: "#4CC1DA" }} className="mr30"><i className="iconfont icon-TAR font-18 mr5"></i>TAR</a>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,28 @@
|
|||
import React from 'react';
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import { withRouter } from "react-router";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../../Loading";
|
||||
import { SnackbarHOC } from "educoder";
|
||||
import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC";
|
||||
import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
|
||||
|
||||
// forge项目详情
|
||||
const ProjectDetail = Loadable({
|
||||
loader: () => import("../Main/Detail"),
|
||||
loading: Loading,
|
||||
});
|
||||
export default withRouter(
|
||||
(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props) => {
|
||||
return (
|
||||
<Switch>
|
||||
<Route
|
||||
path="/:owner/:projectsId"
|
||||
render={(p) => (
|
||||
<ProjectDetail {...props} {...p} />
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
)
|
||||
}))))
|
||||
)
|
|
@ -12,19 +12,19 @@ class DetailTop extends Component {
|
|||
{
|
||||
platform ?
|
||||
<React.Fragment>
|
||||
<Link to={`/projects/${owner}/${projectsId}/commits`} className={pathname.indexOf("/commits") > 0 ? "active" : ""}>
|
||||
<Link to={`/${owner}/${projectsId}/commits`} className={pathname.indexOf("/commits") > 0 ? "active" : ""}>
|
||||
<i className="iconfont icon-tijiaojilu font-20 mr3 font-bd"></i>
|
||||
<span>{(coderCount && coderCount.commits_count) || 0}</span>个提交
|
||||
</Link>
|
||||
<Link to={`/projects/${owner}/${projectsId}/branchs`} className={pathname.indexOf("/branchs") > 0 ? "active" : ""}>
|
||||
<Link to={`/${owner}/${projectsId}/branches`} className={pathname.indexOf("/branches") > 0 ? "active" : ""}>
|
||||
<i className="iconfont icon-fenzhi1 font-18 mr3"></i>
|
||||
<span>{(coderCount && coderCount.branches_count) || 0}</span>个分支
|
||||
</Link>
|
||||
<Link to={`/projects/${owner}/${projectsId}/tag`} className={pathname.indexOf("/tag") > 0 ? "active" : ""}>
|
||||
<Link to={`/${owner}/${projectsId}/tags`} className={pathname.indexOf("/tags") > 0 ? "active" : ""}>
|
||||
<i className="iconfont icon-biaoqian3 font-18 mr3"></i>
|
||||
<span>{(coderCount && coderCount.tags_count) || 0}</span>个标签
|
||||
</Link>
|
||||
<Link to={`/projects/${owner}/${projectsId}/releases`} className={pathname.indexOf("/releases") > 0 ? "active" : ""}>
|
||||
<Link to={`/${owner}/${projectsId}/releases`} className={pathname.indexOf("/releases") > 0 ? "active" : ""}>
|
||||
<i className="iconfont icon-fahangban font-18 mr3"></i>
|
||||
<span>{(coderCount && coderCount.version_releasesed_count) || 0}</span>个发行版
|
||||
</Link>
|
||||
|
|
|
@ -1,35 +1,65 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import styled from "styled-components";
|
||||
import { Button ,Spin } from "antd";
|
||||
import { truncateCommitId } from '../common/util';
|
||||
import { timeFormat, truncateCommitId } from '../common/util';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import Files from '../Merge/Files';
|
||||
|
||||
import Tree from "./img/tree.png";
|
||||
import User from "../Component/User";
|
||||
import Keys from "../Component/Keys";
|
||||
|
||||
import RenderHtml from "../../components/render-html";
|
||||
import axios from "axios";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
const Infos = styled.div`
|
||||
border: 1px solid #dddddd;
|
||||
border: 1px solid #FAFCFF;
|
||||
margin-bottom:15px;
|
||||
& .commitinfos {
|
||||
background-color: #f1f8ff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 20px;
|
||||
border: 1px solid rgba(42, 97, 255, 0.23);
|
||||
border-radius: 3px 3px 0px 0px;
|
||||
padding: 10px 20px 10px 16px;
|
||||
& .markdown-body table{
|
||||
background: #f1f8ff;
|
||||
}
|
||||
& .btnblue{
|
||||
margin-top: 12px;
|
||||
}
|
||||
& .task-hide{
|
||||
width: 65rem;
|
||||
overflow:hidden;
|
||||
white-space:normal;
|
||||
word-break:break-all;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
& > .f-wrap-between {
|
||||
padding: 10px 20px;
|
||||
padding: 14px 20px 14px 16px;
|
||||
border-radius: 3px 3px 0px 0px;
|
||||
border: 1px solid #D0D0D0;
|
||||
.df{
|
||||
align-items: center;
|
||||
& .underline:hover{
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default ({ match , history }) => {
|
||||
function turnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("/")>-1){
|
||||
return str.replaceAll('/','%2F');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
//提交详情页
|
||||
export default (props) => {
|
||||
const {match , history } = props;
|
||||
const [data, setData] = useState({undefined});
|
||||
const [commit, setCommit] = useState(undefined);
|
||||
const [parents, setParents] = useState(undefined);
|
||||
const [committer, setCommitter] = useState(undefined);
|
||||
const [isSpin, setIsSpin] = useState(true);
|
||||
|
||||
const { sha , projectsId, owner } = match.params;
|
||||
useEffect(() => {
|
||||
if (projectsId && owner && sha) {
|
||||
|
@ -43,6 +73,7 @@ export default ({ match , history }) => {
|
|||
setParents(result.data.parents);
|
||||
setCommitter(result.data.committer || (result.data.commit && result.data.commit.committer));
|
||||
setIsSpin(false);
|
||||
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
@ -56,29 +87,42 @@ export default ({ match , history }) => {
|
|||
<Infos>
|
||||
<div className="commitinfos">
|
||||
<div className="f-wrap-between">
|
||||
{commit && commit.message &&
|
||||
<pre className="task-hide" style={{marginBottom:"0px",height:"28px",whiteSpace:"pre-wrap"}}>{commit.message}</pre>
|
||||
}
|
||||
<Button type="primary" onClick={()=>{history.push(`/projects/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button>
|
||||
<div>
|
||||
{commit && commit.message &&
|
||||
<RenderHtml className="task-hide" value={commit.message}/>
|
||||
}
|
||||
<Link to={`/${owner}/${projectsId}/tree/${data.branch}`}><i className="iconfont icon-fenzhi2 font-18"></i>{data.branch}</Link>
|
||||
</div>
|
||||
<Button type="primary" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="btnblue" style={{height:"36px"}}>浏览文件</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="f-wrap-between" style={{ alignItems: "center" }}>
|
||||
<ul className="df">
|
||||
<User
|
||||
url={(committer && getImageUrl(`/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
||||
id = {committer && committer.id}
|
||||
url={(committer && getImageUrl(`/${committer.image_url}`))}
|
||||
name={committer && committer.name}
|
||||
login={committer && committer.login}
|
||||
/>
|
||||
{committer && committer.time_from_now && <li className="ml20 mt2">{committer.time_from_now}</li>}
|
||||
{commit && commit.timestamp && <li className="ml4">提交于{timeFormat(commit.timestamp)}</li>}
|
||||
</ul>
|
||||
<li className="df">
|
||||
{
|
||||
parents && parents.length > 0 && parents.map((item,key)=>{
|
||||
return(
|
||||
<Keys title="父节点" value={truncateCommitId(item.sha)} key={key} className="mr20"></Keys>
|
||||
<div className="ml40 f-wrap-alignCenter">
|
||||
<label className="mr8">父节点</label>
|
||||
<img src={Tree} alt="sha" width={"16px"} className="mr4"/>
|
||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${data.branch}`} className="underline">{truncateCommitId(item.sha)}</Link>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
<Keys title="当前节点" value={truncateCommitId(sha)}></Keys>
|
||||
<div className="ml40 f-wrap-alignCenter">
|
||||
<label className="mr8">当前节点</label>
|
||||
<img src={Tree} alt="sha" width={"16px"} className="mr4"/>
|
||||
<span>{truncateCommitId(sha)}</span>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</Infos>
|
||||
|
@ -87,6 +131,7 @@ export default ({ match , history }) => {
|
|||
data={data}
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
parentsSha={parents && parents.length > 0 && parents[0].sha}
|
||||
/>
|
||||
</Spin>
|
||||
</div>
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Menu, Input , Spin, Pagination , Popover , Select } from 'antd';
|
||||
import Slider from "react-slick";
|
||||
import { getImageUrl } from 'educoder';
|
||||
import "slick-carousel/slick/slick.css";
|
||||
import "slick-carousel/slick/slick-theme.css";
|
||||
import '../css/index.scss'
|
||||
import './list.css';
|
||||
import './list.scss';
|
||||
import './Index.scss';
|
||||
import ListItem from './IndexItem'
|
||||
import axios from 'axios';
|
||||
import img_new from '../Images/new.png';
|
||||
import img_array from '../Images/array.png';
|
||||
import banner from '../Images/banner_list.jpg';
|
||||
import CheckProfile from '../Component/ProfileModal/Profile';
|
||||
|
||||
const Search = Input.Search;
|
||||
|
||||
class Index extends Component {
|
||||
|
@ -228,7 +229,7 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
getoDetail=(login,identifier)=>{
|
||||
this.props.history.push(`/projects/${login}/${identifier}`);
|
||||
this.props.history.push(`/${login}/${identifier}`);
|
||||
}
|
||||
|
||||
// 选择语言类别
|
||||
|
@ -254,10 +255,14 @@ class Index extends Component {
|
|||
|
||||
newItem = ()=>{
|
||||
return(
|
||||
<Menu>
|
||||
<Menu.Item key="created_mirror"><Link to={`/projects/mirror/new`}>新建镜像项目</Link></Menu.Item>
|
||||
<Menu.Item key="created_deposit"><Link to={`/projects/deposit/new`}>新建托管项目</Link></Menu.Item>
|
||||
</Menu>
|
||||
<ul>
|
||||
<li>
|
||||
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/deposit/new')}}>新建项目</CheckProfile>
|
||||
</li>
|
||||
<li>
|
||||
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/mirror/new')}}>导入项目</CheckProfile>
|
||||
</li>
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -387,7 +392,13 @@ class Index extends Component {
|
|||
<div>
|
||||
{
|
||||
current_user && current_user.login &&
|
||||
<Popover content={this.newItem()} trigger={["click"]} placement='bottom' className="mr50">
|
||||
<Popover
|
||||
overlayClassName="newPopUl"
|
||||
content={this.newItem()}
|
||||
trigger={["click"]}
|
||||
placement='bottom'
|
||||
className="mr50"
|
||||
>
|
||||
<a className="ant-dropdown-link">
|
||||
<span className="color-blue font-16"><img src={img_new} alt="" width="13px" /> 新建</span>
|
||||
</a>
|
||||
|
|
|
@ -13,6 +13,21 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.iconBtn{
|
||||
i{
|
||||
color: #666;
|
||||
}
|
||||
span{
|
||||
margin-left: 4px;
|
||||
color: #333!important;
|
||||
&:last-child{
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
&:hover span,&:hover i{
|
||||
color: #466AFF!important;
|
||||
}
|
||||
}
|
||||
/* recommandProjects */
|
||||
.recommandProjects.slick-slider{
|
||||
width: 1230px;
|
||||
|
@ -108,63 +123,94 @@
|
|||
margin: 0 auto;
|
||||
.panelmenu{
|
||||
padding-top:30px;
|
||||
.depotBtn{
|
||||
.mr-5{
|
||||
margin-right: -5px;
|
||||
}
|
||||
.ant-btn{
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
width: 83px;
|
||||
text-align: center;
|
||||
padding:0px ;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
}
|
||||
.ant-btn-default{
|
||||
color: #333;
|
||||
border-color: #d0d0d0;
|
||||
&:hover{
|
||||
background: #F3F4F6;
|
||||
}
|
||||
}
|
||||
.ant-btn-primary{
|
||||
color: #fff;
|
||||
background-color: #466AFF;
|
||||
border: none;
|
||||
&:hover{
|
||||
background-color: rgba(70,106,255,0.85);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.addOptionBtn{
|
||||
height: 32px;
|
||||
line-height: 30px;
|
||||
.depotBtn,.addOptionBtn{
|
||||
display: flex;
|
||||
border:1px solid #d9d9d9;
|
||||
border-radius: 2px;
|
||||
a{
|
||||
padding:0px 13px;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
cursor: pointer;
|
||||
}
|
||||
& > a:first-child{
|
||||
border-right: 1px solid #d9d9d9;
|
||||
}
|
||||
& > a:last-child{
|
||||
border-right: none;
|
||||
color: #333!important;
|
||||
font-weight: 500!important;
|
||||
border-radius: 5px;
|
||||
width: 83px;
|
||||
height: 32px;
|
||||
line-height: 30px;
|
||||
background: #fff;
|
||||
border: 1px solid #D0D0D0;
|
||||
margin-right: 10px;
|
||||
text-align: center;
|
||||
&:hover,&:active{
|
||||
background: #F3F4F6;
|
||||
}
|
||||
}
|
||||
}
|
||||
.infoCount{
|
||||
display: inline-block;
|
||||
padding:0px 5px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
background-color: #eee;
|
||||
color:#999;
|
||||
width: 24px;
|
||||
text-align: center;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
background-color:rgba(153, 153, 153, 0.13);;
|
||||
color:#666;
|
||||
border-radius: 12px;
|
||||
margin-left: 10px;
|
||||
margin-left: 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.attrPerson{
|
||||
padding-top: 15px;
|
||||
padding-top: 12px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 2px;
|
||||
a{
|
||||
margin: 10px 10px 0px 0px;
|
||||
margin: 0px 17px 10px 0px;
|
||||
img{
|
||||
border-radius: 50%;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
&:nth-child(6){
|
||||
&:nth-child(5n){
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.progress{
|
||||
display: flex;
|
||||
border-radius: 10px;
|
||||
height: 7px;
|
||||
border-radius: 2px;
|
||||
height: 11px;
|
||||
margin-top: 12px;
|
||||
span{
|
||||
&:first-child{
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
border-radius: 2px 0px 0px 2px;
|
||||
}
|
||||
&:last-child{
|
||||
border-radius: 0px 10px 10px 0px;
|
||||
border-radius: 0px 2px 2px 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -178,16 +224,17 @@
|
|||
height: 8px;
|
||||
width: 8px;
|
||||
left: 0px;
|
||||
top:10px
|
||||
top:8px;
|
||||
}
|
||||
&>span{
|
||||
padding-left: 15px;
|
||||
position: relative;
|
||||
min-width: 33.5%;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
span{
|
||||
color: #666;
|
||||
&:last-child{
|
||||
color: #999;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
|
@ -195,18 +242,24 @@
|
|||
}
|
||||
.listtable{
|
||||
margin-top: 20px;
|
||||
border:1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
.listtablehead{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
padding:7px 20px;
|
||||
padding:12px 20px 11px;
|
||||
border-radius: 4px 4px 0px 0px;
|
||||
background-color: #FAFBFC;
|
||||
border: 1px solid rgba(42, 97, 255, 0.23);
|
||||
background-color: #FAFCFF;
|
||||
.ellipsistxt{
|
||||
margin-top: 6px;
|
||||
&:hover .markdown-body{
|
||||
color: #466AFF;
|
||||
& a{
|
||||
color: #466AFF;
|
||||
}
|
||||
}
|
||||
margin-top: 2px;
|
||||
// cursor: pointer;
|
||||
#ptxt{
|
||||
margin-bottom: 0px;
|
||||
word-break: break-all;
|
||||
|
@ -216,6 +269,27 @@
|
|||
white-space:-pre-wrap; /* Opera 4-6 */
|
||||
white-space:-o-pre-wrap; /* Opera 7 */
|
||||
word-wrap:break-word;
|
||||
.markdown-body{
|
||||
line-height: 10px;
|
||||
font-size: 14px;
|
||||
& p {
|
||||
margin: 1px 0px 0px !important;
|
||||
font-size: 14px !important;
|
||||
}
|
||||
& ol,ul{
|
||||
padding-bottom: 3px;
|
||||
& li{
|
||||
min-height: 18px;
|
||||
}
|
||||
}
|
||||
& table{
|
||||
line-height: 1;
|
||||
background: #FAFCFF;
|
||||
}
|
||||
&:first-child {
|
||||
margin-top: -1px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
margin-left: 13px;
|
||||
line-height:18px;
|
||||
|
@ -223,36 +297,41 @@
|
|||
width: 0;
|
||||
color: #666;
|
||||
&.hidetxt{
|
||||
height: 18px;
|
||||
height: 24px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
padding-right:8px;
|
||||
&::after{
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
content:"...";
|
||||
}
|
||||
// &::after{
|
||||
// position: absolute;
|
||||
// right: 0px;
|
||||
// bottom: 0px;
|
||||
// content:"...";
|
||||
// }
|
||||
}
|
||||
}
|
||||
.ellipsis{
|
||||
margin-left: 8px;
|
||||
cursor: pointer;
|
||||
border-radius: 2px;
|
||||
background-color: #c1c1c1;
|
||||
height: 16px;
|
||||
background: rgba(153, 153, 153, 0.2);
|
||||
border-radius: 2px;
|
||||
padding:0px 4px;
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
margin-top: 9px;
|
||||
i{
|
||||
font-size: 15px!important;
|
||||
color: #fff;
|
||||
color: #333;
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.listtablebody{
|
||||
border-radius:0px 0px 4px 4px ;
|
||||
border: 1px solid #D0D0D0;
|
||||
border-top: none;
|
||||
li.listtablepath{
|
||||
a{color: #40a9ff;}
|
||||
p{
|
||||
|
@ -260,12 +339,15 @@
|
|||
}
|
||||
}
|
||||
& > li{
|
||||
height: 42px;
|
||||
height: 38px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
padding:0px 20px 0px 24px;
|
||||
&:hover{
|
||||
background-color: #F3F4F6;
|
||||
}
|
||||
& > span:first-child{
|
||||
width: 30%;
|
||||
overflow: hidden;
|
||||
|
@ -292,8 +374,10 @@
|
|||
.drawerBtn{
|
||||
position: fixed;
|
||||
left: -13px;
|
||||
border:1px solid rgb(207,205,223);
|
||||
width: 34px;
|
||||
width: 33px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 0px 8px 3px rgba(0, 0, 0, 0.09);
|
||||
border: 1px solid #666666;
|
||||
border-radius: 0px 12px 12px 0px;
|
||||
height: 70px;
|
||||
top:50%;
|
||||
|
@ -301,36 +385,49 @@
|
|||
cursor: pointer;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-left: 7px;
|
||||
&:hover{
|
||||
box-shadow: 1px 0px 7px rgba(0,0,0,0.1);
|
||||
box-shadow: 0px 0px 8px 3px rgba(0, 0, 0, 0.09);
|
||||
}
|
||||
span{
|
||||
writing-mode: vertical-lr;
|
||||
color: #202429;
|
||||
color: #333;
|
||||
width: 25px;
|
||||
font-size: 14px;
|
||||
}
|
||||
i{
|
||||
color: #24292e;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
width: 18px;
|
||||
color: #333;
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
width: 14px;
|
||||
margin-left: 2px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
}
|
||||
.downMenu{
|
||||
width: 330px;
|
||||
box-shadow: 0px 0px 9px rgba(134, 134, 134,0.4);
|
||||
width: 329px;
|
||||
background-color: #fff;
|
||||
.ant-menu-vertical .ant-menu-item:hover{
|
||||
background-color: #e6f7ff;
|
||||
box-shadow: 0px 1px 8px 1px rgba(212, 212, 212, 0.5);
|
||||
padding-bottom: 14px;
|
||||
.ant-menu-item{
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
}
|
||||
.fileMenu{
|
||||
width: 83px;
|
||||
li{
|
||||
padding:6px 0px!important;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.menuslist{
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
padding:10px 15px;
|
||||
.catelogue{
|
||||
cursor: pointer;
|
||||
background: #FAFBFC;
|
||||
border-radius: 4px;
|
||||
.ant-dropdown-menu-item{
|
||||
border-radius: 8px;
|
||||
|
@ -342,22 +439,19 @@
|
|||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
.ant-dropdown-menu-item.active{
|
||||
background-color: #e6f7ff;
|
||||
}
|
||||
}
|
||||
.catelogue{
|
||||
border:1px solid rgb(211, 211, 211);
|
||||
border: 1px solid #D0D0D0;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
border-radius: 5px;
|
||||
margin-right: 10px;
|
||||
margin-right: 12px;
|
||||
padding:0px 10px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
color: #666!important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&:hover{
|
||||
background-color: #F3F4F6;
|
||||
}
|
||||
span{
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
@ -370,4 +464,48 @@
|
|||
&:hover{
|
||||
color: #05101a;
|
||||
}
|
||||
}
|
||||
.pinfos{
|
||||
i,a{color: #666;}
|
||||
&:hover i,&:hover a{
|
||||
color: #2A61FF!important;
|
||||
}
|
||||
}
|
||||
.graph{
|
||||
flex:1;
|
||||
margin:0px 12px;
|
||||
.ant-typography{
|
||||
white-space: pre-wrap;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
}
|
||||
.ant-anchor-wrapper{
|
||||
padding-left: 2px!important;
|
||||
.ant-anchor-ink::before{
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
.coderSubPage{
|
||||
width: 1200px;
|
||||
margin:0px auto;
|
||||
}
|
||||
.griditemAnchor{
|
||||
margin-left: 0px!important;
|
||||
padding: 0px!important;
|
||||
border-bottom: 1px solid #ddd;
|
||||
.ant-anchor{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.griditemCate{
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.catelogue{
|
||||
margin-left: 0px;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ import { AlignCenter } from '../Component/layout';
|
|||
import { Link } from 'react-router-dom';
|
||||
import '../css/index.scss';
|
||||
import Nodata from '../Nodata';
|
||||
import './list.css';
|
||||
import './list.scss';
|
||||
import img_parise from '../Images/parise.png';
|
||||
|
||||
class IndexItem extends Component {
|
||||
|
@ -28,35 +28,35 @@ class IndexItem extends Component {
|
|||
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
|
||||
</a>
|
||||
:
|
||||
<Link to={item.author && (item.author.type === "Organization" ? `/organize/${item.author.login}`:`/users/${item.author.login}`)} className="show-user-link">
|
||||
<Link to={`/${item.author && item.author.login}`} className="show-user-link">
|
||||
<img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
|
||||
</Link>
|
||||
}
|
||||
<div className="p-r-Infos">
|
||||
<div className="p-r-name">
|
||||
<AlignCenter>
|
||||
<Link to={`/projects/${item.author.login}/${item.identifier}`} title={`${item.author.name}/${item.name}`} className="color-grey-3 font-18 task-hide " style={{maxWidth: 470 }}>
|
||||
<Link to={`/${item.author.login}/${item.identifier}`} title={`${item.author.name}/${item.name}`} className="color-grey-3 font-18 task-hide " style={{maxWidth: 470 }}>
|
||||
{item.author.name}/{item.name}
|
||||
</Link>
|
||||
{ !item.is_public && <span className="privateTag">私有</span> }
|
||||
{
|
||||
item.forked_from_project_id ?
|
||||
<span className="ml5">
|
||||
<Tooltip title="该项目是一个fork仓库" className="ml5">
|
||||
<i className="iconfont icon-fork font-18 color-orange" />
|
||||
</span>
|
||||
</Tooltip>
|
||||
: ""
|
||||
}
|
||||
{
|
||||
item.type && item.type === 2 ?
|
||||
<Tooltip title="该项目是一个镜像" className="ml5">
|
||||
<Tooltip title="该项目是一个同步镜像仓库" className="ml5">
|
||||
<i className="iconfont icon-banbenku font-18 color-green" />
|
||||
</Tooltip>:""
|
||||
}
|
||||
{
|
||||
item.type && item.type === 1 ?
|
||||
<span className="ml5">
|
||||
<Tooltip title="该项目是一个导入于其他网站的仓库" className="ml5">
|
||||
<i className="iconfont icon-jingxiang font-18 color-green" />
|
||||
</span>:""
|
||||
</Tooltip>:""
|
||||
}
|
||||
</AlignCenter>
|
||||
<span className="p-r-tags">
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 631 B |
Binary file not shown.
After Width: | Height: | Size: 590 B |
|
@ -218,74 +218,92 @@
|
|||
}
|
||||
/* -----------详情------------ */
|
||||
.detailHeader-wrapper{
|
||||
background-color:#FAFBFC;
|
||||
/* background: url(../Images/forgeBanner.jpg) no-repeat center; */
|
||||
/* background-size:cover; */
|
||||
background-color:#FBFCFF;
|
||||
border-bottom:1px solid #e2e2e2;
|
||||
}
|
||||
.headerMenu-wrapper{
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.headerMenu-wrapper li{
|
||||
position: relative;
|
||||
text-align: center;
|
||||
height: 40px;
|
||||
line-height: 28px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
.headerMenu-wrapper li a{
|
||||
color: #666;
|
||||
}
|
||||
.headerMenu-wrapper li a > img{
|
||||
margin-right: 8px;
|
||||
}
|
||||
.headerMenu-wrapper li a > span.num{
|
||||
height: 28px;
|
||||
line-height: 29px;
|
||||
margin-left: 8px;
|
||||
font-size: 12px;
|
||||
color: #2878FF;
|
||||
float: right;
|
||||
}
|
||||
.headerMenu-wrapper li.active::after{
|
||||
position: absolute;
|
||||
bottom:0px;
|
||||
height:2px;
|
||||
background-color: #5091FF;
|
||||
content:'';
|
||||
left: 0px;
|
||||
width:100%;
|
||||
cursor: pointer;
|
||||
li{
|
||||
text-align: center;
|
||||
padding:0px;
|
||||
margin-right: 40px;
|
||||
display: flex;
|
||||
& > a{
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
height: 36px;
|
||||
line-height: 24px;
|
||||
display: block;
|
||||
color: #000!important;
|
||||
&> span.num{
|
||||
line-height: 24px;
|
||||
margin-left: 5px;
|
||||
font-size: 12px;
|
||||
float: right;
|
||||
color: #666!important;
|
||||
background-color: rgba(153, 153, 153, 0.13);;
|
||||
border-radius: 50%;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
&.active a::after,&:hover a::after{
|
||||
position: absolute;
|
||||
bottom:0px;
|
||||
height:2px;
|
||||
background-color:rgba(153, 153, 153, 0.2);
|
||||
content:'';
|
||||
left: 0px;
|
||||
width:100%;
|
||||
}
|
||||
&.active span{
|
||||
font-weight: 500;
|
||||
}
|
||||
&.active a::after{
|
||||
background-color: #466AFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
.detail_tag_btn{
|
||||
height:26px;
|
||||
line-height: 26px;
|
||||
height:32px;
|
||||
line-height: 32px;
|
||||
border-radius:5px;
|
||||
border:1px solid #f1f1f1;
|
||||
border:1px solid #D0D0D0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 30px;
|
||||
margin-left: 10px;
|
||||
padding:0px;
|
||||
background-color: transparent;
|
||||
background-color:#FAFBFC;
|
||||
box-shadow: none;
|
||||
.detail_tag_btn_name{
|
||||
padding:0px 10px;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
border-radius:5px 0px 0px 5px;
|
||||
&:hover
|
||||
{
|
||||
background-color: #F3F4F6;
|
||||
}
|
||||
span{
|
||||
color: #333!important;
|
||||
}
|
||||
}
|
||||
.detail_tag_btn_count{
|
||||
width: 42px;
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
border-radius: 0px 4px 4px 0px;
|
||||
height:100%;
|
||||
border-left: 1px solid #D0D0D0;
|
||||
}
|
||||
}
|
||||
.ant-tooltip {
|
||||
max-width: fit-content!important;
|
||||
}
|
||||
.detail_tag_btn_name{
|
||||
padding:0px 10px;
|
||||
color: #666!important;
|
||||
}
|
||||
.detail_tag_btn_name img{
|
||||
margin-right: 10px;
|
||||
}
|
||||
.detail_tag_btn_count{
|
||||
padding:0px 10px;
|
||||
background: #fff;
|
||||
border-radius: 0px 4px 4px 0px;
|
||||
font-size: 12px;
|
||||
height:100%;
|
||||
}
|
||||
.files-md{
|
||||
padding:20px;
|
||||
}
|
||||
|
@ -336,6 +354,7 @@
|
|||
|
||||
|
||||
.gitAddressClone{
|
||||
margin:14px 20px!important;
|
||||
display: flex;
|
||||
height: 40px;
|
||||
align-items: center;
|
||||
|
@ -407,14 +426,15 @@
|
|||
border-right: none;
|
||||
}
|
||||
.gitAddressClone > input{
|
||||
border:none;
|
||||
outline: none;
|
||||
padding:0px 8px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-radius: 0px;
|
||||
border: 1px solid #eee;
|
||||
flex:1;
|
||||
padding: 0px 8px;
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
border: none!important;
|
||||
border-right: 1px solid #eee!important;
|
||||
border-radius: 4px 0px 0px 4px;
|
||||
flex: 1;
|
||||
max-width: 249px;
|
||||
}
|
||||
.wrap-commit-table .ant-table-small > .ant-table-content > .ant-table-body{
|
||||
margin:0px;
|
||||
|
@ -499,7 +519,7 @@
|
|||
}
|
||||
.addFile a{
|
||||
display: block;
|
||||
background-color: rgb(76, 172, 255,0.8);
|
||||
background-color: rgba(76, 172, 255,0.8);
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
height: 32px;
|
||||
|
@ -514,7 +534,7 @@
|
|||
border-left: 1px solid rgba(247, 247, 247, 0.3);
|
||||
}
|
||||
.addFile a:active{
|
||||
background-color: rgb(76, 172, 255,1);
|
||||
background-color: rgba(76, 172, 255,1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -553,8 +573,11 @@
|
|||
}
|
||||
.commonBox{
|
||||
border:1px solid #ddd;
|
||||
margin-top: 30px;
|
||||
margin-top: 18px;
|
||||
border-radius: 4px;
|
||||
.ant-anchor-wrapper{
|
||||
overflow: unset!important;
|
||||
}
|
||||
}
|
||||
.commonBox .commonBox-title{
|
||||
padding:0px 20px;
|
||||
|
@ -567,14 +590,28 @@
|
|||
border-bottom: 1px solid #d9d9d9;
|
||||
border-radius: 4px 4px 0px 0px;
|
||||
}
|
||||
.readBox{
|
||||
border:none;
|
||||
&.commonBox .commonBox-info{
|
||||
border:1px solid #D0D0D0;
|
||||
border-top: none;
|
||||
border-radius: 0px 0px 4px 4px;
|
||||
padding:20px 38px;
|
||||
}
|
||||
}
|
||||
.commonBox .commonBox-title.boxTitle{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 55px;
|
||||
line-height: 55px;
|
||||
background: #FAFCFF;
|
||||
border-radius: 4px 4px 0px 0px;
|
||||
border: 1px solid rgba(42, 97, 255, 0.23);
|
||||
}
|
||||
.synchronism{
|
||||
display: block;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
padding:0px 15px;
|
||||
color: #fff!important;
|
||||
background-color: #28BD6C;
|
||||
|
@ -583,10 +620,19 @@
|
|||
.files_info{
|
||||
cursor: pointer;
|
||||
}
|
||||
.commonBox .commonBox-info{
|
||||
padding:20px 15px;
|
||||
.commonBox {
|
||||
.commonBox-info{
|
||||
padding:20px 15px;
|
||||
}
|
||||
}
|
||||
.commonBox-title-read{
|
||||
vertical-align: middle;
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
&:hover {
|
||||
color: #466AFF;
|
||||
}
|
||||
}
|
||||
.commonBox-title-read{vertical-align: middle;color: #666;}
|
||||
|
||||
@media screen and (max-width: 370px){
|
||||
.p-r-tags,.p-r-btn{
|
||||
|
@ -627,9 +673,7 @@
|
|||
.item:last-child{
|
||||
border-bottom:none;
|
||||
}
|
||||
.gitAddressClone{
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.item_title small{
|
||||
font-weight: 400;
|
||||
margin-left: 10px;
|
||||
|
@ -678,12 +722,84 @@ a.color-grey-ccc:hover{
|
|||
padding:0px 30px;
|
||||
min-height: 400px;
|
||||
}
|
||||
.commitList > div{
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
padding:16px 0px;
|
||||
}
|
||||
.commitList > div:last-child{
|
||||
border-bottom: none;
|
||||
|
||||
.main{
|
||||
margin: 30px auto;
|
||||
.ant-timeline{
|
||||
margin-top: 28px;
|
||||
.commitList-item{
|
||||
position: relative;
|
||||
padding: 20px 20px;
|
||||
background: #FAFCFF;
|
||||
border: 1px solid rgba(42, 97, 255, 0.23);
|
||||
border-radius: 4px;
|
||||
margin-left: 16px;
|
||||
& .treecopy{
|
||||
margin-top: 20px;
|
||||
}
|
||||
& .markdown-body table{
|
||||
background: #FAFCFF;
|
||||
}
|
||||
&:after,&:before{
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: -10px;
|
||||
top: 10px;
|
||||
border-top: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
border-right: 10px solid rgba(42, 97, 255, 0.23);
|
||||
}
|
||||
&:after{
|
||||
left: -8px;
|
||||
border-right: 10px solid #FAFCFF;
|
||||
&:hover{
|
||||
border-right: 10px solid #EEF6FF;
|
||||
}
|
||||
}
|
||||
&:hover{
|
||||
background: #EEF6FF;
|
||||
border: 1px solid rgba(42, 97, 255, 0.58);
|
||||
&:after{
|
||||
border-right: 10px solid #EEF6FF;
|
||||
}
|
||||
&:before{
|
||||
border-right: 10px solid rgba(42, 97, 255, 0.58);
|
||||
}
|
||||
& .markdown-body table{
|
||||
background: #EEF6FF;
|
||||
}
|
||||
}
|
||||
.treecopy-cont{
|
||||
padding: 4px 15px;
|
||||
}
|
||||
.btn-83{
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
.ant-timeline-item{
|
||||
padding: 8px 0 20px;
|
||||
}
|
||||
.ant-timeline-item-tail{
|
||||
height: calc(100% - 20px);
|
||||
border-left: 2px solid #EEEEEE;
|
||||
top: 12px;
|
||||
&:after{
|
||||
content: ' ';
|
||||
height: 0;
|
||||
position: absolute;
|
||||
width: 0;
|
||||
border: 7px solid transparent;
|
||||
border-top-color: #EEEEEE;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
}
|
||||
}
|
||||
.ant-timeline-item-head-custom{
|
||||
top:20px;
|
||||
padding: 0 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -732,4 +848,13 @@ a.color-grey-ccc:hover{
|
|||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.depotNum{
|
||||
color: #666!important;
|
||||
span:last-child{
|
||||
color: #333;
|
||||
}
|
||||
&:hover span:last-child{
|
||||
color: #2A61FF;
|
||||
}
|
||||
}
|
|
@ -52,7 +52,7 @@ function Contribute(props){
|
|||
<AlignCenter>
|
||||
<img alt="" style={{borderRadius:"50%",marginRight:"10px"}} src={getImageUrl(`/${item.image_url}`)} width="50px" height="50px"/>
|
||||
<div>
|
||||
<Link to={`/users/${item.login}`} className="font-16">{item.name}</Link>
|
||||
<Link to={`/${item.login}`} className="font-16">{item.name}</Link>
|
||||
<p className="font-12 color-grey-9">提交{item.contributions}次</p>
|
||||
</div>
|
||||
</AlignCenter>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Skeleton , Tooltip} from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { numFormat } from 'educoder';
|
||||
|
||||
function DetailBanner({ history,list , owner , projectsId , isManager , url , pathname , state , urlFlag , projectDetail , platform ,open_devops }){
|
||||
const [ menuName , setMenuName ] = useState(undefined);
|
||||
|
@ -10,66 +11,76 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
|||
if(pathname && pathname==="source"){
|
||||
let a = list.filter(item=>item.menu_name === "resources");
|
||||
if(a && a.length === 0){
|
||||
history.push(`/projects/${owner}/${projectsId}`);
|
||||
history.push(`/${owner}/${projectsId}`);
|
||||
}
|
||||
}
|
||||
setMenuName(list);
|
||||
}
|
||||
},[list]);
|
||||
return(
|
||||
<div className="f-wrap-between mt15">
|
||||
<div className="f-wrap-between mt25">
|
||||
{
|
||||
menuName && projectDetail ?
|
||||
<ul className="headerMenu-wrapper">
|
||||
{
|
||||
menuName.map((item,key)=>{
|
||||
Array.isArray(menuName)&& menuName.map((item,key)=>{
|
||||
return(
|
||||
<React.Fragment>
|
||||
<React.Fragment key={item.menu_name}>
|
||||
{
|
||||
item.menu_name === "home" &&
|
||||
<li className={pathname==="about" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/about`, state }}>
|
||||
<i className={(pathname==="" || urlFlag) ? "iconfont icon-zhuye1 color-grey-3 mr5 font-14":"iconfont icon-zhuye1 color-grey-6 font-14 mr5"}></i>
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/about`, state }}>
|
||||
<i className={"iconfont icon-zhuye-fill color-grey-3 mr5 font-14"}></i>
|
||||
<span>主页</span>
|
||||
</Link>
|
||||
</Link>
|
||||
</li>
|
||||
}
|
||||
{
|
||||
item.menu_name === "code" &&
|
||||
<li className={(pathname==="" || urlFlag) ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}`, state }}>
|
||||
<i className={(pathname==="" || urlFlag) ? "iconfont icon-daimaku color-grey-3 mr5 font-14":"iconfont icon-daimaku color-grey-6 font-14 mr5"}></i>
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}`, state }}>
|
||||
<i className={"iconfont icon-daimakuicon1 color-grey-3 mr5 font-14"}></i>
|
||||
<span>代码库</span>
|
||||
</Link>
|
||||
</Link>
|
||||
</li>
|
||||
}
|
||||
{
|
||||
item.menu_name === "issues" &&
|
||||
<li className={pathname==="issues" ? "active" : ""}>
|
||||
<Tooltip title="易修是Issue的中文名,即问题列表" placement="bottom">
|
||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/issues`, state }}>
|
||||
<i className={pathname==="issues" ? "iconfont icon-renwu color-grey-3 mr5 font-14":"iconfont icon-renwu color-grey-6 font-14 mr5"}></i>
|
||||
<span>易修</span>
|
||||
{projectDetail && projectDetail.issues_count ? <span className="num">{projectDetail.issues_count}</span> : ""}
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/issues`, state }}>
|
||||
<Tooltip title="易修是Issue的中文名,即问题列表" placement="bottom">
|
||||
<i className={"iconfont icon-yixiuicon1 color-grey-3 mr5 font-14"}></i>
|
||||
<span>易修(Issue)</span>
|
||||
</Tooltip>
|
||||
{projectDetail && projectDetail.issues_count ? <span className="num">{numFormat(projectDetail.issues_count)}</span> : ""}
|
||||
</Link>
|
||||
</Tooltip>
|
||||
</li>
|
||||
}
|
||||
{
|
||||
item.menu_name === "pulls" && projectDetail && parseInt(projectDetail.type) !== 2 && platform ?
|
||||
<li className={pathname==="pulls" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/pulls`, state }}>
|
||||
<i className={pathname==="pulls" ? "iconfont icon-hebingqingqiu1 color-grey-3 mr5 font-14":"iconfont icon-hebingqingqiu1 color-grey-6 font-14 mr5"}></i>
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/pulls`, state }}>
|
||||
<i className={"iconfont icon-hebingqingqiu1 color-grey-3 mr5 font-14"}></i>
|
||||
<span>合并请求</span>
|
||||
{projectDetail && projectDetail.pull_requests_count ? <span className="num">{projectDetail.pull_requests_count}</span> : ""}
|
||||
{projectDetail && projectDetail.pull_requests_count ? <span className="num">{numFormat(projectDetail.pull_requests_count)}</span> : ""}
|
||||
</Link>
|
||||
</li>:""
|
||||
}
|
||||
{
|
||||
item.menu_name === "wiki" &&
|
||||
<li className={pathname === "wiki" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/wiki`, state }}>
|
||||
<i className={"iconfont icon-a-wikiicon1 color-grey-3 mr5 font-14"}></i>
|
||||
<span>Wiki</span>
|
||||
</Link>
|
||||
</li>
|
||||
}
|
||||
{
|
||||
item.menu_name === "devops" && platform ?
|
||||
<li className={pathname==="devops" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/devops${open_devops ? `/dispose`:""}`, state }}>
|
||||
<i className="iconfont icon-gongzuoliu font-13 mr8"></i>工作流(beta版)
|
||||
{/* <Link to={{ pathname: `/${owner}/${projectsId}/devops${open_devops ? `/dispose`:""}`, state }}> */}
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/devops`, state:{...state,open_devops} }}>
|
||||
<i className="iconfont icon-gongzuoliuicon font-13 mr5 color-grey-3"></i>工作流(beta版)
|
||||
{projectDetail && projectDetail.ops_count ? <span>{projectDetail.ops_count}</span> : ""}
|
||||
</Link>
|
||||
</li>
|
||||
|
@ -78,37 +89,37 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
|||
{/* {
|
||||
item.menu_name === "resources" &&
|
||||
<li className={pathname==="source" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/source`, state }}>
|
||||
<i className={pathname==="source" ? "iconfont icon-ziyuanpaihanghetuijian color-grey-3 mr5 font-14":"iconfont icon-ziyuanpaihanghetuijian color-grey-6 font-14 mr5"}></i>
|
||||
<span>资源库</span>
|
||||
{projectDetail && projectDetail.source_count ? <span className="num">{projectDetail.source_count}</span> :""}
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/source`, state }}>
|
||||
<i className={pathname==="source" ? "iconfont icon-ziyuanpaihanghetuijian color-grey-3 mr5 font-14":"iconfont icon-ziyuanpaihanghetuijian color-grey-6 font-14 mr5"}></i>
|
||||
<span>资源库</span>
|
||||
{projectDetail && projectDetail.source_count ? <span className="num">{projectDetail.source_count}</span> :""}
|
||||
</Link>
|
||||
</li>
|
||||
} */}
|
||||
{
|
||||
item.menu_name === "versions" &&
|
||||
<li className={pathname==="milestones" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/milestones`, state }}>
|
||||
<i className={pathname==="milestones" ? "iconfont icon-lichengbei color-grey-3 mr5 font-14":"iconfont icon-lichengbei color-grey-6 font-14 mr5"}></i>
|
||||
<span>里程碑</span>
|
||||
{projectDetail && projectDetail.versions_count ? <span className="num">{projectDetail.versions_count}</span> :""}
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/milestones`, state }}>
|
||||
<i className={pathname==="milestones" ? "iconfont icon-lichengbeiicon color-grey-3 mr5 font-14":"iconfont icon-lichengbeiicon color-grey-6 font-14 mr5"}></i>
|
||||
<span>里程碑</span>
|
||||
{projectDetail && projectDetail.versions_count ? <span className="num">{numFormat(projectDetail.versions_count)}</span> :""}
|
||||
</Link>
|
||||
</li>
|
||||
}
|
||||
{
|
||||
item.menu_name === "activity" &&
|
||||
<li className={pathname==="activity" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/activity`, state }}>
|
||||
<i className={pathname==="activity" ? "iconfont icon-tongzhi color-grey-3 mr5 font-14":"iconfont icon-tongzhi color-grey-6 font-14 mr5"}></i>
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/activity`, state }}>
|
||||
<i className={pathname==="activity" ? "iconfont icon-dongtaiicon color-grey-3 mr5 font-14":"iconfont icon-dongtaiicon color-grey-6 font-14 mr5"}></i>
|
||||
<span>动态</span>
|
||||
</Link>
|
||||
</li>
|
||||
}
|
||||
{
|
||||
item.menu_name === "setting" &&
|
||||
<li className={pathname === "setting" ? "active" : ""}>
|
||||
<Link to={`/projects/${owner}/${projectsId}/setting`}>
|
||||
<i className={url && url.indexOf("/setting") > 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}></i>
|
||||
item.menu_name === "settings" &&
|
||||
<li className={pathname === "settings" ? "active" : ""}>
|
||||
<Link to={`/${owner}/${projectsId}/settings`}>
|
||||
<i className={url && url.indexOf("/settings") > 0 ? "iconfont icon-cangkushezhiicon color-grey-3 mr5 font-14":"iconfont icon-cangkushezhiicon color-grey-6 font-14 mr5"}></i>
|
||||
<span>仓库设置</span>
|
||||
</Link>
|
||||
</li>
|
||||
|
|
|
@ -1,26 +1,15 @@
|
|||
import React from 'react';
|
||||
import { Tooltip , message } from 'antd';
|
||||
import './sub.scss';
|
||||
import CopyTool from '../../Component/CopyTool';
|
||||
|
||||
function Invite({code,className}) {
|
||||
|
||||
function jsCopy(id) {
|
||||
const copyEle = document.querySelector(id); // 获取要复制的节点
|
||||
const range = document.createRange(); // 创造range
|
||||
window.getSelection().removeAllRanges(); //清除页面中已有的selection
|
||||
range.selectNode(copyEle); // 选中需要复制的节点
|
||||
window.getSelection().addRange(range); // 执行选中元素
|
||||
document.execCommand("Copy"); // 执行copy操作
|
||||
message.success('复制成功');
|
||||
}
|
||||
return(
|
||||
<div className={className}>
|
||||
<span className="font-16 color-grey-6">邀请码</span>
|
||||
<span className="font-16 color-ooo">邀请码</span>
|
||||
<div>
|
||||
<span id="devitecode">{code}</span>
|
||||
<Tooltip title={<p className="edu-txt-center">可以通过邀请码邀请成员加入项目<br/>点击复制邀请码。</p>} placement={"bottom"}>
|
||||
<i className="iconfont icon-fuzhi2 font-16 color-blue ml8" onClick={()=>jsCopy("#devitecode")}></i>
|
||||
</Tooltip>
|
||||
<input value={code} id="devitecode" style={{width:"62px",border:"none",cursor:"default"}} readOnly/>
|
||||
<CopyTool timeOut={true} beforeText={<p className="edu-txt-center">可以通过邀请码邀请成员加入项目<br/>点击复制邀请码。</p>} className="ml8 font-16" inputId="devitecode"/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
import React , { useState } from 'react';
|
||||
import { Anchor , Input } from 'antd';
|
||||
import './sub.scss';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
const { Link } = Anchor;
|
||||
|
||||
function ReadmeCatelogue({ menuList , hash }) {
|
||||
const [ goHref , setGoHref ] = useState("");
|
||||
const [ value , setValue ] = useState("");
|
||||
const [ menu , setMenu] = useState(menuList);
|
||||
|
||||
|
||||
function onChange(link){
|
||||
setGoHref(link);
|
||||
};
|
||||
|
||||
function changeValue(e) {
|
||||
setValue(e.target.value);
|
||||
if(e.target.value){
|
||||
let m = menuList.filter(i=>i.text.toLowerCase().indexOf(e.target.value.toLowerCase())>-1);
|
||||
setMenu(m);
|
||||
}else{
|
||||
setMenu(menuList);
|
||||
}
|
||||
}
|
||||
return(
|
||||
<div>
|
||||
<div className="searchBox">
|
||||
<Input
|
||||
placeholder={"请输入关键字"}
|
||||
value={value}
|
||||
onChange={changeValue}
|
||||
prefix={<i className="iconfont icon-sousuo_icon1 font-14"></i>}/>
|
||||
</div>
|
||||
{
|
||||
menu && menu.length>0?
|
||||
<div className="anchorBox">
|
||||
<Anchor affix={false} onChange={onChange}>
|
||||
{
|
||||
menu.map((item,key)=>{
|
||||
return(
|
||||
<div style={{paddingLeft:`${item.level *10}px`}} className={goHref===item.href?"items active":"items"}>
|
||||
<Link href={`#${item.text}`} title={item.text} />
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Anchor>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default ReadmeCatelogue;
|
|
@ -0,0 +1,13 @@
|
|||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import'./sub.scss'
|
||||
|
||||
function SubMenu({tab,owner,projectsId}) {
|
||||
return(
|
||||
<ul className="subMenu">
|
||||
<Link to={`/${owner}/${projectsId}/tags`} className={tab==="tags"?"active":""}>标签</Link>
|
||||
<Link to={`/${owner}/${projectsId}/releases`} className={tab==="releases"?"active":""}>发行版</Link>
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
export default SubMenu;
|
|
@ -24,7 +24,68 @@
|
|||
}
|
||||
}
|
||||
|
||||
.detailsCode{
|
||||
.menuslist{
|
||||
z-index: 100;
|
||||
width: 297px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5);
|
||||
border-radius: 4px;
|
||||
.searchBox{
|
||||
padding:15px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.ant-anchor-wrapper{
|
||||
margin-left: 0px;
|
||||
padding:5px 15px;
|
||||
max-height: 255px!important;
|
||||
.items{
|
||||
border-radius: 4px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
.ant-anchor-link-title{
|
||||
color: #333333!important;
|
||||
}
|
||||
&:hover{
|
||||
background-color: #F3F4F6;
|
||||
}
|
||||
&.active{
|
||||
background-color: #2A61FF;
|
||||
.ant-anchor-link-title{
|
||||
color: #fff!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-anchor-link{
|
||||
padding:0px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.ant-anchor-ink::before{
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.subMenu{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-top: 30px;
|
||||
a{
|
||||
width: 83px;
|
||||
font-weight: 500;
|
||||
line-height: 30px;
|
||||
height: 32px;
|
||||
color: #333333!important;
|
||||
text-align: center;
|
||||
border: 1px solid #D0D0D0;
|
||||
border-radius: 0px 4px 4px 0px;
|
||||
background: rgba(250, 251, 252, 0);
|
||||
&:first-child{
|
||||
border-right: none;
|
||||
border-radius: 4px 0px 0px 4px;
|
||||
}
|
||||
&.active{
|
||||
background-color: #466AFF;
|
||||
color: #fff!important;
|
||||
border-color: #466AFF;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
import React,{ useEffect , useState } from 'react';
|
||||
import SubMenu from '../sub/SubMenu';
|
||||
import { Table , Tooltip , Spin } from 'antd';
|
||||
import axios from 'axios';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { truncateCommitId } from '../../common/util';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import Nonedata from '../../Nodata';
|
||||
import './Index.scss';
|
||||
import Tree from '../img/tree.png'
|
||||
import moment from 'moment';
|
||||
|
||||
function Tags(props) {
|
||||
|
||||
const [ source , setSource ] = useState(undefined);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
|
||||
const { projectsId , owner } = props.match.params;
|
||||
|
||||
useEffect(() => {
|
||||
if (projectsId) {
|
||||
const url = `/${owner}/${projectsId}/tags.json`;
|
||||
axios.get(url).then((result) => {
|
||||
if (result) {
|
||||
setSource(result.data);
|
||||
setIsSpin(false);
|
||||
}
|
||||
}).catch(error => {})
|
||||
}
|
||||
}, [owner, projectsId]);
|
||||
|
||||
const columns=[
|
||||
{
|
||||
title:"标签名",
|
||||
dataIndex:"name",
|
||||
key:1,
|
||||
ellipsis:true,
|
||||
width:"200px",
|
||||
render:(txt,item)=>{
|
||||
return(
|
||||
<div className="tagBranch">
|
||||
<Link className="hover tagClass" to={`/${owner}/${projectsId}/tree/${item.name}`}>{item.name}</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title:"创建时间",
|
||||
dataIndex:"time_ago",
|
||||
key:2,
|
||||
ellipsis:true,
|
||||
render:(txt,item)=>{
|
||||
return (
|
||||
<span className="color-grey-3 tagModel">
|
||||
{
|
||||
item.tagger &&
|
||||
<Tooltip placement="top" title={item.tagger.name}>
|
||||
{
|
||||
item.tagger.id ?
|
||||
<Link className="mr3 tagModelImg" to={`/${item.tagger.login}`} >
|
||||
<img src={getImageUrl(`/${item.tagger && item.tagger.image_url}`)} alt=""/>
|
||||
</Link>
|
||||
:
|
||||
<span className="mr3 tagModelImg" style={{cursor:"default"}}>
|
||||
<img src={getImageUrl(`/${item.tagger && item.tagger.image_url}`)} alt=""/>
|
||||
</span>
|
||||
}
|
||||
</Tooltip>
|
||||
}
|
||||
<span>创建于{txt}</span>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title:"提交ID",
|
||||
dataIndex:"id",
|
||||
key:3,
|
||||
ellipsis:true,
|
||||
render:(txt,item)=>{
|
||||
return (
|
||||
<Tooltip placement="top" title={`最后提交日期:${item.created_at_unix ? moment(item.created_at_unix*1000).format('YYYY-MM-DD'):''}`}>
|
||||
<img src={Tree} alt="提交ID" width="22px" className="mr4"/>
|
||||
<Link className="hover color-blue" to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.id}`)}`}>{truncateCommitId(item.id)}</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title:"描述信息",
|
||||
dataIndex:"message",
|
||||
key:4,
|
||||
ellipsis:true,
|
||||
render:(txt,item)=>{
|
||||
return item.message || "--"
|
||||
}
|
||||
},
|
||||
{
|
||||
title:"下载",
|
||||
dataIndex:"stage_type",
|
||||
key:5,
|
||||
ellipsis:true,
|
||||
align:"center",
|
||||
width:"204px",
|
||||
render:(txt,item)=>{
|
||||
return (
|
||||
<React.Fragment>
|
||||
<a href={`${item.tarball_url}`} download className="btn-83">
|
||||
<i className="iconfont icon-xiazai-icon font-16 mr5"></i>TAR
|
||||
</a>
|
||||
<a href={`${item.zipball_url}`} download className="btn-83">
|
||||
<i className="iconfont icon-xiazai-icon font-16 mr5"></i>ZIP
|
||||
</a>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
]
|
||||
return(
|
||||
<div>
|
||||
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="tagSpin">
|
||||
{
|
||||
source && source.length > 0 &&
|
||||
<Table
|
||||
className="tagTable"
|
||||
dataSource={source} columns={columns} pagination={false}></Table>
|
||||
}
|
||||
{
|
||||
source && source.length === 0 && <Nonedata _html={'暂无数据~'}/>
|
||||
}
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Tags;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue