fix(ux): credentials tab — copy button for password, port 443 in broker URL
This commit is contained in:
@@ -903,6 +903,7 @@ function credsTab(d) {
|
||||
<div class="cred-label">Password</div>
|
||||
<div class="cred-value" id="pw-display">••••••••••••••••</div>
|
||||
<button class="btn btn-ghost btn-sm" id="pw-toggle-btn" onclick="togglePw()">Показать</button>
|
||||
<button class="btn btn-ghost btn-sm" onclick="copyPw(this)">Копировать</button>
|
||||
</div>
|
||||
|
||||
<div class="cred-row">
|
||||
@@ -913,7 +914,8 @@ function credsTab(d) {
|
||||
|
||||
<div class="cred-row">
|
||||
<div class="cred-label">Broker URL</div>
|
||||
<div class="cred-value">${h(S.mqttBase)}</div>
|
||||
<div class="cred-value">${h(S.mqttBase)} <span class="hint">(порт 443)</span></div>
|
||||
<button class="btn btn-ghost btn-sm" onclick="copyVal('${h(S.mqttBase)}',this)">Копировать</button>
|
||||
</div>
|
||||
|
||||
<hr class="separator">
|
||||
@@ -925,8 +927,9 @@ function credsTab(d) {
|
||||
<p>1. Запишите параметры в прошивку устройства:</p>
|
||||
<div class="cred-value" style="margin:8px 0;padding:12px;line-height:1.8;">
|
||||
broker ${h(S.mqttBase)}<br>
|
||||
port 443<br>
|
||||
username ${h(d.mqtt_username)}<br>
|
||||
password (см. выше)<br>
|
||||
password (кнопка «Копировать» у поля Password выше)<br>
|
||||
topic ${h(topic)}
|
||||
</div>
|
||||
<p>2. Устройство должно публиковать JSON в топик.</p>
|
||||
@@ -941,6 +944,12 @@ topic ${h(topic)}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
// copyPw — копировать пароль из S.deviceDetail без показа на экране
|
||||
function copyPw(btn) {
|
||||
if (!S.deviceDetail) return;
|
||||
copyVal(S.deviceDetail.mqtt_password, btn);
|
||||
}
|
||||
|
||||
// togglePw — показать/скрыть пароль (читаем из S.deviceDetail, не из атрибутов)
|
||||
function togglePw() {
|
||||
const el = document.getElementById('pw-display');
|
||||
|
||||
Reference in New Issue
Block a user