feat: migrate rcon historical storage to postgres

This commit is contained in:
devRaGonSa
2026-05-21 08:18:45 +02:00
parent b3691e5271
commit 239595052e
19 changed files with 1658 additions and 92 deletions

View File

@@ -39,18 +39,15 @@
}
.historical-player-row {
cursor: pointer;
outline: 0;
}
.historical-player-row:hover td,
.historical-player-row:focus td,
.historical-player-row:focus-within td,
.historical-player-row.is-expanded td {
background: rgba(210, 182, 118, 0.06);
}
.historical-player-row:focus-visible td,
.historical-player-row__details-button:focus-visible {
outline: 2px solid rgba(210, 182, 118, 0.78);
outline-offset: -2px;
@@ -99,11 +96,6 @@
display: none;
}
.historical-player-row:hover + .historical-player-detail-row,
.historical-player-row:focus + .historical-player-detail-row,
.historical-player-row:focus-within + .historical-player-detail-row,
.historical-player-detail-row:hover,
.historical-player-detail-row:focus-within,
.historical-player-detail-row.is-open {
display: table-row;
}

View File

@@ -230,9 +230,6 @@ function renderPlayerRows(player, item, index) {
<tr
class="historical-player-row historical-player-row--${team.key}"
id="${escapeHtml(rowId)}"
tabindex="0"
aria-controls="${escapeHtml(panelId)}"
aria-expanded="false"
>
<td>
<button
@@ -270,31 +267,35 @@ function renderPlayerRows(player, item, index) {
}
function bindPlayerDetailRows(playersBody) {
playersBody.querySelectorAll(".historical-player-row").forEach((row) => {
const playerRows = [...playersBody.querySelectorAll(".historical-player-row")];
const collapseRow = (row) => {
const button = row.querySelector(".historical-player-row__details-button");
const detailRow = row.nextElementSibling;
if (!button || !detailRow?.classList.contains("historical-player-detail-row")) {
return;
}
row.classList.remove("is-expanded");
detailRow.classList.remove("is-open");
button.setAttribute("aria-expanded", "false");
};
playerRows.forEach((row) => {
const button = row.querySelector(".historical-player-row__details-button");
const detailRow = row.nextElementSibling;
if (!button || !detailRow?.classList.contains("historical-player-detail-row")) {
return;
}
const setExpanded = (expanded) => {
if (expanded) {
playerRows.filter((candidate) => candidate !== row).forEach(collapseRow);
}
row.classList.toggle("is-expanded", expanded);
detailRow.classList.toggle("is-open", expanded);
row.setAttribute("aria-expanded", String(expanded));
button.setAttribute("aria-expanded", String(expanded));
};
const toggleExpanded = () => setExpanded(!detailRow.classList.contains("is-open"));
row.addEventListener("click", (event) => {
if (event.target.closest("a")) {
return;
}
toggleExpanded();
});
row.addEventListener("keydown", (event) => {
if (event.key !== "Enter" && event.key !== " ") {
return;
}
event.preventDefault();
button.addEventListener("click", () => {
toggleExpanded();
});
});

View File

@@ -74,16 +74,11 @@
const serverName = item?.server?.name || "Servidor no disponible";
const closedAt = item?.closed_at || item?.ended_at || item?.started_at;
const detailUrl = buildDynamicInternalMatchDetailUrl(item);
const externalUrl = normalizeDynamicExternalMatchUrl(item?.match_url);
const actionLinks = [
`<span class="historical-match-card__result">${escapeDynamicHtml(formatDynamicResultLabel(item?.result))}</span>`,
detailUrl
? `<a class="historical-match-card__link" href="${escapeDynamicHtml(detailUrl)}">Ver detalles</a>`
: "",
externalUrl
? `<a class="historical-match-card__link historical-match-card__link--scoreboard" href="${escapeDynamicHtml(externalUrl)}" target="_blank" rel="noopener noreferrer">Ver partida</a>`
: "",
].join("");
return `

View File

@@ -802,7 +802,6 @@ function hydrateMvpComparison(
function renderRecentMatchCard(item) {
const mapName = item.map?.pretty_name || item.map?.name || "Mapa no disponible";
const matchUrl = normalizeExternalMatchUrl(item.match_url);
const detailUrl = buildInternalMatchDetailUrl(item);
const actionLinks = [
`<span class="historical-match-card__result">${escapeHtml(formatMatchResult(item.result))}</span>`,
@@ -816,18 +815,6 @@ function renderRecentMatchCard(item) {
</a>
`
: "",
matchUrl
? `
<a
class="historical-match-card__link historical-match-card__link--scoreboard"
href="${escapeHtml(matchUrl)}"
target="_blank"
rel="noopener noreferrer"
>
Ver partida
</a>
`
: "",
].join("");
return `
<article class="historical-match-card historical-match-card--clean">

View File

@@ -316,10 +316,12 @@ function normalizeServerRegion(value) {
.toLowerCase();
const placeholderValues = new Set([
"region pendiente",
"region pending",
"pending",
"unknown",
"desconocida",
"no disponible",
"por confirmar",
"n/a",
]);
return placeholderValues.has(normalizedValue) ? "" : trimmedValue;