import React from 'react/addons'; import metrics from '../utils/MetricsUtil'; import ContainerUtil from '../utils/ContainerUtil'; import containerActions from '../actions/ContainerActions'; var ContainerSettingsAdvanced = React.createClass({ mixins: [React.addons.LinkedStateMixin], contextTypes: { router: React.PropTypes.func }, getInitialState: function () { let [tty, openStdin] = ContainerUtil.mode(this.props.container) || [true, true]; return { tty: tty, openStdin: openStdin }; }, handleSaveAdvancedOptions: function () { metrics.track('Saved Advanced Options'); let tty = this.state.tty; let openStdin = this.state.openStdin; containerActions.update(this.props.container.Name, {Tty: tty, OpenStdin: openStdin}); }, handleChangeTty: function () { this.setState({ tty: !this.state.tty }); }, handleChangeOpenStdin: function () { this.setState({ openStdin: !this.state.openStdin }); }, render: function () { if (!this.props.container) { return false; } return (