Commit 98638b67 authored by Tristan A Spakes's avatar Tristan A Spakes

ver. 1.1.6 Logging fully implemented

parent 2100384b
Pipeline #24619 failed with stages
in 2 seconds
......@@ -57,6 +57,7 @@ function driveHealthCheck() {
} else {
console.error(error)
ipcRenderer.send('log', 'ORNL Toolbox: Failed to complete Drive Health Check request', 'err')
return
}
}
ipcRenderer.send('log', 'ORNL Toolbox: Completed Drive Health Check request', 'info')
......
const exec = require('child_process').exec
function openSoftware(mode) { //Open gnome software application
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
if(mode == 0) {
ipcRenderer.send('log', 'ORNL Toolbox: Submitted request to open Gnome Software', 'info')
if(! installedCheck("gnome-software")) {
alert('This feature is not installed on this system - click the help button or contact the Solution Center for assistance')
ipcRenderer.send('log', 'ORNL Toolbox: Gnome Software is not installed - request aborted', 'err')
return
}
exec('gnome-software', (error, stdout, stderr) => {
if(error) {
console.error(`exec error: ${error}`)
ipcRenderer.send('log', 'ORNL Toolbox: Failed to open Gnome Software', 'err')
return
}
})
ipcRenderer.send('log', 'ORNL Toolbox: Opened Gnome Software', 'info')
} else { //For small orange and red badges to redirect to updates page
if(!execSync) var execSync = require('child_process').execSync
ipcRenderer.send('log', 'ORNL Toolbox: Submitted request to open OS-specific updates program', 'info')
var isUbuntu = execSync('grep Ubuntu /etc/os-release || true', () => {})
isUbuntu = isUbuntu.toString()
if(isUbuntu == "") { //Use RHEL update program
exec('/usr/bin/gpk-update-viewer', (error, stdout, stderr) => {
if(error) {
console.error(`exec error: ${error}`);
console.error(`exec error: ${error}`)
ipcRenderer.send('log', 'ORNL Toolbox: Failed to open RHEL updates program', 'err')
return;
}
})
ipcRenderer.send('log', 'ORNL Toolbox: Opened RHEL updates program', 'info')
} else { //Use Ubuntu update program
exec('/usr/bin/update-manager', (error, stdout, stderr) => {
if(error) {
console.error(`exec error: ${error}`);
console.error(`exec error: ${error}`)
ipcRenderer.send('log', 'ORNL Toolbox: Failed to open Ubuntu updates program', 'err')
return;
}
})
ipcRenderer.send('log', 'ORNL Toolbox: Opened Ubuntu updates program', 'info')
}
}
}
......@@ -60,7 +60,7 @@ function addUser() {
alert('User already exists')
return
} else if(error.includes('Request dismissed')) {
ipcRenderer.send('log', 'ORNL Toolbox: Add User request canceled', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Add User request canceled by user', 'info')
return
}
console.error(error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment