Highlight multi-blocked visits

This commit is contained in:
Sascha Leib
2025-11-07 18:46:17 +01:00
parent b2e22dc664
commit 6861f2af57
4 changed files with 16 additions and 13 deletions

View File

@@ -119,12 +119,14 @@
/* Captcha statuses */ /* Captcha statuses */
&.captcha::before { background-image: url('img/captcha.png') } &.captcha::before { background-image: url('img/captcha.png') }
&.cap_Y::before { background-position-y: -20px } &.cap_Y::before { background-position-y: -20px }
&.cap_YN::before { background-position-y: -40px } &.cap_YN::before, &.cap_YYN::before { background-position-y: -40px }
&.cap_W::before { background-position-y: -60px } &.cap_W::before { background-position-y: -60px }
&.cap_H::before { background-position-y: -80px } &.cap_H::before { background-position-y: -80px }
&.cap_X::before { background-position-y: -100px } &.cap_X::before { background-position-y: -100px }
&.cap_YH::before { background-position-y: -120px } &.cap_YH::before, &.cap_YYH::before { background-position-y: -120px }
&.cap_YNH::before { background-position-y: -140px } &.cap_YNH::before { background-position-y: -140px }
&.cap_YY::before { background-position-y: -160px }
&.cap_N::before { background-position-y: -180px }
/* Country flags */ /* Country flags */
/* Note: flag images and CSS adapted from: https://github.com/lafeber/world-flags-sprite/ */ /* Note: flag images and CSS adapted from: https://github.com/lafeber/world-flags-sprite/ */

View File

