Merge remote-tracking branch 'upstream/gitlink_server' into pre_gitlink_ssr

This commit is contained in:
黄心宇 2024-05-10 13:54:28 +08:00
commit 6477e554c0
18 changed files with 209 additions and 82 deletions

27
package-lock.json generated
View File

@ -12453,6 +12453,11 @@
"resolved": "https://registry.npmmirror.com/keycode/-/keycode-2.2.1.tgz",
"integrity": "sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg=="
},
"keypress": {
"version": "0.1.0",
"resolved": "https://registry.npmmirror.com/keypress/-/keypress-0.1.0.tgz",
"integrity": "sha512-x0yf9PL/nx9Nw9oLL8ZVErFAk85/lslwEP7Vz7s5SI1ODXZIgit3C5qyWjw4DxOuO/3Hb4866SQh28a1V1d+WA=="
},
"killable": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/killable/-/killable-1.0.1.tgz",
@ -14444,11 +14449,23 @@
"pinkie": "^2.0.0"
}
},
"pirates": {
"version": "4.0.6",
"resolved": "https://registry.npmmirror.com/pirates/-/pirates-4.0.6.tgz",
"integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==",
"dev": true
"pinyin": {
"version": "4.0.0-alpha.0",
"resolved": "https://registry.npmmirror.com/pinyin/-/pinyin-4.0.0-alpha.0.tgz",
"integrity": "sha512-hdxO/2RuLWarhLaIcGKdXjkFZ0hFr3W/Yrvrd0YPxuIafixMZSAa4jvxskYLgYHE8OkOXkGsxMsEScwGzqKe3g==",
"requires": {
"commander": "~1.1.1"
},
"dependencies": {
"commander": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/commander/-/commander-1.1.1.tgz",
"integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==",
"requires": {
"keypress": "0.1.x"
}
}
}
},
"pkg-dir": {
"version": "3.0.0",

View File

@ -81,6 +81,7 @@
"nvm": "0.0.4",
"object-assign": "4.1.1",
"papaparse": "^5.3.2",
"pinyin": "^4.0.0-alpha.0",
"postcss-flexbugs-fixes": "3.2.0",
"promise": "8.0.1",
"prop-types": "^15.6.1",

View File

@ -51,7 +51,7 @@
<script src="%PUBLIC_URL%js/alex/moment.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/alipay/alex/2.0.19/bundle/alex.all.global.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<meta name="viewport" content="">
<meta name="viewport" content="width=device-width, user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
<%= htmlWebpackPlugin.tags.bodyTags %>
<script>
var _hmt = _hmt || [];

View File

@ -23,6 +23,7 @@ import SiderBarHelp from './glcc/siderBarHelp';
import { SnackbarHOC, configShareForCustom } from 'educoder';
import { initAxiosInterceptors } from './AppConfig'
import cookie from 'react-cookies';
window.marked = marked;
const theme = createMuiTheme({

View File

@ -25,7 +25,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 || 'admin'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || ''
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -1,6 +1,7 @@
import React from "react";
import md5 from 'md5';
import {Input} from "antd";
import { url as ssrOrigin, host as ssrHost } from '../ssrUrl'
const { Search } = Input;
import { url as ssrOrigin, host as ssrHost } from '../ssrUrl'

View File

@ -28,8 +28,7 @@ function Releases({ owner, projectsId, releaseVersions, distribution }) {
:
<div className="mt8">
暂无发行版
{distribution && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}
new`,state:{stable:true}}}>发布新版本</Link>}
{distribution && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}}}>发布新版本</Link>}
</div>
}

View File

@ -1,8 +1,9 @@
import React, { useEffect } from 'react';
import { Form , Input , Row , Col, Button } from 'antd';
import { Form , Input , Row , Col, Button, message } from 'antd';
import '../index.scss';
import { postCreateZone } from '../api';
import axios from 'axios';
const { TextArea } = Input;
const phonereg = /^([1][3456789])\d{9}$/
@ -25,10 +26,10 @@ function Apply(props){
const zoneApplication = {...values};
postCreateZone(zoneApplication).then(response=>{
if(response && response.data && response.data.code===200){
props.showNotification("提交成功!");
message.success("您的专区申请已提交,请耐心等待管理员与您联系!");
setTimeout(() => {
window.location.href="/";
}, 70);
}, 1000);
}
}).catch(error=>{})
}
@ -55,6 +56,7 @@ function Apply(props){
callback();
}):callback();
}
return(
@ -72,9 +74,12 @@ function Apply(props){
label="专区名称"
>
{getFieldDecorator("name",{
rules:[{required:true,message:"请输入专区名称"}]
rules:[
{required:true,message:"请输入专区名称"},
{pattern: /^[a-zA-Z0-9\u4e00-\u9fa5\\_.-]{1,31}$/, message: "长度1-30,支持中文,英文,数字,可包含下划线(_),中划线(-),英文句号(.)"}
]
})(
<Input placeholder="请输入专区名称" maxLength={50} style={{height:"36px"}}/>
<Input placeholder="请输入专区名称" maxLength={30} style={{height:"36px"}}/>
)}
</Form.Item>
<Form.Item
@ -99,18 +104,18 @@ function Apply(props){
<Row type="flex" justify="space-between">
<Col span={11}>
<Form.Item
label="专区标识"
label="专区英文标识"
>
{getFieldDecorator("key",{
rules:[
{ required: true,message:"请输入专区域名标识" },
// { required: true,message:"" },
{ pattern: /^[a-zA-Z][a-zA-Z0-9_-]{0,18}[a-zA-Z]$/, message: "长度2-20只能包含数字、字母、下划线、中划线必须以字母开头结尾"},
{ validator:checkId }
],
validateTrigger:"onBlur",
validateFirst: true,
})(
<Input placeholder="请输入专区域名标识" maxLength={20} style={{height:"36px"}}/>
<Input placeholder="请输入专区域名标识,若未填写系统将根据专区名称自动生成" maxLength={20} style={{height:"36px"}}/>
)}
</Form.Item>
</Col>

View File

@ -22,7 +22,8 @@ function SelfList(props){
const pathname = props.location.pathname;
const { deptId} = props.match.params;
const { id , temp , data } = props;
const { sectionCmsTitle } = data;
// const { sectionCmsTitle } = data;
const sectionCmsTitle = data && data.sectionCmsTitle;
const limit = 15;
useEffect(()=>{

View File

@ -423,7 +423,7 @@ class Setting extends Component {
{/* <Mirror /> */}
</WhiteBack>
{
projectDetail && projectDetail.permission && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner")?
projectDetail && projectDetail.permission && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner" || projectDetail.permission ==="Manager")?
<WhiteBack className="dangerousBox mb20">
<div>
<div className="dangerousTitle">危险操作区</div>

View File

@ -1,5 +1,5 @@
import React , { useCallback, useEffect , useState } from 'react';
import { Button, Form, Input, Select, Upload, message, Popconfirm, Checkbox } from 'antd';
import { Button, Form, Input, Select, Upload, message, Popconfirm, Checkbox, Icon, Tooltip } from 'antd';
import {getUploadActionUrl} from 'educoder';
import {applyGlcc, findStudentTaskByTaskId, updateApplyGlcc} from '../api';
import TextArea from 'antd/lib/input/TextArea';
@ -231,13 +231,23 @@ function EditRepoApplyInfo(props) {
{cateList && cateList.map(item=> {return <Option value={item.name} key={item.id}>{item.name}</Option>})}
</Select>
)}
{helper('GitLink地址',
'',
'gitlinkUrl',
[{ required: true, message: "请输入GitLink项目地址" },
{ max: 252, message: '超出限制长度252位字符请重新编辑' }],
<Input placeholder="请输入GitLink项目地址" onBlur={()=>{verify("gitlink")}}/>
)}
<div className='posiHasQuestionBox'>
{helper('项目仓库地址',
'如需GLCC资助项目奖金请将项目迁移到Gitlink平台',
'gitlinkUrl',
[{ required: true, message: "请输入项目仓库地址" },
{ max: 252, message: '超出限制长度252位字符请重新编辑' }],
<Input placeholder="请输入项目仓库地址" onBlur={()=>{verify("gitlink")}}/>
)}
{/* <Tooltip title={<div>
迁移方式详见 <a href='https://forum.gitlink.org.cn/forums/10594/detail' target="_blank" style={{color: "#466aff"}}>迁移说明文档</a>
</div>}
>
<Icon type="question-circle" theme="filled" className="question mt15 ml10"/>
</Tooltip> */}
<a href='https://forum.gitlink.org.cn/forums/10594/detail' className="question" target="_blank" style={{color: "#466aff"}}>迁移说明文档</a>
</div>
<Form.Item label="联系人姓名">
{getFieldDecorator("contactName", { rules: [{ required: true, message: "请输入项目联系人姓名" },
{ max: 32, message: '超出限制长度32位字符请重新编辑' }], validateFirst: true, initialValue: current_user.username })(

View File

@ -85,7 +85,7 @@ function Apply(props) {
<p className='font-15 c000'>申请说明</p>
<div>1项目报名时间为<span className='c000'>{formatParsedResult(applyTime, "rangeDay")}</span>请在报名截止时间北京时间<span className='c000'>{formatParsedResult(applyTime, "end")}</span>前提交报名信息</div>
<div>2本次GLCC夏令营建议使用GitLink为代码托管平台学生基于GitLink上项目完成编程任务同时也欢迎使用其他代码托管平台的项目参与活动目前GLCC只对夏令营期间使用GitLink托管的项目提供部分奖励支持</div>
<div>3如果您的项目还未迁移到GitLink上迁移事项请查看<a href='https://help.gitlink.org.cn/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B/%E5%AF%BC%E5%85%A5GitHub%E7%AD%89%E7%AC%AC%E4%B8%89%E6%96%B9Git%E9%A1%B9%E7%9B%AE?_highlight=%E5%AF%BC%E5%85%A5' target="_blank" className='link'>迁移说明文档</a>如在迁移过程中遇到问题请加qq群: 1071514693 联系qq群管理员</div>
<div>3如果您的项目还未迁移到GitLink上迁移事项请查看<a href='https://forum.gitlink.org.cn/forums/10594/detail' target="_blank" className='link'>迁移说明文档</a>如在迁移过程中遇到问题请加qq群: 1071514693 联系qq群管理员</div>
<div>4提交社区和题目信息后欢迎与组委会联系沟通宣传推广和后续合作工作联系人微信: _TigerWang备注GitLink编程夏令营</div>
<div>5在项目报名期间{formatParsedResult(applyTime, "rangeDay")}您可以随时进入当前页调整项目或课题报名信息</div>
<div><span className='c000'>6课题奖励默认由项目方支持可提供现金或者实习机会等其他形式的奖励请根据课题难度设定奖励内容若您可能无法支撑本课题奖励GLCC组委会将进行资助评审择优资助如未获得资助将下线该课题</span></div>

View File

@ -57,6 +57,33 @@
max-height: 100px;
}
}
.posiHasQuestionBox{
width: 50%;
display: flex;
flex-direction: column;
position: relative;
.question{
color: $primary-color;
position: absolute;
bottom: 20px;
right:20px;
}
.ant-row.ant-form-item{
width: 100%;
}
}
.hasQuestionBox{
width: 50%;
display: inline-flex;
.question{
color: $primary-color;
}
.ant-row.ant-form-item{
width: 100%;
}
}
}
.introArea{
width: 100%;

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import {Form, Input, Radio, Select } from 'antd';
import {Form, Icon, Input, Radio, Select, Tooltip } from 'antd';
import TextArea from 'antd/lib/input/TextArea';
import { rewardMoney } from '../api';
const Option = Select.Option;
@ -36,13 +36,22 @@ function TaskApply(props) {
{ max: 32, message: '超出限制长度32位字符请重新编辑' }],
<Input placeholder="请输入课题名称" {...disabledProps}/>
)}
{helper('课题链接',
'',
`taskUrl${taskKey}`,
[{ required: true, message: "请输入课题链接" },
{ max: 252, message: '超出限制长度252位字符请重新编辑' }],
<Input placeholder="请输入课题链接" {...disabledProps}/>
)}
<div className='hasQuestionBox'>
{helper('课题链接',
'',
`taskUrl${taskKey}`,
[{ required: true, message: "请输入课题链接" },
{ max: 252, message: '超出限制长度252位字符请重新编辑' }],
<Input placeholder="请输入课题链接" {...disabledProps}/>
)}
<Tooltip title={<div>
以issue的形式发布课题的具体内容可参考 <a href='https://www.gitlink.org.cn/KomachiSion/nacos/issues/1' target="_blank" style={{color: "#466aff"}}>课题样例</a>
</div>}
>
<Icon type="question-circle" theme="filled" className="question mt12 ml10"/>
</Tooltip>
</div>
{helper('课题难度',
'',
`taskDifficulty${taskKey}`,
@ -122,7 +131,7 @@ function TaskApply(props) {
`taskDesc${taskKey}`,
[{ required: true, message: "请输入课题简介" },
{ max: 200, message: '超出限制长度200位字符请重新编辑' }],
<TextArea placeholder="请输入课题简介" rows={4} {...disabledProps}/>
<TextArea placeholder="请输入课题简介,以便学生快速了解课题" rows={4} {...disabledProps}/>
)}</div>
</div>
</div>

View File

@ -3,6 +3,7 @@ import Login from "./Login";
import Register from "./Register";
import ResetPassword from "./ResetPassword";
import logo from './img/logo.svg';
import logo1 from './img/gitlinkLogo.png';
import banner from './img/banner.png';
import ball from './img/ball.png';
import img1 from './img/img1.png';
@ -15,10 +16,13 @@ function LoginRegisterPage(props){
<div className="loginRegister">
<div className="login_register_left">
<img src={logo} className="logo" alt="" onClick={()=>{window.location.href='/'}} />
<img src={ball} className="ball" alt="" />
<img src={banner} className="banner" alt="" />
<div className="spinningBall">
<img src={ball} className="ball" alt="" />
<img src={banner} className="banner" alt="" />
</div>
</div>
<div className="login_register_right">
<img src={logo1} className="logoInSmall" alt="" onClick={()=>{window.location.href='/'}} />
{props.location.pathname === "/resetPassword" ?
<ResetPassword mygetHelmetapi={mygetHelmetapi}/>
:

View File

@ -9,45 +9,34 @@
background-repeat: no-repeat;
background-position: center;
}
/*当页面宽度大于1000px*/
@media screen and (min-width:1000px) {
.banner{
margin-top: 45vh;
height: auto;
}
.ball{ top: 51vh; }
.right_cont{width: 540px; }
.ResetPassword_content{top: 12vh; }
}
/*当页面宽度大于1280px*/
@media screen and (min-width:1280px) {
.banner{ margin-top: 35vh; }
.ball{ top: 43vh; }
}
/*当页面宽度大于1680px*/
@media screen and (min-width:1680px) {
.banner{ height: 460px; }
.ball{ top: 42vh; }
.right_cont{width: 580px; }
.ResetPassword_content{top: 16vh; }
}
.login_register_left{
height: 100%;
background-image: url(./img/bg.png);
float: left;
width: 30%;
overflow: hidden;
position: relative;
.logo{
width: 54%;
margin-left: 22%;
margin-top: 20%;
&:hover{cursor: pointer; }
}
.ball{
.spinningBall{
width: 100%;
position: absolute;
bottom: -10%;
}
.banner{
height: auto;
width: 100%;
}
.ball{
position: relative;
width: 50%;
left: 24%;
bottom: -15vh;
z-index: 2;
width: 14vw;
left: 7.5vw;
animation: moving2 10s linear infinite;
}
@keyframes moving2 {
@ -59,6 +48,9 @@
.login_register_right{
height: 100%;
background-image: url(./img/rightBg.png);
.logoInSmall{
display: none;
}
.img1{
width: 15vw;
margin-top: 40vh;
@ -185,22 +177,15 @@
}
}
//第三方登录
.quick_logon{
.quick_login{
text-align: center;
.quick_logon_p{
border-top: 1px solid #979797;
margin-top: 24px;
.quick_login_Divider{
margin-top: 13px;
&::before, &::after{
border-top: 1px solid #979797;
}
}
.startlogin{
position: relative;
background: #dee1f4;
display: block;
width: 90px;
top: -15px;
left: 39%;
font-size: 13px;
color: #8D8D8D;
}
}
@ -240,4 +225,70 @@
display: inline-block;
border-bottom: 2px solid;
}
}
/*当页面宽度大于1000px*/
@media screen and (min-width:1000px) {
.right_cont{width: 540px; }
.ResetPassword_content{top: 12vh; }
}
/*当页面宽度大于1680px*/
@media screen and (min-width:1680px) {
.right_cont{width: 580px; }
.ResetPassword_content{top: 16vh; }
}
@media screen and (max-width:1280px) {
.login_register_left .ball{
width: 40%;
bottom: -8vh;
left: 28%;
}
}
// 小屏或者手机端隐藏左侧banner
@media screen and (max-width:786px) {
#root{
width: auto;
}
.login_register_left{
display: none;
}
.login_register_right{
padding-top: 30px;
.right_cont{
position: static;
margin: 0 auto;
width: fit-content;
}
.img1, .img2{
display: none;
}
.logoInSmall{
display: block;
margin: 0 auto 30px;
}
}
}
@media screen and (max-width:500px) {
.login_register_right{
background-color: #f4f7ff;
background-image: none;
}
.login_register_right .right_cont{
padding: 20px;
width: auto;
}
}
@media screen and (max-width:360px) {
.login_register_right .right_cont{
.login_register_head>span:first-child{
font-size: 1.2em;
}
}
.quick_login img{
width: 40px !important;
}
}

View File

@ -1,5 +1,5 @@
import React,{useState ,useEffect} from 'react';
import { Tooltip } from 'antd';
import { Divider, Tooltip } from 'antd';
import educoderLogo from '../../login/educoder.png';
import qqlogo from '../../login/qq@2x.png';
import WeChatlogo from '../../login/WeChat@2x.png';
@ -16,9 +16,10 @@ function OtherLogin(){
return(
setting && setting.third_party_new && setting.third_party_new.length > 0 ?
<p className="quick_logon">
<p className="quick_logon_p"></p>
<span className={"startlogin"}>&nbsp;快速登录&nbsp;</span>
<div className="quick_login">
<Divider className="quick_login_Divider">
<span className='font-13 startlogin'>快速登录</span>
</Divider>
{setting.third_party_new.map((item,key)=>{
return(
<a href={`${item.url}`} className="ml15 mr15">
@ -29,7 +30,7 @@ function OtherLogin(){
)
})
}
</p>
</div>
:""
)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB