Skip to content

Commit

Permalink
fill in proxy form with existing data
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Oct 20, 2023
1 parent 0368f73 commit dea9609
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src-theme/proxymanager/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,25 @@ <h2>Proxy Details</h2>
}

function refresh() {
document.getElementById('proxy').innerText = client.getProxyManager().getCurrentProxy();
let proxy = client.getProxyManager().getCurrentProxy();

if (proxy != null) {
document.getElementById('proxy').innerText = proxy.getHost() + ":" + proxy.getPort();

// Fill in input fields
document.getElementById('host').value = proxy.getHost();
document.getElementById('port').value = proxy.getPort();

let creds = proxy.getCredentials();
if (creds != null) {
document.getElementById('username').value = creds.getUsername();
document.getElementById('password').value = creds.getPassword();
}
} else {
document.getElementById('proxy').innerText = "No proxy.";
}


document.getElementById('location').innerText = client.getSessionService().getLocation();
}

Expand Down

0 comments on commit dea9609

Please sign in to comment.