Make abuse reports scrollable in small screen

This commit is contained in:
2023-11-04 16:57:04 +01:00
parent 611a905da7
commit aa1b24cd71
2 changed files with 38 additions and 34 deletions

View File

@@ -71,44 +71,46 @@ let set_status = async (action, report_type) => {
></iframe> ></iframe>
{/if} {/if}
</div> </div>
<table> <div class="table_scroll">
<tr> <table>
<td>Time</td>
<td>IP</td>
<td>Type</td>
<td>Status</td>
<td colspan="2">Reports from this IP</td>
</tr>
{#each report.reports as user_report}
<tr> <tr>
<td>{formatDate(user_report.time, true, true, false)}</td> <td>Time</td>
<td>{user_report.ip_address}</td> <td>IP</td>
<td>{user_report.type}</td> <td>Type</td>
<td>{user_report.status}</td> <td>Status</td>
<td>{ip_report_count[user_report.ip_address]}</td> <td colspan="2">Reports from this IP</td>
<td>
{#if can_grant}
<button on:click={() => dispatch("resolve_by_ip", {ip: user_report.ip_address, action: "grant"})}>
Accept all
</button>
{/if}
{#if can_reject}
<button on:click={() => dispatch("resolve_by_ip", {ip: user_report.ip_address, action: "reject"})}>
Ignore all
</button>
{/if}
</td>
</tr> </tr>
{#if user_report.description !== ""} {#each report.reports as user_report}
<tr> <tr>
<td>Description</td> <td>{formatDate(user_report.time, true, true, false)}</td>
<td colspan="4" style="white-space: pre;"> <td>{user_report.ip_address}</td>
{user_report.description} <td>{user_report.type}</td>
<td>{user_report.status}</td>
<td>{ip_report_count[user_report.ip_address]}</td>
<td>
{#if can_grant}
<button on:click={() => dispatch("resolve_by_ip", {ip: user_report.ip_address, action: "grant"})}>
Accept all
</button>
{/if}
{#if can_reject}
<button on:click={() => dispatch("resolve_by_ip", {ip: user_report.ip_address, action: "reject"})}>
Ignore all
</button>
{/if}
</td> </td>
</tr> </tr>
{/if} {#if user_report.description !== ""}
{/each} <tr>
</table> <td>Description</td>
<td colspan="5" style="white-space: pre-wrap; word-wrap: break-word;">
{user_report.description}
</td>
</tr>
{/if}
{/each}
</table>
</div>
</div> </div>
</Expandable> </Expandable>

View File

@@ -139,7 +139,7 @@ const remove_report = (id = "") => {
// If a refresh is already scheduled we remove it and schedule a new one // If a refresh is already scheduled we remove it and schedule a new one
clearTimeout(refresh_timeout) clearTimeout(refresh_timeout)
refresh_timeout = setTimeout(get_reports, 5000) refresh_timeout = setTimeout(get_reports, 10000)
} }
onMount(() => { onMount(() => {
@@ -151,6 +151,8 @@ onMount(() => {
endPicker.valueAsNumber = end.getTime() endPicker.valueAsNumber = end.getTime()
get_reports() get_reports()
return () => clearTimeout(refresh_timeout)
}); });
</script> </script>