Merge remote-tracking branch 'upstream/gitlink_ssr_head' into gitlink_ssr_head

This commit is contained in:
黄心宇 2026-01-20 16:31:10 +08:00
commit 6ebc78d3e2
6 changed files with 109 additions and 57 deletions

View File

@ -41,34 +41,37 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
return(
<div className="commonBox readBox" id="readme">
<Anchor offsetTop={58}>
<div className="commonBox-title boxTitle">
<div className="AlignCenter">
<Dropdown overlay={menu()} trigger={['hover']} overlayClassName="menuslist">
<span className="catelogue">
<i className="iconfont icon-muluicon font-12 mr5"></i>
<span>目录</span>
</span>
</Dropdown>
<span className="commonBox-title-read"><a href="#readme ">{readme.name}</a></span>
<div className="commonBox-title boxTitle">
<div className="AlignCenter">
{/* <Dropdown overlay={menu()} trigger={['hover']} overlayClassName="menuslist">
<span className="catelogue">
<i className="iconfont icon-muluicon font-12 mr5"></i>
<span>目录</span>
</span>
</Dropdown> */}
<span className="commonBox-title-read"><a href="#readme ">{readme.name}</a></span>
</div>
{
operate ?
<a className="ml20 pull-right" onClick={() =>ChangeFile(readme && readme.path, false)}>
<i className="iconfont icon-a-bianji font-17 color-grey-6"></i>
</a>
:""
}
</div>
<div className='mdFileBox'>
<Anchor offsetTop={55}>
{menu()}
</Anchor>
{
content &&
<div className="commonBox-info">
<RenderHtml className="break_word_comments imageLayerParent" value={content} url={history.location}/>
</div>
{
operate ?
<a className="ml20 pull-right" onClick={() =>ChangeFile(readme && readme.path, false)}>
<i className="iconfont icon-a-bianji font-17 color-grey-6"></i>
</a>
:""
}
</div>
</Anchor>
{
content &&
<div className="commonBox-info">
<RenderHtml className="break_word_comments imageLayerParent readmeFile" value={content} url={history.location}/>
</div>
}
}
</div>
</div>
)
}

View File

