AstraOS Ver. 1.32:
All checks were successful
Deploy AstraOS Panel / deploy (push) Successful in 12s

- AyranTracker bearbeitet
This commit is contained in:
elias 2026-06-07 12:35:23 +02:00
parent f5d254185b
commit fa504cec60
2 changed files with 18 additions and 28 deletions

View file

@ -79,7 +79,7 @@
</div> </div>
<div class="space-y-4 pt-4"> <div class="space-y-4 pt-4">
<h4 class="text-lg font-black text-slate-300 tracking-wider uppercase border-b border-slate-900 pb-2">Match Historie (Letzte 15 Matches)</h4> <h4 class="text-lg font-black text-slate-300 tracking-wider uppercase border-b border-slate-900 pb-2">Match Historie (Letzte 20 Matches)</h4>
<div id="matchHistoryContainer" class="space-y-4"> <div id="matchHistoryContainer" class="space-y-4">
</div> </div>
</div> </div>
@ -87,22 +87,20 @@
</div> </div>
<script> <script>
// Lokales Mapping für Map-ListView-Icons von valorant-api.com, damit alles perfekt geladen wird // Korrigiertes Mapping mit den exakten UUID-Bildern von valorant-api.com
const mapIcons = { const mapIcons = {
"ascent": "https://media.valorant-api.com/maps/7eae2356-4a54-2a30-5731-93ad3242274d/listViewIcon.png", "ascent": "https://media.valorant-api.com/maps/7eaecc1b-4337-bbf6-6ab9-04b8f06b3319/listviewicon.png",
"bind": "https://media.valorant-api.com/maps/2c9b3b9b-4314-8583-60d8-856d94c0e45a/listViewIcon.png", "split": "https://media.valorant-api.com/maps/d960549e-485c-e861-8d71-aa9d1aed12a2/listviewicon.png",
"haven": "https://media.valorant-api.com/maps/2bee0dc1-43e0-ab88-66d5-a3a69470566e/listViewIcon.png", "fracture": "https://media.valorant-api.com/maps/b5294485-4d60-346e-e89e-00a4c527a405/listviewicon.png",
"split": "https://media.valorant-api.com/maps/d962e550-4c7b-1410-1050-e3c6c001f3e4/listViewIcon.png", "bind": "https://media.valorant-api.com/maps/2c9d57ec-4431-9c5e-2939-8f9ef6dd5cba/listviewicon.png",
"icebox": "https://media.valorant-api.com/maps/e2ad5c54-4114-a870-96ae-19b2e030d18e/listViewIcon.png", "breeze": "https://media.valorant-api.com/maps/2fb9a4fd-47b8-4e7d-a969-74b4046ebd53/listviewicon.png",
"breeze": "https://media.valorant-api.com/maps/2fb9a4aa-42c8-7de2-4d52-04b5833e25d9/listViewIcon.png", "district": "https://media.valorant-api.com/maps/690b3ed2-4dff-945b-8223-6da834e30d24/listviewicon.png",
"fracture": "https://media.valorant-api.com/maps/b5294485-4d60-4a4e-f416-43b35583b639/listViewIcon.png", "haven": "https://media.valorant-api.com/maps/2bee0dc1-43e0-ab88-66d5-a3a69470566e/listviewicon.png",
"pearl": "https://media.valorant-api.com/maps/fd2673d9-41d7-4987-ee8b-5f1905d92b74/listViewIcon.png", "icebox": "https://media.valorant-api.com/maps/e2ad5c54-4114-a870-96ae-19b2e030d18e/listviewicon.png",
"lotus": "https://media.valorant-api.com/maps/2fe4ed3a-450a-948b-6d6b-e89a78e680a9/listViewIcon.png", "pearl": "https://media.valorant-api.com/maps/fd2673d9-41d7-4987-ee8b-5f1905d92b74/listviewicon.png",
"sunset": "https://media.valorant-api.com/maps/92dac14f-4ee3-5e18-bfbf-9a96d5d5e7d6/listViewIcon.png", "lotus": "https://media.valorant-api.com/maps/2fe4ed3a-450a-948b-6d6b-e89a78e680a9/listviewicon.png",
"abyss": "https://media.valorant-api.com/maps/224b0a95-4ae7-8a10-5a2b-2895a10a5344/listViewIcon.png", "sunset": "https://media.valorant-api.com/maps/92dac14f-4ee3-5e18-bfbf-9a96d5d5e7d6/listviewicon.png",
"district": "https://media.valorant-api.com/maps/12452a2d-48e7-916c-e63d-4988bbdbed51/listViewIcon.png", "abyss": "https://media.valorant-api.com/maps/224b0a95-4ae7-8a10-5a2b-2895a10a5344/listviewicon.png"
"kasbah": "https://media.valorant-api.com/maps/de28aa9b-4cbe-1003-320e-6cb3ec309557/listViewIcon.png",
"piazza": "https://media.valorant-api.com/maps/690b3aea-4c13-a87e-4031-f3933e287b37/listViewIcon.png"
}; };
document.getElementById('searchBtn').addEventListener('click', async () => { document.getElementById('searchBtn').addEventListener('click', async () => {
@ -127,7 +125,6 @@
const data = await response.json(); const data = await response.json();
if (response.ok && data.status === "success") { if (response.ok && data.status === "success") {
// Dashboard füllen
document.getElementById('playerNameTag').innerText = `${data.account.name}#${data.account.tag}`; document.getElementById('playerNameTag').innerText = `${data.account.name}#${data.account.tag}`;
document.getElementById('playerLevel').innerText = `Level: ${data.account.level}`; document.getElementById('playerLevel').innerText = `Level: ${data.account.level}`;
document.getElementById('playerCard').src = data.account.card_url || 'https://media.valorant-api.com/playercards/9fb348bc-41a4-91ad-d131-1ca1efdc3535/smallart.png'; document.getElementById('playerCard').src = data.account.card_url || 'https://media.valorant-api.com/playercards/9fb348bc-41a4-91ad-d131-1ca1efdc3535/smallart.png';
@ -140,7 +137,6 @@
document.getElementById('statADR').innerText = data.calculated_stats.avg_damage_round; document.getElementById('statADR').innerText = data.calculated_stats.avg_damage_round;
document.getElementById('statMatches').innerText = data.calculated_stats.matches_analyzed; document.getElementById('statMatches').innerText = data.calculated_stats.matches_analyzed;
// Agenten Boxen
const agentContainer = document.getElementById('agentContainer'); const agentContainer = document.getElementById('agentContainer');
agentContainer.innerHTML = ''; agentContainer.innerHTML = '';
data.top_agents.forEach(agent => { data.top_agents.forEach(agent => {
@ -152,7 +148,6 @@
`); `);
}); });
// Match History groß aufbauen
const historyContainer = document.getElementById('matchHistoryContainer'); const historyContainer = document.getElementById('matchHistoryContainer');
historyContainer.innerHTML = ''; historyContainer.innerHTML = '';
@ -164,11 +159,10 @@
const badgeBg = match.has_won ? 'bg-emerald-500/20 text-emerald-400' : 'bg-rose-500/20 text-rose-400'; const badgeBg = match.has_won ? 'bg-emerald-500/20 text-emerald-400' : 'bg-rose-500/20 text-rose-400';
const statusLabel = match.has_won ? 'SIEG' : 'NIEDERLAGE'; const statusLabel = match.has_won ? 'SIEG' : 'NIEDERLAGE';
// Finde passendes ListView Icon für die Map heraus // Bestimme das richtige ListView Icon aus dem korrigierten Map-Mapping
const mapKey = match.map.toLowerCase().trim(); const mapKey = match.map.toLowerCase().trim();
const mapIconUrl = mapIcons[mapKey] || 'https://media.valorant-api.com/maps/7eae2356-4a54-2a30-5731-93ad3242274d/listViewIcon.png'; const mapIconUrl = mapIcons[mapKey] || 'https://media.valorant-api.com/maps/7eaecc1b-4337-bbf6-6ab9-04b8f06b3319/listviewicon.png';
// RR String bauen (+/-)
let rrDisplay = ''; let rrDisplay = '';
if (match.mmr_change !== null && mode === 'competitive') { if (match.mmr_change !== null && mode === 'competitive') {
if (match.mmr_change > 0) { if (match.mmr_change > 0) {
@ -212,7 +206,6 @@
}); });
} }
// Ansichten wechseln
document.getElementById('searchSection').classList.add('hidden'); document.getElementById('searchSection').classList.add('hidden');
document.getElementById('profileSection').classList.remove('hidden'); document.getElementById('profileSection').classList.remove('hidden');
} else { } else {

View file

@ -1556,7 +1556,6 @@ def get_valorant_stats(name, tag):
# 2. Aktueller Rang (MMR v1) # 2. Aktueller Rang (MMR v1)
mmr_res = requests.get(f"{VALORANT_API_BASE}/v1/mmr/{region}/{name}/{tag}", headers=headers, timeout=10) mmr_res = requests.get(f"{VALORANT_API_BASE}/v1/mmr/{region}/{name}/{tag}", headers=headers, timeout=10)
mmr_data = mmr_res.json().get('data', {}) if mmr_res.status_code == 200 else {} mmr_data = mmr_res.json().get('data', {}) if mmr_res.status_code == 200 else {}
if not mmr_data: mmr_data = {}
# 3. RR-Verlauf (MMR History) abrufen # 3. RR-Verlauf (MMR History) abrufen
rr_history = {} rr_history = {}
@ -1569,8 +1568,8 @@ def get_valorant_stats(name, tag):
if m_id: if m_id:
rr_history[m_id] = h_item.get('mmr_change_to_last_game', 0) rr_history[m_id] = h_item.get('mmr_change_to_last_game', 0)
# 4. Match Historie (Größe 15) # 4. Match Historie erhöht auf size=20 für mehr Übersicht
matches_res = requests.get(f"{VALORANT_API_BASE}/v3/matches/{region}/{name}/{tag}?size=15&mode={match_mode}", matches_res = requests.get(f"{VALORANT_API_BASE}/v3/matches/{region}/{name}/{tag}?size=20&mode={match_mode}",
headers=headers, timeout=10) headers=headers, timeout=10)
matches_list = matches_res.json().get('data', []) if matches_res.status_code == 200 else [] matches_list = matches_res.json().get('data', []) if matches_res.status_code == 200 else []
@ -1635,8 +1634,6 @@ def get_valorant_stats(name, tag):
total_damage += match_damage total_damage += match_damage
mmr_change = rr_history.get(match_id, 0) if match_mode == 'competitive' else None mmr_change = rr_history.get(match_id, 0) if match_mode == 'competitive' else None
# Holen des Map-Namen für die standardisierte Bild-URL im Frontend
map_name = metadata.get('map', 'Unknown') map_name = metadata.get('map', 'Unknown')
processed_matches.append({ processed_matches.append({