mirror of
https://github.com/balena-io/etcher.git
synced 2025-11-09 10:28:32 +00:00
patch: switch api; use ws; integrate sudo-prompt
- switch api roles flow - use websocket instead of node-ipc - integrate; modernize; simplify and deprecate sudo-prompt
This commit is contained in:
21
lib/shared/sudo/sudo-askpass.osascript-zh.js
Executable file
21
lib/shared/sudo/sudo-askpass.osascript-zh.js
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env osascript -l JavaScript
|
||||
|
||||
ObjC.import('stdlib')
|
||||
|
||||
const app = Application.currentApplication()
|
||||
app.includeStandardAdditions = true
|
||||
|
||||
const result = app.displayDialog('balenaEtcher 需要来自管理员的权限才能烧录镜像到磁盘。\n\n输入您的密码以允许此操作。', {
|
||||
defaultAnswer: '',
|
||||
withIcon: 'caution',
|
||||
buttons: ['取消', '好'],
|
||||
defaultButton: '好',
|
||||
hiddenAnswer: true,
|
||||
})
|
||||
|
||||
if (result.buttonReturned === '好') {
|
||||
result.textReturned
|
||||
} else {
|
||||
$.exit(255)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user