Skip to content

Commit

Permalink
del test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fe1w0 committed Mar 14, 2022
1 parent 756a464 commit 39bc59c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 52 deletions.
38 changes: 19 additions & 19 deletions preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,27 @@ window.exports = {
window.utools.hideMainWindow()
utils.vmwareStop(itemData.description)
},
placeholder: '虚拟机列表[运行中]'
placeholder: '虚拟机列表'
},
'vmware_suspend': {
mode: 'list',
args: {
enter: (action, callbackSetList) => {
document.getElementById('settings')?.remove()
callbackSetList(utils.listAllLiveVmxPath());
},
search: (action, searchWord, callbackSetList) => {
document.getElementById('settings')?.remove()
callbackSetList(utils.searchLiveVmxPath(searchWord))
},
'vmware_suspend': {
mode: 'list',
args: {
enter: (action, callbackSetList) => {
document.getElementById('settings')?.remove()
callbackSetList(utils.listAllLiveVmxPath());
},
search: (action, searchWord, callbackSetList) => {
document.getElementById('settings')?.remove()
callbackSetList(utils.searchLiveVmxPath(searchWord))
},
select: (action, itemData) => {
document.getElementById('settings')?.remove()
// itemData 为被选择的数据项
window.utools.hideMainWindow()
utils.vmwareSuspend(itemData.description)
},
select: (action, itemData) => {
document.getElementById('settings')?.remove()
// itemData 为被选择的数据项
window.utools.hideMainWindow()
utils.vmwareSuspend(itemData.description)
},
placeholder: '虚拟机列表[运行中]'
}
placeholder: '虚拟机列表'
}
}
}
29 changes: 0 additions & 29 deletions src/test.js

This file was deleted.

8 changes: 4 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function vmwareOpen(vmxPath) {
if(vmwareObject.isNotificationBar == 'checked'){
utools.showNotification(vmxPath + '打开中')
}
childProcess.execSync(execCmd, {encoding: loadPlugin.binaryEncoding, windowsHide: true});
childProcess.exec(execCmd, {encoding: loadPlugin.binaryEncoding, windowsHide: true});
}catch(e){
console.log("Error: vmwareOpen")
}
Expand All @@ -89,7 +89,7 @@ function vmwareRun(vmxPath) {
message = vmwareObject.isBackground ? vmxPath + '打开中(nogui)' : vmxPath + '打开中(gui)'
utools.showNotification(message)
}
childProcess.execSync(execCmdVmrun, {encoding: loadPlugin.binaryEncoding, windowsHide: true});
childProcess.exec(execCmdVmrun, {encoding: loadPlugin.binaryEncoding, windowsHide: true});
} catch (e) {
console.log("Error: vmwareRun")
}
Expand All @@ -104,7 +104,7 @@ function vmwareStop(vmxPath) {
if(vmwareObject.isNotificationBar == 'checked'){
utools.showNotification(vmxPath + '关闭中')
}
childProcess.execSync(execCmd, {encoding: loadPlugin.binaryEncoding, windowsHide: true});
childProcess.exec(execCmd, {encoding: loadPlugin.binaryEncoding, windowsHide: true});
} catch(e) {
console.log("Error: vmwareStop")
}
Expand All @@ -117,7 +117,7 @@ function vmwareSuspend(vmxPath){
if(vmwareObject.isNotificationBar == 'checked'){
utools.showNotification(vmxPath + '挂起中')
}
childProcess.execSync(execCmd, {encoding: loadPlugin.binaryEncoding, windowsHide: true});
childProcess.exec(execCmd, {encoding: loadPlugin.binaryEncoding, windowsHide: true});
} catch(e) {
console.log("Error: vmwareSuspend")
}
Expand Down

0 comments on commit 39bc59c

Please sign in to comment.