mirror of
https://github.com/gurucomputing/headscale-ui.git
synced 2026-07-18 00:46:59 +00:00
finish device sorting
This commit is contained in:
parent
7ac3405178
commit
d361cb0182
5 changed files with 9 additions and 15 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import NewDeviceTag from './DeviceTags/NewDeviceTag.svelte';
|
||||
import { Device } from '$lib/common/classes';
|
||||
import { updateTags, getDevices } from '$lib/common/apiFunctions.svelte';
|
||||
import { headscaleDeviceStore, alertStore } from '$lib/common/stores.js';
|
||||
import { alertStore } from '$lib/common/stores.js';
|
||||
export let device = new Device();
|
||||
|
||||
function updateTagsAction(tag: String) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { updateTags, getDevices } from '$lib/common/apiFunctions.svelte';
|
||||
import { Device } from '$lib/common/classes';
|
||||
import { fade } from 'svelte/transition';
|
||||
import { headscaleDeviceStore, alertStore} from '$lib/common/stores.js';
|
||||
import { alertStore } from '$lib/common/stores.js';
|
||||
|
||||
let editingTag = false;
|
||||
let newTag = '';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { fade } from 'svelte/transition';
|
||||
import { Device } from '$lib/common/classes';
|
||||
import { headscaleUserStore, headscaleDeviceStore, alertStore } from '$lib/common/stores';
|
||||
import { headscaleUserStore, alertStore } from '$lib/common/stores';
|
||||
import { moveDevice, getDevices } from '$lib/common/apiFunctions.svelte';
|
||||
|
||||
export let device = new Device();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { fade, slide } from 'svelte/transition';
|
||||
import { getDevices, renameDevice } from '$lib/common/apiFunctions.svelte';
|
||||
import { headscaleDeviceStore, alertStore, headscaleDeviceSortStore, headscaleDeviceSortDirectionStore } from '$lib/common/stores.js';
|
||||
import { alertStore} from '$lib/common/stores.js';
|
||||
import { Device } from '$lib/common/classes';
|
||||
|
||||
let editUserForm: HTMLFormElement;
|
||||
|
|
@ -20,13 +20,7 @@
|
|||
.then((response) => {
|
||||
cardEditing = false;
|
||||
// refresh users after editing
|
||||
getDevices($headscaleDeviceSortStore, $headscaleDeviceSortDirectionStore)
|
||||
.then((devices) => {
|
||||
$headscaleDeviceStore = devices;
|
||||
})
|
||||
.catch((error) => {
|
||||
$alertStore = error;
|
||||
});
|
||||
getDevices();
|
||||
})
|
||||
.catch((error) => {
|
||||
$alertStore = error;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script lang="ts">
|
||||
import { getDevices } from '$lib/common/apiFunctions.svelte';
|
||||
import { headscaleDeviceStore, headscaleDeviceSortDirectionStore, alertStore } from '$lib/common/stores';
|
||||
import { headscaleDeviceSortDirectionStore, headscaleDeviceSortStore } from '$lib/common/stores.js';
|
||||
|
||||
function sortAction() {
|
||||
if ($headscaleDeviceSortDirectionStore == 'ascending') {
|
||||
|
|
@ -34,8 +34,8 @@
|
|||
</button>
|
||||
|
||||
<span class="btn-group">
|
||||
<button class="btn btn-xs btn-active">ID</button>
|
||||
<button class="btn btn-xs capitalize">Device Name</button>
|
||||
<button class="btn btn-xs capitalize">Last Seen</button>
|
||||
<button class:btn-active="{$headscaleDeviceSortStore == 'id'}" on:click="{() => {$headscaleDeviceSortStore = 'id'; getDevices()}}" class="btn btn-xs">ID</button>
|
||||
<button class:btn-active="{$headscaleDeviceSortStore == 'givenName'}" on:click="{() => {$headscaleDeviceSortStore = 'givenName'; getDevices()}}" class="btn btn-xs capitalize">Device Name</button>
|
||||
<button class:btn-active="{$headscaleDeviceSortStore == 'lastSeen'}" on:click="{() => {$headscaleDeviceSortStore = 'lastSeen'; getDevices()}}" class="btn btn-xs capitalize">Last Seen</button>
|
||||
</span>
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue