diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 96077ad..9ea8426 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7286,7 +7286,8 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "optional": true }, "aproba": { "version": "1.2.0", @@ -7703,7 +7704,8 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -7759,6 +7761,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -7802,12 +7805,14 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "optional": true }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "optional": true } } }, diff --git a/public/css/iconfont.css b/public/css/iconfont.css index 784f619..89f6d42 100644 --- a/public/css/iconfont.css +++ b/public/css/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 2340181 */ - src: url('iconfont.woff2?t=1632638897939') format('woff2'), - url('iconfont.woff?t=1632638897939') format('woff'), - url('iconfont.ttf?t=1632638897939') format('truetype'); + src: url('iconfont.woff2?t=1632881251448') format('woff2'), + url('iconfont.woff?t=1632881251448') format('woff'), + url('iconfont.ttf?t=1632881251448') format('truetype'); } .iconfont { @@ -13,6 +13,18 @@ -moz-osx-font-smoothing: grayscale; } +.icon-wenjian7:before { + content: "\e8e0"; +} + +.icon-xiangyoujiantou:before { + content: "\e8de"; +} + +.icon-xiangzuojiantou:before { + content: "\e8df"; +} + .icon-a-liulanicon2x:before { content: "\e8dd"; } diff --git a/public/css/iconfont.js b/public/css/iconfont.js index ad36fbc..0e23ffb 100644 --- a/public/css/iconfont.js +++ b/public/css/iconfont.js @@ -1 +1 @@ -!function(c){var l,a,h,i,o,z='',t=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss"),p=function(c,l){l.parentNode.insertBefore(c,l)};if(t&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function v(){o||(o=!0,h())}function m(){try{i.documentElement.doScroll("left")}catch(c){return void setTimeout(m,50)}v()}l=function(){var c,l;(l=document.createElement("div")).innerHTML=z,z=null,(c=l.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",l=c,(c=document.body).firstChild?p(l,c.firstChild):c.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),l()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(h=l,i=c.document,o=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,v())})}(window); \ No newline at end of file +!function(c){var a,l,h,i,o,z='',t=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss"),p=function(c,a){a.parentNode.insertBefore(c,a)};if(t&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function v(){o||(o=!0,h())}function m(){try{i.documentElement.doScroll("left")}catch(c){return void setTimeout(m,50)}v()}a=function(){var c,a;(a=document.createElement("div")).innerHTML=z,z=null,(c=a.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",a=c,(c=document.body).firstChild?p(a,c.firstChild):c.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(l=function(){document.removeEventListener("DOMContentLoaded",l,!1),a()},document.addEventListener("DOMContentLoaded",l,!1)):document.attachEvent&&(h=a,i=c.document,o=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,v())})}(window); \ No newline at end of file diff --git a/public/css/iconfont.json b/public/css/iconfont.json index 91c742a..5acfb6e 100644 --- a/public/css/iconfont.json +++ b/public/css/iconfont.json @@ -5,6 +5,27 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "24656750", + "name": "文件", + "font_class": "wenjian7", + "unicode": "e8e0", + "unicode_decimal": 59616 + }, + { + "icon_id": "630094", + "name": "向右箭头", + "font_class": "xiangyoujiantou", + "unicode": "e8de", + "unicode_decimal": 59614 + }, + { + "icon_id": "630095", + "name": "向左箭头", + "font_class": "xiangzuojiantou", + "unicode": "e8df", + "unicode_decimal": 59615 + }, { "icon_id": "24600282", "name": "浏览icon@2x", diff --git a/public/css/iconfont.ttf b/public/css/iconfont.ttf index 3e373ea..3259828 100644 Binary files a/public/css/iconfont.ttf and b/public/css/iconfont.ttf differ diff --git a/public/css/iconfont.woff b/public/css/iconfont.woff index 481ae55..dda1c16 100644 Binary files a/public/css/iconfont.woff and b/public/css/iconfont.woff differ diff --git a/public/css/iconfont.woff2 b/public/css/iconfont.woff2 index 6c2b2ab..c0cd23a 100644 Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ diff --git a/src/forge/Component/Releases.jsx b/src/forge/Component/Releases.jsx index 2e4e22b..7a287d9 100644 --- a/src/forge/Component/Releases.jsx +++ b/src/forge/Component/Releases.jsx @@ -3,7 +3,6 @@ import { AlignTop } from '../Component/layout'; import { Link } from 'react-router-dom'; function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}){ - return(
@@ -28,7 +27,7 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType} }) :
- 您暂未发布任何版本{baseOperate && projectType !==2 && 创建新版本} + 您暂未发布任何版本{baseOperate && projectType !==2 && 创建新版本}
} diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 02a829a..545b92f 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -67,14 +67,14 @@ function CoderDepot(props){ const [ editReadme , setEditReadme ] = useState(false); const [ pullsFlag , setPullsFlag ] = useState(true); const [ issuesFlag , setIssuesFlag ] = useState(true); + const [ releaseVersions , setReleaseVersions] = useState(undefined); + const details = props.projectDetail; const owner = props.match.params.owner; const projectsId = props.match.params.projectsId; let branchName = props.match.params.branchName; branchName = returnbar(branchName); - const details = props.projectDetail; let pathname = props.history.location.pathname; - const { bannerList } = props; useEffect(()=>{ @@ -90,7 +90,6 @@ function CoderDepot(props){ } },[bannerList]) - useEffect(()=>{ if(details){ setProjectDetail(details); @@ -100,7 +99,7 @@ function CoderDepot(props){ setDefaultBranch(details.default_branch); setInviteCode(details.invite_code); } - },[details]) + }) useEffect(()=>{ if(treeValue){ @@ -127,11 +126,22 @@ function CoderDepot(props){ } },[projectsId,owner,pathname,defaultBranch]) + useEffect(()=>{ + axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{ + if(result && result.data && result.data.releases){ + const release = { + "list":result.data.releases, + "total_count":result.data.releases.length + } + setReleaseVersions(release); + } + }) + },[releaseVersions]) + // 获取主目录列表 function getDirInfo(branch){ setIsSpin(true); const url = `/${owner}/${projectsId}/entries.json`; - axios.get(url, { params: { ref: branch } }).then((result) => { @@ -521,13 +531,13 @@ function CoderDepot(props){ } {/* 发布 */} { - projectDetail && projectDetail.release_versions && + releaseVersions &&
-
{item.message}
+
{item.message}

