forked from Gitlink/forgeplus-react
Compare commits
99 Commits
dev_milita
...
master
Author | SHA1 | Date |
---|---|---|
|
4d652d238d | |
|
6da4dbc165 | |
|
f65f4c273a | |
|
1af504825c | |
|
e94cf68cc5 | |
|
5fa2fd99b9 | |
|
2f6597355c | |
|
20ab8a6683 | |
|
1eb3c20af4 | |
|
afb599f5be | |
|
a7f709a663 | |
|
d6d6df806d | |
|
6cc97bd039 | |
|
037150a63c | |
|
63c2cfed70 | |
|
52dc63362b | |
|
29e3f0d59d | |
|
233e6a8226 | |
|
80cd6fbae0 | |
|
8fa31edaae | |
|
49d3db6746 | |
|
ffbb5ba34e | |
|
bc11ec68e3 | |
|
2d2deec224 | |
|
a67cabbfb4 | |
|
ceb1915939 | |
|
4c65e1981e | |
|
09598d0e2c | |
|
e09490d424 | |
|
a42a670146 | |
|
b8d40259e5 | |
|
487a2f0495 | |
|
ab34369642 | |
|
f12228aa51 | |
|
5477c41f78 | |
|
dc05f9ce35 | |
|
b601582d15 | |
|
832b18e7f5 | |
|
8c58f77afb | |
|
2c363965dd | |
|
60a7f39c16 | |
|
9811276a7c | |
|
a27c74b9aa | |
|
80cae93045 | |
|
78aba67917 | |
|
43223c7787 | |
|
961587921a | |
|
2f595d750a | |
|
bcaec7a2db | |
|
70ea6259ae | |
|
5d6953f2b3 | |
|
c8eda704e5 | |
|
5d6b95ab8f | |
|
426ea3fece | |
|
ab052ebace | |
|
648c6e235b | |
|
96253f3f58 | |
|
101478d924 | |
|
dccbd6735d | |
|
a0ebba839e | |
|
171f14bd2a | |
|
c3e09f2672 | |
|
6296434527 | |
|
e2dbda3083 | |
|
02f382e6fb | |
|
b568aef34e | |
|
2c83221376 | |
|
6a4fe4d277 | |
|
99f7aea290 | |
|
50f39afffa | |
|
d0ccc92cc6 | |
|
2add7911dc | |
|
ec1ff5d479 | |
|
55f23dea0d | |
|
26e74e7ed4 | |
|
3384cd2703 | |
|
0290822ebf | |
|
31edf6ff45 | |
|
8a1feed72b | |
|
0c0203a8ef | |
|
45e69cb14a | |
|
d7f3c766b4 | |
|
a3226dca4e | |
|
d16ee801ec | |
|
c3eb6edddc | |
|
ad8a127170 | |
|
cbaf72b341 | |
|
a4b5b67da6 | |
|
da31875a5a | |
|
b7a92b17e7 | |
|
f4332db4ad | |
|
99174c2782 | |
|
f33f1f3ce5 | |
|
5d99d63267 | |
|
9137b666ea | |
|
1250a9b10b | |
|
6ea82be73a | |
|
964427b8fc | |
|
afd6904349 |
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "educoder",
|
"name": "forge",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
|
@ -3888,11 +3888,6 @@
|
||||||
"randomfill": "^1.0.3"
|
"randomfill": "^1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"crypto-js": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npm.taobao.org/crypto-js/download/crypto-js-4.0.0.tgz",
|
|
||||||
"integrity": "sha1-KQSrJnep0EKFai6i74DekuSjbcw="
|
|
||||||
},
|
|
||||||
"crypto-random-string": {
|
"crypto-random-string": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
|
||||||
|
@ -20480,6 +20475,16 @@
|
||||||
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"xterm": {
|
||||||
|
"version": "4.8.1",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/xterm/download/xterm-4.8.1.tgz",
|
||||||
|
"integrity": "sha1-FVoXKaQ+Gom0BlJOIsVjQznjnKE="
|
||||||
|
},
|
||||||
|
"xterm-addon-fit": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/xterm-addon-fit/download/xterm-addon-fit-0.4.0.tgz",
|
||||||
|
"integrity": "sha1-BuDF0KaqrPsAnvVl76HIHpPZAZM="
|
||||||
|
},
|
||||||
"y18n": {
|
"y18n": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
||||||
|
|
|
@ -111,7 +111,9 @@
|
||||||
"webpack-dev-server": "^3.10.3",
|
"webpack-dev-server": "^3.10.3",
|
||||||
"webpack-manifest-plugin": "^2.2.0",
|
"webpack-manifest-plugin": "^2.2.0",
|
||||||
"whatwg-fetch": "2.0.3",
|
"whatwg-fetch": "2.0.3",
|
||||||
"wrap-md-editor": "^0.2.20"
|
"wrap-md-editor": "^0.2.20",
|
||||||
|
"xterm": "4.8.1",
|
||||||
|
"xterm-addon-fit": "0.4.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node --max_old_space_size=15360 scripts/start.js",
|
"start": "node --max_old_space_size=15360 scripts/start.js",
|
||||||
|
|
|
@ -2346,7 +2346,6 @@ input::-ms-clear {
|
||||||
/*中间部分宽度固定为1200*/
|
/*中间部分宽度固定为1200*/
|
||||||
.newMain {
|
.newMain {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding-bottom: 110px;
|
|
||||||
min-width: 1200px;
|
min-width: 1200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4108,21 +4107,6 @@ em.vertical-line {
|
||||||
|
|
||||||
/* 右侧内容宽度变化的话,需要调整posi-search right的值*/
|
/* 右侧内容宽度变化的话,需要调整posi-search right的值*/
|
||||||
|
|
||||||
/*底部*/
|
|
||||||
.newFooter {
|
|
||||||
max-height: 110px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.newFooter {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
background: #323232;
|
|
||||||
clear: both;
|
|
||||||
min-width: 1200px;
|
|
||||||
z-index: 8;
|
|
||||||
left: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footercon {
|
.footercon {
|
||||||
border-bottom: 1px solid #47494d;
|
border-bottom: 1px solid #47494d;
|
||||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,55 @@
|
||||||
"css_prefix_text": "icon-",
|
"css_prefix_text": "icon-",
|
||||||
"description": "",
|
"description": "",
|
||||||
"glyphs": [
|
"glyphs": [
|
||||||
|
{
|
||||||
|
"icon_id": "991344",
|
||||||
|
"name": "提交",
|
||||||
|
"font_class": "tijiao",
|
||||||
|
"unicode": "e860",
|
||||||
|
"unicode_decimal": 59488
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "1852052",
|
||||||
|
"name": "数据库",
|
||||||
|
"font_class": "dataBase",
|
||||||
|
"unicode": "e85a",
|
||||||
|
"unicode_decimal": 59482
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "4165948",
|
||||||
|
"name": "文件",
|
||||||
|
"font_class": "wenjian4",
|
||||||
|
"unicode": "e85b",
|
||||||
|
"unicode_decimal": 59483
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "17165148",
|
||||||
|
"name": "链接",
|
||||||
|
"font_class": "lianjie2",
|
||||||
|
"unicode": "e85c",
|
||||||
|
"unicode_decimal": 59484
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "17463741",
|
||||||
|
"name": "分支",
|
||||||
|
"font_class": "fenzhi2",
|
||||||
|
"unicode": "e85d",
|
||||||
|
"unicode_decimal": 59485
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "17972521",
|
||||||
|
"name": "分支-3",
|
||||||
|
"font_class": "fenzhi-3",
|
||||||
|
"unicode": "e85e",
|
||||||
|
"unicode_decimal": 59486
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "18682391",
|
||||||
|
"name": "天平",
|
||||||
|
"font_class": "tianping",
|
||||||
|
"unicode": "e85f",
|
||||||
|
"unicode_decimal": 59487
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "1770896",
|
"icon_id": "1770896",
|
||||||
"name": "撤销",
|
"name": "撤销",
|
||||||
|
|
|
@ -20,6 +20,27 @@ Created by iconfont
|
||||||
/>
|
/>
|
||||||
<missing-glyph />
|
<missing-glyph />
|
||||||
|
|
||||||
|
<glyph glyph-name="tijiao" unicode="" d="M776.340596 759.889666l-369.442335 0c-7.573056 0-14.839097-2.967819-20.263042-8.187088L201.197681 571.177294c-5.526284-5.423946-8.801119-12.997002-8.801119-20.774735l-1.023386-513.637418c0-7.777733 2.967819-15.043774 8.494104-20.570058 5.526284-5.526284 12.792325-8.494104 20.570058-8.494104L382.746352 7.700979c12.485309 0 22.514491 10.029182 22.514491 22.514491s-10.029182 22.514491-22.514491 22.514491L236.402159 52.729962l0.921047 467.687388 194.03398 0c16.681191 0 30.189886 13.508695 30.189886 30.189886L461.547072 714.860684l298.828703 0 0-665.200879L621.195283 49.659804c-12.485309 0-22.514491-10.029182-22.514491-22.514491s10.029182-22.514491 22.514491-22.514491l155.145313 0c16.06716 0 29.064162 12.997002 29.064162 29.064162L805.404757 730.825505C805.404757 746.892664 792.407755 759.889666 776.340596 759.889666zM416.518089 565.446332 259.837697 565.446332l153.610234 149.414351 3.172497 0L416.620428 565.446332zM713.30002 434.452928c0 12.485309-10.029182 22.514491-22.514491 22.514491L326.460124 456.96742c-12.485309 0-22.514491-10.029182-22.514491-22.514491l0 0c0-12.485309 10.029182-22.514491 22.514491-22.514491l364.325405 0C703.270837 411.938437 713.30002 421.967619 713.30002 434.452928L713.30002 434.452928zM713.30002 357.698981c0 12.485309-10.029182 22.514491-22.514491 22.514491L326.460124 380.213472c-12.485309 0-22.514491-10.029182-22.514491-22.514491l0 0c0-12.485309 10.029182-22.514491 22.514491-22.514491l364.325405 0C703.270837 335.184489 713.30002 345.213672 713.30002 357.698981L713.30002 357.698981zM713.30002 279.921647c0 12.485309-10.029182 22.514491-22.514491 22.514491L326.460124 302.436138c-12.485309 0-22.514491-10.029182-22.514491-22.514491l0 0c0-12.485309 10.029182-22.514491 22.514491-22.514491l364.325405 0C703.270837 257.407156 713.30002 267.436338 713.30002 279.921647L713.30002 279.921647zM501.970818 220.155906c-1.535079 1.535079-4.093544 1.43274-5.526284-0.102339l-54.853488-59.458725c-2.251449-2.456126-0.511693-6.447332 2.865481-6.447332L479.968019 154.147511l0-88.829902c0-2.251449 1.842095-4.298221 4.093544-4.298221l36.841895 0c2.251449 0 4.093544 2.046772 4.093544 4.298221L524.997002 154.045173l35.511493 0c3.479512 0 5.219268 4.195882 2.660804 6.652009L501.970818 220.155906z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
|
|
||||||
|
<glyph glyph-name="dataBase" unicode="" d="M512 793.4c110.7 0 215-12.3 293.9-34.7 35.8-10.2 65-22.1 84.5-34.7 18.6-12 21.3-19.7 21.6-20.6-0.2-0.9-3-8.6-21.6-20.6-19.5-12.5-48.7-24.5-84.5-34.7-78.9-22.3-183.2-34.7-293.9-34.7s-215 12.3-293.9 34.7c-35.8 10.2-65 22.1-84.5 34.7-18.6 12-21.3 19.7-21.6 20.6 0.2 0.9 3 8.6 21.6 20.6 19.5 12.5 48.7 24.5 84.5 34.7 78.9 22.4 183.2 34.7 293.9 34.7M512 833.4c-243 0-440-58.2-440-130s197-130 440-130 440 58.2 440 130-197 130-440 130zM112 705.6h-40v-641h40v641zM952 705.9h-40v-641h40v641zM912 65v-0.5c-0.2-0.9-3-8.6-21.6-20.6-19.5-12.5-48.7-24.5-84.5-34.7-78.9-22.3-183.2-34.6-293.9-34.6s-215 12.3-293.9 34.7c-35.8 10.2-65 22.1-84.5 34.7-18.6 12-21.3 19.7-21.6 20.6v0.3l-40-0.3v-0.1c0-71.8 197-130 440-130s440 58.2 440 130v0.4l-40 0.1zM912 275.5v-0.5c-0.2-0.9-3-8.6-21.6-20.6-19.5-12.5-48.7-24.5-84.5-34.7-78.9-22.3-183.2-34.7-293.9-34.7s-215 12.3-293.9 34.7c-35.8 10.2-65 22.1-84.5 34.7-18.6 12-21.3 19.7-21.6 20.6v0.3l-40-0.3v-0.1c0-71.8 197-130 440-130s440 58.2 440 130v0.4l-40 0.2zM912 497v-0.5c-0.2-0.9-3-8.6-21.6-20.6-19.5-12.5-48.7-24.5-84.5-34.7-78.9-22.3-183.2-34.7-293.9-34.7s-215 12.3-293.9 34.7c-35.8 10.2-65 22.1-84.5 34.7-18.6 12-21.3 19.7-21.6 20.6v0.3l-40-0.3v-0.1c0-71.8 197-130 440-130s440 58.2 440 130v0.4l-40 0.2z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
|
|
||||||
|
<glyph glyph-name="wenjian4" unicode="" d="M751.3-61.4H274.7c-82.7 0-150 67.3-150 150V679.8c0 82.7 67.3 150 150 150h138.9c13.8 0 25-11.2 25-25s-11.2-25-25-25H274.7c-55.1 0-100-44.9-100-100v-591.2c0-55.1 44.9-100 100-100h476.6c55.1 0 100 44.9 100 100v390H653.6c-32.4 0-62.8 12.6-85.7 35.6-22.9 23-35.4 53.5-35.2 85.9l0.9 204.9c0 10 6 19 15.2 22.9 9.2 3.9 19.8 2 27-4.8l317.7-301.2 0.3-0.3 0.5-0.5c4.3-4.5 6.9-10.6 6.9-17.2v-415c0.1-83-67.2-150.3-149.9-150.3z m-168 808.3l-0.6-147.1c-0.1-19 7.3-36.9 20.7-50.4 13.4-13.5 31.3-20.9 50.3-20.9h160L583.3 746.9zM701.4 298H324.6c-13.8 0-25 11.2-25 25s11.2 25 25 25h376.8c13.8 0 25-11.2 25-25s-11.2-25-25-25zM701.4 148.7H324.6c-13.8 0-25 11.2-25 25s11.2 25 25 25h376.8c13.8 0 25-11.2 25-25s-11.2-25-25-25z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
|
|
||||||
|
<glyph glyph-name="lianjie2" unicode="" d="M427.392 259.328a40.448 40.448 0 0 0-31.168 13.376c-93.44 93.44-93.44 244.864 0 342.784l209.28 209.28c93.44 93.44 249.344 93.44 342.784 0a243.264 243.264 0 0 0 71.232-169.216c0-62.272-26.688-124.608-71.232-169.152L832.64 361.728c-17.856-17.792-44.544-17.792-57.92 0-17.792 17.792-17.792 44.544 0 57.856l120.256 120.256a155.904 155.904 0 0 1 0 222.592 155.904 155.904 0 0 1-222.656 0l-209.28-209.28a155.904 155.904 0 0 1 0-222.592c17.856-17.792 17.856-44.48 0-57.856-8.832-4.48-22.208-13.376-35.584-13.376zM240.448-128c-66.816 0-124.672 26.688-169.216 71.232A243.264 243.264 0 0 0 0 112.448c0 62.272 26.688 124.608 71.232 169.152l120.192 120.192c17.856 17.856 44.544 17.856 57.92 0 17.792-17.792 17.792-44.48 0-57.856l-120.256-120.192a155.904 155.904 0 0 1 0-222.656 158.08 158.08 0 0 1 111.36-44.48 158.08 158.08 0 0 1 111.296 44.48l209.28 209.28a158.08 158.08 0 0 1 44.48 111.36c0 44.48-17.792 80.064-44.544 111.232-17.792 17.792-17.792 44.544 0 57.92 17.792 17.792 44.544 17.792 57.92 0a243.264 243.264 0 0 0 71.232-169.216c0-66.752-26.752-124.672-71.232-169.152l-209.28-209.28C365.056-101.312 307.2-128 240.448-128z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
|
|
||||||
|
<glyph glyph-name="fenzhi2" unicode="" d="M737.792 811.2a128 128 0 0 0 36.352-250.752C761.6 440.96 690.176 374.08 567.936 369.28l-14.208-0.256c-104.704 0-179.456-21.12-225.472-61.312l0.064-121.6a128 128 0 1 0-76.8 0V561.024a128 128 0 1 0 76.8 0l-0.128-160.96c53.44 28.352 121.6 43.264 203.84 45.44l21.76 0.32c88.064 0 133.248 35.456 143.36 115.968a128 128 0 0 0 40.64 249.344zM289.92 128a64 64 0 1 1 0-128 64 64 0 0 1 0 128z m0 619.2a64 64 0 1 1 0-128 64 64 0 0 1 0 128z m447.872 0a64 64 0 1 1 0-128 64 64 0 0 1 0 128z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
|
|
||||||
|
<glyph glyph-name="fenzhi-3" unicode="" d="M199.095774 895.999795a170.536926 170.536926 0 0 0 59.166708-330.526654c30.719994-284.446663 286.719943-339.046332 406.753199-349.85977a170.577886 170.577886 0 1 0 159.866848-229.826514 171.622366 171.622366 0 0 0-161.566688 113.786857c-241.766352 11.386878-325.406655 102.973419-407.326639 205.373399v-101.273579a170.659806 170.659806 0 1 0-113.786857 0V564.346742A170.721246 170.721246 0 0 0 199.095774 895.999795m0-113.786857a56.893429 56.893429 0 1 1 56.893428-56.893429 57.057269 57.057269 0 0 1-56.893428 56.893429m0-682.659704a56.893429 56.893429 0 1 1 56.893428-56.893428 57.057269 57.057269 0 0 1-56.893428 56.893428m625.766275 113.786858a56.893429 56.893429 0 1 1 56.893428-56.893429 57.057269 57.057269 0 0 1-56.893428 56.893429z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
|
|
||||||
|
<glyph glyph-name="tianping" unicode="" d="M669.5 495.5c0-74.4 60.5-134.9 134.9-134.9s134.9 60.5 134.9 134.9c0 30.3-21.4 84.9-63.7 162.3-31 56.8-62.5 105.9-62.8 106.4v0.1c-0.2 0.3-0.4 0.6-0.7 0.9 0 0.1-0.1 0.1-0.1 0.2-0.2 0.2-0.4 0.5-0.6 0.7-0.1 0.1-0.2 0.2-0.3 0.2-0.2 0.2-0.4 0.3-0.6 0.5-0.1 0.1-0.2 0.1-0.3 0.2-0.6 0.4-1.3 0.8-2 1.1-0.1 0-0.2 0.1-0.2 0.1l-0.9 0.3c-0.1 0-0.2 0.1-0.3 0.1-0.3 0.1-0.6 0.1-0.9 0.2h-0.3c-0.4 0-0.8 0.1-1.2 0.1H556.6c-4.6 20.4-22.8 35.7-44.6 35.7s-40-15.3-44.6-35.7H221.6c-0.4 0-0.8 0-1.2-0.1h-0.3c-0.3 0-0.6-0.1-0.9-0.2-0.1 0-0.2-0.1-0.3-0.1l-0.9-0.3c-0.1 0-0.2-0.1-0.2-0.1-0.7-0.3-1.4-0.7-2-1.1-0.1-0.1-0.2-0.1-0.3-0.2-0.2-0.2-0.4-0.3-0.6-0.5-0.1-0.1-0.2-0.2-0.3-0.2l-0.7-0.7-0.1-0.1c-0.2-0.3-0.5-0.6-0.7-0.9v-0.1c-0.3-0.5-31.8-49.5-62.8-106.4-42.3-77.4-63.7-132-63.7-162.3 0-74.4 60.5-134.9 134.9-134.9s134.9 60.5 134.9 134.9c0 30.3-21.4 84.9-63.7 162.3-20.6 37.7-41.4 72-53.1 91h227.7c3.9-17.2 17.4-30.7 34.6-34.6v-587.9H315.7c-5.5 0-10-4.5-10-10V55H172.9c-5.5 0-10-4.5-10-10v-71.4c0-5.5 4.5-10 10-10h678.2c5.5 0 10 4.5 10 10V45c0 5.5-4.5 10-10 10H718.3v61.4c0 5.5-4.5 10-10 10H522V714.2c17.2 3.9 30.7 17.4 34.6 34.6h229.7c-11.7-18.9-32.5-53.2-53.2-91-42.2-77.3-63.6-131.9-63.6-162.3z m171.6-512H182.9v51.4h658.3v-51.4z m-142.8 71.4H325.7v51.4h372.7v-51.4zM221.6 380.6c-63.4 0-114.9 51.6-114.9 114.9 0 1.1 0 2.2 0.1 3.4h229.7c0.1-1.2 0.1-2.3 0.1-3.4-0.1-63.3-51.6-114.9-115-114.9z m111.3 138.3H110.2c6.3 24.4 22.1 64.2 57.6 129.2 21.1 38.6 42.4 73.6 53.7 91.9 11.4-18.3 32.7-53.3 53.7-91.9 35.6-65 51.5-104.8 57.7-129.2zM512 733.1c-14.2 0-25.7 11.5-25.7 25.7s11.5 25.7 25.7 25.7 25.7-11.5 25.7-25.7-11.5-25.7-25.7-25.7z m292.4-352.5c-63.4 0-114.9 51.6-114.9 114.9 0 1.1 0 2.3 0.1 3.5 0.6-0.1 1.1-0.2 1.7-0.2h227.9c0.1-1.2 0.1-2.3 0.1-3.4 0.1-63.2-51.5-114.8-114.9-114.8z m0 359.4c11.4-18.3 32.7-53.3 53.7-91.9 35.5-65 51.3-104.9 57.6-129.2H693.1c6.3 24.4 22.1 64.2 57.6 129.2 21.1 38.7 42.3 73.7 53.7 91.9z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
|
|
||||||
<glyph glyph-name="chexiao" unicode="" d="M530.496 524.928h-6.144V661.632c0 51.136-29.312 72.448-65.472 43.328L122.816 434.624c-36.096-28.992-36.096-76.48 0.128-105.472l333.504-267.648c36.16-28.992 67.968 0.448 67.968 43.584v144.256h50.496c145.856 0 257.152-62.976 325.248-184.576 13.376-22.08 27.456-17.28 27.456 0-2.944 216.576-186.368 460.16-397.12 460.16z" horiz-adv-x="1024" />
|
<glyph glyph-name="chexiao" unicode="" d="M530.496 524.928h-6.144V661.632c0 51.136-29.312 72.448-65.472 43.328L122.816 434.624c-36.096-28.992-36.096-76.48 0.128-105.472l333.504-267.648c36.16-28.992 67.968 0.448 67.968 43.584v144.256h50.496c145.856 0 257.152-62.976 325.248-184.576 13.376-22.08 27.456-17.28 27.456 0-2.944 216.576-186.368 460.16-397.12 460.16z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 724 KiB After Width: | Height: | Size: 733 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2,7 +2,7 @@ import axios from 'axios';
|
||||||
import { requestProxy } from "./indexEduplus2RequestProxy";
|
import { requestProxy } from "./indexEduplus2RequestProxy";
|
||||||
import { broadcastChannelOnmessage, isDev, queryString } from 'educoder';
|
import { broadcastChannelOnmessage, isDev, queryString } from 'educoder';
|
||||||
import { notification } from 'antd';
|
import { notification } from 'antd';
|
||||||
import cookie from 'react-cookies';
|
|
||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
let message501 = false;
|
let message501 = false;
|
||||||
|
@ -11,10 +11,8 @@ broadcastChannelOnmessage('refreshPage', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
function locationurl(list) {
|
function locationurl(list) {
|
||||||
if (window.location.port === "3007") {
|
if (window.location.port !== "3007") {
|
||||||
|
window.location.href = list
|
||||||
} else {
|
|
||||||
window.location.href = list
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO 开发期多个身份切换
|
// TODO 开发期多个身份切换
|
||||||
|
@ -26,53 +24,22 @@ if (isDev) {
|
||||||
parsed = queryString.parse(_search);
|
parsed = queryString.parse(_search);
|
||||||
}
|
}
|
||||||
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
||||||
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
||||||
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
|
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
|
||||||
}
|
}
|
||||||
function clearAllCookie() {
|
|
||||||
cookie.remove('_educoder_session', { path: '/' });
|
|
||||||
cookie.remove('autologin_trustie', { path: '/' });
|
|
||||||
setpostcookie()
|
|
||||||
}
|
|
||||||
clearAllCookie();
|
|
||||||
function setpostcookie() {
|
|
||||||
const str = window.location.pathname;
|
|
||||||
if (str.indexOf("/wxcode") !== -1) {
|
|
||||||
cookie.remove('_educoder_session', { path: '/' });
|
|
||||||
cookie.remove('autologin_trustie', { path: '/' });
|
|
||||||
const _params = window.location.search;
|
|
||||||
if (_params) {
|
|
||||||
let _search = _params.split('?')[1];
|
|
||||||
let _educoder_sessions = _search.split('&')[0].split('=');
|
|
||||||
cookie.save('_educoder_session', _educoder_sessions[1], { domain: '.educoder.net', path: '/' });
|
|
||||||
let autologin_trusties = _search.split('&')[1].split('=');
|
|
||||||
cookie.save('autologin_trustie', autologin_trusties[1], { domain: '.educoder.net', path: '/' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setpostcookie();
|
|
||||||
|
|
||||||
window._debugType = debugType;
|
window._debugType = debugType;
|
||||||
export function initAxiosInterceptors(props) {
|
export function initAxiosInterceptors(props) {
|
||||||
|
// 判断网络是否连接
|
||||||
initOnlineOfflineListener();
|
initOnlineOfflineListener();
|
||||||
var proxy = "http://localhost:3000";
|
|
||||||
proxy = "https://testforgeplus.trustie.net";
|
|
||||||
|
|
||||||
const requestMap = {};
|
var proxy = "https://testforgeplus.trustie.net";
|
||||||
window.setfalseInRequestMap = function (keyName) {
|
|
||||||
requestMap[keyName] = false;
|
|
||||||
}
|
|
||||||
//响应前的设置
|
//响应前的设置
|
||||||
axios.interceptors.request.use(
|
axios.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
setpostcookie()
|
if(config.url.indexOf("http") !== -1) {
|
||||||
clearAllCookie()
|
|
||||||
|
|
||||||
if (config.url.indexOf(proxy) !== -1) {
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
requestProxy(config)
|
requestProxy(config);
|
||||||
|
|
||||||
let url = `/api${config.url}`;
|
let url = `/api${config.url}`;
|
||||||
|
|
||||||
if (`${config[0]}` !== `true`) {
|
if (`${config[0]}` !== `true`) {
|
||||||
|
@ -86,12 +53,6 @@ export function initAxiosInterceptors(props) {
|
||||||
} else {
|
} else {
|
||||||
config.url = url;
|
config.url = url;
|
||||||
}
|
}
|
||||||
setpostcookie();
|
|
||||||
}
|
|
||||||
if (config.url.indexOf('update_file') === -1) {
|
|
||||||
requestMap[config.url] = true;
|
|
||||||
|
|
||||||
window.setTimeout("setfalseInRequestMap('" + config.url + "')", 900)
|
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
|
@ -146,8 +107,6 @@ export function initAxiosInterceptors(props) {
|
||||||
message501 = false
|
message501 = false
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
requestMap[response.config.url] = false;
|
|
||||||
setpostcookie();
|
|
||||||
return response;
|
return response;
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
|
|
|
@ -15,7 +15,7 @@ export function getImageUrl(path) {
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
return `${local}/${path}`
|
return `${local}/${path}`
|
||||||
}
|
}
|
||||||
return `/${path}`;
|
return `${path}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getImage(path) {
|
export function getImage(path) {
|
||||||
|
@ -162,28 +162,28 @@ export function getmyUrl(geturl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUploadActionUrl(path, goTest) {
|
export function getUploadActionUrl(path, goTest) {
|
||||||
return `${getUrl()}/api/attachments.json?debug=${window._debugType || 'admin'}`;
|
return `${getUrl()}/api/attachments.json${isDev ?`${isDev ?`?debug=${window._debugType || 'admin'}` : ""}` : ""}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUploadLogoActionUrl() {
|
export function getUploadLogoActionUrl() {
|
||||||
return `${getUrl()}/api/resumes/logo.json?debug=${window._debugType || 'admin'}`;
|
return `${getUrl()}/api/resumes/logo.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUploadActionUrltwo(id) {
|
export function getUploadActionUrltwo(id) {
|
||||||
return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json?debug=${window._debugType || 'admin'}`
|
return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUploadActionUrlthree() {
|
export function getUploadActionUrlthree() {
|
||||||
return `${getUrlmys()}/api/jupyters/import_with_tpm.json?debug=${window._debugType || 'admin'}`
|
return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getupload_git_file(id) {
|
export function getupload_git_file(id) {
|
||||||
return `${getUrlmys()}/api/shixuns/${id}/upload_git_file.json?debug=${window._debugType || 'admin'}`
|
return `${getUrlmys()}/api/shixuns/${id}/upload_git_file.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function getUploadActionUrlOfAuth(id) {
|
export function getUploadActionUrlOfAuth(id) {
|
||||||
return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json?debug=${window._debugType || 'admin'}`
|
return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getRandomNumber(type) {
|
export function getRandomNumber(type) {
|
||||||
|
|
|
@ -64,7 +64,7 @@ function CommentItem({
|
||||||
const commentAvatar = (author) => (
|
const commentAvatar = (author) => (
|
||||||
<img
|
<img
|
||||||
className="item-flex flex-image"
|
className="item-flex flex-image"
|
||||||
src={author.image_url ? getImageUrl(`images/${author.image_url}`) : 'https://b-ssl.duitang.com/uploads/item/201511/13/20151113110434_kyReJ.jpeg'}
|
src={author.image_url ? getImageUrl(`/${author.image_url}`) : 'https://b-ssl.duitang.com/uploads/item/201511/13/20151113110434_kyReJ.jpeg'}
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -67,15 +67,14 @@ function Index(props){
|
||||||
}
|
}
|
||||||
return(
|
return(
|
||||||
<div className="aboutPanels">
|
<div className="aboutPanels">
|
||||||
|
|
||||||
<div className="aboutContent">
|
<div className="aboutContent">
|
||||||
<AlignCenterBetween style={{padding:"14px 0px"}}>
|
<AlignCenterBetween style={{padding:"14px 20px"}}>
|
||||||
<span className="font-16"><i className="iconfont icon-xiangmujianjie mr5 font-16 color-blue"></i>项目简介</span>
|
<span className="font-16"><i className="iconfont icon-xiangmujianjie mr5 font-16 color-blue"></i>项目简介</span>
|
||||||
{ editOpration && !edit && <a onClick={editContent} className="color-blue">编辑</a> }
|
{ editOpration && !edit && <a onClick={editContent} className="color-blue">编辑</a> }
|
||||||
</AlignCenterBetween>
|
</AlignCenterBetween>
|
||||||
{
|
{
|
||||||
edit ?
|
edit ?
|
||||||
<div>
|
<div className="padding20">
|
||||||
<MDEditor
|
<MDEditor
|
||||||
placeholder={"请输入描述信息"}
|
placeholder={"请输入描述信息"}
|
||||||
height={500}
|
height={500}
|
||||||
|
@ -114,7 +113,7 @@ function Index(props){
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<div style={{padding:"20px 0px"}}>
|
<div className="padding20">
|
||||||
{content ?
|
{content ?
|
||||||
<RenderHtml className="break_word_comments imageLayerParent" value={content} url={props.history.location}/>
|
<RenderHtml className="break_word_comments imageLayerParent" value={content} url={props.history.location}/>
|
||||||
:
|
:
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
.aboutContent{
|
.aboutContent{
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
border: 1px solid #EEEEEE;
|
border: 1px solid #EEEEEE;
|
||||||
padding:0px 30px;
|
|
||||||
width:100%;
|
width:100%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-top:20px;
|
margin-top:20px;
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ActivityItem extends Component {
|
||||||
}
|
}
|
||||||
<p className="itemLine mt10">
|
<p className="itemLine mt10">
|
||||||
<Link to={`/users/${item && item.user_login}`} className="show-user-link">
|
<Link to={`/users/${item && item.user_login}`} className="show-user-link">
|
||||||
<img alt="" src={getImageUrl(`images/${item.user_avatar}`)} className="createImage" />
|
<img alt="" src={getImageUrl(`/${item.user_avatar}`)} className="createImage" />
|
||||||
<span className="mr20">{item.user_name}</span>
|
<span className="mr20">{item.user_name}</span>
|
||||||
</Link>
|
</Link>
|
||||||
{item.created_at && <span className="color-grey-9">创建于<span className="ml2 color-grey-6">{item.created_at}</span></span>}
|
{item.created_at && <span className="color-grey-9">创建于<span className="ml2 color-grey-6">{item.created_at}</span></span>}
|
||||||
|
|
|
@ -102,9 +102,10 @@ export default (({ projectsId , branch , owner , changeBranch , branchList , tag
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
return(
|
return(
|
||||||
<Popover placement="bottom" visible={flag} content={menu} onClick={()=>setFlag(!flag)} overlayClassName="branch-tagBox-list">
|
<Popover placement='bottomLeft' visible={flag} content={menu} onClick={()=>setFlag(!flag)} overlayClassName="branch-tagBox-list">
|
||||||
<div className="branch-tagBox">
|
<div className="branch-tagBox">
|
||||||
<span className="color-grey-9 mr3 ml8">{nav === 0 ?"分支":"标签"}:</span>
|
{/* {nav === 0 ?"分支":"标签"} */}
|
||||||
|
<span className="color-grey-9 mr3 ml8"><i className="iconfont icon-fenzhi2 font-18"></i></span>
|
||||||
<a className="ant-dropdown-link">
|
<a className="ant-dropdown-link">
|
||||||
{showValue}
|
{showValue}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
min-width: 240px;
|
min-width: 140px;
|
||||||
}
|
}
|
||||||
.branch-tagBox-list .ant-popover-arrow{
|
.branch-tagBox-list .ant-popover-arrow{
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -42,7 +42,7 @@ function AddMember({getID,login}){
|
||||||
className="user_img radius"
|
className="user_img radius"
|
||||||
width="28"
|
width="28"
|
||||||
height="28"
|
height="28"
|
||||||
src={getImageUrl(`images/${item && item.image_url}`)}
|
src={getImageUrl(`/${item && item.image_url}`)}
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
<span className="ml10" style={{ "vertical-align": "middle" }}>
|
<span className="ml10" style={{ "vertical-align": "middle" }}>
|
||||||
|
|
|
@ -6,7 +6,7 @@ import './Component.scss';
|
||||||
function Cards({img , title, desc , rightBtn , src}){
|
function Cards({img , title, desc , rightBtn , src}){
|
||||||
return(
|
return(
|
||||||
<div className="cards">
|
<div className="cards">
|
||||||
{img &&<div className="img"><img src={getImageUrl(`images/${img}`)} alt=""/></div>}
|
{img &&<div className="img"><img src={getImageUrl(`/${img}`)} alt=""/></div>}
|
||||||
<div className="content">
|
<div className="content">
|
||||||
<p className="titles">
|
<p className="titles">
|
||||||
<Link to={src}>{title}</Link>
|
<Link to={src}>{title}</Link>
|
||||||
|
|
|
@ -20,6 +20,7 @@ li.ant-menu-item{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-bottom:18px;
|
margin-bottom:18px;
|
||||||
min-height: 130px;
|
min-height: 130px;
|
||||||
|
border:1px solid #eee;
|
||||||
.img{
|
.img{
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
width: 190px;
|
width: 190px;
|
||||||
|
@ -61,6 +62,7 @@ li.ant-menu-item{
|
||||||
}
|
}
|
||||||
// Tabs
|
// Tabs
|
||||||
.tabsStyle{
|
.tabsStyle{
|
||||||
|
border:1px solid #eee;
|
||||||
.ant-tabs-bar.ant-tabs-top-bar{
|
.ant-tabs-bar.ant-tabs-top-bar{
|
||||||
padding-left: 35px;
|
padding-left: 35px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
|
@ -110,6 +112,9 @@ li.ant-menu-item{
|
||||||
right:240px;
|
right:240px;
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
}
|
}
|
||||||
|
.laterest{
|
||||||
|
color: #05690d;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1800px){
|
@media screen and (max-width: 1800px){
|
||||||
.handleBox{
|
.handleBox{
|
||||||
|
@ -136,3 +141,55 @@ li.ant-menu-item{
|
||||||
right:0px;
|
right:0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.ant-drawer{
|
||||||
|
z-index: 10000!important;
|
||||||
|
}
|
||||||
|
.ant-drawer-body{
|
||||||
|
padding:0px!important;
|
||||||
|
.drawerHead{
|
||||||
|
background-color: #333;
|
||||||
|
color: #fff;
|
||||||
|
padding:15px 20px;
|
||||||
|
}
|
||||||
|
.ant-tree{
|
||||||
|
margin:0px 20px!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.menuPanels{
|
||||||
|
width: 240px;
|
||||||
|
height: 180px;
|
||||||
|
.ant-popover-content,.ant-popover-inner{
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.halfs{
|
||||||
|
margin-top: 24px;
|
||||||
|
padding:24px 0px 0px 0px;
|
||||||
|
border-top: 1px solid #e8e8e8;
|
||||||
|
.attrPerson{
|
||||||
|
padding-bottom: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.menuinfos{
|
||||||
|
padding:15px 0px;
|
||||||
|
&>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;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
& >span:last-child{
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
&:last-child{
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,160 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { AlignCenter , FlexAJ } from '../Component/layout';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import { Popover , Spin } from 'antd';
|
||||||
|
import { getImageUrl } from 'educoder';
|
||||||
|
import './Component.scss';
|
||||||
|
import { getUser } from '../GetData/getData';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
function Contributors({contributors,owner,projectsId}){
|
||||||
|
const [ menuList ,setMenuList ]= useState([]);
|
||||||
|
const [ list , setList ]= useState(undefined);
|
||||||
|
const [ total , setTotal ]= useState(0);
|
||||||
|
const [ menu , setMenu ] = useState("");
|
||||||
|
const [ login , setLogin ] = useState(undefined);
|
||||||
|
const [ isSpin , setIsSpin ] = useState(false);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(contributors && contributors.total_count>0){
|
||||||
|
setTotal(contributors.total_count);
|
||||||
|
setList(contributors.list);
|
||||||
|
}
|
||||||
|
},[contributors])
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(login){
|
||||||
|
getUsers(login);
|
||||||
|
}else{
|
||||||
|
setMenu(undefined);
|
||||||
|
}
|
||||||
|
},[login])
|
||||||
|
|
||||||
|
async function getUsers(login){
|
||||||
|
setIsSpin(true);
|
||||||
|
let a = menuList && menuList.filter(i=>i.login === login);
|
||||||
|
if(a.length === 0){
|
||||||
|
let result = await getUser(login);
|
||||||
|
let arr = menuList;
|
||||||
|
arr.push({...result});
|
||||||
|
setMenuList(arr);
|
||||||
|
setMenusFunc(result);
|
||||||
|
setIsSpin(false);
|
||||||
|
}else{
|
||||||
|
setMenusFunc(a[0]);
|
||||||
|
setIsSpin(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMenusFunc(data){
|
||||||
|
if(data){
|
||||||
|
let ele = (
|
||||||
|
<Spin spinning={isSpin}>
|
||||||
|
<FlexAJ>
|
||||||
|
<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)}
|
||||||
|
</div>
|
||||||
|
</AlignCenter>
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
{
|
||||||
|
data.location && <AlignCenter className="font-12 pt4 pb4"><span>所在地址:</span><span className="ml5">{data.location}</span></AlignCenter>
|
||||||
|
}
|
||||||
|
</Spin>
|
||||||
|
)
|
||||||
|
setMenu(ele);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function FocusFunc(flag,login){
|
||||||
|
axios({
|
||||||
|
method: flag ? 'post' : 'delete',
|
||||||
|
url: `/watchers/${flag ? 'follow' : 'unfollow'}.json`,
|
||||||
|
params: {target_type: "user",id:login}
|
||||||
|
}).then(result => {
|
||||||
|
if (result && (result.data.status === 0 || result.data.status === 2)) {
|
||||||
|
let a = menuList && menuList.filter(i=>i.login === login);
|
||||||
|
if(a){
|
||||||
|
a[0].is_watch = flag;
|
||||||
|
}
|
||||||
|
setMenusFunc(a[0]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderArray(array){
|
||||||
|
let str = "";
|
||||||
|
for(var i = 0;i<array.length;i++){
|
||||||
|
str += array[i].name +"、";
|
||||||
|
}
|
||||||
|
let substr = str.substr(0,str.length-1);
|
||||||
|
return (<span title={substr}>{substr}</span>)
|
||||||
|
}
|
||||||
|
|
||||||
|
function setVisibleFunc(flag,l,index){
|
||||||
|
if(l !== login){
|
||||||
|
setLogin(l);
|
||||||
|
}
|
||||||
|
var lx = list.concat();
|
||||||
|
lx.map(i=>i.visible =false);
|
||||||
|
if(flag){
|
||||||
|
lx[index].visible = flag;
|
||||||
|
}
|
||||||
|
lx.splice();
|
||||||
|
setList(lx);
|
||||||
|
}
|
||||||
|
|
||||||
|
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>
|
||||||
|
<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}`}>
|
||||||
|
<img src={getImageUrl(`/${item.image_url}`)} alt="" onMouseOver={()=>setVisibleFunc(true,item.login,key)}/>
|
||||||
|
</Link>
|
||||||
|
</Popover>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Contributors;
|
|
@ -0,0 +1,99 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { Drawer , Tree , Spin } from 'antd';
|
||||||
|
import './Component.scss';
|
||||||
|
import axios from 'axios';
|
||||||
|
const { TreeNode , DirectoryTree } = Tree;
|
||||||
|
|
||||||
|
function DrawerPanel({visible,onClose,branch,owner,projectsId,history, name , list}){
|
||||||
|
const [ treeData , setTreeData ] = useState(undefined);
|
||||||
|
const [ isSpin , setIsSpin ] = useState(true);
|
||||||
|
const [first , setFirst ] = useState(true);
|
||||||
|
useEffect(()=>{
|
||||||
|
if(visible && first){
|
||||||
|
if(list){
|
||||||
|
setTreeData(list);
|
||||||
|
setIsSpin(false);
|
||||||
|
}else{
|
||||||
|
getMenulist();
|
||||||
|
}
|
||||||
|
setFirst(false);
|
||||||
|
}
|
||||||
|
},[visible])
|
||||||
|
|
||||||
|
function getMenulist(){
|
||||||
|
const url = `/${owner}/${projectsId}/entries.json`;
|
||||||
|
axios.get(url,{ params: { ref: branch } }).then(result=>{
|
||||||
|
if(result){
|
||||||
|
setTreeData(result.data.entries);
|
||||||
|
}
|
||||||
|
setIsSpin(false);
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderTreeNodes(data) {
|
||||||
|
return data && data.length > 0 && data.map((item) => {
|
||||||
|
return (
|
||||||
|
<TreeNode title={item.name} key={item.key} dataRef={item} isLeaf={item.type === "file"}>
|
||||||
|
{renderTreeNodes(item.children)}
|
||||||
|
</TreeNode>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLoadData(tr){
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
if (tr.props.children) {
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let en = [];
|
||||||
|
const url = `/${owner}/${projectsId}/sub_entries.json`;
|
||||||
|
axios.get(url, {
|
||||||
|
params:{
|
||||||
|
filepath:tr.props.dataRef.path,
|
||||||
|
ref:branch,
|
||||||
|
type:"dir"
|
||||||
|
}
|
||||||
|
}).then((result) => {
|
||||||
|
if(result){
|
||||||
|
en = result.data.entries;
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
setTimeout(() => {
|
||||||
|
tr.props.dataRef.children = en;
|
||||||
|
setTreeData([...treeData]);
|
||||||
|
resolve();
|
||||||
|
}, 2000);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectTree(keys,event){
|
||||||
|
let dataref = event.node.props.dataRef;
|
||||||
|
if(dataref.type==="file"){
|
||||||
|
onClose();
|
||||||
|
history.push(`/projects/${owner}/${projectsId}/tree/${branch}/${dataref.path}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Drawer
|
||||||
|
placement="left"
|
||||||
|
visible={visible}
|
||||||
|
closable={false}
|
||||||
|
onClose={onClose}
|
||||||
|
width={"320px"}
|
||||||
|
maskStyle={{backgroundColor:'rgba(0,0,0,0.09)'}}
|
||||||
|
>
|
||||||
|
<Spin spinning={isSpin}>
|
||||||
|
<div className="drawerHead">
|
||||||
|
<p className="font-20">{name}</p>
|
||||||
|
<p><i class="iconfont icon-fenzhi2 font-18 color-grey-9 mr3"></i>{branch}</p>
|
||||||
|
</div>
|
||||||
|
<DirectoryTree loadData={onLoadData} onSelect={selectTree}>
|
||||||
|
{treeData && renderTreeNodes(treeData)}
|
||||||
|
</DirectoryTree>
|
||||||
|
</Spin>
|
||||||
|
</Drawer>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default DrawerPanel;
|
|
@ -0,0 +1,9 @@
|
||||||
|
.ant-modal-mask{
|
||||||
|
z-index: 10000;
|
||||||
|
}
|
||||||
|
.ant-modal-wrap{
|
||||||
|
z-index: 10001;
|
||||||
|
.ant-form-explain{
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
import React , {forwardRef, useEffect} from 'react';
|
||||||
|
import { Modal , Form , Input , Button } from 'antd';
|
||||||
|
import './EAccount.scss';
|
||||||
|
|
||||||
|
function EducoderAccount({form , visible , onOk , email}){
|
||||||
|
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(email){
|
||||||
|
setFieldsValue({email})
|
||||||
|
}
|
||||||
|
},[email])
|
||||||
|
|
||||||
|
function onSure(){
|
||||||
|
validateFields((error,values)=>{
|
||||||
|
if(!error){
|
||||||
|
onOk(values);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 5 },
|
||||||
|
wrapperCol: { span: 18 },
|
||||||
|
};
|
||||||
|
return(
|
||||||
|
<Modal
|
||||||
|
visible={visible}
|
||||||
|
title="提示"
|
||||||
|
width="500px"
|
||||||
|
closable={false}
|
||||||
|
footer={
|
||||||
|
<Button type="primary" onClick={onSure}>确定</Button>
|
||||||
|
}
|
||||||
|
centered
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<p className="mb15 edu-txt-center" style={{maxWidth:"350px",margin:"0px auto"}}>
|
||||||
|
为确保您能正常使用平台功能,请确认以下信息:
|
||||||
|
</p>
|
||||||
|
<Form {...layout}>
|
||||||
|
<Form.Item label="邮箱">
|
||||||
|
{getFieldDecorator("email",{
|
||||||
|
rules:[{required:true,message:"请输入邮箱账号"}]
|
||||||
|
})(
|
||||||
|
<Input placeholder="请输入您的邮箱账号" width="220px"/>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="密码">
|
||||||
|
{getFieldDecorator("password",{
|
||||||
|
rules:[{required:true,message:"请输入邮箱密码"}]
|
||||||
|
})(
|
||||||
|
<Input.Password placeholder="请输入您的邮箱密码" width="220px"/>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Form.create()(forwardRef(EducoderAccount));
|
|
@ -0,0 +1,54 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { FlexAJ } from '../Component/layout';
|
||||||
|
|
||||||
|
function LanguagePower({languages}){
|
||||||
|
const [ array , setArray ] = useState(undefined);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(languages){
|
||||||
|
let arr = [];
|
||||||
|
Object.keys(languages).map((item,key)=>{
|
||||||
|
arr.push({name:item,percent:languages[item],color:getColor()});
|
||||||
|
})
|
||||||
|
setArray(arr);
|
||||||
|
}
|
||||||
|
},[languages])
|
||||||
|
|
||||||
|
function getColor(){
|
||||||
|
let str = "#";
|
||||||
|
let arr = ["1","2","3","4","4","5","6","7","8","9","a","b","c","d","e","f"];
|
||||||
|
for(var i=0;i<6;i++){
|
||||||
|
let num = parseInt(Math.random() * 16);
|
||||||
|
str+=arr[num];
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
return(
|
||||||
|
<div>
|
||||||
|
<p className="font-16 color-grey-6">开发语言</p>
|
||||||
|
<div className="progress">
|
||||||
|
{
|
||||||
|
array && array.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
<span style={{width:item.percent,backgroundColor:item.color}}></span>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
array && array.length > 0 &&
|
||||||
|
<FlexAJ className="progresstip">
|
||||||
|
{
|
||||||
|
array.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
<span><i className="zero" style={{backgroundColor:`${item.color}`}}></i><span>{item.name}</span><span>{item.percent}</span></span>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</FlexAJ>
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default LanguagePower;
|
|
@ -45,7 +45,7 @@ const Div = styled.div`{
|
||||||
export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => {
|
export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => {
|
||||||
return (
|
return (
|
||||||
<Div>
|
<Div>
|
||||||
<Link to={`/users/${user && user.login}`}><Img src={getImageUrl(`images/${img}`)} /></Link>
|
<Link to={`/users/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link>
|
||||||
<div className="m-infos">
|
<div className="m-infos">
|
||||||
<Link to={`/users/${user && user.login}`}><Name>{name}</Name></Link>
|
<Link to={`/users/${user && user.login}`}><Name>{name}</Name></Link>
|
||||||
<Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time>
|
<Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time>
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { AlignCenter , AlignTop , FlexAJ } from '../Component/layout';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
function Releases({owner,projectsId,releaseVersions}){
|
||||||
|
|
||||||
|
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 ?
|
||||||
|
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/releases`}>全部</Link>
|
||||||
|
:
|
||||||
|
<Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||||
|
}
|
||||||
|
</FlexAJ>
|
||||||
|
{
|
||||||
|
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/8/update`}>{item.name}</Link>
|
||||||
|
<span className="font-12 laterest ml5">最新</span>
|
||||||
|
</p>
|
||||||
|
<p className="color-grey-9 font-13">{item.created_at}</p>
|
||||||
|
</div>
|
||||||
|
</AlignTop>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Releases;
|
|
@ -44,7 +44,7 @@ export default ({ getUser })=>{
|
||||||
className="user_img radius"
|
className="user_img radius"
|
||||||
width="28"
|
width="28"
|
||||||
height="28"
|
height="28"
|
||||||
src={getImageUrl(`images/${item && item.image_url}`)}
|
src={getImageUrl(`/${item && item.image_url}`)}
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
<span className="ml10" style={{ "vertical-align": "middle" }}>
|
<span className="ml10" style={{ "vertical-align": "middle" }}>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
export default ({ url , name , column , id , login })=>{
|
||||||
export default ({ url , name , column })=>{
|
|
||||||
const Img = styled.span`
|
const Img = styled.span`
|
||||||
display:flex;
|
display:flex;
|
||||||
${column && "flex-direction: column;text-align:center;"}
|
${column && "flex-direction: column;text-align:center;"}
|
||||||
|
@ -19,8 +19,16 @@ export default ({ url , name , column })=>{
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
return(
|
return(
|
||||||
|
id?
|
||||||
|
<Link to={`/users/${login}`}>
|
||||||
|
<Img>
|
||||||
|
{ url && <img src={url} alt=""/> }
|
||||||
|
<span>{name}</span>
|
||||||
|
</Img>
|
||||||
|
</Link>
|
||||||
|
:
|
||||||
<Img>
|
<Img>
|
||||||
<img src={url} alt=""/>
|
{ url && <img src={url} alt=""/> }
|
||||||
<span>{name}</span>
|
<span>{name}</span>
|
||||||
</Img>
|
</Img>
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,18 +24,33 @@ export const AlignCenter = styled.div`{
|
||||||
display:flex;
|
display:flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}`
|
}`
|
||||||
|
export const AlignTop = styled.div`{
|
||||||
|
display:flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
}`
|
||||||
// 左右结构
|
// 左右结构
|
||||||
export const Box = styled.div`{
|
export const Box = styled.div`{
|
||||||
display:flex;
|
display:flex;
|
||||||
align-item:flex-start;
|
align-items:flex-start;
|
||||||
|
}`
|
||||||
|
export const LongWidth = styled.div`{
|
||||||
|
flex:1;
|
||||||
|
width:0;
|
||||||
|
border-radius:5px;
|
||||||
|
margin-bottom:30px;
|
||||||
}`
|
}`
|
||||||
export const Long = styled.div`{
|
export const Long = styled.div`{
|
||||||
width:72%;
|
width:78%;
|
||||||
|
border-radius:5px;
|
||||||
|
margin-bottom:30px;
|
||||||
|
}`
|
||||||
|
export const ShortWidth = styled.div`{
|
||||||
|
width:300px;
|
||||||
border-radius:5px;
|
border-radius:5px;
|
||||||
margin-bottom:30px;
|
margin-bottom:30px;
|
||||||
}`
|
}`
|
||||||
export const Short = styled.div`{
|
export const Short = styled.div`{
|
||||||
width:28%;
|
flex:1;
|
||||||
border-radius:5px;
|
border-radius:5px;
|
||||||
margin-bottom:30px;
|
margin-bottom:30px;
|
||||||
}`
|
}`
|
||||||
|
|
|
@ -36,8 +36,7 @@ function About(props, ref) {
|
||||||
const [ disabled, setDisabled ] = useState(false);
|
const [ disabled, setDisabled ] = useState(false);
|
||||||
const [ typeFlag, setTypeFlag] = useState(false);
|
const [ typeFlag, setTypeFlag] = useState(false);
|
||||||
|
|
||||||
|
const AuthorLogin = props.projectDetail && props.projectDetail.author && props.projectDetail.author.login;
|
||||||
const AuthorLogin = props.author && props.author.login;
|
|
||||||
const CurrentLogin = props.current_user && props.current_user.login;
|
const CurrentLogin = props.current_user && props.current_user.login;
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(CurrentLogin === AuthorLogin){
|
if(CurrentLogin === AuthorLogin){
|
||||||
|
@ -56,11 +55,6 @@ function About(props, ref) {
|
||||||
setIsSpining(false);
|
setIsSpining(false);
|
||||||
if(result && result.data ){
|
if(result && result.data ){
|
||||||
setStep(result.data.step);
|
setStep(result.data.step);
|
||||||
// setStep(0);
|
|
||||||
// setFieldsValue({...result.data.cloud_account});
|
|
||||||
// if(result.data.cloud_account){
|
|
||||||
// setDisabled(true);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
setIsSpining(false);
|
setIsSpining(false);
|
||||||
|
|
|
@ -45,9 +45,9 @@ function Dispose(props){
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result && result.data){
|
if(result && result.data){
|
||||||
setList(result.data.pipelines);
|
setList(result.data.pipelines);
|
||||||
setSpining(false);
|
|
||||||
}
|
}
|
||||||
}).catch(error=>{})
|
setSpining(false);
|
||||||
|
}).catch(error=>{setSpining(false);})
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
@ -137,13 +137,17 @@ function Dispose(props){
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/devops/mould`);
|
props.history.push(`/projects/${owner}/${projectsId}/devops/mould`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const operate = current_user && (permission && permission !== "Reporter");
|
// 参数管理
|
||||||
|
function toparameter(){
|
||||||
|
props.history.push(`/projects/${owner}/${projectsId}/devops/params`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const operate = current_user && (permission && permission !== "Reporter");
|
||||||
return(
|
return(
|
||||||
<Spin spinning={spining}>
|
<Spin spinning={spining}>
|
||||||
<PipelineName branchList={branchList} visible={visible} value={updateInfo} onCancel={()=>setVisible(false)} onOk={onOk}/>
|
<PipelineName branchList={branchList} visible={visible} value={updateInfo} onCancel={()=>setVisible(false)} onOk={onOk}/>
|
||||||
<div className="disposePanel">
|
<div className="disposePanel">
|
||||||
<Head manager={ operate ? toModalManage : undefined} />
|
<Head manager={ operate ? toModalManage : undefined} parameter={operate ? toparameter :undefined}/>
|
||||||
<Div>
|
<Div>
|
||||||
{ operate && <Blueback onClick={()=>addNew(undefined,undefined)}>新增流水线</Blueback> }
|
{ operate && <Blueback onClick={()=>addNew(undefined,undefined)}>新增流水线</Blueback> }
|
||||||
<div className="mt20 disposeList">
|
<div className="mt20 disposeList">
|
||||||
|
|
|
@ -2,13 +2,47 @@ import React from 'react';
|
||||||
import { Table , Popconfirm } from 'antd';
|
import { Table , Popconfirm } from 'antd';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
const STATUS = {
|
// const STATUS = {
|
||||||
running:"运行中",
|
// running:"运行中",
|
||||||
failure:"未通过",
|
// failure:"未通过",
|
||||||
error:"未通过",
|
// error:"未通过",
|
||||||
success:"已通过",
|
// success:"已通过",
|
||||||
killed:"已撤销",
|
// killed:"已撤销",
|
||||||
pending:"准备中"
|
// pending:"准备中"
|
||||||
|
// }
|
||||||
|
function renderTableStatus(status) {
|
||||||
|
switch (status) {
|
||||||
|
case "running":
|
||||||
|
return (
|
||||||
|
<span className="statusTag running">
|
||||||
|
<i className="iconfont icon-yunhangzhong"></i>运行中
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
case "failure": case 'error':
|
||||||
|
return (
|
||||||
|
<span className="statusTag failed">
|
||||||
|
<i className="iconfont icon-weitongguo"></i>未通过
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
case "success":
|
||||||
|
return (
|
||||||
|
<span className="statusTag pass">
|
||||||
|
<i className="iconfont icon-yitongguo"></i>已通过
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
case 'killed':
|
||||||
|
return (
|
||||||
|
<span className="statusTag killed">
|
||||||
|
<i className="iconfont icon-weitongguo"></i>已撤销
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
default :
|
||||||
|
return (
|
||||||
|
<span className="statusTag Preparing">
|
||||||
|
<i className="iconfont icon-zhunbeizhong"></i>准备中
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
||||||
|
|
||||||
|
@ -32,7 +66,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
||||||
ellipsis:true,
|
ellipsis:true,
|
||||||
render:(value,item)=>{
|
render:(value,item)=>{
|
||||||
return(
|
return(
|
||||||
<Link to={`/projects/${owner}/${projectsId}/branch/${item.branch}/tree/${value}`} className="color-blue">{value}</Link>
|
<Link to={`/projects/${owner}/${projectsId}/tree/${item.branch}/${value}`} className="color-blue">{value}</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -61,10 +95,10 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
||||||
title:"最近构建状态",
|
title:"最近构建状态",
|
||||||
dataIndex:"pipeline_status",
|
dataIndex:"pipeline_status",
|
||||||
key:1,
|
key:1,
|
||||||
width:"10%",
|
width:"12%",
|
||||||
ellipsis:true,
|
ellipsis:true,
|
||||||
render:(txt)=>{
|
render:(txt)=>{
|
||||||
return(STATUS[txt])
|
return renderTableStatus(txt)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,15 +2,18 @@ import React from 'react';
|
||||||
import { AlignCenterBetween , Blueline , FlexAJ } from '../../Component/layout';
|
import { AlignCenterBetween , Blueline , FlexAJ } from '../../Component/layout';
|
||||||
|
|
||||||
|
|
||||||
function head({manager}){
|
function head({manager , parameter}){
|
||||||
return(
|
return(
|
||||||
<AlignCenterBetween>
|
<AlignCenterBetween>
|
||||||
<span className="font-20">工作流配置</span>
|
<span className="font-20">工作流配置</span>
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
<a href={`https://forum.trustie.net/forums/3111/detail`} target="_blank" className="color-grey-6"><i className="iconfont icon-tishi1 font-14 mr3"></i>模板使用说明</a>
|
{
|
||||||
|
parameter && <Blueline onClick={parameter}>参数管理</Blueline>
|
||||||
|
}
|
||||||
{
|
{
|
||||||
manager && <Blueline style={{marginLeft:"20px"}} onClick={manager}>模板管理</Blueline>
|
manager && <Blueline style={{marginLeft:"20px"}} onClick={manager}>模板管理</Blueline>
|
||||||
}
|
}
|
||||||
|
<a href={`https://forum.trustie.net/forums/3111/detail`} target="_blank" className="color-grey-6 ml20"><i className="iconfont icon-tishi1 font-14 mr3"></i>模板使用说明</a>
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
</AlignCenterBetween>
|
</AlignCenterBetween>
|
||||||
)
|
)
|
||||||
|
|
|
@ -26,6 +26,11 @@ const Mould = Loadable({
|
||||||
loader: () => import('./Mould'),
|
loader: () => import('./Mould'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
const Params = Loadable({
|
||||||
|
loader: () => import('./Manage/Params'),
|
||||||
|
loading: Loading,
|
||||||
|
})
|
||||||
|
|
||||||
export default ((props)=>{
|
export default ((props)=>{
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
@ -36,6 +41,11 @@ export default ((props)=>{
|
||||||
(p) => (<New {...props} {...p}/>)
|
(p) => (<New {...props} {...p}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
<Route path="/projects/:owner/:projectsId/devops/params"
|
||||||
|
render={
|
||||||
|
(p) => (<Params {...props} {...p}/>)
|
||||||
|
}
|
||||||
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/mould"
|
<Route path="/projects/:owner/:projectsId/devops/mould"
|
||||||
render={
|
render={
|
||||||
(p) => (<Mould {...props} {...p}/>)
|
(p) => (<Mould {...props} {...p}/>)
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import React , { useEffect , useState , useRef } from 'react';
|
import React , { useEffect , useState } from 'react';
|
||||||
import { Banner } from '../Component/layout';
|
import { Banner } from '../Component/layout';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import Dispost from './Dispose';
|
import Dispost from './Dispose';
|
||||||
import Structure from './Structure';
|
|
||||||
|
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
@ -11,22 +10,11 @@ const Div = styled.div`{
|
||||||
padding:24px 30px;
|
padding:24px 30px;
|
||||||
}`;
|
}`;
|
||||||
export default ((props)=>{
|
export default ((props)=>{
|
||||||
const [ menu , setMenu ] = useState(false);
|
|
||||||
const [ permission , setPermission ] = useState("");
|
const [ permission , setPermission ] = useState("");
|
||||||
const childRef = useRef();
|
|
||||||
|
|
||||||
const path = props.location.pathname;
|
|
||||||
const owner = props.match.params.owner;
|
const owner = props.match.params.owner;
|
||||||
const projectsId = props.match.params.projectsId;
|
|
||||||
|
|
||||||
const projectDetail = props.projectDetail;
|
const projectDetail = props.projectDetail;
|
||||||
useEffect(()=>{
|
|
||||||
if(path === `/projects/${owner}/${projectsId}/devops/list`){
|
|
||||||
setMenu(true);
|
|
||||||
}else{
|
|
||||||
setMenu(false);
|
|
||||||
}
|
|
||||||
},[path])
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(projectDetail){
|
if(projectDetail){
|
||||||
|
@ -34,22 +22,13 @@ export default ((props)=>{
|
||||||
}
|
}
|
||||||
},[projectDetail])
|
},[projectDetail])
|
||||||
|
|
||||||
const updateChildState = () => {
|
|
||||||
// changeVal就是子组件暴露给父组件的方法
|
|
||||||
if (childRef.current) {
|
|
||||||
childRef.current.changeVal();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="disposePanel">
|
<div className="disposePanel">
|
||||||
<Banner>
|
<Banner>
|
||||||
{ permission !=="Reporter" && <Link to={`/projects/${owner}/${props.match.params.projectsId}/devops/dispose`}>工作流配置</Link>}
|
{ permission !=="Reporter" && <Link to={`/projects/${owner}/${props.match.params.projectsId}/devops/dispose`}>工作流配置</Link>}
|
||||||
{/* <Link to={`/projects/${owner}/${props.match.params.projectsId}/devops/list`}className={menu===true && "color-blue"}>构建列表</Link> */}
|
|
||||||
{/* { menu===true && <a onClick={updateChildState} style={{float:"right",fontSize:"14px",color:"#FF6E21",marginTop:"5px"}}>刷新</a>} */}
|
|
||||||
</Banner>
|
</Banner>
|
||||||
<Div>
|
<Div>
|
||||||
{/* { menu === true && <Structure {...props} wrappedComponentRef={(form) => childRef.current = form} ref={childRef}/> } */}
|
|
||||||
<Dispost {...props}/>
|
<Dispost {...props}/>
|
||||||
</Div>
|
</Div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,119 @@
|
||||||
|
import React , { useEffect , useState , useRef } from 'react';
|
||||||
|
import { Banner , Blueback , FlexAJ , AlignCenter } from '../../Component/layout';
|
||||||
|
import { Input , Table , Popconfirm , Pagination } from 'antd';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import New from './ParamsNew';
|
||||||
|
import "./manage.scss";
|
||||||
|
import axios from 'axios';
|
||||||
|
import { result } from 'lodash';
|
||||||
|
|
||||||
|
const Div = styled.div`{
|
||||||
|
padding:24px 30px;
|
||||||
|
min-height:420px;
|
||||||
|
}`;
|
||||||
|
function Params(props){
|
||||||
|
const [ list ,setList ] = useState(undefined);
|
||||||
|
const [ editList ,setEditList ] = useState(undefined);
|
||||||
|
const [ visible ,setVisible ] = useState(false);
|
||||||
|
|
||||||
|
let projectsId = props.match.params.projectsId;
|
||||||
|
let owner = props.match.params.owner;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
Init()
|
||||||
|
},[])
|
||||||
|
|
||||||
|
function Init(){
|
||||||
|
const url = `/ci/secrets.json`;
|
||||||
|
axios.get(url,{
|
||||||
|
params:{
|
||||||
|
owner,repo:projectsId
|
||||||
|
}
|
||||||
|
}).then(result=>{
|
||||||
|
if(result){
|
||||||
|
setList(result.data);
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
const columns=[
|
||||||
|
{
|
||||||
|
title:"参数名",
|
||||||
|
dataIndex:"name",
|
||||||
|
key:1,
|
||||||
|
ellipsis:true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title:"操作",
|
||||||
|
dataIndex:"operation",
|
||||||
|
key:4,
|
||||||
|
render:(txt,item)=>{
|
||||||
|
return(
|
||||||
|
<React.Fragment>
|
||||||
|
<a className="mr10 color-grey-6" onClick={()=>editMouldFunc(item)}><i className="iconfont icon-zaibianji font-13 mr3"></i>编辑</a>
|
||||||
|
<Popconfirm title={"确定要删除此模板?"} onConfirm={()=>deleteMouldFunc(item.id,item.name)} okText="确定" cancelText={"取消"}>
|
||||||
|
<a className="mr10 color-grey-6"><i className="iconfont icon-lajitong font-13 mr3"></i>删除</a>
|
||||||
|
</Popconfirm>
|
||||||
|
</React.Fragment>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// 编辑
|
||||||
|
function editMouldFunc(item){
|
||||||
|
setEditList(item);
|
||||||
|
setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
function deleteMouldFunc(id,name){
|
||||||
|
if(id && name){
|
||||||
|
const url = `/ci/secrets/${id}.json`;
|
||||||
|
axios.delete(url,{
|
||||||
|
params:{owner,repo:projectsId,name}
|
||||||
|
}).then(result=>{
|
||||||
|
if(result){
|
||||||
|
Init();
|
||||||
|
props.showNotification(`参数删除成功!`);
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function successFunc(values,id){
|
||||||
|
const url = `/ci/secrets.json?owner=${owner}&repo=${projectsId}`;
|
||||||
|
axios.post(url,{
|
||||||
|
...values,id
|
||||||
|
}).then(result=>{
|
||||||
|
if(result){
|
||||||
|
props.showNotification(`${id ? '参数编辑':"新增参数"}成功!`);
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
function CancelFunc(){
|
||||||
|
setVisible(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div>
|
||||||
|
<New visble={visible} successFunc={successFunc} CancelFunc={CancelFunc} editList={editList}/>
|
||||||
|
<Banner>
|
||||||
|
<FlexAJ>
|
||||||
|
<span className="font-18">工作流 - 参数管理</span>
|
||||||
|
<Link to={`/projects/${owner}/${projectsId}/devops/dispose`} className="font-14 color-grey-9 ml20">返回</Link>
|
||||||
|
</FlexAJ>
|
||||||
|
</Banner>
|
||||||
|
<Div className="disposeList">
|
||||||
|
<div style={{textAlign:"right"}}>
|
||||||
|
<Blueback onClick={()=>setVisible(true)}>新建</Blueback>
|
||||||
|
</div>
|
||||||
|
<Table className="mt20" size="small" columns={columns} dataSource={list} rowKey={(row)=>row.id} pagination={false}></Table>
|
||||||
|
</Div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Params;
|
|
@ -0,0 +1,73 @@
|
||||||
|
import React , { useEffect , useState , useRef , forwardRef } from 'react';
|
||||||
|
import { Modal , Input , Form } from 'antd';
|
||||||
|
|
||||||
|
const { TextArea } = Input;
|
||||||
|
|
||||||
|
function ParamsNew({ form , visble,successFunc,CancelFunc ,editList }){
|
||||||
|
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 5 },
|
||||||
|
wrapperCol: { span: 18 },
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(editList && editList.id){
|
||||||
|
setFieldsValue({
|
||||||
|
name:editList.name,
|
||||||
|
data:editList.data
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
setFieldsValue({
|
||||||
|
name:undefined,
|
||||||
|
data:undefined
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},[editList])
|
||||||
|
|
||||||
|
// 确定
|
||||||
|
function onConfirmFunc(){
|
||||||
|
validateFields((error,values)=>{
|
||||||
|
if(!error){
|
||||||
|
successFunc(values,editList && editList.id);
|
||||||
|
onCancelFunc();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function onCancelFunc(){
|
||||||
|
setFieldsValue({
|
||||||
|
name:undefined,
|
||||||
|
data:undefined
|
||||||
|
})
|
||||||
|
CancelFunc();
|
||||||
|
}
|
||||||
|
return(
|
||||||
|
<Modal
|
||||||
|
visible={visble}
|
||||||
|
okText={"确定"}
|
||||||
|
cancelText={"取消"}
|
||||||
|
onCancel={onCancelFunc}
|
||||||
|
onOk={onConfirmFunc}
|
||||||
|
title={"新建"}
|
||||||
|
closable={false}
|
||||||
|
width="500px"
|
||||||
|
>
|
||||||
|
<Form {...layout}>
|
||||||
|
<Form.Item label="参数名称">
|
||||||
|
{getFieldDecorator("name",{
|
||||||
|
rules:[{required:true,message:"请输入参数名称"}]
|
||||||
|
})(
|
||||||
|
<Input placeholder="请输入参数名称" width="220px"/>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="参数值">
|
||||||
|
{getFieldDecorator("data",{
|
||||||
|
rules:[{required:true,message:"请输入参数值"}]
|
||||||
|
})(
|
||||||
|
<TextArea placeholder="请输入参数值" width="220px" autoSize={{ minRows: 4, maxRows: 4 }}/>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Form.create()(forwardRef(ParamsNew));
|
|
@ -0,0 +1,4 @@
|
||||||
|
.ant-form-explain{
|
||||||
|
position: absolute;
|
||||||
|
bottom: -15px;
|
||||||
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { Spin } from "antd";
|
import { Spin , Menu } from "antd";
|
||||||
import { FlexAJ, AlignCenter } from "../Component/layout";
|
import { FlexAJ, AlignCenter } from "../Component/layout";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import CodeSSH from './ssh/Index';
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
data,
|
data,
|
||||||
|
@ -17,6 +18,8 @@ export default ({
|
||||||
const [spining, setSpining] = useState(true);
|
const [spining, setSpining] = useState(true);
|
||||||
const [stage, setStage] = useState(undefined);
|
const [stage, setStage] = useState(undefined);
|
||||||
const [step, setStep] = useState(undefined);
|
const [step, setStep] = useState(undefined);
|
||||||
|
const [nav, setNav] = useState("0");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSpining(rightSpin);
|
setSpining(rightSpin);
|
||||||
}, [rightSpin]);
|
}, [rightSpin]);
|
||||||
|
@ -35,6 +38,7 @@ export default ({
|
||||||
: p[0];
|
: p[0];
|
||||||
|
|
||||||
setStep(sub);
|
setStep(sub);
|
||||||
|
setNav("0");
|
||||||
if (sub && sub.status !== "skipped") {
|
if (sub && sub.status !== "skipped") {
|
||||||
getStep(pre.number, sub.number);
|
getStep(pre.number, sub.number);
|
||||||
}
|
}
|
||||||
|
@ -65,43 +69,55 @@ export default ({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Spin spinning={spining}>
|
<React.Fragment>
|
||||||
<div className="rightMainContent">
|
{/* <Menu className="devopsNav" onClick={(e)=>{setNav(e.key)}} selectedKeys={[nav]} mode="horizontal">
|
||||||
{data && data.status !== "error" ? (
|
<Menu.Item key={'0'} value="0">开发流水线</Menu.Item>
|
||||||
<div>
|
<Menu.Item key={'1'} value="1">命令行</Menu.Item>
|
||||||
<FlexAJ className="items">
|
</Menu> */}
|
||||||
<span>{step && step.name}</span>
|
{
|
||||||
<AlignCenter>
|
nav === "0" &&
|
||||||
{step && step.duration_time}
|
<Spin spinning={spining}>
|
||||||
<i className="iconfont icon-sanjiaoxing-down"></i>
|
<div className="rightMainContent">
|
||||||
</AlignCenter>
|
{data && data.status !== "error" ? (
|
||||||
</FlexAJ>
|
<div>
|
||||||
<div>
|
<FlexAJ className="items">
|
||||||
{coders && coders.length > 0 ? (
|
<span>{step && step.name}</span>
|
||||||
coders.map((item, key) => {
|
<AlignCenter>
|
||||||
return (
|
{step && step.duration_time}
|
||||||
|
<i className="iconfont icon-sanjiaoxing-down"></i>
|
||||||
|
</AlignCenter>
|
||||||
|
</FlexAJ>
|
||||||
|
<div>
|
||||||
|
{coders && coders.length > 0 ? (
|
||||||
|
coders.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<div className="opsDetailOut">
|
||||||
|
<span>{key + 1}</span>
|
||||||
|
<p>{item.out}</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
) : empty ? (
|
||||||
<div className="opsDetailOut">
|
<div className="opsDetailOut">
|
||||||
<span>{key + 1}</span>
|
<span>1</span>
|
||||||
<p>{item.out}</p>
|
<p>
|
||||||
|
{stage && stage.name} – {step && step.name}: Skipped
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
) : (
|
||||||
})
|
""
|
||||||
) : empty ? (
|
)}
|
||||||
<div className="opsDetailOut">
|
|
||||||
<span>1</span>
|
|
||||||
<p>
|
|
||||||
{stage && stage.name} – {step && step.name}: Skipped
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
</div>
|
||||||
""
|
) : (
|
||||||
)}
|
<div style={{ color: "red" }}>error:{data && data.error}</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
</Spin>
|
||||||
<div style={{ color: "red" }}>error:{data && data.error}</div>
|
}
|
||||||
)}
|
{
|
||||||
</div>
|
nav === "1" && <CodeSSH />
|
||||||
</Spin>
|
}
|
||||||
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,6 +58,7 @@ function Structure(props,ref){
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
author:item.author && item.author.name,
|
author:item.author && item.author.name,
|
||||||
|
image_url:item.author && item.author.image_url,
|
||||||
message: {
|
message: {
|
||||||
branch: item.branch_target,
|
branch: item.branch_target,
|
||||||
message: item.message,
|
message: item.message,
|
||||||
|
@ -187,7 +188,7 @@ function Structure(props,ref){
|
||||||
<i className="iconfont icon-weitongguo"></i>已撤销
|
<i className="iconfont icon-weitongguo"></i>已撤销
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
case 'pending':
|
default:
|
||||||
return (
|
return (
|
||||||
<span className="statusTag Preparing">
|
<span className="statusTag Preparing">
|
||||||
<i className="iconfont icon-zhunbeizhong"></i>准备中
|
<i className="iconfont icon-zhunbeizhong"></i>准备中
|
||||||
|
@ -244,7 +245,7 @@ function Structure(props,ref){
|
||||||
{meg.sha && <span className="color-orange">{meg.sha}</span>}
|
{meg.sha && <span className="color-orange">{meg.sha}</span>}
|
||||||
</div>
|
</div>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<img style={{borderRadius:"50%",marginRight:"10px",width:"25px",height:"25px"}} src={`${current_user && getUrl(`/images/${current_user.image_url}`)}`} />
|
<img style={{borderRadius:"50%",marginRight:"10px",width:"25px",height:"25px"}} alt="" src={`${item.image_url && getUrl(`/images/${item.image_url}`)}`} />
|
||||||
<div className="task-hide ml5" style={{ maxWidth: "300px" }}>
|
<div className="task-hide ml5" style={{ maxWidth: "300px" }}>
|
||||||
{meg.message}
|
{meg.message}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
padding:60px 0px;
|
padding:60px 0px;
|
||||||
}
|
}
|
||||||
.disposePanel{
|
.disposePanel{
|
||||||
|
border:1px solid #eee;
|
||||||
.language{
|
.language{
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
@ -81,47 +82,6 @@
|
||||||
.ant-modal-close{
|
.ant-modal-close{
|
||||||
top:7px;
|
top:7px;
|
||||||
}
|
}
|
||||||
// 列表
|
|
||||||
.listPart{
|
|
||||||
.statusTag{
|
|
||||||
display: flex;
|
|
||||||
padding:0px 16px;
|
|
||||||
height: 32px;
|
|
||||||
line-height: 32px;
|
|
||||||
border-radius:20px;
|
|
||||||
float: left;
|
|
||||||
i{
|
|
||||||
font-size: 20px!important;
|
|
||||||
margin-right: 7px;
|
|
||||||
}
|
|
||||||
&.running{
|
|
||||||
background:#F1F8FF;
|
|
||||||
border:1px solid #5091FF;
|
|
||||||
color: #5091FF;
|
|
||||||
}
|
|
||||||
&.Preparing{
|
|
||||||
background:rgba(255,248,244,1);
|
|
||||||
border:1px solid rgba(255,110,33,1);
|
|
||||||
color:rgba(255,110,33,1) ;
|
|
||||||
}
|
|
||||||
&.pass{
|
|
||||||
background:#EEFDF5;
|
|
||||||
border:1px solid #28BD6C;
|
|
||||||
color:#28BD6C ;
|
|
||||||
}
|
|
||||||
&.failed{
|
|
||||||
background:#FCEEEE;
|
|
||||||
border:1px solid #F73030;
|
|
||||||
color:#F73030 ;
|
|
||||||
}
|
|
||||||
&.killed{
|
|
||||||
background:#eee;
|
|
||||||
border:1px solid #999;
|
|
||||||
color:#999 ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// ops详情
|
// ops详情
|
||||||
|
@ -234,6 +194,18 @@
|
||||||
&.rightSection{
|
&.rightSection{
|
||||||
width:100%;
|
width:100%;
|
||||||
background-color: #081930;
|
background-color: #081930;
|
||||||
|
.devopsNav{
|
||||||
|
background-color: #111c24;
|
||||||
|
border-bottom: none;
|
||||||
|
.ant-menu-item{
|
||||||
|
color: #ccc;
|
||||||
|
padding:0px;
|
||||||
|
margin:0px 20px!important;
|
||||||
|
}
|
||||||
|
.ant-menu-item.ant-menu-item-selected{
|
||||||
|
color: #1890ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
.rightMainContent{
|
.rightMainContent{
|
||||||
padding:24px 30px;
|
padding:24px 30px;
|
||||||
height:100vh;
|
height:100vh;
|
||||||
|
@ -510,3 +482,40 @@
|
||||||
.hide{
|
.hide{
|
||||||
display: none!important;
|
display: none!important;
|
||||||
}
|
}
|
||||||
|
.statusTag{
|
||||||
|
display: flex;
|
||||||
|
padding:0px 16px;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
border-radius:20px;
|
||||||
|
float: left;
|
||||||
|
i{
|
||||||
|
font-size: 20px!important;
|
||||||
|
margin-right: 7px;
|
||||||
|
}
|
||||||
|
&.running{
|
||||||
|
background:#F1F8FF;
|
||||||
|
border:1px solid #5091FF;
|
||||||
|
color: #5091FF;
|
||||||
|
}
|
||||||
|
&.Preparing{
|
||||||
|
background:rgba(255,248,244,1);
|
||||||
|
border:1px solid rgba(255,110,33,1);
|
||||||
|
color:rgba(255,110,33,1) ;
|
||||||
|
}
|
||||||
|
&.pass{
|
||||||
|
background:#EEFDF5;
|
||||||
|
border:1px solid #28BD6C;
|
||||||
|
color:#28BD6C ;
|
||||||
|
}
|
||||||
|
&.failed{
|
||||||
|
background:#FCEEEE;
|
||||||
|
border:1px solid #F73030;
|
||||||
|
color:#F73030 ;
|
||||||
|
}
|
||||||
|
&.killed{
|
||||||
|
background:#eee;
|
||||||
|
border:1px solid #999;
|
||||||
|
color:#999 ;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import XmlPanel from "./XmlPanel";
|
||||||
|
import mediator from "./mediator";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
// const defaulturl = `http://47.111.130.18:48088`;
|
||||||
|
const defaultValue = {
|
||||||
|
host: "106.75.231.63",
|
||||||
|
port: "2021",
|
||||||
|
ws_url: "wss://pre-webssh.educoder.net/ws",
|
||||||
|
username: "root",
|
||||||
|
secret: "Dron_123123",
|
||||||
|
};
|
||||||
|
function Index() {
|
||||||
|
const [sshConfigData, setSshConfigData] = useState(undefined);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!sshConfigData) {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
mediator.publish("create-socket", 1);
|
||||||
|
}, 300);
|
||||||
|
}, [sshConfigData]);
|
||||||
|
|
||||||
|
// 获取服务器连接信息
|
||||||
|
function init() {
|
||||||
|
const url = `/api/ci/pipelines/ssh_server.json`;
|
||||||
|
axios.get(url).then(result=>{
|
||||||
|
if(result && result.data){
|
||||||
|
setSshConfigData({...result.data})
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<XmlPanel
|
||||||
|
sshConfigData={sshConfigData||{}}
|
||||||
|
sid={1}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default Index;
|
|
@ -0,0 +1,219 @@
|
||||||
|
import React, { useRef, useEffect, useState } from 'react';
|
||||||
|
import { Base64 } from 'js-base64';
|
||||||
|
|
||||||
|
import { Terminal } from 'xterm';
|
||||||
|
import 'xterm/css/xterm.css';
|
||||||
|
import mediator from './mediator';
|
||||||
|
import ResizeObserver from 'resize-observer-polyfill';
|
||||||
|
|
||||||
|
function getColsAndRows(width, height, term) {
|
||||||
|
let w = term._core._renderService.dimensions.actualCellWidth || 9.5;
|
||||||
|
let h = term._core._renderService.dimensions.actualCellHeight || 18;
|
||||||
|
const rows = Math.floor(height / h);
|
||||||
|
const cols = Math.floor(width / w);
|
||||||
|
return [cols, rows];
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLayout(term, el) {
|
||||||
|
const ro = new ResizeObserver(entries => {
|
||||||
|
console.log(entries);
|
||||||
|
for (let entry of entries) {
|
||||||
|
if (entry.target.offsetHeight > 0 || entry.target.offsetWidth > 0) {
|
||||||
|
const [cols, rows] = getColsAndRows(
|
||||||
|
entry.target.offsetWidth,
|
||||||
|
entry.target.offsetHeight,
|
||||||
|
term,
|
||||||
|
);
|
||||||
|
console.log('cols, rows', cols, rows);
|
||||||
|
term.resize(cols, rows);
|
||||||
|
mediator.publish('ssh-xterm-resize', {
|
||||||
|
columns: cols,
|
||||||
|
rows: rows,
|
||||||
|
width: entry.target.offsetWidth,
|
||||||
|
height: entry.target.offsetHeight,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ro.observe(el);
|
||||||
|
return ro;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TimeTicket = 30000;
|
||||||
|
|
||||||
|
//建立 websockt 来交互
|
||||||
|
//根据容器大小计算行数和列数并做到自适应
|
||||||
|
//socket 与 term 需要分开初始化 因为socket 可能重置连接
|
||||||
|
//mediator 监听消息,如果和id匹配,则建立连接,重置,或关闭连接
|
||||||
|
|
||||||
|
export default ({ sshConfigData, sid }) => {
|
||||||
|
const [term, setTerm] = useState(null);
|
||||||
|
|
||||||
|
const { ws_url, password, port, secret } = sshConfigData;
|
||||||
|
const el = useRef();
|
||||||
|
const socket = useRef();
|
||||||
|
const isFirstConnected = useRef(false);
|
||||||
|
|
||||||
|
//term init
|
||||||
|
useEffect(() => {
|
||||||
|
if (el.current && ws_url) {
|
||||||
|
const term = new Terminal({ fontSize: 16, rendererType: 'dom' });
|
||||||
|
term.open(el.current);
|
||||||
|
|
||||||
|
term.onData(data => {
|
||||||
|
if (socket.current) {
|
||||||
|
if (socket.current.readyState === 1) {
|
||||||
|
socket.current.send(JSON.stringify({ tp: 'client', data: data }));
|
||||||
|
mediator.publish('on-operating-ssh'); //有操作则自动延时
|
||||||
|
} else {
|
||||||
|
//断开连接后重连
|
||||||
|
// socket.current = null
|
||||||
|
// mediator.publish('create-socket', sid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
term.write('Connecting...');
|
||||||
|
setTerm(term);
|
||||||
|
const ro = onLayout(term, el.current);
|
||||||
|
return () => {
|
||||||
|
term.dispose();
|
||||||
|
ro.unobserve(el.current);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, [ws_url, el.current]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (term && ws_url) {
|
||||||
|
function createSocket() {
|
||||||
|
const socketInstance = new WebSocket(ws_url);
|
||||||
|
socket.current = socketInstance;
|
||||||
|
|
||||||
|
socketInstance.onopen = () => {
|
||||||
|
let container = term.element.parentElement;
|
||||||
|
if (container) {
|
||||||
|
let width = container.offsetWidth;
|
||||||
|
let height = container.offsetHeight;
|
||||||
|
console.log('init', {
|
||||||
|
tp: 'init',
|
||||||
|
data: {
|
||||||
|
...sshConfigData,
|
||||||
|
secret: secret,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
rows: term.rows,
|
||||||
|
columns: term.cols,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
socketInstance.send(
|
||||||
|
JSON.stringify({
|
||||||
|
tp: 'init',
|
||||||
|
data: {
|
||||||
|
...sshConfigData,
|
||||||
|
secret: secret,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
rows: term.rows,
|
||||||
|
columns: term.cols,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
term.focus();
|
||||||
|
};
|
||||||
|
socketInstance.onerror = error => {
|
||||||
|
console.log(
|
||||||
|
'------in socket error----',
|
||||||
|
error,
|
||||||
|
socketInstance,
|
||||||
|
ws_url,
|
||||||
|
);
|
||||||
|
//连接报错后,重新请求资源
|
||||||
|
// mediator.publish('on-recreate-socket')
|
||||||
|
};
|
||||||
|
socketInstance.onmessage = event => {
|
||||||
|
if (!isFirstConnected.current) {
|
||||||
|
term.write('\r');
|
||||||
|
// term.focus()
|
||||||
|
setTimeout(() => {
|
||||||
|
// term.clear();
|
||||||
|
}, 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);
|
||||||
|
};
|
||||||
|
|
||||||
|
socketInstance.onclose = evt => {
|
||||||
|
if (tid) {
|
||||||
|
clearInterval(tid);
|
||||||
|
}
|
||||||
|
term.write('\r\nconnection closed');
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const tid = setInterval(() => {
|
||||||
|
if (socket.current) {
|
||||||
|
socket.current.send(JSON.stringify({ tp: 'h' }));
|
||||||
|
}
|
||||||
|
}, TimeTicket);
|
||||||
|
|
||||||
|
const unSubCreate = mediator.subscribe('create-socket', id => {
|
||||||
|
if (sid === id) {
|
||||||
|
if (socket.current && socket.current.readyState === 1) {
|
||||||
|
term.focus();
|
||||||
|
} else {
|
||||||
|
createSocket();
|
||||||
|
}
|
||||||
|
term.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const unSubClose = mediator.subscribe('close-socket', id => {
|
||||||
|
if (sid === id) {
|
||||||
|
if (socket.current) {
|
||||||
|
socket.current.close();
|
||||||
|
isFirstConnected.current = false;
|
||||||
|
term.clear();
|
||||||
|
}
|
||||||
|
socket.current = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const unSubResize = mediator.subscribe('ssh-xterm-resize', option => {
|
||||||
|
if (socket.current && socket.current.readyState === 1) {
|
||||||
|
socket.current.send(
|
||||||
|
JSON.stringify({ tp: 'resize', data: { ...option } }),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const unSubAddTime = mediator.subscribe('ssh-add-connect-time', () => {
|
||||||
|
if (socket.current && socket.current.readyState === 1) {
|
||||||
|
socket.current.send(JSON.stringify({ tp: 'overtime' }));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
unSubClose();
|
||||||
|
unSubCreate();
|
||||||
|
unSubResize();
|
||||||
|
unSubAddTime();
|
||||||
|
if (socket.current) {
|
||||||
|
socket.current.close();
|
||||||
|
isFirstConnected.current = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, [term, ws_url, port]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div ref={el} className="xterm-panel" style={{height:"100%"}}>
|
||||||
|
{!ws_url ? <p style={{ color: '#fff' }}>正在连接命令行服务...</p> : null}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
|
@ -0,0 +1,46 @@
|
||||||
|
function Mediator(obj) {
|
||||||
|
const channels = {};
|
||||||
|
|
||||||
|
const mediator = {
|
||||||
|
subscribe: function(channel, cb) {
|
||||||
|
if (!channels[channel]) {
|
||||||
|
channels[channel] = [];
|
||||||
|
}
|
||||||
|
channels[channel].push(cb);
|
||||||
|
return this.unsubscribe.bind(null, channel, cb);
|
||||||
|
},
|
||||||
|
|
||||||
|
unsubscribe: function(channel, cb) {
|
||||||
|
let rs = channels[channel];
|
||||||
|
let index = -1;
|
||||||
|
if (rs) {
|
||||||
|
for (let i = 0; i < rs.length; i++) {
|
||||||
|
if (rs[i].name === cb.name) {
|
||||||
|
index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index >= 0) {
|
||||||
|
channels[channel].splice(index, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
publish: function(channel) {
|
||||||
|
if (!channels[channel]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const args = Array.prototype.slice.call(arguments, 1);
|
||||||
|
channels[channel].forEach(subscription => {
|
||||||
|
subscription.apply(null, args);
|
||||||
|
});
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return obj ? Object.assign(obj, mediator) : mediator;
|
||||||
|
}
|
||||||
|
const mediator = new Mediator();
|
||||||
|
export default mediator;
|
|
@ -11,3 +11,11 @@ export const getTag = async (id,owner)=>{
|
||||||
export const getHooks = async (id,params)=>{
|
export const getHooks = async (id,params)=>{
|
||||||
return (await axios.get(`/projects/${id}/hooks.json`,{params})).data;
|
return (await axios.get(`/projects/${id}/hooks.json`,{params})).data;
|
||||||
}
|
}
|
||||||
|
// 获取子目录列表
|
||||||
|
export const getSubEntries = async (owner,projectsId,params)=>{
|
||||||
|
return (await axios.get(`/${owner}/${projectsId}/sub_entries.json`,{params})).data;
|
||||||
|
}
|
||||||
|
// 获取用户信息
|
||||||
|
export const getUser = async (login)=>{
|
||||||
|
return (await axios.get(`/users/${login}/hovercard.json`)).data;
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
import React, { useEffect , useState } from 'react';
|
||||||
|
import './header.scss';
|
||||||
|
|
||||||
|
function Footer(){
|
||||||
|
const [ value , setValue ] = useState(undefined);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
try {
|
||||||
|
var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting'));
|
||||||
|
setValue(chromesettingArray.footer);
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
|
function showhtml(htmlString){
|
||||||
|
var html = {__html:htmlString};
|
||||||
|
return <div dangerouslySetInnerHTML={html}></div> ;
|
||||||
|
}
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div>
|
||||||
|
<div style={{height:"483px"}}></div>
|
||||||
|
<div className="newFooter edu-txt-center">
|
||||||
|
{value && showhtml(value)}
|
||||||
|
{/* <div className="footerInfos">
|
||||||
|
<ul>
|
||||||
|
<li>社区</li>
|
||||||
|
<li><a href={`/`} target="_blank">网站首页</a></li>
|
||||||
|
<li><a href={`https://www.trustie.net/agreement`} target="_blank">服务协议</a></li>
|
||||||
|
<li><a href={`https://forum.trustie.net/forums/1168/detail`} target="_blank">帮助中心</a></li>
|
||||||
|
<li><a href={`https://forum.trustie.net/`} target="_blank">问吧交流</a></li>
|
||||||
|
<li><a href={`https://www.trustie.net/cooperation`} target="_blank">合作伙伴</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li>支持与服务</li>
|
||||||
|
<li><a href={`https://forgeplus.trustie.net/docs/api`} target="_blank">API文档</a></li>
|
||||||
|
<li><a href={`https://forum.trustie.net/forums/1168/detail`} target="_blank">帮助中心</a></li>
|
||||||
|
<li><a href={`https://git-scm.com`} target="_blank">Git常用命令</a></li>
|
||||||
|
<li><a href={`https://forum.trustie.net/forums/3080/detail`} target="_blank">DevOps使用文档</a></li>
|
||||||
|
<li><a href={`https://forgeplus.trustie.net/projects/jasder/forgeplus/tree/master/CHANGELOG.md`} target="_blank">日志更新</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li>合作伙伴</li>
|
||||||
|
<li><a href={`http://www.sei.pku.edu.cn`} target="_blank">北京大学</a></li>
|
||||||
|
<li><a href={`http://scse.buaa.edu.cn`} target="_blank">北京航空航天大学</a></li>
|
||||||
|
<li><a href={`https://www.nju.edu.cn`} target="_blank">南京大学</a></li>
|
||||||
|
<li><a href={`https://www.xtu.edu.cn`} target="_blank">湘潭大学</a></li>
|
||||||
|
<li><a href={`http://www.iscas.ac.cn`} target="_blank">ISCAS</a></li>
|
||||||
|
<li><a href={`https://www.ucloud.cn`} target="_blank">UCloud优刻得</a></li>
|
||||||
|
<li><a href={`http://www.inforbus.com`} target="_blank">中创软件</a></li>
|
||||||
|
<li><a href={`https://www.inspur.com`} target="_blank">浪潮集团</a></li>
|
||||||
|
<li><a href={`http://www.copu.org.cn`} target="_blank">中国开源软件推进联盟</a></li>
|
||||||
|
<li><a href={`https://www.sjtu.edu.cn`} target="_blank">上海交通大学</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li>合作伙伴</li>
|
||||||
|
<li><span>热线:</span></li>
|
||||||
|
<li><span>QQ群:1071514693</span></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<p className="footerCopy">© Copyright 2007~2021 国防科技大学Trustie团队 & IntelliDE <a href="https://beian.miit.gov.cn">湘ICP备 17009477号</a></p> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Footer;
|
|
@ -0,0 +1,730 @@
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import AccountProfile from "../../modules/user/AccountProfile";
|
||||||
|
import { getImageUrl } from 'educoder'
|
||||||
|
import axios from 'axios';
|
||||||
|
import { Modal, Input, message, notification , Dropdown , Menu ,Divider } from 'antd';
|
||||||
|
|
||||||
|
import LoginDialog from '../../modules/login/LoginDialog';
|
||||||
|
import GotoQQgroup from '../../modal/GotoQQgroup'
|
||||||
|
// import 'antd/lib/modal/style/index.css';
|
||||||
|
// import 'antd/lib/checkbox/style/index.css';
|
||||||
|
// import 'antd/lib/radio/style/index.css';
|
||||||
|
// import 'antd/lib/input/style/index.css';
|
||||||
|
import '../../modules/tpm/TPMIndex.css';
|
||||||
|
import logo from '../../modules/tpm/images/logo.png';
|
||||||
|
import './header.scss';
|
||||||
|
const $ = window.$
|
||||||
|
// TODO 这部分脚本从公共脚本中直接调用
|
||||||
|
const { Search } = Input;
|
||||||
|
let old_url;
|
||||||
|
|
||||||
|
window._header_componentHandler = null;
|
||||||
|
// 非trustie链接则新开页跳转
|
||||||
|
const str = ['www.trustie.net','forgeplus.trustie.net','forum.trustie.net','testforgeplus.trustie.net']
|
||||||
|
class NewHeader extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
this.state = {
|
||||||
|
Addcoursestypes: false,
|
||||||
|
tojoinitemtype: false,
|
||||||
|
tojoinclasstitle: undefined,
|
||||||
|
rolearr: ["", ""],
|
||||||
|
Checkboxteacherchecked: false,
|
||||||
|
Checkboxstudentchecked: false,
|
||||||
|
Checkboxteachingchecked: false,
|
||||||
|
Checkboxteachertype: false,
|
||||||
|
Checkboxteachingtype: false,
|
||||||
|
code_notice: false,
|
||||||
|
checked_notice: false,
|
||||||
|
RadioGroupvalue: undefined,
|
||||||
|
submitapplications: false,
|
||||||
|
isRender: false,
|
||||||
|
showSearchOpentype: false,
|
||||||
|
showTrial: false,
|
||||||
|
setevaluatinghides: false,
|
||||||
|
occupation: 0,
|
||||||
|
mydisplay: false,
|
||||||
|
headtypesonClickbool: false,
|
||||||
|
headtypess: "/",
|
||||||
|
settings: null,
|
||||||
|
goshowqqgtounp: false,
|
||||||
|
visiblemyss: false,
|
||||||
|
openSearch:false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
componentDidMount() {
|
||||||
|
// this.getAppdata();
|
||||||
|
this.geturlsdata();
|
||||||
|
window._header_componentHandler = this;
|
||||||
|
|
||||||
|
//下拉框的显示隐藏
|
||||||
|
var hoverTimeout;
|
||||||
|
var hoveredPanel;
|
||||||
|
$(".edu-menu-panel").hover(function () {
|
||||||
|
if (hoverTimeout) { // 一次只显示一个panel
|
||||||
|
if (hoveredPanel && hoveredPanel !== this) {
|
||||||
|
$(hoveredPanel).find(".edu-menu-list").hide()
|
||||||
|
}
|
||||||
|
clearTimeout(hoverTimeout);
|
||||||
|
hoverTimeout = null;
|
||||||
|
}
|
||||||
|
hoveredPanel = this;
|
||||||
|
$(this).find(".edu-menu-list").show();
|
||||||
|
}, function () {
|
||||||
|
var that = this;
|
||||||
|
// 延迟hide
|
||||||
|
hoverTimeout = setTimeout(function () {
|
||||||
|
$(that).find(".edu-menu-list").hide();
|
||||||
|
}, 800)
|
||||||
|
|
||||||
|
});
|
||||||
|
//获取游览器地址
|
||||||
|
try {
|
||||||
|
window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href))
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchInput = (open,item)=>{
|
||||||
|
if(open){
|
||||||
|
return(
|
||||||
|
<div
|
||||||
|
onBlur={() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.setState({
|
||||||
|
openSearch:false
|
||||||
|
})
|
||||||
|
}, 300)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Search placeholder="实践课程/教学课堂/实践项目/交流问答"
|
||||||
|
className={`search-input mr20`}
|
||||||
|
onSearch={(value)=>this.onGlobalSearch(value,item)}
|
||||||
|
autoFocus={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}else{
|
||||||
|
return <i className="iconfont icon-sousuo font-18 color-grey-6 ml30" onClick={() => {
|
||||||
|
this.setState({openSearch:true})
|
||||||
|
}} />
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onGlobalSearch=(value,item)=>{
|
||||||
|
window.location.href=`${item}?value=` + value;
|
||||||
|
}
|
||||||
|
|
||||||
|
openNotification = (messge) => {
|
||||||
|
notification.open({
|
||||||
|
message: "提示",
|
||||||
|
description:
|
||||||
|
messge,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
componentWillReceiveProps(newProps, oldProps) {
|
||||||
|
this.setState({
|
||||||
|
user: newProps.user
|
||||||
|
})
|
||||||
|
if (newProps.Headertop !== undefined) {
|
||||||
|
old_url = newProps.Headertop.old_url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getCookie = (key) => {
|
||||||
|
var arr, reg = RegExp('(^| )' + key + '=([^;]+)(;|$)');
|
||||||
|
if (arr === document.cookie.match(reg))
|
||||||
|
return decodeURIComponent(arr[2]);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
delCookie = (name) => {
|
||||||
|
var exp = new Date();
|
||||||
|
exp.setTime(exp.getTime() - 1);
|
||||||
|
var cval = this.getCookie(name);
|
||||||
|
if (cval != null) {
|
||||||
|
document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onLogout = () => {
|
||||||
|
const url = `/accounts/logout.json`
|
||||||
|
this.delCookie("autologin_trustie")
|
||||||
|
axios.get(url, {
|
||||||
|
}).then((response) => {
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
this.setState({
|
||||||
|
user: undefined
|
||||||
|
})
|
||||||
|
window.location.href = "/login"
|
||||||
|
message.success('退出成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
tojoinclass = () => {
|
||||||
|
let { user } = this.state;
|
||||||
|
if (user === undefined) {
|
||||||
|
this.setState({
|
||||||
|
isRender: true
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (user && user.login === "") {
|
||||||
|
this.setState({
|
||||||
|
isRender: true
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (user && user.profile_completed === false) {
|
||||||
|
this.setState({
|
||||||
|
AccountProfiletype: true
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
Addcoursestypes: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
tojoinitem = () => {
|
||||||
|
if (this.props.user && this.props.user.email === undefined || this.props.user && this.props.user.email === null || this.props.user && this.props.user.email === "") {
|
||||||
|
this.openNotification("请先绑定邮箱,谢谢");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let { user } = this.state;
|
||||||
|
if (user === undefined) {
|
||||||
|
this.setState({
|
||||||
|
isRender: true
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (user && user.login === "") {
|
||||||
|
this.setState({
|
||||||
|
isRender: true
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user && user.profile_completed === false) {
|
||||||
|
this.setState({
|
||||||
|
AccountProfiletype: true
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
tojoinitemtype: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
submitstatevalue = (sum, value, data) => {
|
||||||
|
this.setState({
|
||||||
|
Addcoursestypes: false,
|
||||||
|
tojoinitemtype: false,
|
||||||
|
tojoinclasstitle: undefined,
|
||||||
|
rolearr: ["", ""],
|
||||||
|
Checkboxteacherchecked: false,
|
||||||
|
Checkboxstudentchecked: false,
|
||||||
|
Checkboxteachingchecked: false,
|
||||||
|
Checkboxteachertype: false,
|
||||||
|
Checkboxteachingtype: false,
|
||||||
|
code_notice: false,
|
||||||
|
checked_notice: false,
|
||||||
|
submitapplicationssum: sum,
|
||||||
|
submitapplications: true,
|
||||||
|
submitapplicationsvalue: value,
|
||||||
|
submitapplicationsvaluedata: data,
|
||||||
|
RadioGroupvalue: undefined
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onChangeRadioGroup = (e) => {
|
||||||
|
this.setState({
|
||||||
|
RadioGroupvalue: e.target.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
submitsubmitapplications = () => {
|
||||||
|
let {
|
||||||
|
submitapplicationssum,
|
||||||
|
submitapplicationsvaluedata
|
||||||
|
} = this.state;
|
||||||
|
this.setState({
|
||||||
|
submitapplications: false,
|
||||||
|
RadioGroupvalue: undefined
|
||||||
|
})
|
||||||
|
if (submitapplicationssum === 0) {
|
||||||
|
if (submitapplicationsvaluedata !== undefined) {
|
||||||
|
window.location.href = "/courses/" + submitapplicationsvaluedata;
|
||||||
|
}
|
||||||
|
} else if (submitapplicationssum === 1) {
|
||||||
|
if (submitapplicationsvaluedata !== undefined) {
|
||||||
|
window.location.href = "/projects/" + submitapplicationsvaluedata;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hidesubmitapplications = () => {
|
||||||
|
this.setState({
|
||||||
|
Addcoursestypes: false,
|
||||||
|
tojoinitemtype: false,
|
||||||
|
tojoinclasstitle: undefined,
|
||||||
|
rolearr: ["", ""],
|
||||||
|
Checkboxteacherchecked: false,
|
||||||
|
Checkboxstudentchecked: false,
|
||||||
|
Checkboxteachingchecked: false,
|
||||||
|
Checkboxteachertype: false,
|
||||||
|
Checkboxteachingtype: false,
|
||||||
|
code_notice: false,
|
||||||
|
checked_notice: false,
|
||||||
|
submitapplications: false,
|
||||||
|
RadioGroupvalue: undefined
|
||||||
|
})
|
||||||
|
}
|
||||||
|
educoderlogin = () => {
|
||||||
|
//登录账号
|
||||||
|
this.setState({
|
||||||
|
isRender: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
educoderloginysl = () => {
|
||||||
|
//退出账号
|
||||||
|
var url = `/accounts/logout.json`;
|
||||||
|
axios.get((url)).then((result) => {
|
||||||
|
if (result !== undefined) {
|
||||||
|
window.location.href = "/";
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
hideAddcoursestypes = () => {
|
||||||
|
this.setState({
|
||||||
|
Addcoursestypes: false
|
||||||
|
})
|
||||||
|
};
|
||||||
|
HideAddcoursestypess = (i) => {
|
||||||
|
console.log("调用了");
|
||||||
|
this.setState({
|
||||||
|
Addcoursestypes: false,
|
||||||
|
mydisplay: true,
|
||||||
|
occupation: i,
|
||||||
|
})
|
||||||
|
};
|
||||||
|
ModalCancelsy = () => {
|
||||||
|
this.setState({
|
||||||
|
mydisplay: false,
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
hidetojoinclass = () => {
|
||||||
|
this.setState({
|
||||||
|
tojoinclasstype: false,
|
||||||
|
tojoinitemtype: false,
|
||||||
|
tojoinclasstitle: undefined,
|
||||||
|
rolearr: ["", ""],
|
||||||
|
Checkboxteacherchecked: false,
|
||||||
|
Checkboxstudentchecked: false,
|
||||||
|
Checkboxteachingchecked: false,
|
||||||
|
Checkboxteachertype: false,
|
||||||
|
Checkboxteachingtype: false,
|
||||||
|
code_notice: false,
|
||||||
|
checked_notice: false,
|
||||||
|
RadioGroupvalue: undefined
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭
|
||||||
|
cancelModulationModels = () => {
|
||||||
|
this.setState({ isRenders: false })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setevaluatinghides = () => {
|
||||||
|
this.setState({
|
||||||
|
setevaluatinghides: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//修改登录方法
|
||||||
|
Modifyloginvalue = () => {
|
||||||
|
this.setState({
|
||||||
|
isRender: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
hideAccountProfile = () => {
|
||||||
|
this.setState({
|
||||||
|
AccountProfiletype: false
|
||||||
|
})
|
||||||
|
};
|
||||||
|
headtypesonClick = (url, bool) => {
|
||||||
|
this.setState({
|
||||||
|
headtypess: url,
|
||||||
|
headtypesonClickbool: bool,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取数据为空的时候
|
||||||
|
gettablogourlnull = () => {
|
||||||
|
this.setState({
|
||||||
|
settings: undefined
|
||||||
|
});
|
||||||
|
var link = document.createElement('link'),
|
||||||
|
oldLink = document.getElementById('dynamic-favicon');
|
||||||
|
link.id = 'dynamic-favicon';
|
||||||
|
link.rel = 'shortcut icon';
|
||||||
|
link.href = "/react/build/./favicon.ico";
|
||||||
|
if (oldLink) {
|
||||||
|
document.head.removeChild(oldLink);
|
||||||
|
}
|
||||||
|
document.head.appendChild(link);
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取数据的时候
|
||||||
|
gettablogourldata = (response) => {
|
||||||
|
document.title = response.data.setting.name;
|
||||||
|
var link = document.createElement('link'),
|
||||||
|
oldLink = document.getElementById('dynamic-favicon');
|
||||||
|
link.id = 'dynamic-favicon';
|
||||||
|
link.rel = 'shortcut icon';
|
||||||
|
link.href = '/' + response.data.setting.tab_logo_url;
|
||||||
|
if (oldLink) {
|
||||||
|
document.head.removeChild(oldLink);
|
||||||
|
}
|
||||||
|
document.head.appendChild(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleVisibleChanges = (boll) => {
|
||||||
|
this.setState({
|
||||||
|
visiblemyss: boll,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getAppdata = () => {
|
||||||
|
try {
|
||||||
|
var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting'));
|
||||||
|
var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse'));
|
||||||
|
this.setState({
|
||||||
|
settings: chromesettingArray
|
||||||
|
});
|
||||||
|
if (chromesettingArray.tab_logo_url) {
|
||||||
|
this.gettablogourldata(chromesettingresponseArray);
|
||||||
|
} else {
|
||||||
|
this.gettablogourlnull();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.geturlsdata();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
geturlsdata = () => {
|
||||||
|
let url = "/setting.json";
|
||||||
|
axios.get(url).then((response) => {
|
||||||
|
if (response && response.data) {
|
||||||
|
this.setState({ settings: response.data.setting });
|
||||||
|
// localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
|
||||||
|
// localStorage.setItem('chromesettingresponse', JSON.stringify(response));
|
||||||
|
try {
|
||||||
|
if (response.data.setting.tab_logo_url) {
|
||||||
|
this.gettablogourldata(response);
|
||||||
|
} else {
|
||||||
|
this.gettablogourlnull();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.gettablogourlnull();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.gettablogourlnull();
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
this.gettablogourlnull();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
matchpaths = (url) => {
|
||||||
|
const { match } = this.props;
|
||||||
|
if(url){
|
||||||
|
if (match.path.indexOf(url) > -1) {
|
||||||
|
return true
|
||||||
|
}else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 处理弹框
|
||||||
|
setgoshowqqgtounp = (bool) => {
|
||||||
|
this.setState({
|
||||||
|
goshowqqgtounp: bool
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
addMenu=(list)=>{
|
||||||
|
return(
|
||||||
|
list && list.length >0 &&
|
||||||
|
<div className="dropdownFlex">
|
||||||
|
<Menu>
|
||||||
|
{
|
||||||
|
list.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
(item.name !=="加入课堂" && item.name !=="加入开发项目") && <Menu.Item><a href={item.url}>{item.name}</a></Menu.Item>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</Menu>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { match} = this.props;
|
||||||
|
let current_user = this.props.user;
|
||||||
|
let { Addcoursestypes,
|
||||||
|
tojoinitemtype,
|
||||||
|
tojoinclasstitle,
|
||||||
|
code_notice,
|
||||||
|
checked_notice,
|
||||||
|
AccountProfiletype,
|
||||||
|
submitapplications,
|
||||||
|
submitapplicationsvalue,
|
||||||
|
user,
|
||||||
|
isRender,
|
||||||
|
showSearchOpentype,
|
||||||
|
headtypesonClickbool,
|
||||||
|
headtypess,
|
||||||
|
settings,
|
||||||
|
goshowqqgtounp,
|
||||||
|
openSearch,
|
||||||
|
} = this.state;
|
||||||
|
/*用户名称 用户头像url*/
|
||||||
|
let activeIndex = false;
|
||||||
|
let activeForums = false;
|
||||||
|
let activeShixuns = false;
|
||||||
|
let activePaths = false;
|
||||||
|
let coursestype = false;
|
||||||
|
let activePackages = false;
|
||||||
|
let activeMoopCases = false;
|
||||||
|
let activeCompetitions = false;
|
||||||
|
|
||||||
|
if (match.path === '/forums') {
|
||||||
|
activeForums = true;
|
||||||
|
} else if (match.path.startsWith('/shixuns')) {
|
||||||
|
activeShixuns = true;
|
||||||
|
} else if (match.path.startsWith('/paths')) {
|
||||||
|
activePaths = true;
|
||||||
|
} else if (match.path.startsWith('/courses')) {
|
||||||
|
coursestype = true;
|
||||||
|
} else if (match.path.startsWith('/crowdsourcing')) {
|
||||||
|
activePackages = true;
|
||||||
|
} else if (match.path.startsWith('/moop_cases')) {
|
||||||
|
activeMoopCases = true;
|
||||||
|
} else if (match.path.startsWith('/competitions')) {
|
||||||
|
activeCompetitions = true;
|
||||||
|
} else {
|
||||||
|
activeIndex = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let headtypes = '/';
|
||||||
|
if (settings) {
|
||||||
|
if (settings.navbar) {
|
||||||
|
if (settings.navbar.length > 0) {
|
||||||
|
if (match.path === '/') {
|
||||||
|
if (headtypesonClickbool === false) {
|
||||||
|
headtypes = undefined;
|
||||||
|
} else {
|
||||||
|
headtypes = headtypess;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (var i = 0; i < settings.navbar.length; i++) {
|
||||||
|
if (match.path === settings.navbar[i].link) {
|
||||||
|
headtypes = settings.navbar[i].link;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let shixuntype = false;
|
||||||
|
let pathstype = false;
|
||||||
|
let coursestypes = false;
|
||||||
|
if (this.props && this.props.mygetHelmetapi != null) {
|
||||||
|
let shixun = "/shixuns";
|
||||||
|
let paths = "/paths";
|
||||||
|
let courses = "/courses";
|
||||||
|
this.props.mygetHelmetapi.navbar.map((item, key) => {
|
||||||
|
var reg = RegExp(item.link);
|
||||||
|
if (shixun.match(reg)) {
|
||||||
|
if (item.hidden === true) {
|
||||||
|
shixuntype = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (paths.match(reg)) {
|
||||||
|
if (item.hidden === true) {
|
||||||
|
pathstype = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (courses.match(reg)) {
|
||||||
|
if (item.hidden === true) {
|
||||||
|
coursestypes = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let search_url = settings && settings.common && settings.common.search;
|
||||||
|
let notice_url = settings && settings.common && settings.common.notice;
|
||||||
|
return (
|
||||||
|
<div className="newHeaders" id="nHeader">
|
||||||
|
<div className="headerContent">
|
||||||
|
{isRender === true ?
|
||||||
|
<LoginDialog
|
||||||
|
{...this.props}
|
||||||
|
{...this.state}
|
||||||
|
Modifyloginvalue={() => this.Modifyloginvalue()}
|
||||||
|
/> : ""}
|
||||||
|
|
||||||
|
{AccountProfiletype === true ?
|
||||||
|
<AccountProfile
|
||||||
|
hideAccountProfile={() => this.hideAccountProfile()}
|
||||||
|
{...this.props}
|
||||||
|
{...this.state}
|
||||||
|
/> : ""}
|
||||||
|
{
|
||||||
|
goshowqqgtounp === true ?
|
||||||
|
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool) => this.setgoshowqqgtounp(bool)}></GotoQQgroup>
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
<a href={settings && settings.new_course.default_url} className={"fl mr30"} style={{minWidth:"45px"}}>
|
||||||
|
{
|
||||||
|
settings && settings.nav_logo_url ?
|
||||||
|
<img alt="可控开源社区" className="logoimg" style={{ heigth: "40px" }} src={getImageUrl(`/${settings.nav_logo_url}`)}></img>
|
||||||
|
:
|
||||||
|
<img alt="可控开源社区" className="logoimg" style={{ heigth: "40px" }} src={logo}></img>
|
||||||
|
}
|
||||||
|
</a>
|
||||||
|
<div className="head-nav pr" id={"head-navpre1"}>
|
||||||
|
{
|
||||||
|
settings && settings.navbar && settings.navbar.length > 0 ?
|
||||||
|
<ul id="header-nav">
|
||||||
|
{
|
||||||
|
settings.navbar && settings.navbar.map((item, key) => {
|
||||||
|
var new_link = item.link;
|
||||||
|
var user_login = this.props.user && this.props.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")
|
||||||
|
} else if (new_link.indexOf("contests") > -1) {
|
||||||
|
new_link = new_link.replace(/contests/g, "users/" + 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")
|
||||||
|
}
|
||||||
|
|
||||||
|
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
|
||||||
|
var wl = waiLian && waiLian.length>0;
|
||||||
|
return (
|
||||||
|
<li key={key} onClick={() => this.headtypesonClick(item.link, true)} className={`${this.matchpaths(item.link) === true ? 'pr active' : 'pr'}`} style={!is_hidden ? { display: 'flex' } : { display: 'none' }}>
|
||||||
|
<a href={new_link} target={wl ? "_self":"_blank"}>{item.name}</a>
|
||||||
|
</li>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div className="head-right">
|
||||||
|
{search_url ? this.SearchInput(openSearch,search_url):""}
|
||||||
|
{
|
||||||
|
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>
|
||||||
|
</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>:""
|
||||||
|
}
|
||||||
|
<Modal
|
||||||
|
keyboard={false}
|
||||||
|
title="提示"
|
||||||
|
visible={submitapplications}
|
||||||
|
closable={false}
|
||||||
|
footer={null}
|
||||||
|
>
|
||||||
|
<div className="task_popup_con ml30">
|
||||||
|
<div className="mr15">
|
||||||
|
<ul>
|
||||||
|
<div className="task-popup-content">
|
||||||
|
<p className="task-popup-text-center font-16">
|
||||||
|
{submitapplicationsvalue}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<li className="clearfix mt10 edu-txt-center">
|
||||||
|
<a className="task-btn mr10"
|
||||||
|
onClick={this.hidesubmitapplications}>取消</a>
|
||||||
|
<a
|
||||||
|
className="task-btn task-btn-orange ml20"
|
||||||
|
onClick={this.submitsubmitapplications}>确定</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
</div>
|
||||||
|
{!user || (user && !user.login) ?
|
||||||
|
<span className="font-15 ml30">
|
||||||
|
<a onClick={() => this.educoderlogin()} className="mr5 color-grey-6">登录</a>
|
||||||
|
{
|
||||||
|
settings && settings.common && settings.common.register &&
|
||||||
|
<span><em className="vertical-line"></em><a className="ml5 color-grey-6" href={`${settings.common.register}`} target="_blank">注册</a></span>
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
:
|
||||||
|
<div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}>
|
||||||
|
<a href={`/users/${this.props.current_user === undefined ? "" : this.props.current_user.login}/courses`}>
|
||||||
|
<img alt="头像" className="radius" height="34" id="nh_user_logo" name="avatar_image" src={getImageUrl(`/${user.image_url}`)} width="34">
|
||||||
|
</img>
|
||||||
|
</a>
|
||||||
|
<ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
|
||||||
|
<li className="bor-bottom-greyE" style={{cursor:"default",background:"#fff"}}>{this.props.current_user.username}</li>
|
||||||
|
{
|
||||||
|
settings && settings.personal && settings.personal.length > 0 && settings.personal.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
<li key={key}><a href={item.url} target="_blank">{item.name}</a></li>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
<li className="bor-top-greyE">
|
||||||
|
<a onClick={() => this.educoderloginysl()}>退出</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NewHeader;
|
|
@ -0,0 +1,62 @@
|
||||||
|
|
||||||
|
.dropdownFlex{
|
||||||
|
display:flex;
|
||||||
|
padding:5px;
|
||||||
|
background:#fff;
|
||||||
|
border-radius: 3px;
|
||||||
|
.ant-menu-vertical > .ant-menu-item{
|
||||||
|
border:none
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.newFooter {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
background: #323232;
|
||||||
|
clear: both;
|
||||||
|
min-width: 1200px;
|
||||||
|
z-index: 8;
|
||||||
|
left: 0px;
|
||||||
|
p {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom:0px !important;
|
||||||
|
}
|
||||||
|
.footerInfos{
|
||||||
|
display: flex;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin:0px auto;
|
||||||
|
justify-content: space-around;
|
||||||
|
padding:60px 0px;
|
||||||
|
& >ul{
|
||||||
|
padding:0px 40px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
max-width: 25%;
|
||||||
|
text-align: left;
|
||||||
|
li{
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 300;
|
||||||
|
&:first-child{
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
&>a,&>span{
|
||||||
|
color: #bbb;
|
||||||
|
}
|
||||||
|
&>a:hover{
|
||||||
|
color: #4cacff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.footerCopy{
|
||||||
|
color: #bbb;
|
||||||
|
border-top: 1px solid #4e4e4e;
|
||||||
|
padding:10px 0px;
|
||||||
|
a{
|
||||||
|
color: #bbb;
|
||||||
|
&:hover{
|
||||||
|
color: #4cacff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,6 @@ import { withRouter } from "react-router";
|
||||||
import { SnackbarHOC } from "educoder";
|
import { SnackbarHOC } from "educoder";
|
||||||
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
|
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
|
||||||
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
|
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
|
||||||
import Handbook from './Component/Handbook';
|
|
||||||
import "./css/index.scss";
|
import "./css/index.scss";
|
||||||
|
|
||||||
import Loadable from "react-loadable";
|
import Loadable from "react-loadable";
|
||||||
|
@ -35,7 +34,6 @@ class Index extends Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="newMain clearfix">
|
<div className="newMain clearfix">
|
||||||
<Handbook />
|
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:projectsType/new/:OIdentifier"
|
path="/projects/:projectsType/new/:OIdentifier"
|
||||||
|
@ -49,6 +47,12 @@ class Index extends Component {
|
||||||
<ProjectNew {...this.props} {...props} />
|
<ProjectNew {...this.props} {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
|
<Route
|
||||||
|
path="/projects/new"
|
||||||
|
render={(props) => (
|
||||||
|
<ProjectNew {...this.props} {...props} />
|
||||||
|
)}
|
||||||
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId"
|
path="/projects/:owner/:projectsId"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
|
|
|
@ -0,0 +1,449 @@
|
||||||
|
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 { getImageUrl } from "educoder";
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import CloneAddress from '../Branch/CloneAddress';
|
||||||
|
|
||||||
|
import SelectBranch from '../Branch/Select';
|
||||||
|
import User from '../Component/User';
|
||||||
|
import axios from 'axios';
|
||||||
|
import Path from './CoderDepotPath';
|
||||||
|
import Catalogue from './CoderDepotCatalogue';
|
||||||
|
import ReadMe from './CoderDepotReadme';
|
||||||
|
import CoderRootFileDetail from './CoderRootFileDetail';
|
||||||
|
import './Index.scss';
|
||||||
|
import Releases from '../Component/Releases';
|
||||||
|
import Contributors from '../Component/Contributors';
|
||||||
|
import LanguagePower from '../Component/LanguagePower';
|
||||||
|
import DrawerPanel from '../Component/DrawerPanel';
|
||||||
|
import UpdateDescModal from './sub/UpdateDescModal';
|
||||||
|
import Nodata from '../Nodata';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* projectDetail.type:0是托管项目,1是镜像项目,2是同步镜像项目(为2时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能)
|
||||||
|
*/
|
||||||
|
function CoderDepot(props){
|
||||||
|
const [ projectDetail , setProjectDetail ]= useState(undefined);
|
||||||
|
const [ treeValue , setTreeValue ] = useState(undefined);
|
||||||
|
const [ treeValuePath , setTreeValuePath ] = useState(undefined);
|
||||||
|
const [ lastCommit,setLastCommit ] = useState(undefined);
|
||||||
|
const [ lastCommitAuthor,setLastCommitAuthor ] = useState(undefined);
|
||||||
|
const [ type ,setType ] = useState('dir');
|
||||||
|
const [ hide , setHide ] = useState(true);
|
||||||
|
const [ hideBtn , setHideBtn ] = useState(false);
|
||||||
|
const [ commitCount ,setCommitCount ] = useState(0);
|
||||||
|
const [ dirInfo ,setDirInfo ] = useState(undefined);//文件夹目录列表
|
||||||
|
const [ fileInfo ,setFileInfo ] = useState(undefined);//文件内容信息
|
||||||
|
const [ zip_url , setZip_url ] = useState(undefined);
|
||||||
|
const [ tar_url , setTar_url ] = useState(undefined);
|
||||||
|
const [ readOnly , setReadOnly] = useState(true);
|
||||||
|
const [ isSpin , setIsSpin] = useState(true);
|
||||||
|
const [ visible ,setVisible ] = useState(false);
|
||||||
|
const [ mainFlag ,setMainFlag ] = useState(false);
|
||||||
|
const [ openModal , setOpenModal ] = useState(false);
|
||||||
|
const [ desc , setDesc ] = useState(undefined);
|
||||||
|
const [ website , setWebsite ] = useState(undefined);
|
||||||
|
const [ lesson_url , setLessonUrl ] = useState(undefined);
|
||||||
|
|
||||||
|
const owner = props.match.params.owner;
|
||||||
|
const projectsId = props.match.params.projectsId;
|
||||||
|
const branchName = props.match.params.branchName;
|
||||||
|
let pathname = props.history.location.pathname;
|
||||||
|
useEffect(()=>{
|
||||||
|
if(props.projectDetail){
|
||||||
|
setProjectDetail(props.projectDetail);
|
||||||
|
setDesc(props.projectDetail.description);
|
||||||
|
setWebsite(props.projectDetail.website);
|
||||||
|
setLessonUrl(props.projectDetail.lesson_url);
|
||||||
|
}
|
||||||
|
},[props])
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(treeValue){
|
||||||
|
setTreeValuePath(treeValue.split('/'));
|
||||||
|
}else{
|
||||||
|
setTreeValuePath(undefined);
|
||||||
|
}
|
||||||
|
},[treeValue])
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if (pathname && projectDetail){
|
||||||
|
if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1) {
|
||||||
|
let url = pathname.split(`/tree/${branchName}/`)[1];
|
||||||
|
setTreeValue(url);
|
||||||
|
getFileInfo(url,branchName);
|
||||||
|
}else{
|
||||||
|
setTreeValue(undefined);
|
||||||
|
getDirInfo(branchName ||projectDetail.default_branch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},[pathname,projectDetail])
|
||||||
|
|
||||||
|
// 获取主目录列表
|
||||||
|
function getDirInfo(branch){
|
||||||
|
setIsSpin(true);
|
||||||
|
const url = `/${owner}/${projectsId}/entries.json`;
|
||||||
|
axios.get(url, {
|
||||||
|
params: { ref: branch }
|
||||||
|
}).then((result) => {
|
||||||
|
if (result) {
|
||||||
|
setCommitCount(result.data.commits_count);
|
||||||
|
setDirInfo(result.data.entries);
|
||||||
|
setFileInfo(undefined);
|
||||||
|
setTar_url(result.data.tar_url);
|
||||||
|
setZip_url(result.data.zip_url);
|
||||||
|
let c = result.data.last_commit
|
||||||
|
setLastCommit(c && c.commit);
|
||||||
|
setLastCommitAuthor(c && c.committer);
|
||||||
|
setMainFlag(true);
|
||||||
|
setReadOnly(true);
|
||||||
|
}
|
||||||
|
setTimeout(function(){setIsSpin(false);},500);
|
||||||
|
}).catch(error=>{setIsSpin(false);})
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(projectDetail && lastCommit)
|
||||||
|
{
|
||||||
|
let ele = document.getElementById("ptxt");
|
||||||
|
if(ele){
|
||||||
|
let h = ele.offsetHeight;
|
||||||
|
if( h > 18 ) setHideBtn(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},[projectDetail,lastCommit])
|
||||||
|
// 获取子目录列表
|
||||||
|
function getFileInfo(path, ref){
|
||||||
|
setIsSpin(true);
|
||||||
|
const url = `/${owner}/${projectsId}/sub_entries.json`;
|
||||||
|
axios.get(url, {
|
||||||
|
params:{
|
||||||
|
filepath:path,
|
||||||
|
ref:ref || branchName,
|
||||||
|
type
|
||||||
|
}
|
||||||
|
}).then((result) => {
|
||||||
|
if (result) {
|
||||||
|
let en = result.data.entries;
|
||||||
|
if(en.type){
|
||||||
|
setDirInfo(undefined);
|
||||||
|
setFileInfo(en);
|
||||||
|
setType(en.type);
|
||||||
|
}else{
|
||||||
|
setFileInfo(undefined);
|
||||||
|
setDirInfo(en);
|
||||||
|
setType("dir");
|
||||||
|
}
|
||||||
|
let c = result.data.last_commit
|
||||||
|
setLastCommit(c && c.commit);
|
||||||
|
setLastCommitAuthor(c && c.committer);
|
||||||
|
setMainFlag(false);
|
||||||
|
setReadOnly(true);
|
||||||
|
}
|
||||||
|
setTimeout(function(){setIsSpin(false);},500)
|
||||||
|
}).catch(error=>{setIsSpin(false);})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 切换分支或者标签
|
||||||
|
function changeBranch(value){
|
||||||
|
let url = `/projects/${owner}/${projectsId}${value && `/tree/${value}`}${treeValue ? `/${treeValue}`:""}`;
|
||||||
|
props.history.push(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文件相关的下拉项
|
||||||
|
const fileMenu =(
|
||||||
|
<Menu>
|
||||||
|
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件</a></Menu.Item>
|
||||||
|
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件</a></Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
)
|
||||||
|
|
||||||
|
function getPathUrl(array,index){
|
||||||
|
if(array && array.length>0 && index){
|
||||||
|
let str = "";
|
||||||
|
for(let i=0;i<index;i++){
|
||||||
|
str += `/${array[i]}`;
|
||||||
|
}
|
||||||
|
return str.substr(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 页面地址返回到主目录
|
||||||
|
function returnMain(){
|
||||||
|
setTreeValue(undefined);
|
||||||
|
let branch = branchName || (projectDetail && projectDetail.default_branch);
|
||||||
|
props.history.push(`/projects/${owner}/${projectsId}/tree/${branch}`);
|
||||||
|
};
|
||||||
|
// 子目录路径返回链接
|
||||||
|
function returnUlr(url){
|
||||||
|
props.history.push(`/projects/${owner}/${projectsId}/tree${branchName?`/${branchName}`:""}/${url}`);
|
||||||
|
}
|
||||||
|
// 点击跳转到子目录
|
||||||
|
function goToSubRoot(path,type,filename){
|
||||||
|
setType(type);
|
||||||
|
props.history.push(`/projects/${owner}/${projectsId}${`/tree/${branchName || (projectDetail && projectDetail.default_branch)}`}${path?`/${path}`:""}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onEdit(readOnly){
|
||||||
|
setReadOnly(readOnly);
|
||||||
|
}
|
||||||
|
function ChangeFile(path, readOnly){
|
||||||
|
//点击直接跳转页面 加载一次路由
|
||||||
|
props.history.push(`/projects/${owner}/${projectsId}/tree/${branchName || (projectDetail && projectDetail.default_branch)}/${path}`);
|
||||||
|
setType("file");
|
||||||
|
setReadOnly(readOnly);
|
||||||
|
};
|
||||||
|
|
||||||
|
function changeHide(hide){
|
||||||
|
setHide(!hide);
|
||||||
|
}
|
||||||
|
|
||||||
|
function urlLink(link){
|
||||||
|
if(props.checkIfLogin()===false){
|
||||||
|
props.showLoginDialog()
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
props.history.push(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloadMenu = (
|
||||||
|
<div className="downMenu">
|
||||||
|
<div style={{padding:"20px",borderBottom:"1px solid #eee"}}>
|
||||||
|
<CloneAddress
|
||||||
|
http_url={projectDetail && projectDetail.clone_url}
|
||||||
|
showNotification={props.showNotification}/>
|
||||||
|
</div>
|
||||||
|
<Menu className="edu-txt-center">
|
||||||
|
<Menu.Item><a href={zip_url}>下载 ZIP</a></Menu.Item>
|
||||||
|
<Menu.Item><a href={tar_url}>下载 TAR.GZ</a></Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
// 确认修改简介、website、实践课程链接
|
||||||
|
function okUpdate(d,w,l){
|
||||||
|
const url = `/${owner}/${projectsId}.json`;
|
||||||
|
axios.put(url,{
|
||||||
|
description:d,website:w,lesson_url:l
|
||||||
|
}).then(result=>{
|
||||||
|
if(result && result.data && result.data.id){
|
||||||
|
setDesc(result.data.description);
|
||||||
|
setWebsite(result.data.website);
|
||||||
|
setLessonUrl(result.data.lesson_url);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let n = fileInfo && fileInfo.name;
|
||||||
|
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
|
||||||
|
|
||||||
|
return(
|
||||||
|
<WhiteBack>
|
||||||
|
<UpdateDescModal desc={desc} website={website} lesson_url={lesson_url} visible={openModal} onCancel={()=>setOpenModal(false)} onOk={okUpdate}/>
|
||||||
|
<Spin spinning={isSpin}>
|
||||||
|
{
|
||||||
|
(dirInfo || fileInfo) &&
|
||||||
|
<React.Fragment>
|
||||||
|
<DrawerPanel
|
||||||
|
history={props.history}
|
||||||
|
owner={owner}
|
||||||
|
projectsId={projectsId}
|
||||||
|
name={projectDetail && projectDetail.name}
|
||||||
|
branch={branchName || (projectDetail && projectDetail.default_branch)}
|
||||||
|
visible={visible}
|
||||||
|
onClose={()=>setVisible(false)}
|
||||||
|
list = {mainFlag ? dirInfo : undefined}
|
||||||
|
/>
|
||||||
|
<div className="drawerBtn" onClick={()=>setVisible(true)}>
|
||||||
|
<i className="iconfont icon-youjiantou font-16"></i>
|
||||||
|
<span>目录</span>
|
||||||
|
</div>
|
||||||
|
</React.Fragment>
|
||||||
|
}
|
||||||
|
<div style={{minHeight:"500px"}}>
|
||||||
|
{
|
||||||
|
projectDetail &&
|
||||||
|
<Box className="Panels">
|
||||||
|
<LongWidth>
|
||||||
|
<div className="panelmenu">
|
||||||
|
<FlexAJ>
|
||||||
|
<AlignCenter>
|
||||||
|
<div className="mr20">
|
||||||
|
{
|
||||||
|
props && props.platform ?
|
||||||
|
<SelectBranch
|
||||||
|
repo_id={projectDetail && projectDetail.repo_id}
|
||||||
|
projectsId={projectsId}
|
||||||
|
branch={branchName || (projectDetail && projectDetail.default_branch)}
|
||||||
|
changeBranch={changeBranch}
|
||||||
|
owner={owner}
|
||||||
|
history={props.history}
|
||||||
|
branchList={projectDetail && projectDetail.branches && projectDetail.branches.list}
|
||||||
|
></SelectBranch>
|
||||||
|
:
|
||||||
|
<span>分支:<span className="color-grey-6">{branchName || (projectDetail && projectDetail.default_branch)}</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>
|
||||||
|
</AlignCenter>
|
||||||
|
<AlignCenter>
|
||||||
|
<div className="mr20 addOptionBtn">
|
||||||
|
{
|
||||||
|
projectDetail.type !== 2 &&
|
||||||
|
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||||
|
}
|
||||||
|
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||||
|
</div>
|
||||||
|
{ type === "dir" && projectDetail.type !== 2 &&
|
||||||
|
<Dropdown overlay={fileMenu} className="mr20">
|
||||||
|
<Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button>
|
||||||
|
</Dropdown>
|
||||||
|
}
|
||||||
|
|
||||||
|
<Dropdown overlay={downloadMenu} placement="bottomRight">
|
||||||
|
<Button type={'primary'}>下载 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-white"></i></Button>
|
||||||
|
</Dropdown>
|
||||||
|
</AlignCenter>
|
||||||
|
</FlexAJ>
|
||||||
|
{
|
||||||
|
dirInfo || 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 hide" :"ellipsistxt"}><p id="ptxt">{lastCommit && lastCommit.message}</p></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`} className="ml12 color-grey-9"><i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交</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)=>{
|
||||||
|
return(
|
||||||
|
<Catalogue
|
||||||
|
owner={owner}
|
||||||
|
item={item}
|
||||||
|
projectsId={projectsId}
|
||||||
|
goToSubRoot={goToSubRoot}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
{
|
||||||
|
fileInfo &&
|
||||||
|
<CoderRootFileDetail
|
||||||
|
{...props}
|
||||||
|
detail={fileInfo}
|
||||||
|
readOnly={readOnly}
|
||||||
|
md={mdFlag}
|
||||||
|
onEdit={onEdit}
|
||||||
|
currentBranch={branchName || (projectDetail && projectDetail.default_branch)}
|
||||||
|
type={projectDetail.type}
|
||||||
|
></CoderRootFileDetail>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
{
|
||||||
|
(dirInfo && dirInfo.length === 0) && (fileInfo && fileInfo.length === 0) ? <Nodata _html="暂未发现文件"/> :""
|
||||||
|
}
|
||||||
|
{/* readme文件显示(显示文件详情时不显示readme文件) */}
|
||||||
|
{ dirInfo && (projectDetail && projectDetail.readme) ? <ReadMe ChangeFile={ChangeFile} readme={projectDetail && projectDetail.readme} operate={props && (props.isManager || props.isDeveloper) && projectDetail.type !==2 } history={props.history} /> :"" }
|
||||||
|
</div>
|
||||||
|
</LongWidth>
|
||||||
|
{
|
||||||
|
!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>
|
||||||
|
{desc && <p className="font-14 color-grey-9 mb15 task-hide-2" style={{lineHeight:"22px",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} target="_blank" style={{wordBreak:"break-all",lineHeight:"20px",marginTop:"5px",textDecoration:"underline"}}>{website}</a>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
<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-9"></i>
|
||||||
|
<span>{projectDetail && projectDetail.size}</span>
|
||||||
|
</p>
|
||||||
|
{
|
||||||
|
projectDetail && projectDetail.license_name &&
|
||||||
|
<p className="color-grey-6">
|
||||||
|
<i className="iconfont icon-tianping font-16 mr10 color-grey-9"></i>
|
||||||
|
<span>{projectDetail.license_name}</span>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
lesson_url &&
|
||||||
|
<div>
|
||||||
|
<Divider />
|
||||||
|
<p className="font-16 color-grey-6">实践课程</p>
|
||||||
|
<a href={lesson_url} target="_blank" className="color-grey-6" style={{textDecoration:"underline"}}>{lesson_url}</a>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
{/* 发布 */}
|
||||||
|
{
|
||||||
|
projectDetail && projectDetail.release_versions &&
|
||||||
|
<React.Fragment>
|
||||||
|
<Divider />
|
||||||
|
<Releases owner={owner} projectsId={projectsId} releaseVersions={projectDetail.release_versions} history={props.history}/>
|
||||||
|
</React.Fragment>
|
||||||
|
}
|
||||||
|
{/* 贡献者 */}
|
||||||
|
{
|
||||||
|
projectDetail && projectDetail.contributors &&
|
||||||
|
<Contributors contributors={projectDetail && projectDetail.contributors} owner={owner} projectsId={projectsId} />
|
||||||
|
}
|
||||||
|
{/* 语言 */}
|
||||||
|
{ projectDetail && projectDetail.languages &&
|
||||||
|
<React.Fragment>
|
||||||
|
<Divider />
|
||||||
|
<LanguagePower languages={projectDetail.languages}/>
|
||||||
|
</React.Fragment>
|
||||||
|
}
|
||||||
|
</Gap>
|
||||||
|
</ShortWidth>
|
||||||
|
}
|
||||||
|
</Box>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</Spin>
|
||||||
|
</WhiteBack>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default CoderDepot;
|
|
@ -0,0 +1,22 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import { truncateCommitId } from '../common/util';
|
||||||
|
|
||||||
|
function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){
|
||||||
|
return(
|
||||||
|
<li>
|
||||||
|
<span>
|
||||||
|
<a onClick={()=>goToSubRoot(item.path,item.type,item.name)}>
|
||||||
|
<i className={item.type === 'dir' ? "iconfont icon-wenjianjia1 color-green-file font-15 mr5":"iconfont icon-wenjia color-green-file font-15 mr5"}></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}>
|
||||||
|
{item.commit && item.commit.message}
|
||||||
|
</Link>
|
||||||
|
</span>
|
||||||
|
<span>{item.commit && item.commit.time_from_now}</span>
|
||||||
|
</li>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default CoderDepotCatalogue;
|
|
@ -0,0 +1,30 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
|
||||||
|
function CoderDepotPath({treeValuePath , returnUlr , returnMain , getPathUrl , identifier}){
|
||||||
|
return(
|
||||||
|
<li className="listtablepath">
|
||||||
|
<p>
|
||||||
|
<a
|
||||||
|
onClick={returnMain}
|
||||||
|
className="color-blue"
|
||||||
|
>
|
||||||
|
{identifier}
|
||||||
|
</a>
|
||||||
|
{treeValuePath.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
{
|
||||||
|
key === treeValuePath.length-1 ?
|
||||||
|
<span className="color-grey-6 subFileName" key={key}>{item}</span>
|
||||||
|
:
|
||||||
|
<a onClick={()=>returnUlr(`${getPathUrl(treeValuePath,key+1)}`)} className="color-blue subFileName">{item}</a>
|
||||||
|
}
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default CoderDepotPath;
|
|
@ -0,0 +1,62 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import RenderHtml from '../../components/render-html';
|
||||||
|
import { Dropdown , Menu , Spin } from 'antd';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
const $ = window.$;
|
||||||
|
|
||||||
|
function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
||||||
|
const [ menuList ,setMenuList ] = useState(undefined);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(readme && readme.content){
|
||||||
|
let path = history.location.pathname;
|
||||||
|
const items = $.map($("#readme").find("h1,h2,h3,h4,h5,h6"), function (el, _) {
|
||||||
|
const anchor = el.id;
|
||||||
|
const level = el.tagName.replace("H", "");
|
||||||
|
const href = `#${anchor}`;
|
||||||
|
return { href:`${path}${href}`,text:el.textContent , level:level }
|
||||||
|
});
|
||||||
|
setMenuList(items);
|
||||||
|
}
|
||||||
|
},[readme])
|
||||||
|
|
||||||
|
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>
|
||||||
|
)
|
||||||
|
}else{
|
||||||
|
return <Spin />
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(
|
||||||
|
<div className="commonBox" id="readme">
|
||||||
|
<div className="commonBox-title">
|
||||||
|
<Dropdown overlay={menu()}>
|
||||||
|
<i className="iconfont icon-zhangjie1 font-16 color-grey-3 mr10"></i>
|
||||||
|
</Dropdown>
|
||||||
|
<span className="commonBox-title-read">README.md</span>
|
||||||
|
{
|
||||||
|
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-info">
|
||||||
|
<RenderHtml className="break_word_comments imageLayerParent" value={readme && readme.content} url={history.location}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default CoderDepotReadme;
|
|
@ -32,7 +32,7 @@ export default ((props)=>{
|
||||||
return(
|
return(
|
||||||
<li key={key}>
|
<li key={key}>
|
||||||
<div>
|
<div>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/branch/${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
|
<Link to={`/projects/${owner}/${projectsId}/tree/${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
|
||||||
<p className="f-wrap-alignCenter mt15">
|
<p className="f-wrap-alignCenter mt15">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.last_commit.sha}`)}`} className="mr5 commitKey" style={{marginLeft:0}}>{item.last_commit && truncateCommitId(item.last_commit.sha)}</Link>
|
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.last_commit.sha}`)}`} className="mr5 commitKey" style={{marginLeft:0}}>{item.last_commit && truncateCommitId(item.last_commit.sha)}</Link>
|
||||||
<span className="color-grey-3 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
|
<span className="color-grey-3 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
|
||||||
|
|
|
@ -74,6 +74,7 @@ class CoderRootCommit extends Component{
|
||||||
array.push({
|
array.push({
|
||||||
name:item.author && item.author.name,
|
name:item.author && item.author.name,
|
||||||
login: item.author && item.author.login,
|
login: item.author && item.author.login,
|
||||||
|
id: item.author && item.author.id,
|
||||||
image_url:item.author && item.author.image_url,
|
image_url:item.author && item.author.image_url,
|
||||||
sha:item.sha,
|
sha:item.sha,
|
||||||
time_from_now:item.time_from_now,
|
time_from_now:item.time_from_now,
|
||||||
|
@ -107,7 +108,7 @@ class CoderRootCommit extends Component{
|
||||||
let branch = branchName || defaultBranch;
|
let branch = branchName || defaultBranch;
|
||||||
return(
|
return(
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className={commit_class}>
|
<div className={"main"}>
|
||||||
<div className="f-wrap-between">
|
<div className="f-wrap-between">
|
||||||
<SelectBranch
|
<SelectBranch
|
||||||
repo_id={projectDetail && projectDetail.repo_id}
|
repo_id={projectDetail && projectDetail.repo_id}
|
||||||
|
@ -136,16 +137,24 @@ class CoderRootCommit extends Component{
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="flex1 ml20 font-16 color-grey-3">{item.message}</Link>
|
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="flex1 ml20 font-16 color-grey-3">{item.message}</Link>
|
||||||
</p>
|
</p>
|
||||||
<p className="f-wrap-alignCenter mt15">
|
<p className="f-wrap-alignCenter mt15">
|
||||||
<Link to={`/users/${item.login}`} className="show-user-link">
|
{
|
||||||
{item.image_url?<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
item.id ?
|
||||||
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
|
<Link to={`/users/${item.login}`} className="show-user-link">
|
||||||
</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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
{commitDatas && commitDatas.length > 0 && <Nodata _html="暂无数据"/>}
|
{commitDatas && commitDatas.length === 0 && <Nodata _html="暂无数据"/>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,517 +0,0 @@
|
||||||
import React, { Component } from "react";
|
|
||||||
import { Menu, Spin } from "antd";
|
|
||||||
import { getImageUrl } from "educoder";
|
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
|
|
||||||
import './list.css';
|
|
||||||
import SelectBranch from '../Branch/Select';
|
|
||||||
import CloneAddress from '../Branch/CloneAddress';
|
|
||||||
import RootTable from './RootTable';
|
|
||||||
import CoderRootFileDetail from './CoderRootFileDetail';
|
|
||||||
import { truncateCommitId } from '../common/util';
|
|
||||||
import RenderHtml from '../../components/render-html';
|
|
||||||
import Nodata from '../Nodata';
|
|
||||||
import { getBranch } from '../GetData/getData';
|
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
/**
|
|
||||||
* address:http和SSH,http_url(对应git地址)
|
|
||||||
* filePath:点击目录时当前目录的路径
|
|
||||||
* subfileType:保存当前点击目录的文件类型(显示目录列表时才显示新建文件,如果点击的是文件就不显示新建文件按钮)
|
|
||||||
* readMeContent:根目录下面的readme文件内容
|
|
||||||
*/
|
|
||||||
function getPathUrl(array,index){
|
|
||||||
if(array && array.length>0 && index){
|
|
||||||
let str = "";
|
|
||||||
for(let i=0;i<index;i++){
|
|
||||||
str += `/${array[i]}`;
|
|
||||||
}
|
|
||||||
return str.substr(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
class CoderRootDirectory extends Component {
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
address: "http",
|
|
||||||
filePath: undefined,
|
|
||||||
subFileType: undefined,
|
|
||||||
readMeContent: undefined,
|
|
||||||
readMeFile: undefined,
|
|
||||||
|
|
||||||
isSpin: true,
|
|
||||||
|
|
||||||
branchList: undefined,
|
|
||||||
fileDetail: undefined,
|
|
||||||
branchLastCommit: undefined,
|
|
||||||
lastCommitAuthor: undefined,
|
|
||||||
|
|
||||||
rootList: undefined,
|
|
||||||
readOnly: true,
|
|
||||||
zip_url:undefined,
|
|
||||||
tar_url:undefined,
|
|
||||||
chooseType:undefined,
|
|
||||||
|
|
||||||
md:false,
|
|
||||||
treeValue:undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
changeAddress = (address) => {
|
|
||||||
this.setState({
|
|
||||||
address,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
componentDidMount = () => {
|
|
||||||
this.Init();
|
|
||||||
this.getBranchs();
|
|
||||||
};
|
|
||||||
// 获取分支列表
|
|
||||||
getBranchs=()=>{
|
|
||||||
const { projectsId , owner } = this.props.match.params;
|
|
||||||
axios.get(`/${owner}/${projectsId}/branches.json`).then(result=>{
|
|
||||||
this.setState({
|
|
||||||
branchList:result.data
|
|
||||||
})
|
|
||||||
}).catch((error)=>{})
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate = (prevState) => {
|
|
||||||
const { location } = this.props;
|
|
||||||
const prevlocation = prevState && prevState.location;
|
|
||||||
if (location !== prevlocation) {
|
|
||||||
this.setState({
|
|
||||||
isSpin: true,
|
|
||||||
});
|
|
||||||
this.Init();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Init = () => {
|
|
||||||
let { pathname } = this.props.history.location;
|
|
||||||
const { branchName , owner , projectsId } = this.props.match.params;
|
|
||||||
const { defaultBranch } = this.props;
|
|
||||||
let branch = branchName || defaultBranch;
|
|
||||||
if (pathname && (pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1)) {
|
|
||||||
let url = pathname.split(`/tree/${branchName}/`)[1];
|
|
||||||
this.setState({treeValue:url})
|
|
||||||
this.getFileDetail(decodeURI(url),branch);
|
|
||||||
} else {
|
|
||||||
this.getProjectRoot(branch);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 页面地址返回到主目录
|
|
||||||
returnMain = (branch) => {
|
|
||||||
const { projectsId , owner , branchName } = this.props.match.params;
|
|
||||||
this.setState({
|
|
||||||
readOnly:true,
|
|
||||||
treeValue:undefined
|
|
||||||
})
|
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/tree/${branchName}`:""}`);
|
|
||||||
this.getProjectRoot(branch);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取根目录
|
|
||||||
getProjectRoot = (branch) => {
|
|
||||||
const { projectsId , owner } = this.props.match.params;
|
|
||||||
const url = `/${owner}/${projectsId}/entries.json`;
|
|
||||||
axios.get(url, { params: { ref: branch } })
|
|
||||||
.then((result) => {
|
|
||||||
if (result) {
|
|
||||||
let last_commit = result.data && result.data.last_commit;
|
|
||||||
let entries = result.data && result.data.entries;
|
|
||||||
this.setState({
|
|
||||||
filePath: undefined,
|
|
||||||
fileDetail: [],
|
|
||||||
isSpin: false,
|
|
||||||
branchLastCommit: last_commit && last_commit.commit,
|
|
||||||
lastCommitAuthor:
|
|
||||||
last_commit && (last_commit.author || (last_commit.commit && last_commit.commit.author)),
|
|
||||||
zip_url: result.data.zip_url,
|
|
||||||
tar_url: result.data.tar_url
|
|
||||||
});
|
|
||||||
if (entries && entries.length > 0) {
|
|
||||||
this.renderData(entries);
|
|
||||||
}
|
|
||||||
this.setState({
|
|
||||||
rootList: entries,
|
|
||||||
subFileType: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).catch((error) => {});
|
|
||||||
};
|
|
||||||
|
|
||||||
ChangeFile = (arr, readOnly) => {
|
|
||||||
const { projectsId , owner } = this.props.match.params;
|
|
||||||
//点击直接跳转页面 加载一次路由
|
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/tree/${arr.path}`);
|
|
||||||
this.setState({
|
|
||||||
readOnly: readOnly,
|
|
||||||
chooseType:"file"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取子目录
|
|
||||||
getFileDetail = (path, ref) => {
|
|
||||||
this.setState({
|
|
||||||
filePath: decodeURI(path),
|
|
||||||
});
|
|
||||||
const { projectsId , owner , branchName } = this.props.match.params;
|
|
||||||
const { chooseType } = this.state;
|
|
||||||
const url = `/${owner}/${projectsId}/sub_entries.json`;
|
|
||||||
axios.get(url,{
|
|
||||||
params:{
|
|
||||||
filepath:path,
|
|
||||||
ref:ref || branchName,
|
|
||||||
type:chooseType
|
|
||||||
}
|
|
||||||
}).then((result)=>{
|
|
||||||
let entries = result.data && result.data.entries;
|
|
||||||
this.setState({
|
|
||||||
isSpin:false
|
|
||||||
})
|
|
||||||
if(result){
|
|
||||||
if(entries){
|
|
||||||
// 返回对象entries.type则是文件类型,否则是文件夹
|
|
||||||
if(entries.type){
|
|
||||||
this.setState({
|
|
||||||
fileDetail:[entries],
|
|
||||||
rootList:[],
|
|
||||||
subFileType:false
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
this.setState({
|
|
||||||
fileDetail:[],
|
|
||||||
rootList:entries,
|
|
||||||
branchLastCommit:result.data.last_commit && result.data.last_commit.commit,
|
|
||||||
lastCommitAuthor:result.data.last_commit && (result.data.last_commit.author || (result.data.last_commit.commit && result.data.last_commit.commit.author))
|
|
||||||
})
|
|
||||||
this.renderData(entries);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
this.setState({
|
|
||||||
fileDetail:[],
|
|
||||||
rootList:[],
|
|
||||||
isSpin:false,
|
|
||||||
subFileType:false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
this.setState({
|
|
||||||
isSpin:false
|
|
||||||
})
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
renderData = (data) => {
|
|
||||||
const rootList = [];
|
|
||||||
const readMeContent = [];
|
|
||||||
const readMeFile = [];
|
|
||||||
data && data.map((item, key) => {
|
|
||||||
rootList.push({
|
|
||||||
key,
|
|
||||||
message: item.commit && item.commit.message,
|
|
||||||
...item,
|
|
||||||
});
|
|
||||||
if (item.is_readme_file) {
|
|
||||||
readMeContent.push({ ...item });
|
|
||||||
readMeFile.push({ ...item });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.setState({
|
|
||||||
rootList: rootList,
|
|
||||||
readMeContent,
|
|
||||||
readMeFile,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 点击跳转到子目录
|
|
||||||
goToSubRoot=(path,type,filename)=>{
|
|
||||||
this.setState({
|
|
||||||
chooseType:type
|
|
||||||
})
|
|
||||||
const { projectsId, owner , branchName } = this.props.match.params;
|
|
||||||
const { defaultBranch } = this.props;
|
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}${`/tree/${branchName || defaultBranch}`}${path?`/${path}`:""}`);
|
|
||||||
if(filename.substring(filename.length - 3) === ".md"){
|
|
||||||
this.setState({
|
|
||||||
md:true
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
this.setState({
|
|
||||||
md:false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// readme文件内容
|
|
||||||
renderReadMeContent = (readMeContent, permission) => {
|
|
||||||
const { fileDetail, readMeFile } = this.state;
|
|
||||||
if (fileDetail) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (readMeContent && readMeContent.length > 0) {
|
|
||||||
return (
|
|
||||||
<div className="commonBox">
|
|
||||||
<div className="commonBox-title">
|
|
||||||
<span className="mr10">
|
|
||||||
<i className="iconfont icon-wenjian1 font-16 color-grey-9 fl mt3"></i>
|
|
||||||
</span>
|
|
||||||
<span className="commonBox-title-read">
|
|
||||||
{readMeContent[0].name}
|
|
||||||
</span>
|
|
||||||
{permission ?
|
|
||||||
<a
|
|
||||||
onClick={() => this.ChangeFile(readMeFile[0], false)}
|
|
||||||
className="ml20 pull-right"
|
|
||||||
>
|
|
||||||
<i className="iconfont icon-bianji6 font-16 color-blue"></i>
|
|
||||||
</a>
|
|
||||||
:
|
|
||||||
""
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div className="commonBox-info">
|
|
||||||
{readMeContent[0].content ?
|
|
||||||
<RenderHtml className="break_word_comments imageLayerParent" value={readMeContent[0].content} url={this.props.history.location}/>
|
|
||||||
:
|
|
||||||
<span>暂无~</span>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 选择分支
|
|
||||||
changeBranch = (value) => {
|
|
||||||
const { projectsId , owner } = this.props.match.params;
|
|
||||||
const { treeValue } = this.state;
|
|
||||||
let url = `/projects/${owner}/${projectsId}${value && `/tree/${value}`}${treeValue ? `/${treeValue}`:""}`;
|
|
||||||
this.props.history.push(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 子目录路径返回链接
|
|
||||||
returnUlr=(url)=>{
|
|
||||||
this.setState({
|
|
||||||
chooseType:"dir",
|
|
||||||
readOnly:true,
|
|
||||||
treeValue:url
|
|
||||||
})
|
|
||||||
const { projectsId , owner , branchName } = this.props.match.params;
|
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}/tree/${url}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
onEdit=(readOnly)=>{
|
|
||||||
this.setState({
|
|
||||||
readOnly
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
downloadUrl = (zip_url,tar_url) => {
|
|
||||||
return(
|
|
||||||
<Menu>
|
|
||||||
{zip_url && (
|
|
||||||
<Menu.Item>
|
|
||||||
<a href={zip_url}>ZIP</a>
|
|
||||||
</Menu.Item>
|
|
||||||
)}
|
|
||||||
{tar_url && (
|
|
||||||
<Menu.Item>
|
|
||||||
<a href={tar_url}>TAR.GZ</a>
|
|
||||||
</Menu.Item>
|
|
||||||
)}
|
|
||||||
</Menu>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
title = (branchLastCommit,lastCommitAuthor) => {
|
|
||||||
if (branchLastCommit) {
|
|
||||||
const { projectsId , owner } = this.props.match.params;
|
|
||||||
return (
|
|
||||||
<div className="f-wrap-alignCenter">
|
|
||||||
{lastCommitAuthor ? (
|
|
||||||
<React.Fragment>
|
|
||||||
{lastCommitAuthor.login ? (
|
|
||||||
<Link
|
|
||||||
to={`/users/${lastCommitAuthor.login}/projects`}
|
|
||||||
className="show-user-link"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
src={getImageUrl(`images/${lastCommitAuthor.image_url}`)}
|
|
||||||
className="radius mr10"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
<span className="mr15">{lastCommitAuthor.name}</span>
|
|
||||||
</Link>
|
|
||||||
) : (
|
|
||||||
<span className="mr15">{lastCommitAuthor.name}</span>
|
|
||||||
)}
|
|
||||||
</React.Fragment>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${branchLastCommit.sha}`)}`} className="color-blue flex-1 hide-1">
|
|
||||||
{branchLastCommit.message}
|
|
||||||
</Link>
|
|
||||||
<span>{branchLastCommit.time_from_now}</span>
|
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${branchLastCommit.sha}`)}`} className="commitKey">
|
|
||||||
{truncateCommitId(branchLastCommit.sha)}
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
render(){
|
|
||||||
const { branchLastCommit , lastCommitAuthor , rootList ,filePath , fileDetail , subFileType , readMeContent, isSpin , zip_url , tar_url , branchList} = this.state;
|
|
||||||
const { isManager , isDeveloper , projectDetail , platform , defaultBranch } = this.props;
|
|
||||||
|
|
||||||
const { projectsId , owner , branchName } = this.props.match.params;
|
|
||||||
let branch = branchName || defaultBranch;
|
|
||||||
|
|
||||||
const columns = [
|
|
||||||
{
|
|
||||||
key:"name",
|
|
||||||
dataIndex: 'name',
|
|
||||||
width:"30%",
|
|
||||||
render: (text,item) => (
|
|
||||||
<a onClick={()=>this.goToSubRoot(item.path,item.type,text)} className="ml12 task-hide" style={{ display: "block", maxWidth: "345px" }}>
|
|
||||||
<i className={ item.type === "file" ? "iconfont icon-wenjia font-15 color-green-file mr5" : "iconfont icon-wenjianjia1 color-green-file font-15 mr5"}></i>{text}
|
|
||||||
</a>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key:"message",
|
|
||||||
dataIndex: "message",
|
|
||||||
width: "60%",
|
|
||||||
render: (text, item) =>
|
|
||||||
item.commit && item.commit.message ?
|
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit.sha}`)}`} title={item.commit.message} className="task-hide" style={{ display: "block", maxWidth: "670px" }} >
|
|
||||||
{item.commit.message}
|
|
||||||
</Link>
|
|
||||||
: ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key:"time_from_now",
|
|
||||||
dataIndex: "time_from_now",
|
|
||||||
width: "10%",
|
|
||||||
className: "edu-txt-right",
|
|
||||||
render: (text, item) =>
|
|
||||||
item.commit && item.commit.time_from_now ?
|
|
||||||
<a title={item.commit.created_at} className="mr12" style={{ cursor: "default", color: "#888" }} >
|
|
||||||
{item.commit.time_from_now}
|
|
||||||
</a>
|
|
||||||
:""
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const urlRoot = filePath === undefined ? "" : `/${filePath}`;
|
|
||||||
let array = filePath && filePath.split("/");
|
|
||||||
return (
|
|
||||||
<Spin spinning={isSpin}>
|
|
||||||
<div className="main" style={{minHeight:'400px'}}>
|
|
||||||
<div className="f-wrap-between mb20">
|
|
||||||
<div className="f-wrap-alignCenter">
|
|
||||||
{
|
|
||||||
platform ?
|
|
||||||
<SelectBranch
|
|
||||||
repo_id={projectDetail && projectDetail.repo_id}
|
|
||||||
projectsId={projectsId}
|
|
||||||
branch={branch}
|
|
||||||
changeBranch={this.changeBranch}
|
|
||||||
owner={owner}
|
|
||||||
history={this.props.history}
|
|
||||||
branchList={branchList}
|
|
||||||
></SelectBranch>
|
|
||||||
:
|
|
||||||
<span>分支:<span className="color-grey-6">master</span></span>
|
|
||||||
}
|
|
||||||
|
|
||||||
{filePath && (
|
|
||||||
<span className="ml20 font-16">
|
|
||||||
<a
|
|
||||||
onClick={() => this.returnMain(branch)}
|
|
||||||
className="color-blue"
|
|
||||||
>
|
|
||||||
{projectDetail && projectDetail.identifier}
|
|
||||||
</a>
|
|
||||||
{array &&
|
|
||||||
array.map((item, key) => {
|
|
||||||
return (
|
|
||||||
<React.Fragment>
|
|
||||||
{
|
|
||||||
key === array.length-1 ?
|
|
||||||
<span className="color-grey-6 subFileName" key={key}>{item}</span>
|
|
||||||
:
|
|
||||||
<a onClick={()=>this.returnUlr(`${getPathUrl(array,key+1)}`)} className="color-blue subFileName">{item}</a>
|
|
||||||
}
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="f-wrap-alignCenter">
|
|
||||||
{subFileType && (projectDetail && parseInt(projectDetail.type)) !== 2 && (isManager || isDeveloper) && platform && (
|
|
||||||
<div>
|
|
||||||
<span>
|
|
||||||
<Link to={`/projects/${owner}/${projectsId}/${branch}/uploadfile${urlRoot}`} >
|
|
||||||
<span className="color-green mr30">上传文件</span>
|
|
||||||
</Link>
|
|
||||||
</span>
|
|
||||||
<span className="mr30">
|
|
||||||
<Link
|
|
||||||
to={`/projects/${owner}/${projectsId}/${branch}/newfile${urlRoot}`}
|
|
||||||
>
|
|
||||||
<span className="color-blue">新建文件</span>
|
|
||||||
</Link>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{projectDetail && projectDetail.clone_url && (
|
|
||||||
<CloneAddress
|
|
||||||
http_url={projectDetail.clone_url}
|
|
||||||
downloadUrl={this.downloadUrl(zip_url,tar_url)}
|
|
||||||
showNotification={this.props.showNotification}
|
|
||||||
></CloneAddress>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* 主目录列表 */}
|
|
||||||
{rootList && rootList.length > 0 && (
|
|
||||||
<RootTable
|
|
||||||
columns={columns}
|
|
||||||
data={rootList}
|
|
||||||
title={() => this.title(branchLastCommit,lastCommitAuthor)}
|
|
||||||
></RootTable>
|
|
||||||
)}
|
|
||||||
{/* 子目录列表、文件 */}
|
|
||||||
{fileDetail && fileDetail.length > 0 && (
|
|
||||||
<CoderRootFileDetail
|
|
||||||
detail={fileDetail[0]}
|
|
||||||
{...this.props}
|
|
||||||
{...this.state}
|
|
||||||
readOnly={this.state.readOnly}
|
|
||||||
onEdit={this.onEdit}
|
|
||||||
currentBranch={branch}
|
|
||||||
></CoderRootFileDetail>
|
|
||||||
)}
|
|
||||||
{
|
|
||||||
(rootList && rootList.length === 0) && (fileDetail && fileDetail.length === 0) && <Nodata _html="暂未发现文件!"/>
|
|
||||||
}
|
|
||||||
{ rootList && this.renderReadMeContent(readMeContent, isManager || isDeveloper)}
|
|
||||||
</div>
|
|
||||||
</Spin>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default CoderRootDirectory;
|
|
|
@ -24,13 +24,25 @@ class CoderRootFileDetail extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
const { detail } = this.props;
|
const { detail , mdFlag } = this.props;
|
||||||
this.setState({
|
this.setState({
|
||||||
value: detail.content,
|
value: detail.content,
|
||||||
});
|
});
|
||||||
this.languages_total();
|
this.languages_total();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
componentDidUpdate=(prevProps)=>{
|
||||||
|
const { content } = this.props && this.props.detail;
|
||||||
|
const prevcontent = prevProps.detail && prevProps.detail.content;
|
||||||
|
if (content && prevcontent) {
|
||||||
|
if (prevcontent !== content){
|
||||||
|
this.setState({
|
||||||
|
description: content
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
languages_total = () => {
|
languages_total = () => {
|
||||||
const { detail } = this.props;
|
const { detail } = this.props;
|
||||||
const file_name = detail.path.split("/").pop().split(".").pop();
|
const file_name = detail.path.split("/").pop().split(".").pop();
|
||||||
|
@ -164,15 +176,16 @@ class CoderRootFileDetail extends Component {
|
||||||
current_user,
|
current_user,
|
||||||
isManager,
|
isManager,
|
||||||
isDeveloper,
|
isDeveloper,
|
||||||
md,
|
|
||||||
currentBranch,
|
currentBranch,
|
||||||
platform
|
platform,
|
||||||
|
md,
|
||||||
|
type
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { language, languages, description } = this.state;
|
const { language, languages, description } = this.state;
|
||||||
let flag = current_user && current_user.login && (isManager || isDeveloper);
|
let flag = current_user && current_user.login && (isManager || isDeveloper);
|
||||||
const Option = Select.Option;
|
const Option = Select.Option;
|
||||||
return (
|
return (
|
||||||
<div className="mb20">
|
<React.Fragment>
|
||||||
<div className="grid-item branchTitle">
|
<div className="grid-item branchTitle">
|
||||||
<div className="grid-item">
|
<div className="grid-item">
|
||||||
<span className="ml20 color-grey-6 font-16">
|
<span className="ml20 color-grey-6 font-16">
|
||||||
|
@ -185,17 +198,18 @@ class CoderRootFileDetail extends Component {
|
||||||
{readOnly ? (
|
{readOnly ? (
|
||||||
<span>
|
<span>
|
||||||
{
|
{
|
||||||
detail.direct_download ?
|
!detail.direct_download?
|
||||||
""
|
|
||||||
:
|
|
||||||
<span>
|
<span>
|
||||||
<a onClick={() => this.DownLoadFile(detail.download_url)} className="ml20">
|
<a onClick={() => this.DownLoadFile(detail.download_url)} className="ml20">
|
||||||
<i className="iconfont icon-xiazai1 font-15 color-grey-6"></i>
|
<i className="iconfont icon-xiazai1 font-15 color-grey-6"></i>
|
||||||
</a>
|
</a>
|
||||||
<a onClick={() => this.EditFile(false)} className="ml20">
|
{
|
||||||
<i className="iconfont icon-bianji1 font-15 color-grey-6"></i>
|
type !==2 &&
|
||||||
</a>
|
<a onClick={() => this.EditFile(false)} className="ml20">
|
||||||
</span>
|
<i className="iconfont icon-bianji1 font-15 color-grey-6"></i>
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
</span>:""
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
|
@ -226,18 +240,21 @@ class CoderRootFileDetail extends Component {
|
||||||
</button>
|
</button>
|
||||||
</React.Fragment>
|
</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>
|
||||||
|
}
|
||||||
|
|
||||||
<Popconfirm
|
|
||||||
title="确认删除这个文件?"
|
|
||||||
className="ml20"
|
|
||||||
okText="确定"
|
|
||||||
cancelText="取消"
|
|
||||||
onConfirm={this.deleteFile}
|
|
||||||
>
|
|
||||||
<a>
|
|
||||||
<i className="iconfont icon-shanchu font-15 color-grey-6"></i>
|
|
||||||
</a>
|
|
||||||
</Popconfirm>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
@ -245,11 +262,7 @@ class CoderRootFileDetail extends Component {
|
||||||
<div>
|
<div>
|
||||||
{detail.image_type ? (
|
{detail.image_type ? (
|
||||||
<div className="edu-txt-center pt20 pb20">
|
<div className="edu-txt-center pt20 pb20">
|
||||||
<img
|
<img alt="" src={detail.download_url} style={{ maxWidth: "80%" }} />
|
||||||
alt=""
|
|
||||||
src={detail.download_url}
|
|
||||||
style={{ maxWidth: "80%" }}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
) : detail.direct_download ? (
|
) : detail.direct_download ? (
|
||||||
<div className="mt20 text-center">
|
<div className="mt20 text-center">
|
||||||
|
@ -268,14 +281,14 @@ class CoderRootFileDetail extends Component {
|
||||||
{...this.state}
|
{...this.state}
|
||||||
language={language ? language : "javascript"}
|
language={language ? language : "javascript"}
|
||||||
filepath={`/${detail.path}`}
|
filepath={`/${detail.path}`}
|
||||||
content={detail.content}
|
content={description}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
editorType="update"
|
editorType="update"
|
||||||
currentBranch={currentBranch}
|
currentBranch={currentBranch}
|
||||||
></Meditor>
|
></Meditor>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,6 @@ const UploadFile = Loadable({
|
||||||
loader: () => import('../Newfile/upload_file'),
|
loader: () => import('../Newfile/upload_file'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
const CoderRootDirectory = Loadable({
|
|
||||||
loader: () => import('./CoderRootDirectory'),
|
|
||||||
loading: Loading,
|
|
||||||
})
|
|
||||||
const CoderRootCommit = Loadable({
|
const CoderRootCommit = Loadable({
|
||||||
loader: () => import('./CoderRootCommit'),
|
loader: () => import('./CoderRootCommit'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
|
@ -71,6 +67,7 @@ class CoderRootIndex extends Component{
|
||||||
this.getTopCount(branchName || defaultBranch);
|
this.getTopCount(branchName || defaultBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取<Top />组件里要显示的数据
|
||||||
getTopCount=(branch)=>{
|
getTopCount=(branch)=>{
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const url = `/${owner}/${projectsId}/top_counts.json`;
|
const url = `/${owner}/${projectsId}/top_counts.json`;
|
||||||
|
@ -105,13 +102,6 @@ class CoderRootIndex extends Component{
|
||||||
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* diff */}
|
|
||||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
|
||||||
render={
|
|
||||||
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
|
||||||
}
|
|
||||||
></Route>
|
|
||||||
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
||||||
render={
|
render={
|
||||||
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
||||||
|
@ -122,7 +112,6 @@ class CoderRootIndex extends Component{
|
||||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
<Route path="/projects/:owner/:projectsId/releases/:versionId/update"
|
<Route path="/projects/:owner/:projectsId/releases/:versionId/update"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderRootVersionUpdate {...this.props} {...this.state} {...props} />)
|
(props) => (<CoderRootVersionUpdate {...this.props} {...this.state} {...props} />)
|
||||||
|
@ -133,33 +122,21 @@ class CoderRootIndex extends Component{
|
||||||
() => (<CoderRootVersionNew {...this.props} {...this.state} />)
|
() => (<CoderRootVersionNew {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
<Route path="/projects/:owner/:projectsId/releases"
|
<Route path="/projects/:owner/:projectsId/releases"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootVersion {...this.props} {...this.state} />)
|
() => (<CoderRootVersion {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
<Route path="/projects/:owner/:projectsId/tag"
|
<Route path="/projects/:owner/:projectsId/tag"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootTag {...this.props} {...this.state} />)
|
() => (<CoderRootTag {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/tree/:branchName"
|
|
||||||
render={
|
|
||||||
(props) => (<CoderRootDirectory {...this.props} {...this.state} getTopCount={this.getTopCount} />)
|
|
||||||
}
|
|
||||||
></Route>
|
|
||||||
<Route path="/projects/:owner/:projectsId/branchs"
|
<Route path="/projects/:owner/:projectsId/branchs"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootBranch {...this.props} {...this.state} />)
|
() => (<CoderRootBranch {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId"
|
|
||||||
render={
|
|
||||||
() => (<CoderRootDirectory {...this.props} {...this.state} getTopCount={this.getTopCount} />)
|
|
||||||
}
|
|
||||||
></Route>
|
|
||||||
</Switch>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
||||||
import { Spin, Tooltip } from 'antd';
|
import { Spin, Tooltip } from 'antd';
|
||||||
import { Link, Route, Switch } from 'react-router-dom';
|
import { Link, Route, Switch } from 'react-router-dom';
|
||||||
import { Content } from '../Component/layout';
|
import { Content } from '../Component/layout';
|
||||||
|
import DetailBanner from './sub/DetailBanner';
|
||||||
import '../css/index.scss'
|
import '../css/index.scss'
|
||||||
import './list.css';
|
import './list.css';
|
||||||
|
|
||||||
|
@ -96,7 +97,19 @@ const ForkUsers = Loadable({
|
||||||
loader: () => import('../UsersList/fork_users'),
|
loader: () => import('../UsersList/fork_users'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
const Contribute = Loadable({
|
||||||
|
loader: () => import('./sub/Contribute'),
|
||||||
|
loading: Loading,
|
||||||
|
})
|
||||||
|
|
||||||
|
const CoderRootCommit = Loadable({
|
||||||
|
loader: () => import('./CoderRootCommit'),
|
||||||
|
loading: Loading,
|
||||||
|
})
|
||||||
|
const CoderDepot = Loadable({
|
||||||
|
loader: () => import('./CoderDepot'),
|
||||||
|
loading: Loading,
|
||||||
|
})
|
||||||
|
|
||||||
const TrendsIndex = Loadable({
|
const TrendsIndex = Loadable({
|
||||||
loader: () => import('../Activity/Activity'),
|
loader: () => import('../Activity/Activity'),
|
||||||
|
@ -107,6 +120,10 @@ const DevAbout = Loadable({
|
||||||
loader: () => import('../About/Index'),
|
loader: () => import('../About/Index'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
const Source = Loadable({
|
||||||
|
loader: () => import('../Source/Index'),
|
||||||
|
loading: Loading,
|
||||||
|
})
|
||||||
const DevIndex = Loadable({
|
const DevIndex = Loadable({
|
||||||
loader: () => import('../DevOps/Index'),
|
loader: () => import('../DevOps/Index'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
|
@ -117,20 +134,23 @@ const DevIndex = Loadable({
|
||||||
function checkPathname(projectsId,owner,pathname){
|
function checkPathname(projectsId,owner,pathname){
|
||||||
let name = "";
|
let name = "";
|
||||||
if(pathname && pathname !== `/projects/${owner}/${projectsId}`){
|
if(pathname && pathname !== `/projects/${owner}/${projectsId}`){
|
||||||
if(pathname.indexOf("/about")>-1){
|
let url = pathname.split(`/projects/${owner}/${projectsId}`)[1];
|
||||||
|
if(url.indexOf("/about")>-1){
|
||||||
name="about"
|
name="about"
|
||||||
}else if(pathname.indexOf("/issues")>-1 ||pathname.indexOf("Milepost") > 0){
|
}else if(url.indexOf("/issues")>-1 ||url.indexOf("Milepost") > 0){
|
||||||
name = "issues";
|
name = "issues";
|
||||||
}else if(pathname.indexOf("/pulls")>-1){
|
}else if(url.indexOf("/pulls")>-1){
|
||||||
name="pulls"
|
name="pulls"
|
||||||
}else if(pathname.indexOf("/milestones")>-1){
|
}else if(url.indexOf("/milestones")>-1){
|
||||||
name="milestones"
|
name="milestones"
|
||||||
}else if(pathname.indexOf("/activity")>-1){
|
}else if(url.indexOf("/activity")>-1){
|
||||||
name="activity"
|
name="activity"
|
||||||
}else if(pathname.indexOf("/setting")>-1){
|
}else if(url.indexOf("/setting")>-1){
|
||||||
name="setting"
|
name="setting"
|
||||||
}else if(pathname.indexOf(`/devops`)>-1){
|
}else if(url.indexOf(`/devops`)>-1){
|
||||||
name="devops"
|
name="devops"
|
||||||
|
}else if(url.indexOf(`/source`)>-1){
|
||||||
|
name="source"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
|
@ -150,7 +170,6 @@ class Detail extends Component {
|
||||||
watched: false,
|
watched: false,
|
||||||
praised: false,
|
praised: false,
|
||||||
http_url: undefined,
|
http_url: undefined,
|
||||||
author: undefined,
|
|
||||||
branchs: undefined,
|
branchs: undefined,
|
||||||
branchList: undefined,
|
branchList: undefined,
|
||||||
project: null,
|
project: null,
|
||||||
|
@ -245,7 +264,8 @@ class Detail extends Component {
|
||||||
|
|
||||||
getDetail = () => {
|
getDetail = () => {
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const url = `/${owner}/${projectsId}.json`;
|
this.getBanner();
|
||||||
|
const url = `/${owner}/${projectsId}/detail.json`;
|
||||||
axios.get(url).then((result) => {
|
axios.get(url).then((result) => {
|
||||||
if (result && result.data) {
|
if (result && result.data) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -255,7 +275,6 @@ class Detail extends Component {
|
||||||
isReporter: result.data.permission && result.data.permission === "Reporter",
|
isReporter: result.data.permission && result.data.permission === "Reporter",
|
||||||
isDeveloper: result.data.permission && result.data.permission === "Developer",
|
isDeveloper: result.data.permission && result.data.permission === "Developer",
|
||||||
http_url: result.data.clone_url,
|
http_url: result.data.clone_url,
|
||||||
author: result.data.author,
|
|
||||||
praised: result.data.praised,
|
praised: result.data.praised,
|
||||||
watched: result.data.watched,
|
watched: result.data.watched,
|
||||||
watchers_count: result.data.watchers_count,
|
watchers_count: result.data.watchers_count,
|
||||||
|
@ -267,6 +286,19 @@ class Detail extends Component {
|
||||||
}).catch((error) => { })
|
}).catch((error) => { })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取动态导航栏菜单
|
||||||
|
getBanner(){
|
||||||
|
const { projectsId , owner } = this.props.match.params;
|
||||||
|
const url = `/${owner}/${projectsId}/menu_list.json`;
|
||||||
|
axios.get(url).then(result=>{
|
||||||
|
if(result){
|
||||||
|
this.setState({
|
||||||
|
bannerList:result.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
// 关注和取消关注
|
// 关注和取消关注
|
||||||
focusFunc = (flag) => {
|
focusFunc = (flag) => {
|
||||||
const { platform } = this.state;
|
const { platform } = this.state;
|
||||||
|
@ -363,7 +395,7 @@ class Detail extends Component {
|
||||||
const { projectDetail, watchers_count, praises_count,
|
const { projectDetail, watchers_count, praises_count,
|
||||||
forked_count, firstSync , secondSync ,
|
forked_count, firstSync , secondSync ,
|
||||||
isManager, watched, praised,
|
isManager, watched, praised,
|
||||||
project , open_devops , platform , defaultBranch } = this.state;
|
project , open_devops , platform , defaultBranch , bannerList } = this.state;
|
||||||
const url = this.props.history.location.pathname;
|
const url = this.props.history.location.pathname;
|
||||||
const urlArr = url.split("/");
|
const urlArr = url.split("/");
|
||||||
const urlFlag = (urlArr.length === 3);
|
const urlFlag = (urlArr.length === 3);
|
||||||
|
@ -464,9 +496,11 @@ class Detail extends Component {
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<span className="detail_tag_btn">
|
<span className="detail_tag_btn">
|
||||||
<a className="detail_tag_btn_name" style={{cursor:platform?"pointer":"default"}} onClick={this.forkFunc}>
|
<Tooltip title="复刻是fork的中文名,即复制代码仓库" placement="bottom">
|
||||||
<i className="iconfont icon-fork color-grey-9 mr3"></i>复刻 (Fork)
|
<a className="detail_tag_btn_name" style={{cursor:platform?"pointer":"default"}} onClick={this.forkFunc}>
|
||||||
</a>
|
<i className="iconfont icon-fork color-grey-9 mr3"></i>复刻
|
||||||
|
</a>
|
||||||
|
</Tooltip>
|
||||||
{
|
{
|
||||||
forked_count > 0 ?
|
forked_count > 0 ?
|
||||||
platform ?
|
platform ?
|
||||||
|
@ -483,83 +517,36 @@ class Detail extends Component {
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
firstSync ? "" :
|
firstSync ? "" :
|
||||||
<div className="f-wrap-between mt15">
|
<DetailBanner
|
||||||
<ul className="headerMenu-wrapper">
|
history={this.props.history}
|
||||||
<li className={pathname==="about" ? "active" : ""}>
|
list={bannerList}
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/about`, state }}>
|
owner={owner}
|
||||||
<i className={(pathname==="" || urlFlag) ? "iconfont icon-zhuye1 color-grey-3 mr5 font-14":"iconfont icon-zhuye1 color-grey-6 font-14 mr5"}></i>
|
projectsId={projectsId}
|
||||||
<span>主页</span>
|
pathname={pathname}
|
||||||
</Link>
|
state={state}
|
||||||
</li>
|
projectDetail={projectDetail}
|
||||||
<li className={(pathname==="" || urlFlag) ? "active" : ""}>
|
open_devops={open_devops}
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}`, state }}>
|
platform={platform}
|
||||||
<i className={(pathname==="" || urlFlag) ? "iconfont icon-daimaku color-grey-3 mr5 font-14":"iconfont icon-daimaku color-grey-6 font-14 mr5"}></i>
|
urlFlag={urlFlag}
|
||||||
<span>代码库</span>
|
isManager={isManager}
|
||||||
</Link>
|
/>
|
||||||
</li>
|
|
||||||
<li className={pathname==="issues" ? "active" : ""}>
|
|
||||||
<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>易修 (Issue)</span>
|
|
||||||
{projectDetail && projectDetail.issues_count ? <span className="num">{projectDetail.issues_count}</span> : ""}
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
{
|
|
||||||
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>
|
|
||||||
<span>合并请求</span>
|
|
||||||
{projectDetail && projectDetail.pull_requests_count ? <span className="num">{projectDetail.pull_requests_count}</span> : ""}
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
{
|
|
||||||
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版)
|
|
||||||
{projectDetail && projectDetail.ops_count ? <span>{projectDetail.ops_count}</span> : ""}
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
|
|
||||||
<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>
|
|
||||||
</li>
|
|
||||||
<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>
|
|
||||||
<span>动态</span>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
{
|
|
||||||
isManager && platform &&
|
|
||||||
<li className={url.indexOf("/setting") > 0 ? "active" : ""}>
|
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting`}>
|
|
||||||
<i className={url.indexOf("/setting") > 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}></i>
|
|
||||||
<span>仓库设置</span>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
firstSync ?
|
firstSync ?
|
||||||
<Content className="spincontent">
|
<Content className="spincontent">
|
||||||
<Spin className="spinstyle" tip={project && `正在从 ${project.mirror_url} 迁移`} size="large">
|
<Spin className="spinstyle" tip={project && `正在从 ${project.mirror_url} 迁移`} size="large" />
|
||||||
</Spin>
|
|
||||||
</Content>
|
</Content>
|
||||||
:
|
:
|
||||||
<Spin spinning={secondSync} className="spinstyle" tip="正在同步镜像" size="large">
|
<Spin spinning={secondSync} className="spinstyle" tip="正在同步镜像" size="large">
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
|
{/* 资源 */}
|
||||||
|
<Route path="/projects/:owner/:projectsId/source"
|
||||||
|
render={
|
||||||
|
() => (<Source {...this.props} {...this.state} {...common} />)
|
||||||
|
}
|
||||||
|
></Route>
|
||||||
{/* 主页 */}
|
{/* 主页 */}
|
||||||
<Route path="/projects/:owner/:projectsId/about"
|
<Route path="/projects/:owner/:projectsId/about"
|
||||||
render={
|
render={
|
||||||
|
@ -650,6 +637,7 @@ class Detail extends Component {
|
||||||
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
{/* 新建合并请求 */}
|
||||||
<Route path="/projects/:owner/:projectsId/pulls/new"
|
<Route path="/projects/:owner/:projectsId/pulls/new"
|
||||||
render={
|
render={
|
||||||
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
||||||
|
@ -676,11 +664,6 @@ class Detail extends Component {
|
||||||
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/coders/filesurl"
|
|
||||||
render={
|
|
||||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
|
||||||
}
|
|
||||||
></Route>
|
|
||||||
<Route path="/projects/:owner/:projectsId/watchers"
|
<Route path="/projects/:owner/:projectsId/watchers"
|
||||||
render={
|
render={
|
||||||
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||||
|
@ -696,19 +679,32 @@ class Detail extends Component {
|
||||||
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
{/* 贡献者列表 */}
|
||||||
|
<Route path="/projects/:owner/:projectsId/contribute"
|
||||||
|
render={
|
||||||
|
() => (<Contribute {...this.props} {...this.state} {...common} />)
|
||||||
|
}
|
||||||
|
></Route>
|
||||||
|
|
||||||
|
{/* 代码库----详情页面 */}
|
||||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} {...common}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/tree/:branchName"
|
<Route path="/projects/:owner/:projectsId/tree/:branchName"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common}/>)
|
||||||
|
}
|
||||||
|
></Route>
|
||||||
|
<Route path="/projects/:owner/:projectsId/:subIndex"
|
||||||
|
render={
|
||||||
|
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId"
|
<Route path="/projects/:owner/:projectsId"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
|
@ -59,13 +59,13 @@ export default ({ match , history }) => {
|
||||||
{commit && commit.message &&
|
{commit && commit.message &&
|
||||||
<pre className="task-hide" style={{marginBottom:"0px",height:"28px",whiteSpace:"pre-wrap"}}>{commit.message}</pre>
|
<pre className="task-hide" style={{marginBottom:"0px",height:"28px",whiteSpace:"pre-wrap"}}>{commit.message}</pre>
|
||||||
}
|
}
|
||||||
<Button type="primary" onClick={()=>{history.push(`/projects/${owner}/${projectsId}/branch/${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button>
|
<Button type="primary" onClick={()=>{history.push(`/projects/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="f-wrap-between" style={{ alignItems: "center" }}>
|
<div className="f-wrap-between" style={{ alignItems: "center" }}>
|
||||||
<ul className="df">
|
<ul className="df">
|
||||||
<User
|
<User
|
||||||
url={(committer && getImageUrl(`images/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
url={(committer && getImageUrl(`/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
||||||
name={committer && committer.name}
|
name={committer && committer.name}
|
||||||
/>
|
/>
|
||||||
{committer && committer.time_from_now && <li className="ml20 mt2">{committer.time_from_now}</li>}
|
{committer && committer.time_from_now && <li className="ml20 mt2">{committer.time_from_now}</li>}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Menu, Input , Spin, Pagination , Popover , Select } from 'antd';
|
import { Menu, Input , Spin, Pagination , Popover , Select } from 'antd';
|
||||||
import { getUrl } from 'educoder';
|
import { getImageUrl } from 'educoder';
|
||||||
import '../css/index.scss'
|
import '../css/index.scss'
|
||||||
import './list.css';
|
import './list.css';
|
||||||
import './Index.scss';
|
import './Index.scss';
|
||||||
|
@ -271,7 +271,7 @@ class Index extends Component {
|
||||||
return(
|
return(
|
||||||
<div onClick={()=>this.getoDetail(item.author && item.author.login,item.identifier)}>
|
<div onClick={()=>this.getoDetail(item.author && item.author.login,item.identifier)}>
|
||||||
<div className="mainInfo">
|
<div className="mainInfo">
|
||||||
<img src={getUrl(`/images/${item.author && item.author.image_url}`)} alt=""/>
|
<img src={getImageUrl(`/${item.author && item.author.image_url}`)} alt=""/>
|
||||||
<p className="school">{item.name}</p>
|
<p className="school">{item.name}</p>
|
||||||
<p className="name">{item.author && item.author.name}</p>
|
<p className="name">{item.author && item.author.name}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
width: 220px;
|
width: 220px;
|
||||||
margin-right: 25px;
|
margin-right: 25px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
border: 1px solid #eee;
|
||||||
&:last-child{
|
&:last-child{
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
}
|
}
|
||||||
|
@ -72,3 +73,243 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// coderDepot
|
||||||
|
.Panels{
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
.panelmenu{
|
||||||
|
padding-top:30px;
|
||||||
|
}
|
||||||
|
.addOptionBtn{
|
||||||
|
height: 32px;
|
||||||
|
line-height: 30px;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.infoCount{
|
||||||
|
display: inline-block;
|
||||||
|
padding:0px 5px;
|
||||||
|
height: 16px;
|
||||||
|
line-height: 16px;
|
||||||
|
background-color: #eee;
|
||||||
|
color:#999;
|
||||||
|
border-radius: 12px;
|
||||||
|
margin-left: 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.attrPerson{
|
||||||
|
padding-top: 15px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
a{
|
||||||
|
margin: 10px 10px 0px 0px;
|
||||||
|
img{
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 35px;
|
||||||
|
height: 35px;
|
||||||
|
}
|
||||||
|
&:nth-child(6){
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.progress{
|
||||||
|
display: flex;
|
||||||
|
border-radius: 10px;
|
||||||
|
height: 7px;
|
||||||
|
margin-top: 12px;
|
||||||
|
span{
|
||||||
|
border-left: 1px solid #fff;
|
||||||
|
&:first-child{
|
||||||
|
border-left: none;
|
||||||
|
border-radius: 10px 0px 0px 10px;
|
||||||
|
}
|
||||||
|
&:last-child{
|
||||||
|
border-radius: 0px 10px 10px 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.progresstip{
|
||||||
|
margin-top: 15px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
i.zero{
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
border-radius: 50%;
|
||||||
|
height: 8px;
|
||||||
|
width: 8px;
|
||||||
|
left: 0px;
|
||||||
|
top:10px
|
||||||
|
}
|
||||||
|
&>span{
|
||||||
|
padding-left: 15px;
|
||||||
|
position: relative;
|
||||||
|
min-width: 33.5%;
|
||||||
|
span{
|
||||||
|
color: #666;
|
||||||
|
&:last-child{
|
||||||
|
color: #999;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.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;
|
||||||
|
border-radius: 4px 4px 0px 0px;
|
||||||
|
background-color: #FAFBFC;
|
||||||
|
.ellipsistxt{
|
||||||
|
margin-left: 13px;
|
||||||
|
line-height:18px;
|
||||||
|
margin-top:6px;
|
||||||
|
flex:1;
|
||||||
|
width: 0;
|
||||||
|
color: #666;
|
||||||
|
&>p{
|
||||||
|
word-break:break-all;
|
||||||
|
}
|
||||||
|
&.hide{
|
||||||
|
height: 18px;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
padding-right:8px;
|
||||||
|
}
|
||||||
|
&.hide::after{
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
content:"...";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ellipsis{
|
||||||
|
margin-left: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 2px;
|
||||||
|
background-color: #c1c1c1;
|
||||||
|
padding:0px 4px;
|
||||||
|
height: 14px;
|
||||||
|
line-height: 14px;
|
||||||
|
margin-top: 9px;
|
||||||
|
i{
|
||||||
|
font-size: 15px!important;
|
||||||
|
color: #fff;
|
||||||
|
height: 14px;
|
||||||
|
line-height: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.listtablebody{
|
||||||
|
li.listtablepath{
|
||||||
|
a{color: #40a9ff;}
|
||||||
|
p{
|
||||||
|
margin-bottom: 0px!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
li{
|
||||||
|
height: 42px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 1px solid #d9d9d9;
|
||||||
|
padding:0px 20px 0px 24px;
|
||||||
|
& > span:first-child{
|
||||||
|
width: 30%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
& > span:nth-child(2){
|
||||||
|
width: 60%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
& > span:nth-child(3){
|
||||||
|
width: 10%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&> li:last-child{
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.drawerBtn{
|
||||||
|
position: fixed;
|
||||||
|
left: -13px;
|
||||||
|
border:1px solid rgb(207,205,223);
|
||||||
|
width: 34px;
|
||||||
|
border-radius: 0px 12px 12px 0px;
|
||||||
|
height: 70px;
|
||||||
|
top:50%;
|
||||||
|
margin-top: -35px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: center;
|
||||||
|
&:hover{
|
||||||
|
box-shadow: 1px 0px 7px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
writing-mode: vertical-lr;
|
||||||
|
color: #202429;
|
||||||
|
width: 25px;
|
||||||
|
}
|
||||||
|
i{
|
||||||
|
color: #24292e;
|
||||||
|
height: 18px;
|
||||||
|
line-height: 18px;
|
||||||
|
width: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.downMenu{
|
||||||
|
box-shadow: 0px 0px 9px rgba(134, 134, 134,0.4);
|
||||||
|
background-color: #fff;
|
||||||
|
.ant-menu-vertical .ant-menu-item:hover{
|
||||||
|
background-color: #e6f7ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.menuslist{
|
||||||
|
max-height: 200px;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding:10px 15px;
|
||||||
|
border-radius: 4px;
|
||||||
|
.ant-dropdown-menu-item{
|
||||||
|
border-radius: 8px;
|
||||||
|
text-align: left!important;
|
||||||
|
a{
|
||||||
|
width: 350px;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ant-dropdown-menu-item.active{
|
||||||
|
background-color: #e6f7ff;
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,8 +27,8 @@ class IndexItem extends Component {
|
||||||
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
|
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
|
||||||
</a>
|
</a>
|
||||||
:
|
:
|
||||||
<Link to={`/users/${item.author.login}`} className="show-user-link">
|
<Link to={item.author && (item.author.type === "Organization" ? `/organize/${item.author.login}`:`/users/${item.author.login}`)} className="show-user-link">
|
||||||
<img className="p-r-photo" alt="" src={getImageUrl(`${item.author && item.author.image_url}`)} ></img>
|
<img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
|
||||||
</Link>
|
</Link>
|
||||||
}
|
}
|
||||||
<div className="p-r-Infos">
|
<div className="p-r-Infos">
|
||||||
|
|
|
@ -18,10 +18,17 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
.list-left > div{
|
||||||
|
border:1px solid #eee;
|
||||||
|
}
|
||||||
|
.list-left > div.bgcF{
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
.list-right{
|
.list-right{
|
||||||
width:74%;
|
width:74%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding:10px;
|
padding:10px;
|
||||||
|
border:1px solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -274,7 +281,6 @@
|
||||||
height:100%;
|
height:100%;
|
||||||
}
|
}
|
||||||
.files-md{
|
.files-md{
|
||||||
border:1px solid #eee;
|
|
||||||
padding:20px;
|
padding:20px;
|
||||||
}
|
}
|
||||||
/* 详情-代码 */
|
/* 详情-代码 */
|
||||||
|
@ -424,18 +430,11 @@
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
/* 分支 */
|
/* 分支 */
|
||||||
.branchTable{
|
|
||||||
border:1px solid #f7f7f7;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.branchTitle{
|
.branchTitle{
|
||||||
padding:12px 10px;
|
padding:8px 10px;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
background:rgba(241,248,255,1);
|
border-bottom: 1px solid #d9d9d9;
|
||||||
}
|
|
||||||
.branchUl{
|
|
||||||
padding:0px 30px;
|
|
||||||
}
|
}
|
||||||
.branchUl li{
|
.branchUl li{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -548,17 +547,19 @@
|
||||||
}
|
}
|
||||||
.commonBox{
|
.commonBox{
|
||||||
border:1px solid #ddd;
|
border:1px solid #ddd;
|
||||||
margin-top: 25px;
|
margin-top: 30px;
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
.commonBox .commonBox-title{
|
.commonBox .commonBox-title{
|
||||||
padding:0px 15px;
|
padding:0px 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
background: #F1F8FF;
|
background: #FAFBFC;/* F1F8FF */
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
height: 50px;
|
height: 45px;
|
||||||
line-height: 50px;
|
line-height: 45px;
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #d9d9d9;
|
||||||
|
border-radius: 4px 4px 0px 0px;
|
||||||
}
|
}
|
||||||
.synchronism{
|
.synchronism{
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -575,7 +576,7 @@
|
||||||
.commonBox .commonBox-info{
|
.commonBox .commonBox-info{
|
||||||
padding:20px 15px;
|
padding:20px 15px;
|
||||||
}
|
}
|
||||||
.commonBox-title-read{vertical-align: middle;}
|
.commonBox-title-read{vertical-align: middle;color: #666;}
|
||||||
|
|
||||||
@media screen and (max-width: 370px){
|
@media screen and (max-width: 370px){
|
||||||
.p-r-tags,.p-r-btn{
|
.p-r-tags,.p-r-btn{
|
||||||
|
@ -665,7 +666,7 @@ a.color-grey-ccc:hover{
|
||||||
|
|
||||||
.commitList{
|
.commitList{
|
||||||
padding:0px 30px;
|
padding:0px 30px;
|
||||||
min-height: 450px;
|
min-height: 400px;
|
||||||
}
|
}
|
||||||
.commitList > div{
|
.commitList > div{
|
||||||
border-bottom: 1px solid #EEEEEE;
|
border-bottom: 1px solid #EEEEEE;
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { WhiteBack , AlignCenter } from '../../Component/layout';
|
||||||
|
import "./sub.scss";
|
||||||
|
import axios from 'axios';
|
||||||
|
import { Pagination , Spin } from 'antd';
|
||||||
|
import NoData from '../../Nodata';
|
||||||
|
import { getImageUrl } from 'educoder';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
function Contribute(props){
|
||||||
|
const [ list , setList ] = useState(undefined);
|
||||||
|
const [ page , setPage ] = useState(1);
|
||||||
|
const [ total , setTotal ] = useState(0);
|
||||||
|
const [ isSpin , setIsSpin ] = useState(true);
|
||||||
|
|
||||||
|
const owner = props.match.params.owner;
|
||||||
|
const projectsId = props.match.params.projectsId;
|
||||||
|
const LIMIT = 20;
|
||||||
|
useEffect(()=>{
|
||||||
|
if(owner && projectsId){
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},[owner,projectsId,page]);
|
||||||
|
|
||||||
|
function getData(){
|
||||||
|
setIsSpin(true);
|
||||||
|
const url = `/${owner}/${projectsId}/contributors.json`;
|
||||||
|
axios.get(url,{
|
||||||
|
params:{
|
||||||
|
limit:LIMIT,page,
|
||||||
|
}
|
||||||
|
}).then(result=>{
|
||||||
|
if(result){
|
||||||
|
setList(result.data.contributors);
|
||||||
|
setTotal(result.data.total_count);
|
||||||
|
setIsSpin(false);
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
return(
|
||||||
|
<WhiteBack>
|
||||||
|
<Spin spinning={isSpin}>
|
||||||
|
<div className="boxPanel">
|
||||||
|
<p className="font-18 mb20">贡献者列表</p>
|
||||||
|
{
|
||||||
|
list && list.length > 0 ?
|
||||||
|
<div className="contrbuteList">
|
||||||
|
{
|
||||||
|
list.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
<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>
|
||||||
|
<p className="font-12 color-grey-9">提交{item.contributions}次</p>
|
||||||
|
</div>
|
||||||
|
</AlignCenter>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
{
|
||||||
|
list && list.length === 0 ? <NoData _html="暂无贡献者" />:""
|
||||||
|
}
|
||||||
|
{
|
||||||
|
total > LIMIT ?
|
||||||
|
<div className="mt20 edu-txt-center">
|
||||||
|
<Pagination simple pageSize={LIMIT} onChange={(p)=>{setPage(p)}} current={page} total={total}/>
|
||||||
|
</div>
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</Spin>
|
||||||
|
</WhiteBack>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Contribute;
|
|
@ -0,0 +1,127 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { Skeleton , Tooltip} from 'antd';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
function DetailBanner({ history,list , owner , projectsId , isManager , url , pathname , state , urlFlag , projectDetail , platform ,open_devops }){
|
||||||
|
const [ menuName , setMenuName ] = useState(undefined);
|
||||||
|
useEffect(()=>{
|
||||||
|
if(list){
|
||||||
|
// 没有资源库banner但是通过连接进资源库页面时
|
||||||
|
if(pathname && pathname==="source"){
|
||||||
|
let a = list.filter(item=>item.menu_name === "resources");
|
||||||
|
if(a && a.length === 0){
|
||||||
|
history.push(`/projects/${owner}/${projectsId}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setMenuName(list);
|
||||||
|
}
|
||||||
|
},[list]);
|
||||||
|
return(
|
||||||
|
<div className="f-wrap-between mt15">
|
||||||
|
{
|
||||||
|
menuName && projectDetail ?
|
||||||
|
<ul className="headerMenu-wrapper">
|
||||||
|
{
|
||||||
|
menuName.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
<React.Fragment>
|
||||||
|
{
|
||||||
|
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>
|
||||||
|
<span>主页</span>
|
||||||
|
</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>
|
||||||
|
<span>代码库</span>
|
||||||
|
</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>
|
||||||
|
</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>
|
||||||
|
<span>合并请求</span>
|
||||||
|
{projectDetail && projectDetail.pull_requests_count ? <span className="num">{projectDetail.pull_requests_count}</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版)
|
||||||
|
{projectDetail && projectDetail.ops_count ? <span>{projectDetail.ops_count}</span> : ""}
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
{/* {
|
||||||
|
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>
|
||||||
|
</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>
|
||||||
|
</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>
|
||||||
|
<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>
|
||||||
|
<span>仓库设置</span>
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</React.Fragment>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
:
|
||||||
|
<Skeleton paragraph={false} active={true}/>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default DetailBanner;
|
|
@ -0,0 +1,63 @@
|
||||||
|
import React , { forwardRef, useEffect } from 'react';
|
||||||
|
import {Form , Modal , Input } from 'antd';
|
||||||
|
import "./sub.scss";
|
||||||
|
const { TextArea } = Input;
|
||||||
|
function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url}){
|
||||||
|
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(desc || website){
|
||||||
|
setFieldsValue({
|
||||||
|
website,desc,lesson_url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},[desc,website])
|
||||||
|
|
||||||
|
function onSure(){
|
||||||
|
validateFields((err,values)=>{
|
||||||
|
if(!err){
|
||||||
|
onCancel();
|
||||||
|
onOk(values.desc,values.website,values.lesson_url)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return(
|
||||||
|
<Modal
|
||||||
|
title={"修改信息"}
|
||||||
|
closable={false}
|
||||||
|
visible={visible}
|
||||||
|
centered
|
||||||
|
onCancel={onCancel}
|
||||||
|
onOk={onSure}
|
||||||
|
okText="确定"
|
||||||
|
cancelText="取消"
|
||||||
|
width="400px"
|
||||||
|
className={"descmodal"}
|
||||||
|
>
|
||||||
|
<Form>
|
||||||
|
<Form.Item label="仓库描述">
|
||||||
|
{getFieldDecorator("desc",{
|
||||||
|
rules:[]
|
||||||
|
})(
|
||||||
|
<TextArea placeholder="仓库描述" rows={4} maxLength={200}/>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="website">
|
||||||
|
{getFieldDecorator("website",{
|
||||||
|
rules:[]
|
||||||
|
})(
|
||||||
|
<Input placeholder="website链接"/>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="实践课程">
|
||||||
|
{getFieldDecorator("lesson_url",{
|
||||||
|
rules:[]
|
||||||
|
})(
|
||||||
|
<Input placeholder="实践课程链接"/>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Form.create()(forwardRef(UpdateDescModal));
|
|
@ -0,0 +1,23 @@
|
||||||
|
.boxPanel{
|
||||||
|
width: 1200px;
|
||||||
|
margin:0px auto;
|
||||||
|
padding:20px 0px;
|
||||||
|
min-height: 500px;
|
||||||
|
.contrbuteList{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
& > div{
|
||||||
|
width: 20%;
|
||||||
|
}
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.descmodal{
|
||||||
|
.ant-row.ant-form-item{
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.ant-col.ant-form-item-label{
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,7 +22,7 @@ function Commits({ commits , projectsId , owner }){
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(item.sha)}`} className="color-blue">浏览代码</Link>
|
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(item.sha)}`} className="color-blue">浏览代码</Link>
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
<AlignCenter className="mt15">
|
<AlignCenter className="mt15">
|
||||||
<User url={getImageUrl(`images/${item.committer && item.committer.image_url}`)} name={`${item.committer && item.committer.name}`}></User><span>:提交于{item.time_from_now}</span>
|
<User url={getImageUrl(`/${item.committer && item.committer.image_url}`)} name={`${item.committer && item.committer.name}`}></User><span>:提交于{item.time_from_now}</span>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -47,7 +47,7 @@ function Files({data,history,owner,projectsId}){
|
||||||
<span>{item.name}</span>
|
<span>{item.name}</span>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<span>
|
<span>
|
||||||
<Button className="mr20" onClick={()=>{history.push(`/projects/${owner}/${projectsId}${item.sha ? `/branch/${truncateCommitId(item.sha)}/`:"/"}tree/${item.name}`)}}>查看文件</Button>
|
<Button className="mr20" onClick={()=>{history.push(`/projects/${owner}/${projectsId}/tree/${truncateCommitId(item.sha)}/${item.name}`)}}>查看文件</Button>
|
||||||
<span className="color-green">+{item.addition}</span>
|
<span className="color-green">+{item.addition}</span>
|
||||||
<span className="color-red ml20">-{item.deletion}</span>
|
<span className="color-red ml20">-{item.deletion}</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { Popconfirm, Tag } from "antd";
|
import { Tag } from "antd";
|
||||||
|
import { AlignCenter } from '../Component/layout';
|
||||||
import { getImageUrl } from "educoder";
|
import { getImageUrl } from "educoder";
|
||||||
import "./merge.css";
|
import "./merge.css";
|
||||||
|
|
||||||
|
@ -74,13 +75,13 @@ class MergeItem extends Component {
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
className="radius"
|
className="radius"
|
||||||
src={getImageUrl(`images/${item && item.avatar_url}`)}
|
src={getImageUrl(`/${item && item.avatar_url}`)}
|
||||||
alt=""
|
alt=""
|
||||||
width="24"
|
width="24"
|
||||||
height="24"
|
height="24"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
<span>
|
<AlignCenter>
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${item && item.author_login}`}
|
to={`/users/${item && item.author_login}`}
|
||||||
className="show-user-link color-grey-8 ml5"
|
className="show-user-link color-grey-8 ml5"
|
||||||
|
@ -98,7 +99,7 @@ class MergeItem extends Component {
|
||||||
<span className="ml15">
|
<span className="ml15">
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/branch/${item.pull_request_head}`}
|
to={`/projects/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${item.pull_request_head}`}
|
||||||
className="maxW200px hide-1 ver-middle"
|
className="maxW200px hide-1 ver-middle"
|
||||||
>
|
>
|
||||||
{item.is_original
|
{item.is_original
|
||||||
|
@ -116,7 +117,7 @@ class MergeItem extends Component {
|
||||||
</span>
|
</span>
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${projectsId}/branch/${item.pull_request_base}`}
|
to={`/projects/${owner}/${projectsId}/tree/${item.pull_request_base}`}
|
||||||
className="maxW200px hide-1 ver-middle"
|
className="maxW200px hide-1 ver-middle"
|
||||||
>
|
>
|
||||||
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
|
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
|
||||||
|
@ -124,7 +125,7 @@ class MergeItem extends Component {
|
||||||
</Link>
|
</Link>
|
||||||
</Tag>
|
</Tag>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</AlignCenter>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<ul
|
<ul
|
||||||
|
|
|
@ -101,7 +101,7 @@ class MergeSubmit extends Component{
|
||||||
render: (text,item) => (
|
render: (text,item) => (
|
||||||
<span className="f-wrap-alignCenter">
|
<span className="f-wrap-alignCenter">
|
||||||
<Link to={`/users/${item.login}`} className="show-user-link">
|
<Link to={`/users/${item.login}`} className="show-user-link">
|
||||||
<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
|
<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
|
||||||
<label className="hide-1" style={{maxWidth:"75px",'vertical-align':'middle'}}>{text}</label>
|
<label className="hide-1" style={{maxWidth:"75px",'vertical-align':'middle'}}>{text}</label>
|
||||||
</Link>
|
</Link>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -305,7 +305,7 @@ class MessageCount extends Component {
|
||||||
<div className="mt15">
|
<div className="mt15">
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${data.pull_request.is_original?data.project_identifier:projectsId}/branch/${data.pull_request.head}`}
|
to={`/projects/${owner}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${data.pull_request.head}`}
|
||||||
className="ver-middle"
|
className="ver-middle"
|
||||||
>
|
>
|
||||||
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head}
|
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head}
|
||||||
|
@ -320,7 +320,7 @@ class MessageCount extends Component {
|
||||||
</span>
|
</span>
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${projectsId}/branch/${data.pull_request.base}`}
|
to={`/projects/${owner}/${projectsId}/tree/${data.pull_request.base}`}
|
||||||
className="ver-middle"
|
className="ver-middle"
|
||||||
>
|
>
|
||||||
{/* {data.pull_request.is_fork ? data.pull_request.base : `${data.pull_request.pull_request_user}:${data.pull_request.base}`} */}
|
{/* {data.pull_request.is_fork ? data.pull_request.base : `${data.pull_request.pull_request_user}:${data.pull_request.base}`} */}
|
||||||
|
@ -331,26 +331,14 @@ class MessageCount extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
<div className="mt15">
|
<div className="mt15">
|
||||||
<Link
|
<Link to={`/users/${data.issue.author_login}`} className="show-user-link">
|
||||||
to={`/users/${data.issue.author_login}`}
|
<img className="mr5" src={getImageUrl(`/${data.issue.author_picture}`)}
|
||||||
className="show-user-link"
|
alt="" width="24" height="24" style={{borderRadius:"50%"}}
|
||||||
>
|
|
||||||
<img
|
|
||||||
className="mr5"
|
|
||||||
src={getImageUrl(
|
|
||||||
`images/${data.issue.author_picture}`
|
|
||||||
)}
|
|
||||||
alt=""
|
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
<span className="ver-middle">
|
<span className="ver-middle">
|
||||||
<span className="color-grey-8 mr5">由</span>
|
<span className="color-grey-8 mr5">由</span>
|
||||||
<Link
|
<Link to={`/users/${data.issue.author_login}`} className="show-user-link color-blue">
|
||||||
to={`/users/${data.issue.author_login}`}
|
|
||||||
className="show-user-link color-blue"
|
|
||||||
>
|
|
||||||
{data.issue.author_name}
|
{data.issue.author_name}
|
||||||
</Link>
|
</Link>
|
||||||
<span className="ml5 color-grey-8">
|
<span className="ml5 color-grey-8">
|
||||||
|
|
|
@ -253,27 +253,9 @@ class merge extends Component {
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
|
|
||||||
const Paginations = (
|
|
||||||
<React.Fragment>
|
|
||||||
{search_count > limit ? (
|
|
||||||
<div className="mt30 mb50 edu-txt-center">
|
|
||||||
<Pagination
|
|
||||||
simple
|
|
||||||
defaultCurrent={page}
|
|
||||||
total={search_count}
|
|
||||||
pageSize={limit}
|
|
||||||
onChange={this.ChangePage}
|
|
||||||
></Pagination>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
<div className="main">
|
<div className="main" style={{padding:"0px"}}>
|
||||||
<div className="topWrapper" style={{borderBottom:"none"}}>
|
<div className="topWrapper" style={{borderBottom:"none",padding:"20px"}}>
|
||||||
<div className="target-detail-search">
|
<div className="target-detail-search">
|
||||||
<Search
|
<Search
|
||||||
placeholder="输入关键字搜索合并请求"
|
placeholder="输入关键字搜索合并请求"
|
||||||
|
@ -419,9 +401,21 @@ class merge extends Component {
|
||||||
{...this.props}
|
{...this.props}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
></OrderItem>
|
></OrderItem>
|
||||||
{Paginations}
|
|
||||||
</div>
|
</div>
|
||||||
):""}
|
):""}
|
||||||
|
{search_count > select_params.limit ? (
|
||||||
|
<div className="mt30 mb50 edu-txt-center">
|
||||||
|
<Pagination
|
||||||
|
simple
|
||||||
|
current={select_params.page}
|
||||||
|
total={search_count}
|
||||||
|
pageSize={select_params.limit}
|
||||||
|
onChange={this.ChangePage}
|
||||||
|
></Pagination>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
{ data && data.issues && data.issues.length === 0 ? <NoneData _html="暂时还没有相关数据!" projectsId={projectsId} owner={owner} /> :""}
|
{ data && data.issues && data.issues.length === 0 ? <NoneData _html="暂时还没有相关数据!" projectsId={projectsId} owner={owner} /> :""}
|
||||||
</Spin>
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -164,7 +164,7 @@ class Index extends Component {
|
||||||
const { projectsType } = this.props.match.params;
|
const { projectsType } = this.props.match.params;
|
||||||
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
|
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
|
||||||
const decoderPass = Base64.encode(values.password);
|
const decoderPass = Base64.encode(values.password);
|
||||||
const url = projectsType === "deposit" ? "/projects.json" : "/projects/migrate.json";
|
const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json";
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
...values,
|
...values,
|
||||||
auth_password:decoderPass,
|
auth_password:decoderPass,
|
||||||
|
@ -179,7 +179,7 @@ class Index extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpin: false
|
isSpin: false
|
||||||
})
|
})
|
||||||
this.props.showNotification(`${projectsType === "deposit" ? "托管" : "镜像"}项目创建成功!`);
|
this.props.showNotification(`${projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目创建成功!`);
|
||||||
this.props.history.push(`/projects/${owners_name}/${result.data.identifier}`);
|
this.props.history.push(`/projects/${owners_name}/${result.data.identifier}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,9 +276,9 @@ class Index extends Component {
|
||||||
mirrorCheck
|
mirrorCheck
|
||||||
} = this.state;
|
} = this.state;
|
||||||
return (
|
return (
|
||||||
<div className="main back-white">
|
<div className="main back-white" style={{padding:"0px",border:"none"}}>
|
||||||
<div className="newPanel">
|
<div className="newPanel">
|
||||||
<div className="newPanel_title">创建{projectsType === "deposit" ? "托管" : "镜像"}项目</div>
|
<div className="newPanel_title">创建{projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目</div>
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<Form>
|
<Form>
|
||||||
<div className="newPanel_content">
|
<div className="newPanel_content">
|
||||||
|
@ -303,7 +303,7 @@ class Index extends Component {
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{
|
{
|
||||||
projectsType !== "deposit" &&
|
projectsType && projectsType === "mirror" &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="镜像版本库地址"
|
label="镜像版本库地址"
|
||||||
|
@ -321,7 +321,7 @@ class Index extends Component {
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
projectsType !== "deposit" &&
|
projectsType && projectsType === "mirror" &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<p className="mt10 mb10 color-grey-3 pointer" onClick={this.changeMirrorCheck}>需要授权验证<i className={mirrorCheck?"iconfont icon-xiajiantou font-13 ml10 color-grey-8":"iconfont icon-youjiantou font-13 ml10 color-grey-8"}></i></p>
|
<p className="mt10 mb10 color-grey-3 pointer" onClick={this.changeMirrorCheck}>需要授权验证<i className={mirrorCheck?"iconfont icon-xiajiantou font-13 ml10 color-grey-8":"iconfont icon-youjiantou font-13 ml10 color-grey-8"}></i></p>
|
||||||
{
|
{
|
||||||
|
@ -428,7 +428,7 @@ class Index extends Component {
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{
|
{
|
||||||
projectsType === "deposit" &&
|
(projectsType === "deposit" || !projectsType) &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label=".gitignore"
|
label=".gitignore"
|
||||||
|
@ -482,7 +482,7 @@ class Index extends Component {
|
||||||
)}
|
)}
|
||||||
</Form.Item >
|
</Form.Item >
|
||||||
{
|
{
|
||||||
projectsType !== "deposit" &&
|
projectsType && projectsType === "mirror" &&
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="迁移类型:"
|
label="迁移类型:"
|
||||||
style={{ margin: "0px" }}
|
style={{ margin: "0px" }}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class UserSubmitComponent extends Component {
|
||||||
const { getTopCount } = this.props;
|
const { getTopCount } = this.props;
|
||||||
getTopCount && getTopCount(values.branchname);
|
getTopCount && getTopCount(values.branchname);
|
||||||
}
|
}
|
||||||
let url = `/projects/${owner}/${projectsId}${values.branchname ? `/branch/${values.branchname}`: (branch ? `/branch/${branch}` : "")}`;
|
let url = `/projects/${owner}/${projectsId}${values.branchname ? `/tree/${values.branchname}`: (branch ? `/tree/${branch}` : "")}`;
|
||||||
this.props.history.push(url);
|
this.props.history.push(url);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -89,7 +89,7 @@ class UserSubmitComponent extends Component {
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.setState({ isSpin: false });
|
this.setState({ isSpin: false });
|
||||||
if (result.data && result.data.status === 1) {
|
if (result.data && result.data.status === 1) {
|
||||||
let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/branch/${values.branchname}` : ((currentBranch || branch) ? `/branch/${currentBranch || branch}`:""))}`;
|
let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/tree/${values.branchname}` : ((currentBranch || branch) ? `/tree/${currentBranch || branch}`:""))}`;
|
||||||
this.props.history.push(url);
|
this.props.history.push(url);
|
||||||
this.props.showNotification("文件修改成功!");
|
this.props.showNotification("文件修改成功!");
|
||||||
}
|
}
|
||||||
|
@ -114,10 +114,10 @@ class UserSubmitComponent extends Component {
|
||||||
const { editor_type } = this.props;
|
const { editor_type } = this.props;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<span className="df mt30" style={{ alignItems: "center" }}>
|
<span className="df" style={{ alignItems: "center" }}>
|
||||||
<Link to={`/users/${current_user && current_user.login}`} className="show-user-link" >
|
<Link to={`/users/${current_user && current_user.login}`} className="show-user-link" >
|
||||||
<img
|
<img
|
||||||
src={getImageUrl(`images/${current_user && current_user.image_url}`)}
|
src={getImageUrl(`/${current_user && current_user.image_url}`)}
|
||||||
alt=""
|
alt=""
|
||||||
className="screwImg"
|
className="screwImg"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -61,10 +61,6 @@
|
||||||
.screwPanel .ant-radio-wrapper{
|
.screwPanel .ant-radio-wrapper{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.branchTable{
|
|
||||||
border:1px solid #eaeaea;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
.branchTable .margin-view-overlays{
|
.branchTable .margin-view-overlays{
|
||||||
border-right: 1px solid #eaeaea;
|
border-right: 1px solid #eaeaea;
|
||||||
background-color: #fbfbfb;
|
background-color: #fbfbfb;
|
||||||
|
|
|
@ -12,6 +12,13 @@ class m_editor extends Component {
|
||||||
editorValue: this.props.content,
|
editorValue: this.props.content,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
componentDidUpdate=(prevProps)=>{
|
||||||
|
if(prevProps && this.props && this.props.content !== prevProps.content){
|
||||||
|
this.setState({
|
||||||
|
editorValue:this.props.content
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
changeEditor = (editorValue) => {
|
changeEditor = (editorValue) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
editorValue,
|
editorValue,
|
||||||
|
@ -44,7 +51,7 @@ class m_editor extends Component {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div>
|
<div>
|
||||||
<div className="branchTable">
|
<div className="branchTable" style={{border:"1px solid #eee"}}>
|
||||||
<Editor
|
<Editor
|
||||||
height="400px"
|
height="400px"
|
||||||
language={language ? language : "plaintext"}
|
language={language ? language : "plaintext"}
|
||||||
|
@ -56,18 +63,19 @@ class m_editor extends Component {
|
||||||
editorWillMount={this.editorWillMount}
|
editorWillMount={this.editorWillMount}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{!readOnly && (
|
||||||
{!readOnly && (
|
<div style={{marginTop:"20px"}}>
|
||||||
<UserSubmitComponent
|
<UserSubmitComponent
|
||||||
{...this.props}
|
{...this.props}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
filepath={`${this.props.filepath}`}
|
filepath={`${this.props.filepath}`}
|
||||||
content={editorValue}
|
content={editorValue}
|
||||||
editor_type={editorType}
|
editor_type={editorType}
|
||||||
currentBranch={currentBranch}
|
currentBranch={currentBranch}
|
||||||
></UserSubmitComponent>
|
></UserSubmitComponent>
|
||||||
)}
|
</div>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ class Detail extends Component {
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
className="user_img"
|
className="user_img"
|
||||||
src={getImageUrl(`images/${data && data.author_picture}`)}
|
src={getImageUrl(`/${data && data.author_picture}`)}
|
||||||
alt=""
|
alt=""
|
||||||
width="50"
|
width="50"
|
||||||
height="50"
|
height="50"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
.screenWrap{
|
.screenWrap{
|
||||||
background:rgba(250,250,250,1);
|
background:rgba(250,250,250,1);
|
||||||
border:1px solid rgba(221,221,221,1);
|
border-top:1px solid rgba(221,221,221,1);
|
||||||
|
border-bottom:1px solid rgba(221,221,221,1);
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
@ -48,15 +49,15 @@
|
||||||
justify-content: center
|
justify-content: center
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.statusTag{
|
// .statusTag{
|
||||||
display: block;
|
// display: block;
|
||||||
height: 24px;
|
// height: 24px;
|
||||||
line-height: 24px;
|
// line-height: 24px;
|
||||||
border-radius: 4px;
|
// border-radius: 4px;
|
||||||
padding:0px 12px;
|
// padding:0px 12px;
|
||||||
color: #fff;
|
// color: #fff;
|
||||||
margin:3px 0px 0px 10px;
|
// margin:3px 0px 0px 10px;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.updateBtn{
|
.updateBtn{
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -551,6 +551,7 @@ a.issue-type-button.active:hover {
|
||||||
}
|
}
|
||||||
.item-list-right {
|
.item-list-right {
|
||||||
width: 74%;
|
width: 74%;
|
||||||
|
border:1px solid #eee;
|
||||||
}
|
}
|
||||||
.detail_edit_action {
|
.detail_edit_action {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -673,7 +674,11 @@ a.issue-type-button.active:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.display-in{
|
.display-in{
|
||||||
display: inherit;
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
.issue-form-right{
|
||||||
|
border:1px solid #eee;
|
||||||
}
|
}
|
||||||
.issue-form-right .ant-form-item{
|
.issue-form-right .ant-form-item{
|
||||||
margin-bottom: 8px !important;
|
margin-bottom: 8px !important;
|
||||||
|
|
|
@ -524,7 +524,8 @@ class order extends Component {
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="main">
|
<div className="main" style={{padding:"0px"}}>
|
||||||
|
<div style={{padding:"10px 20px 0px 20px"}}>
|
||||||
<div className="topWrapper" style={{ paddingTop: "10px" }}>
|
<div className="topWrapper" style={{ paddingTop: "10px" }}>
|
||||||
<ul className="topWrapper_type">
|
<ul className="topWrapper_type">
|
||||||
<li>
|
<li>
|
||||||
|
@ -568,6 +569,7 @@ class order extends Component {
|
||||||
<DatePicker value={end ? moment(end, 'YYYY-MM-DD') : ""} placeholder="请选择结束时间" onChange={this.changeEndTime} />
|
<DatePicker value={end ? moment(end, 'YYYY-MM-DD') : ""} placeholder="请选择结束时间" onChange={this.changeEndTime} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<div className="f-wrap-between screenWrap">
|
<div className="f-wrap-between screenWrap">
|
||||||
<div className="df">
|
<div className="df">
|
||||||
|
|
|
@ -11,7 +11,7 @@ function Collaborator(props){
|
||||||
const [ newGroupId , setNewGroupId] = useState(undefined);
|
const [ newGroupId , setNewGroupId] = useState(undefined);
|
||||||
const {projectsId ,owner} = props.match.params;
|
const {projectsId ,owner} = props.match.params;
|
||||||
|
|
||||||
const author = props.projectDetail && props.projectDetail.author;
|
const author = props && props.projectDetail && props.projectDetail.author;
|
||||||
|
|
||||||
function getID(id){
|
function getID(id){
|
||||||
setNewId(id);
|
setNewId(id);
|
||||||
|
@ -26,8 +26,8 @@ function Collaborator(props){
|
||||||
{
|
{
|
||||||
author && author.type === "Organization" ?
|
author && author.type === "Organization" ?
|
||||||
<span>
|
<span>
|
||||||
<span style={{cursor:"pointer"}} className={nav === "1" ? "font-18 text-black color-blue":"font-18 text-black"} onClick={()=>setNav("1")}>协作者管理</span>
|
<span style={{cursor:"pointer"}} className={nav === "1" ? "font-18 text-black color-blue":"font-18 text-black"} onClick={()=>{setNav("1");setNewId(undefined)}}>协作者管理</span>
|
||||||
<span style={{cursor:"pointer"}} className={nav === "2" ? "font-18 text-black ml30 color-blue":"font-18 text-black ml30"} onClick={()=>setNav("2")}>团队管理</span>
|
<span style={{cursor:"pointer"}} className={nav === "2" ? "font-18 text-black ml30 color-blue":"font-18 text-black ml30"} onClick={()=>{setNav("2");setNewId(undefined)}}>团队管理</span>
|
||||||
</span>
|
</span>
|
||||||
:
|
:
|
||||||
<span className="font-18 text-black">协作者管理</span>
|
<span className="font-18 text-black">协作者管理</span>
|
||||||
|
@ -42,7 +42,7 @@ function Collaborator(props){
|
||||||
<div>
|
<div>
|
||||||
{
|
{
|
||||||
nav === "1" ?
|
nav === "1" ?
|
||||||
<Member newId={newId} projectsId={projectsId} owner={owner} project_id={props.project_id} author={props.author} showNotification={props.showNotification}/>
|
<Member newId={newId} projectsId={projectsId} owner={owner} project_id={props.project_id} author={props.projectDetail && props.projectDetail.author} showNotification={props.showNotification}/>
|
||||||
:
|
:
|
||||||
<Group owner={owner} projectsId={projectsId} newGroupId={newGroupId}/>
|
<Group owner={owner} projectsId={projectsId} newGroupId={newGroupId}/>
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,107 +1,139 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from "react";
|
||||||
import { Table , Button , Popconfirm , Pagination } from 'antd';
|
import { Table, Button, Popconfirm, Pagination } from "antd";
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from "react-router-dom";
|
||||||
import axios from 'axios';
|
import axios from "axios";
|
||||||
|
|
||||||
const roles = {
|
const roles = {
|
||||||
owner:"所有者",
|
owner: "所有者",
|
||||||
admin:"管理者",
|
admin: "管理者",
|
||||||
write:"开发者",
|
write: "开发者",
|
||||||
read:"报告者"
|
read: "报告者",
|
||||||
}
|
};
|
||||||
const limit = 15;
|
const limit = 15;
|
||||||
function CollaboratorGroup({newGroupId,owner , projectsId}){
|
function CollaboratorGroup({ newGroupId, owner, projectsId }) {
|
||||||
const [ list , setList ] = useState(undefined);
|
const [list, setList] = useState(undefined);
|
||||||
const [ isSpin , setIsSpin ] = useState(false);
|
const [isSpin, setIsSpin] = useState(true);
|
||||||
const [ page , setPage ] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const [ total , setTotal ] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(() => {
|
||||||
getData();
|
getData();
|
||||||
},[])
|
}, []);
|
||||||
|
|
||||||
function getData(){
|
function getData() {
|
||||||
const url = `/${owner}/${projectsId}/teams.json`;
|
const url = `/${owner}/${projectsId}/teams.json`;
|
||||||
axios.get(url,{
|
axios
|
||||||
params:{
|
.get(url, {
|
||||||
page,limit
|
params: {
|
||||||
}
|
page,
|
||||||
}).then(result=>{
|
limit,
|
||||||
if(result && result.data){
|
},
|
||||||
setList(result.data.teams);
|
})
|
||||||
setTotal(result.data.total_count);
|
.then((result) => {
|
||||||
}
|
if (result && result.data) {
|
||||||
}).catch(error=>{})
|
setList(result.data.teams);
|
||||||
|
setTotal(result.data.total_count);
|
||||||
|
setIsSpin(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(() => {
|
||||||
if(newGroupId){
|
if (newGroupId) {
|
||||||
addGroup(newGroupId);
|
addGroup(newGroupId);
|
||||||
}
|
}
|
||||||
},[newGroupId])
|
}, [newGroupId]);
|
||||||
// 添加团队
|
// 添加团队
|
||||||
function addGroup(id){
|
function addGroup(id) {
|
||||||
const url = `/${owner}/${projectsId}/teams.json`;
|
const url = `/${owner}/${projectsId}/teams.json`;
|
||||||
axios.post(url,{
|
axios
|
||||||
team_id:id
|
.post(url, {
|
||||||
}).then(result=>{
|
team_id: id,
|
||||||
if(result && result.data){
|
})
|
||||||
getData();
|
.then((result) => {
|
||||||
}
|
if (result && result.data) {
|
||||||
}).catch(error=>{})
|
getData();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除团队
|
// 删除团队
|
||||||
function deleteGroup(id){
|
function deleteGroup(id) {
|
||||||
const url = `/${owner}/${projectsId}/teams/${id}.json`;
|
const url = `/${owner}/${projectsId}/teams/${id}.json`;
|
||||||
axios.delete(url).then(result=>{
|
axios
|
||||||
if(result && result.data){
|
.delete(url)
|
||||||
getData();
|
.then((result) => {
|
||||||
}
|
if (result && result.data) {
|
||||||
}).catch(error=>{})
|
getData();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title:"团队名",
|
title: "团队名",
|
||||||
dataIndex:"name",
|
dataIndex: "name",
|
||||||
render:(value,item)=>{
|
render: (value, item) => {
|
||||||
return <Link to={`/organize/${owner}/group/${item.id}`}>{value}</Link>
|
return <Link to={`/organize/${owner}/group/${item.id}`}>{value}</Link>;
|
||||||
}
|
},
|
||||||
},{
|
},
|
||||||
title:"权限",
|
{
|
||||||
dataIndex:"authorize",
|
title: "权限",
|
||||||
width:"20%",
|
dataIndex: "authorize",
|
||||||
render:(value,item)=>{
|
width: "20%",
|
||||||
return roles[value]
|
render: (value, item) => {
|
||||||
}
|
return roles[value];
|
||||||
},{
|
},
|
||||||
title:"操作",
|
},
|
||||||
dataIndex:"operation",
|
{
|
||||||
width:"25%",
|
title: "操作",
|
||||||
render:(value,item)=>{
|
dataIndex: "operation",
|
||||||
return(
|
width: "25%",
|
||||||
item.can_remove && <Popconfirm title={`确定要删除‘${item.name}’团队?`} okText="是" cancelText="否" onConfirm={()=>{deleteGroup(item.id)}}><Button type="danger">删除</Button></Popconfirm>
|
render: (value, item) => {
|
||||||
)
|
return (
|
||||||
}
|
item.can_remove && (
|
||||||
}
|
<Popconfirm
|
||||||
]
|
title={`确定要删除‘${item.name}’团队?`}
|
||||||
return(
|
okText="是"
|
||||||
<div className="padding20-30" style={{minHeight:"400px"}}>
|
cancelText="否"
|
||||||
|
onConfirm={() => {
|
||||||
|
deleteGroup(item.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button type="danger">删除</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<div className="padding20-30" style={{ minHeight: "400px" }}>
|
||||||
<Table
|
<Table
|
||||||
dataSource={list}
|
dataSource={list}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
loading={isSpin}
|
loading={isSpin}
|
||||||
></Table>
|
></Table>
|
||||||
{
|
{total > limit ? (
|
||||||
total > limit ?
|
|
||||||
<div className="pb20 mt20 edu-txt-center">
|
<div className="pb20 mt20 edu-txt-center">
|
||||||
<Pagination simple current={page}total={total} pageSize={limit} onChange={(page)=>{setPage(page)}}/>
|
<Pagination
|
||||||
|
simple
|
||||||
|
current={page}
|
||||||
|
total={total}
|
||||||
|
pageSize={limit}
|
||||||
|
onChange={(page) => {
|
||||||
|
setPage(page);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
:""
|
) : (
|
||||||
}
|
""
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
export default CollaboratorGroup;
|
export default CollaboratorGroup;
|
|
@ -15,13 +15,11 @@ const MENU_LIST = [
|
||||||
function CollaboratorMember({projectsId,owner,project_id,author,showNotification,newId}){
|
function CollaboratorMember({projectsId,owner,project_id,author,showNotification,newId}){
|
||||||
const [ roleName , setRoleName ] = useState(undefined);
|
const [ roleName , setRoleName ] = useState(undefined);
|
||||||
const [ search , setSearch ] = useState(undefined);
|
const [ search , setSearch ] = useState(undefined);
|
||||||
const [ page , setPage ] = useState(undefined);
|
const [ page , setPage ] = useState(1);
|
||||||
const [ isSpin , setIsSpin ] = useState(false);
|
const [ isSpin , setIsSpin ] = useState(true);
|
||||||
const [ role , setRole ] = useState(undefined);
|
const [ role , setRole ] = useState(undefined);
|
||||||
const [ listData , setListData ] = useState(undefined);
|
const [ listData , setListData ] = useState(undefined);
|
||||||
const [ total , setTotal ] = useState(0);
|
const [ total , setTotal ] = useState(0);
|
||||||
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(newId){
|
if(newId){
|
||||||
addCollaborator(newId);
|
addCollaborator(newId);
|
||||||
|
@ -188,7 +186,7 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
|
||||||
className="show-user-link"
|
className="show-user-link"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={getImageUrl(`images/${text}`)}
|
src={getImageUrl(`/${text}`)}
|
||||||
alt=""
|
alt=""
|
||||||
width="32px"
|
width="32px"
|
||||||
height="32px"
|
height="32px"
|
||||||
|
@ -261,13 +259,13 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
|
||||||
</div>
|
</div>
|
||||||
</Spin>
|
</Spin>
|
||||||
{total > LIMIT ?
|
{total > LIMIT ?
|
||||||
<div className="edu-txt-center mt20 mb20">
|
<div className="edu-txt-center mt20 pb20">
|
||||||
<Pagination
|
<Pagination
|
||||||
showQuickJumper
|
simple
|
||||||
pageSize={LIMIT}
|
pageSize={LIMIT}
|
||||||
current={page}
|
current={page}
|
||||||
total={total}
|
total={total}
|
||||||
onChange={()=>setPage(page)}
|
onChange={(page)=>setPage(page)}
|
||||||
></Pagination>
|
></Pagination>
|
||||||
</div>
|
</div>
|
||||||
:""}
|
:""}
|
||||||
|
|
|
@ -82,7 +82,7 @@ class Index extends Component {
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting/tags`} className="w-100">
|
<Link to={`/projects/${owner}/${projectsId}/setting/tags`} className="w-100">
|
||||||
<i className="iconfont icon-biaoqian3 font-18 mr10"></i>
|
<i className="iconfont icon-biaoqian3 font-18 mr10 color-grey-6"></i>
|
||||||
项目标签
|
项目标签
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
|
@ -103,7 +103,7 @@ class Index extends Component {
|
||||||
</ul>
|
</ul>
|
||||||
</Short>
|
</Short>
|
||||||
<Long>
|
<Long>
|
||||||
<Gap>
|
<Gap className="list-r-Info">
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
{/* 协作者 */}
|
{/* 协作者 */}
|
||||||
<Route
|
<Route
|
||||||
|
|
|
@ -1,13 +1,22 @@
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Form, Input, Checkbox, Select } from "antd";
|
import { Form, Input, Checkbox, Select , Spin } from "antd";
|
||||||
import Title from '../Component/Title';
|
import Title from '../Component/Title';
|
||||||
import Mirror from './SettingMirror';
|
|
||||||
import {WhiteBack} from '../Component/layout';
|
import {WhiteBack} from '../Component/layout';
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import "./setting.scss";
|
import "./setting.scss";
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
|
const menu = [
|
||||||
|
{name:"主页",index:"home"},
|
||||||
|
{name:"代码库",index:"code"},
|
||||||
|
{name:"易修 (Issue)",index:"issues"},
|
||||||
|
{name:"合并请求",index:"pulls"},
|
||||||
|
{name:"工作流(beta版)",index:"devops"},
|
||||||
|
// {name:"资源库",index:"resources"},
|
||||||
|
{name:"里程碑",index:"versions"},
|
||||||
|
{name:"动态",index:"activity"},
|
||||||
|
]
|
||||||
class Setting extends Component {
|
class Setting extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -15,6 +24,8 @@ class Setting extends Component {
|
||||||
CategoryList: undefined,
|
CategoryList: undefined,
|
||||||
LanguageList: undefined,
|
LanguageList: undefined,
|
||||||
private_check: undefined,
|
private_check: undefined,
|
||||||
|
loading:true,
|
||||||
|
project_units:['home',"activity","code"]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,11 +62,18 @@ class Setting extends Component {
|
||||||
.get(url)
|
.get(url)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
const { project_units } = this.state;
|
||||||
|
let units = result.data.project_units;
|
||||||
|
units.push(...project_units);
|
||||||
|
|
||||||
this.props.form.setFieldsValue({
|
this.props.form.setFieldsValue({
|
||||||
...result.data,
|
...result.data,
|
||||||
|
project_units:units
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
private_check: result.data.private,
|
private_check: result.data.private,
|
||||||
|
loading:false,
|
||||||
|
project_units:units
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -99,31 +117,50 @@ class Setting extends Component {
|
||||||
resetSetting = () => {
|
resetSetting = () => {
|
||||||
this.props.form.validateFields((err, values) => {
|
this.props.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
|
this.setState({
|
||||||
|
loading:true
|
||||||
|
})
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
|
const navUrl = `/${owner}/${projectsId}/project_units.json`;
|
||||||
|
|
||||||
const { private_check } = this.state;
|
let unit = values.project_units.filter(item => (item !== "home" && item!== "activity" && item!== "code"));
|
||||||
const url = `/${owner}/${projectsId}.json`;
|
axios.post(navUrl, {
|
||||||
axios
|
unit_types:unit
|
||||||
.put(url, {
|
}).then((result) => {
|
||||||
name: values.project_name,
|
if (result) {
|
||||||
description: values.project_description,
|
this.update(values);
|
||||||
private: private_check,
|
}
|
||||||
...values,
|
}).catch(error=>{})
|
||||||
})
|
|
||||||
.then((result) => {
|
|
||||||
if (result) {
|
|
||||||
this.props.showNotification(`仓库信息修改成功!`);
|
|
||||||
const { getDetail } = this.props;
|
|
||||||
getDetail && getDetail();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
update=(values)=>{
|
||||||
|
const { projectsId , owner } = this.props.match.params;
|
||||||
|
const { private_check } = this.state;
|
||||||
|
const url = `/${owner}/${projectsId}.json`;
|
||||||
|
axios.put(url, {
|
||||||
|
name: values.project_name,
|
||||||
|
description: values.project_description,
|
||||||
|
private: private_check,
|
||||||
|
...values,
|
||||||
|
}).then((result) => {
|
||||||
|
if (result) {
|
||||||
|
this.props.showNotification(`仓库信息修改成功!`);
|
||||||
|
const { getDetail } = this.props;
|
||||||
|
getDetail && getDetail();
|
||||||
|
this.setState({
|
||||||
|
loading:false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
this.setState({
|
||||||
|
loading:false
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 删除本仓库
|
// 删除本仓库
|
||||||
deleteProject = () => {
|
deleteProject = () => {
|
||||||
this.props.confirm({
|
this.props.confirm({
|
||||||
|
@ -152,77 +189,97 @@ class Setting extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { getFieldDecorator } = this.props.form;
|
const { getFieldDecorator } = this.props.form;
|
||||||
|
|
||||||
const { CategoryList, LanguageList, private_check } = this.state;
|
const { CategoryList, LanguageList, private_check ,loading } = this.state;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<WhiteBack style={{paddingBottom:"20px"}}>
|
<Spin spinning={loading}>
|
||||||
<Title>基本设置</Title>
|
<WhiteBack>
|
||||||
<Form className="baseForm">
|
<Title>基本设置</Title>
|
||||||
<Form.Item label="项目名称">
|
<Form className="baseForm">
|
||||||
{getFieldDecorator("project_name", {
|
<Form.Item label="项目名称">
|
||||||
rules: [
|
{getFieldDecorator("project_name", {
|
||||||
{
|
rules: [
|
||||||
required: true,
|
{
|
||||||
message: "请输入项目名称",
|
required: true,
|
||||||
},
|
message: "请输入项目名称",
|
||||||
],
|
},
|
||||||
})(<Input placeholder="请输入项目名称" />)}
|
],
|
||||||
</Form.Item>
|
})(<Input placeholder="请输入项目名称" />)}
|
||||||
<div className="df" style={{ alignItems: "center" }}>
|
</Form.Item>
|
||||||
<span className="mr20 mb15 font-16">可见性</span>
|
<div className="df" style={{ alignItems: "center" }}>
|
||||||
<Form.Item label="">
|
<span className="mr20 mb15 font-16">可见性</span>
|
||||||
{getFieldDecorator("private", {
|
<Form.Item label="">
|
||||||
|
{getFieldDecorator("private", {
|
||||||
|
rules: [],
|
||||||
|
})(
|
||||||
|
<Checkbox
|
||||||
|
checked={private_check}
|
||||||
|
onChange={this.changePrivate}
|
||||||
|
>
|
||||||
|
将仓库设为私有
|
||||||
|
</Checkbox>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
<Form.Item label="仓库描述">
|
||||||
|
{getFieldDecorator("project_description", {
|
||||||
rules: [],
|
rules: [],
|
||||||
})(
|
})(
|
||||||
<Checkbox
|
<TextArea
|
||||||
checked={private_check}
|
placeholder="请输入仓库描述"
|
||||||
onChange={this.changePrivate}
|
style={{ height: "80px" }} maxLength={200}
|
||||||
>
|
/>
|
||||||
将仓库设为私有
|
|
||||||
</Checkbox>
|
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
<Form.Item label="项目类别">
|
||||||
<Form.Item label="仓库描述">
|
{getFieldDecorator("project_category_id", {
|
||||||
{getFieldDecorator("project_description", {
|
rules: [
|
||||||
rules: [],
|
{
|
||||||
})(
|
required: true,
|
||||||
<TextArea
|
message: "请选择大类别",
|
||||||
placeholder="请输入仓库描述"
|
},
|
||||||
style={{ height: "80px" }}
|
],
|
||||||
/>
|
})(<Select>{CategoryList}</Select>)}
|
||||||
)}
|
</Form.Item>
|
||||||
</Form.Item>
|
<Form.Item label="项目语言">
|
||||||
<Form.Item label="项目类别">
|
{getFieldDecorator("project_language_id", {
|
||||||
{getFieldDecorator("project_category_id", {
|
rules: [
|
||||||
rules: [
|
{
|
||||||
{
|
required: true,
|
||||||
required: true,
|
message: "请选择项目语言",
|
||||||
message: "请选择大类别",
|
},
|
||||||
},
|
],
|
||||||
],
|
})(<Select>{LanguageList}</Select>)}
|
||||||
})(<Select>{CategoryList}</Select>)}
|
</Form.Item>
|
||||||
</Form.Item>
|
<Form.Item label="项目导航">
|
||||||
<Form.Item label="项目语言">
|
{getFieldDecorator("project_units", {
|
||||||
{getFieldDecorator("project_language_id", {
|
rules: [],
|
||||||
rules: [
|
})(
|
||||||
{
|
<Checkbox.Group>
|
||||||
required: true,
|
{
|
||||||
message: "请选择项目语言",
|
menu.map((item,key)=>{
|
||||||
},
|
return(
|
||||||
],
|
<Checkbox
|
||||||
})(<Select>{LanguageList}</Select>)}
|
key={key}
|
||||||
</Form.Item>
|
value={item.index}
|
||||||
<p className="clearfix">
|
disabled={item.index === "home" || item.index === "activity" || item.index === "code"}
|
||||||
<a className="submitBtn" onClick={this.resetSetting}>
|
>{item.name}</Checkbox>
|
||||||
更新仓库设置
|
)
|
||||||
</a>
|
})
|
||||||
</p>
|
}
|
||||||
</Form>
|
</Checkbox.Group>
|
||||||
{/* 镜像设置部分,暂无接口,先不显示 */}
|
)}
|
||||||
{/* <Mirror /> */}
|
</Form.Item>
|
||||||
</WhiteBack>
|
<p className="clearfix">
|
||||||
<WhiteBack className="dangerousBox mb20">
|
<a className="submitBtn" onClick={this.resetSetting}>
|
||||||
|
更新仓库设置
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</Form>
|
||||||
|
{/* 镜像设置部分,暂无接口,先不显示 */}
|
||||||
|
{/* <Mirror /> */}
|
||||||
|
</WhiteBack>
|
||||||
|
<WhiteBack className="dangerousBox mb20">
|
||||||
<div>
|
<div>
|
||||||
<div className="dangerousTitle">危险操作区</div>
|
<div className="dangerousTitle">危险操作区</div>
|
||||||
<div className="flex-a-center padding15-10">
|
<div className="flex-a-center padding15-10">
|
||||||
|
@ -239,6 +296,7 @@ class Setting extends Component {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</WhiteBack>
|
</WhiteBack>
|
||||||
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,7 @@
|
||||||
.dangerousBox{
|
.dangerousBox{
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
padding:20px;
|
padding:20px;
|
||||||
|
border-top: 1px solid #eee;
|
||||||
&>div{
|
&>div{
|
||||||
border:1px solid #efc16b;
|
border:1px solid #efc16b;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
import React , { forwardRef, useEffect } from 'react';
|
||||||
|
import { Modal , Form , Input } from 'antd';
|
||||||
|
|
||||||
|
function AddTag({form , visible , onCancel ,onOk}){
|
||||||
|
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
setFieldsValue({tagName:undefined})
|
||||||
|
},[visible])
|
||||||
|
|
||||||
|
function submit(){
|
||||||
|
validateFields((error,values)=>{
|
||||||
|
if(!error){
|
||||||
|
onOk(values);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 5 },
|
||||||
|
wrapperCol: { span: 18 },
|
||||||
|
};
|
||||||
|
return(
|
||||||
|
<Modal
|
||||||
|
title={"新增标签"}
|
||||||
|
closable={false}
|
||||||
|
visible={visible}
|
||||||
|
onCancel={onCancel}
|
||||||
|
onOk={submit}
|
||||||
|
cancelText="取消"
|
||||||
|
okText="确定"
|
||||||
|
width="400px"
|
||||||
|
centered
|
||||||
|
>
|
||||||
|
<Form {...layout}>
|
||||||
|
<Form.Item label="标签名">
|
||||||
|
{getFieldDecorator("tagName",{
|
||||||
|
rules:[{required:true,message:"请输入标签名"}]
|
||||||
|
})(
|
||||||
|
<Input placeholder="请输入标签名" width="200px" autoComplete="off" />
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
export default Form.create()(forwardRef(AddTag));
|
|
@ -0,0 +1,287 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import './Index.scss';
|
||||||
|
import { AlignCenter, Blueback , FlexAJ } from '../Component/layout';
|
||||||
|
import { Dropdown, Input , Menu , Pagination, Spin , Popconfirm, Button } from 'antd';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import UploadSource from './UploadSource';
|
||||||
|
import AddTag from './AddTag';
|
||||||
|
import { getImageUrl } from 'educoder';
|
||||||
|
import Nodata from '../Nodata';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const { Search } = Input;
|
||||||
|
const sort = [
|
||||||
|
"按上传时间排序",
|
||||||
|
"按下载次数排序"
|
||||||
|
]
|
||||||
|
const limit = 15;
|
||||||
|
const https = 'https://testfiles.trustie.net';
|
||||||
|
function Index(props){
|
||||||
|
const [ sortValue , setSortValue ] = useState(0);
|
||||||
|
const [ page , setPage ] = useState(1);
|
||||||
|
const [ total , setTotal ] = useState(0);
|
||||||
|
const [ search , setSearch ] = useState(undefined);
|
||||||
|
const [ data , setData ] = useState(undefined);
|
||||||
|
const [ isSpin , setIsSpin ] = useState(true);
|
||||||
|
const [ error , setError ] = useState(false);
|
||||||
|
const [ attachments , setAttachments ] = useState(undefined);
|
||||||
|
|
||||||
|
const [ id , setId ] = useState(undefined);
|
||||||
|
|
||||||
|
const [ visible , setVisible ] = useState(false);
|
||||||
|
const [ addVisible , setAddVisible ] = useState(false);
|
||||||
|
|
||||||
|
const repo_id = props.projectDetail && props.projectDetail.repo_id;
|
||||||
|
const owner = props.match.params.owner;
|
||||||
|
const current_user = props.current_user;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(owner && repo_id){
|
||||||
|
setIsSpin(true);
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},[repo_id,owner,search,sortValue,page])
|
||||||
|
|
||||||
|
function getData(){
|
||||||
|
const url = https +`/api/project/achievement/`;
|
||||||
|
axios.get(url,{
|
||||||
|
params:{
|
||||||
|
projectId:repo_id,
|
||||||
|
curPage:page,
|
||||||
|
pageSize:limit,
|
||||||
|
name:search,
|
||||||
|
sort:sortValue+1,
|
||||||
|
}
|
||||||
|
}).then(result=>{
|
||||||
|
if(result && result.data){
|
||||||
|
setData(result.data.data.rows);
|
||||||
|
setTotal(result.data.data.total);
|
||||||
|
setIsSpin(false);
|
||||||
|
setError(false);
|
||||||
|
}
|
||||||
|
}).catch(error=>{setIsSpin(false);setError(true);})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
function onSearch(value){
|
||||||
|
setSearch(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 切换排序方式
|
||||||
|
function changeSort(e,index){
|
||||||
|
setSortValue(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const menu=(
|
||||||
|
<Menu>
|
||||||
|
{
|
||||||
|
sort && sort.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
<Menu.Item onClick={(e)=>changeSort(e,key)} value={key} className={key=== sortValue ?"color-blue":""}>{item}</Menu.Item>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</Menu>
|
||||||
|
)
|
||||||
|
|
||||||
|
function listmenu(id,attachments,isPublic){
|
||||||
|
return(
|
||||||
|
<Menu>
|
||||||
|
<Menu.Item onClick={()=>{setId(id);setVisible(true);setAttachments(attachments)}}>更新版本</Menu.Item>
|
||||||
|
<Menu.Item onClick={()=>changeStatus(id,isPublic===1?0:1)}>{isPublic === 1 ? "设为私有":"设为公开"}</Menu.Item>
|
||||||
|
<Menu.Item onClick={()=>deleteSourceFunc(id)}>删除资源</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// 更细私有状态
|
||||||
|
function changeStatus(id,isPublic){
|
||||||
|
const url = https+`/api/project/achievement/updateStatus`;
|
||||||
|
axios.put(url,{
|
||||||
|
id,status:isPublic
|
||||||
|
}).then(result=>{
|
||||||
|
if(result && result.data){
|
||||||
|
props.showNotification(`资源${isPublic === 1 ? "设为公开":"设为私有"}成功!`);
|
||||||
|
setIsSpin(true);
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
}).catch({})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除资源方法
|
||||||
|
function deleteSourceFunc(id){
|
||||||
|
props.confirm({
|
||||||
|
content: "是否确认删除所选资源文件?",
|
||||||
|
onOk: () => {
|
||||||
|
const url = https + `/api/project/achievement/${id}`;
|
||||||
|
axios.delete(url).then(result=>{
|
||||||
|
if(result && result.data && result.data.code === "1"){
|
||||||
|
props.showNotification("资源删除成功");
|
||||||
|
setIsSpin(true);
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 上传资源成功
|
||||||
|
function onOk(){
|
||||||
|
setVisible(false);
|
||||||
|
setIsSpin(true);
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认删除标签
|
||||||
|
function removeTagFunc(id,tag){
|
||||||
|
const url = https + `/api/project/achievement/deleteTag`;
|
||||||
|
axios.delete(url,{
|
||||||
|
params:{id,tagName:tag}
|
||||||
|
}).then(result=>{
|
||||||
|
if(result && result.data){
|
||||||
|
props.showNotification("标签删除成功");
|
||||||
|
setIsSpin(true);
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
}).then(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
function addPanel(id){
|
||||||
|
setAddVisible(true);
|
||||||
|
setId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onCancelAdd(){
|
||||||
|
setId(undefined);
|
||||||
|
setAddVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加标签
|
||||||
|
function sureAddTag(values){
|
||||||
|
const url = https+`/api/project/achievement/addTag?id=`+id+`&tagName=`+values.tagName;
|
||||||
|
axios.put(url).then(result=>{
|
||||||
|
if(result){
|
||||||
|
setId(undefined);
|
||||||
|
setAddVisible(false);
|
||||||
|
setIsSpin(true);
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div className="sourcePanel">
|
||||||
|
<AddTag
|
||||||
|
visible={addVisible}
|
||||||
|
onCancel={onCancelAdd}
|
||||||
|
onOk={sureAddTag}
|
||||||
|
/>
|
||||||
|
<UploadSource
|
||||||
|
visible={visible}
|
||||||
|
onCancel={()=>setVisible(false)}
|
||||||
|
onOk={onOk}
|
||||||
|
showNotification={props.showNotification}
|
||||||
|
owner={owner}
|
||||||
|
projectsId={repo_id}
|
||||||
|
id={id}
|
||||||
|
attachments={attachments}
|
||||||
|
/>
|
||||||
|
<div className="headtitle">
|
||||||
|
<FlexAJ>
|
||||||
|
<span className="font-18">资源库{total ? <span>({total})</span>:""}</span>
|
||||||
|
{ current_user && current_user.login && (props.projectDetail && props.projectDetail.permission) ?
|
||||||
|
<Blueback onClick={()=>{setId(undefined);setVisible(true);}}>上传资源</Blueback>:""
|
||||||
|
}
|
||||||
|
</FlexAJ>
|
||||||
|
</div>
|
||||||
|
<FlexAJ className="subHeadtitle">
|
||||||
|
<Search
|
||||||
|
placeholder="在项目内搜索资源"
|
||||||
|
onSearch={onSearch}
|
||||||
|
allowClear
|
||||||
|
enterButton="搜索"
|
||||||
|
width="220px"
|
||||||
|
/>
|
||||||
|
<Dropdown overlay={menu} placement="bottomRight">
|
||||||
|
<span className="color-grey-9">{sort[sortValue]}<i className="iconfont icon-sanjiaoxing-down font-16 color-grey-9 ml3"></i></span>
|
||||||
|
</Dropdown>
|
||||||
|
</FlexAJ>
|
||||||
|
<Spin spinning={isSpin}>
|
||||||
|
<div className="bodycontent">
|
||||||
|
{
|
||||||
|
data && data.length> 0 &&
|
||||||
|
<ul className="bodycontentul">
|
||||||
|
{
|
||||||
|
data.map((item,key)=>{
|
||||||
|
return(
|
||||||
|
<li>
|
||||||
|
<Link to= {`/users/${item.login}`} className="infoImg"><img src={getImageUrl(`/${item.imageUrl}`)} alt="" /></Link>
|
||||||
|
<div style={{flex:'1',width:"0"}}>
|
||||||
|
<FlexAJ>
|
||||||
|
<AlignCenter>
|
||||||
|
<a href={https+`/busiAttachments/download/${item.attachId}`} download className="infoname">{item.fileName}</a>
|
||||||
|
<a href={https + `/busiAttachments/view/${item.attachId}`}><i className="iconfont icon-shenqinggongkai font-15 ml10 color-grey-9"></i></a>
|
||||||
|
{item.isPublic === 0 && <span className="privateTip">私有</span>}
|
||||||
|
</AlignCenter>
|
||||||
|
{ current_user && current_user.login &&
|
||||||
|
<Dropdown overlay={()=>listmenu(item.id,item.attachments,item.isPublic)} placement={'bottomRight'}>
|
||||||
|
<i className="iconfont icon-gengduo1 color-grey-6"></i>
|
||||||
|
</Dropdown>
|
||||||
|
}
|
||||||
|
</FlexAJ>
|
||||||
|
<p className="infos">
|
||||||
|
<span>上传时间:<span>{item.uploadTime}</span></span>
|
||||||
|
<span>文件大小:<span>{item.fileSize}</span></span>
|
||||||
|
<span>下载:<span>{item.download}</span></span>
|
||||||
|
</p>
|
||||||
|
<p className="infodesc task-hide-2">{item.remark}</p>
|
||||||
|
<div className="infotag">
|
||||||
|
{
|
||||||
|
item.tags && item.tags.length>0 && item.tags.map((i,k)=>{
|
||||||
|
return(
|
||||||
|
<span>{i}
|
||||||
|
{
|
||||||
|
current_user && (current_user.login === item.login) ?
|
||||||
|
<Popconfirm title="确定要删除当前标签?" onConfirm={()=>removeTagFunc(item.id,i)} okText="是" cancelText="否">
|
||||||
|
<i className="iconfont icon-guanbi font-12 ml2"></i>
|
||||||
|
</Popconfirm>:""
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
{
|
||||||
|
current_user && (current_user.login === item.login) &&
|
||||||
|
<a className="color-blue font-12" onClick={()=>addPanel(item.id)} style={{height:"20px",lineHeight:"20px"}}>+新增标签</a>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
}
|
||||||
|
{
|
||||||
|
((data && data.length === 0) || error) && <Nodata _html="暂无数据"/>
|
||||||
|
}
|
||||||
|
{
|
||||||
|
total > limit &&
|
||||||
|
<div className="pt20 pb20 edu-txt-center">
|
||||||
|
<Pagination
|
||||||
|
simple
|
||||||
|
current={page}
|
||||||
|
pageSize={limit}
|
||||||
|
total={total}
|
||||||
|
onChange={(p)=>{setPage(p)}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</Spin>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Index;
|
|
@ -0,0 +1,109 @@
|
||||||
|
.sourcePanel{
|
||||||
|
width: 1200px;
|
||||||
|
margin: 20px auto;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 2px;
|
||||||
|
box-shadow: 0px 0px 4px rgba(0,0,0,0.1);
|
||||||
|
.headtitle{
|
||||||
|
padding:15px 20px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
.subHeadtitle{
|
||||||
|
padding:15px 20px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
.ant-input-group-wrapper{
|
||||||
|
width:320px;
|
||||||
|
.ant-btn.ant-input-search-button{
|
||||||
|
margin: 0px;
|
||||||
|
margin-top: -1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bodycontent{
|
||||||
|
padding:0px 20px;
|
||||||
|
min-height: 500px;
|
||||||
|
& > ul.bodycontentul > li{
|
||||||
|
display: flex;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
padding:20px 0px;
|
||||||
|
align-items: flex-start;
|
||||||
|
&:last-child{
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
.infoImg{
|
||||||
|
img{
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
.infoname{
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.privateTip{
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-left: 10px;
|
||||||
|
background-color: orange;
|
||||||
|
height: 18px;
|
||||||
|
line-height: 18px;
|
||||||
|
padding:0px 3px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.infos{
|
||||||
|
& > span{
|
||||||
|
margin-right: 20px;
|
||||||
|
color: #999;
|
||||||
|
& >span{
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.infodesc{
|
||||||
|
color: #666;
|
||||||
|
line-height: 20px;
|
||||||
|
margin:5px 0px!important;
|
||||||
|
}
|
||||||
|
.infotag{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
span{
|
||||||
|
display: block;
|
||||||
|
padding:0px 4px;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-right: 10px;
|
||||||
|
border: 1px solid #f8df8c;
|
||||||
|
background: #fffce6;
|
||||||
|
color: #0d90c3;
|
||||||
|
border-radius: 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.versionTable{
|
||||||
|
.currentTip{
|
||||||
|
display: block;
|
||||||
|
padding:0px 3px;
|
||||||
|
border-radius: 2px;
|
||||||
|
border:1px solid #68c7ec;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #68c7ec;
|
||||||
|
height: 18px;
|
||||||
|
line-height: 18px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
.ant-table-body{
|
||||||
|
margin:0px!important;
|
||||||
|
thead{
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
thead >tr >th,tbody > tr > td{
|
||||||
|
padding:4px 5px!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { Upload, Button } from 'antd';
|
||||||
|
import { appendFileSizeToUploadFileAll } from 'educoder';
|
||||||
|
|
||||||
|
import axios from 'axios';
|
||||||
|
function Uploads({ className , size , actionUrl,fileList,showNotification , load}) {
|
||||||
|
const [ files , setFiles ] = useState(undefined);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(fileList){
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
},[fileList]);
|
||||||
|
|
||||||
|
function init(){
|
||||||
|
let f = appendFileSizeToUploadFileAll(fileList);
|
||||||
|
setFiles(f);
|
||||||
|
}
|
||||||
|
function onAttachmentRemove(file){
|
||||||
|
if (!file.percent || file.percent === 100) {
|
||||||
|
deleteAttachment(file);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function deleteAttachment(file){
|
||||||
|
let id = file.response && file.response.data && file.response.data.id;
|
||||||
|
const url = actionUrl + `/busiAttachments/${id}`;
|
||||||
|
axios.delete(url).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
if (response.data.code === "1") {
|
||||||
|
let nf = files.filter(item=>item.response.data.id !== id);
|
||||||
|
setFiles(nf);
|
||||||
|
fileIdList(nf);
|
||||||
|
} else {
|
||||||
|
showNotification(response.data.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function handleChange (info) {
|
||||||
|
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
|
||||||
|
let fileList = info.fileList;
|
||||||
|
let len = info.fileList && info.fileList.length;
|
||||||
|
setFiles(appendFileSizeToUploadFileAll([fileList[len-1]]));
|
||||||
|
fileIdList(fileList[len-1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function fileIdList (fileList) {
|
||||||
|
let data = fileList.response && fileList.response.data;
|
||||||
|
fileList && load && load(data && data.id,data && data.fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
function beforeUpload(file){
|
||||||
|
const isLt100M = file.size / 1024 / 1024 < size;
|
||||||
|
if (!isLt100M) {
|
||||||
|
showNotification(`文件大小必须小于${size}MB!`);
|
||||||
|
}
|
||||||
|
return isLt100M;
|
||||||
|
}
|
||||||
|
|
||||||
|
const upload = {
|
||||||
|
name: 'file',
|
||||||
|
fileList: files,
|
||||||
|
action: actionUrl+`/busiAttachments/upload`,
|
||||||
|
onChange:handleChange,
|
||||||
|
onRemove:onAttachmentRemove,
|
||||||
|
beforeUpload:beforeUpload,
|
||||||
|
maxCount:1
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<Upload {...upload} className={className}>
|
||||||
|
<Button type={"default"}>上传文件</Button>
|
||||||
|
<span className="ml10 color-grey-9">(你可以上传小于<span className="color-red">{size}MB</span>的文件)</span>
|
||||||
|
</Upload>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Uploads;
|
|
@ -0,0 +1,150 @@
|
||||||
|
import React , { forwardRef, useEffect, useState } from 'react';
|
||||||
|
import { Modal , Form , Checkbox , Input , Table } from 'antd';
|
||||||
|
import Upload from './Upload';
|
||||||
|
import { AlignCenter } from '../Component/layout';
|
||||||
|
import axios from 'axios';
|
||||||
|
const { TextArea } = Input;
|
||||||
|
|
||||||
|
const https = 'https://testfiles.trustie.net';
|
||||||
|
function UploadSource({ form , visible , onCancel , onOk , showNotification , attachments , id ,owner,projectsId}){
|
||||||
|
const [ tableData , setTableData ] = useState(undefined);
|
||||||
|
const [ fileId , setFilesId ] = useState(undefined);
|
||||||
|
const [ fileName , setFileName ] = useState(undefined);
|
||||||
|
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(id && attachments){
|
||||||
|
setTableData(attachments);
|
||||||
|
}
|
||||||
|
},[id,attachments])
|
||||||
|
// 上传附件后得到的文件id数组
|
||||||
|
function UploadFunc(id,name){
|
||||||
|
setFilesId(id);
|
||||||
|
setFileName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
dataIndex:"fileName",
|
||||||
|
key:"fileName",
|
||||||
|
title:"资源名称",
|
||||||
|
width:"42%",
|
||||||
|
ellipsis:true,
|
||||||
|
render:(value,item,key)=>{
|
||||||
|
return <AlignCenter>
|
||||||
|
<div className="task-hide" style={{maxWidth:key===0 ? "240px":"100%"}}>{value}</div>
|
||||||
|
{ key === 0 && <span className="currentTip">当前版本</span> }
|
||||||
|
</AlignCenter>
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex:"downloads",
|
||||||
|
key:"downloads",
|
||||||
|
title:"下载数",
|
||||||
|
width:"14%",
|
||||||
|
className:"edu-txt-center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex:"fileSizeString",
|
||||||
|
key:"fileSizeString",
|
||||||
|
title:"文件大小",
|
||||||
|
width:"16%",
|
||||||
|
className:"edu-txt-center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex:"createdAt",
|
||||||
|
key:"createdAt",
|
||||||
|
title:"上传时间",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// 确定
|
||||||
|
function submit(){
|
||||||
|
if(fileId){
|
||||||
|
validateFields((error,values)=>{
|
||||||
|
if(!error){
|
||||||
|
postInfo(values);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
showNotification("请先上传文件!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function postInfo(values){
|
||||||
|
const url = https+`/api/project/achievement/`;
|
||||||
|
if(id){
|
||||||
|
// 修改
|
||||||
|
axios.put(url,{
|
||||||
|
id,fileName,fileId:`${fileId}`,
|
||||||
|
remark:values.remark
|
||||||
|
}).then(result=>{
|
||||||
|
if(result && result.data){
|
||||||
|
onOk();
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}else{
|
||||||
|
// 上传
|
||||||
|
axios.post(url,{
|
||||||
|
fileId:`${fileId}`,
|
||||||
|
fileName,
|
||||||
|
login:owner,
|
||||||
|
projectId:projectsId,
|
||||||
|
...values
|
||||||
|
}).then(result=>{
|
||||||
|
if(result && result.data){
|
||||||
|
onOk();
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return(
|
||||||
|
<Modal
|
||||||
|
title={id?"更新资源版本":"上传资源"}
|
||||||
|
closable={false}
|
||||||
|
visible={visible}
|
||||||
|
onCancel={onCancel}
|
||||||
|
onOk={submit}
|
||||||
|
cancelText="取消"
|
||||||
|
okText="确定"
|
||||||
|
width="600px"
|
||||||
|
centered
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<Form>
|
||||||
|
{id && <Table className="versionTable mb20" columns={columns} dataSource={tableData} pagination={false} size={"small"}/> }
|
||||||
|
<Form.Item style={{display:id?"none":"block"}}>
|
||||||
|
{getFieldDecorator("tagNames",{
|
||||||
|
rules:[]
|
||||||
|
})(
|
||||||
|
<Checkbox.Group>
|
||||||
|
<Checkbox value="软件版本">软件版本</Checkbox>
|
||||||
|
<Checkbox value="文档">文档</Checkbox>
|
||||||
|
<Checkbox value="代码">代码</Checkbox>
|
||||||
|
<Checkbox value="媒体">媒体</Checkbox>
|
||||||
|
<Checkbox value="论文">论文</Checkbox>
|
||||||
|
<Checkbox value="其它">其它</Checkbox>
|
||||||
|
</Checkbox.Group>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
<Upload
|
||||||
|
className="commentStyle"
|
||||||
|
load={UploadFunc}
|
||||||
|
size={100}
|
||||||
|
showNotification={showNotification}
|
||||||
|
actionUrl= {https}
|
||||||
|
/>
|
||||||
|
<Form.Item className="mt20">
|
||||||
|
{getFieldDecorator("remark",{
|
||||||
|
rules:[]
|
||||||
|
})(
|
||||||
|
<TextArea rows={4} placeholder="请输入资源描述" />
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Form.create()(forwardRef(UploadSource));;
|
|
@ -10,6 +10,7 @@ export default (({ data , current_user , successFunc }) => {
|
||||||
data.map((item, key) => {
|
data.map((item, key) => {
|
||||||
return (
|
return (
|
||||||
<Cards
|
<Cards
|
||||||
|
user={item.user}
|
||||||
img={item.user.image_url}
|
img={item.user.image_url}
|
||||||
name={item.user.name}
|
name={item.user.name}
|
||||||
time={item.created_at}
|
time={item.created_at}
|
||||||
|
|
|
@ -30,8 +30,8 @@ export default (({projects}) => {
|
||||||
projects.map((item, key) => {
|
projects.map((item, key) => {
|
||||||
return (
|
return (
|
||||||
<Div>
|
<Div>
|
||||||
<Imgs src={item.project && getImageUrl(`images/${item.project.owner_image_url}`)}/>
|
<Imgs src={item.project && getImageUrl(`/${item.project.owner_image_url}`)}/>
|
||||||
<Link to={`/projects/${item.project.owner_name}/${item.project.identifier}`}>{item.project.name}</Link>
|
<Link to={`/projects/${item.project.owner_login}/${item.project.identifier}`}>{item.project.name}</Link>
|
||||||
</Div>
|
</Div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -48,7 +48,7 @@ export default (props)=>{
|
||||||
</Short>
|
</Short>
|
||||||
<Long>
|
<Long>
|
||||||
<Gap>
|
<Gap>
|
||||||
<WhiteBack>
|
<WhiteBack style={{border:'1px solid #eee'}}>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group/:groupId/setting/project"
|
path="/organize/:OIdentifier/group/:groupId/setting/project"
|
||||||
|
|
|
@ -101,7 +101,7 @@ export default ((props) => {
|
||||||
group ?
|
group ?
|
||||||
<div>
|
<div>
|
||||||
<AlignCenterBetween>
|
<AlignCenterBetween>
|
||||||
<span className="color-grey-3">{group.name}</span>
|
<span className="color-grey-3">{group.nickname}</span>
|
||||||
{group.is_member && !group.is_admin ?
|
{group.is_member && !group.is_admin ?
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="确认离开团队吗?"
|
title="确认离开团队吗?"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue