Commit 7d1403a3 authored by Tristan A Spakes's avatar Tristan A Spakes

ver. 1.2.0 gnome-screensaver is no longer a dependency, option given to...

ver. 1.2.0 gnome-screensaver is no longer a dependency, option given to install it before badge minder if it isn't installed already
parent 351745e7
Pipeline #25637 failed with stages
in 3 seconds
......@@ -12,6 +12,7 @@
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="./yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="./badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
<script src="../fileSystemManagement/localDriveUsage/localDriveUsage.js"></script>
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
......@@ -36,7 +37,7 @@
</div>
<div class="content">
<span title="Opens an application page for changing Badge Minder settings.">
<div id="buttons" onclick="addWinMain('./badgeManagement/badgeMinder/badgeMinder.html', 'Badge Minder', 450, 360)"><font color="white">Badge Minder</font></div>
<div id="buttons" onclick="badgeInstallCheckpoint()"><font color="white">Badge Minder</font></div>
</span>
<span title="Opens an application page for checking if the inserted Yubikey is locked.">
<div id="buttons" onclick="yubiBadgeCheckpoint(0)"><font color="white">Yubikey Lock Checker</font></div>
......
/* Prevents highlighting of text, dragging of images, etc. */
*, *::after, *::before {
margin: 0;
padding: 0;
-webkit-user-select: none;
-webkit-user-drag: none;
-webkit-app-region: no-drag;
font-family: 'Montserrat', sans-serif;
}
div {
-webkit-user-select: none;
-webkit-user-drag: none;
-webkit-app-region: no-drag;
font-family: 'Montserrat', sans-serif;
}
/* Horizontal line formatting */
hr {
display: block;
margin-top: 0.15em;
margin-bottom: 0.15em;
}
/* For submission buttons */
input[type=submit] {
padding: 0;
border: none;
background: none;
font-size: 21px;
}
#badgeInstallCheckpointPage {
display: flex;
height: 100vh;
flex-direction: column;
justify-content: center;
align-items: center;
}
#badgeInstallCheckpointText {
font-size: 16px;
text-align: center;
margin-bottom: 25px;
margin-left: 12px;
margin-right: 12px;
}
.badgeInstallCheckpointButtonsContent {
width: 100vw;
height: 10vh;
display: flex;
flex-direction: row;
justify-content: center;
}
.badgeInstallCheckpointButtons {
text-align: center;
align-items: center;
width: 22vw;
height: 18vh;
margin-right: 12.5px;
margin-left: 12.5px;
background-color: #007833 !important;
border-radius: 8px;
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2), 0 4px 8px 0 rgba(0,0,0,0.19);
color: White;
}
.badgeInstallCheckpointButtons:hover {
background-color: Gray !important;
cursor: pointer;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Badge Minder Checkpoint</title>
<link rel="stylesheet" href="./badgeInstallCheckpoint.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<script src="../../../miscjs/addWindow.js"></script>
<script src="../badgeMinderClose.js"></script>
<script src="./badgeInstallCheckpointConfirm.js"></script>
</head>
<body>
<div id="badgeInstallCheckpointPage">
<div id="badgeInstallCheckpointText">
Gnome-Screensaver is not currently installed. Badge Minder requires
Gnome-Screensaver to function. Would you like to install it?
</div>
<div class="badgeInstallCheckpointButtonsContent">
<span title="Click 'Install' to install gnome-screensaver, which is required for Badge Minder">
<input type="submit" class="badgeInstallCheckpointButtons" value="Install" onclick="badgeInstallCheckpointConfirm()">
</span>
<span title="Click 'Close' to close this current window and decline the installation.">
<input type="submit" class="badgeInstallCheckpointButtons" value="Close" onclick="badgeMinderClose()">
</span>
</div>
</div>
</body>
</html>
function badgeInstallCheckpoint() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
if(!execSync) var execSync = require('child_process').execSync
ipcRenderer.send('log', 'ORNL Toolbox: Submitted Badge Install Checkpoint request', 'info')
var os
try { //Detect OS
execSync('grep Ubuntu /etc/os-release')
os = "Ubuntu"
ipcRenderer.send('log', 'ORNL Toolbox: OS determined to be Ubuntu', 'info')
} catch(error) {
//"Ubuntu" not found in file
os = "RHEL"
ipcRenderer.send('log', 'ORNL Toolbox: OS determined to be RHEL', 'info')
}
try {
if(os == "Ubuntu") {
package = execSync(`apt -qq list --installed gnome-screensaver`)
} else {
package = execSync(`yum list installed gnome-screensaver | grep gnome-screensaver`)
}
} catch(error) {
alert(error)
ipcRenderer.send('log', 'ORNL Toolbox: Failed while checking for gnome-screensaver - request aborted', 'err')
return
}
ipcRenderer.send('log', 'ORNL Toolbox: Completed Badge Install Checkpoint request', 'info')
if(package == "") {
addWinMain('./badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.html', 'Badge Minder Checkpoint', 400, 175)
} else {
addWinMain('./badgeManagement/badgeMinder/badgeMinder.html', 'Badge Minder', 450, 360)
}
}
function badgeInstallCheckpointConfirm() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
if(!execSync) var execSync = require('child_process').execSync
ipcRenderer.send('log', 'ORNL Toolbox: Submitted install request for gnome-screensaver', 'info')
var os
try { //Detect OS
execSync('grep Ubuntu /etc/os-release')
os = "Ubuntu"
ipcRenderer.send('log', 'ORNL Toolbox: OS determined to be Ubuntu', 'info')
} catch(error) {
//"Ubuntu" not found in file
os = "RHEL"
ipcRenderer.send('log', 'ORNL Toolbox: OS determined to be RHEL', 'info')
}
try { //Install gnome-screensaver
if(os == "Ubuntu") {
execSync(`pkexec apt install gnome-screensaver`)
} else {
execSync(`pkexec yum install gnome-screensaver`)
}
} catch(error) {
error = error.toString()
if(error.includes("Request dismissed")) {
ipcRenderer.send('log', 'ORNL Toolbox: Request canceled by user', 'err')
badgeMinderClose()
return
} else {
ipcRenderer.send('log', 'ORNL Toolbox: Failed to install gnome-screensaver - request aborted', 'err')
console.error(error)
alert(error)
badgeMinderClose()
}
}
alert('Gnome Screensaver successfully installed')
ipcRenderer.send('log', 'ORNL Toolbox: Completed install request for gnome-screensaver', 'info')
//Open Badge Minder window
addWinMain('./badgeManagement/badgeMinder/badgeMinder.html', 'Badge Minder', 450, 360)
}
......@@ -77,6 +77,9 @@ function badgeConfig() {
return
}
//carrier = parseInt(carrier) //LEFT OFF HERE
//Assigning a domain string to the carrier
switch(parseInt(carrier)) {
case 0:
......
function badgeMinderClose() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
console.log('close')
ipcRenderer.send('close minor window')
ipcRenderer.send('log', `ORNL Toolbox: Clicked 'Close' - Badge Minder closed`, 'info')
......
......@@ -16,6 +16,6 @@ npm install electron-packager
sed -i "s/VERSION_NUMBER/$VERSION_NUMBER/" ./about/about.html
npm run build
mv ./Releases/ornltoolbox-linux-x64 ./ornltoolbox
sudo /usr/local/bin/fpm -s dir -f -n ornltoolbox${BRANCH} --provides ornltoolbox --deb-no-default-config-files -v $VERSION_NUMBER --description "A collection of ORNL Linux tools" -t deb -p /opt/ornltoolbox${BRANCH}-${VERSION_NUMBER}.deb --prefix /opt --after-install ./packages/packagePostInstall.bash --after-remove ./packages/packagePostRemove.bash --before-upgrade ./packages/packagePostRemove.bash --after-upgrade ./packages/packagePostInstall.bash -d 'libgconf-2-4' -d 'gnome-screensaver' -d 'yubico-piv-tool' -d 'sox' -d 'smartmontools' -d 'policykit-1-gnome' -d 'desktop-file-utils' ./ornltoolbox
sudo /usr/local/bin/fpm -s dir -f -n ornltoolbox${BRANCH} --provides ornltoolbox --deb-no-default-config-files -v $VERSION_NUMBER --description "A collection of ORNL Linux tools" -t rpm -p /opt/ornltoolbox${BRANCH}-${VERSION_NUMBER}.rpm --prefix /opt --after-install ./packages/packagePostInstall.bash --after-remove ./packages/packagePostRemove.bash --before-upgrade ./packages/packagePostRemove.bash --after-upgrade ./packages/packagePostInstall.bash -d 'libXScrnSaver' -d 'gnome-screensaver' -d 'yubico-piv-tool' -d 'sox' -d 'smartmontools' -d 'polkit-gnome' ./ornltoolbox
sudo /usr/local/bin/fpm -s dir -f -n ornltoolbox${BRANCH} --provides ornltoolbox --deb-no-default-config-files -v $VERSION_NUMBER --description "A collection of ORNL Linux tools" -t deb -p /opt/ornltoolbox${BRANCH}-${VERSION_NUMBER}.deb --prefix /opt --after-install ./packages/packagePostInstall.bash --after-remove ./packages/packagePostRemove.bash --before-upgrade ./packages/packagePostRemove.bash --after-upgrade ./packages/packagePostInstall.bash -d 'libgconf-2-4' -d 'yubico-piv-tool' -d 'sox' -d 'smartmontools' -d 'policykit-1-gnome' -d 'desktop-file-utils' ./ornltoolbox
sudo /usr/local/bin/fpm -s dir -f -n ornltoolbox${BRANCH} --provides ornltoolbox --deb-no-default-config-files -v $VERSION_NUMBER --description "A collection of ORNL Linux tools" -t rpm -p /opt/ornltoolbox${BRANCH}-${VERSION_NUMBER}.rpm --prefix /opt --after-install ./packages/packagePostInstall.bash --after-remove ./packages/packagePostRemove.bash --before-upgrade ./packages/packagePostRemove.bash --after-upgrade ./packages/packagePostInstall.bash -d 'libXScrnSaver' -d 'yubico-piv-tool' -d 'sox' -d 'smartmontools' -d 'polkit-gnome' ./ornltoolbox
cp /opt/ornltoolbox${BRANCH}-${VERSION_NUMBER}* .
......@@ -12,6 +12,7 @@
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="../badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
<script src="./localDriveUsage/localDriveUsage.js"></script>
<script src="./addPassphrase/addPassphrase.js"></script>
<script src="./removePassphrase/removePassphrase.js"></script>
......
......@@ -16,6 +16,7 @@
<script src="./miscjs/openURL.js"></script>
<script src="./miscjs/launchBomgar.js"></script>
<script src="./badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="./badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
<script src="./fileSystemManagement/localDriveUsage/localDriveUsage.js"></script>
<script src="./miscjs/menuFunctionCalls.js"></script>
<script src="./miscjs/checkForRoot.js"></script>
......
......@@ -12,6 +12,7 @@
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="../badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
<script src="../fileSystemManagement/localDriveUsage/localDriveUsage.js"></script>
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
......
......@@ -259,7 +259,7 @@ function createWindow() {
var menu = Menu.buildFromTemplate(menuTemplate);
Menu.setApplicationMenu(menu); //Sets the template as the app menu
//mainWindow.openDevTools() //Opens dev tools on start
mainWindow.openDevTools() //Opens dev tools on start
}
function addWin(file, title, width, height) {
......@@ -310,7 +310,7 @@ function addWin(file, title, width, height) {
})
addWindow.setMenu(null)
//addWindow.openDevTools()
addWindow.openDevTools()
}
}
......
......@@ -17,7 +17,7 @@ ipcRenderer.on('openSudoManagement', () => {
})
ipcRenderer.on('openBadgeMinder', () => {
addWinMain('./badgeManagement/badgeMinder/badgeMinder.html', 'Badge Minder', 450, 360)
badgeInstallCheckpoint()
})
ipcRenderer.on('openYubiChecker', () => {
......
......@@ -13,6 +13,7 @@
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../miscjs/loadSoftwareBadges.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="../badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
<script src="../fileSystemManagement/localDriveUsage/localDriveUsage.js"></script>
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
......
//Loads the software major page and closes minor windows
function softManWin() {
if(!ipcRenderer) var ipcRenderer = require('electron').ipcRenderer
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')
......
......@@ -12,6 +12,7 @@
<script src="../softwareManagement/openSoftware/openSoftware.js"></script>
<script src="../miscjs/menuFunctionCalls.js"></script>
<script src="../badgeManagement/yubiBadgeCheckpoint/yubiBadgeCheckpoint.js"></script>
<script src="../badgeManagement/badgeMinder/badgeInstallCheckpoint/badgeInstallCheckpoint.js"></script>
<script src="../fileSystemManagement/localDriveUsage/localDriveUsage.js"></script>
<script src="../fileSystemManagement/addPassphrase/addPassphrase.js"></script>
<script src="../fileSystemManagement/removePassphrase/removePassphrase.js"></script>
......
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