WebHost: Use B64encoded UUIDs for links.

Warning: This will break old links
This commit is contained in:
Fabian Dill
2020-07-27 05:04:49 +02:00
parent 63cbdb9449
commit 8696ee4c9e
6 changed files with 50 additions and 31 deletions

View File

@@ -1,19 +1,22 @@
{% extends 'layout.html' %}
{% block head %}
<title>Multiworld {{ room.id }}</title>
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("host_room.css") }}" />
<title>Multiworld {{ room.id|suuid }}</title>
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("host_room.css") }}"/>
{% endblock %}
{% block body %}
<div id="host-room">
{% if room.owner == session["_id"] %}
Room created from <a href="{{ url_for("view_seed", seed=room.seed.id) }}">Seed #{{ room.seed.id }}</a><br>
Room created from <a href="{{ url_for("view_seed", seed=room.seed.id) }}">Seed #{{ room.seed.id|suuid }}</a>
<br>
{% endif %}
{% if room.tracker %}
This room has a <a href="{{ url_for("get_tracker", tracker=room.tracker) }}">Multiworld Tracker</a> enabled.<br>
This room has a <a href="{{ url_for("get_tracker", tracker=room.tracker) }}">Multiworld Tracker</a> enabled.
<br>
{% endif %}
This room will be closed after {{ room.timeout//60//60 }} hours of inactivity. Should you wish to continue later,
This room will be closed after {{ room.timeout//60//60 }} hours of inactivity. Should you wish to continue
later,
you can simply refresh this page and the server will be started again.<br>
{% if room.owner == session["_id"] %}
<form method=post>

View File

@@ -1,7 +1,7 @@
{% macro list_rooms(rooms) -%}
<ul>
{% for room in rooms %}
<li><a href="{{ url_for("host_room", room=room.id) }}">Room #{{ room.id }}</a></li>
<li><a href="{{ url_for("host_room", room=room.id) }}">Room #{{ room.id|suuid }}</a></li>
{% endfor %}
{{ caller() }}
</ul>

View File

@@ -36,8 +36,9 @@
<tbody>
{% for room in rooms %}
<tr>
<td><a href="{{ url_for("view_seed", seed=room.seed.id) }}">{{ room.seed.id }}</a></td>
<td><a href="{{ url_for("host_room", room=room.id) }}">{{ room.id }}</a></td>
<td><a href="{{ url_for("view_seed", seed=room.seed.id) }}">{{ room.seed.id|suuid }}</a>
</td>
<td><a href="{{ url_for("host_room", room=room.id) }}">{{ room.id|suuid }}</a></td>
<td>{{ room.seed.multidata.names[0]|length }} Total:
{{ room.seed.multidata.names[0]|join(", ")|truncate(256, False, " ...") }}</td>
<td>{{ room.creation_time.strftime("%Y-%m-%d %H:%M") }}</td>

View File

@@ -2,9 +2,9 @@
{% import "macros.html" as macros %}
{% block head %}
<title>Multiworld Seed {{ seed.id }}</title>
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("view_seed.css") }}" />
<script type="application/ecmascript" src="{{ static_autoversion("view_seed.js") }}" ></script>
<title>Multiworld Seed {{ seed.id|suuid }}</title>
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("view_seed.css") }}"/>
<script type="application/ecmascript" src="{{ static_autoversion("view_seed.js") }}"></script>
{% endblock %}
{% block body %}
@@ -13,19 +13,19 @@
<h3>Seed Info</h3>
<table>
<tbody>
<tr>
<td>Seed:&nbsp;</td>
<td>{{ seed.id }}</td>
</tr>
<tr>
<td>Created:&nbsp;</td>
<td id="creation-time" data-creation-time="{{ seed.creation_time }}"></td>
</tr>
<tr>
<td>Players:&nbsp;</td>
<td>
<ul>
{% for team in seed.multidata["names"] %}
<tr>
<td>Seed:&nbsp;</td>
<td>{{ seed.id|suuid }}</td>
</tr>
<tr>
<td>Created:&nbsp;</td>
<td id="creation-time" data-creation-time="{{ seed.creation_time }}"></td>
</tr>
<tr>
<td>Players:&nbsp;</td>
<td>
<ul>
{% for team in seed.multidata["names"] %}
<li>Team #{{ loop.index }} - {{ team | length }}
<ul>
{% for player in team %}