Merge pull request '样式优化等' (#710) from Eeeros/forgeplus-react:gitlink_ssr_head into gitlink_ssr_head

1
This commit is contained in:
Eeeros 2024-05-09 14:15:54 +08:00
commit a045b50f53
8 changed files with 89 additions and 44 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -22,15 +22,15 @@ export default ({ url , name , column , id , login })=>{
return(
id?
<Link to={`/${login}`}>
<Img>
<span className="User">
{ url && <img src={url} alt=""/> }
<span>{name}</span>
</Img>
</span>
</Link>
:
<Img>
<span className="User">
{ url && <img src={url} alt=""/> }
<span>{name}</span>
</Img>
</span>
)
}

View File

@ -410,7 +410,7 @@ function CoderDepot(props){
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type !==2 && pullsFlag && props.platform;
const fileOperate = type === "dir" && projectDetail && projectDetail.type !==2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
return(
<WhiteBack>
<div className='WhiteBack'>
{mirror_status ===0 && <UpdateDescModal desc={desc} website={website} lesson_url={lesson_url} topicsInfo={topics} visible={openModal} onCancel={()=>setOpenModal(false)} onOk={okUpdate}/> }
<Spin spinning={isSpin}>
{
@ -435,11 +435,11 @@ function CoderDepot(props){
<div style={{minHeight:"500px"}}>
{
projectDetail &&
<Box className="Panels">
<LongWidth>
<div className="Panels Box">
<div className="LongWidth">
<div className="panelmenu">
<FlexAJ>
<AlignCenter>
<div className="FlexAJ">
<div className="AlignCenter">
<div className="mr30">
{
props && (props.platform && mirror_status ===0) ?
@ -467,7 +467,7 @@ function CoderDepot(props){
/>
:
<React.Fragment>
<AlignCenter className="mr20">
<div className="mr20 AlignCenter">
{
props.platform ?
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
@ -482,8 +482,8 @@ function CoderDepot(props){
<span className="ml3">{projectDetail && projectDetail.branches_count}</span>
</span>
}
</AlignCenter>
<AlignCenter className="mr20">
</div>
<div className="mr20 AlignCenter">
{
props.platform ?
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn">
@ -497,11 +497,11 @@ function CoderDepot(props){
<span className="ml3">{projectDetail && projectDetail.tags_count}</span>
</span>
}
</AlignCenter>
</div>
</React.Fragment>
}
</AlignCenter>
<AlignCenter className="depotBtn">
</div>
<div className="depotBtn AlignCenter">
<div className="addOptionBtn">
{
baseOperate &&
@ -533,8 +533,8 @@ function CoderDepot(props){
<Dropdown overlay={downloadMenu} placement="bottomRight" trigger={['click']}>
<Button type={'primary'}>下载 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-white mr-3"></i></Button>
</Dropdown>
</AlignCenter>
</FlexAJ>
</div>
</div>
{
(dirInfo && dirInfo.length>0) || fileInfo ?
<div className="listtable">
@ -602,18 +602,18 @@ function CoderDepot(props){
{/* readme文件显示(显示文件详情时不显示readme文件) */}
{ (readme && readme.replace_content) ? <ReadMe ChangeFile={ChangeFile} readme={readme} operate={props && (props.isManager || props.isDeveloper) && projectDetail.type !==2 } history={props.history} /> :"" }
</div>
</LongWidth>
</div>
{
(!(treeValuePath && treeValuePath.length > 0) && !fileInfo ) &&
<ShortWidth>
<Gap style={{paddingLeft:"30px"}}>
<div className="ShortWidth">
<div className="Gap" style={{paddingLeft:"30px"}}>
<div className="panelmenu">
<FlexAJ className="font-18 color-ooo mb20" style={{lineHeight:"28px"}}>关于
<div className="font-18 color-ooo mb20 FlexAJ" style={{lineHeight:"28px"}}>关于
{
projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner" || projectDetail.permission==="Manager") &&
<i onClick={()=>setOpenModal(true)} className="iconfont icon-a-shezhi color-grey-9 font-15 pointer"></i>
}
</FlexAJ>
</div>
{desc && <p className="font-14 color-grey-3 mb15 task-hide-2" style={{lineHeight:"24px",WebkitLineClamp:"4",textAlign:"justify",wordBreak:"break-all"}} title={desc}>{desc}</p>}
{/* 项目标签 */}
{topics && <div className='projectHomeTopics'>
@ -675,14 +675,14 @@ function CoderDepot(props){
{mirror_status ===0 && <Contributors owner={owner} projectsId={projectsId} /> }
{/* 语言 */}
{ mirror_status ===0 && <LanguagePower owner={owner} projectsId={projectsId}/> }
</Gap>
</ShortWidth>
</div>
</div>
}
</Box>
</div>
}
</div>
</Spin>
</WhiteBack>
</div>
)
}

View File

@ -619,9 +619,9 @@ class Detail extends Component {
<div>
<div className="detailHeader-wrapper">
<div className="normal">
<AlignTop style={{ padding: "18px 0px 10px", justifyContent: "space-between" }}>
<div className="AlignTop" style={{ padding: "18px 0px 10px", justifyContent: "space-between" }}>
<div>
<AlignTop>
<div className="AlignTop">
<div className="projectallName">
{project && project.author &&
<Link to={`/${project.author.login}`}>{project.author.name}</Link>
@ -631,7 +631,7 @@ class Detail extends Component {
</div>
{projectDetail && projectDetail.private && <span className="privateTag mt6">私有</span>}
{!platform && <span className="privateTag red mt6">只读</span>}
</AlignTop>
</div>
<div className="mt8">
{
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
@ -699,7 +699,7 @@ class Detail extends Component {
</span>
}
</div>
</AlignTop>
</div>
{/* <div className="mt6" style={{minHeight:"20px"}}>
{
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?

View File

@ -16,9 +16,9 @@ function RecordList(props){
const [loading, setLoading] = useState(false);
const [data, setData] = useState({});
// table
const pageSize = 10;
const [current, setCurrent] = useState(1);
const [total, setTotal] = useState(0);
const [pageSize, setPageSize] = useState(10);
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
useEffect(()=>{
@ -74,13 +74,6 @@ function RecordList(props){
setExpandedRowKeys(Array.from(keys));
}
// pagesize
function onShowSizeChange(current, pageSize){
window.scrollTo(0, 0);
setCurrent(1);
setPageSize(pageSize);
}
//
function changePage(page, pageSize){
window.scrollTo(0, 0);
@ -107,8 +100,7 @@ function RecordList(props){
rowKey={'id'}
expandedRowKeys={expandedRowKeys}
onExpand={onExpand}
pagination={false}
// pagination={{current: current, pageSize: pageSize, total: total, showSizeChanger: true, onShowSizeChange:onShowSizeChange, showQuickJumper: true, onChange: changePage}}
pagination={{current: current, pageSize: pageSize, total: total, hideOnSinglePage: true, onChange: changePage}}
/>
</div>
}

View File

@ -130,7 +130,7 @@ function StoreList(props){
</span> },
{ title: 'GitLink分支', dataIndex: 'gitlink_branch_name', className:"recordColumns"},
{ title: '最后一次同步时间', dataIndex: 'sync_time', className:"primaryColor recordColumns"},
{ title: '同步状态', dataIndex: 'sync_status', className:"recordColumns", render: (text)=>sync_status(text)},
{ title: '最后一次同步状态', dataIndex: 'sync_status', className:"recordColumns", render: (text)=>sync_status(text)},
{ title: '操作', dataIndex: 'enable', align: 'center', className:"primaryColor recordColumns", render: (text, item)=>{
const branch = item[platform === 'GitHub' ? 'github_branch': 'gitee_branch']
return <div>
@ -143,7 +143,7 @@ function StoreList(props){
}else{
setBranchRnable(item);
}
}}>{text ? "停止" : "开始"}</a>
}}>{text ? "中止同步" : "启动同步"}</a>
</div>
}},
]

View File

@ -186,4 +186,57 @@ i.color-orange05:hover {
.color-light-green {
color: #29bd8b !important;
}
.AlignTop {
display:flex;
align-items: flex-start
}
.WhiteBack {
background-color:#fff;
border-radius:5px
}
.Box {
display:flex;
align-items:flex-start
}
.LongWidth {
flex:1;
width:0;
border-radius:5px;
margin-bottom:30px
}
.ShortWidth {
width:300px;
border-radius:5px;
margin-bottom:30px
}
.Gap {
padding-left:20px;
box-sizing:border-box;
}
.AlignCenter {
display:flex;
align-items: center
}
.FlexAJ {
display:flex;
align-items: center;
justify-content: space-between
}
.mt25 {
margin-top:25px
}
.User {
display:flex;
font-weight: bold;
align-items: center
}
.User img {
width:30px;
height:30px;
border-radius:50%
}
.User span {
margin-left:8px
}