SHA256
CORE/CONTENT test5593 и адаптация UI
This commit is contained in:
@@ -67,7 +67,8 @@ export function openBlockchainDetailsModal(details, { authService, solanaEndpoin
|
||||
<div class="block-proof-actions">
|
||||
<a class="secondary-btn block-proof-link" id="block-proof-open" target="_blank" rel="noopener noreferrer">↗ ${safe(label('open_arweave'))}</a>
|
||||
<button class="secondary-btn" type="button" id="block-proof-copy-url">${safe(label('copy_url'))}</button>
|
||||
<button class="secondary-btn" type="button" id="block-proof-download">↓ ${safe(label('download_signed'))}</button>
|
||||
<button class="secondary-btn" type="button" id="block-proof-download">↓ ${safe(label('download_signed'))} (CORE)</button>
|
||||
<button class="secondary-btn" type="button" id="block-proof-download-content">↓ ${safe(label('download_signed'))} (CONTENT)</button>
|
||||
<button class="secondary-btn block-proof-verify" type="button" id="block-proof-verify">🛡 ${safe(label('verify'))}</button>
|
||||
</div>
|
||||
<div id="block-proof-results" class="block-proof-results" hidden aria-live="polite"></div>
|
||||
@@ -125,21 +126,24 @@ export function openBlockchainDetailsModal(details, { authService, solanaEndpoin
|
||||
get('block-proof-copy-url')?.addEventListener('click', () => { void copy(arweaveBlockUrl(currentVersion().arweaveDataItemId)); });
|
||||
get('block-proof-copy-raw')?.addEventListener('click', () => { void copy(rawText); });
|
||||
get('block-proof-close')?.addEventListener('click', close);
|
||||
button.addEventListener('click', async () => {
|
||||
const contentButton = get('block-proof-download-content');
|
||||
const download = async (kind) => {
|
||||
if (busy) return;
|
||||
busy = true; button.disabled = true; verify.disabled = true;
|
||||
busy = true; button.disabled = true; contentButton.disabled = true; verify.disabled = true;
|
||||
try {
|
||||
const proof = await signedBlock();
|
||||
if (!isActive() || !get('blockchain-details-modal')) return;
|
||||
const blobUrl = URL.createObjectURL(new Blob([proof.bytes], { type: 'application/octet-stream' }));
|
||||
const blobUrl = URL.createObjectURL(new Blob([kind === 'CONTENT' ? proof.contentProof.bytes : proof.bytes], { type: 'application/octet-stream' }));
|
||||
const link = document.createElement('a');
|
||||
link.href = blobUrl;
|
||||
link.download = signedDataItemFilename(details.authorBlockchainName, currentVersion().blockNumber);
|
||||
link.download = signedDataItemFilename(details.authorBlockchainName, currentVersion().blockNumber).replace(/\.ans104$/, `-${kind.toLowerCase()}.ans104`);
|
||||
document.body.append(link); link.click(); link.remove();
|
||||
setTimeout(() => URL.revokeObjectURL(blobUrl), 30000);
|
||||
} catch (error) { if (isActive()) showToast(String(error?.message || error), { kind: 'error' }); }
|
||||
finally { busy = false; button.disabled = false; verify.disabled = false; }
|
||||
});
|
||||
finally { busy = false; button.disabled = false; contentButton.disabled = false; verify.disabled = false; }
|
||||
};
|
||||
button.addEventListener('click', () => void download('CORE'));
|
||||
contentButton.addEventListener('click', () => void download('CONTENT'));
|
||||
verify.addEventListener('click', async () => {
|
||||
if (busy) return;
|
||||
busy = true; verify.disabled = true; button.disabled = true;
|
||||
@@ -148,8 +152,9 @@ export function openBlockchainDetailsModal(details, { authService, solanaEndpoin
|
||||
try {
|
||||
const proof = await signedBlock();
|
||||
const id = currentVersion().arweaveDataItemId || proof.actualId;
|
||||
const [arweave, solana] = await Promise.all([
|
||||
const [arweave, contentArweave, solana] = await Promise.all([
|
||||
checkArweavePayload(id, proof.data),
|
||||
checkArweavePayload(proof.contentProof.actualId, proof.contentProof.data),
|
||||
checkSolanaAuthor({ authorLogin: details.authorLogin, blockchainName: details.authorBlockchainName,
|
||||
owner32: proof.owner32, solanaEndpoint }),
|
||||
]);
|
||||
@@ -157,7 +162,8 @@ export function openBlockchainDetailsModal(details, { authService, solanaEndpoin
|
||||
results.innerHTML = [
|
||||
resultRow(label('signature'), 'valid'),
|
||||
resultRow(label('integrity'), 'valid'),
|
||||
resultRow(label('arweave_check'), arweave.status, arweave.reason),
|
||||
resultRow(`${label('arweave_check')} (CORE)`, arweave.status, arweave.reason),
|
||||
resultRow(`${label('arweave_check')} (CONTENT)`, contentArweave.status, contentArweave.reason),
|
||||
resultRow(label('solana_check'), solana.status, solana.reason),
|
||||
`<p class="meta-muted">${safe(label('proof_note'))}</p>`,
|
||||
].join('');
|
||||
|
||||
Reference in New Issue
Block a user