FileExplorerPage.jsx
Home
/
FileServer /
Web /
Scripts /
React /
Pages /
FileExplorerPage.jsx
class FileExplorerPage extends React.Component {
constructor(props) {
super(props);
console.log('FileExplorerPage start');
//this.state = { counter: 0 };
this.OnAuthChange = this.OnAuthChange.bind(this);
this.OnItemsChange = this.OnItemsChange.bind(this);
this.SetID = this.SetID.bind(this);
this.GetID = this.GetID.bind(this);
//Получить ID из url
var Url_ID = new URL(window.location.href).
searchParams.get("ID");
if (Url_ID != null)
this.SetID(Url_ID);
//if (this.props.match != undefined
// && this.props.match.params != undefined
// && this.props.match.params.ID != undefined)
// this.SetID(this.props.match.params.ID);
//Получить id от родительского компонента
else
this.SetID(-1);
}
OnAuthChange() {
this.OnItemsChange();
this.refs.MenuControl.OnAuthChange();
}
OnItemsChange() {
this.refs.FileExplorerControl.
LoadDirectory();
}
SetID(val) {
this.CurrentID = val;
console.log(this.CurrentID);
}
GetID() {
return this.CurrentID;
}
render() {
return (
<div>
<hr />
<MenuControl ref="MenuControl"
ParentComponent={this}
/>
<hr />
<UserControl ref="UserControl"
ParentComponent={this}
/>
<hr />
<FileExplorerControl ref="FileExplorerControl"
ParentComponent={this}
ShoSelect={true}
/>
<hr />
{this.GetID() != -1
?
<div>
<ExplorerActionsControl ref="ExplorerActionsControl"
ParentComponent={this}
/>
<hr />
<UploaderControl ref="UploaderControl"
ParentComponent={this}
/>
<hr />
</div>
: ""
}
<BootstrapControl
/>
<hr />
</div>
);
}
}