This commit is contained in:
ScrawnyRonnie 2024-03-22 12:37:25 -04:00
parent 9179125e98
commit 377f69859b
4 changed files with 89 additions and 115 deletions

View file

@ -14,9 +14,11 @@
export let params;
let iWeapons = [];
let vehicles = [];
let alert;
let avatar = {};
let iWeaponsKillsSum
let vehicleKillsSum
let kdByDate = [];
let url = params.id || avatar.id
let face;
@ -58,7 +60,7 @@
async function get_iWeaponStats() {
try {
const ids = [55, 56, 57, 140, 146, 175, 233, 299, 304, 324, 334, 345, 396, 406,
const ids = [55, 56, 57, 140, 146, 148, 175, 233, 299, 304, 324, 334, 345, 396, 406,
407, 411, 425, 429, 462, 468, 556, 587, 588, 589, 599, 673, 680, 701, 706, 714,
716, 730, 737, 817, 838, 845, 864, 888, 889, 890, 968, 969, 970];
const resp = await axios.get(weaponstatsUrl);
@ -92,6 +94,16 @@
iWeapons = filteredWeapons;
iWeaponsKillsSum = iWeapons.reduce((total, weapon) => total + weapon.kills, 0);
const vIds = [46, 60, 62, 66, 67, 68, 79, 83, 84, 118, 135, 179, 199, 200, 239, 259, 294, 335, 338,
353, 432, 441, 446, 459, 470, 480, 532, 572, 632, 642, 643, 671, 685, 686, 687, 688, 697,
707, 710, 741, 759, 784, 819, 825, 826, 847, 849, 860, 862, 865, 896, 898, 900, 923, 943, 986, 997];
const filteredVehicles = stats.weapons.filter(weapon => {
return vIds.includes(weapon.weapon_id);
});
vehicles = filteredVehicles;
vehicleKillsSum = vehicles.reduce((total, weapon) => total + weapon.kills, 0);
// Reset alert message if needed
alert.message("");
} catch (e) {
@ -163,7 +175,21 @@
{/each}
</tbody>
</table>
<br>
<span style="color:lightgrey;">Kills by Vehicle - Total: </span>{vehicleKillsSum}
<table class="table table-sm table-dark table-responsive-md table-striped table-hover">
<thead class="thead-light">
<th>Vehicle</th>
<th>Kills</th>
</thead>
<tbody>
{#each vehicles as veh}
<tr>
<td>{getWeaponName(veh.weapon_id)}</td>
<td>{veh.kills}</td>
</tr>
{/each}
</tbody>
</table>
<span style="color:lightgrey;">Daily Stats</span>
<table class="table table-sm table-dark table-responsive-md table-striped table-hover">
<thead class="thead-light">

View file

@ -167,6 +167,7 @@
</div>
<div class="tab-pane" id="top" role="tabpanel" aria-labelledby="top-tab">
<span style="color:lightgrey; text-align:center;">Top 50 Characters Most Daily Kills</span>
<table class="table table-sm table-dark table-responsive-md table-striped table-hover">
<thead class="thead-light">
<th>#</th>