From 1a024f801124030e7db8356787ea368e2431cf5e Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Sun, 9 Aug 2020 22:20:51 +0800 Subject: [PATCH 01/56] =?UTF-8?q?FIX=20=E5=8E=BB=E6=8E=89=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=89=8B=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Index.js | 6 ++---- src/forge/users/Index.jsx | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/forge/Index.js b/src/forge/Index.js index 20eabd5c..98276e08 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -6,7 +6,6 @@ import { withRouter } from "react-router"; import { SnackbarHOC } from "educoder"; import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC"; import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC"; -import Handbook from './Component/Handbook'; import "./css/index.scss"; import Loadable from "react-loadable"; @@ -14,7 +13,7 @@ import Loading from "../Loading"; import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC"; const ProjectNew = Loadable({ - loader: () => import("./New/Index"), + loader: () => import("./New/Index"), loading: Loading, }); const ProjectIndex = Loadable({ @@ -33,11 +32,10 @@ const Infos = Loadable({ }); class Index extends Component { - + render() { return (
- import("./Infos"), loading: Loading, @@ -15,7 +14,6 @@ export default withRouter( (CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)=>{ return(
- ) })))) -) \ No newline at end of file +) From 5601b71937d553b0d11b066e8d3687e1ffaaaaa4 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sun, 9 Aug 2020 23:08:11 +0800 Subject: [PATCH 02/56] junke --- src/modules/tpm/NewHeader.js | 68 +++++++++++++++++------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 2ead4e4f..e2c47bb3 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -50,7 +50,8 @@ class NewHeader extends Component { } } componentDidMount() { - this.getAppdata(); + // this.getAppdata(); + this.geturlsdata(); window._header_componentHandler = this; //下拉框的显示隐藏 @@ -547,23 +548,19 @@ class NewHeader extends Component { geturlsdata = () => { let url = "/setting.json"; axios.get(url).then((response) => { - if (response) { - if (response.data) { - this.setState({ - mygetHelmetapi2: 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) { + if (response && response.data) { + this.setState({ + mygetHelmetapi2: 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(); } - } else { + } catch (e) { this.gettablogourlnull(); } } else { @@ -571,29 +568,30 @@ class NewHeader extends Component { } }).catch((error) => { this.gettablogourlnull(); - }); } matchpaths = (url) => { const { match } = this.props; - if (url === '/forums' && match.path === '/forums') { - return true - } else if (url.startsWith('/projects') && match.path.startsWith('/projects')) { - return true - } else if (url.startsWith('/paths') && match.path.startsWith('/paths')) { - return true - } else if (url.startsWith('/courses') && match.path.startsWith('/courses')) { - return true - } else if (url.startsWith('/competitions') && match.path.startsWith('/competitions')) { - return true - } else if (url.startsWith('/statistics') && match.path.startsWith('/statistics')) { - return true - } else if (url.startsWith('/users') && match.path.startsWith('/users')) { - return true - } else { - return false + if(url){ + if (url === '/forums' && match.path === '/forums') { + return true + } else if (url.startsWith('/projects') && match.path.startsWith('/projects')) { + return true + } else if (url.startsWith('/paths') && match.path.startsWith('/paths')) { + return true + } else if (url.startsWith('/courses') && match.path.startsWith('/courses')) { + return true + } else if (url.startsWith('/competitions') && match.path.startsWith('/competitions')) { + return true + } else if (url.startsWith('/statistics') && match.path.startsWith('/statistics')) { + return true + } else if (url.startsWith('/users') && match.path.startsWith('/users')) { + return true + } else { + return false + } } } @@ -741,7 +739,7 @@ class NewHeader extends Component { var new_link = item.link; var user_login = this.props.user && this.props.user.login; var is_hidden = item.hidden - if (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1) { + 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") @@ -752,7 +750,7 @@ class NewHeader extends Component { is_hidden = true } } - if (user_login && new_link.indexOf("homes") > -1) { + if (user_login && (new_link && new_link.indexOf("homes") > -1)) { new_link = new_link.replace(/homes/g, "users/" + user_login + "/user_activities") } return ( From 13c65565749097c99e66c533d3e6d1f24910b232 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Sun, 9 Aug 2020 23:20:08 +0800 Subject: [PATCH 03/56] =?UTF-8?q?FIX=20=E6=9B=B4=E6=94=B9logo=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/tpm/NewHeader.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index e2c47bb3..a93dc45e 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -722,12 +722,12 @@ class NewHeader extends Component { this.setgoshowqqgtounp(bool)}> :"" } - this.headtypesonClick("/", false)} className={"fl mr30"}> + this.headtypesonClick("/", false)} className={"fl mr30"}> { mygetHelmetapi2 && mygetHelmetapi2.nav_logo_url && mygetHelmetapi2.nav_logo_url ? - 高校智能化教学与实训平台 + 可控开源社区 : - 高校智能化教学与实训平台 + 可控开源社区 } { @@ -881,4 +881,3 @@ class NewHeader extends Component { } export default NewHeader; - From 2fa71241db65c960cf95aad8327d8ee8301a60d3 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Sun, 9 Aug 2020 23:24:12 +0800 Subject: [PATCH 04/56] =?UTF-8?q?FIX=20=E6=9B=B4=E6=94=B9header=E7=9A=84?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/tpm/TPMIndex.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/tpm/TPMIndex.css b/src/modules/tpm/TPMIndex.css index 1f40ed79..ea7c652b 100644 --- a/src/modules/tpm/TPMIndex.css +++ b/src/modules/tpm/TPMIndex.css @@ -24,7 +24,7 @@ body>.-task-title { } .newHeaders{ max-width: unset; - background: #fff !important; + background: #24292d; width: 100%; height:70px; min-width: 1200px; @@ -412,4 +412,4 @@ body>.-task-title { .progress-container { flex: 1 0 0; margin-left: 20px; -} \ No newline at end of file +} From f1614a4b6234614551ac421248c815f3c00dae95 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Mon, 10 Aug 2020 11:27:41 +0800 Subject: [PATCH 05/56] Delete url --- src/modules/tpm/NewHeader.js | 3 --- src/modules/tpm/TPMIndex.css | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index a93dc45e..9a8f5485 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -760,9 +760,6 @@ class NewHeader extends Component { ) }) } -
  • - 问题反馈 -
  • : "" diff --git a/src/modules/tpm/TPMIndex.css b/src/modules/tpm/TPMIndex.css index ea7c652b..3d97b393 100644 --- a/src/modules/tpm/TPMIndex.css +++ b/src/modules/tpm/TPMIndex.css @@ -26,7 +26,7 @@ body>.-task-title { max-width: unset; background: #24292d; width: 100%; - height:70px; + height:60px; min-width: 1200px; z-index: 1000; -moz-box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.1); From 85d924db70fcf21cac2a3eb904df1b7ea789494b Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Thu, 13 Aug 2020 11:56:39 +0800 Subject: [PATCH 06/56] Fix: Add New File Language Api Wrong6 --- src/forge/Component/FileLanguage.jsx | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/forge/Component/FileLanguage.jsx b/src/forge/Component/FileLanguage.jsx index 177449c4..e2c9cc5d 100644 --- a/src/forge/Component/FileLanguage.jsx +++ b/src/forge/Component/FileLanguage.jsx @@ -1,3 +1,5 @@ + + import React , { useState , useEffect } from 'react'; import { Select } from 'antd'; import axios from 'axios'; @@ -57,28 +59,27 @@ const LANGUAGE = [ export default (({ language , select_language })=>{ const [ languages , setLanguage ] = useState(undefined); - - useEffect(()=>{ - const url = '/dev_ops/languages.json'; - axios.get(url).then(result=>{ - if(result){ - setLanguage(result.data); - } - }).catch(error=>{ - console.log(error); - }) - },[]) + // useEffect(()=>{ + // const url = '/dev_ops/languages.json'; + // axios.get(url).then(result=>{ + // if(result){ + // setLanguage(result.data); + // } + // }).catch(error=>{ + // console.log(error); + // }) + // },[]) function changelanguage(value){ - let array = value ? languages.filter(item=>item.name === value) :undefined; - select_language(value,array && array[0]); + // let array = value ? languages.filter(item=>item.name === value) :undefined; + select_language(value); } return( ) From f2f910b5e40c19b831139715e8a791d341051f37 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Tue, 18 Aug 2020 10:36:33 +0800 Subject: [PATCH 07/56] Add Dun Check For Project --- src/forge/Upload/Index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js index f366d5da..cfa22349 100644 --- a/src/forge/Upload/Index.js +++ b/src/forge/Upload/Index.js @@ -57,11 +57,26 @@ class Index extends Component { handleChange = (info) => { const { changeIsComplete } = this.props; changeIsComplete && changeIsComplete(true); + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { let fileList = info.fileList; this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); this.fileIdList(fileList); + + if ( info.file.status === 'done') { + let filelist = info.fileList && info.fileList.length>0 && info.fileList[info.fileList.length-1]; + if(filelist && filelist.response && filelist.response.status === -1){ + this.props.showNotification(filelist.response.message) + this.setState((state) => { + state.fileList.pop() + return { + fileList: state.fileList, + }; + }); + this.fileIdList(this.state.fileList); + } + } } } From 0922df387581a917a19e9468726d63eecd84417e Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Wed, 19 Aug 2020 18:18:03 +0800 Subject: [PATCH 08/56] Hide LoginDialog --- src/modules/login/LoginDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/login/LoginDialog.js b/src/modules/login/LoginDialog.js index 44197524..47fad4b1 100644 --- a/src/modules/login/LoginDialog.js +++ b/src/modules/login/LoginDialog.js @@ -580,9 +580,9 @@ class LoginDialog extends Component { - this.getloginurl("https://www.trustie.net/account/lost_password")} + this.getloginurl("http://39.105.176.215/account/lost_password")} className="mr3 color-grey-9">找回密码 - this.getloginurl("https://www.trustie.net/login?login=false")} className="color-grey-9">注册 + this.getloginurl("http://39.105.176.215/user_join")} className="color-grey-9">注册

    From 3b0c708d82d9bd0c83f32957883339f3bca4c8f0 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Thu, 20 Aug 2020 11:44:27 +0800 Subject: [PATCH 09/56] Fix: Issues --- src/forge/users/Infos.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index a18b54e8..0a93846a 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -141,10 +141,7 @@ class Infos extends Component {
    this.route_link("watchers")} > @@ -175,7 +172,7 @@ class Infos extends Component { {user && user.watching_count} this.route_link("fan_users")} className={`with50 text-center pull-left ${route_type === "fan_users" ? "text-primary" : ""}`} > From e0e6cdcc79f5e90fcc0d957c2577bb06ee86cbc6 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Thu, 20 Aug 2020 11:57:36 +0800 Subject: [PATCH 10/56] Fix: Issues --- src/forge/Newfile/m_editor.js | 2 +- src/forge/users/Infos.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js index 806154b0..848d752d 100644 --- a/src/forge/Newfile/m_editor.js +++ b/src/forge/Newfile/m_editor.js @@ -49,7 +49,7 @@ class m_editor extends Component { height="600px" language={language ? language : "plaintext"} theme={"vs-grey"} - defaultValue="请输入内容" + defaultValue="" value={editorValue} options={editor_options} onChange={this.changeEditor} diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index 0a93846a..2c5c09f2 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -141,7 +141,7 @@ class Infos extends Component {
    this.route_link("watchers")} > @@ -172,7 +172,7 @@ class Infos extends Component { {user && user.watching_count} this.route_link("fan_users")} className={`with50 text-center pull-left ${route_type === "fan_users" ? "text-primary" : ""}`} > From a9161b86a2707610c0272a5cc9fc210d5cc3bd50 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Thu, 20 Aug 2020 15:01:01 +0800 Subject: [PATCH 11/56] Change --- src/forge/users/Infos.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index 2c5c09f2..819c34a3 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -43,7 +43,7 @@ class Infos extends Component { isSpin: false, user: undefined, project_type: undefined, - route_type: undefined + route_type: undefined, }; } @@ -113,6 +113,7 @@ class Infos extends Component { render() { + const extra_http = `${document.location.protocol}//${document.domain}`; const { current_user, mygetHelmetapi } = this.props; const { user, isSpin, project_type, route_type } = this.state; return ( @@ -141,8 +142,7 @@ class Infos extends Component {
    - this.route_link("watchers")} >
    {current_user && user && user.login === current_user.login ? "我关注的" : "TA关注的"}
    {user && user.watching_count} - - + this.route_link("fan_users")} className={`with50 text-center pull-left ${route_type === "fan_users" ? "text-primary" : ""}`} >
    {current_user && user && user.login === current_user.login ? "关注我的" : "关注TA的"}
    {user && user.watched_count} - +
    From 07e1525f09dce1da655c71da8f5ddfa3bed2e71c Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 20 Aug 2020 18:10:40 +0800 Subject: [PATCH 12/56] router --- src/forge/Merge/MergeItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index d34f5382..d558591f 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -98,7 +98,7 @@ class MergeItem extends Component { {item.is_original From 74d26a40d371f7724d02af5da8b20b0017e28317 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Mon, 24 Aug 2020 11:37:51 +0800 Subject: [PATCH 13/56] Change Edit Url --- src/forge/users/Infos.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index 819c34a3..76c76cf3 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -142,7 +142,7 @@ class Infos extends Component { + + + } + { + item.status === "unpassed" && + 已拒绝 + } + { + item.status === "passed" && + 已同意 + } + + ) + } + } + ] + // 拒绝&同意 + function operation(ids,s){ + setLoading(true); + const url = `/apply_signatures/${ids}.json`; + axios.put(url,{ + project_id:project_id, + status:s + }).then(result=>{ + setLoading(false); + if(result){ + props.showNotification(`${s==="passed"?"同意":"拒绝"}此申请已操作成功!`); + Init(searchValue,status); + } + }).catch(error=>{setLoading(false)}) + } + + function searchList(){ + setLoading(true); + Init(searchValue,status); + } + + const menu=( + + 全部 + 审核中 + 已拒绝 + 已同意 + + ) + + function chooseStatus(e){ + setStatus(e.key); + Init(searchValue, e.key); + } + + + return( + + 项目管理 + + SetSearchValue(e.target.value)} + onSearch={searchList} + /> + + + {status ==="waiting"?"审核中":status==="unpassed"?"已拒绝":status==="passed"?"已同意":"全部"} + + + + + record.id} + pagination={false} + dataSource={list} + loading={loading} + >
    + { + total > LIMIT && +
    + +
    + } + +
    + ) +} +export default SpecialProject; \ No newline at end of file diff --git a/src/forge/Settings/setting.scss b/src/forge/Settings/setting.scss index 3d1d6aeb..affc9838 100644 --- a/src/forge/Settings/setting.scss +++ b/src/forge/Settings/setting.scss @@ -139,6 +139,7 @@ .padding15-10{ padding:15px 10px; } +.center{text-align: center;} .w-100{width: 100%;} .fwb{font-weight: 600;} .text-black{color: #333;} From dde7fa730af2642b7b90dea331bd57ff87b81098 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 4 Jan 2021 16:43:15 +0800 Subject: [PATCH 39/56] =?UTF-8?q?=E5=90=8C=E4=B8=8A-update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/Main/Detail.js | 3 +-- src/forge/Main/IndexItem.js | 25 +++++++++++++------------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 82a5cb78..e271ed76 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -27,7 +27,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '15243705227' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' } function clearAllCookie() { cookie.remove('_educoder_session', { path: '/' }); diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 1ddef304..0247b6b3 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -202,8 +202,7 @@ class Detail extends Component { // 工作流:两种状态进入的链接不同 const pathname = this.props.history.location.pathname; - let p = checkPathname(pathname); - if(p==="devops"){ + if(pathname===`/projects/${owner}/${projectsId}/devops`){ if(result.data.open_devops && pathname === `/projects/${owner}/${projectsId}/devops`){ this.props.history.push(`/projects/${owner}/${projectsId}/devops/list`); }else if(result.data.open_devops===false && pathname !== `/projects/${owner}/${projectsId}/devops`){ diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index 884e0c16..3441b76e 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -26,19 +26,20 @@ class IndexItem extends Component { projectHref=(link , user_apply_signatures,project_id,is_secret , id)=>{ const { user , showLoginDialog } = this.props; - if(user && user.login){ - let signa = user_apply_signatures && user_apply_signatures[0]; - if((is_secret && (!signa || (signa && signa.status !== "passed"))) && user.login !== id ){ - this.setState({ - visible:true, - user_apply_signatures:user_apply_signatures.length>0 ? user_apply_signatures[0] : undefined, - project_id - }) - }else{ - this.props.history.push(link); - } + debugger; + if(is_secret && (!user || (user && !user.login))){ + showLoginDialog(); + return; + } + let signa = user_apply_signatures && user_apply_signatures[0]; + if((is_secret && (!signa || (signa && signa.status !== "passed"))) && user.login !== id ){ + this.setState({ + visible:true, + user_apply_signatures:user_apply_signatures.length>0 ? user_apply_signatures[0] : undefined, + project_id + }) }else{ - showLoginDialog && showLoginDialog(); + this.props.history.push(link); } } hideModal=()=>{ From 5bda100e327a5f82f44c5c6cdba94a18d79cbb2f Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 5 Jan 2021 09:23:58 +0800 Subject: [PATCH 40/56] update --- src/AppConfig.js | 2 +- src/forge/Main/IndexItem.js | 1 - src/forge/Settings/Index.js | 4 ++-- src/forge/Settings/SpecialProject.jsx | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index e271ed76..82a5cb78 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -27,7 +27,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '15243705227' } function clearAllCookie() { cookie.remove('_educoder_session', { path: '/' }); diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index 3441b76e..30979954 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -26,7 +26,6 @@ class IndexItem extends Component { projectHref=(link , user_apply_signatures,project_id,is_secret , id)=>{ const { user , showLoginDialog } = this.props; - debugger; if(is_secret && (!user || (user && !user.login))){ showLoginDialog(); return; diff --git a/src/forge/Settings/Index.js b/src/forge/Settings/Index.js index 2196018e..1fecef5c 100644 --- a/src/forge/Settings/Index.js +++ b/src/forge/Settings/Index.js @@ -43,8 +43,8 @@ const ManageNew = Loadable({ class Index extends Component { render() { const { projectsId , owner } = this.props.match.params; - const { user } = this.props; const { pathname } = this.props.history.location; + const { projectDetail } = this.props; const flag = pathname === `/projects/${owner}/${projectsId}/setting`; return ( @@ -93,7 +93,7 @@ class Index extends Component {

    { - user && user.login === owner ? + projectDetail && projectDetail.permission && projectDetail.permission === "Owner" ?
  • -1 ? "active" : ""} > diff --git a/src/forge/Settings/SpecialProject.jsx b/src/forge/Settings/SpecialProject.jsx index 197af884..883b5d0a 100644 --- a/src/forge/Settings/SpecialProject.jsx +++ b/src/forge/Settings/SpecialProject.jsx @@ -15,7 +15,6 @@ function SpecialProject(props){ const [ loading ,setLoading ] = useState(true); const { owner , projectsId} = props.match.params; - console.log(props); const { project_id } = props; useEffect(()=>{ @@ -133,7 +132,7 @@ function SpecialProject(props){ const menu=( - 全部 + 全部 审核中 已拒绝 已同意 From 350f9426eaf9edbc4f0eca29d0452e48df0a971d Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 5 Jan 2021 10:33:58 +0800 Subject: [PATCH 41/56] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/DevOps/Index.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/forge/DevOps/Index.jsx b/src/forge/DevOps/Index.jsx index 77b82eb0..1855da42 100644 --- a/src/forge/DevOps/Index.jsx +++ b/src/forge/DevOps/Index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React , { useEffect } from 'react'; import { WhiteBack } from '../Component/layout'; import './ops.scss'; @@ -15,6 +15,19 @@ const Infos = Loadable({ loading: Loading, }) export default ((props)=>{ + const { projectsId , owner } = props.match.params; + const open_devops = props.projectDetail && props.projectDetail.open_devops; + + // 工作流:两种状态进入的链接不同 + useEffect(()=>{ + if(open_devops !== undefined){ + if(open_devops){ + props.history.replace(`/projects/${owner}/${projectsId}/devops/list`); + }else{ + props.history.replace(`/projects/${owner}/${projectsId}/devops`); + } + } + },[open_devops]) return( From c68a3dbd6f082ce2ae8ddb4c3f932c27ac1907f5 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 11 Jan 2021 18:14:59 +0800 Subject: [PATCH 42/56] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=88=90=E5=91=98?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E7=89=B9=E6=AE=8A=E5=BC=80=E6=BA=90=E8=AE=B8?= =?UTF-8?q?=E5=8F=AF=E8=AF=81=E9=A1=B9=E7=9B=AE=E4=B8=8D=E7=94=A8=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/IndexItem.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index 30979954..8841a7ae 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -23,15 +23,22 @@ class IndexItem extends Component { state: login }) } - - projectHref=(link , user_apply_signatures,project_id,is_secret , id)=>{ + /** + * link:跳转到详情的地址 + * user_apply_signatures:是否已经发送访问特殊开源项目的文件 + * project_id:项目id + * is_secret:是否是特殊开源许可证项目 + * id:创建者login + * is_member:是否是项目成员(如果是项目成员可以直接进入项目) + * */ + projectHref=(link , user_apply_signatures,project_id,is_secret , id,is_member)=>{ const { user , showLoginDialog } = this.props; if(is_secret && (!user || (user && !user.login))){ showLoginDialog(); return; } let signa = user_apply_signatures && user_apply_signatures[0]; - if((is_secret && (!signa || (signa && signa.status !== "passed"))) && user.login !== id ){ + if((is_secret && !is_member && (!signa || (signa && signa.status !== "passed"))) && user.login !== id ){ this.setState({ visible:true, user_apply_signatures:user_apply_signatures.length>0 ? user_apply_signatures[0] : undefined, @@ -72,7 +79,7 @@ class IndexItem extends Component { }
    - this.projectHref(`/projects/${item.author.login}/${item.identifier}`,item.user_apply_signatures, item.id,item.is_secret,item.author.login)} className="hide-1 color-grey-3 font-18 task-hide fwt-500 " style={{ whiteSpace: "wrap", display: 'flex', width: 400 }}> + this.projectHref(`/projects/${item.author.login}/${item.identifier}`,item.user_apply_signatures, item.id,item.is_secret,item.author.login,item.is_member)} className="hide-1 color-grey-3 font-18 task-hide fwt-500 " style={{ whiteSpace: "wrap", display: 'flex', width: 400 }}> {item.author.name}/{item.name} { item.forked_from_project_id ? From 5a6b7bd717fb7b7ec27e4637b7b17bf246bc3a1b Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 12 Jan 2021 09:30:30 +0800 Subject: [PATCH 43/56] update --- src/AppConfig.js | 2 +- src/forge/Main/Detail.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 82a5cb78..1743bdc5 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -27,7 +27,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '15243705227' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'p86402359' } function clearAllCookie() { cookie.remove('_educoder_session', { path: '/' }); diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 0247b6b3..d86d694c 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -192,7 +192,7 @@ class Detail extends Component { platform:result.data.platform && result.data.platform !== 'educoder' }) let signa = result.data.user_apply_signatures && result.data.user_apply_signatures[0]; - if(result.data.is_secret && (!signa || (signa && signa.status !== "passed")) && user.login !== owner){ + if(result.data.is_secret && !result.data.is_member && (!signa || (signa && signa.status !== "passed")) && user.login !== owner){ this.setState({ visible:true, is_secret:result.data.is_secret, From 83e337b2e98e491dc5a6a6b95fe90f766a9bc920 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 12 Jan 2021 17:44:46 +0800 Subject: [PATCH 44/56] pullrequest --- src/forge/Merge/MessageCount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index c837ccb4..12601836 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -258,7 +258,7 @@ class MessageCount extends Component {
    {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head} From d8d464a3322f46203b7ed1cfc7b4d428965bf853 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 12 Jan 2021 17:45:54 +0800 Subject: [PATCH 45/56] pullrequest --- src/forge/Merge/MessageCount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 75921701..507c62dd 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -300,7 +300,7 @@ class MessageCount extends Component {
    {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head} From c746e9e634c45f969e55c03956002f816e797b32 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 13 Jan 2021 14:21:12 +0800 Subject: [PATCH 46/56] pulls --- src/forge/Merge/MessageCount.js | 40 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 507c62dd..71e74668 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -40,6 +40,7 @@ class MessageCount extends Component { SpinMerge: false, edit_spin: false, pr_status: undefined, + pull_request:undefined, copyVisible:false, }; @@ -69,11 +70,12 @@ class MessageCount extends Component { axios .get(url) .then((result) => { - if (result) { + if (result && result.data) { this.setState({ data: result.data, SpinFlag: false, - pr_status: result.data && result.data.pull_request && result.data.pull_request.status, + pr_status: result.data.pull_request && result.data.pull_request.status, + pull_request:result.data.pull_request }); } else { this.setState({ SpinFlag: false }); @@ -120,12 +122,12 @@ class MessageCount extends Component { SpinMerge: true, }); const { projectsId , owner } = this.props.match.params; - const { data, title, body, mergekey, pr_status } = this.state; - const url = `/${owner}/${projectsId}/pulls/${data.pull_request.id}/pr_merge.json`; + const { title, body, mergekey, pull_request } = this.state; + const url = `/${owner}/${projectsId}/pulls/${pull_request.id}/pr_merge.json`; axios .post(url, { project_id: projectsId, - id: data.pull_request.id, + id: pull_request.id, do: mergekey, body: body, title: title, @@ -249,9 +251,15 @@ class MessageCount extends Component { isSpin, ismesrge, SpinFlag, - copyVisible + copyVisible, + pull_request } = this.state; const { current_user, projectDetail } = this.props; + + const permission = projectDetail && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner"); + const userLogin = current_user && current_user.login && (pull_request && pull_request.create_user === current_user.login); + const operate = current_user && projectDetail && pr_status === 0 && (permission || userLogin); + const menu = ( this.getOption(e)}> @@ -280,13 +288,13 @@ class MessageCount extends Component {
    - {data.issue.subject} + { data.issue && data.issue.subject} - {data.pull_request && ( + {pull_request && ( {pr_status === 1 ? "已合并" @@ -300,10 +308,10 @@ class MessageCount extends Component {
    - {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head} + {pull_request.is_original ? pull_request.fork_project_user : data.issue.project_author_name}:{pull_request.head} @@ -315,11 +323,11 @@ class MessageCount extends Component { {/* {data.pull_request.is_fork ? data.pull_request.base : `${data.pull_request.pull_request_user}:${data.pull_request.base}`} */} - {data.issue.project_author_name}:{data.pull_request.base} + {data.issue.project_author_name}:{pull_request.base}
    @@ -401,9 +409,7 @@ class MessageCount extends Component { 下载为 */} - {current_user && projectDetail && - pr_status === 0 && - projectDetail.permission !=="Reporter" && ( + {operate && (
  • 账号管理
  • 我的消息
  • - + 账号安全
  • - + 创客管理
  • From de550d5f42f2d6a01fdaa37a2e6bbf18d36199ef Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 4 Feb 2021 15:05:37 +0800 Subject: [PATCH 49/56] remove --- src/modules/tpm/NewHeader.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 8b72f1bf..81b9678f 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -16,7 +16,6 @@ import logo from './images/logo.png'; import { result } from 'lodash'; const $ = window.$ - window._header_componentHandler = null; // 非trustie链接则新开页跳转 const str = ['www.trustie.net','forgeplus.trustie.net','forum.trustie.net','testforgeplus.trustie.net'] @@ -95,10 +94,6 @@ class NewHeader extends Component { this.setState({ user: newProps.user }) - if (newProps.Headertop !== undefined) { - old_url = newProps.Headertop.old_url - } - } getCookie = (key) => { var arr, reg = RegExp('(^| )' + key + '=([^;]+)(;|$)'); From 617f139f529fc490f0c6dcf272803784be6a1ba5 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 4 Feb 2021 15:13:08 +0800 Subject: [PATCH 50/56] fault --- src/modules/tpm/NewHeader.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 81b9678f..5df70ca5 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -46,8 +46,7 @@ class NewHeader extends Component { headtypess: "/", mygetHelmetapi2: null, goshowqqgtounp: false, - visiblemyss: false, - settingData:undefined + visiblemyss: false } } componentDidMount() { @@ -546,9 +545,7 @@ class NewHeader extends Component { let url = "/setting.json"; axios.get(url).then((response) => { if (response && response.data) { - this.setState({ - settingData:result.data.setting - }) + this.setState({ mygetHelmetapi2: response.data.setting }); try { if (response.data.setting.tab_logo_url) { this.gettablogourldata(response); @@ -605,8 +602,7 @@ class NewHeader extends Component { headtypesonClickbool, headtypess, mygetHelmetapi2, - goshowqqgtounp, - settingData + goshowqqgtounp } = this.state; /*用户名称 用户头像url*/ let activeIndex = false; @@ -833,25 +829,25 @@ class NewHeader extends Component {
  • 账号管理
  • 我的消息
  • - + 账号安全
  • - + 创客管理
  • From 2c3d917bd46063f08849f4eb377a147b44561661 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 9 Feb 2021 10:44:41 +0800 Subject: [PATCH 51/56] mygetHelmetapi2 --- src/AppConfig.js | 2 +- src/modules/tpm/NewHeader.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 1743bdc5..9cd885eb 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -58,7 +58,7 @@ export function initAxiosInterceptors(props) { // TODO 避免重复的请求 https://github.com/axios/axios#cancellation var proxy = "http://localhost:3000"; - proxy = "http://39.105.176.215:49999"; + proxy = "http://osredmforge.educoder.net"; const requestMap = {}; window.setfalseInRequestMap = function (keyName) { diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 5df70ca5..5c2ac829 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -829,25 +829,25 @@ class NewHeader extends Component {
  • 账号管理
  • 我的消息
  • - + 账号安全
  • - + 创客管理
  • From efc2443bb85267dbaddb8ee128575d228d0d2948 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 25 Feb 2021 16:58:59 +0800 Subject: [PATCH 52/56] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Index.js | 45 +++++++++++++++------------------------- src/forge/users/Infos.js | 2 +- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index 9cba30fe..d127775d 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -22,7 +22,6 @@ class Index extends Component { sort: undefined, total: 0, isSpin: true, - project_type: undefined, category_id: undefined, typeList: undefined, @@ -36,8 +35,8 @@ class Index extends Component { } componentDidMount = () => { - const { page,search, sort, project_type, category_id , languageId } = this.state; - this.getListData(page,search, sort, project_type, category_id , languageId); + const { page,search, sort,category_id , languageId } = this.state; + this.getListData(page,search, sort,category_id , languageId); this.getType(); @@ -72,7 +71,7 @@ class Index extends Component { } // 获取列表 - getListData = (page,search, sort, project_type, category_id,languageId) => { + getListData = (page,search, sort,category_id,language_id) => { const { current_user } = this.props; const url = `/projects.json`; axios.get(url, { @@ -82,9 +81,8 @@ class Index extends Component { limit:15, search, sort_by: sort, - project_type, category_id, - language_id:languageId + language_id } }).then((result) => { if (result) { @@ -111,7 +109,7 @@ class Index extends Component { this.setState({ typeList: list.map((item, key) => { return ( -
  • this.changeType(`${item.project_type}`, list)}> +
  • this.changeType(`${item.id}`, list)}>

    {item.name} {item.projects_count} @@ -123,15 +121,15 @@ class Index extends Component { } // 切换类型 - changeType = (type, list) => { + changeType = (id, list) => { this.setState({ isSpin: true, - project_type: type, + languageId: id, search: undefined }) - this.setTypeList(list, type) - const { page,sort, category_id , languageId } = this.state; - this.getListData(page,undefined, sort, type, category_id , languageId); + this.setTypeList(list, id) + const { page,sort, category_id} = this.state; + this.getListData(page,undefined, sort,category_id , id); } // 获取类型 @@ -166,8 +164,8 @@ class Index extends Component { page: 1 }); this.setCategoryList(list, id) - const { sort, project_type , languageId } = this.state; - this.getListData(1,undefined, sort, project_type, id , languageId); + const { sort,languageId } = this.state; + this.getListData(1,undefined, sort,id , languageId); } // 排序 @@ -178,8 +176,8 @@ class Index extends Component { search: undefined, isSpin: true }) - const {project_type, category_id , languageId } = this.state; - this.getListData(1,undefined, e.key, project_type, category_id , languageId); + const {category_id , languageId } = this.state; + this.getListData(1,undefined, e.key,category_id , languageId); } // 搜索 @@ -192,7 +190,7 @@ class Index extends Component { sort: "updated_on" }) const {sort, category_id , languageId } = this.state; - this.getListData(1,value, sort, undefined, category_id , languageId); + this.getListData(1,value, sort,category_id , languageId); } changeSearchValue = (e) => { this.setState({ @@ -204,23 +202,14 @@ class Index extends Component { this.setState({ page }) - const {search, sort, project_type, category_id , languageId } = this.state; - this.getListData(page,search, sort, project_type, category_id , languageId); + const {search, sort,category_id , languageId } = this.state; + this.getListData(page,search, sort, category_id , languageId); } getoDetail=(login,identifier)=>{ this.props.history.push(`/projects/${login}/${identifier}`); } - // 选择语言类别 - changeLanguage=(e)=>{ - this.setState({ - isSpin:true, - languageId:e === 0 ?undefined:e - }) - const { page,sort , project_type , category_id } = this.state; - this.getListData(page, undefined, sort, project_type, category_id ,e === 0 ?undefined:e); - } menu =()=> { return( diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index f5b6ca9a..6b8ea202 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -227,7 +227,7 @@ class Infos extends Component {