{ }); } }, [projectsId , owner, sha]); - - function timeFormat(seconds) { - const time = new Date(seconds*1000); - return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+(time.getHours()+1)+":"+time.getMinutes(); - } return (

diff --git a/src/forge/Main/version/New.jsx b/src/forge/Main/version/New.jsx index d9028b8..3f432e9 100644 --- a/src/forge/Main/version/New.jsx +++ b/src/forge/Main/version/New.jsx @@ -32,9 +32,9 @@ export default Form.create()( const [fileList, setFileList] = useState(undefined); const [attachment, setAttachment] = useState(undefined); const [options , setOptions] = useState(undefined); - + const stable = history && history.location && history.location.state.stable; const { projectsId, versionId , owner } = match.params; - + useEffect(()=>{ if(projectDetail && projectDetail.default_branch){ setBranch(projectDetail.default_branch); @@ -129,6 +129,7 @@ export default Form.create()( function changeBranch(params) { setBranch(params); } + return (
@@ -207,7 +208,7 @@ export default Form.create()( { rules:[], validateFirst: true })( - 这是一个预览版本 + 这是一个预览版本 )}

@@ -216,7 +217,6 @@ export default Form.create()(

diff --git a/src/forge/Main/version/version.js b/src/forge/Main/version/version.js index 5b48aff..ba4ff8b 100644 --- a/src/forge/Main/version/version.js +++ b/src/forge/Main/version/version.js @@ -8,6 +8,7 @@ import './version.scss'; import axios from 'axios'; import Tree from '../img/tree-black.png'; import RenderHtml from '../../../components/render-html'; +import User from "../../Component/User"; function version(props) { console.log(props); @@ -29,6 +30,7 @@ function version(props) { axios.get(url).then((result) => { if (result) { setData(result.data); + console.log('data',result.data) const { releases = [] } = result.data; //默认第一个展开(body参数) releases.length && (releases[0].bodyshow = true); @@ -48,7 +50,6 @@ function version(props) { } //删除 function deleteRelease(releaseId) { - console.log(releaseId); if(releaseId){ axios.delete(`/${owner}/${projectsId}/releases/${releaseId}.json`).then((result)=>{ if(result){ @@ -64,28 +65,29 @@ function version(props) { {item.draft} - {item.tag_name}{item.draft === "预发行" ?"(standalone)":""} + {item.tag_name} - {truncateCommitId(item.sha)} + {truncateCommitId(item.sha)}
- 发布{item.name}{item.draft === "预发行" ?"(standalone)版本":""} + 发布{item.name} - { - (isManager || isDeveloper) && type !==2 && - - } - {current_user_login == owner && {deleteRelease(item.version_id)}}>} + {data && data.user_admin_permission && } + {data && data.user_admin_permission && {deleteRelease(item.version_id)}}>}
- + showBody(key,item.bodyshow)}> - - {item.user_name} + 发布于{item.created_at} { @@ -96,16 +98,14 @@ function version(props) { }

- {item.tag_name}.TAR.gz - {item.tag_name}.ZIP -

- {/* 发行版附件下载 */} - {/* {item.attachments.length !=0 &&

- 附件: */} + {/* 发行版附件下载 */} {item.attachments && item.attachments.map((item)=>{ - return({item.title}) + return(下载 {item.title}) })} - {/*

} */} + {/* 发行版下载包 */} + 下载 {item.tag_name}.TAR.gz + 下载 {item.tag_name}.ZIP +

) @@ -115,7 +115,7 @@ function version(props) { return ( { - data && data.user_permission && type !== 2 && + data && data.user_admin_permission &&
@@ -128,7 +128,7 @@ function version(props) { } else if (releases && releases.length === 0) { return ( ) @@ -136,7 +136,7 @@ function version(props) { } function addFunc(){ - props.history.push(`/${owner}/${projectsId}/releases/new`); + props.history.push({pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}}); } return ( diff --git a/src/forge/Main/version/version.scss b/src/forge/Main/version/version.scss index 7985f37..7cd5ddb 100644 --- a/src/forge/Main/version/version.scss +++ b/src/forge/Main/version/version.scss @@ -26,6 +26,12 @@ flex-direction: column; align-items: flex-end; padding-right: 15px; + &>.color-grey-3{ + max-width: 10rem; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } } .versionInfo_right{ flex: 1; @@ -54,6 +60,13 @@ .body-show{ padding: 5px 10px 10px 10px; } + & .version-user>a>span{ + display: inline-block; + & img{ + width: 20px; + height: 20px; + } + } } .versionTag{ display: inline; @@ -95,7 +108,7 @@ margin-top: 5px; padding-top: 20px; border-top: 1px solid #eee; - width: 100%; + // width: 100%; a{ display: block; color: #333; diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx index 32215d1..fef6319 100644 --- a/src/forge/Merge/Files.jsx +++ b/src/forge/Merge/Files.jsx @@ -10,7 +10,21 @@ function Files(props){ const [ files , setFiles ] = useState(data && data.files); const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径"); const [ isOpen, setIsOpen] = useState(false); - const commitPage = history && history.location && history.location.query && history.location.query.page; + const commitPage = history && history.location && history.location.query && history.location.query.commitPage; + // console.log('222',commitPage); + // const nextHref = useRef(null); + + // useEffect(()=>{ + // const unlisten = history.listen((location)=>{ + // if(nextHref.current !== location.pathname){ + // nextHref.current = location.pathname; + // history.replace({pathname:location.pathname,search:`commitPage=${commitPage}`}); + // // history.replace({pathname:location.pathname, query:{page:commitPage}}); + // } else{ + // unlisten; + // } + // }) + // }) useEffect(()=>{ if(data){ diff --git a/src/forge/common/util.js b/src/forge/common/util.js index 4f8f0bf..1b35ea2 100644 --- a/src/forge/common/util.js +++ b/src/forge/common/util.js @@ -6,3 +6,11 @@ export function truncateCommitId(str) { return str } } + +// 秒数转2021-9-29 01:01 +export function timeFormat(SecondsStr){ + const time = new Date(SecondsStr*1000); + const hour = time.getHours()<10?"0".concat(time.getHours()):time.getHours(); + const minutes = time.getMinutes()<10?"0".concat(time.getMinutes()):time.getMinutes(); + return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+hour+":"+minutes; +} \ No newline at end of file diff --git a/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index 4f1e6d8..d6df12c 100644 --- a/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -53,8 +53,6 @@ class CompetitionContentspdfpeopledata extends Component { let url = `/users/accounts/${id}.json`; axios.get(url).then((result) => { if (result.data) { - console.log("GetuseridApi"); - console.log(result.data); this.setState({ userdata:result.data })