Привел обработку ошибок в примерах к единообразию

This commit is contained in:
vgoma 2020-10-17 12:56:14 +03:00
parent 56e5e2ff17
commit 4739fe3b9f
6 changed files with 11 additions and 13 deletions

View File

@ -18,10 +18,6 @@ function SystemInfo() {
})();
});
if (!systemInfo) {
return null;
}
return (
<>
<legend>Информация о системе</legend>

View File

@ -7,7 +7,7 @@
var $certificate = document.getElementById('certificate'),
$createSignature = document.getElementById('createSignature'),
$certificateDetails = document.getElementById('certificateDetails'),
$certificateError = document.getElementById('certificateError');
$certificateError = document.getElementById('certificateListError');
$certificate.addEventListener('change', function handleCertSelection() {
var thumbprint = $certificate.value;
@ -26,6 +26,6 @@
$certificate.appendChild($certOption);
});
}, function (error) {
$certificateError.textContent = '\n' + error.message;
$certificateError.textContent = error.message;
});
})();

View File

@ -43,12 +43,12 @@
}, function (error) {
$signature.placeholder = 'Не создана';
$signatureError.textContent = '\n' + error.message;
$signatureError.textContent = error.message;
});
}, function (error) {
$hash.placeholder = 'Не вычислен';
$hashError.textContent = '\n' + error.message;
$hashError.textContent = error.message;
});
});
})();

View File

@ -16,6 +16,6 @@
}, handleError);
function handleError(error) {
$systemInfoError.textContent = '\n' + error.message;
$systemInfoError.textContent = error.message;
}
})();

View File

@ -18,11 +18,13 @@
<select id="certificate" tabindex="-1" required>
<option disabled selected>Не выбран</option>
</select>
<pre id="certificateListError"></pre>
<details id="certificateDetails">
<summary>Информация о сертификате</summary>
<pre id="certificateInfo"></pre>
</details>
<pre id="certificateError"></pre>
<pre id="certificateInfoError"></pre>
<label>Тип подписи: *</label>
<br>
@ -44,6 +46,8 @@
<label for="signature">Подпись (PKCS7):</label><br>
<textarea id="signature" cols="80" rows="30" placeholder="Не создана"></textarea>
<pre id="signatureError"></pre>
<p>
Для
<a href="https://www.gosuslugi.ru/pgu/eds/"
@ -54,8 +58,6 @@
<br>
для отделенной подписи (или *.sig для совмещенной).
</p>
<pre id="signatureError"></pre>
</fieldset>
<fieldset>

View File

@ -7,7 +7,7 @@
var $certificate = document.getElementById('certificate'),
$certificateDetails = document.getElementById('certificateDetails'),
$certificateInfo = document.getElementById('certificateInfo'),
$certificatesError = document.getElementById('certificatesError');
$certificatesError = document.getElementById('certificateInfoError');
$certificateDetails.style.display = 'none';