1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 11:51:27 +00:00

feat: wiki editor

This commit is contained in:
liuhongbo
2024-05-17 16:46:12 +08:00
parent 28304dbe23
commit 2e9da8487e
2 changed files with 12 additions and 6 deletions

View File

@@ -49,6 +49,7 @@ class Wiki extends Component {
can_edit_file: false,
seadoc_access_token: '',
docUuid: '',
assets_url: '',
};
window.onpopstate = this.onpopstate;
@@ -217,6 +218,7 @@ class Wiki extends Component {
this.removePythonWrapper();
wikiAPI.getWiki2FileContent(wikiId, filePath).then(res => {
let data = res.data;
this.setState({
isDataLoading: false,
content: data.content,
@@ -225,6 +227,7 @@ class Wiki extends Component {
latestContributor: data.latest_contributor,
can_edit_file: data.can_edit_file,
seadoc_access_token: data.seadoc_access_token,
assets_url: data.assets_url,
});
}).catch(error => {
let errorMsg = Utils.getErrorMsg(error);
@@ -603,7 +606,7 @@ class Wiki extends Component {
setCurrentPage={this.setCurrentPage}
currentPageId={this.state.currentPageId}
/>
{<MainPanel
<MainPanel
path={this.state.path}
pathExist={this.state.pathExist}
isViewFile={this.state.isViewFile}
@@ -618,7 +621,8 @@ class Wiki extends Component {
onMainNavBarClick={this.onMainNavBarClick}
can_edit_file={this.state.can_edit_file}
seadoc_access_token={this.state.seadoc_access_token}
/>}
assets_url={this.state.assets_url}
/>
<MediaQuery query="(max-width: 767.8px)">
<Modal isOpen={!this.state.closeSideBar} toggle={this.onCloseSide} contentClassName="d-none"></Modal>
</MediaQuery>