mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +00:00
feat(GUI): link to drivers when clicking a driverless usbboot device
Step 2 until we support installing the drivers from within Etcher. This also introduces an "Open drive link" Mixpanel event. See: https://www.raspberrypi.org/documentation/hardware/computemodule/cm-emmc-flashing.md See: https://github.com/resin-io/etcher/pull/1892 Change-Type: patch Changelog-Entry: Download usbboot drivers installer when clicking a driverless usbboot device on Windows. Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit is contained in:
parent
d7211b130b
commit
4c40c8ff30
@ -18,6 +18,7 @@
|
||||
|
||||
const angular = require('angular')
|
||||
const _ = require('lodash')
|
||||
const Bluebird = require('bluebird')
|
||||
const constraints = require('../../../../../shared/drive-constraints')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
const availableDrives = require('../../../../../shared/models/available-drives')
|
||||
@ -26,7 +27,9 @@ const utils = require('../../../../../shared/utils')
|
||||
|
||||
module.exports = function (
|
||||
$q,
|
||||
$uibModalInstance
|
||||
$uibModalInstance,
|
||||
WarningModalService,
|
||||
OSOpenExternalService
|
||||
) {
|
||||
/**
|
||||
* @summary The drive selector state
|
||||
@ -97,7 +100,23 @@ module.exports = function (
|
||||
})
|
||||
|
||||
selectionState.toggleDrive(drive.device)
|
||||
} else if (drive.link) {
|
||||
analytics.logEvent('Open drive link modal', {
|
||||
url: drive.link
|
||||
})
|
||||
|
||||
const message = drive.message || `Etcher will open ${drive.link} in your browser`
|
||||
return WarningModalService.display({
|
||||
confirmationLabel: 'Yes, continue',
|
||||
description: `${message}. Are you sure you want to continue?`
|
||||
}).then((answer) => {
|
||||
if (answer) {
|
||||
OSOpenExternalService.open(drive.link)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return Bluebird.resolve()
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,9 @@ const angular = require('angular')
|
||||
const MODULE_NAME = 'Etcher.Components.DriveSelector'
|
||||
const DriveSelector = angular.module(MODULE_NAME, [
|
||||
require('../modal/modal'),
|
||||
require('../../utils/byte-size/byte-size')
|
||||
require('../warning-modal/warning-modal'),
|
||||
require('../../utils/byte-size/byte-size'),
|
||||
require('../../os/open-external/open-external')
|
||||
])
|
||||
|
||||
DriveSelector.controller('DriveSelectorController', require('./controllers/drive-selector'))
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="modal-body">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item" ng-repeat="drive in modal.getDrives() track by drive.device"
|
||||
ng-disabled="!modal.constraints.isDriveValid(drive, modal.state.getImage())"
|
||||
ng-disabled="!modal.constraints.isDriveValid(drive, modal.state.getImage()) && !drive.link"
|
||||
ng-dblclick="modal.selectDriveAndClose(drive)"
|
||||
ng-click="modal.toggleDrive(drive)">
|
||||
<img class="list-group-item-section" alt="Drive device type logo"
|
||||
|
@ -273,6 +273,8 @@ class USBBootAdapter extends EventEmitter {
|
||||
disabled: true,
|
||||
icon: 'warning',
|
||||
size: null,
|
||||
link: 'https://github.com/raspberrypi/usbboot/raw/master/win32/rpiboot_setup.exe',
|
||||
message: 'Etcher will now download the necessary drivers from the Raspberry Pi Foundation',
|
||||
adaptor: USBBootAdapter.id
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user