Merge branch 'pr/445'

This commit is contained in:
Eugene Pankov 2022-11-02 19:36:33 +01:00
commit e083dbc38f
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
3 changed files with 19 additions and 2 deletions

View file

@ -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(())

View file

@ -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">

View file

@ -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;
}