Testing restarter

This commit is contained in:
James Barnsley
2018-04-16 09:01:42 +12:00
parent 68c89d0070
commit 55ade30130
8 changed files with 94 additions and 57 deletions

View File

@ -15,9 +15,11 @@ class VersionManager extends React.Component{
}
renderUpgradeButton(){
return <button className="productive" onClick={() => this.props.pusherActions.startUpgrade()}>Upgrade to { this.props.pusher.version.latest }</button>
if (this.props.pusher.upgrading){
return (
<button className="outline" disabled>
<button className="productive working" disabled>
<FontAwesome name="circle-o-notch" spin />
&nbsp;
Upgrading
@ -25,22 +27,18 @@ class VersionManager extends React.Component{
);
}
if (!this.props.pusher.version.is_root){
return <button className="outline" disabled>Not running as root</button>
}
if (this.props.pusher.version.upgrade_available){
return <button className="primary" onClick={() => this.props.pusherActions.startUpgrade()}>Upgrade to { this.props.pusher.version.latest }</button>
return <button className="productive" onClick={() => this.props.pusherActions.startUpgrade()}>Upgrade to { this.props.pusher.version.latest }</button>
}
return <button className="outline" disabled>No updates available</button>
return <button className="secondary" disabled>Already up-to-date</button>
}
render(){
return (
<span className="version-manager">
{ this.renderUpgradeButton() }
<span className="description">{ this.props.pusher.version.current } installed</span>
<span>{ this.props.pusher.version.current } installed</span>
{this.renderUpgradeButton()}
</span>
);
}