Display ETA during flash and check (#460)

* Show speed during check

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Display ETA during flash and check

Fixes: https://github.com/resin-io/etcher/issues/256
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-06-08 13:35:44 -04:00
parent ef82c2f09b
commit 8de4be1897
6 changed files with 26 additions and 4 deletions

View File

@ -6540,6 +6540,13 @@ body {
color: #85898c;
font-size: 10px; }
.step-footer-split {
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: space-between;
max-width: 170px; }
.step-footer-underline {
border-bottom: 1px dotted;
padding-bottom: 2px; }

View File

@ -26,6 +26,7 @@ const _ = require('lodash');
const app = angular.module('Etcher', [
require('angular-ui-router'),
require('angular-ui-bootstrap'),
require('angular-moment'),
// Etcher modules
require('./modules/drive-scanner'),
@ -136,7 +137,7 @@ app.controller('AppController', function(
}
NotifierService.subscribe($scope, 'image-writer:state', function(state) {
AnalyticsService.log(`Progress (${state.type}): ${state.progress}% at ${state.speed} MB/s`);
AnalyticsService.log(`Progress (${state.type}): ${state.progress}% at ${state.speed} MB/s (eta ${state.eta}s)`);
OSWindowProgressService.set(state.progress);
});

View File

@ -229,6 +229,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
self.state = {
type: state.type,
progress: state.percentage,
eta: state.eta,
// Transform bytes to megabytes preserving only two decimal places
speed: Math.floor(state.speed / 1e+6 * 100) / 100 || 0

View File

@ -104,9 +104,13 @@
<span class="glyphicon glyphicon-repeat"></span> Retry
</button>
<p class="step-footer"
ng-bind="app.writer.state.speed.toFixed(2) + ' MB/s'"
ng-show="app.writer.state.speed && app.writer.state.progress != 100 && app.writer.state.type == 'write'"></p>
<p class="step-footer step-footer-split" ng-show="app.writer.state.speed && app.writer.state.progress != 100">
<!-- Convert our eta (in seconds) to milliseconds, which is what `moment` understands -->
<span>ETA: {{ app.writer.state.eta * 1000 | amDateFormat:'m[m]ss[s]' }}</span>
<span ng-bind="app.writer.state.speed.toFixed(2) + ' MB/s'"></span>
</p>
</div>
</div>
</div>

View File

@ -164,6 +164,14 @@ body {
font-size: 10px;
}
.step-footer-split {
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: space-between;
max-width: $btn-min-width;
}
.step-footer-underline {
border-bottom: 1px dotted;
padding-bottom: 2px;

View File

@ -50,6 +50,7 @@
},
"dependencies": {
"angular": "^1.5.3",
"angular-moment": "^1.0.0-beta.6",
"angular-q-promisify": "^1.1.0",
"angular-ui-bootstrap": "^1.3.2",
"angular-ui-router": "^0.2.18",