Commit 40d1bdad authored by Tristan A Spakes's avatar Tristan A Spakes

ver. 1.1.0 Logging largely implemented. Add User logging complete. Logging added for web requests

parent e9daca97
Pipeline #23373 passed with stages
in 1 minute and 18 seconds
//Loads the badgeManagement major page and closes minor windows
function badgeManWin() {
ipcRenderer.send('log', 'ORNL Toolbox: Opened \"Badge Management\"', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Opened Badge Management', 'info')
//Destroying any minor windows that were opened from the main window
ipcRenderer.send('close minor window')
// Change main window to badge management window
......
......@@ -6,7 +6,7 @@ if [[ ${CI_COMMIT_REF_NAME} == 'master' ]]; then
else
BRANCH="-${CI_COMMIT_REF_NAME}"
fi
VERSION_NUMBER='1.0.12'
VERSION_NUMBER='1.1.0'
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum -y install nodejs npm ruby-devel gcc make rpm-build rubygems
......
//Change to file system management page after closing the minor window
function fileSysWin() {
ipcRenderer.send('log', 'ORNL Toolbox: Opened \"File System Management\"', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Opened File System Management', 'info')
//Destroying any minor windows that were opened from the main window
ipcRenderer.send('close minor window')
// Change main window to file system management window
......
//Change to IT Support and Services page after closing the minor window
function itsWin() {
ipcRenderer.send('log', 'ORNL Toolbox: Opened \"IT Services & Support\"', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Opened IT Services & Support', 'info')
//Destroying any minor windows that were opened from the main window
ipcRenderer.send('close minor window')
// Change main window to IT Services and Support window
......
......@@ -4,6 +4,6 @@ const ipcRenderer = require('electron').ipcRenderer
//Sends a signal to the main process to open a new window
function addWinMain(file, title, width, height) {
ipcRenderer.send('log', `ORNL Toolbox: Opened \"${title}\"`, 'info')
ipcRenderer.send('log', `ORNL Toolbox: Opened ${title}`, 'info')
ipcRenderer.send('new window', file, title, width, height)
}
/* Causes minor windows to close and the major page to
switch back to the home page when clicking the back button */
function backToMain() {
ipcRenderer.send('log', 'ORNL Toolbox: Opened \"Main Menu\"', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Opened Main Menu', 'info')
//Destroying any minor windows that were opened from the main window
ipcRenderer.send('close minor window')
// Change main window to user management window
......
......@@ -2,5 +2,6 @@ const shell = require('electron').shell
//Open the given url in the default browser
function openURL(url) {
ipcRenderer.send('log', `ORNL Toolbox: Opened ${url}`, 'info')
shell.openExternal(`${url}`)
}
//Loads the software major page and closes minor windows
function softManWin() {
ipcRenderer.send('log', 'ORNL Toolbox: Opened \"Software Management\"', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Opened Software Management', 'info')
//Destroying any minor windows that were opened from the main window
ipcRenderer.send('close minor window')
// Change main window to software management window
......
......@@ -27,6 +27,8 @@ function addUser() {
//Have user enter a name if the LDAP server can't be reached
//also if the specified user doesn't have the workstation resource
if(name == "" || name.includes('Can\'t contact LDAP server')) {
ipcRenderer.send('log', 'ORNL Toolbox: LDAP server unable to be reached or entered UID has no workstation resource', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Opened manual name entry for Add User', 'info')
name = ipcRenderer.sendSync('prompt', 'start')
if(name == null) {
return
......@@ -41,6 +43,7 @@ function addUser() {
//"Ubuntu" not found in file
sudo = "-G wheel "
}
ipcRenderer.send('log', 'ORNL Toolbox: Assigned sudo privileges to entered UID', 'info')
} else {
sudo = ""
}
......@@ -50,9 +53,11 @@ function addUser() {
} catch(error) {
error = error.toString()
if(error.includes('already exists')) {
ipcRenderer.send('log', 'ORNL Toolbox: Entered UID already exists', 'err')
alert('User already exists')
return
} else if(error.includes('Request dismissed')) {
ipcRenderer.send('log', 'ORNL Toolbox: Add User canceled', 'info')
alert('Operation canceled')
return
}
......@@ -61,6 +66,7 @@ function addUser() {
return
}
ipcRenderer.send('log', 'ORNL Toolbox: Entered UID added as a user', 'info')
alert('User added')
ipcRenderer.send('close minor window')
}
......@@ -2,7 +2,7 @@ let addWin = remote.getGlobal('addWindow')
//Change to User Management page after closing the minor window
function userManWin() {
ipcRenderer.send('log', 'ORNL Toolbox: Opened \"User & Group Management\"', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Opened User & Group Management', 'info')
//Destroying any minor windows that were opened from the main window
ipcRenderer.send('close minor window')
// Change main window to user management window
......
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