Add current time and last Gitea update to index.html

This commit is contained in:
2025-10-30 14:51:29 +01:00
parent 597e26ab62
commit f1d8b97156

View File

@@ -50,6 +50,11 @@
border-left: 5px solid #FFC107; border-left: 5px solid #FFC107;
margin-top: 20px; margin-top: 20px;
} }
.footer-info {
margin-top: 30px;
font-size: 0.8em;
color: #aaa;
}
</style> </style>
</head> </head>
<body> <body>
@@ -75,6 +80,37 @@
</ul> </ul>
<p>For detailed usage instructions and to understand how to deploy these overlays, please refer to the <a href="https://gitea.ramforth.net/ramforth/Overlays/src/branch/main/azuracast/README.md">Azuracast README.md</a> within the Gitea repository.</p> <p>For detailed usage instructions and to understand how to deploy these overlays, please refer to the <a href="https://gitea.ramforth.net/ramforth/Overlays/src/branch/main/azuracast/README.md">Azuracast README.md</a> within the Gitea repository.</p>
<div class="footer-info">
<p>Current Time: <span id="current-time"></span></p>
<p>Last Gitea Update: <span id="last-gitea-update"></span></p>
</div>
</div> </div>
<script>
// Update current time
function updateCurrentTime() {
const now = new Date();
document.getElementById('current-time').textContent = now.toLocaleString();
}
setInterval(updateCurrentTime, 1000);
updateCurrentTime();
// Fetch last Gitea update
const giteaApiUrl = 'https://gitea.ramforth.net/api/v1/repos/ramforth/Overlays/commits?limit=1';
fetch(giteaApiUrl)
.then(response => response.json())
.then(data => {
if (data && data.length > 0) {
const lastCommitDate = new Date(data[0].commit.committer.date);
document.getElementById('last-gitea-update').textContent = lastCommitDate.toLocaleString();
} else {
document.getElementById('last-gitea-update').textContent = 'N/A';
}
})
.catch(error => {
console.error('Error fetching Gitea commit info:', error);
document.getElementById('last-gitea-update').textContent = 'Error fetching data';
});
</script>
</body> </body>
</html> </html>