|
|
|
@ -37,6 +37,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
setContentWidth100 = (flag) => {
|
|
|
|
|
const newFileContent = flag === false ? '' : this.state.fileContent
|
|
|
|
|
this.setState({
|
|
|
|
|
// isCodeFile
|
|
|
|
|
isContentWidth100: flag,
|
|
|
|
|
fileContent: newFileContent
|
|
|
|
|
})
|
|
|
|
@ -145,12 +146,18 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
// this.props.setLoadingContent(false)
|
|
|
|
|
|
|
|
|
|
const trees = response.data.trees
|
|
|
|
|
const treeIsFileMap = {}
|
|
|
|
|
if (!trees || !Array.isArray(trees)) {
|
|
|
|
|
// this.props.showSnackbar('无法找到对应的资源,请变更地址或联系管理员!')
|
|
|
|
|
// return;
|
|
|
|
|
} else {
|
|
|
|
|
trees.forEach(item => {
|
|
|
|
|
treeIsFileMap[item.name] = item.type == 'blob'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if(response.status === 200){
|
|
|
|
|
this.setState({
|
|
|
|
|
treeIsFileMap,
|
|
|
|
|
...response.data,
|
|
|
|
|
repositoryLoading: false
|
|
|
|
|
});
|
|
|
|
|