mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
update landing page
make relative links (T-Pot home) dynamic to display them only if services are available adjust dimensions for link container correct github link place attack-map link in the home container
This commit is contained in:
33
docker/nginx/dist/html/assets/js/lists.js
vendored
33
docker/nginx/dist/html/assets/js/lists.js
vendored
@ -3,12 +3,35 @@
|
||||
// ┴─┘┴└─┘ ┴ └─┘
|
||||
|
||||
// Print the first List
|
||||
const printFirstList = () => {
|
||||
const isLinkAvailable = async (link) => {
|
||||
try {
|
||||
const response = await fetch(link, { method: 'HEAD', redirect: 'manual' });
|
||||
if (response.ok) {
|
||||
// The link is available
|
||||
return true;
|
||||
} else if (response.status === 301 || response.status === 302) {
|
||||
// The link is a redirect, follow the redirect and check the final location
|
||||
const newLocation = response.headers.get('Location');
|
||||
if (newLocation) {
|
||||
const newResponse = await fetch(newLocation, { method: 'HEAD' });
|
||||
if (newResponse.ok) {
|
||||
// The final location is available
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Link check failed: ', error);
|
||||
}
|
||||
// The link is not available
|
||||
return false;
|
||||
};
|
||||
|
||||
const printFirstList = async () => {
|
||||
let icon = `<i class="list__head" icon-name="${CONFIG.firstListIcon}"></i>`;
|
||||
const position = 'beforeend';
|
||||
list_1.insertAdjacentHTML(position, icon);
|
||||
for (const link of CONFIG.lists.firstList) {
|
||||
// List item
|
||||
let item = `
|
||||
<a
|
||||
target="${CONFIG.openInNewTab ? '_blank' : ''}"
|
||||
@ -17,8 +40,10 @@ const printFirstList = () => {
|
||||
>${link.name}</a
|
||||
>
|
||||
`;
|
||||
const position = 'beforeend';
|
||||
list_1.insertAdjacentHTML(position, item);
|
||||
if (await isLinkAvailable(link.link)) {
|
||||
const position = 'beforeend';
|
||||
list_1.insertAdjacentHTML(position, item);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
1
docker/nginx/dist/html/assets/js/lucide.min.js.map
vendored
Normal file
1
docker/nginx/dist/html/assets/js/lucide.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
48
docker/nginx/dist/html/assets/js/time.js
vendored
48
docker/nginx/dist/html/assets/js/time.js
vendored
@ -1,36 +1,28 @@
|
||||
// ┌┬┐┬┌┬┐┌─┐
|
||||
// │ ││││├┤
|
||||
// ┴ ┴┴ ┴└─┘
|
||||
// Set time and Date
|
||||
|
||||
window.onload = displayClock();
|
||||
// Clock function
|
||||
function displayClock() {
|
||||
const monthNames = [
|
||||
'Jan',
|
||||
'Feb',
|
||||
'Mar',
|
||||
'Apr',
|
||||
'May',
|
||||
'Jun',
|
||||
'Jul',
|
||||
'Aug',
|
||||
'Sep',
|
||||
'Oct',
|
||||
'Nov',
|
||||
'Dec',
|
||||
];
|
||||
const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
|
||||
// Get clock elements
|
||||
var d = new Date();
|
||||
var mm = monthNames[d.getMonth()];
|
||||
var dd = d.getDate();
|
||||
var min = (mins = ('0' + d.getMinutes()).slice(-2));
|
||||
var hh = d.getHours();
|
||||
var ampm = '';
|
||||
var d = new Date();
|
||||
var mm = monthNames[d.getMonth()];
|
||||
var dd = d.getDate();
|
||||
var min = (mins = ('0' + d.getMinutes()).slice(-2));
|
||||
var hh = d.getHours();
|
||||
var ampm = '';
|
||||
|
||||
// Display clock elements
|
||||
document.getElementById('hour').innerText = hh;
|
||||
document.getElementById('separator').innerHTML = ' : ';
|
||||
document.getElementById('minutes').innerText = min + ampm;
|
||||
setTimeout(displayClock, 1000);
|
||||
}
|
||||
if (CONFIG.twelveHourFormat) {
|
||||
ampm = hh >= 12 ? ' pm' : ' am';
|
||||
hh = hh % 12;
|
||||
hh = hh ? hh : 12;
|
||||
}
|
||||
|
||||
document.getElementById('hour').innerText = hh;
|
||||
document.getElementById('separator').innerHTML = ' : ';
|
||||
document.getElementById('minutes').innerText = min + ampm;
|
||||
|
||||
setTimeout(displayClock, 1000);
|
||||
}
|
Reference in New Issue
Block a user