Compare commits
167 Commits
master
...
gitlink_se
| Author | SHA1 | Date |
|---|---|---|
|
|
4a322d1e2e | |
|
|
79331db271 | |
|
|
652de9b441 | |
|
|
f2a660d595 | |
|
|
711c2e57da | |
|
|
6fc441d7c5 | |
|
|
b4e2c6148a | |
|
|
0735968e73 | |
|
|
37f5bce087 | |
|
|
951792dc11 | |
|
|
7d7f265ffb | |
|
|
7495c54f8d | |
|
|
631f8ceeea | |
|
|
d70ddfb2f7 | |
|
|
54741a6d8a | |
|
|
116c3e531f | |
|
|
990cfe2781 | |
|
|
66e1235c3b | |
|
|
76fdff6737 | |
|
|
4bc79b5153 | |
|
|
3085e40426 | |
|
|
ea979b78ee | |
|
|
b1775e5158 | |
|
|
3678b8eb72 | |
|
|
12d8f5bf5d | |
|
|
e04fb11194 | |
|
|
010edf3cb2 | |
|
|
ab26a528b6 | |
|
|
6d39e25667 | |
|
|
a2ea832208 | |
|
|
d1bc3680b9 | |
|
|
08416390e5 | |
|
|
190200d1e6 | |
|
|
b124364203 | |
|
|
35c2f63c55 | |
|
|
30c61f0a7d | |
|
|
743dabd553 | |
|
|
015296e065 | |
|
|
48c21ac245 | |
|
|
a93b8a08c9 | |
|
|
1c48ffb130 | |
|
|
0ee9280bb1 | |
|
|
e785e9a358 | |
|
|
b3b95e9856 | |
|
|
5be8ead356 | |
|
|
7d78919c4a | |
|
|
d5b4c5425f | |
|
|
f259f05cdc | |
|
|
95cd289373 | |
|
|
e739f5b786 | |
|
|
c79be9a597 | |
|
|
fb03565a25 | |
|
|
7ec53a246c | |
|
|
56946f94e8 | |
|
|
61ee3fe36f | |
|
|
d5f989bbe2 | |
|
|
f5817e5150 | |
|
|
1c24baf3b9 | |
|
|
3d3ef19d4a | |
|
|
7b77c46915 | |
|
|
746f552a21 | |
|
|
7872d5ecab | |
|
|
60da6bd110 | |
|
|
a3bbf6b1c1 | |
|
|
d37709b1a5 | |
|
|
aeff357660 | |
|
|
0e6cb3954a | |
|
|
ae12618c0c | |
|
|
914966bd39 | |
|
|
f89f4b6628 | |
|
|
7407545d1f | |
|
|
f0ffc9a29c | |
|
|
987eb39681 | |
|
|
848109afe8 | |
|
|
d7bdb35bb7 | |
|
|
254b3173d1 | |
|
|
44f06b7305 | |
|
|
b16e95923a | |
|
|
98a7f73c04 | |
|
|
b6a450a482 | |
|
|
66c495d6b5 | |
|
|
42139ef998 | |
|
|
925d5ea356 | |
|
|
ad1f0e29e7 | |
|
|
3da9306ed6 | |
|
|
568a632d65 | |
|
|
5982c0df96 | |
|
|
21046bbcb7 | |
|
|
0c816805fb | |
|
|
28f8b6b54c | |
|
|
7d087ec1f2 | |
|
|
beba8975ca | |
|
|
d4690cc8b5 | |
|
|
38021c2e4b | |
|
|
4233811ae3 | |
|
|
8273acd195 | |
|
|
cacb8c84ae | |
|
|
fb8ae3fcdf | |
|
|
a257d832cb | |
|
|
ff7d191011 | |
|
|
9a2c3f1754 | |
|
|
bcdf506e6c | |
|
|
ccc6cb5d26 | |
|
|
0661c6b932 | |
|
|
99947c0c87 | |
|
|
03cff6ec2e | |
|
|
f86acfebdf | |
|
|
9a62d7806e | |
|
|
a7df6da5f0 | |
|
|
eab68ac270 | |
|
|
a9e3513706 | |
|
|
6b20391c72 | |
|
|
3135300fe6 | |
|
|
ecc6387113 | |
|
|
990c4e22b0 | |
|
|
7eea9316dd | |
|
|
6a546c79e4 | |
|
|
4c48b6c77a | |
|
|
4d5430c3ed | |
|
|
d49af735f1 | |
|
|
03370e8a07 | |
|
|
0b43fa8952 | |
|
|
465c4cc8c7 | |
|
|
37668ddcd4 | |
|
|
7102594444 | |
|
|
b2f2df65bb | |
|
|
8a577fb263 | |
|
|
5c491071b6 | |
|
|
c554237076 | |
|
|
d22a741bf7 | |
|
|
383b3f5d74 | |
|
|
63da7adcf9 | |
|
|
3243aeebc6 | |
|
|
1a86a75345 | |
|
|
3b6cc99d49 | |
|
|
d872ffc606 | |
|
|
3b69c01ead | |
|
|
1e0608aa14 | |
|
|
9b6816e346 | |
|
|
6ee257231d | |
|
|
70edb73f6c | |
|
|
5c7553d4aa | |
|
|
278701f24b | |
|
|
97ab819bf9 | |
|
|
d870f17b85 | |
|
|
91ac6c2357 | |
|
|
3702d1c1a5 | |
|
|
93d48c359e | |
|
|
80dace18e9 | |
|
|
375cbb37df | |
|
|
10d933e037 | |
|
|
4fdd3f6f80 | |
|
|
458b56e33b | |
|
|
c256887132 | |
|
|
6a588db7f6 | |
|
|
6c4e1c6665 | |
|
|
c554d2c00d | |
|
|
b69bf5974a | |
|
|
ecb1691b4d | |
|
|
6a9f2b31a6 | |
|
|
4947cd8456 | |
|
|
8429effe16 | |
|
|
49ebe450be | |
|
|
e3c926da77 | |
|
|
af48da2eb3 | |
|
|
6630309466 | |
|
|
a7c3dee7e3 |
|
|
@ -1268,11 +1268,17 @@ a.shixun-task-btn {
|
|||
|
||||
|
||||
/*-----------实训配置、评测脚本-------------*/
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 2340181 */
|
||||
src: url('iconfont.woff2?t=1631773579834') format('woff2'),
|
||||
url('iconfont.woff?t=1631773579834') format('woff'),
|
||||
url('iconfont.ttf?t=1631773579834') format('truetype');
|
||||
}
|
||||
html body {
|
||||
font-size: 14px;
|
||||
line-height: 2.0;
|
||||
background: #fafafa;
|
||||
font-family: "Microsoft YaHei", "SimSun";
|
||||
font-family: "iconfont";
|
||||
color: #05101a;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
|
|
@ -3941,7 +3947,7 @@ html>body #ajax-indicator {
|
|||
}
|
||||
.head-nav {
|
||||
text-align: center;
|
||||
height: 70px;
|
||||
height: 58px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
|
@ -3953,14 +3959,14 @@ html>body #ajax-indicator {
|
|||
position: absolute;
|
||||
top: 0px;
|
||||
z-index: 3;
|
||||
height: 70px;
|
||||
height: 58px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li {
|
||||
float: left;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
height: 58px;
|
||||
line-height: 58px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
|
|
@ -3971,7 +3977,7 @@ html>body #ajax-indicator {
|
|||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
|
@ -3983,10 +3989,6 @@ html>body #ajax-indicator {
|
|||
margin-right: 0px
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li.active{
|
||||
/* background-color: #3B3B3B; */
|
||||
}
|
||||
|
||||
|
||||
.head-nav ul#header-nav li p:hover {
|
||||
color: #cccccc;
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.4 KiB |
851
src/App.js
|
|
@ -3,14 +3,14 @@ import './App.css';
|
|||
import { ConfigProvider } from 'antd'
|
||||
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
||||
import {
|
||||
// BrowserRouter as Router,
|
||||
Route,
|
||||
Switch
|
||||
// BrowserRouter as Router,
|
||||
Route,
|
||||
Switch
|
||||
} from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import LoginDialog from './modules/login/LoginDialog';
|
||||
import 'babel-polyfill';
|
||||
import Loading from './Loading'
|
||||
import Loading from './Loading';
|
||||
|
||||
import Loadable from 'react-loadable';
|
||||
import marked from './common/marked';
|
||||
|
|
@ -26,18 +26,18 @@ import configureStore from './redux/stores/configureStore';
|
|||
const store = configureStore();
|
||||
window.marked = marked;
|
||||
const theme = createMuiTheme({
|
||||
palette: {
|
||||
primary: {
|
||||
main: '#4CACFF',
|
||||
contrastText: 'rgba(255, 255, 255, 0.87)'
|
||||
},
|
||||
secondary: { main: '#4CACFF' }, // #11cb5f This is just green.A700 as hex.
|
||||
},
|
||||
palette: {
|
||||
primary: {
|
||||
main: '#4CACFF',
|
||||
contrastText: 'rgba(255, 255, 255, 0.87)'
|
||||
},
|
||||
secondary: { main: '#4CACFF' }, // #11cb5f This is just green.A700 as hex.
|
||||
},
|
||||
});
|
||||
//forge项目
|
||||
const Projects = Loadable({
|
||||
loader: () => import('./forge/Index'),
|
||||
loading: Loading,
|
||||
loader: () => import('./forge/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
// forge项目详情
|
||||
const ProjectDetail = Loadable({
|
||||
|
|
@ -46,470 +46,493 @@ const ProjectDetail = Loadable({
|
|||
});
|
||||
//forge安全设置
|
||||
const Security = Loadable({
|
||||
loader: () => import('./forge/SecuritySetting/Index'),
|
||||
loading: Loading,
|
||||
loader: () => import('./forge/SecuritySetting/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
//forge项目-devOps详情
|
||||
const OpsDetail = Loadable({
|
||||
loader: () => import('./forge/DevOps/opsDetail'),
|
||||
loading: Loading,
|
||||
loader: () => import('./forge/DevOps/opsDetail'),
|
||||
loading: Loading,
|
||||
})
|
||||
//403页面
|
||||
const Shixunauthority = Loadable({
|
||||
loader: () => import('./modules/403/Shixunauthority'),
|
||||
loading: Loading,
|
||||
loader: () => import('./modules/403/Shixunauthority'),
|
||||
loading: Loading,
|
||||
})
|
||||
//404页面
|
||||
const Shixunnopage = Loadable({
|
||||
loader: () => import('./modules/404/Shixunnopage'),
|
||||
loading: Loading,
|
||||
loader: () => import('./modules/404/Shixunnopage'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
//500页面
|
||||
const http500 = Loadable({
|
||||
loader: () => import('./modules/500/http500'),
|
||||
loading: Loading,
|
||||
loader: () => import('./modules/500/http500'),
|
||||
loading: Loading,
|
||||
})
|
||||
const InfosIndex = Loadable({
|
||||
loader: () => import('./forge/users/Index'),
|
||||
loading: Loading,
|
||||
loader: () => import('./forge/users/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
// 组织
|
||||
const OrganizeIndex = Loadable({
|
||||
loader: () => import('./forge/Team/Index'),
|
||||
loading: Loading,
|
||||
loader: () => import('./forge/Team/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
const EducoderLogin = Loadable({
|
||||
loader: () => import('./modules/login/EducoderLogin'),
|
||||
loading: Loading,
|
||||
loader: () => import('./modules/login/EducoderLogin'),
|
||||
loading: Loading,
|
||||
})
|
||||
const Search = Loadable({
|
||||
loader: () => import('./modules/search/'),
|
||||
loading: Loading,
|
||||
loader: () => import('./modules/search/'),
|
||||
loading: Loading,
|
||||
})
|
||||
const WikiPreview = Loadable({
|
||||
loader: () => import('./forge/Wiki/Preview'),
|
||||
loading: Loading,
|
||||
loader: () => import('./forge/Wiki/Preview'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
const ProjectIndex = Loadable({
|
||||
loader: () => import("./forge/Index"),
|
||||
loading: Loading,
|
||||
loader: () => import("./forge/Index"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const Home = Loadable({
|
||||
loader: () => import('./home/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
const LoginRegisterPage = Loadable({
|
||||
loader: () => import("./modules/loginRegister/LoginRegisterPage"),
|
||||
loading: Loading,
|
||||
});
|
||||
// const CreateMerge = Loadable({
|
||||
// loader: () => import('./forge/Merge/NewMerge'),
|
||||
// loading: Loading,
|
||||
// })
|
||||
|
||||
// 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。
|
||||
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize"];
|
||||
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize","login","register","resetPassword"];
|
||||
|
||||
class App extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
Addcoursestype: false,
|
||||
Addcoursestypes: false,
|
||||
mydisplay: false,
|
||||
occupation: 0,
|
||||
mygetHelmetapi: null,
|
||||
pathType: null,
|
||||
pathName: null,
|
||||
}
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
Addcoursestype: false,
|
||||
Addcoursestypes: false,
|
||||
mydisplay: false,
|
||||
occupation: 0,
|
||||
mygetHelmetapi: null,
|
||||
pathType: null,
|
||||
pathName: null,
|
||||
}
|
||||
}
|
||||
|
||||
UNSAFE_componentWillMount() {
|
||||
initAxiosInterceptors(this.props);
|
||||
let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : '';
|
||||
pathname && this.getPathnameType(pathname);
|
||||
UNSAFE_componentWillMount() {
|
||||
initAxiosInterceptors(this.props);
|
||||
let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : '';
|
||||
pathname && this.getPathnameType(pathname);
|
||||
|
||||
// 添加路由监听,决定组织还是个人
|
||||
this.unlisten = this.props.history.listen((location) => {
|
||||
let newPathname = location.pathname.split('/')[1];
|
||||
if (this.state.pathName !== newPathname) {
|
||||
// this.setState({ pathType: '' });
|
||||
newPathname && this.getPathnameType(newPathname);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 添加路由监听,决定组织还是个人
|
||||
this.unlisten = this.props.history.listen((location) => {
|
||||
let newPathname = location.pathname.split('/')[1];
|
||||
if (this.state.pathName !== newPathname) {
|
||||
// this.setState({ pathType: '' });
|
||||
newPathname && this.getPathnameType(newPathname);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
// (!keyWord.includes(this.props.location.pathname.split('/')[1])) &&
|
||||
if (nextProps.location.pathname.split('/')[1] !== this.props.location.pathname.split('/')[1] && nextState.pathType === this.state.pathType) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
if(!nextProps.location.pathname==='/'){
|
||||
return true;
|
||||
}
|
||||
// 阻止个人与组织切换时(组件渲染)请求导致的404
|
||||
if (nextProps.location.pathname.split('/')[1] !== this.props.location.pathname.split('/')[1] && nextState.pathType === this.state.pathType) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
getPathnameType = (pathname) => {
|
||||
if (!keyWord.includes(pathname)) {
|
||||
let url = `/owners/${pathname}.json`;
|
||||
axios.get(url).then((response) => {
|
||||
if (response && response.status === 200) {
|
||||
this.setState({
|
||||
pathType: response.data.type || '404',
|
||||
pathName: pathname,
|
||||
})
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.setState({
|
||||
pathType: pathname,
|
||||
pathName: pathname,
|
||||
});
|
||||
}
|
||||
}
|
||||
getPathnameType = (pathname) => {
|
||||
if (!keyWord.includes(pathname)) {
|
||||
let url = `/owners/${pathname}.json`;
|
||||
axios.get(url).then((response) => {
|
||||
if (response && response.status === 200) {
|
||||
this.setState({
|
||||
pathType: response.data.type || '404',
|
||||
pathName: pathname,
|
||||
})
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.setState({
|
||||
pathType: pathname,
|
||||
pathName: pathname,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
HideAddcoursestypess = (i) => {
|
||||
this.setState({
|
||||
Addcoursestype: false,
|
||||
Addcoursestypes: false,
|
||||
mydisplay: true,
|
||||
occupation: i,
|
||||
})
|
||||
};
|
||||
hideAddcoursestypes = () => {
|
||||
this.setState({
|
||||
Addcoursestypes: false
|
||||
})
|
||||
};
|
||||
HideAddcoursestypess = (i) => {
|
||||
this.setState({
|
||||
Addcoursestype: false,
|
||||
Addcoursestypes: false,
|
||||
mydisplay: true,
|
||||
occupation: i,
|
||||
})
|
||||
};
|
||||
hideAddcoursestypes = () => {
|
||||
this.setState({
|
||||
Addcoursestypes: false
|
||||
})
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
document.title = "loading...";
|
||||
componentDidMount() {
|
||||
document.title = "loading...";
|
||||
|
||||
this.getAppdata();
|
||||
this.getAppdata();
|
||||
|
||||
window.addEventListener('error', (event) => {
|
||||
const msg = `${event.type}: ${event.message}`;
|
||||
});
|
||||
window.addEventListener('error', (event) => {
|
||||
const msg = `${event.type}: ${event.message}`;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.unlisten && this.unlisten(); // 执行解绑
|
||||
}
|
||||
componentWillUnmount() {
|
||||
this.unlisten && this.unlisten(); // 执行解绑
|
||||
}
|
||||
|
||||
//修改登录方法
|
||||
Modifyloginvalue = () => {
|
||||
this.setState({
|
||||
isRender: false,
|
||||
})
|
||||
};
|
||||
//修改登录方法
|
||||
Modifyloginvalue = () => {
|
||||
this.setState({
|
||||
isRender: false,
|
||||
})
|
||||
};
|
||||
|
||||
//获取数据为空的时候
|
||||
gettablogourlnull = () => {
|
||||
this.setState({
|
||||
mygetHelmetapi: undefined
|
||||
});
|
||||
document.title = "Forge";
|
||||
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);
|
||||
};
|
||||
//获取数据为空的时候
|
||||
gettablogourlnull = () => {
|
||||
this.setState({
|
||||
mygetHelmetapi: undefined
|
||||
});
|
||||
document.title = "Forge";
|
||||
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);
|
||||
}
|
||||
//获取当前定制信息
|
||||
getAppdata = () => {
|
||||
let url = "/setting.json";
|
||||
axios.get(url).then((response) => {
|
||||
if (response) {
|
||||
if (response.data) {
|
||||
this.setState({
|
||||
mygetHelmetapi: 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();
|
||||
}
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.gettablogourlnull();
|
||||
});
|
||||
};
|
||||
//获取数据的时候
|
||||
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);
|
||||
}
|
||||
//获取当前定制信息
|
||||
getAppdata = () => {
|
||||
let url = "/setting.json";
|
||||
axios.get(url).then((response) => {
|
||||
if (response) {
|
||||
if (response.data) {
|
||||
this.setState({
|
||||
mygetHelmetapi: 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();
|
||||
}
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.gettablogourlnull();
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { mygetHelmetapi, pathType} = this.state;
|
||||
let personal = mygetHelmetapi && mygetHelmetapi.personal;
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<ConfigProvider locale={zhCN}>
|
||||
<MuiThemeProvider theme={theme}>
|
||||
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
|
||||
<SiderBar />
|
||||
{/* <Router> */}
|
||||
<Switch>
|
||||
{/* wiki预览 */}
|
||||
<Route path="/:owner/:projectsId/wiki/preview/:projectName/:projectId" render={
|
||||
(props) => {
|
||||
return (<WikiPreview {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
} />
|
||||
render() {
|
||||
const { mygetHelmetapi, pathType} = this.state;
|
||||
let personal = mygetHelmetapi && mygetHelmetapi.personal;
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<ConfigProvider locale={zhCN}>
|
||||
<MuiThemeProvider theme={theme}>
|
||||
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
|
||||
<SiderBar />
|
||||
{/* <Router> */}
|
||||
<Switch>
|
||||
{/* wiki预览 */}
|
||||
<Route path="/:owner/:projectsId/wiki/preview/:projectName/:projectId" render={
|
||||
(props) => {
|
||||
return (<WikiPreview {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
} />
|
||||
|
||||
{/* 项目PR */}
|
||||
<Route path="/:owner/:projectsId/compare"
|
||||
render={
|
||||
(props) => (<ProjectDetail {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
{/* 项目PR */}
|
||||
<Route path="/:owner/:projectsId/compare"
|
||||
render={
|
||||
(props) => (<ProjectDetail {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
{/*项目*/}
|
||||
<Route
|
||||
path={"/:owner/:projectId/devops/:opsId/detail"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OpsDetail {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
<Route
|
||||
path={"/settings"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Security {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
{/*403*/}
|
||||
<Route path="/403" component={Shixunauthority} />
|
||||
|
||||
<Route path="/500" component={http500} />
|
||||
|
||||
{/*404*/}
|
||||
<Route path="/nopage" component={Shixunnopage} />
|
||||
|
||||
{/* 查询 */}
|
||||
<Route path="/search" component={Search} />
|
||||
|
||||
<Route exact path="/explore/all"
|
||||
render={
|
||||
(props) => (
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
<Route exact path="/explore"
|
||||
render={
|
||||
(props) => (
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
{/* 登录 */}
|
||||
<Route
|
||||
path="/login"
|
||||
render={(props) =><LoginRegisterPage {...this.props} {...props}/>}
|
||||
></Route>
|
||||
|
||||
{/*项目*/}
|
||||
<Route
|
||||
path={"/:owner/:projectId/devops/:opsId/detail"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OpsDetail {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
<Route
|
||||
path={"/settings"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Security {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
|
||||
{/* 注册 */}
|
||||
<Route
|
||||
path="/register"
|
||||
render={
|
||||
(props) => {
|
||||
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}
|
||||
/>
|
||||
{/*403*/}
|
||||
<Route path="/403" component={Shixunauthority} />
|
||||
render={(props) =><LoginRegisterPage {...this.props} {...props}/>}
|
||||
></Route>
|
||||
|
||||
<Route path="/500" component={http500} />
|
||||
|
||||
{/*404*/}
|
||||
<Route path="/nopage" component={Shixunnopage} />
|
||||
|
||||
{/* 查询 */}
|
||||
<Route path="/search" component={Search} />
|
||||
|
||||
<Route exact path="/explore"
|
||||
render={
|
||||
(props) => (
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
{/* 组织 */}
|
||||
<Route path={"/organize"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
{/*新建项目等*/}
|
||||
{/* 忘记密码 */}
|
||||
<Route
|
||||
path={"/projects"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Projects {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
path="/resetPassword"
|
||||
render={(props) =><LoginRegisterPage {...this.props} {...props}/>}
|
||||
></Route>
|
||||
|
||||
{/* 判断为用户/组织,并进入对应页面 */}
|
||||
{
|
||||
pathType === 'User' ?
|
||||
<Route exact path="/:username"
|
||||
render={
|
||||
(props) => {
|
||||
return (<InfosIndex {...this.props} {...this.state} />)
|
||||
}
|
||||
}
|
||||
/> : pathType === 'Organization' ? <Route path={"/:OIdentifier"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route> : pathType === '404' ? <Route component={Shixunnopage} />:
|
||||
<Route exact path="/"
|
||||
render={
|
||||
(props) => (
|
||||
personal && personal.length > 0 ?
|
||||
<InfosIndex {...this.props} {...props} />
|
||||
:
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
// <Route path="/" component={Loading} />
|
||||
// <Route path="/" component={Shixunnopage} />
|
||||
}
|
||||
{/* 组织 */}
|
||||
<Route path={"/organize"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
{/*新建项目等*/}
|
||||
<Route
|
||||
path={"/projects"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Projects {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
{/* 判断为用户/组织,并进入对应页面 */}
|
||||
{
|
||||
pathType === 'User' ?
|
||||
<Route exact path="/:username"
|
||||
render={
|
||||
(props) => {
|
||||
return (<InfosIndex {...this.props} {...this.state} />)
|
||||
}
|
||||
}
|
||||
/> : pathType === 'Organization' ? <Route path={"/:OIdentifier"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route> : pathType === '404' ? <Route component={Shixunnopage} />:
|
||||
""
|
||||
}
|
||||
<Route exact path="/"
|
||||
render={
|
||||
(props) => (
|
||||
<Home {...props} {...this.props} {...this.state}/>
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
{/* 个人主页 */}
|
||||
<Route path="/:username"
|
||||
render={
|
||||
(props) => {
|
||||
return (<InfosIndex {...this.props} {...this.state} />)
|
||||
}
|
||||
}></Route>
|
||||
|
||||
|
||||
|
||||
{/* 个人主页 */}
|
||||
<Route path="/:username"
|
||||
render={
|
||||
(props) => {
|
||||
return (<InfosIndex {...this.props} {...this.state} />)
|
||||
}
|
||||
}></Route>
|
||||
|
||||
|
||||
<Route component={Shixunnopage} />
|
||||
</Switch>
|
||||
{/* </Router> */}
|
||||
</MuiThemeProvider>
|
||||
</ConfigProvider>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
<Route component={Shixunnopage} />
|
||||
</Switch>
|
||||
{/* </Router> */}
|
||||
</MuiThemeProvider>
|
||||
</ConfigProvider>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// moment国际化,设置为中文
|
||||
moment.defineLocale('zh-cn', {
|
||||
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
|
||||
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
|
||||
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
|
||||
weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
|
||||
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
|
||||
longDateFormat: {
|
||||
LT: 'Ah点mm分',
|
||||
LTS: 'Ah点m分s秒',
|
||||
L: 'YYYY-MM-DD',
|
||||
LL: 'YYYY年MMMD日',
|
||||
LLL: 'YYYY年MMMD日Ah点mm分',
|
||||
LLLL: 'YYYY年MMMD日ddddAh点mm分',
|
||||
l: 'YYYY-MM-DD',
|
||||
ll: 'YYYY年MMMD日',
|
||||
lll: 'YYYY年MMMD日Ah点mm分',
|
||||
llll: 'YYYY年MMMD日ddddAh点mm分'
|
||||
},
|
||||
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
|
||||
meridiemHour: function (hour, meridiem) {
|
||||
if (hour === 12) {
|
||||
hour = 0;
|
||||
}
|
||||
if (meridiem === '凌晨' || meridiem === '早上' ||
|
||||
meridiem === '上午') {
|
||||
return hour;
|
||||
} else if (meridiem === '下午' || meridiem === '晚上') {
|
||||
return hour + 12;
|
||||
} else {
|
||||
// '中午'
|
||||
return hour >= 11 ? hour : hour + 12;
|
||||
}
|
||||
},
|
||||
meridiem: function (hour, minute, isLower) {
|
||||
var hm = hour * 100 + minute;
|
||||
if (hm < 600) {
|
||||
return '凌晨';
|
||||
} else if (hm < 900) {
|
||||
return '早上';
|
||||
} else if (hm < 1130) {
|
||||
return '上午';
|
||||
} else if (hm < 1230) {
|
||||
return '中午';
|
||||
} else if (hm < 1800) {
|
||||
return '下午';
|
||||
} else {
|
||||
return '晚上';
|
||||
}
|
||||
},
|
||||
calendar: {
|
||||
sameDay: function () {
|
||||
return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
|
||||
},
|
||||
nextDay: function () {
|
||||
return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
|
||||
},
|
||||
lastDay: function () {
|
||||
return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
|
||||
},
|
||||
nextWeek: function () {
|
||||
var startOfWeek, prefix;
|
||||
startOfWeek = moment().startOf('week');
|
||||
prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';
|
||||
return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
|
||||
},
|
||||
lastWeek: function () {
|
||||
var startOfWeek, prefix;
|
||||
startOfWeek = moment().startOf('week');
|
||||
prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
|
||||
return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
|
||||
},
|
||||
sameElse: 'LL'
|
||||
},
|
||||
ordinalParse: /\d{1,2}(日|月|周)/,
|
||||
ordinal: function (number, period) {
|
||||
switch (period) {
|
||||
case 'd':
|
||||
case 'D':
|
||||
case 'DDD':
|
||||
return number + '日';
|
||||
case 'M':
|
||||
return number + '月';
|
||||
case 'w':
|
||||
case 'W':
|
||||
return number + '周';
|
||||
default:
|
||||
return number;
|
||||
}
|
||||
},
|
||||
relativeTime: {
|
||||
future: '%s内',
|
||||
past: '%s前',
|
||||
s: '几秒',
|
||||
m: '1分钟',
|
||||
mm: '%d分钟',
|
||||
h: '1小时',
|
||||
hh: '%d小时',
|
||||
d: '1天',
|
||||
dd: '%d天',
|
||||
M: '1个月',
|
||||
MM: '%d个月',
|
||||
y: '1年',
|
||||
yy: '%d年'
|
||||
},
|
||||
week: {
|
||||
// GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
|
||||
dow: 1, // Monday is the first day of the week.
|
||||
doy: 4 // The week that contains Jan 4th is the first week of the year.
|
||||
}
|
||||
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
|
||||
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
|
||||
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
|
||||
weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
|
||||
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
|
||||
longDateFormat: {
|
||||
LT: 'Ah点mm分',
|
||||
LTS: 'Ah点m分s秒',
|
||||
L: 'YYYY-MM-DD',
|
||||
LL: 'YYYY年MMMD日',
|
||||
LLL: 'YYYY年MMMD日Ah点mm分',
|
||||
LLLL: 'YYYY年MMMD日ddddAh点mm分',
|
||||
l: 'YYYY-MM-DD',
|
||||
ll: 'YYYY年MMMD日',
|
||||
lll: 'YYYY年MMMD日Ah点mm分',
|
||||
llll: 'YYYY年MMMD日ddddAh点mm分'
|
||||
},
|
||||
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
|
||||
meridiemHour: function (hour, meridiem) {
|
||||
if (hour === 12) {
|
||||
hour = 0;
|
||||
}
|
||||
if (meridiem === '凌晨' || meridiem === '早上' ||
|
||||
meridiem === '上午') {
|
||||
return hour;
|
||||
} else if (meridiem === '下午' || meridiem === '晚上') {
|
||||
return hour + 12;
|
||||
} else {
|
||||
// '中午'
|
||||
return hour >= 11 ? hour : hour + 12;
|
||||
}
|
||||
},
|
||||
meridiem: function (hour, minute, isLower) {
|
||||
var hm = hour * 100 + minute;
|
||||
if (hm < 600) {
|
||||
return '凌晨';
|
||||
} else if (hm < 900) {
|
||||
return '早上';
|
||||
} else if (hm < 1130) {
|
||||
return '上午';
|
||||
} else if (hm < 1230) {
|
||||
return '中午';
|
||||
} else if (hm < 1800) {
|
||||
return '下午';
|
||||
} else {
|
||||
return '晚上';
|
||||
}
|
||||
},
|
||||
calendar: {
|
||||
sameDay: function () {
|
||||
return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
|
||||
},
|
||||
nextDay: function () {
|
||||
return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
|
||||
},
|
||||
lastDay: function () {
|
||||
return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
|
||||
},
|
||||
nextWeek: function () {
|
||||
var startOfWeek, prefix;
|
||||
startOfWeek = moment().startOf('week');
|
||||
prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';
|
||||
return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
|
||||
},
|
||||
lastWeek: function () {
|
||||
var startOfWeek, prefix;
|
||||
startOfWeek = moment().startOf('week');
|
||||
prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
|
||||
return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
|
||||
},
|
||||
sameElse: 'LL'
|
||||
},
|
||||
ordinalParse: /\d{1,2}(日|月|周)/,
|
||||
ordinal: function (number, period) {
|
||||
switch (period) {
|
||||
case 'd':
|
||||
case 'D':
|
||||
case 'DDD':
|
||||
return number + '日';
|
||||
case 'M':
|
||||
return number + '月';
|
||||
case 'w':
|
||||
case 'W':
|
||||
return number + '周';
|
||||
default:
|
||||
return number;
|
||||
}
|
||||
},
|
||||
relativeTime: {
|
||||
future: '%s内',
|
||||
past: '%s前',
|
||||
s: '几秒',
|
||||
m: '1分钟',
|
||||
mm: '%d分钟',
|
||||
h: '1小时',
|
||||
hh: '%d小时',
|
||||
d: '1天',
|
||||
dd: '%d天',
|
||||
M: '1个月',
|
||||
MM: '%d个月',
|
||||
y: '1年',
|
||||
yy: '%d年'
|
||||
},
|
||||
week: {
|
||||
// GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
|
||||
dow: 1, // Monday is the first day of the week.
|
||||
doy: 4 // The week that contains Jan 4th is the first week of the year.
|
||||
}
|
||||
});
|
||||
export default SnackbarHOC()(App);
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ export function initAxiosInterceptors(props) {
|
|||
if (response.data.status === -1) {
|
||||
if (window.location.pathname.startsWith('/tasks/')) {
|
||||
props.showSnackbar(response.data.message || '服务器异常,请联系管理员。')
|
||||
} else if(window.location.pathname.startsWith('/login') || window.location.pathname.startsWith('/register') || window.location.pathname.startsWith('/resetPassword')) {
|
||||
return response;
|
||||
} else {
|
||||
notification.open({
|
||||
message: "提示",
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ li.ant-menu-item{
|
|||
color: #333;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 10px!important;
|
||||
a{
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export default ({history}) => {
|
|||
/>
|
||||
</div>
|
||||
:
|
||||
<i className="iconfont icon-sousuo font-18 color-grey-6 ml30" onClick={() => {
|
||||
<i className="iconfont icon-sousuo font-18 ml30" style={{color:"#a5a5a5"}} onClick={() => {
|
||||
setOpenSearch(true)
|
||||
}} />
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,25 +3,40 @@ import { Modal , Button } from 'antd';
|
|||
import './Index.scss';
|
||||
import '../../css/index.scss';
|
||||
import RenderHtml from '../../../components/render-html';
|
||||
import cookie from 'react-cookies';
|
||||
// import cookie from 'react-cookies';
|
||||
import axios from 'axios';
|
||||
|
||||
function SystemNotice({system_notification,history}){
|
||||
function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice}){
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
|
||||
useEffect(()=>{
|
||||
if(system_notification && !cookie.load('notice_stage')){
|
||||
if(system_notification && !system_notification.is_read && showNotice && login){
|
||||
setVisible(true);
|
||||
}
|
||||
},[system_notification,history.location])
|
||||
},[system_notification])
|
||||
|
||||
function sureContinue() {
|
||||
cookie.remove('notice_stage');
|
||||
if(login && ( system_notification && system_notification.id )){
|
||||
const url = `/users/${login}/system_notification_histories.json`;
|
||||
axios.post(url,{
|
||||
system_notification_id:system_notification.id
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setVisible(false);
|
||||
hideSystemNotice();
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}else{
|
||||
setVisible(false);
|
||||
hideSystemNotice();
|
||||
}
|
||||
// cookie.remove('notice_stage');
|
||||
|
||||
let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天
|
||||
// let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//一分钟
|
||||
cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" });
|
||||
// let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天
|
||||
// // let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//一分钟
|
||||
// cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" });
|
||||
|
||||
setVisible(false);
|
||||
// setVisible(false);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -19,48 +19,44 @@ function Footer(){
|
|||
|
||||
return(
|
||||
<div>
|
||||
<div style={{height:"543px"}}></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>
|
||||
{value && showhtml(value)}
|
||||
</div>
|
||||
// {/* <div className="footEdition">
|
||||
// <div className="footContent">
|
||||
// <ul className="center">
|
||||
// <img src={""} alt="Gitlink(确实开源)" height="29px"/>
|
||||
// <p>(确实开源)</p>
|
||||
// </ul>
|
||||
// <ul>
|
||||
// <li className="thehead">社区</li>
|
||||
// <li><a href="/">网站首页</a></li>
|
||||
// <li><a href="https://forum.trustie.net/forums/1168/detail">帮助中心</a></li>
|
||||
// <li><a href="https://forum.trustie.net/">论坛交流</a></li>
|
||||
// <li><a href="https://www.trustie.net/cooperation">合作伙伴</a></li>
|
||||
// </ul>
|
||||
// <ul>
|
||||
// <li className="thehead">支持与服务</li>
|
||||
// <li><a href="https://forgeplus.trustie.net/docs/api">API文档</a></li>
|
||||
// <li><a href="https://git-scm.com">Git常用命令</a></li>
|
||||
// <li><a href="https://forum.trustie.net/forums/3080/detail">DevOps使用文档</a></li>
|
||||
// <li><a href='https://www.trustie.net/agreement'>服务协议</a></li>
|
||||
// </ul>
|
||||
// <ul>
|
||||
// <li className="thehead">加入我们</li>
|
||||
// <li className="theline">
|
||||
// <div className="mr50">
|
||||
// <li>公众号</li>
|
||||
// <img src={"Img"} alt="公众号"/>
|
||||
// </div>
|
||||
// <div>
|
||||
// <li>QQ群</li>
|
||||
// <img src={"qqImg"} alt="QQ群"/>
|
||||
// </div>
|
||||
// </li>
|
||||
// </ul>
|
||||
// </div>
|
||||
// <p className="copyrightDesc">©Copyright 2007~2021 国防科技大学Gitlink团队 & IntelliDE <br/>湘ICP备 17009477号</p>
|
||||
// </div> */}
|
||||
)
|
||||
}
|
||||
export default Footer;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ import React, { Component } from 'react';
|
|||
import AccountProfile from "../../modules/user/AccountProfile";
|
||||
import { getImageUrl } from 'educoder'
|
||||
import axios from 'axios';
|
||||
import { Input , notification , Dropdown ,Popover, Menu,Badge, Button } from 'antd';
|
||||
import cookie from 'react-cookies';
|
||||
import { notification , Dropdown ,Popover, Menu,Badge } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import LoginDialog from '../../modules/login/LoginDialog';
|
||||
|
|
@ -14,9 +15,8 @@ import CheckProfile from '../Component/ProfileModal/Profile';
|
|||
|
||||
import './header.scss';
|
||||
import NoticeContent from './NoticeContent';
|
||||
const $ = window.$
|
||||
import MainLogo from './img/logo.png';
|
||||
// TODO 这部分脚本从公共脚本中直接调用
|
||||
const { Search } = Input;
|
||||
let old_url;
|
||||
|
||||
window._header_componentHandler = null;
|
||||
|
|
@ -56,26 +56,26 @@ class NewHeader extends Component {
|
|||
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)
|
||||
// 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))
|
||||
|
|
@ -98,11 +98,17 @@ class NewHeader extends Component {
|
|||
|
||||
educoderlogin = () => {
|
||||
//登录账号
|
||||
this.setState({
|
||||
isRender: true
|
||||
})
|
||||
if(window.location.pathname === "/"){
|
||||
window.location.href="/login";
|
||||
}else{
|
||||
this.setState({
|
||||
isRender: true
|
||||
})
|
||||
}
|
||||
}
|
||||
educoderloginysl = () => {
|
||||
//退出账号时清除登录页面的下次自动登录(用户再次打开登录页面时下次自动登录框不勾选)
|
||||
cookie.remove("autologin");
|
||||
//退出账号
|
||||
var url = `/accounts/logout.json`;
|
||||
axios.get((url)).then((result) => {
|
||||
|
|
@ -279,96 +285,94 @@ class NewHeader extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { match ,resetUserInfo ,showNotification} = this.props;
|
||||
const { resetUserInfo ,showNotification,publicNav} = this.props;
|
||||
let current_user = this.props.user;
|
||||
let {
|
||||
AccountProfiletype,
|
||||
user,
|
||||
isRender,
|
||||
headtypesonClickbool,
|
||||
headtypess,
|
||||
settings,
|
||||
visible,
|
||||
} = 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;
|
||||
// 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;
|
||||
}
|
||||
// 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 && this.props.mygetHelmetapi.navbar && 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 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 && this.props.mygetHelmetapi.navbar && 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;
|
||||
return (
|
||||
<div className="newHeaders" id="nHeader">
|
||||
<div className={publicNav ? `newHeaders publicNav`:`newHeaders`} id="nHeader">
|
||||
<div className="headerContent">
|
||||
{isRender === true ?
|
||||
<LoginDialog
|
||||
|
|
@ -383,10 +387,16 @@ class NewHeader extends Component {
|
|||
{...this.props}
|
||||
{...this.state}
|
||||
/> : ""}
|
||||
{
|
||||
publicNav &&
|
||||
<a href={'https://www.ccf.org.cn/'} className={"fl pr15"}>
|
||||
<img src={MainLogo} alt="ccf" />
|
||||
</a>
|
||||
}
|
||||
{
|
||||
settings && settings.nav_logo_url ?
|
||||
<a href={settings && settings.new_course.default_url} className={"fl mr50"} style={{minWidth:"45px"}}>
|
||||
<img alt="可控开源社区" className="logoimg" style={{ heigth: "40px" }} src={getImageUrl(`/${settings.nav_logo_url}`)}></img>
|
||||
<a href={settings && settings.new_course.default_url} className={"fl mr50"}>
|
||||
<img alt="可控开源社区" className="logoimg" src={getImageUrl(`/${settings.nav_logo_url}`)}></img>
|
||||
</a>
|
||||
:
|
||||
""
|
||||
|
|
@ -433,7 +443,8 @@ class NewHeader extends Component {
|
|||
{
|
||||
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 mr15"></i>
|
||||
{/* <i className="iconfont icon-tianjiafangda ml30 mr15"></i> */}
|
||||
<img src={require(`./img/add.png`)} alt="" width="16px" className="mr15 ml30"/>
|
||||
</Dropdown>:""
|
||||
}
|
||||
|
||||
|
|
@ -448,7 +459,8 @@ class NewHeader extends Component {
|
|||
>
|
||||
<Link to={"/settings/notice"} className="message-icon">
|
||||
{current_user && <Badge count={current_user.message_unread_total}>
|
||||
<i className="iconfont icon-xiaoxilingdang color-grey-6 ml15 mr15"></i>
|
||||
{/* <i className="iconfont icon-xiaoxilingdang ml15 mr15"></i> */}
|
||||
<img src={require(`./img/ring.png`)} alt="" width="16px" className="ml15 mr15"/>
|
||||
</Badge>}
|
||||
</Link>
|
||||
</Popover>
|
||||
|
|
@ -457,10 +469,14 @@ class NewHeader extends Component {
|
|||
</div>
|
||||
{!user || (user && !user.login) ?
|
||||
<span className="font-15 ml30">
|
||||
<a onClick={() => this.educoderlogin()} className="mr5 color-grey-6">登录</a>
|
||||
<a onClick={() => this.educoderlogin()} className="mr5 color-white">登录</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>
|
||||
(settings && settings.common && settings.common.register) ?
|
||||
publicNav ?
|
||||
<a href='/register' className="regBtn">立即注册</a>
|
||||
:
|
||||
<span><em className="vertical-line"></em><a className="ml5 color-white" href='/register'>注册</a></span>
|
||||
:""
|
||||
}
|
||||
</span>
|
||||
:
|
||||
|
|
|
|||
|
|
@ -262,4 +262,101 @@
|
|||
|
||||
.text-center{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.footEdition{
|
||||
background-color: #171B23;
|
||||
.footContent{
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding:86px 0px;
|
||||
justify-content: space-around;
|
||||
width: 1200px;
|
||||
margin:0px auto;
|
||||
ul{
|
||||
min-width: 120px;
|
||||
text-align: left;
|
||||
margin-right: 80px;
|
||||
&.center{
|
||||
text-align: center;
|
||||
}
|
||||
&>p{
|
||||
height: 22px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
line-height: 22px;
|
||||
}
|
||||
&>img{
|
||||
width: 100px;
|
||||
height: 100%;
|
||||
margin-bottom: 30px;
|
||||
margin-top: 25px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
li{
|
||||
height: 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
color: #BDC2D1;
|
||||
margin-bottom: 15px!important;
|
||||
a{
|
||||
color: #BDC2D1!important;
|
||||
&:hover{
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
&.thehead{
|
||||
height: 25px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
line-height: 25px;
|
||||
margin-bottom: 20px!important;
|
||||
}
|
||||
}
|
||||
.theline{
|
||||
.imgCon{
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
padding:5px;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
img{
|
||||
width: 100%;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.copyrightDesc{
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #BDC2D1;
|
||||
line-height: 28px;
|
||||
padding:15px 0px;
|
||||
text-align: center;
|
||||
background-color: #1B212C;
|
||||
a{
|
||||
color: #BDC2D1!important;
|
||||
}
|
||||
}
|
||||
.regBtn{
|
||||
height: 40px;
|
||||
background: #466AFF;
|
||||
border-radius: 2px;
|
||||
display: inline-block;
|
||||
padding:0px 18px;
|
||||
margin-left: 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF!important;
|
||||
line-height: 40px;
|
||||
&:hover{
|
||||
color: #FFFFFF!important;
|
||||
background-color: #355CFF;
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 749 B |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 615 B |
|
|
@ -22,11 +22,10 @@ const ProjectIndex = Loadable({
|
|||
loading: Loading,
|
||||
});
|
||||
|
||||
// 项目详情放在用户和组织下作为二级菜单存在
|
||||
// const ProjectDetail = Loadable({
|
||||
// loader: () => import("./Main/Detail"),
|
||||
// loading: Loading,
|
||||
// });
|
||||
const ProjectHome = Loadable({
|
||||
loader: () => import("./Main/projecthome/Index"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
class Index extends Component {
|
||||
|
||||
|
|
@ -60,23 +59,17 @@ class Index extends Component {
|
|||
<ProjectNew {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
{/* <Route
|
||||
path="/:owner/:projectsId"
|
||||
render={(props) => (
|
||||
<ProjectDetail {...this.props} {...props} />
|
||||
)}
|
||||
></Route> */}
|
||||
<Route
|
||||
path="/explore"
|
||||
path="/explore/all"
|
||||
render={(props) => (
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/"
|
||||
path="/explore"
|
||||
render={(props) => (
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
<ProjectHome {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
|
|
@ -90,10 +83,3 @@ export default withRouter(
|
|||
parentSelector: ".newMain",
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index))))
|
||||
);
|
||||
|
||||
// export default withRouter(
|
||||
// ImageLayerOfCommentHOC({
|
||||
// imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||
// parentSelector: ".newMain",
|
||||
// })(Index)
|
||||
// );
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ function CoderDepot(props){
|
|||
if(result && result.data){
|
||||
const release = {
|
||||
"list":result.data.releases,
|
||||
"total_count":result.data.releases.length
|
||||
"total_count":result.data.releases && result.data.releases.length
|
||||
}
|
||||
setReleaseVersions(release);
|
||||
}
|
||||
|
|
@ -328,7 +328,7 @@ function CoderDepot(props){
|
|||
function okUpdate(d,w,l){
|
||||
const url = `/${owner}/${projectsId}.json`;
|
||||
axios.put(url,{
|
||||
description:d,website:w,lesson_url:l
|
||||
description:d,website:w || "",lesson_url:l||""
|
||||
}).then(result=>{
|
||||
if(result && result.data && result.data.id){
|
||||
setDesc(result.data.description);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
|||
|
||||
return(
|
||||
<div className="commonBox readBox" id="readme">
|
||||
<Anchor offsetTop={70} targetOffset={160}>
|
||||
<Anchor offsetTop={58}>
|
||||
<div className="commonBox-title boxTitle">
|
||||
<AlignCenter>
|
||||
<Dropdown overlay={menu()} trigger={['hover']} overlayClassName="menuslist">
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ export default ((props)=>{
|
|||
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
|
||||
return(
|
||||
<React.Fragment>
|
||||
<div className="main">
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class CoderRootFileDetail extends Component {
|
|||
const Option = Select.Option;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Anchor className="griditemAnchor" offsetTop={70}>
|
||||
<Anchor className="griditemAnchor" offsetTop={58}>
|
||||
<div className="griditemCate">
|
||||
{
|
||||
md && readOnly &&
|
||||
|
|
|
|||
|
|
@ -509,11 +509,6 @@ class Detail extends Component {
|
|||
this.textFunc(projectDetail.forked_from_project_id, projectDetail.fork_info)
|
||||
: ""
|
||||
}
|
||||
{
|
||||
projectDetail && projectDetail.type && projectDetail.type !== 0 ?
|
||||
<span className="color-grey-9">导入于 <a className="color-grey-6" target="_blank" href={projectDetail.mirror_url}>{projectDetail.mirror_url}</a></span>
|
||||
: ""
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class Index extends Component {
|
|||
|
||||
this.getCategory();
|
||||
|
||||
this.getRecommand();
|
||||
// this.getRecommand();
|
||||
|
||||
this.getLanguage();
|
||||
|
||||
|
|
@ -304,9 +304,9 @@ class Index extends Component {
|
|||
|
||||
return (
|
||||
<div>
|
||||
<p className="t_project_banner">
|
||||
{/* <p className="t_project_banner">
|
||||
<img src={banner} width="100%" alt=""/>
|
||||
</p>
|
||||
</p> */}
|
||||
{/* {
|
||||
recommendOriList && recommendOriList.length>0?
|
||||
<Slider {...settings} className="recommandOri">
|
||||
|
|
@ -320,7 +320,7 @@ class Index extends Component {
|
|||
</Slider>
|
||||
:""
|
||||
} */}
|
||||
{
|
||||
{/* {
|
||||
recommendList && recommendList.length>0 &&
|
||||
<Slider {...setting} className={recommendList.length>5 ? "recommandProjects":"recommandProjects mb20"}>
|
||||
{
|
||||
|
|
@ -341,7 +341,7 @@ class Index extends Component {
|
|||
})
|
||||
}
|
||||
</Slider>
|
||||
}
|
||||
} */}
|
||||
<div className="ProjectListIndex">
|
||||
<div className="list-left">
|
||||
<ul className="list-l-Menu">
|
||||
|
|
|
|||
|
|
@ -52,12 +52,6 @@ class IndexItem extends Component {
|
|||
<i className="iconfont icon-banbenku font-18 color-green" />
|
||||
</Tooltip>:""
|
||||
}
|
||||
{
|
||||
item.type && item.type === 1 ?
|
||||
<Tooltip title="该项目是一个导入于其他网站的仓库" className="ml5">
|
||||
<i className="iconfont icon-jingxiang font-18 color-green" />
|
||||
</Tooltip>:""
|
||||
}
|
||||
</AlignCenter>
|
||||
<span className="p-r-tags">
|
||||
{
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 460 B |
|
After Width: | Height: | Size: 463 B |
|
After Width: | Height: | Size: 435 B |
|
After Width: | Height: | Size: 969 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
|
@ -0,0 +1,129 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import './Index.scss';
|
||||
import SubBanner from './SubBanner';
|
||||
import SubUnitBanner from './SubUnitBanner';
|
||||
import Icon from '../img/index/icon.png';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Spin } from 'antd';
|
||||
import SubList from './SubList';
|
||||
import more from '../img/index/more.png';
|
||||
import axios from 'axios';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import Nodata from '../../Nodata';
|
||||
|
||||
const LIMIT = 20;
|
||||
function Index() {
|
||||
|
||||
const [ cateList , setCateList ] = useState(undefined);
|
||||
const [ projectsList , setProjectsList ] = useState(undefined);
|
||||
const [ cateID, setCateID ] = useState(undefined);
|
||||
const [ isSpin, setIsSpin ] = useState(true);
|
||||
|
||||
useEffect(()=>{
|
||||
getCate();
|
||||
},[])
|
||||
|
||||
useEffect(()=>{
|
||||
setIsSpin(true);
|
||||
getProject();
|
||||
},[cateID])
|
||||
|
||||
function getCate() {
|
||||
const url = `/project_categories/pinned_index.json`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result && result.data){
|
||||
setCateList(result.data.project_categories);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getProject() {
|
||||
const url = `/projects.json`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
pinned:"d",
|
||||
category_id:cateID,
|
||||
limit:LIMIT
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
setProjectsList(result.data.projects);
|
||||
setIsSpin(false);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
<SubBanner />
|
||||
<SubUnitBanner />
|
||||
<div className="dataPanel">
|
||||
<div className="left">
|
||||
<ul className="leftTypes">
|
||||
<a className={cateID ? "" : "active"} onClick={()=>setCateID(undefined)}><img src={Icon} alt="" /><span>最近更新</span></a>
|
||||
{
|
||||
cateList && cateList.length>0?
|
||||
cateList.map((i,k)=>{
|
||||
return(
|
||||
<a className={cateID === i.id ?"active":""} onClick={()=>setCateID(i.id)}><img src={i.logo_url || Icon} alt="" /><span>{i.name}</span></a>
|
||||
)
|
||||
})
|
||||
:""
|
||||
}
|
||||
</ul>
|
||||
<div className="leftLists">
|
||||
<div className="leftTitles">
|
||||
<span>开源项目</span>
|
||||
<Link to={`/explore/all`} target="_blank">更多<i className="iconfont icon-triangle font-12"></i></Link>
|
||||
</div>
|
||||
<Spin spinning={isSpin}>
|
||||
<div style={{minHeight:"400px"}}>
|
||||
{
|
||||
projectsList && projectsList.length > 0 ?
|
||||
<div className="leftlistItem">
|
||||
{
|
||||
projectsList.map((i,k)=>{
|
||||
return(
|
||||
<li>
|
||||
<Link to={`/${i.author && i.author.login}`} target="_blank"><img src={getImageUrl(`/${i.author && i.author.image_url}`)} alt="" /></Link>
|
||||
<div className="itemTitle">
|
||||
<div className="item-title-infos">
|
||||
<Link to={`/${i.author && i.author.login}/${i.identifier}`} target="_blank" className="infotitle task-hide">{i.author && i.author.name}/{i.name}</Link>
|
||||
{i.praises_count > 0 ? <span><i className="iconfont icon-dianzan11 mr3 font-16"></i>{i.praises_count}</span> :"" }
|
||||
{i.forked_count > 0 ? <span><i className="iconfont icon-fork2 mr3 font-13"></i>{i.forked_count}</span>:""}
|
||||
</div>
|
||||
<div className="item-desc task-hide-2">
|
||||
{i.description}
|
||||
</div>
|
||||
<div className="item-data">
|
||||
{i.category && i.category.id ? <span className="category">{i.category.name}</span> :"" }
|
||||
{i.language && i.language.id ? <span className="language mr30">{i.language.name}</span> :""}
|
||||
<span style={{lineHeight:"15px",display:"flex"}}><i className="iconfont icon-shijian font-15 mr5"></i>更新于{i.time_ago}</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
{
|
||||
projectsList && projectsList.length === 0 && <Nodata _html="暂无数据" />
|
||||
}
|
||||
</div>
|
||||
</Spin>
|
||||
{
|
||||
projectsList && projectsList.length > 0 &&
|
||||
<div className="left-bottom-btn">
|
||||
<Link to={`/explore/all`} target="_blank">查看更多开源项目<img src={more} alt="" /></Link>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<SubList />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,553 @@
|
|||
.banners{
|
||||
background: url('../img/index/banner.png') no-repeat top;
|
||||
min-height: 516px;
|
||||
background-size: cover;
|
||||
background-color: #0C2A5B;
|
||||
.bannersCenter{
|
||||
padding-top: 30px;
|
||||
max-width: 1200px;
|
||||
margin: 0px auto;
|
||||
position: relative;
|
||||
height: 516px;
|
||||
}
|
||||
.bTitle{
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 20px!important;
|
||||
text-align: center;
|
||||
span{
|
||||
background: linear-gradient(to right,#289AF6 0%, #9E84FF 40%, #FFB03B 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
}
|
||||
.bSubTitle{
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.bannerBox{
|
||||
background: url('../img/index/box.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
height: 240px;
|
||||
width: 380px;
|
||||
margin:0px auto;
|
||||
padding:25px 30px 34px;
|
||||
.bannersProject{
|
||||
position: relative;
|
||||
.slick-list{
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.slick-track{
|
||||
display: flex;
|
||||
li{
|
||||
padding:15px 20px;
|
||||
.projectinfos{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-bottom: 13px;
|
||||
img{
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 7px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.name{
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 250px;
|
||||
color: #25EBFF;
|
||||
a{
|
||||
color: #25EBFF!important;
|
||||
}
|
||||
}
|
||||
.company{
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 250px;
|
||||
a{
|
||||
color: #FFFFFF!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.desc{
|
||||
height: 40px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
.infoData{
|
||||
display: flex;
|
||||
margin-top: 16px;
|
||||
justify-content: space-around;
|
||||
&>span{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&>span{
|
||||
color: #FFB729;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
img{
|
||||
width: 16px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.airBubble{
|
||||
&>div{
|
||||
position: absolute;
|
||||
height: 410px;
|
||||
width: 415px;
|
||||
bottom: 0px;
|
||||
&.right{
|
||||
right: 0px;
|
||||
}
|
||||
&.left{
|
||||
left: 0px;
|
||||
}
|
||||
&.right div, &.left div{
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
span{
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(124deg, rgba(255, 255, 255, 0.1) 0%, rgba(5, 200, 220, 0.04) 50%, rgba(5, 200, 220, 0.03) 100%);
|
||||
box-shadow: 0px 0px 7px 3px rgba(0, 154, 255, 0.19);
|
||||
border: 1px solid rgba(0, 154, 255, 0.19);
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
padding:5px;
|
||||
animation: zoomin 1.3s infinite alternate;
|
||||
&:hover{
|
||||
animation:none
|
||||
}
|
||||
}
|
||||
}
|
||||
&.right span:nth-child(4) a,&.left span:nth-child(1) a,&.left span:nth-child(2) a{
|
||||
color: #25EBFF!important;
|
||||
}
|
||||
&.right span:nth-child(1) a,&.left span:nth-child(5) a{
|
||||
color: #CD8AFF!important;
|
||||
}
|
||||
&.right span:nth-child(3) a,&.right span:nth-child(5) a,&.left span:nth-child(6) a{
|
||||
color: #FF6125!important;
|
||||
}
|
||||
&.left span:nth-child(3) a{
|
||||
color: #FF8425!important;
|
||||
}
|
||||
&.right span:nth-child(2) a,&.left span:nth-child(4) a{
|
||||
color: #8CC2FF!important;
|
||||
}
|
||||
&.right span:nth-child(1){
|
||||
right: 0px;
|
||||
height: 120px;
|
||||
width: 120px;
|
||||
}
|
||||
&.right span:nth-child(2){
|
||||
right: 160px;
|
||||
height: 72px;
|
||||
width: 72px;
|
||||
bottom: 220px;
|
||||
padding:0px;
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
&.right span:nth-child(3){
|
||||
right: 300px;
|
||||
height: 94px;
|
||||
width: 94px;
|
||||
bottom: 99px;
|
||||
padding:8px;
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
&.right span:nth-child(4){
|
||||
right: 156px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
bottom: 39px;
|
||||
font-size: 12px;
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
&.right span:nth-child(5){
|
||||
right: 10px;
|
||||
height: 94px;
|
||||
width: 94px;
|
||||
bottom: 97px;
|
||||
animation-delay: 0.4s;
|
||||
}
|
||||
&.left span:nth-child(1){
|
||||
left: 80px;
|
||||
height: 110px;
|
||||
width: 110px;
|
||||
padding:8px;
|
||||
animation-delay: 0.1s;
|
||||
}
|
||||
&.left span:nth-child(2){
|
||||
right: 60px;
|
||||
height: 96px;
|
||||
width: 96px;
|
||||
top: 85px;
|
||||
font-size: 13px;
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
&.left span:nth-child(3){
|
||||
left: 0px;
|
||||
height: 86px;
|
||||
width: 86px;
|
||||
top: 145px;
|
||||
font-size: 13px;
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
&.left span:nth-child(4){
|
||||
left: 164px;
|
||||
height: 70px;
|
||||
width: 70px;
|
||||
bottom: 158px;
|
||||
font-size: 12px;
|
||||
font-size: 12px;
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
&.left span:nth-child(5){
|
||||
left: 35px;
|
||||
height: 102px;
|
||||
width: 102px;
|
||||
bottom: 32px;
|
||||
font-size: 13px;
|
||||
animation-delay: 0.4s;
|
||||
}
|
||||
&.left span:nth-child(6){
|
||||
right: 10px;
|
||||
height: 114px;
|
||||
width: 114px;
|
||||
bottom: 26px;
|
||||
padding:8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@keyframes zoomin{
|
||||
0%{-webkit-transform:scale(1.05);transform:scale(1.05)}
|
||||
100%{-webkit-transform:scale(0.8);transform:scale(0.8)}
|
||||
}
|
||||
@-webkit-keyframes zoomin{
|
||||
0%{-webkit-transform:scale(1.05);transform:scale(1.05)}
|
||||
100%{-webkit-transform:scale(0.8);transform:scale(0.8)}
|
||||
}
|
||||
.unitBanner{
|
||||
padding:29px 0px;
|
||||
background: #F9F9F9;
|
||||
.unitContent{
|
||||
max-width: 1200px;
|
||||
margin:0px auto;
|
||||
.unitTitle{
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
color: #1E1E1E;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
img{
|
||||
margin-left: 9px;
|
||||
}
|
||||
}
|
||||
.unitSlider{
|
||||
padding:30px 0px 10px;
|
||||
.slick-list{
|
||||
width: 100%;
|
||||
height: 56px;
|
||||
overflow: hidden;
|
||||
.slickline{
|
||||
display: flex!important;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.dataPanel{
|
||||
width: 1200px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding:30px 0px 60px;
|
||||
margin:0px auto;
|
||||
.left{
|
||||
width: 850px;
|
||||
box-shadow: 0px 0px 4px 5px rgba(0, 0, 0, 0.02);
|
||||
display: flex;
|
||||
.leftTypes{
|
||||
width: 220px;
|
||||
height: 1576px;
|
||||
background: url('../img/index/typebg.png');
|
||||
background-size: 100% 100%;
|
||||
box-shadow: 0px 0px 4px 5px rgba(0, 0, 0, 0.02);
|
||||
a{
|
||||
padding:0px 20px;
|
||||
height: 44px;
|
||||
margin-top: 10px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
&:hover{
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
&.active{
|
||||
background: linear-gradient(to right,#07228F , #466AFF);
|
||||
color: #fff!important;
|
||||
}
|
||||
img{
|
||||
margin-right: 12px;
|
||||
width: 28px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.leftLists{
|
||||
flex:1;
|
||||
.leftTitles{
|
||||
height: 60px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid rgba(153, 153, 153, 0.16);
|
||||
padding:0px 20px;
|
||||
span{
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
}
|
||||
a{
|
||||
color: #466AFF!important;
|
||||
}
|
||||
}
|
||||
.leftlistItem{
|
||||
padding:0px 20px;
|
||||
li{
|
||||
border-bottom: 1px solid rgba(153, 153, 153, 0.16);
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding:20px 0px ;
|
||||
&>a img{
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.itemTitle{
|
||||
flex:1;
|
||||
.item-title-infos{
|
||||
height: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.infotitle{
|
||||
flex:1;
|
||||
height: 21px;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
line-height: 21px;
|
||||
color: #333!important;
|
||||
max-width: 458px;
|
||||
&:hover{
|
||||
color: #466AFF!important;
|
||||
}
|
||||
}
|
||||
span{
|
||||
margin-left:20px ;
|
||||
color: #333;
|
||||
i{
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
.item-desc{
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #414141;
|
||||
line-height: 24px;
|
||||
max-width: 548px;
|
||||
margin: 5px 0px;
|
||||
}
|
||||
.item-data{
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
color: #7D7D7D;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.category{
|
||||
position: relative;
|
||||
padding-left: 11px;
|
||||
margin-right: 10px;
|
||||
&::before{
|
||||
position: absolute;
|
||||
content: "";
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background-color: #466AFF;
|
||||
top: 7px;
|
||||
left: 0px;
|
||||
}
|
||||
}
|
||||
.language{
|
||||
position: relative;
|
||||
padding-left: 11px;
|
||||
&::before{
|
||||
position: absolute;
|
||||
content: "";
|
||||
width: 1px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
border-left: 1px solid #9e9e9e;
|
||||
bottom: 5px;
|
||||
left: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.left-bottom-btn{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding:18px 0px;
|
||||
a{
|
||||
height: 38px;
|
||||
line-height: 36px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #466AFF;
|
||||
color: #466AFF;
|
||||
font-size: 16px;
|
||||
padding:0px 20px;
|
||||
img{
|
||||
height: 16px;
|
||||
margin-top: -1px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.right{
|
||||
width: 330px;
|
||||
&>div{
|
||||
box-shadow: 0px 0px 4px 5px rgba(0, 0, 0, 0.02);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.partTitle{
|
||||
padding:15px;
|
||||
background: #F6F9FF;
|
||||
font-size: 18px;
|
||||
color: #000000;
|
||||
font-weight: 500;
|
||||
margin-bottom: 10px;
|
||||
img{
|
||||
width: 33px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
.righthotAuthor{
|
||||
padding-bottom: 15px;
|
||||
li{
|
||||
padding-left: 15px;
|
||||
&>div{
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding:10px 15px 10px 0px;
|
||||
border-bottom: 1px solid rgba(153, 153, 153, 0.1);
|
||||
img{
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
margin-right: 8px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
&:hover{
|
||||
background-color: #F3F3F3;
|
||||
}
|
||||
&:last-child > div{
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
.hotProjects{
|
||||
li{
|
||||
padding:10px 15px;
|
||||
margin-bottom: 10px;
|
||||
&:hover{
|
||||
background-color: #F3F3F3;
|
||||
}
|
||||
.mInfos{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 20px;
|
||||
.num{
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: #466AFF;
|
||||
border-radius: 2px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 18px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.name{
|
||||
flex:1;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
.sInfos{
|
||||
background: #F7F8F9;
|
||||
padding:0px 5px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
line-height: 24px;
|
||||
word-break: break-all;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import Slider from 'react-slick';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import Eye from '../img/index/eye.png';
|
||||
import Data from '../img/index/data.png';
|
||||
import Earth from '../img/index/earth.png';
|
||||
import axios from 'axios';
|
||||
|
||||
// const list =[
|
||||
// {img:Imgs,name:"矽璓工业物联操作系统XiUOS",company:"泛在操作系统实验室",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"openGauss-operator",company:"华为技术有限公司",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"PaddleDetection 2.0",company:"TrustieMirrors",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"skyline",company:"浪潮信息",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"BitXHub",company:"开放原子开源基金会",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"Device Model",company:"openDACS",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"Gitlink",company:"Gitlink",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"openEuler-datenlord",company:"华为技术有限公司",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"OpenAtom XuperChain",company:"开放原子开源基金会",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"xuos-web",company:"泛在操作系统实验室",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// {img:Imgs,name:"CrowdOS开源项目开发",company:"西北工业大学",desc:"此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情此处为项目介绍详情",look:432,cloud:"云原声",type:"C++"},
|
||||
// ]
|
||||
const settings={
|
||||
dots: false,
|
||||
infinite: true,
|
||||
speed: 1000,
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
autoplay:true,
|
||||
arrows:false,
|
||||
adaptiveHeight:true
|
||||
}
|
||||
|
||||
function SubBanner() {
|
||||
|
||||
const [ list , setList ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
getList();
|
||||
},[])
|
||||
|
||||
function getList() {
|
||||
const url = `/projects/banner_recommend.json`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result && result.data){
|
||||
setList(result.data.projects);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
return(
|
||||
<div className="banners">
|
||||
<div className="bannersCenter">
|
||||
<p className="bTitle"><span>GitLink 确实开源</span></p>
|
||||
<p className="bSubTitle">新一代开发创新服务平台 让你的创意在这里释放</p>
|
||||
<div className="bannerBox">
|
||||
{
|
||||
list && list.length > 0 ?
|
||||
<Slider {...settings} className="bannersProject">
|
||||
{
|
||||
list.map((i,k)=>{
|
||||
return(
|
||||
<li>
|
||||
<div className="projectinfos">
|
||||
<Link to={`/${i.author && i.author.login}`}><img src={getImageUrl(`/${i.author && i.author.image_url}`)} alt="" /></Link>
|
||||
<div>
|
||||
<p className="name"><Link to={`/${i.author && i.author.login}/${i.identifier}`}>{i.name}</Link></p>
|
||||
<p className="company"><Link to={`/${i.author && i.author.login}`}>{i.author && i.author.name}</Link></p>
|
||||
</div>
|
||||
</div>
|
||||
<p className="desc">{i.description}</p>
|
||||
<div className="infoData">
|
||||
<span><img src={Eye} alt="" /><span>{i.visits}</span></span>
|
||||
{i.category && i.category.id && <span><img src={Data} alt="" /><span>{i.category.name}</span></span>}
|
||||
{i.language && i.language.id && <span><img src={Earth} alt="" /><span>{i.language.name}</span></span>}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Slider>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
<div className="airBubble">
|
||||
<div className="left">
|
||||
<div>
|
||||
{
|
||||
list && list.length > 0 && list.map((i,k)=>{
|
||||
return(
|
||||
k%2 === 0? <span><Link to={`/${i.author && i.author.login}/${i.identifier}`}>{i.author && i.author.name}/{i.name}</Link></span> : ""
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="right">
|
||||
<div>
|
||||
{
|
||||
list && list.length > 0 && list.map((i,k)=>{
|
||||
return(
|
||||
k%2 > 0 ? <span><Link to={`/${i.author && i.author.login}/${i.identifier}`}>{i.author && i.author.name}/{i.name}</Link></span> : ""
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default SubBanner
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import hotAuthor from '../img/index/hotAuthor.png';
|
||||
import week from '../img/index/week.png';
|
||||
import month from '../img/index/month.png';
|
||||
import { Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
||||
|
||||
function SubList() {
|
||||
|
||||
const [ weekList ,setWeekList ] = useState(undefined);
|
||||
const [ monthList ,setMonthList ] = useState(undefined);
|
||||
const [ authorList ,setAuthorList ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
getList(7);
|
||||
getList(30);
|
||||
getAuthorList(7);
|
||||
},[])
|
||||
|
||||
function getList(time){
|
||||
const url = `/project_rank.json`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
time
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
time === 7 ? setWeekList(result.data.projects) : setMonthList(result.data.projects);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
function getAuthorList(time){
|
||||
const url = `/user_rank.json`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
time
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
setAuthorList(result.data.users);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
return(
|
||||
<div className="right">
|
||||
{
|
||||
authorList && authorList.length > 0?
|
||||
<div>
|
||||
<div className="partTitle"><img src={hotAuthor} alt="" /><span>本周热门开发者</span></div>
|
||||
<div className="righthotAuthor">
|
||||
{
|
||||
authorList.map((i,k)=>{
|
||||
return(
|
||||
<li>
|
||||
<div>
|
||||
<Link target="_blank" to={`/${i.login}`}><img src={getImageUrl(`/${i.avatar_url}`)} alt=""/></Link>
|
||||
<div>
|
||||
<Link target="_blank" to={`/${i.login}`} className="font-15">{i.name}</Link>
|
||||
<p className="task-hide" style={{maxWidth:"260px"}}>
|
||||
<Link target="_blank" to={`/${i.login}/${i.project && i.project.identifier}`}><i className="iconfont icon-daimakuicon1 font-14 mr8"></i>{i.project && i.project.name}</Link>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
|
||||
{
|
||||
weekList && weekList.length > 0 ?
|
||||
<div>
|
||||
<div className="partTitle"><img src={week} alt="" /><span>本周热门项目</span></div>
|
||||
<div className="hotProjects">
|
||||
{
|
||||
weekList.map((i,k)=>{
|
||||
return(
|
||||
<li>
|
||||
<div className="mInfos">
|
||||
<span className="num">{k+1}</span>
|
||||
<Link target="_blank" to={`/${i.owner && i.owner.login}/${i.identifier}`} className="name task-hide">{i.owner && i.owner.name}/{i.name}</Link>
|
||||
<span>
|
||||
<i className="iconfont icon-dianzan11 font-16 mr4"></i>{i.praises}
|
||||
</span>
|
||||
</div>
|
||||
{i.description &&
|
||||
<div className="sInfos task-hide-2">
|
||||
{i.description}
|
||||
</div>
|
||||
}
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
{
|
||||
monthList && monthList.length > 0?
|
||||
<div>
|
||||
<div className="partTitle"><img src={month} alt="" /><span>本月热门项目</span></div>
|
||||
<div className="hotProjects">
|
||||
{
|
||||
monthList.map((i,k)=>{
|
||||
return(
|
||||
<li>
|
||||
<div className="mInfos">
|
||||
<span className="num">{k+1}</span>
|
||||
<Link target="_blank" to={`/${i.owner && i.owner.login}/${i.identifier}`} className="name task-hide">{i.owner && i.owner.name}/{i.name}</Link>
|
||||
<span>
|
||||
<i className="iconfont icon-dianzan11 font-16 mr4"></i>{i.praises}
|
||||
</span>
|
||||
</div>
|
||||
{i.description &&
|
||||
<div className="sInfos task-hide-2">
|
||||
{i.description}
|
||||
</div>
|
||||
}
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default SubList;
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import Hot from '../img/index/hot.png';
|
||||
import Slider from "react-slick";
|
||||
import huawei from '../img/index/unit/huawei.png';
|
||||
import langchao from '../img/index/unit/langchao.png';
|
||||
import jijinhui from '../img/index/unit/jijinhui.png';
|
||||
import mulan from '../img/index/unit/mulan.png';
|
||||
import xigongye from '../img/index/unit/xigongye.png';
|
||||
import feiteng from '../img/index/unit/feiteng.png';
|
||||
import xiuos from '../img/index/unit/xiuos.png';
|
||||
import huake from '../img/index/unit/huake.png';
|
||||
import axios from 'axios';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
||||
const settings = {
|
||||
dots: false,
|
||||
infinite: true,
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
vertical: true,
|
||||
verticalSwiping: true,
|
||||
autoplay:true,
|
||||
arrows:false
|
||||
};
|
||||
const group_size = 6;
|
||||
function SubUnitBanner() {
|
||||
|
||||
const [ list , setlist ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
getRecommandOrz();
|
||||
},[])
|
||||
|
||||
function getRecommandOrz(params) {
|
||||
const url = `/organizations/recommend.json`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
group_size
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setlist(result.data.organizations)
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
return(
|
||||
list && list.length > 0 ?
|
||||
<div className="unitBanner">
|
||||
<div className="unitContent">
|
||||
<div className="unitTitle">
|
||||
<span>精选开源组织</span>
|
||||
<img src={Hot} alt="" width="47px"/>
|
||||
</div>
|
||||
<Slider {...settings} className="unitSlider">
|
||||
{
|
||||
list.map((i,k)=>{
|
||||
return(
|
||||
<div className="slickline">
|
||||
{
|
||||
i.map((j,k1)=>{
|
||||
return(
|
||||
<Link to={j.name}><img src={getImageUrl(`/${j.avatar_url}`)} alt="" height="56px" style={{maxWidth:"180px"}}/></Link>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
{/* <div className="slickline">
|
||||
<a href="https://www.nwpu.edu.cn/" target="_blank"><img src={xigongye} alt="" height="56px"/></a>
|
||||
<a href="https://www.phytium.com.cn/" target="_blank"><img src={feiteng} alt="" height="56px"/></a>
|
||||
<a href="http://xuos.io" target="_blank"><img src={xiuos} alt="" height="56px"/></a>
|
||||
<a href="https://www.hust.edu.cn/" target="_blank"><img src={huake} alt="" height="56px"/></a>
|
||||
</div> */}
|
||||
</Slider>
|
||||
</div>
|
||||
</div>
|
||||
:""
|
||||
|
||||
)
|
||||
}
|
||||
export default SubUnitBanner;
|
||||
|
|
@ -36,7 +36,7 @@ function ReadmeCatelogue({ menuList , hash }) {
|
|||
{
|
||||
menu && menu.length>0?
|
||||
<div className="anchorBox">
|
||||
<Anchor affix={false} onChange={onChange}>
|
||||
<Anchor affix={false} onChange={onChange} offsetTop={140}>
|
||||
{
|
||||
menu.map((item,key)=>{
|
||||
return(
|
||||
|
|
|
|||
|
|
@ -113,8 +113,8 @@ class MergeItem extends Component {
|
|||
className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}}
|
||||
>
|
||||
{item.is_original
|
||||
? item.fork_project_user
|
||||
: project_author_name}
|
||||
? item.fork_project_user_name
|
||||
: item.author_name}
|
||||
:{item.pull_request_head}
|
||||
</Link>
|
||||
</Tag>
|
||||
|
|
@ -136,7 +136,6 @@ class MergeItem extends Component {
|
|||
to={`/${owner}/${projectsId}/tree/${turnbar(item.pull_request_base)}`}
|
||||
className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}}
|
||||
>
|
||||
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
|
||||
{project_author_name}:{item.pull_request_base}
|
||||
</Link>
|
||||
</Tag>
|
||||
|
|
|
|||
|
|
@ -365,10 +365,10 @@ class MessageCount extends Component {
|
|||
<div className="mt15">
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
|
||||
className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: ${data.pull_request && data.pull_request.head}`}
|
||||
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
|
||||
className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.pull_request.is_original ? data.pull_request.fork_project_user_name : data.issue.author_name}: ${data.pull_request && data.pull_request.head}`}
|
||||
>
|
||||
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {data.pull_request && data.pull_request.head}
|
||||
{data.pull_request.is_original ? data.pull_request.fork_project_user_name : data.issue.author_name}: {data.pull_request && data.pull_request.head}
|
||||
</Link>
|
||||
</Tag>
|
||||
<span className="mr8 ver-middle">
|
||||
|
|
|
|||
|
|
@ -289,7 +289,8 @@ class Index extends Component {
|
|||
let second = first.split('.')[0];
|
||||
if(!second)return;
|
||||
this.props.form.setFieldsValue({
|
||||
repository_name:second
|
||||
repository_name:second,
|
||||
name:second
|
||||
})
|
||||
}else{
|
||||
this.props.form.setFieldsValue({
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ class MilepostDetail extends Component {
|
|||
|
||||
const { issue_chosen, issues, limit, page, search_count, data, isSpin , status_type } = this.state;
|
||||
const { projectsId, meilid ,owner} = this.props.match.params;
|
||||
|
||||
const { current_user , showLoginDialog , projectDetail } = this.props;
|
||||
const menu = (
|
||||
<Menu onClick={(e) => this.getOption(e)}>
|
||||
<Menu.Item key={'created_on'} value="desc">最新创建</Menu.Item>
|
||||
|
|
@ -239,8 +239,17 @@ class MilepostDetail extends Component {
|
|||
<span className="font-weight-bold">{data && data.percent && data.percent.toFixed(2)}%完成 </span>
|
||||
</span>
|
||||
<div className="milepostdiv">
|
||||
<Link to={`/${owner}/${projectsId}/milestones/${meilid}/edit`} className="topWrapper_btn" style={{ marginRight: 15 }} >编辑里程碑</Link>
|
||||
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push(`/${owner}/${projectsId}/issues/${meilid}/new`)}} className="topWrapper_btn">创建易修</CheckProfile>
|
||||
{
|
||||
(current_user && current_user.login) && ( projectDetail && projectDetail.permission && projectDetail.permission !== "Reporter") ?
|
||||
<Link to={`/${owner}/${projectsId}/milestones/${meilid}/edit`} className="topWrapper_btn" style={{ marginRight: 15 }} >编辑里程碑</Link>
|
||||
:""
|
||||
}
|
||||
{
|
||||
current_user && current_user.login ?
|
||||
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push(`/${owner}/${projectsId}/issues/${meilid}/new`)}} className="topWrapper_btn">创建易修</CheckProfile>
|
||||
:
|
||||
<a className="topWrapper_btn" onClick={showLoginDialog}>创建易修</a>
|
||||
}
|
||||
</div>
|
||||
</FlexAJ>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class OrderItem extends Component {
|
|||
{current_user && current_user.login && checkbox}
|
||||
<div className="flex-1">
|
||||
<p className="mb10 df" style={{alignItems:"center"}}>
|
||||
<Link to={`/${owner}/${projectsId}/issues/${item.id}`} target="_blank" title={item.name} className="hide-1 font-16 color-grey-3 lineh-30 mr10" style={{maxWidth:"370px"}}>{item.name}</Link>
|
||||
<Link to={`/${owner}/${projectsId}/issues/${item.id}`} title={item.name} className="hide-1 font-16 color-grey-3 lineh-30 mr10" style={{maxWidth:"370px"}}>{item.name}</Link>
|
||||
{TagInfo(item.priority,"mr10")}
|
||||
</p>
|
||||
<p className="color-grey-6 font-12">
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import { getImageUrl } from 'educoder';
|
|||
import { Link } from 'react-router-dom';
|
||||
|
||||
import './Index.scss';
|
||||
import { useEffect } from "react";
|
||||
|
||||
const MyNoticeIndex = Loadable({
|
||||
loader: () => import("./notice/myNotice/Index"),
|
||||
|
|
@ -43,10 +44,15 @@ const PrivateLetter = Loadable({
|
|||
});
|
||||
|
||||
function Index(props){
|
||||
const { current_user,mygetHelmetapi } = props;
|
||||
const { current_user,mygetHelmetapi , checkIfLogin } = props;
|
||||
const { pathname } = props.location;
|
||||
const notice_url = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice;
|
||||
|
||||
useEffect(()=>{
|
||||
if(checkIfLogin() === false){
|
||||
props.history.push('/login');
|
||||
}
|
||||
},[])
|
||||
return(
|
||||
<div className="newMain clearfix whiteBack">
|
||||
<div className="boies">
|
||||
|
|
|
|||
|
|
@ -267,6 +267,11 @@ class Setting extends Component {
|
|||
},
|
||||
],
|
||||
})(<Input placeholder="请输入项目名称" />)}
|
||||
{
|
||||
projectDetail && projectDetail.type && projectDetail.type !== 0 ?
|
||||
<span className="color-grey-9">该项目导入于 <a className="color-grey-6" target="_blank" href={projectDetail.mirror_url}>{projectDetail.mirror_url}</a></span>
|
||||
: ""
|
||||
}
|
||||
</Form.Item>
|
||||
<div className="df" style={{ alignItems: "center" }}>
|
||||
<span className="mr20 mb15 font-16">可见性</span>
|
||||
|
|
|
|||
|
|
@ -191,6 +191,12 @@
|
|||
.shortStyle{
|
||||
.setStyleRule{
|
||||
min-height: 35px;
|
||||
#merge_whitelist_usernames{
|
||||
li.ant-select-selection__choice{
|
||||
margin-top: 0px!important;
|
||||
margin-bottom: 3px!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.columsRadio{
|
||||
display: block;
|
||||
|
|
|
|||
|
|
@ -157,6 +157,17 @@ export default Form.create()(
|
|||
setAuth(params.target.value)
|
||||
}
|
||||
|
||||
function checkname(rule, value, callback){
|
||||
if(!value){
|
||||
callback();
|
||||
}
|
||||
if(value && !value.match(/^[a-zA-Z][a-zA-Z\d]{3,14}$/)){
|
||||
callback("只能使用英文字母和数字,以字母开头,长度为4到15个字符");
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
|
||||
function checkname(rule, value, callback){
|
||||
if(!value){
|
||||
callback();
|
||||
|
|
|
|||
|
|
@ -10,14 +10,10 @@ function ListItem({item,key,OIdentifier}) {
|
|||
<Link to={`/${OIdentifier}/${item.identifier}`} className="name">{item.name}</Link>
|
||||
{ item.forked_from_project_id && <i className="iconfont icon-fork font-18 color-orange ml8" /> }
|
||||
{
|
||||
item.type && item.type !== 0 ?
|
||||
item.type === 2 ?
|
||||
item.type && item.type === 2 ?
|
||||
<Tooltip title="该项目是一个镜像" className="ml8">
|
||||
<i className="iconfont icon-banbenku font-18 color-green" />
|
||||
</Tooltip>:
|
||||
<span className="ml8">
|
||||
<i className="iconfont icon-jingxiang font-18 color-green" />
|
||||
</span>:""
|
||||
</Tooltip>:""
|
||||
}
|
||||
</span>
|
||||
<ListCount fork={item.forked_count} parise={item.praises_count}/>
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ export default Form.create()(
|
|||
)}
|
||||
<p>选择头像:</p>
|
||||
<UploadImage url={getImageUrl(`/${image}`)} getImage={getImage}/>
|
||||
<Button type={"primary"} onClick={updateDetail}>更新仓库设置</Button>
|
||||
<Button type={"primary"} onClick={updateDetail}>更新组织设置</Button>
|
||||
</Form>
|
||||
</Div>
|
||||
</WhiteBack>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,122 @@
|
|||
import React, { Component } from "react";
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Spin } from 'antd';
|
||||
import NoneData from '../Nodata';
|
||||
import './version.css';
|
||||
import axios from 'axios';
|
||||
import RenderHtml from '../../components/render-html';
|
||||
|
||||
/**
|
||||
* issue_chosen:下拉的筛选列表,
|
||||
* data:列表接口返回的所有数据,
|
||||
* issues:列表数组,
|
||||
* isSpin:加载中,
|
||||
*/
|
||||
class version extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
issue_chosen: undefined,
|
||||
data: undefined,
|
||||
releases:undefined,
|
||||
issues: undefined,
|
||||
isSpin: true,
|
||||
search: undefined,
|
||||
search_count: undefined,
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.getIssueList();
|
||||
}
|
||||
// 获取列表数据
|
||||
getIssueList = () => {
|
||||
const { projectsId, owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/releases.json`;
|
||||
axios.get(url).then((result) => {
|
||||
if (result) {
|
||||
this.setState({
|
||||
data: result.data,
|
||||
releases:result.data.releases,
|
||||
issues: result.data.issues,
|
||||
isSpin: false
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
// 显示版本描述
|
||||
showBody=(key,flag)=>{
|
||||
let { releases } = this.state;
|
||||
releases[key].bodyshow = !flag;
|
||||
this.setState({
|
||||
releases
|
||||
})
|
||||
}
|
||||
|
||||
renderList = (releases) => {
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
if (releases && releases.length > 0) {
|
||||
return (
|
||||
releases.map((item, key) => {
|
||||
return (
|
||||
<div className="versionInfo" key={key}>
|
||||
<span className="versionInfo_left">
|
||||
<span className={`${item.draft === "稳定" ?"versionTag green":"versionTag yellow"}`}>{item.draft}</span>
|
||||
<span className="mt10">{item.created_at}</span>
|
||||
<span className="color-grey-8">
|
||||
<i className="iconfont icon-biaoqian3 mr3 font-14"></i>
|
||||
{item.tag_name}
|
||||
</span>
|
||||
</span>
|
||||
<div className="versionInfo_right">
|
||||
<span className="versionName">
|
||||
<span className="task-hide">{item.name}</span>
|
||||
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
||||
</span>
|
||||
<span className="color-grey-3">
|
||||
<i className={`${item.bodyshow ? "iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14"}`} onClick={()=>this.showBody(key,item.bodyshow)}></i>
|
||||
{item.user_name}:<span className="color-grey-8">发布了这个版本,并在发布后提交给{item.target_commitish}</span>
|
||||
</span>
|
||||
{
|
||||
item.bodyshow && <RenderHtml className="break_word_comments imageLayerParent" value={item.body} url={this.props.history.location}/>
|
||||
}
|
||||
<RenderHtml />
|
||||
<p className="mt10 pl3">
|
||||
<a href={item.tarball_url} style={{color:"#4CC1DA"}} className="mr30"><i className="iconfont icon-TAR font-18 mr5"></i>TAR</a>
|
||||
<a href={item.zipball_url} style={{color:"#28BD6C"}}><i className="iconfont icon-ZIP font-18 mr5"></i>ZIP</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
)
|
||||
} else if (releases && releases.length === 0) {
|
||||
return ( <NoneData _html="暂时还没有相关数据!" /> )
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { projectsId ,owner } = this.props.match.params;
|
||||
const { data , releases , isSpin } = this.state
|
||||
|
||||
return (
|
||||
<div className="main" style={{padding:"0px"}}>
|
||||
<div className="topWrapper" style={{padding:"15px 20px"}}>
|
||||
<span className="font-18 color-grey-3">版本发布</span>
|
||||
{
|
||||
data && data.user_permission ?
|
||||
<Link to={`/projects/${owner}/${projectsId}/releases/new`} className="topWrapper_btn_new">+ 发布新版</Link>
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
<div className="releasesVersion">
|
||||
<Spin spinning={isSpin}><div>{this.renderList(releases)}</div></Spin>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default version;
|
||||
|
|
@ -123,6 +123,8 @@ class Infos extends Component {
|
|||
});
|
||||
const { current_user } = this.props;
|
||||
const { username } = this.props.match.params;
|
||||
const { pathname } = this.props.location;
|
||||
const { notice } = this.state;
|
||||
|
||||
let url = `/users/${username || (current_user && current_user.login)}.json`;
|
||||
axios.get(url).then((result) => {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ function Team(props){
|
|||
</Menu>
|
||||
)
|
||||
|
||||
|
||||
return(
|
||||
<div>
|
||||
<div className="headerbox">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,161 @@
|
|||
import React , { useEffect } from 'react';
|
||||
import Slider from 'react-slick';
|
||||
import Beijing from './Img/unit/beijing.png';
|
||||
import SHJT from './Img/unit/SHJT.png';
|
||||
import DD from './Img/unit/DD.png';
|
||||
import HW from './Img/unit/HW.png';
|
||||
import ML from './Img/unit/ML.png';
|
||||
import QH from './Img/unit/QH.png';
|
||||
import QZ from './Img/unit/QZ.png';
|
||||
import TX from './Img/unit/TX.png';
|
||||
import XH from './Img/unit/XH.png';
|
||||
import XJY from './Img/unit/XJY.png';
|
||||
import ZC from './Img/unit/ZC.png';
|
||||
import GFKJ from './Img/unit/GFKJ.png';
|
||||
import BJHKHT from './Img/unit/BJHKHT.png';
|
||||
import ISCAS from './Img/unit/ISCAS.png';
|
||||
import NJDX from './Img/unit/NJDX.png';
|
||||
import CEC from './Img/unit/CEC.png';
|
||||
import KYRJLM from './Img/unit/KYRJLM.png';
|
||||
import WXYJY from './Img/unit/WXYJY.png';
|
||||
import HSKY from './Img/unit/HSKY.png';
|
||||
import LSLM from './Img/unit/LSLM.png';
|
||||
import TG from './Img/unit/TG.png';
|
||||
import LC from './Img/unit/LC.png';
|
||||
import YKD from './Img/unit/YKD.png';
|
||||
import Axios from 'axios';
|
||||
import { useState } from 'react';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
||||
const list = [
|
||||
{image_url:GFKJ, name:"国防科技大学",src:"https://www.nudt.edu.cn/"},
|
||||
{image_url:TG, name:"头歌",src:"https://www.educoder.net/"},
|
||||
{image_url:XJY, name:"长沙先进技术研究院",src:"https://www.hnjmrh.gov.cn/newweb/service/detail/305/"},
|
||||
{image_url:Beijing, name:"北京大学",src:"https://www.pku.edu.cn/"},
|
||||
{image_url:BJHKHT, name:"北京航空航天",src:"https://www.buaa.edu.cn/"},
|
||||
{image_url:ISCAS, name:"ISCAS",src:"http://www.iscas.ac.cn/"},
|
||||
{image_url:NJDX, name:"南京大学",src:"https://www.nju.edu.cn/"},
|
||||
{image_url:DD, name:"滴滴",src:"https://www.didiglobal.com/"},
|
||||
{image_url:CEC, name:"CEC",src:"https://www.cec.com.cn/"},
|
||||
{image_url:HW, name:"华为",src:"https://www.huawei.com/"},
|
||||
{image_url:ML, name:"木兰开源社区",src:"https://www.mulanos.cn/"},
|
||||
{image_url:TX, name:"腾讯",src:"https://www.tencent.com/zh-cn"},
|
||||
{image_url:KYRJLM, name:"中国开源软件推进联盟",src:"http://www.copu.org.cn/"},
|
||||
{image_url:XH, name:"中国计算机学会",src:"https://www.ccf.org.cn/"},
|
||||
{image_url:QZ, name:"openi启智",src:"https://www.openi.org.cn/"},
|
||||
{image_url:HSKY, name:"红山开源",src:"https://osredm.com/"},
|
||||
{image_url:LSLM, name:"绿色产业联盟",src:"https://www.opengcc.org/"},
|
||||
{image_url:ZC, name:"中创软件",src:"http://www.cvicse.com/"},
|
||||
{image_url:LC, name:"浪潮",src:"https://cloud.inspur.com/"},
|
||||
{image_url:YKD, name:"ucloud",src:"https://www.ucloud.cn/"}
|
||||
]
|
||||
|
||||
const settings = {
|
||||
dots: false,
|
||||
infinite: true,
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
vertical: true,
|
||||
verticalSwiping: true,
|
||||
autoplay:true,
|
||||
arrows:false
|
||||
};
|
||||
function FifthEdition() {
|
||||
const [ topics ,setTopics ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
// if(list.length>10){
|
||||
// Init();
|
||||
// }
|
||||
getUnit();
|
||||
},[])
|
||||
|
||||
function getUnit(){
|
||||
const url =`/topics.json`;
|
||||
Axios.get(url,{params:{
|
||||
topic_type:"cooperator",
|
||||
limit:20,
|
||||
group_size:5
|
||||
}}).then(result=>{
|
||||
if(result){
|
||||
setTopics(result.data.topics);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function Init() {
|
||||
let box = document.getElementById('scrollBox1');
|
||||
scrollUp();
|
||||
var myTimer = setInterval(scrollUp, 10);
|
||||
// 鼠标移入container 元素上 清除定时器 停止滚动
|
||||
box.onmouseover = () => {
|
||||
clearInterval(myTimer);
|
||||
}
|
||||
// 鼠标移出container 元素上 继续滚动
|
||||
// 60表示每隔60毫秒向上滚动一次
|
||||
box.onmouseout = () => {
|
||||
myTimer = setInterval(scrollUp, 10);
|
||||
}
|
||||
}
|
||||
|
||||
function scrollUp() {
|
||||
let box = document.getElementById('scrollBox1');
|
||||
if(box){
|
||||
let con1 = document.getElementById('box1');
|
||||
if (box.scrollLeft >= con1.clientWidth) {
|
||||
box.scrollLeft = 0;
|
||||
} else {
|
||||
box.scrollLeft++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(
|
||||
<div id={"scrollBox1"}>
|
||||
{/* <div style={{width:370*list.length+"px"}}>
|
||||
<ul className="fifthList" id="box1" style={{width:(370*list.length)/2+"px"}}>
|
||||
{
|
||||
list && list.map((i,k)=>{
|
||||
return(
|
||||
<li><a href={i.src} target="_blank"><img src={i.image_url} alt={i.name}/></a></li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
{list.length > 10 &&
|
||||
<ul className="fifthList" id="box2" style={{width:(370*list.length)/2+"px"}}>
|
||||
{
|
||||
list && list.map((i,k)=>{
|
||||
return(
|
||||
<li><a href={i.src} target="_blank"><img src={i.image_url} alt={i.name}/></a></li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div> */}
|
||||
{
|
||||
topics && topics.length>0 ?
|
||||
<Slider {...settings} className="unitMainSlider">
|
||||
{
|
||||
topics.map((i,k)=>{
|
||||
return(
|
||||
<div className="slickMainline">
|
||||
{
|
||||
i.map((j,k1)=>{
|
||||
return(
|
||||
<a href={j.url} target="_blank"><img src={getImageUrl(j.image)} alt=""/></a>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Slider>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default FifthEdition;
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
import React from 'react';
|
||||
import Img from './Img/gitlink.png';
|
||||
import qqImg from './Img/qq.png';
|
||||
function Footnav() {
|
||||
return(
|
||||
<div className="footEdition">
|
||||
<div className="footContent">
|
||||
<ul className="center">
|
||||
<img src={Img} alt="Gitlink(确实开源)" height="29px"/>
|
||||
<p>(确实开源)</p>
|
||||
</ul>
|
||||
<ul>
|
||||
<li className="thehead">社区</li>
|
||||
<li><a href="/">网站首页</a></li>
|
||||
{/* 关于我们 */}
|
||||
<li><a href="https://forum.trustie.net/forums/1168/detail">帮助中心</a></li>
|
||||
<li><a href="https://forum.trustie.net/">论坛交流</a></li>
|
||||
<li><a href="https://www.trustie.net/cooperation">合作伙伴</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li className="thehead">支持与服务</li>
|
||||
<li><a href="https://forgeplus.trustie.net/docs/api">API文档</a></li>
|
||||
<li><a href="https://git-scm.com">Git常用命令</a></li>
|
||||
<li><a href="https://forum.trustie.net/forums/3080/detail">DevOps使用文档</a></li>
|
||||
<li><a href='https://www.trustie.net/agreement'>服务协议</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li className="thehead">加入我们</li>
|
||||
<li className="theline">
|
||||
{/* <div className="mr50">
|
||||
<li>公众号</li>
|
||||
<img src={qqImg} alt="公众号"/>
|
||||
</div> */}
|
||||
<div>
|
||||
<li>QQ群</li>
|
||||
<div className="imgCon">
|
||||
<img src={qqImg} alt="QQ群"/>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p className="copyrightDesc">©Copyright 2007~2021 国防科技大学GitLink团队 & IntelliDE <br/>湘ICP备 17009477号</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Footnav;
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
import React from 'react';
|
||||
import './Index.scss';
|
||||
// import gitlink from './Img/gitlink.png';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
||||
function HeadNav({showLoginDialog,mygetHelmetapi}) {
|
||||
const register = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.register;
|
||||
const navbar = mygetHelmetapi && mygetHelmetapi.navbar;
|
||||
return(
|
||||
<div className="headNav">
|
||||
<div className="headNavDiv">
|
||||
<ul className="headlist">
|
||||
<li><img src={getImageUrl(`/${mygetHelmetapi && mygetHelmetapi.nav_logo_url}`)} alt="gitlink" height="37px" style={{marginRight:"15px"}}/></li>
|
||||
{
|
||||
navbar && navbar.length>0&&
|
||||
navbar.map((i,k)=>{
|
||||
return(
|
||||
<li style={{display:i.hidden?"none":"block"}}><a href={i.link}>{i.name}</a></li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
<div>
|
||||
<a className="color-white" onClick={showLoginDialog}>登录</a>
|
||||
<a className="regBtn" href={register}>注册</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default HeadNav;
|
||||
|
After Width: | Height: | Size: 535 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 470 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 3.3 KiB |