var _ = require('underscore'); var $ = require('jquery'); var React = require('react/addons'); var Router = require('react-router'); var remote = require('remote'); var dialog = remote.require('dialog'); var ContainerStore = require('./ContainerStore'); var ContainerListItem = React.createClass({ handleItemMouseEnter: function () { var $action = $(this.getDOMNode()).find('.action'); $action.show(); }, handleItemMouseLeave: function () { var $action = $(this.getDOMNode()).find('.action'); $action.hide(); }, handleDeleteContainer: function () { dialog.showMessageBox({ message: 'Are you sure you want to delete this container?', buttons: ['Delete', 'Cancel'] }, function (index) { if (index === 0) { ContainerStore.remove(this.props.container.Name, function (err) { console.error(err); }); } }.bind(this)); }, render: function () { var self = this; var container = this.props.container; var downloadingImage = null, downloading = false; var env = container.Config.Env; if (env.length) { var obj = _.object(env.map(function (e) { return e.split('='); })); if (obj.KITEMATIC_DOWNLOADING) { downloading = true; } downloadingImage = obj.KITEMATIC_DOWNLOADING_IMAGE || null; } var imageName = downloadingImage || container.Config.Image; // Synchronize all animations var style = { WebkitAnimationDelay: (self.props.start - Date.now()) + 'ms' }; var state; if (downloading) { state =