mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-20 17:56:31 +00:00
Merge pull request #2219 from resin-io/fix-zero-zero
fix(gui): Fix zero-zero devices when verify is disabled
This commit is contained in:
commit
882d0ecba8
@ -126,12 +126,7 @@ exports.performWrite = (image, drives, onProgress) => {
|
|||||||
console.log(message)
|
console.log(message)
|
||||||
})
|
})
|
||||||
|
|
||||||
const flashResults = {
|
const flashResults = {}
|
||||||
devices: {
|
|
||||||
succeeded: 0,
|
|
||||||
failed: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ipc.server.on('fail', (error) => {
|
ipc.server.on('fail', (error) => {
|
||||||
console.log('Fail:', error)
|
console.log('Fail:', error)
|
||||||
@ -144,11 +139,7 @@ exports.performWrite = (image, drives, onProgress) => {
|
|||||||
_.merge(flashResults, event)
|
_.merge(flashResults, event)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipc.server.on('state', (progress) => {
|
ipc.server.on('state', onProgress)
|
||||||
flashResults.devices.succeeded = progress.succeeded
|
|
||||||
flashResults.devices.failed = progress.failed
|
|
||||||
onProgress(progress)
|
|
||||||
})
|
|
||||||
|
|
||||||
ipc.server.on('ready', (data, socket) => {
|
ipc.server.on('ready', (data, socket) => {
|
||||||
ipc.server.emit(socket, 'write', {
|
ipc.server.emit(socket, 'write', {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<div uib-tooltip="{{ finish.formattedErrors() }}" tooltip-placement="bottom" class="title-wrap">
|
<div uib-tooltip="{{ finish.formattedErrors() }}" tooltip-placement="bottom" class="title-wrap">
|
||||||
<h3 class="title">Flash Complete!</h3>
|
<h3 class="title">Flash Complete!</h3>
|
||||||
<div class="target-status-line target-status-{{ type }}"
|
<div class="target-status-line target-status-{{ type }}"
|
||||||
ng-repeat="(type, quantity) in finish.flash.getFlashResults().devices">
|
ng-repeat="(type, quantity) in finish.flash.getFlashResults().results.devices">
|
||||||
<span class="target-status-dot"></span>
|
<span class="target-status-dot"></span>
|
||||||
<span class="target-status-quantity">{{ quantity }}</span>
|
<span class="target-status-quantity">{{ quantity }}</span>
|
||||||
<span class="target-status-message">{{ finish.progressMessage[type](quantity) }}</span>
|
<span class="target-status-message">{{ finish.progressMessage[type](quantity) }}</span>
|
||||||
|
@ -350,6 +350,7 @@ class ImageWriter extends EventEmitter {
|
|||||||
|
|
||||||
// Generate preparation tasks for all destinations
|
// Generate preparation tasks for all destinations
|
||||||
const tasks = destinations.map((destination) => {
|
const tasks = destinations.map((destination) => {
|
||||||
|
destination.verified = !this.verifyChecksums
|
||||||
this.destinations.set(destination.device.device, destination)
|
this.destinations.set(destination.device.device, destination)
|
||||||
return (next) => {
|
return (next) => {
|
||||||
runSeries([
|
runSeries([
|
||||||
@ -632,17 +633,27 @@ class ImageWriter extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
_finish () {
|
_finish () {
|
||||||
this._cleanup(() => {
|
this._cleanup(() => {
|
||||||
|
const failures = []
|
||||||
|
let succeeded = 0
|
||||||
|
let failed = 0
|
||||||
|
|
||||||
this.finished = true
|
this.finished = true
|
||||||
|
|
||||||
|
this.destinations.forEach((dest) => {
|
||||||
|
succeeded += dest.finished && dest.verified && !dest.error ? 1 : 0
|
||||||
|
failed += dest.error ? 1 : 0
|
||||||
|
if (dest.error) {
|
||||||
|
dest.error.device = dest.device.device
|
||||||
|
failures.push(dest.error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
this.emit('finish', {
|
this.emit('finish', {
|
||||||
|
devices: { succeeded, failed },
|
||||||
bytesRead: this.bytesRead,
|
bytesRead: this.bytesRead,
|
||||||
bytesWritten: this.bytesWritten,
|
bytesWritten: this.bytesWritten,
|
||||||
checksum: this.checksum,
|
checksum: this.checksum,
|
||||||
errors: Array.from(this.destinations).filter(([ device, dest ]) => {
|
errors: failures
|
||||||
return dest.error
|
|
||||||
}).map(([ device, dest ]) => {
|
|
||||||
dest.error.device = device
|
|
||||||
return dest.error
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user