@@ -416,7 +416,7 @@ BotMon.live = {
_client: BotMon.live.data.clients.match(nv.agent) ?? null, // client info _client: BotMon.live.data.clients.match(nv.agent) ?? null, // client info
_platform: BotMon.live.data.platforms.match(nv.agent), // platform info _platform: BotMon.live.data.platforms.match(nv.agent), // platform info
_captcha: {'X': 0, 'Y': 0, 'N': 0, 'W':0, 'H': 0, _captcha: {'X': 0, 'Y': 0, 'N': 0, 'W':0, 'H': 0,
_str: function() { return (this.X > 0 ? 'X' : '') + (this.Y > 0 ? 'Y' : '') + (this.N > 0 ? 'N' : '') + (this.W > 0 ? 'W' : '') + (this.H > 0 ? 'H' : ''); } _str: function() { return (this.X > 0 ? 'X' : '') + (this.Y > 0 ? (this.Y > 1 ? 'YY' : 'Y') : '') + (this.N > 0 ? 'N' : '') + (this.W > 0 ? 'W' : '') + (this.H > 0 ? 'H' : ''); }
} // captcha counter } // captcha counter
}}; }};
model._visitors.push(visitor); model._visitors.push(visitor);
@@ -574,11 +574,13 @@ BotMon.live = {
_makeCaptchaTitle: function(cObj) { _makeCaptchaTitle: function(cObj) {
const cStr = cObj._str(); const cStr = cObj._str();
switch (cStr) { switch (cStr) {
case 'Y': case 'Y': return "Blocked.";
case 'NY': return "Blocked."; case 'YY': return "Blocked multiple times.";
case 'YN': return "Solved"; case 'YN': return "Solved";
case 'YYN': return "Solved after multiple attempts";
case 'W': return "Whitelisted"; case 'W': return "Whitelisted";
case 'H': return "HEAD request, no captcha"; case 'H': return "HEAD request, no captcha";
case 'YH': case 'YYH': return "Block & HEAD mixed";
default: return "Undefined: " + cStr; default: return "Undefined: " + cStr;
} }
} }
@@ -2083,7 +2085,7 @@ BotMon.live = {
botList.forEach( (botInfo) => { botList.forEach( (botInfo) => {
const bli = makeElement('dd'); const bli = makeElement('dd');
bli.appendChild(makeElement('span', {'class': 'has_icon bot bot_' + botInfo.id }, botInfo.name)); bli.appendChild(makeElement('span', {'class': 'has_icon bot bot_' + botInfo.id }, botInfo.name));
bli.appendChild(makeElement('span', {'class': 'count' }, botInfo.count)); bli.appendChild(makeElement('span', {'class': 'count' }, botInfo.count || kNoData));
botElement.append(bli) botElement.append(bli)
}); });
} }
@@ -2098,7 +2100,7 @@ BotMon.live = {
ispList.forEach( (netInfo) => { ispList.forEach( (netInfo) => {
const li = makeElement('dd'); const li = makeElement('dd');
li.appendChild(makeElement('span', {'class': 'has_icon ipaddr ip' + netInfo.typ }, netInfo.name)); li.appendChild(makeElement('span', {'class': 'has_icon ipaddr ip' + netInfo.typ }, netInfo.name));
li.appendChild(makeElement('span', {'class': 'count' }, netInfo.count)); li.appendChild(makeElement('span', {'class': 'count' }, netInfo.count || kNoData));
botIps.append(li) botIps.append(li)
}); });
} }
@@ -2111,7 +2113,7 @@ BotMon.live = {
countryList.forEach( (cInfo) => { countryList.forEach( (cInfo) => {
const cLi = makeElement('dd'); const cLi = makeElement('dd');
cLi.appendChild(makeElement('span', {'class': 'has_icon country ctry_' + cInfo.id.toLowerCase() }, cInfo.name)); cLi.appendChild(makeElement('span', {'class': 'has_icon country ctry_' + cInfo.id.toLowerCase() }, cInfo.name));
cLi.appendChild(makeElement('span', {'class': 'count' }, cInfo.count)); cLi.appendChild(makeElement('span', {'class': 'count' }, cInfo.count || kNoData));
botCountries.appendChild(cLi); botCountries.appendChild(cLi);
}); });
} }
@@ -2210,7 +2212,7 @@ BotMon.live = {
usrCtryList.forEach( (cInfo) => { usrCtryList.forEach( (cInfo) => {
const cLi = makeElement('dd'); const cLi = makeElement('dd');
cLi.appendChild(makeElement('span', {'class': 'has_icon country ctry_' + cInfo.id.toLowerCase() }, cInfo.name)); cLi.appendChild(makeElement('span', {'class': 'has_icon country ctry_' + cInfo.id.toLowerCase() }, cInfo.name));
cLi.appendChild(makeElement('span', {'class': 'count' }, cInfo.count)); cLi.appendChild(makeElement('span', {'class': 'count' }, cInfo.count || kNoData));
usrCountries.appendChild(cLi); usrCountries.appendChild(cLi);
}); });
} }
@@ -2234,7 +2236,7 @@ BotMon.live = {
pgDd.appendChild(makeElement('span', { pgDd.appendChild(makeElement('span', {
'class': 'count', 'class': 'count',
'title': pgInfo.count + " page views" 'title': pgInfo.count + " page views"
}, pgInfo.count)); }, pgInfo.count || kNoData));
wmpages.appendChild(pgDd); wmpages.appendChild(pgDd);
}); });
} }

View File

@@ -176,11 +176,10 @@ const $BMCaptcha = {
(new Date()).toISOString().substring(0, 10) (new Date()).toISOString().substring(0, 10)
]; ];
if (performance.now() - $BMCaptcha._st <= 1500) dat.push(performance.now() - $BMCaptcha._st); if (performance.now() - $BMCaptcha._st <= 1500) dat.push(performance.now() - $BMCaptcha._st);
const hash = $BMCaptcha.digest.hash(dat.join(';'));
// set the cookie: // set the cookie:
document.cookie = "DWConfirm=" + encodeURIComponent(hash) + '; path=/; session;' document.cookie = "DWConfirm=" + encodeURIComponent($BMCaptcha.digest.hash(dat.join(';'))) + '; path=/; session;';
+ (document.location.protocol === 'https:' ? ' secure;' : ''); // + (document.location.protocol === 'https:' ? ' secure;' : '');
} catch (err) { } catch (err) {
console.error(err); console.error(err);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB