зеркало из https://github.com/docker/kitematic.git
Added react lint support and fixed possible NaN
Signed-off-by: FrenchBen <me@frenchben.com>
This commit is contained in:
Родитель
9d830fc5ac
Коммит
98bb98934e
|
@ -1,5 +1,8 @@
|
|||
root: true
|
||||
|
||||
plugins:
|
||||
- react
|
||||
|
||||
ecmaFeatures:
|
||||
modules: true
|
||||
jsx: true
|
||||
|
|
|
@ -65,7 +65,8 @@
|
|||
"babel": "^5.1.10",
|
||||
"babel-jest": "^5.2.0",
|
||||
"electron-prebuilt": "^0.27.3",
|
||||
"eslint": "^1.0.0",
|
||||
"eslint": "^1.3.1",
|
||||
"eslint-plugin-react": "^3.3.0",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-babel": "^5.0.1",
|
||||
"grunt-chmod": "^1.0.3",
|
||||
|
|
|
@ -9,7 +9,7 @@ import metrics from './utils/MetricsUtil';
|
|||
import template from './menutemplate';
|
||||
import webUtil from './utils/WebUtil';
|
||||
import hubUtil from './utils/HubUtil';
|
||||
var urlUtil = require ('./utils/URLUtil');
|
||||
var urlUtil = require('./utils/URLUtil');
|
||||
var app = remote.require('app');
|
||||
import request from 'request';
|
||||
import docker from './utils/DockerUtil';
|
||||
|
|
|
@ -13,12 +13,12 @@ var ContainerHome = React.createClass({
|
|||
router: React.PropTypes.func
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
componentDidMount: function () {
|
||||
this.handleResize();
|
||||
window.addEventListener('resize', this.handleResize);
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
componentWillUnmount: function () {
|
||||
window.removeEventListener('resize', this.handleResize);
|
||||
},
|
||||
|
||||
|
@ -46,7 +46,7 @@ var ContainerHome = React.createClass({
|
|||
|
||||
render: function () {
|
||||
if (!this.props.container) {
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
|
||||
let body;
|
||||
|
@ -70,11 +70,14 @@ var ContainerHome = React.createClass({
|
|||
}
|
||||
|
||||
sum = sum / this.props.container.Progress.amount;
|
||||
if (isNaN(sum)) {
|
||||
sum = 0;
|
||||
}
|
||||
|
||||
body = (
|
||||
<div className="details-progress">
|
||||
<h2>Downloading Image</h2>
|
||||
<h2>{(Math.round(sum*100)/100).toFixed(2)}%</h2>
|
||||
<h2>{ (Math.round(sum * 100) / 100).toFixed(2) }%</h2>
|
||||
<div className="container-progress-wrapper">
|
||||
<ContainerProgress pBar1={values[0]} pBar2={values[1]} pBar3={values[2]} pBar4={values[3]}/>
|
||||
</div>
|
||||
|
|
Загрузка…
Ссылка в новой задаче