diff --git a/src/ContainerList.react.js b/src/ContainerList.react.js index 082bef2699..1d6d25a034 100644 --- a/src/ContainerList.react.js +++ b/src/ContainerList.react.js @@ -13,9 +13,15 @@ var ContainerList = React.createClass({ ); }); + var newItem; + if (!this.props.downloading) { + newItem = ; + } else { + newItem = ''; + } return ( ); diff --git a/src/ContainerStore.js b/src/ContainerStore.js index 2b77facb10..d18071b7ce 100644 --- a/src/ContainerStore.js +++ b/src/ContainerStore.js @@ -463,6 +463,9 @@ var ContainerStore = assign(Object.create(EventEmitter.prototype), { }, error: function () { return _error; + }, + downloading: function () { + return !!_.keys(_placeholders).length; } }); diff --git a/src/Containers.react.js b/src/Containers.react.js index a3f935f4c8..a9fcc266a5 100644 --- a/src/Containers.react.js +++ b/src/Containers.react.js @@ -10,6 +10,8 @@ var metrics = require('./Metrics'); var autoUpdater = remote.require('auto-updater'); var RetinaImage = require('react-retina-image'); var machine = require('./DockerMachine'); +var OverlayTrigger = require('react-bootstrap').OverlayTrigger; +var Tooltip = require('react-bootstrap').Tooltip; var util = require('./Util'); var Containers = React.createClass({ @@ -21,7 +23,8 @@ var Containers = React.createClass({ sorted: ContainerStore.sorted(), updateAvailable: false, currentButtonLabel: '', - error: ContainerStore.error() + error: ContainerStore.error(), + downloading: ContainerStore.downloading() }; }, componentDidMount: function () { @@ -62,7 +65,8 @@ var Containers = React.createClass({ update: function (name, status) { this.setState({ containers: ContainerStore.containers(), - sorted: ContainerStore.sorted() + sorted: ContainerStore.sorted(), + downloading: ContainerStore.downloading() }); if (status === 'destroy') { this.onDestroy(); @@ -71,7 +75,8 @@ var Containers = React.createClass({ updateFromClient: function (name, status) { this.setState({ containers: ContainerStore.containers(), - sorted: ContainerStore.sorted() + sorted: ContainerStore.sorted(), + downloading: ContainerStore.downloading() }); if (status === 'create') { this.transitionTo('containerHome', {name: name}); @@ -158,6 +163,19 @@ var Containers = React.createClass({ New Update ); } + + var button; + console.log(this.state.downloading); + if (this.state.downloading) { + button = ( + Only one container can be downloaded at a time.}> + + + ); + } else { + button = ; + } + var container = this.getParams().name ? this.state.containers[this.getParams().name] : {}; return (
@@ -167,11 +185,11 @@ var Containers = React.createClass({

Containers

- + {button}
- +
{this.state.currentButtonLabel}