Compare commits
2
Commits
ea0c7e21f8
...
0612395bbf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0612395bbf | ||
|
|
16b6fbeaf6 |
@@ -238,13 +238,13 @@
|
||||
|
||||
<div style="border:1px solid #1E1E2E;border-radius:6px;padding:10px;">
|
||||
<div style="color:#E0E0F0;font-weight:600;margin-bottom:6px;">HTTP-Basic</div>
|
||||
<input id="dc-http-user" placeholder="Benutzer" style="width:100%;margin-bottom:4px;">
|
||||
<input id="dc-http-user" placeholder="Benutzer (optional)" style="width:100%;margin-bottom:4px;">
|
||||
<input id="dc-http-pass" type="password" placeholder="Passwort" style="width:100%;">
|
||||
</div>
|
||||
|
||||
<div style="border:1px solid #1E1E2E;border-radius:6px;padding:10px;">
|
||||
<div style="color:#E0E0F0;font-weight:600;margin-bottom:6px;">FritzBox (TR-064)</div>
|
||||
<input id="dc-fb-user" placeholder="FritzBox-Benutzer" style="width:100%;margin-bottom:4px;">
|
||||
<input id="dc-fb-user" placeholder="FritzBox-Benutzer (optional, leer wenn keiner)" style="width:100%;margin-bottom:4px;">
|
||||
<input id="dc-fb-pass" type="password" placeholder="FritzBox-Passwort" style="width:100%;">
|
||||
</div>
|
||||
|
||||
@@ -4647,10 +4647,15 @@
|
||||
const c = document.getElementById('dc-snmp-community').value.trim();
|
||||
if (c) creds.snmp = { version: v, community: c };
|
||||
}
|
||||
// HTTP-Basic: Benutzer optional (manche Geraete nutzen Password-only).
|
||||
const hu = document.getElementById('dc-http-user').value.trim();
|
||||
if (hu) creds.http = { user: hu, pass: document.getElementById('dc-http-pass').value };
|
||||
const hp = document.getElementById('dc-http-pass').value;
|
||||
if (hu || hp) creds.http = { user: hu, pass: hp };
|
||||
// FritzBox: Benutzer optional (Password-only-Boxen haben keinen) — es reicht
|
||||
// ein Passwort. Gespeichert wird, sobald User ODER Passwort gesetzt ist.
|
||||
const fu = document.getElementById('dc-fb-user').value.trim();
|
||||
if (fu) creds.fritzbox = { user: fu, pass: document.getElementById('dc-fb-pass').value };
|
||||
const fp = document.getElementById('dc-fb-pass').value;
|
||||
if (fu || fp) creds.fritzbox = { user: fu, pass: fp };
|
||||
if (!Object.keys(creds).length) { document.getElementById('dc-status').textContent = 'Nichts zu speichern — mindestens einen Typ ausfuellen.'; return; }
|
||||
send({ action: 'sat_creds_set', satellite: credsModalSat, ip: credsModalIp, creds });
|
||||
document.getElementById('dc-status').textContent = 'Speichere …';
|
||||
|
||||
@@ -622,8 +622,8 @@ def _do_http(action: str, params: dict) -> dict:
|
||||
pass
|
||||
user = params.get("user") or hcreds.get("user")
|
||||
pw = params.get("pass") or params.get("password") or hcreds.get("pass")
|
||||
if user:
|
||||
auth = (str(user), str(pw or ""))
|
||||
if user or pw: # Benutzer optional — manche Geraete nutzen Password-only-Basic-Auth
|
||||
auth = (str(user or ""), str(pw or ""))
|
||||
r = requests.request(method, url, data=params.get("body"),
|
||||
headers=params.get("headers"), auth=auth,
|
||||
timeout=HTTP_TIMEOUT_SEC)
|
||||
|
||||
Reference in New Issue
Block a user