mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +00:00
feat(GUI): hide unsafe mode option with env var (#2347)
We hide the unsafe mode option toggle with an env var `ETCHER_HIDE_UNSAFE_MODE` that also enables unsafe mode. Closes: https://github.com/resin-io/etcher/issues/2243 Change-Type: patch Changelog-Entry: Hide unsafe mode option toggle with an env var.
This commit is contained in:
parent
e472fe0276
commit
34ce00e2d5
@ -23,7 +23,7 @@ const permissions = require('../../../shared/permissions')
|
|||||||
const scanner = SDK.createScanner({
|
const scanner = SDK.createScanner({
|
||||||
blockdevice: {
|
blockdevice: {
|
||||||
get includeSystemDrives () {
|
get includeSystemDrives () {
|
||||||
return settings.get('unsafeMode')
|
return settings.get('unsafeMode') && !process.env.ETCHER_HIDE_UNSAFE_MODE
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
usbboot: {}
|
usbboot: {}
|
||||||
|
@ -109,7 +109,7 @@ module.exports = function (DriveSelectorService) {
|
|||||||
|
|
||||||
analytics.logEvent('Select drive', {
|
analytics.logEvent('Select drive', {
|
||||||
device: drive.device,
|
device: drive.device,
|
||||||
unsafeMode: settings.get('unsafeMode')
|
unsafeMode: settings.get('unsafeMode') && !process.env.ETCHER_HIDE_UNSAFE_MODE
|
||||||
})
|
})
|
||||||
}).catch(exceptionReporter.report)
|
}).catch(exceptionReporter.report)
|
||||||
}
|
}
|
||||||
|
@ -104,4 +104,18 @@ module.exports = function (WarningModalService) {
|
|||||||
}
|
}
|
||||||
}).catch(exceptionReporter.report)
|
}).catch(exceptionReporter.report)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Show unsafe mode based on an env var
|
||||||
|
* @function
|
||||||
|
* @public
|
||||||
|
*
|
||||||
|
* @returns {Boolean}
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* SettingsController.shouldShowUnsafeMode()
|
||||||
|
*/
|
||||||
|
this.shouldShowUnsafeMode = () => {
|
||||||
|
return !process.env.ETCHER_HIDE_UNSAFE_MODE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox">
|
<div class="checkbox" ng-if="settings.shouldShowUnsafeMode()">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
tabindex="10"
|
tabindex="10"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user