geoip_shop_manager.py aktualisiert
This commit is contained in:
@@ -1346,6 +1346,7 @@ def show_all_logs():
|
|||||||
print(f"\n{'═' * 70}")
|
print(f"\n{'═' * 70}")
|
||||||
print(" 📊 GESAMTÜBERSICHT ALLER SHOPS")
|
print(" 📊 GESAMTÜBERSICHT ALLER SHOPS")
|
||||||
print(f"{'═' * 70}")
|
print(f"{'═' * 70}")
|
||||||
|
print(f" {COLOR_GREEN}Grün = hinter Link11{COLOR_RESET} | {COLOR_RED}Rot = Direkt{COLOR_RESET}")
|
||||||
|
|
||||||
total_php_blocks = 0
|
total_php_blocks = 0
|
||||||
shop_php_stats = {} # shop -> {'blocks': N, 'activation': datetime, 'req_min': float, 'ips': {}}
|
shop_php_stats = {} # shop -> {'blocks': N, 'activation': datetime, 'req_min': float, 'ips': {}}
|
||||||
@@ -1402,7 +1403,15 @@ def show_all_logs():
|
|||||||
runtime = stats['runtime_minutes']
|
runtime = stats['runtime_minutes']
|
||||||
bar = "█" * min(int(req_min * 2), 20) if req_min > 0 else ""
|
bar = "█" * min(int(req_min * 2), 20) if req_min > 0 else ""
|
||||||
runtime_str = format_duration(runtime) if runtime > 0 else "?"
|
runtime_str = format_duration(runtime) if runtime > 0 else "?"
|
||||||
print(f" ├─ {shop}: {count} ({req_min:.1f} req/min, seit {runtime_str}) {bar}")
|
|
||||||
|
# Color shop name based on Link11 status
|
||||||
|
link11_info = check_link11(shop)
|
||||||
|
if link11_info['is_link11']:
|
||||||
|
shop_colored = f"{COLOR_GREEN}{shop}{COLOR_RESET}"
|
||||||
|
else:
|
||||||
|
shop_colored = f"{COLOR_RED}{shop}{COLOR_RESET}"
|
||||||
|
|
||||||
|
print(f" ├─ {shop_colored}: {count} ({req_min:.1f} req/min, seit {runtime_str}) {bar}")
|
||||||
|
|
||||||
# Show top IP for this shop
|
# Show top IP for this shop
|
||||||
shop_ips = stats['ips']
|
shop_ips = stats['ips']
|
||||||
@@ -1428,7 +1437,15 @@ def show_all_logs():
|
|||||||
for shop in sorted(crowdsec_stats.keys()):
|
for shop in sorted(crowdsec_stats.keys()):
|
||||||
count = crowdsec_stats[shop]
|
count = crowdsec_stats[shop]
|
||||||
bar = "█" * min(count // 10, 20) if count > 0 else ""
|
bar = "█" * min(count // 10, 20) if count > 0 else ""
|
||||||
print(f" ├─ {shop}: {count} {bar}")
|
|
||||||
|
# Color shop name based on Link11 status
|
||||||
|
link11_info = check_link11(shop)
|
||||||
|
if link11_info['is_link11']:
|
||||||
|
shop_colored = f"{COLOR_GREEN}{shop}{COLOR_RESET}"
|
||||||
|
else:
|
||||||
|
shop_colored = f"{COLOR_RED}{shop}{COLOR_RESET}"
|
||||||
|
|
||||||
|
print(f" ├─ {shop_colored}: {count} {bar}")
|
||||||
elif check_crowdsec():
|
elif check_crowdsec():
|
||||||
print(" └─ Keine aktiven Bans")
|
print(" └─ Keine aktiven Bans")
|
||||||
else:
|
else:
|
||||||
@@ -1454,9 +1471,16 @@ def show_all_logs():
|
|||||||
top_shop_count = top_shop[1]
|
top_shop_count = top_shop[1]
|
||||||
# Shorten shop name if too long
|
# Shorten shop name if too long
|
||||||
if len(top_shop_name) > 25:
|
if len(top_shop_name) > 25:
|
||||||
top_shop_display = top_shop_name[:22] + '...'
|
top_shop_short = top_shop_name[:22] + '...'
|
||||||
else:
|
else:
|
||||||
top_shop_display = top_shop_name
|
top_shop_short = top_shop_name
|
||||||
|
|
||||||
|
# Color shop name based on Link11 status
|
||||||
|
link11_info = check_link11(top_shop_name)
|
||||||
|
if link11_info['is_link11']:
|
||||||
|
top_shop_display = f"{COLOR_GREEN}{top_shop_short}{COLOR_RESET}"
|
||||||
|
else:
|
||||||
|
top_shop_display = f"{COLOR_RED}{top_shop_short}{COLOR_RESET}"
|
||||||
else:
|
else:
|
||||||
top_shop_display = "?"
|
top_shop_display = "?"
|
||||||
top_shop_count = 0
|
top_shop_count = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user