added url, apikey to lockscreen

This commit is contained in:
Sören 2025-05-03 15:12:58 +02:00
parent dbcdce5296
commit 2eb80e0da9
4 changed files with 9 additions and 3 deletions

View File

@ -20,7 +20,8 @@ const config = new ConfigManager(__path + '/config.json', true, {
database: 'hydrationhub'
},
devmode: false,
devmode_fileupload: false
devmode_fileupload: false,
galleryApiKey: '',
});//, log.core); // Disabled due to Cyclic dependencies with log handler (specifically-> devmode for loglevel)

View File

@ -1,7 +1,8 @@
import express, { Request, Response } from 'express';
import config from '../../handlers/config.js';
function get(req: Request, res: Response) {
res.render("screensaver")
res.render("screensaver", { apikey: config.global.galleryApiKey })
}
export default { get };

View File

@ -26,7 +26,8 @@ function handleImage() {
orientation: 'landscape',
height: window.screen.availHeight,
width: window.screen.availWidth,
cropCenteringMode: 'sm'
cropCenteringMode: 'sm',
apikey: apiKey
};
const apiUrl = `https://photo.thegreydiamond.de/api/images/random.php?${new URLSearchParams(apiParams).toString()}`;

View File

@ -10,6 +10,9 @@
<div id="date"></div>
</div>
<script>
const apiKey = "<%= it.apikey %>";
</script>
<script src="/static/apiWrapper.js"></script>
<script src="/static/pageDriver.js"></script>
<script src="/static/js/lockscreenBgHandler.js"></script>