Add an indicator to the page showing dev build
This commit is contained in:
parent
983724bf08
commit
0c69d19f72
@ -1,7 +1,8 @@
|
||||
/* ITS Thermal Receipt Printer
|
||||
* Developed by Skylar Grant for MCCS ITS
|
||||
*/
|
||||
const version = "1.2.10 dev";
|
||||
const version = "1.2.10";
|
||||
const inDevEnv = true; // Set to true for development environment, false for production
|
||||
// #############################################################
|
||||
// Variables
|
||||
// #############################################################
|
||||
@ -131,6 +132,25 @@ function setVersionNumber() {
|
||||
document.getElementById('versionNumber').innerText = version;
|
||||
}
|
||||
|
||||
function setDevBanner() {
|
||||
if (inDevEnv) {
|
||||
const body = document.body;
|
||||
const banner = document.createElement('div');
|
||||
banner.innerText = 'DEVELOPMENT BUILD';
|
||||
banner.style.position = 'fixed';
|
||||
banner.style.top = '0';
|
||||
banner.style.left = '0';
|
||||
// banner.style.width = '100%';
|
||||
banner.style.backgroundColor = 'red';
|
||||
banner.style.color = 'white';
|
||||
banner.style.textAlign = 'center';
|
||||
banner.style.fontSize = '24px';
|
||||
banner.style.fontWeight = 'bold';
|
||||
banner.style.zIndex = '1000';
|
||||
body.appendChild(banner);
|
||||
}
|
||||
}
|
||||
|
||||
function tempPasswordHandler() {
|
||||
// Grab the form values
|
||||
const username = document.getElementById('tempPwUsername').value;
|
||||
@ -511,6 +531,7 @@ document.getElementById('ewasteClistBtn').addEventListener('click', () => {
|
||||
// #############################################################
|
||||
try {
|
||||
setVersionNumber();
|
||||
setDevBanner();
|
||||
} catch (error) {
|
||||
console.error(`An error occurred during initialization: ${error.message}`);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user