This commit is contained in:
asyncnomi 2023-01-04 00:22:40 +01:00
parent d38ce339b5
commit 69945cdb14
2 changed files with 10 additions and 2 deletions

View file

@ -479,7 +479,15 @@ fastify.post('/sendTreasure', async (request, reply) => {
if (activityExists.success) {
if (ActivityData[content.activityUid].type == "treasure") {
let imageUid = makeid(128);
fs.writeFileSync("static/images/"+imageUid, content.image);
let fileImage = `
<!DOCTYPE html>
<html>
<body>
<img style='object-fit: contain; width:100%; height:100%;' src='${content.image}'/>
</body>
</html>
`
fs.writeFileSync("static/images/" + imageUid + ".html", fileImage);
TreasureData[treasureUid] = {
date: new Date(),
creator: content.uid,

View file

@ -164,7 +164,7 @@ function get_admin(type) {
<div class="treasure-title">Demande de vérification par ${treasureData[entry].creator}</div>
<div class="treasure-activity">Activité: ${treasureData[entry].activity.title}</div>
<div class="treasure-desc">Description: ${treasureData[entry].desc}</div>
<div class="treasure-image">Image: <a href="${base_url}static/images/${treasureData[entry].image}" target="_blank"> Lien</a></div>
<div class="treasure-image">Image: <a href="${base_url}static/images/${treasureData[entry].image}.html" target="_blank"> Lien</a></div>
<span class="treasure-footer">
<div class="treasure-uid">UID: ${treasureData[entry].treasureUid}</div>
<div class="treasure-date">UID: ${treasureData[entry].date}</div>