good progress

This commit is contained in:
2021-05-23 16:55:57 +02:00
parent 90ea2174db
commit fb7ade79cb
12 changed files with 671 additions and 189 deletions

View File

@ -0,0 +1,172 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
{{ player.guid }} - {{ player.name }}
</title>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
crossorigin="anonymous"
/>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/css/theme.bootstrap_4.min.css"
integrity="sha512-2C6AmJKgt4B+bQc08/TwUeFKkq8CsBNlTaNcNgUmsDJSU1Fg+R6azDbho+ZzuxEkJnCjLZQMozSq3y97ZmgwjA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
</head>
<body>
<main class="container">
<div class="row">
<div class="col">
<table class="table table-sm table-borderless">
<tbody>
<tr>
<th scope="row">guid</th>
<td>
<a href="https://steamcommunity.com/profiles/{{ player.guid }}" target="_blank">
{{ player.guid }}
</a>
</td>
<tr>
<th scope="row">name</th>
<td>{{ player.name }}</td>
<tr>
<th scope="row">first_seen</th>
<td>{{ player.first_seen }}</td>
<tr>
<th scope="row">last_seen</th>
<td>{{ player.last_seen }}</td>
<tr>
<th scope="row">playtime</th>
<td>{{ player.playtime | to_duration }}</td>
<tr>
<th scope="row">chats</th>
<td>{{ player.chats }}</td>
<tr>
<th scope="row">deaths</th>
<td>{{ player.deaths }}</td>
<tr>
<th scope="row">kills</th>
<td>{{ player.kills }}</td>
<tr>
<th scope="row">voicetime</th>
<td>{{ player.voicetime | to_duration }}</td>
</tbody>
</table>
</div>
<div class="col">
<table class="table table-striped tablesorter" id="playerNamesTable">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col" class="sorter-duration">Time</th>
</tr>
</thead>
<tbody>
{%- for name in player.names %}
<tr>
<th scope="row">{{ name.name }}</th>
<td>{{ (name.time * 0.015) | to_duration }}</td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
<div class="col">
<table class="table table-striped" id="playerSpraysTable">
<thead>
<tr>
<th scope="col">Spray</th>
</tr>
</thead>
<tbody>
{%- for spray in player.sprays %}
<tr>
<th scope="row">{{ spray.spray }}</th>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
</div>
<div class="row">
<h3>Sessions</h3>
<table class="table table-striped tablesorter" id="playerSessionsTable">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col" class="sorter-isoDate">Time</th>
<th scope="col" class="sorter-duration">Length</th>
<th scope="col">Map</th>
<th scope="col" class="sorter-duration">Playtime</th>
<th scope="col">Chats</th>
<th scope="col" class="sorter-duration">Voicetime</th>
</tr>
</thead>
<tbody>
{%- for session in player_sessions %}
<tr>
<th scope="row">
<a href="{{ url_for('views.session', session_id=session.session.id) }}#{{ player.guid }}">
{{ session.session.id }}
</a>
</th>
<td>{{ session.session.time.isoformat(' ') }}</td>
<td>{{ session.session.length | to_duration }}</td>
<td>{{ session.session.mapname }}</td>
<td>{{ session.playtime | to_duration }}</td>
<td>{{ session.chats }}</td>
<td>{{ session.voicetime | to_duration }}</td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
</main>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.min.js"
integrity="sha512-qzgd5cYSZcosqpzpn7zF2ZId8f/8CHmFKZ8j7mU4OUXTNRd5g+ZHBPsgKEwoqxCtdQvExE5LprwwPAgoicguNg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/parsers/parser-duration.min.js"
integrity="sha512-X7QJLLEO6yg8gSlmgRAP7Ec2qDD+ndnFcd8yagZkkN5b/7bCMbhRQdyJ4SjENUEr+4eBzgwvaFH5yR/bLJZJQA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script type="text/javascript">
$(function() {
$("#playerNamesTable").tablesorter({
theme: "bootstrap"
});
$("#playerSessionsTable").tablesorter({
theme: "bootstrap"
});
});
</script>
</body>
</html>

View File

