Commit 91b82636 authored by Tristan A Spakes's avatar Tristan A Spakes

ver. 1.1.7

parent cfba3401
Pipeline #24629 passed with stages
in 1 minute and 5 seconds
......@@ -6,7 +6,7 @@ if [[ ${CI_COMMIT_REF_NAME} == 'master' ]]; then
else
BRANCH="-${CI_COMMIT_REF_NAME}"
fi
VERSION_NUMBER='1.1.6'
VERSION_NUMBER='1.1.7'
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
......
......@@ -6,6 +6,9 @@ const ipc = require('electron').ipcRenderer
//Send feedback email
function sendFeedback() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
ipcRenderer.send('log', 'ORNL Toolbox: Submitted request to send help email', 'info')
var cat = document.getElementById('feedbackCategory').value
var body = document.getElementById('feedbackTextBox').value
var subject
......@@ -51,6 +54,7 @@ function sendFeedback() {
})
alert('Feedback sent')
ipcRenderer.send('log', 'ORNL Toolbox: Completed feedback email request', 'info')
let feedWin = remote.getGlobal('addWindow')
feedWin.destroy()
if(feedWin) {
......
......@@ -2,6 +2,8 @@ const execSync = require('child_process').execSync
const remote = require('electron').remote
function getHostName() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
try {
var hostname = execSync('hostname', () => {})
hostname = (hostname.toString()).trim()
......@@ -11,12 +13,18 @@ function getHostName() {
document.getElementById("helpDevice").value = hostname
} catch(error) {
console.error(error)
ipcRenderer.send('log', 'ORNL Toolbox: Failed to retrieve host name', 'err')
return
}
ipcRenderer.send('log', 'ORNL Toolbox: Sucessfully retrieved host name', 'info')
}
function help() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
if(!fs) var fs = require('fs')
ipcRenderer.send('log', 'ORNL Toolbox: Submitted request to send help email', 'info')
var short = document.getElementById('helpShort').value
var long = document.getElementById('helpLong').value
var replyTo = execSync('whoami', () => {})
......@@ -28,7 +36,7 @@ function help() {
//William Key's email receiver requires two newlines to process a ticket correctly
//This strangeness is to allow users to type ', ", and ` freely
fs.writeFileSync("/tmp/ToolboxEmail.txt", String.raw`uid="${replyTo}"
var result = fs.writeFileSync("/tmp/ToolboxEmail.txt", String.raw`uid="${replyTo}"
deviceName="${hostname}"
......@@ -36,21 +44,35 @@ shortDescription="${short}"
longDescription="${long}"`, (err) => {
if(err) {
return console.log(err);
return 1;
}
})
if(result == 1) {
ipcRenderer.send('log', 'ORNL Toolbox: Error creating the help email - request aborted', 'err')
} else {
ipcRenderer.send('log', 'ORNL Toolbox: Help email successfully createWindow', 'info')
}
command = `bash /opt/ornltoolbox/resources/app/help/help-emailer.sh "${subject}" "$(cat /tmp/ToolboxEmail.txt)"`
//Send the help email
execSync(command, (error, stdout, stderr) => {
result = execSync(command, (error, stdout, stderr) => {
if(stderr) {
alert(`${stderr}`)
ipcRenderer.send('log', 'ORNL Toolbox: Failed to send the help email', 'err')
return 1
}
})
if(result == 1) {
ipcRenderer.send('log', 'ORNL Toolbox: Error sending the help email - request aborted', 'err')
return
}
alert('Incident created - your issue will be addressed as soon as possible')
ipcRenderer.send('log', 'ORNL Toolbox: Completed help email request', 'info')
let helpWin = remote.getGlobal('addWindow')
helpWin.destroy()
if(helpWin) {
......
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