mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-09-06 22:55:24 +08:00
This commit is contained in:
parent
90b0aaf137
commit
7e217d5f89
1 changed files with 7 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { api, type Role, type Target, type User } from 'admin/lib/api'
|
||||
import { api, type Role, type Target } from 'admin/lib/api'
|
||||
import AsyncButton from 'common/AsyncButton.svelte'
|
||||
import ConnectionInstructions from 'common/ConnectionInstructions.svelte'
|
||||
import { TargetKind } from 'gateway/lib/api'
|
||||
|
@ -20,7 +20,7 @@
|
|||
let { params }: Props = $props()
|
||||
|
||||
let error: string|undefined = $state()
|
||||
let selectedUser: User|undefined = $state()
|
||||
let selectedUsername: string|undefined = $state($serverInfo?.username)
|
||||
let target: Target | undefined = $state()
|
||||
let roleIsAllowed: Record<string, any> = $state({})
|
||||
let connectionsInstructionsModalOpen = $state(false)
|
||||
|
@ -86,9 +86,9 @@
|
|||
<Loadable promise={api.getUsers()}>
|
||||
{#snippet children(users)}
|
||||
<FormGroup floating label="Select a user">
|
||||
<select bind:value={selectedUser} class="form-control">
|
||||
{#each users as user}
|
||||
<option value={user}>
|
||||
<select bind:value={selectedUsername} class="form-control">
|
||||
{#each users as user (user.id)}
|
||||
<option value={user.username}>
|
||||
{user.username}
|
||||
</option>
|
||||
{/each}
|
||||
|
@ -100,7 +100,7 @@
|
|||
|
||||
<ConnectionInstructions
|
||||
targetName={target.name}
|
||||
username={selectedUser?.username}
|
||||
username={selectedUsername}
|
||||
targetKind={{
|
||||
Ssh: TargetKind.Ssh,
|
||||
WebAdmin: TargetKind.WebAdmin,
|
||||
|
@ -208,7 +208,7 @@
|
|||
<Loadable promise={loadRoles()}>
|
||||
{#snippet children(roles)}
|
||||
<div class="list-group list-group-flush mb-3">
|
||||
{#each roles as role}
|
||||
{#each roles as role (role.id)}
|
||||
<label
|
||||
for="role-{role.id}"
|
||||
class="list-group-item list-group-item-action d-flex align-items-center"
|
||||
|
|
Loading…
Add table
Reference in a new issue