@ -16,99 +16,113 @@
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4">
<div class="container-fluid">
<a class="navbar-brand" href="#">Top navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav me-auto mb-2 mb-md-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<main>
<main class="container-fluid">
<div class="btn-toolbar" role="toolbar">
<div class="btn-group me-2" role="group">
<button type="button" class="btn-pause btn btn-outline-warning" title="Pause">
<i class="fas fa-pause"></i>
</button>
<button type="button" class="btn-play btn btn-outline-success" title="Play">
<i class="fas fa-play"></i>
</button>
<button type="button" class="btn-stop btn btn-outline-danger" title="Stop">
<i class="fas fa-stop"></i>
</button>
<button
type="button"
class="btn-rewind btn btn-outline-success"
title="Rewind"
>
<i class="fas fa-fast-backward"></i>
</button>
<button
type="button"
class="btn-fast-forward btn btn-outline-success"
title="Fast forward"
>
<i class="fas fa-fast-forward"></i>
</button>
</div>
<div class="btn-group me-2" role="group">
<button type="button" title="Zoom in" class="btn-zoom-in btn btn-outline-dark">
<i class="fas fa-search-plus" aria-hidden="true"></i>
</button>
<button type="button" title="Zoom out" class="btn-zoom-out btn btn-outline-dark">
<i class="fas fa-search-minus" aria-hidden="true"></i>
</button>
</div>
<div class="btn-group me-2">
<div style="margin: 6px">
<input
type="range"
min="0"
max="100"
value="50"
class="master-gain form-range mw-50"
id="master-gain"
/>
<div class="d-flex flex-column flex-grow-1">
<div class="btn-toolbar" role="toolbar" style="min-width: max-content;">
<div class="btn-group me-2" role="group">
<button type="button" class="btn-pause btn btn-outline-warning" title="Pause">
<i class="fas fa-pause"></i>
</button>
<button type="button" class="btn-play btn btn-outline-success" title="Play">
<i class="fas fa-play"></i>
</button>
<button type="button" class="btn-stop btn btn-outline-danger" title="Stop">
<i class="fas fa-stop"></i>
</button>
<button
type="button"
class="btn-rewind btn btn-outline-success"
title="Rewind"
>
<i class="fas fa-fast-backward"></i>
</button>
<button
type="button"
class="btn-fast-forward btn btn-outline-success"
title="Fast forward"
>
<i class="fas fa-fast-forward"></i>
</button>
</div>
<div style="margin: 6px">
<span class="audio-pos" aria-label="Audio position">00:00:00.0</span>
<div class="btn-group me-2" role="group">
<button type="button" title="Zoom in" class="btn-zoom-in btn btn-outline-dark">
<i class="fas fa-search-plus" aria-hidden="true"></i>
</button>
<button type="button" title="Zoom out" class="btn-zoom-out btn btn-outline-dark">
<i class="fas fa-search-minus" aria-hidden="true"></i>
</button>
</div>
<div style="margin: 6px">
<span class="audio-pos-2" aria-label="Audio position">00:00:00.0</span>
<div class="btn-group me-2">
<div style="margin: 6px">
<input
type="range"
min="0"
max="100"
value="50"
class="master-gain form-range mw-50"
id="master-gain"
/>
</div>
</div>
<div class="form-check form-switch">
<input class="form-check-input automatic-scroll" type="checkbox" id="automatic_scroll" checked>
<label class="form-check-label" for="automatic_scroll">Autoscroll</label>
<div class="btn-group me-2">
<div style="margin: 6px">
<span class="audio-pos font-monospace" aria-label="Audio position">00:00:00.0</span>
</div>
<div style="margin: 6px">
<span class="audio-pos-2 font-monospace" aria-label="Audio position">00:00:00.0</span>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="autoscroll_voice" checked>
<label class="form-check-label" for="autoscroll_voice">Voice</label>
</div>
<div class="form-check form-switch">
<label class="form-check-label" for="autoscroll_chat">Chat</label>
<input class="form-check-input" type="checkbox" id="autoscroll_chat" checked>
</div>
</div>
<div class="btn-group me-2">
<button type="button" title="Download the selection as Wav file" class="btn btn-download btn-outline-primary">
<i class="fas fa-download" aria-hidden="true"></i>
</button>
</div>
</div>
<div class="overflow-auto" id="playlist">
</div>
</div>
<div id="playlist">
<div class="d-flex flex-column overflow-auto" id="chat">
<table class="table table-sm text-nowrap">
<thead>
<tr>
<th scope="col">Time</th>
<th scope="col">SteamID</th>
<th scope="col">Name</th>
<th scope="col">Message</th>
</tr>
</thead>
<tbody>
{%- for chat in chats %}
<tr>
<td onclick="jumpToGameTick({{ chat.tick }})">
{{ (chat.tick * session.tickinterval) | to_duration }}
</td>
<td>{{ chat.player_guid }}</td>
<td>{{ chat.name }}</td>
<td>{{ chat.chat }}</td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
</main>
@ -154,7 +168,7 @@ var g_events = [
playlist.load([
{%- for guid, psess in player_sessions.items() %}
{%- if psess.voicetime > 0 %}
{src: "/static/css-ze-parsed/{{ session.demoname }}/voice/{{ guid }}.demopus", name: "{{ guid }}"},
{src: "/static/css-ze-parsed/{{ session.demoname }}/voice/{{ guid }}.demopus", name: "{{ guid }}", info: "{{ psess.player.name }}"},
{%- endif -%}
{% endfor %}
]).then(function() {