mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-01-20 01:34:47 +00:00
display tweaks
This commit is contained in:
parent
8fc23cc6e4
commit
093636fc6d
|
|
@ -9,15 +9,25 @@ class GameController {
|
|||
|
||||
const pageTitle = `Latest Games`;
|
||||
|
||||
const gamesQry = await Database.raw(`
|
||||
SELECT distinct game_id,map,gametype, datestamp
|
||||
FROM games
|
||||
WHERE (stats->>'score' IS NOT NULL) AND (game_id <> 0)
|
||||
ORDER BY game_id desc
|
||||
LIMIT 2000;
|
||||
`);
|
||||
// const gamesQry = await Database.raw(`
|
||||
// SELECT distinct game_id,map,gametype, datestamp
|
||||
// FROM games
|
||||
// WHERE (stats->>'score' IS NOT NULL) AND (game_id <> 0)
|
||||
// ORDER BY game_id desc
|
||||
// LIMIT 2000;
|
||||
// `);
|
||||
|
||||
|
||||
const gamesQry = await Database.raw(`
|
||||
WITH gamelist AS (
|
||||
SELECT DISTINCT p.game_id, p.map, p.gametype, p.datestamp, count(*) OVER (PARTITION BY game_id) as count from games p
|
||||
)
|
||||
SELECT * from gamelist
|
||||
WHERE (count > 1) AND (game_id <> 0)
|
||||
ORDER BY game_id desc
|
||||
LIMIT 2000
|
||||
`);
|
||||
|
||||
// filter out duplicate game_ids (https://dev.to/marinamosti/removing-duplicates-in-an-array-of-objects-in-js-with-sets-3fep)
|
||||
const games = gamesQry.rows.reduce((game, current) => {
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class PlayerController {
|
|||
'gametype',
|
||||
'stats')
|
||||
.where({ player_guid: request.params.player_guid })
|
||||
.orderBy('game_id', 'desc')
|
||||
.limit(50)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,12 +14,41 @@
|
|||
@endif
|
||||
</head>
|
||||
<body class="antialiased font-sans bg-gray-200">
|
||||
|
||||
<div id="popup" class="relative bg-indigo-600">
|
||||
<div class="max-w-screen-xl mx-auto py-3 px-3 sm:px-6 lg:px-8">
|
||||
<div class="pr-16 sm:text-center sm:px-16">
|
||||
<p class="font-medium text-white">
|
||||
Hey! This is a preview. Things aren't quite finished yet. Stay tuned!
|
||||
</p>
|
||||
</div>
|
||||
<div class="absolute inset-y-0 right-0 pt-1 pr-1 flex items-start sm:pt-1 sm:pr-2 sm:items-start">
|
||||
<button type="button" class="flex p-2 rounded-md hover:bg-indigo-500 focus:outline-none focus:bg-indigo-500 transition ease-in-out duration-150" onclick="closePopUp()">
|
||||
<svg class="h-6 w-6 text-white" stroke="currentColor" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{{ startTag }}}
|
||||
|
||||
{{-- {{ edgeVar }} --}}
|
||||
@if(node_env().env === "production" || node_env().hmr === "false")
|
||||
{{ script(versionjs('app')) }}
|
||||
@else
|
||||
{{ script('http://localhost:8081/dist/js/app.js') }}
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function closePopUp(){
|
||||
document.getElementById("popup").remove();
|
||||
};
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in a new issue