mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-02-23 23:16:27 +08:00
Merge branch 'pr/445'
This commit is contained in:
commit
e083dbc38f
3 changed files with 19 additions and 2 deletions
|
@ -1472,12 +1472,17 @@ impl ServerSession {
|
|||
.map(|(t, opt)| (t.clone(), opt.clone()))
|
||||
};
|
||||
|
||||
let Some((target, ssh_options)) = target else {
|
||||
let Some((target, mut ssh_options)) = target else {
|
||||
self.target = TargetSelection::NotFound(target_name.to_string());
|
||||
warn!("Selected target not found");
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
// Forward username from the authenticated user to the target, if target has no username
|
||||
if ssh_options.username.is_empty() {
|
||||
ssh_options.username = username.to_string();
|
||||
}
|
||||
|
||||
let _ = self.server_handle.lock().await.set_target(&target).await;
|
||||
self.target = TargetSelection::Found(target, ssh_options);
|
||||
Ok(())
|
||||
|
|
|
@ -148,7 +148,10 @@ async function toggleRole (role: Role) {
|
|||
</div>
|
||||
|
||||
<FormGroup floating label="Username">
|
||||
<input class="form-control" bind:value={target.options.username} />
|
||||
<input class="form-control"
|
||||
placeholder="Use the currently logged in user's name"
|
||||
bind:value={target.options.username}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<div class="d-flex">
|
||||
|
|
|
@ -92,3 +92,12 @@ input:-webkit-autofill:focus {
|
|||
.page-item.active .page-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
// Fix placeholder text with floating FormGroup labels
|
||||
.form-floating>.form-control::placeholder {
|
||||
color: revert;
|
||||
}
|
||||
|
||||
.form-floating>.form-control:not(:focus)::placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue