huashengdun / webssh

:seedling: Web based ssh client
https://webssh.huashengdun.org/
MIT License
4.57k stars 1.31k forks source link

Set default hostname on form without specifying a username or logging in #395

Open abcbarryn opened 1 month ago

abcbarryn commented 1 month ago

If I add ?hostname=foo to the URL the hostname does not populate in the webform unless I do ?hostname=foo&username=bar but then it automatically attempt to login once and fails because there is no password. I would like to be able to pass a default hostname but leave the username field blank and wait for the user to fill in the form before attempting to login.

abcbarryn commented 1 month ago

I edited main.js and commented out these 3 lines and that seems to give me the exact behavior that I want...

//    if (!username) {
//      errors.push('Value of username is required.');
//    }