1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

Add wiki history page (#7061)

* add wiki history page

* update button color

* update wiki history page

* code optimize

* code optimize

* update style

* optimize code

* remove wiki-history-page

---------

Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com>
This commit is contained in:
yinjianfei-user
2024-11-25 16:24:30 +08:00
committed by GitHub
parent 4da1b47664
commit 78b829834b
6 changed files with 108 additions and 3 deletions

View File

@@ -57,6 +57,16 @@ class MainPanel extends Component {
return { ...props, docUuid: window.seafile.docUuid, currentPageConfig };
}
handleClickHistory = () => {
const { wikiId, permission } = window.wiki.config;
if (permission !== 'rw') return;
const { siteRoot } = window.app.config;
const { currentPageConfig } = this.state;
const historyUrl = `${siteRoot}wiki/file_revisions/${wikiId}/?page_id=${currentPageConfig.id}`;
window.location.href = historyUrl;
};
render() {
const { permission, pathExist, isDataLoading, config, onUpdatePage, isUpdateBySide } = this.props;
const { currentPageConfig = {} } = this.state;
@@ -83,7 +93,14 @@ class MainPanel extends Component {
<DocInfo initContext={true}/>
</div>
</div>
{username && wikiPermission !== 'public' && <Account />}
{username && wikiPermission !== 'public' && (
<div className='d-flex align-items-center'>
<div className='wiki2-file-history-button' onClick={this.handleClickHistory}>
<i className='sf3-font sf3-font-history'/>
</div>
<Account />
</div>
)}
</div>
<div className="main-panel-center">
<div className={`cur-view-content ${isViewingFile ? 'o-hidden' : ''}`}>

View File

@@ -39,6 +39,22 @@ body {
font-size: 14px;
}
.wiki2-main-panel .wiki2-main-panel-north .wiki2-file-history-button {
width: 24px;
height: 24px;
margin-right: 16px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
border-radius: 3px;
color: #666666;
}
.wiki2-main-panel .wiki2-main-panel-north .wiki2-file-history-button:hover {
background-color: #EFEFEF;
}
.main-panel-center .cur-view-content {
padding: 0;
}