wizard bugfixes

This commit is contained in:
NoobishSVK
2024-11-07 17:25:04 +01:00
parent 73e7a7bf19
commit 21484dd6a2
4 changed files with 7 additions and 5 deletions
+5 -2
View File
@@ -222,12 +222,15 @@ router.post('/saveData', (req, res) => {
}); });
router.get('/getData', (req, res) => { router.get('/getData', (req, res) => {
if (configExists() === false) {
res.json(serverConfig);
}
if(req.session.isAdminAuthenticated) { if(req.session.isAdminAuthenticated) {
// Check if the file exists // Check if the file exists
fs.access(configPath, fs.constants.F_OK, (err) => { fs.access(configPath, fs.constants.F_OK, (err) => {
if (err) { if (err) {
// File does not exist console.log(err);
res.status(404).send('Data not found');
} else { } else {
// File exists, send it as the response // File exists, send it as the response
res.sendFile(path.join(__dirname, '../' + configName + '.json')); res.sendFile(path.join(__dirname, '../' + configName + '.json'));
+1 -1
View File
@@ -187,5 +187,5 @@ async function loadConsoleLogs() {
}); });
resolve(); resolve();
}); });
$("#console-output").scrollTop($("#console-output")[0].scrollHeight); $("#console-output").length ? $("#console-output").scrollTop($("#console-output")[0].scrollHeight) : null;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
$(document).ready(function() { $(document).ready(function() {
$('.btn-prev').toggle($('.step:visible').index() !== 0); $('.btn-prev').toggle($('.step:visible').index() !== 0);
$('.btn-next').click(() => navigateStep(true)); $('.btn-next').click(() => navigateStep(true));
$('.btn-prev').click(() => navigateStep(false)); $('.btn-prev').click(() => navigateStep(false));
}); });
function updateProgressBar(currentStep) { function updateProgressBar(currentStep) {
-1
View File
@@ -211,7 +211,6 @@
<script src="js/settings.js"></script> <script src="js/settings.js"></script>
<script src="js/dropdown.js"></script> <script src="js/dropdown.js"></script>
<script src="js/toast.js"></script> <script src="js/toast.js"></script>
<script src="js/settings.js"></script>
<script src="js/setup.js"></script> <script src="js/setup.js"></script>
<script src="js/wizard.js"></script> <script src="js/wizard.js"></script>
<script src="js/confighandler.js"></script> <script src="js/confighandler.js"></script>