@ -1,4 +1,4 @@
import React, { Component } from "react";
import React, { Component, Fragment } from "react";
import { Popconfirm , Select , Dropdown , Spin , Anchor } from "antd";
import "./list.scss";
import axios from "axios";
@ -227,8 +227,6 @@ class CoderRootFileDetail extends Component {
return(
<ReadmeCatelogue menuList={menuList} hash={this.props.history.location.hash}/>
)
}else{
return <Spin />
}
}
@ -303,7 +301,7 @@ class CoderRootFileDetail extends Component {
/>
<Anchor className="griditemAnchor" offsetTop={58}>
<div className="griditemCate">
{
{/* {
md && readOnly &&
<Dropdown overlay={this.menu()} trigger={['hover']} overlayClassName="menuslist">
<span className="catelogue mr20">
@ -311,7 +309,7 @@ class CoderRootFileDetail extends Component {
<span>目录</span>
</span>
</Dropdown>
}
} */}
<span className="color-grey-6 font-16">
{bytesToSize(detail && detail.size)}
</span>
@ -324,7 +322,8 @@ class CoderRootFileDetail extends Component {
{
!detail.direct_download?
<span>
<a onClick={() => this.DownLoadFile(detail.download_url)} className="ml20">
{/* onClick={() => this.DownLoadFile(detail.download_url)} */}
<a href={`/attachments/entries/get_file?download_url=${detail.download_url}`}className="ml20">
<i className="iconfont icon-xiazai1 font-15 color-grey-6"></i>
</a>
{
@ -383,14 +382,14 @@ class CoderRootFileDetail extends Component {
)}
</p>
</Anchor>
<div>
<div className="pl8">
{detail.image_type ? (
<div className="edu-txt-center pt20 pb20">
<img alt="" src={detail.download_url} style={{ maxWidth: "80%" }} />
</div>
) : detail.direct_download ? (
<div className="pt10 text-center pb10">
<a onClick={() => this.DownLoadFile(detail.download_url)} className="color-blue font-15">
<a href={`/attachments/entries/get_file?download_url=${detail.download_url}`} className="color-blue font-15">
下载原始文件
</a>
{
@ -400,24 +399,36 @@ class CoderRootFileDetail extends Component {
}
</div>
) : (
md && readOnly ?
<div className="files-md" id="files-md">
<RenderHtml className="file-md imageLayerParent" value={description} url={this.props.history.location}/>
md && readOnly ? <Fragment>
<div key="readOnly" className="mdFileBox">
<Anchor offsetTop={105}>
{this.menu()}
</Anchor>
<div className="files-md" id="files-md">
<RenderHtml className="file-md imageLayerParent mdFile" value={description} url={this.props.history.location} />
</div>
</div>
</Fragment>
:
<Meditor
{...this.props}
{...this.state}
language={language ? language : "javascript"}
filepath={`/${detail.path}`}
content={detail.content}
readOnly={readOnly}
md={md}
editorType="update"
currentBranch={currentBranch}
descName={detail && `Update ${detail.name}`}
></Meditor>
)}
<Fragment>
<div className="files-md" id="files-md" style={{ display: 'none' }}>
<RenderHtml className="file-md imageLayerParent" value={description} url={this.props.history.location} />
</div>
<Meditor
key="editor"
{...this.props}
{...this.state}
language={language ? language : "javascript"}
filepath={`/${detail.path}`}
content={detail.content}
readOnly={readOnly}
md={md}
editorType="update"
currentBranch={currentBranch}
descName={detail && `Update ${detail.name}`}
></Meditor>
</Fragment>
)}
</div>
</React.Fragment>
);

View File

@ -339,6 +339,16 @@
.listtablebody{
border-radius:0px 0px 4px 4px ;
border: 1px solid #D0D0D0;
.ant-affix{
z-index: 8;
}
.readmeMenu{
width: 300px;
padding: 20px 10px;
.ant-anchor-link{
padding: 8px 10px 8px 0px;
}
}
li{
a{
color: #05101a;
@ -577,4 +587,14 @@
img{
margin-bottom: 35px;
}
}
.mdFileBox{
display: flex;
&>div>div, & .ant-anchor-wrapper, & .ant-anchor, & .readmeMenu{
height: 100%;
}
.mdFile{
padding: 20px;
border-left: 1px solid #D0D0D0;
}
}

View File

@ -324,6 +324,8 @@
}
.files-md{
padding:20px;
flex: 1;
width: 0;
h1,h2, h3, h4, h5, h6{
margin-bottom: .5em !important;
}
@ -618,11 +620,26 @@
}
.readBox{
border:none;
.ant-affix{
z-index: 8;
}
.readmeMenu{
width: 240px;
padding: 20px 10px;
border:1px solid #D0D0D0;
border-top: none;
border-right: none;
.ant-anchor-link{
padding: 8px 10px 8px 0px;
}
}
&.commonBox .commonBox-info{
border:1px solid #D0D0D0;
border-top: none;
border-radius: 0px 0px 4px 4px;
padding:20px 38px;
border-radius: 0px 0px 4px 0px;
padding:20px 18px;
flex: 1;
width: 0;
}
}
.commonBox .commonBox-title.boxTitle{

View File

@ -24,8 +24,8 @@ function ReadmeCatelogue({ menuList , hash }) {
}
}
return(
<div>
<div className="searchBox">
<div className='readmeMenu'>
<div className="searchBox mb15">
<Input
placeholder={"请输入关键字"}
value={value}
@ -39,7 +39,7 @@ function ReadmeCatelogue({ menuList , hash }) {
{
menu.map((item,key)=>{
return(
<div style={{paddingLeft:`${item.level *15}px`}} className={goHref===item.href?"items active":"items"}>
<div style={{paddingLeft:`${(item.level-1) *15}px`}} className={goHref===item.href?"items active":"items"}>
<Link href={`${item.href}`} title={item.text} />
</div>
)

View File

@ -54,10 +54,11 @@ export default (props) => {
useEffect(() => {
document.title = `${checkItem && checkItem.titleStr || wikiBySearch}-维基预览`
if(!(str || checkItem.title_sub)) return
const func = sha ? getPreviousWiki : getWiki
func({
...wikiParams,
pageName: str,
pageName: str || checkItem.title_sub,
sha
}).then(res => {
if(res && res.code === 200){