Make filesystem list view columns sortable

This commit is contained in:
2025-04-02 15:12:38 +02:00
parent 1d72179672
commit 4b297fec46
11 changed files with 106 additions and 50 deletions

View File

@@ -2,7 +2,7 @@
import { createEventDispatcher } from "svelte";
import { formatDate } from "util/Formatting";
import Modal from "util/Modal.svelte"
import SortButton from "./SortButton.svelte";
import SortButton from "layout/SortButton.svelte";
import { flip } from "svelte/animate";
const dispatch = createEventDispatcher()

View File

@@ -1,7 +1,7 @@
<script>
import { flip } from "svelte/animate";
import { formatDataVolume } from "util/Formatting";
import SortButton from "./SortButton.svelte";
import SortButton from "layout/SortButton.svelte";
export let peers = [];
$: update_peers(peers)

View File

@@ -1,27 +0,0 @@
<script>
export let field = ""
export let active_field = ""
export let asc = true
export let sort_func
</script>
<button class:button_highlight={active_field === field} on:click={() => sort_func(field)}>
{#if active_field === field}
{#if asc}
{:else}
{/if}
{/if}
<slot></slot>
</button>
<style>
button {
display: block;
margin: 0;
line-height: 1em;
width: 100%;
text-align: center;
}
</style>

View File

@@ -2,7 +2,7 @@
import { onMount } from "svelte";
import LoadingIndicator from "util/LoadingIndicator.svelte";
import { formatDataVolume, formatDate } from "util/Formatting";
import SortButton from "admin_panel/SortButton.svelte";
import SortButton from "layout/SortButton.svelte";
export let user_id = ""
let files = []