mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-02-24 07:25:48 +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()))
|
.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());
|
self.target = TargetSelection::NotFound(target_name.to_string());
|
||||||
warn!("Selected target not found");
|
warn!("Selected target not found");
|
||||||
return Ok(());
|
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;
|
let _ = self.server_handle.lock().await.set_target(&target).await;
|
||||||
self.target = TargetSelection::Found(target, ssh_options);
|
self.target = TargetSelection::Found(target, ssh_options);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -148,7 +148,10 @@ async function toggleRole (role: Role) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormGroup floating label="Username">
|
<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>
|
</FormGroup>
|
||||||
|
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
|
|
|
@ -92,3 +92,12 @@ input:-webkit-autofill:focus {
|
||||||
.page-item.active .page-link {
|
.page-item.active .page-link {
|
||||||
text-decoration: underline;
|
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