mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-09-07 23:25:13 +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">
|
<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 AsyncButton from 'common/AsyncButton.svelte'
|
||||||
import ConnectionInstructions from 'common/ConnectionInstructions.svelte'
|
import ConnectionInstructions from 'common/ConnectionInstructions.svelte'
|
||||||
import { TargetKind } from 'gateway/lib/api'
|
import { TargetKind } from 'gateway/lib/api'
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
let { params }: Props = $props()
|
let { params }: Props = $props()
|
||||||
|
|
||||||
let error: string|undefined = $state()
|
let error: string|undefined = $state()
|
||||||
let selectedUser: User|undefined = $state()
|
let selectedUsername: string|undefined = $state($serverInfo?.username)
|
||||||
let target: Target | undefined = $state()
|
let target: Target | undefined = $state()
|
||||||
let roleIsAllowed: Record<string, any> = $state({})
|
let roleIsAllowed: Record<string, any> = $state({})
|
||||||
let connectionsInstructionsModalOpen = $state(false)
|
let connectionsInstructionsModalOpen = $state(false)
|
||||||
|
@ -86,9 +86,9 @@
|
||||||
<Loadable promise={api.getUsers()}>
|
<Loadable promise={api.getUsers()}>
|
||||||
{#snippet children(users)}
|
{#snippet children(users)}
|
||||||
<FormGroup floating label="Select a user">
|
<FormGroup floating label="Select a user">
|
||||||
<select bind:value={selectedUser} class="form-control">
|
<select bind:value={selectedUsername} class="form-control">
|
||||||
{#each users as user}
|
{#each users as user (user.id)}
|
||||||
<option value={user}>
|
<option value={user.username}>
|
||||||
{user.username}
|
{user.username}
|
||||||
</option>
|
</option>
|
||||||
{/each}
|
{/each}
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
|
|
||||||
<ConnectionInstructions
|
<ConnectionInstructions
|
||||||
targetName={target.name}
|
targetName={target.name}
|
||||||
username={selectedUser?.username}
|
username={selectedUsername}
|
||||||
targetKind={{
|
targetKind={{
|
||||||
Ssh: TargetKind.Ssh,
|
Ssh: TargetKind.Ssh,
|
||||||
WebAdmin: TargetKind.WebAdmin,
|
WebAdmin: TargetKind.WebAdmin,
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
<Loadable promise={loadRoles()}>
|
<Loadable promise={loadRoles()}>
|
||||||
{#snippet children(roles)}
|
{#snippet children(roles)}
|
||||||
<div class="list-group list-group-flush mb-3">
|
<div class="list-group list-group-flush mb-3">
|
||||||
{#each roles as role}
|
{#each roles as role (role.id)}
|
||||||
<label
|
<label
|
||||||
for="role-{role.id}"
|
for="role-{role.id}"
|
||||||
class="list-group-item list-group-item-action d-flex align-items-center"
|
class="list-group-item list-group-item-action d-flex align-items-center"
|
||||||
|
|
Loading…
Add table
Reference in a new issue