summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/lib/shell.js35
-rw-r--r--webapp/src/components/DashboardPage.vue2
2 files changed, 18 insertions, 19 deletions
diff --git a/server/lib/shell.js b/server/lib/shell.js
index 09a3ae2..080e5d6 100644
--- a/server/lib/shell.js
+++ b/server/lib/shell.js
@@ -12,7 +12,7 @@ const fs = require('fs')
module.exports = {
buildIpxe: async function (req, res) {
const ipxeVersion = req.params.version
-
+
// Cloning git.
sendToLog(ipxeVersion, 'Cloning git ...\n', 'primary')
await cloneIpxe(ipxeVersion)
@@ -24,7 +24,7 @@ module.exports = {
// Make ipxe.
sendToLog(ipxeVersion, 'Make iPXE ...\n', 'primary')
shell.cd(path.join(__appdir, 'ipxe', 'ipxe_' + ipxeVersion, 'src'))
-
+
// Different make command for efi / bios are needed.
var makeCmd = ''
if (ipxeVersion === 'efi') makeCmd = 'make bin-x86_64-efi/snponly.efi EMBED=' + path.join(__appdir, 'ipxe', 'embedded_' + ipxeVersion + '.ipxe') + ' TRUST=' + path.join(__appdir, 'bin', 'fullchain.pem')// + ' bin/undionly.kpxe'
@@ -33,7 +33,7 @@ module.exports = {
var make = shell.exec(makeCmd, { async: true }, () => {
resolve()
})
-
+
// Send the output to the frontend log.
make.stdout.on('data', data => {
sendToLog(ipxeVersion, data, 'normal')
@@ -57,12 +57,12 @@ module.exports = {
}
}
-async function cloneIpxe(ipxeVersion) {
+async function cloneIpxe (ipxeVersion) {
// Check if git is installed on the server.
if (!shell.which('git')) {
return { status: 'GIT_MISSING', error_message: 'Please install git on the server.' }
}
-
+
shell.cd(path.join(__appdir, 'ipxe'))
return new Promise((resolve, reject) => {
var clone = shell.exec('git clone ' + ipxeGIT + ' ipxe_' + ipxeVersion, { async: true }, () => {
@@ -77,44 +77,43 @@ async function cloneIpxe(ipxeVersion) {
})
}
-function copyConfigs(ipxeVersion) {
+function copyConfigs (ipxeVersion) {
// Remove the default configs and paste in the customized ones.
shell.rm(path.join(__appdir, 'ipxe', 'ipxe_' + ipxeVersion, 'src', 'config', 'general.h'))
shell.rm(path.join(__appdir, 'ipxe', 'ipxe_' + ipxeVersion, 'src', 'config', 'console.h'))
shell.cp(path.join(__appdir, 'ipxe', 'general_' + ipxeVersion + '.h'), path.join(__appdir, 'ipxe', 'ipxe_' + ipxeVersion, 'src', 'config', 'general.h'))
shell.cp(path.join(__appdir, 'ipxe', 'console_' + ipxeVersion + '.h'), path.join(__appdir, 'ipxe', 'ipxe_' + ipxeVersion, 'src', 'config', 'console.h'))
- return
}
-function sendToLog(ipxeVersion, msg, status, writeLog = true) {
- var date = new Date();
+function sendToLog (ipxeVersion, msg, status, log = true) {
+ var date = new Date()
var dateString = '[' + date.getFullYear() + '-'
-
+
var month = parseInt(date.getMonth()) + 1
if (month < 10) dateString += '0' + month + '-'
else dateString += month + '-'
-
+
if (parseInt(date.getDate()) < 10) dateString += '0' + date.getDate() + ' '
else dateString += date.getDate() + ' '
-
+
if (parseInt(date.getHours()) < 10) dateString += '0' + date.getHours() + ':'
else dateString += date.getHours() + ':'
-
+
if (parseInt(date.getMinutes()) < 10) dateString += '0' + date.getMinutes() + ':'
else dateString += date.getMinutes() + ':'
-
+
if (parseInt(date.getSeconds()) < 10) dateString += '0' + date.getSeconds()
else dateString += date.getSeconds()
dateString += ']'
-
+
var logEntry = { date: dateString, status: status, msg: msg }
-
+
var socket = ipxeVersion + ' log'
io.in('broadcast ipxeBuild').emit(socket, logEntry)
- if (writeLog) writeLog(ipxeVersion, logEntry)
+ if (log) writeLog(ipxeVersion, logEntry)
}
-function writeLog(ipxeVersion, logEntry) {
+function writeLog (ipxeVersion, logEntry) {
fs.writeFile(path.join(__appdir, 'ipxe', 'log_' + ipxeVersion + '.txt'), logEntry.date + '\t' + logEntry.status + '\t' + logEntry.msg, { flag: 'a+' }, (err) => {
if (err) throw err
})
diff --git a/webapp/src/components/DashboardPage.vue b/webapp/src/components/DashboardPage.vue
index f408ebb..9696466 100644
--- a/webapp/src/components/DashboardPage.vue
+++ b/webapp/src/components/DashboardPage.vue
@@ -59,7 +59,7 @@
</v-touch>
</v-navigation-drawer>
- <v-toolbar dark app :clipped-left="settings.clipped" class="non-selectable">
+ <v-toolbar dark app :clipped-left="settings.clipped" class="non-selectable" style="z-index: 10;">
<v-toolbar-side-icon class="drawer-icon" @click.stop="toggleDrawer"></v-toolbar-side-icon>
<div class="logo"><img class="non-draggable hidden-md-and-down" src="@/assets/logo.svg" /></div>
<v-spacer></v-spacer>