|
|
|
@ -27,7 +27,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.state = {
|
|
|
|
|
listItemtype:false,
|
|
|
|
|
listItemtypes:false,
|
|
|
|
|
repositoryLoading: true,
|
|
|
|
|
pathArray: pathArray,
|
|
|
|
|
isContentWidth100: this._isFileInPathArray(pathArray)
|
|
|
|
@ -37,9 +37,11 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
|
if (this.props.secret_repository_tab != prevProps.secret_repository_tab) {
|
|
|
|
|
this.setState({
|
|
|
|
|
listItemtype:false,
|
|
|
|
|
listItemtypes:false,
|
|
|
|
|
})
|
|
|
|
|
this.fetchRepo()
|
|
|
|
|
console.log(this.props)
|
|
|
|
|
console.log(this.state)
|
|
|
|
|
this.fetchRepo(0)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -180,7 +182,11 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
this.props.setpathArray(newPathArray)
|
|
|
|
|
let urlNewPathArray = newPathArray;
|
|
|
|
|
let fileInPathArray = false;
|
|
|
|
|
if (newPathArray.length&&!type) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (newPathArray.length&&!type&&typeof listItem != 'number') {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileInPathArray = this.nameTypeMap[newPathArray[newPathArray.length - 1]] ? this.nameTypeMap[newPathArray[newPathArray.length - 1]] !== 'tree'
|
|
|
|
|
: (listItem ? listItem.type !== 'tree' : this._isFileName( newPathArray[newPathArray.length - 1] ))
|
|
|
|
|
|
|
|
|
@ -224,6 +230,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化时,repo接口完毕后需要看是否需要fetchCode
|
|
|
|
|
|
|
|
|
|
if (fileInPathArray&&!type) {
|
|
|
|
|
//
|
|
|
|
|
this.fetchCode(newPathArray)
|
|
|
|
|