fix undocumented headscale ui change

This commit is contained in:
Chris Bisset 2025-07-11 23:59:10 +00:00
parent 15c4dd9575
commit c55492acba
3 changed files with 5 additions and 5 deletions

View file

@ -464,7 +464,7 @@
});
}
export async function moveDevice(deviceID: string, user: string): Promise<any> {
export async function moveDevice(deviceID: string, userID: string): Promise<any> {
// variables in local storage
let headscaleURL = localStorage.getItem('headscaleURL') || '';
@ -480,7 +480,7 @@
Authorization: `Bearer ${headscaleAPIKey}`
},
body: JSON.stringify({
user: user
user: parseInt(userID)
})
})
.then((response) => {

View file

@ -10,7 +10,7 @@ export class Device {
public approvedRoutes: string[] = [];
public availableRoutes: string[] = [];
public subnetRoutes: string[] = [];
public user: { name: string } = { name: '' };
public user: User = new User();
public online?: boolean;
public constructor(init?: Partial<Device>) {

View file

@ -6,7 +6,7 @@
export let device = new Device();
let deviceMoving = false;
let selectedUser = device.user.name;
let selectedUser = device.user.id;
function moveDeviceAction() {
moveDevice(device.id, selectedUser)
@ -39,7 +39,7 @@
<form on:submit|preventDefault={moveDeviceAction}>
<select class="card-select mr-3" required bind:value={selectedUser}>
{#each $userStore as user}
<option>{user.name}</option>
<option value={user.id}>{user.name}</option>
{/each}
</select>
<!-- edit accept symbol -->