Makes tables scrollable

This commit is contained in:
2021-09-21 23:12:55 +02:00
parent 2d70f11936
commit fb26f17fb8
5 changed files with 109 additions and 91 deletions

View File

@@ -331,8 +331,18 @@ table:not(.form) {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
} }
.table_scroll {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
}
.table_scroll > table {
min-width: 100%;
}
tr:not(.form) {border-bottom: 1px var(--layer_2_color_border) solid;} tr:not(.form) {border-bottom: 1px var(--layer_2_color_border) solid;}
tr > td, tr > th {padding: 0.4em;} tr > td, tr > th {padding: 0.3em 0.6em;}
@media(max-width: 30em) { @media(max-width: 30em) {
/* Forms will be stacked on small screens */ /* Forms will be stacked on small screens */
tr.form > td { tr.form > td {

View File

@@ -133,6 +133,7 @@ onMount(get_reporters);
<br/> <br/>
<div class="table_scroll">
<table style="text-align: left;"> <table style="text-align: left;">
<tr> <tr>
<td>E-mail</td> <td>E-mail</td>
@@ -160,6 +161,7 @@ onMount(get_reporters);
{/each} {/each}
</table> </table>
</div> </div>
</div>
<style> <style>
.spinner_container { .spinner_container {

View File

@@ -139,6 +139,7 @@ onMount(get_bans);
<br/> <br/>
<div class="table_scroll">
<table style="text-align: left;"> <table style="text-align: left;">
<tr> <tr>
<td>Address</td> <td>Address</td>
@@ -156,7 +157,7 @@ onMount(get_bans);
<td>{formatDate(row.expire_time, true, true, false)}</td> <td>{formatDate(row.expire_time, true, true, false)}</td>
<td>{row.offences}</td> <td>{row.offences}</td>
<td> <td>
<button on:click|preventDefault={() => {delete_ban(row.address)}} class="button button_red"> <button on:click|preventDefault={() => {delete_ban(row.address)}} class="button button_red round">
<i class="icon">delete</i> <i class="icon">delete</i>
</button> </button>
</td> </td>
@@ -164,6 +165,7 @@ onMount(get_bans);
{/each} {/each}
</table> </table>
</div> </div>
</div>
<style> <style>
.spinner_container { .spinner_container {

View File

@@ -112,6 +112,7 @@ const logout = async (key) => {
your keys. your keys.
</p> </p>
</div> </div>
<div class="table_scroll">
<table style="text-align: left;"> <table style="text-align: left;">
<tr> <tr>
<td>Key</td> <td>Key</td>
@@ -127,7 +128,7 @@ const logout = async (key) => {
<td>{formatDate(row.last_used_time, true, true, false)}</td> <td>{formatDate(row.last_used_time, true, true, false)}</td>
<td>{row.creation_ip_address}</td> <td>{row.creation_ip_address}</td>
<td> <td>
<button on:click|preventDefault={() => {logout(row.auth_key)}} class="button button_red"> <button on:click|preventDefault={() => {logout(row.auth_key)}} class="button button_red round">
<i class="icon">delete</i> <i class="icon">delete</i>
</button> </button>
</td> </td>
@@ -138,6 +139,7 @@ const logout = async (key) => {
{/each} {/each}
</table> </table>
</div> </div>
</div>
<style> <style>
.spinner_container { .spinner_container {

View File

@@ -24,6 +24,7 @@ onMount(() => {
</script> </script>
<div> <div>
<div class="tab_bar">
<a class="button tab" <a class="button tab"
href="/user" href="/user"
class:button_highlight={page === ""} class:button_highlight={page === ""}
@@ -45,6 +46,7 @@ onMount(() => {
<i class="icon">vpn_key</i> <i class="icon">vpn_key</i>
API keys API keys
</a> </a>
</div>
<hr/> <hr/>
{#if page === ""} {#if page === ""}