mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-27 13:16:36 +00:00
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:
parent
ef82c2f09b
commit
8de4be1897
@ -6540,6 +6540,13 @@ body {
|
|||||||
color: #85898c;
|
color: #85898c;
|
||||||
font-size: 10px; }
|
font-size: 10px; }
|
||||||
|
|
||||||
|
.step-footer-split {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
max-width: 170px; }
|
||||||
|
|
||||||
.step-footer-underline {
|
.step-footer-underline {
|
||||||
border-bottom: 1px dotted;
|
border-bottom: 1px dotted;
|
||||||
padding-bottom: 2px; }
|
padding-bottom: 2px; }
|
||||||
|
@ -26,6 +26,7 @@ const _ = require('lodash');
|
|||||||
const app = angular.module('Etcher', [
|
const app = angular.module('Etcher', [
|
||||||
require('angular-ui-router'),
|
require('angular-ui-router'),
|
||||||
require('angular-ui-bootstrap'),
|
require('angular-ui-bootstrap'),
|
||||||
|
require('angular-moment'),
|
||||||
|
|
||||||
// Etcher modules
|
// Etcher modules
|
||||||
require('./modules/drive-scanner'),
|
require('./modules/drive-scanner'),
|
||||||
@ -136,7 +137,7 @@ app.controller('AppController', function(
|
|||||||
}
|
}
|
||||||
|
|
||||||
NotifierService.subscribe($scope, 'image-writer:state', function(state) {
|
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);
|
OSWindowProgressService.set(state.progress);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -229,6 +229,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
|
|||||||
self.state = {
|
self.state = {
|
||||||
type: state.type,
|
type: state.type,
|
||||||
progress: state.percentage,
|
progress: state.percentage,
|
||||||
|
eta: state.eta,
|
||||||
|
|
||||||
// Transform bytes to megabytes preserving only two decimal places
|
// Transform bytes to megabytes preserving only two decimal places
|
||||||
speed: Math.floor(state.speed / 1e+6 * 100) / 100 || 0
|
speed: Math.floor(state.speed / 1e+6 * 100) / 100 || 0
|
||||||
|
@ -104,9 +104,13 @@
|
|||||||
<span class="glyphicon glyphicon-repeat"></span> Retry
|
<span class="glyphicon glyphicon-repeat"></span> Retry
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<p class="step-footer"
|
<p class="step-footer step-footer-split" ng-show="app.writer.state.speed && app.writer.state.progress != 100">
|
||||||
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>
|
<!-- 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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -164,6 +164,14 @@ body {
|
|||||||
font-size: 10px;
|
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 {
|
.step-footer-underline {
|
||||||
border-bottom: 1px dotted;
|
border-bottom: 1px dotted;
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular": "^1.5.3",
|
"angular": "^1.5.3",
|
||||||
|
"angular-moment": "^1.0.0-beta.6",
|
||||||
"angular-q-promisify": "^1.1.0",
|
"angular-q-promisify": "^1.1.0",
|
||||||
"angular-ui-bootstrap": "^1.3.2",
|
"angular-ui-bootstrap": "^1.3.2",
|
||||||
"angular-ui-router": "^0.2.18",
|
"angular-ui-router": "^0.2.18",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user