首页v2版

This commit is contained in:
谢思 2025-11-11 18:47:13 +08:00
parent 6fae1fabdb
commit 48b03d1a35
57 changed files with 1460 additions and 13 deletions

View File

@ -236,10 +236,10 @@ module.exports = {
loader: 'less-loader', // compiles Less to CSS
options: {
modifyVars: {
'primary-color': '#466aff',
'primary-color': '#2149d4',
'primary-color-hover': '#6684FE',
'primary-color-active': '#1A47FF',
'link-color': '#466aff',
'link-color': '#2149d4',
},
javascriptEnabled: true,
},

View File

@ -248,8 +248,8 @@ module.exports = {
loader: 'less-loader', // compiles Less to CSS
options: {
modifyVars: {
'primary-color': '#466aff',
'link-color': '#466aff',
'primary-color': '#2149d4',
'link-color': '#2149d4',
},
javascriptEnabled: true,
},

View File

@ -194,8 +194,8 @@ const serverConfig = {
loader: 'less-loader', // compiles Less to CSS
options: {
modifyVars: {
'primary-color': '#466aff',
'link-color': '#466aff',
'primary-color': '#2149d4',
'link-color': '#2149d4',
},
javascriptEnabled: true,
},

View File

@ -16,6 +16,10 @@
font-family: "alibabaReg";
src: url("../fonts/ALIBABA-PUHUITI-REGULAR.TTF");
}
@font-face {
font-family: "ziyouwenyihei";
src: url("../fonts/ziyouwenyihei.ttf");
}
.header {
width: 100%;
height: 51px;
@ -6333,4 +6337,8 @@ p {
.cursor {
cursor: pointer
}
.opacity80{
opacity: 0.8;
}

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1727340588188') format('woff2'),
url('iconfont.woff?t=1727340588188') format('woff'),
url('iconfont.ttf?t=1727340588188') format('truetype');
src: url('iconfont.woff2?t=1762825432985') format('woff2'),
url('iconfont.woff?t=1762825432985') format('woff'),
url('iconfont.ttf?t=1762825432985') format('truetype');
}
.iconfont {
@ -13,6 +13,270 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-wendangbangong-01:before {
content: "\e9bd";
}
.icon-wendangsousuo:before {
content: "\e9b7";
}
.icon-jieyakelu:before {
content: "\e9b0";
}
.icon-tuxingtuxiang1:before {
content: "\e9b6";
}
.icon-xiazaigongju:before {
content: "\e9bc";
}
.icon-shipinchuli:before {
content: "\e9b2";
}
.icon-liulanqi:before {
content: "\e9b8";
}
.icon-shejiaoliaotian:before {
content: "\e9b9";
}
.icon-shurufa:before {
content: "\e9ba";
}
.icon-quanbuleibie:before {
content: "\e9bb";
}
.icon-tuxingtuxiang:before {
content: "\e9af";
}
.icon-xitonggongju:before {
content: "\e9b1";
}
.icon-wendangbangong:before {
content: "\e9b3";
}
.icon-zhuomiankongzhi:before {
content: "\e9b4";
}
.icon-Npm:before {
content: "\e9ad";
}
.icon-Maven:before {
content: "\e9ac";
}
.icon-Python:before {
content: "\e9ae";
}
.icon-a-xiazai3:before {
content: "\e9ab";
}
.icon-xiala4:before {
content: "\e9a9";
}
.icon-tufaxingzhongdasuanlixuqiuyingjixiangying:before {
content: "\e9a0";
}
.icon-kuazhongxinxietongkeyanjisuanrenwutiaodu:before {
content: "\e9a1";
}
.icon-xingnengjizhunyupingce:before {
content: "\e9a8";
}
.icon-jiantou3:before {
content: "\e9a5";
}
.icon-jiantou21:before {
content: "\e9a6";
}
.icon-a-xiazai1:before {
content: "\e9a7";
}
.icon-binghangjisuankuangjia:before {
content: "\e9aa";
}
.icon-shouqi:before {
content: "\e99f";
}
.icon-zhankai1:before {
content: "\e9a2";
}
.icon-renwutiaoduguanli:before {
content: "\e9a3";
}
.icon-yigoushujuku:before {
content: "\e9a4";
}
.icon-shequissue:before {
content: "\e99c";
}
.icon-shequ-xuanzhong:before {
content: "\e99d";
}
.icon-shequ1:before {
content: "\e99e";
}
.icon-huanjingbianliang:before {
content: "\e99b";
}
.icon-liuliangkongzhi:before {
content: "\e991";
}
.icon-tingzhi:before {
content: "\e993";
}
.icon-qiangzhitingzhi:before {
content: "\e995";
}
.icon-zanting1:before {
content: "\e99a";
}
.icon-qidong1:before {
content: "\e996";
}
.icon-guanlianpeizhi:before {
content: "\e994";
}
.icon-shanchu9:before {
content: "\e997";
}
.icon-bianjipeizhi:before {
content: "\e998";
}
.icon-shilizhuce:before {
content: "\e999";
}
.icon-wangguanguanli:before {
content: "\e98d";
}
.icon-xiazaiYAML:before {
content: "\e98f";
}
.icon-huifu2:before {
content: "\e990";
}
.icon-zhongqi:before {
content: "\e992";
}
.icon-lianluzhuizong1:before {
content: "\e98e";
}
.icon-yincang3:before {
content: "\e986";
}
.icon-shoujihao:before {
content: "\e987";
}
.icon-xianshi1:before {
content: "\e988";
}
.icon-mima:before {
content: "\e989";
}
.icon-paixu:before {
content: "\e98a";
}
.icon-jiantou_xiangyou:before {
content: "\e98b";
}
.icon-a-fork1:before {
content: "\e98c";
}
.icon-dianzan1:before {
content: "\e983";
}
.icon-yonghuming:before {
content: "\e984";
}
.icon-youxiang2:before {
content: "\e985";
}
.icon-tongzhi1:before {
content: "\e981";
}
.icon-xinzeng:before {
content: "\e982";
}
.icon-a-fenzhi1:before {
content: "\e980";
}
.icon-yunxiazai:before {
content: "\e97b";
}
.icon-lunwen1:before {
content: "\e97c";
}
.icon-zhuanli2:before {
content: "\e97d";
}
.icon-jiantou2:before {
content: "\e97e";
}
.icon-jiantou-you-cuxiantiao:before {
content: "\e97f";
}
.icon-gongxianquequan:before {
content: "\e979";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,468 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "46034062",
"name": "文档办公-01",
"font_class": "wendangbangong-01",
"unicode": "e9bd",
"unicode_decimal": 59837
},
{
"icon_id": "46033728",
"name": "文档搜索",
"font_class": "wendangsousuo",
"unicode": "e9b7",
"unicode_decimal": 59831
},
{
"icon_id": "46033639",
"name": "解压刻录",
"font_class": "jieyakelu",
"unicode": "e9b0",
"unicode_decimal": 59824
},
{
"icon_id": "46033573",
"name": "图形图像",
"font_class": "tuxingtuxiang1",
"unicode": "e9b6",
"unicode_decimal": 59830
},
{
"icon_id": "46033572",
"name": "下载工具",
"font_class": "xiazaigongju",
"unicode": "e9bc",
"unicode_decimal": 59836
},
{
"icon_id": "46033597",
"name": "视频处理",
"font_class": "shipinchuli",
"unicode": "e9b2",
"unicode_decimal": 59826
},
{
"icon_id": "46033165",
"name": "浏览器",
"font_class": "liulanqi",
"unicode": "e9b8",
"unicode_decimal": 59832
},
{
"icon_id": "46033154",
"name": "社交聊天",
"font_class": "shejiaoliaotian",
"unicode": "e9b9",
"unicode_decimal": 59833
},
{
"icon_id": "46033153",
"name": "输入法",
"font_class": "shurufa",
"unicode": "e9ba",
"unicode_decimal": 59834
},
{
"icon_id": "46032783",
"name": "全部类别",
"font_class": "quanbuleibie",
"unicode": "e9bb",
"unicode_decimal": 59835
},
{
"icon_id": "46032622",
"name": "图形图像",
"font_class": "tuxingtuxiang",
"unicode": "e9af",
"unicode_decimal": 59823
},
{
"icon_id": "46032621",
"name": "系统工具",
"font_class": "xitonggongju",
"unicode": "e9b1",
"unicode_decimal": 59825
},
{
"icon_id": "46032619",
"name": "文档办公",
"font_class": "wendangbangong",
"unicode": "e9b3",
"unicode_decimal": 59827
},
{
"icon_id": "46032616",
"name": "桌面控制",
"font_class": "zhuomiankongzhi",
"unicode": "e9b4",
"unicode_decimal": 59828
},
{
"icon_id": "46032217",
"name": "Npm",
"font_class": "Npm",
"unicode": "e9ad",
"unicode_decimal": 59821
},
{
"icon_id": "46032121",
"name": "Maven",
"font_class": "Maven",
"unicode": "e9ac",
"unicode_decimal": 59820
},
{
"icon_id": "46032118",
"name": "Python",
"font_class": "Python",
"unicode": "e9ae",
"unicode_decimal": 59822
},
{
"icon_id": "46031753",
"name": "下载 (3)",
"font_class": "a-xiazai3",
"unicode": "e9ab",
"unicode_decimal": 59819
},
{
"icon_id": "46031290",
"name": "下拉",
"font_class": "xiala4",
"unicode": "e9a9",
"unicode_decimal": 59817
},
{
"icon_id": "45509718",
"name": "突发性重大算力需求应急响应",
"font_class": "tufaxingzhongdasuanlixuqiuyingjixiangying",
"unicode": "e9a0",
"unicode_decimal": 59808
},
{
"icon_id": "45509716",
"name": "跨中心协同科研计算任务调度",
"font_class": "kuazhongxinxietongkeyanjisuanrenwutiaodu",
"unicode": "e9a1",
"unicode_decimal": 59809
},
{
"icon_id": "45509717",
"name": "性能基准与评测",
"font_class": "xingnengjizhunyupingce",
"unicode": "e9a8",
"unicode_decimal": 59816
},
{
"icon_id": "45509657",
"name": "箭头",
"font_class": "jiantou3",
"unicode": "e9a5",
"unicode_decimal": 59813
},
{
"icon_id": "45509658",
"name": "箭头2",
"font_class": "jiantou21",
"unicode": "e9a6",
"unicode_decimal": 59814
},
{
"icon_id": "45509659",
"name": "下载 (1)",
"font_class": "a-xiazai1",
"unicode": "e9a7",
"unicode_decimal": 59815
},
{
"icon_id": "45509654",
"name": "并行计算框架",
"font_class": "binghangjisuankuangjia",
"unicode": "e9aa",
"unicode_decimal": 59818
},
{
"icon_id": "45509663",
"name": "收起",
"font_class": "shouqi",
"unicode": "e99f",
"unicode_decimal": 59807
},
{
"icon_id": "45509660",
"name": "展开",
"font_class": "zhankai1",
"unicode": "e9a2",
"unicode_decimal": 59810
},
{
"icon_id": "45509661",
"name": "任务调度管理",
"font_class": "renwutiaoduguanli",
"unicode": "e9a3",
"unicode_decimal": 59811
},
{
"icon_id": "45509664",
"name": "异构数据库",
"font_class": "yigoushujuku",
"unicode": "e9a4",
"unicode_decimal": 59812
},
{
"icon_id": "45229517",
"name": "社区issue",
"font_class": "shequissue",
"unicode": "e99c",
"unicode_decimal": 59804
},
{
"icon_id": "45229516",
"name": "社区-选中",
"font_class": "shequ-xuanzhong",
"unicode": "e99d",
"unicode_decimal": 59805
},
{
"icon_id": "45229515",
"name": "社区",
"font_class": "shequ1",
"unicode": "e99e",
"unicode_decimal": 59806
},
{
"icon_id": "44951992",
"name": "环境变量",
"font_class": "huanjingbianliang",
"unicode": "e99b",
"unicode_decimal": 59803
},
{
"icon_id": "44779010",
"name": "流量控制",
"font_class": "liuliangkongzhi",
"unicode": "e991",
"unicode_decimal": 59793
},
{
"icon_id": "44779009",
"name": "停止",
"font_class": "tingzhi",
"unicode": "e993",
"unicode_decimal": 59795
},
{
"icon_id": "44779008",
"name": "强制停止",
"font_class": "qiangzhitingzhi",
"unicode": "e995",
"unicode_decimal": 59797
},
{
"icon_id": "44779007",
"name": "暂停",
"font_class": "zanting1",
"unicode": "e99a",
"unicode_decimal": 59802
},
{
"icon_id": "44778800",
"name": "启动",
"font_class": "qidong1",
"unicode": "e996",
"unicode_decimal": 59798
},
{
"icon_id": "44778675",
"name": "关联配置",
"font_class": "guanlianpeizhi",
"unicode": "e994",
"unicode_decimal": 59796
},
{
"icon_id": "44778677",
"name": "删除",
"font_class": "shanchu9",
"unicode": "e997",
"unicode_decimal": 59799
},
{
"icon_id": "44778671",
"name": "编辑配置",
"font_class": "bianjipeizhi",
"unicode": "e998",
"unicode_decimal": 59800
},
{
"icon_id": "44778674",
"name": "实例注册",
"font_class": "shilizhuce",
"unicode": "e999",
"unicode_decimal": 59801
},
{
"icon_id": "44778684",
"name": "网关管理",
"font_class": "wangguanguanli",
"unicode": "e98d",
"unicode_decimal": 59789
},
{
"icon_id": "44778683",
"name": "下载YAML",
"font_class": "xiazaiYAML",
"unicode": "e98f",
"unicode_decimal": 59791
},
{
"icon_id": "44778682",
"name": "恢复",
"font_class": "huifu2",
"unicode": "e990",
"unicode_decimal": 59792
},
{
"icon_id": "44778681",
"name": "重启",
"font_class": "zhongqi",
"unicode": "e992",
"unicode_decimal": 59794
},
{
"icon_id": "44778292",
"name": "链路追踪",
"font_class": "lianluzhuizong1",
"unicode": "e98e",
"unicode_decimal": 59790
},
{
"icon_id": "43884585",
"name": "隐藏",
"font_class": "yincang3",
"unicode": "e986",
"unicode_decimal": 59782
},
{
"icon_id": "43884586",
"name": "手机号",
"font_class": "shoujihao",
"unicode": "e987",
"unicode_decimal": 59783
},
{
"icon_id": "43884583",
"name": "显示",
"font_class": "xianshi1",
"unicode": "e988",
"unicode_decimal": 59784
},
{
"icon_id": "43884584",
"name": "密码",
"font_class": "mima",
"unicode": "e989",
"unicode_decimal": 59785
},
{
"icon_id": "43884582",
"name": "排序",
"font_class": "paixu",
"unicode": "e98a",
"unicode_decimal": 59786
},
{
"icon_id": "43884581",
"name": "箭头_向右",
"font_class": "jiantou_xiangyou",
"unicode": "e98b",
"unicode_decimal": 59787
},
{
"icon_id": "43884580",
"name": "fork (1)",
"font_class": "a-fork1",
"unicode": "e98c",
"unicode_decimal": 59788
},
{
"icon_id": "43884589",
"name": "点赞",
"font_class": "dianzan1",
"unicode": "e983",
"unicode_decimal": 59779
},
{
"icon_id": "43884587",
"name": "用户名",
"font_class": "yonghuming",
"unicode": "e984",
"unicode_decimal": 59780
},
{
"icon_id": "43884588",
"name": "邮箱",
"font_class": "youxiang2",
"unicode": "e985",
"unicode_decimal": 59781
},
{
"icon_id": "43788877",
"name": "通知",
"font_class": "tongzhi1",
"unicode": "e981",
"unicode_decimal": 59777
},
{
"icon_id": "43788876",
"name": "新增",
"font_class": "xinzeng",
"unicode": "e982",
"unicode_decimal": 59778
},
{
"icon_id": "39410543",
"name": "分支 (1)",
"font_class": "a-fenzhi1",
"unicode": "e980",
"unicode_decimal": 59776
},
{
"icon_id": "42234576",
"name": "云下载",
"font_class": "yunxiazai",
"unicode": "e97b",
"unicode_decimal": 59771
},
{
"icon_id": "42234575",
"name": "论文",
"font_class": "lunwen1",
"unicode": "e97c",
"unicode_decimal": 59772
},
{
"icon_id": "42234574",
"name": "专利",
"font_class": "zhuanli2",
"unicode": "e97d",
"unicode_decimal": 59773
},
{
"icon_id": "42234573",
"name": "箭头",
"font_class": "jiantou2",
"unicode": "e97e",
"unicode_decimal": 59774
},
{
"icon_id": "42234572",
"name": "箭头-右-粗线条",
"font_class": "jiantou-you-cuxiantiao",
"unicode": "e97f",
"unicode_decimal": 59775
},
{
"icon_id": "41876673",
"name": "贡献确权",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -109,7 +109,7 @@ const ProjectIndex = Loadable({
});
const Home = Loadable({
loader: () => import('./forge/Main/projectHomeNew'),
loader: () => import('./forge/Main/projectHomeNew/v2'),
loading: Loading,
})

View File

@ -0,0 +1,129 @@
import React, { useEffect, useState } from 'react';
import { Button, Input, message, Modal, Popover , Tooltip } from 'antd';
import './Component.scss';
import axios from 'axios';
import ShareModal from './SiderBarShareModal';
import Handbook1 from '../Images/handbook1.png';
const $ = window.$;
$(window).scroll(function () {
if ($(".gotop").length > 0) {
if ($(document).scrollTop() > 0) {
$(".-task-sidebar .gotop").show();
$(".gotop").click(function () {
$("html,body").scrollTop(0);
});
}
if ($(document).scrollTop() === 0) {
$(".-task-sidebar .gotop").hide();
}
}
});
function SiderBar(props) {
const {location, history,user} = props;
const {search, pathname} = location;
const [ data , setData ] = useState([]);
const [ visible , setVisible ] = useState(false);
const [ login , setLogin ]= useState(false);
const [ feedBackModal, setFeedBackModal] = useState(false);
const [ feedBackValue, setFeedBackValue] = useState(undefined);
const [ failApply, setFailApply] = useState(undefined);
useEffect(()=>{
user && setLogin(user.login);
},[user])
useEffect(()=>{
getFAQ();
// getCurrentUser();
//
$(".-task-sidebar .gotop").hide();
//
if(search && search.indexOf('feedback') !== -1 && search.indexOf('type=feedback') === -1){
// issue
setFeedBackModal(true)
}
},[])
function getFAQ(){
const url = `/faqs.json`;
axios.get(url).then(result=>{
if(result && result.data){
setData(result.data);
}
}).catch(error=>{})
}
function content(list){
return <div>
<ul className="faqUl">
{
list && list.map((i,k)=>{
return(
<li key={i.question+k}><a href={`${i.url}`} title={i.question} target="_blank">{i.question}</a></li>
)
})
}
</ul>
</div>
}
function shareContent(){
return <div>
<ul className="shareUl">
<p className="titlecontent">分享到</p>
<li onClick={()=>setVisible(true)}><i className="iconfont icon-weixin2" style={{color:"#62b900"}}></i></li>
</ul>
</div>
}
//
function feedBackClick(){
if(login){
setFeedBackModal(true);
}else{
history.push(`/login?go_page=${pathname}?feedback`);
}
}
function applyFeedBack(){
if(feedBackValue){
setFailApply(undefined);
setFeedBackModal(false);
setFeedBackValue(undefined);
axios.post(`/v1/${login}/feedbacks`,{content: feedBackValue}).then(res=>{
if(res && res.data && !res.data.status){
message.success('反馈成功');
}
})
}else{
setFailApply('请填写您的反馈建议');
}
}
return (
<div>
<a className="needApplyBut" onClick={feedBackClick}>需求反馈</a>
<Modal
width={610}
className='feedBackModal'
visible={feedBackModal}
onCancel={()=>{setFeedBackModal(false); history.push(pathname)}}
title={'需求反馈'}
footer={<Button type='primary' style={{width: '300px', height: '36px'}} onClick={applyFeedBack}>提交</Button>}>
<div className='feedBackBox'>
<Input.TextArea autoSize={{minRows: 9}} placeholder={`请在此处输入您的姓名、单位名称以及需求或建议,我们将会认真对待每一条反馈`} className={`feedBackText ${failApply ? 'errorInput' : ''}`} maxLength={500} value={feedBackValue} onChange={(e)=>{setFeedBackValue(e.target.value); e.target.value && e.target.value.length && setFailApply(undefined);}}/>
<span className='countNumBox'>{(feedBackValue && feedBackValue.length) || 0}/500</span>
</div>
{failApply && <div className='mt10' style={{color: '#f60011'}}>{failApply}</div>}
</Modal>
</div>
)
}
export default SiderBar;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,259 @@
import React, { useEffect, useState } from "react";
import axios from "axios";
import { Divider, Input, Pagination, Popover, Spin } from "antd";
import { Link } from "react-router-dom";
import Nodata from "../../../Nodata";
import { getImageUrl } from "../../../../common/UrlTool";
import { TPMIndexHOC } from "../../../../modules/tpm/TPMIndexHOC";
import RenderHtml from "../../../../components/render-html";
import FeedBack from "../../../../forge/Component/feedBack";
import './index.scss';
const { Search } = Input;
function ProjectHomePage(props) {
const [cateList, setCateList] = useState(undefined);
const [projectsList, setProjectsList] = useState(undefined);
const [search, setSearch] = useState(undefined);
const [cateID, setCateID] = useState(undefined);
const [isSpin, setIsSpin] = useState(true);
const [monthList, setMonthList] = useState(undefined);
const [total, setTotal] = useState(0);
const [page, setPage] = useState(1);
const [cateTopics, setCateTopics] = useState(undefined);
const [topicId, setTopicId] = useState(undefined);
const [topicDetail, setTopicDetail] = useState(undefined);
const [count, setCount] = useState({});
const {countByGHM, countByOther} = count;
const topicsByCateId = cateTopics && cateTopics[cateID];
// const topicsByCateId = cateTopics && cateTopics[cateID] || [
// {
// "id": "1,2",
// "name": "Maven",
// "icon": "icon-maven",
// "intro": "使maven **settings.xml** Maven **conf/settings.xml** **m2/settings.xml**\n\n`settings.xml`` <mirrors>` \n\n```xml\n<mirrors>\n <mirror>\n <id>xzgd-repo-mirror</id>\n <mirrorOf>*</mirrorOf>\n <url>http://172.16.6.110:8081/repository/maven-repo/</url>\n </mirror>\n</mirrors>\n```\n\n\n`settings.xml``<profiles>`\n\n\n```xml\n<profiles> \n <profile> \n <id>xzgd-maven-mirror-profile</id>\n <repositories>\n <repository>\n <id>xzgd-maven-mirror</id>\n <url>http://172.16.6.110:8081/repository/maven-repo/</url>\n </repository>\n </repositories>\n <pluginRepositories>\n <pluginRepository>\n <id>xzgd-maven-mirror</id>\n <url>http://172.16.6.110:8081/repository/maven-repo/</url> \n </pluginRepository> \n </pluginRepositories> \n </profile> \n</profiles>\n```\n\n`settings.xml``<activeProfiles>`\n\n```xml\n<activeProfiles>\n <activeProfile>xzgd-maven-mirror-profile</activeProfile>\n</activeProfiles>\n```\n"
// },
// {
// "id": "2,4",
// "name": "Python",
// "icon": "icon-python",
// "intro": "****\n\n:\n```xml\npip config set global.index-url https://mirrors.aliyun.com/pypi/simple\npip config set install.trusted-host mirrors.aliyun.com\n```\n\n****\n\n pip \n\n**Windows** pip.ini C:\\Users\\<>\\pip\\pip.ini\n```xml\n[global]\nindex-url = https://mirrors.aliyun.com/pypi/simple/\n[install]\ntrusted-host = mirrors.aliyun.com\n```\n\n**Linux/Mac** ~/.config/pip/pip.conf \n```xml\n[global]\nindex-url = https://mirrors.aliyun.com/pypi/simple\n[install]\ntrusted-host = mirrors.aliyun.com\n```\n\n\n```xml\npip config list\n```"
// },
// {
// "id": "4,5",
// "name": "Npm",
// "icon": "icon-npm",
// "intro": "使npm config set registrynpm\n\n使\n\n```xml\nnpm config set registry https://registry.npm.taobao.org\n```\n\n\n```xml\nnpm config get registry\n```\n\nnpm"
// }
// ];
const topicsLength = topicsByCateId && topicsByCateId.length
const LIMIT = !topicsLength ? 30 : 25;
useEffect(() => {
getCate();
// getList();
getCateTopic();
document.title = '军用开源软件仓库';
//
getInitCount();
}, [])
useEffect(() => {
setIsSpin(true);
getProject();
}, [cateID, search, page, topicId])
function getInitCount() {
const obj = {
countByGHM: 0,
countByOther: 0
}
axios.get(`/organizations/gh_mirrors/projects.json?page=1&limit=15&sort_by=updated_on&sort_direction=desc`).then(result => {
if (result && result.data) {
obj.countByGHM = result.data.total_count || 0
}
return axios.get(`/projects.json?pinned=d&limit=1`)
}).then(result => {
if (result && result.data) {
obj.countByOther = result.data.total_count - obj.countByGHM
}
setCount(obj);
}).catch(error => { })
}
function getCateTopic() {
fetch('/cate_topic.json').then(r => r.json()).then(res => {
setCateTopics(res);
});
}
function getCate() {
const url = `/project_categories/pinned_index.json`;
axios.get(url).then(result => {
if (result && result.data) {
const { project_categories=[] } = result.data;
setCateList(project_categories);
project_categories[0] && setCateID(project_categories[0].id);
}
}).catch(error => { })
}
function getProject() {
const url = `/projects.json`;
let params = {
pinned: "d",
category_id: cateID,
limit: LIMIT,
search: search,
page: page,
topic_id: topicId,
sort_by: cateID ? undefined : "praises_count",
language_id: undefined
};
if (cateID === 39 && topicId) {
// topicIdlanguage_idmavenpythonnpm
params.language_id = topicId.split(",")
params.topic_id = undefined
}
cateID && axios.get(url, { params }).then(result => {
if (result && result.data) {
setTotal(result.data.total_count);
setProjectsList(result.data.projects);
setIsSpin(false);
}
}).catch(error => { })
}
function getList() {
// const url = `/project_rank.json`;
const url = `/projects/banner_recommend.json`
axios.get(url, {
// params: {
// time: 30,
// page: 1,
// limit: 16
// }
}).then(result => {
if (result && result.data) {
setMonthList(result.data.projects);
}
}).catch(error => { })
}
return <div className="homepage_box">
{/* banner区域内容 */}
<div className="banner-wrapper">
<div className="banner-content">
<div className="homepageMain banner_main df">
<div className="">
<div className="font-30 color-white banner-title-1">军用开源软件仓库</div>
<div className="font-16 opacity80 color-white mt5 mb15">汇聚全球顶尖开源力量构建安全协同创新的软件生态赋能军事数字化转型与智能化升级</div>
<FeedBack {...props}/>
</div>
<div className="df color-white project_count glass-effect">
<div className="center">
<p>{countByOther}</p>
<span className="font-14 opacity80">软件包总数</span>
</div>
<Divider type="vertical" />
<div className="center">
<p>{countByGHM}</p>
<span className="font-14 opacity80">可信三方组件数</span>
</div>
</div>
</div>
</div>
</div>
<div className="homepage_content">
{/* 一级分类 */}
<div className="homepageMain df cate_list">
<span className="color-white font-15">软件分类&nbsp;</span>
<ul className="cate_ul">
{/* <a className={cateID ? "" : "active"} onClick={() => { setPage(1); setCateID(undefined); setTopicId(undefined) }}><span>热门推荐</span></a> */}
{
cateList && cateList.length > 0 ?
cateList.map((i, k) => {
return (
<a key={k} className={cateID === i.id ? "active" : ""} onClick={() => { setPage(1); setCateID(i.id); setTopicId(undefined) }}><span>{i.name}</span></a>
)
})
: ""
}
</ul>
<Search
placeholder="输入名称关键字"
size="middle"
onSearch={(value) => { setPage(1); setSearch(value); }}
className="mlat"
style={{ width: "320px", marginLeft: "auto" }}
allowClear
/>
</div>
{/* 二级分类以及仓库列表(左右布局) */}
<div className="homepageMain df project_list_box">
{/* 二级分类,即标签列表 */}
{topicsByCateId && !!topicsByCateId.length && <div className="left_cate2">
<ul className="topic_ul">
<li className={!topicId ? 'active' : ''} onClick={() => { setPage(1); setTopicId(undefined) }}>
<img src={require(`./img/${!topicId ? 'icon-all-1' : 'icon-all'}.png`)} alt="" width="18px" className="mr10 mb3" />
<span>全部类别</span>
</li>
{topicsByCateId.map((item, index) => {
const uniqueKey = `${cateID}-${index}`;
const isActive = item.id === topicId;
const imageName = `${item.icon}${isActive ? '-1' : ''}.png`;
return <li key={uniqueKey} className={item.id === topicId ? 'active' : ''} onClick={() => { setPage(1); setTopicId(item.id); setTopicDetail(item) }}>
<img src={require(`./img/${imageName}`)} alt="" width="18px" className="mr10 mb3" />
<span>{item.name}</span>
</li>
})}
</ul>
</div>}
{/* 项目列表 */}
<div className="flex1" style={{ position: 'relative' }}>
{/* 三方组件下的提示信息<div dangerouslySetInnerHTML={{__html: topicDetail.intro}}></div>*/}
{cateID === 39 && topicId && topicDetail && <Popover
getPopupContainer={trigger => trigger.parentNode}
content={
<div style={{ overflowY: 'auto', maxHeight: '500px' }}>
<RenderHtml value={topicDetail.intro} />
</div>
}
trigger="click"
placement="bottomLeft"
overlayClassName="tipByCate_Popover"
>
<div className="tipByCate pointer">{`设置${topicDetail.name}包管理器仓库地址,`}<a>查看更多</a></div>
</Popover>}
<Spin spinning={isSpin}>
{projectsList && !!projectsList.length ? <div className={`df home_project_list ${!topicsLength ? 'sixItemBox' : ''}`}>
{projectsList.map(i => {
const url = i.author ? `/${i.author.login}/${i.identifier}${i.author.login === "gh_mirrors" ? "/about" : "/about"}` : ``
return <div className="home_project">
{i.author && i.author.login !== "gh_mirrors" && <a className="download-icon" href={url}><i className="iconfont icon-a-xiazai3 font-12 mr5"></i>下载</a>}
<div className="df a-i-center" style={{ flex: 1 }}>
{i.lesson_url && <img src={getImageUrl(`${i.lesson_url}`)} alt="" className="author_img" />}
<div className="flex1">
<Link to={url}><div className="task-hide font-16 color-19 hover-light" style={{marginTop: '-5px'}}>{i.name}</div></Link>
{/* 项目标签 */}
{i.topics && <div className='proListTopics mt3'>
{/* {i.author && i.author.login === "gh_mirrors" && i.topics && !i.topics.length && <span className='proListTopic mr15 font-13 task-hide'>华中科技大学</span>} */}
{i.topics.slice(0, 2).map(item => <Link to={`/explore/topic/${item.id}/${encodeURIComponent(item.name)}`} className='proListTopic mr15 font-13 task-hide'>{item.name}</Link>)}
</div>}
</div>
</div>
{i.description && <div className="task-hide color-424 mt10">
{i.description}
</div>}
</div>
})}
</div> : <Nodata _html="暂无数据" />}
</Spin>
{cateID && <Pagination pageSize={LIMIT} total={total} hideOnSinglePage={true} current={page} onChange={(page) => { setPage(page) }} className='center mt30' />}
</div>
</div>
</div>
</div>
}
export default TPMIndexHOC(ProjectHomePage)

View File

@ -0,0 +1,325 @@
.homepageMain {
width: 1600px;
margin: 0 auto;
}
.homepage_box {
background-color: #f7f9ff;
}
.banner-content {
margin: 0 auto;
width: 1920px;
height: 461px;
background-image: url("./img/banner.png");
background-size: 100% 100%;
position: relative;
z-index: 1;
.banner_main {
justify-content: space-between;
align-items: center;
padding-top: 80px;
}
.banner-title-1 {
font-family: 'ziyouwenyihei';
}
.needApplyBut {
display: inline-block;
width: 140px;
height: 44px;
background-image: linear-gradient(136.87deg, #5eb4ff 0%, #2f49c0 48.54%, #2149d4 100%);
border-radius: 22px;
border: 2px solid #437ACF;
font-size: 16px;
text-align: center;
line-height: 40px;
color: white;
transition: all 0.3s ease;
&:hover {
background-image: linear-gradient(314.14deg, #5eb4ff 0%, #2f49c0 48.54%, #2149d4 100%);
}
&:active,
&:focus {
background-image: linear-gradient(314.14deg, #2149d4 0%, #2149d4 48.54%, #2149d4 100%);
}
}
.project_count {
width: 343px;
height: 103px;
// background-image: url('./img/count_bg.png');
// background-size: 100% 100%;
justify-content: space-evenly;
align-items: center;
.ant-divider {
height: 33px;
background: none;
background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.59) 0%, rgba(43, 255, 241, 0.07) 100%);
}
p {
font-size: 30px;
font-family: "YouSheBiaoTiHei";
}
.center{
min-width: 45%;
}
}
}
.banner-wrapper {
position: relative;
width: 100%;
height: 461px; // 添加高度以确保伪元素能正确显示
&::before,
&::after {
content: '';
position: absolute;
top: 0;
height: 100%;
width: 50%;
z-index: 0;
}
&::before {
left: 0;
background-image: linear-gradient(180deg, #030E33 0%, #030F34 60%, #041741 80%, #071e4d 100%);
}
&::after {
right: 0;
background-image: linear-gradient(180deg, #2B3B80 0%, #263269 25%, #192751 50%, #14254A 100%);
}
}
.homepage_content {
position: relative;
top: -140px;
z-index: 3;
}
.cate_list {
padding: 25px 30px 50px 30px;
// background-color: #29385D;
background-image: url("./img/cate_bg.png");
background-size: 100% 100%;
.cate_ul a {
background-color: #f4f6fa;
border-radius: 6px;
padding: 9px 11px;
margin: 0 8px;
color: #191919;
&:hover {
color: #2149d4;
}
&.active {
color: white;
background-color: #2149d4;
}
}
}
.project_list_box {
min-height: 550px;
background-color: #ffffff;
border-radius: 10px;
position: relative;
top: -25px;
.tipByCate {
padding: 10px 30px;
margin: 25px;
background-image: linear-gradient(121.96deg, #fff6e2 0%, #fff4eb 100%);
border-radius: 8px;
color: #301403;
font-size: 16px;
}
pre.prettyprint {
margin-bottom: 16px !important;
}
}
.left_cate2 {
width: 200px;
border-right: 1px solid rgba(76, 88, 118, 0.1);
padding-left: 35px;
padding-bottom: 35px;
.topic_ul {
li {
font-size: 16px;
margin-top: 20px;
color: #42464e;
cursor: pointer;
span {
position: relative;
padding-bottom: 5px;
display: inline-block;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 1px;
background-color: #191919;
transition: width 0.3s ease-in-out;
}
}
&:hover {
span {
&::after {
width: 100%;
}
}
}
}
li.active {
span {
font-weight: 500;
color: #191919;
&::after {
width: 100%;
background-color: #191919;
}
}
}
}
}
.project_list_box .home_project_list {
margin: 25px;
flex-wrap: wrap;
gap: 15px;
&.sixItemBox{
.home_project{
flex: 0 0 calc(16.6% - 13px);
}
}
.home_project {
padding: 30px 5px 20px 18px;
flex: 0 0 calc(20% - 13px);
background-color: #f7f9fd;
border-radius: 8px;
backdrop-filter: blur(10px);
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
width: 0;
.task-hide-2 {
word-break: break-all;
}
.color-424 {
color: #42464e;
}
.a-i-center {
align-items: center;
}
.author_img {
width: 54px;
height: 54px;
margin-right: 15px;
border-radius: 6px;
}
.download-icon {
width: 69px;
height: 30px;
position: absolute;
top: 0;
right: 0;
background-color: #ebf0fb;
border-radius: 0px 8px 0px 6px;
text-align: center;
line-height: 30px;
color:#2149d4;
}
.hover-light.color-grey-6,
.hover-light.color-grey-6 a {
color: #666 !important;
}
&:hover {
// border: 2px solid rgba(22, 93, 255, 1);
.hover-light, .hover-light a {
color: #2149d4 !important;
}
}
.proListTopics {
display: flex;
.proListTopic {
background-color: #ffffff;
border-radius: 4px;
max-width: 158px;
padding: 0 10px;
height: 22px;
line-height: 22px;
color: #737a87;
margin-bottom: 5px !important;
}
}
}
}
.tipByCate_Popover.ant-popover {
width: 96.5%;
.ant-popover-arrow {
display: none;
}
.ant-popover-content {
margin-top: -13px;
}
}
.glass-effect {
background: rgba(0, 0, 0, 0);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-radius: 5px;
position: relative;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 5px;
padding: 1px;
background: linear-gradient(180deg,#5871C8 0%,#4997DC 50%,#20469142 100%);;
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: destination-out;
mask-composite: exclude;
pointer-events: none;
}
}

View File

@ -1,5 +1,5 @@
$primary-color: #466aff;
$primary-color: #2149d4;
$primary-color-hover: #6684FE;
$primary-color-active: #1A47FF;
$link-color: #466aff;
$link-color: #2149d4;
$link-black-color: #05101a;