diff --git a/README.md b/README.md
index cd23272083..72996ff18c 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
[](https://travis-ci.org/kitematic/kitematic)
[](https://coveralls.io/r/kitematic/kitematic?branch=master)
[](https://www.bithound.io/github/kitematic/kitematic)
-[](https://gitter.im/kitematic/kitematic?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
+

@@ -27,9 +27,9 @@ Please read through our [Contributing Guidelines](https://github.com/kitematic/k
## Community
-- For questions on how to use Kitematic, see our [user forum](https://forums.docker.com/c/kitematic).
+- [](https://gitter.im/kitematic/kitematic?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
+- Ask questions on our [user forum](https://forums.docker.com/c/kitematic).
- **#kitematic** on IRC. [Join the channel](http://webchat.freenode.net/?channels=%23kitematic&uio=d4).
-- Join the Kitematic [Gitter Channel](https://gitter.im/kitematic/kitematic)
- Follow [@kitematic on Twitter](https://twitter.com/kitematic).
- Read and subscribe to [the Kitematic Blog](http://blog.kitematic.com).
diff --git a/src/ContainerHome.react.js b/src/ContainerHome.react.js
index 530e1b2668..a25fa678b5 100644
--- a/src/ContainerHome.react.js
+++ b/src/ContainerHome.react.js
@@ -112,7 +112,7 @@ var ContainerHome = React.createClass({
diff --git a/src/ContainerHomeLogs.react.js b/src/ContainerHomeLogs.react.js
index d400a48d72..4a471202ff 100644
--- a/src/ContainerHomeLogs.react.js
+++ b/src/ContainerHomeLogs.react.js
@@ -6,51 +6,50 @@ var metrics = require('./Metrics');
var _prevBottom = 0;
-var ContainerHomeLogs = React.createClass({
- mixins: [Router.State, Router.Navigation],
+module.exports = React.createClass({
+ mixins: [Router.Navigation],
getInitialState: function () {
return {
logs: []
};
},
- componentWillReceiveProps: function () {
- this.init();
- },
componentDidMount: function() {
- this.init();
- LogStore.on(LogStore.SERVER_LOGS_EVENT, this.updateLogs);
+ if (!this.props.container) {
+ return;
+ }
+ this.update();
+ this.scrollToBottom();
+ LogStore.on(LogStore.SERVER_LOGS_EVENT, this.update);
+ LogStore.fetch(this.props.container.Name);
},
componentWillUnmount: function() {
- LogStore.removeListener(LogStore.SERVER_LOGS_EVENT, this.updateLogs);
+ LogStore.detach(this.props.container.Name);
+ LogStore.removeListener(LogStore.SERVER_LOGS_EVENT, this.update);
},
componentDidUpdate: function () {
- // Scroll logs to bottom
+ this.scrollToBottom();
+ },
+ scrollToBottom: function () {
var parent = $('.logs');
if (parent.scrollTop() >= _prevBottom - 50) {
parent.scrollTop(parent[0].scrollHeight - parent.height());
}
_prevBottom = parent[0].scrollHeight - parent.height();
},
- init: function () {
- this.updateLogs();
- },
- updateLogs: function (name) {
- if (name && name !== this.getParams().name) {
- return;
- }
- this.setState({
- logs: LogStore.logs(this.getParams().name)
- });
- },
handleClickLogs: function () {
metrics.track('Viewed Logs', {
from: 'preview'
});
- this.transitionTo('containerLogs', {name: this.getParams().name});
+ this.transitionTo('containerLogs', {name: this.props.container.Name});
+ },
+ update: function () {
+ this.setState({
+ logs: LogStore.logs(this.props.container.Name)
+ });
},
render: function () {
var logs = this.state.logs.map(function (l, i) {
- return
;
+ return
;
});
if (logs.length === 0) {
logs = "No logs for this container.";
@@ -62,11 +61,8 @@ var ContainerHomeLogs = React.createClass({
{logs}
-
-
+