Новый формат блоков CORE/CONTENT test5595

This commit is contained in:
AidarKC
2026-11-27 10:04:22 +03:00
parent d3a84dd451
commit f9e7c4ef94
180 changed files with 15365 additions and 1301 deletions
+4 -3
View File
@@ -441,12 +441,13 @@ function createEntryCard({ item, inspection, parseError, channelNames, blockchai
addDetailRow(info, t('screens.my_blockchain_view.text_017'), `#${item.blockNumber}`);
addDetailRow(info, t('screens.my_blockchain_view.text_018'), formatDate(item.timestampMs));
addDetailRow(info, t('screens.my_blockchain_view.text_019'), item.blockHash, { code: true });
if (inspection?.dataItemId) addDetailRow(info, 'DataItem ID', inspection.dataItemId, { code: true });
if (inspection?.dataItemId) addDetailRow(info, 'CORE DataItem ID', inspection.dataItemId, { code: true });
if (inspection?.contentDataItemId) addDetailRow(info, 'CONTENT DataItem ID', inspection.contentDataItemId, { code: true });
const body = frame?.body || {};
if (body.line) {
if (Number.isInteger(Number(body.line.lineCode))) addDetailRow(info, t('screens.my_blockchain_view.text_020'), `#${body.line.lineCode}`);
if (Number.isInteger(Number(body.line.lineSequence))) addDetailRow(info, t('screens.my_blockchain_view.text_021'), body.line.lineSequence);
if (Number.isInteger(body.line.lineSequence)) addDetailRow(info, t('screens.my_blockchain_view.text_021'), body.line.lineSequence);
}
if (body.kind === 'profile') {
addDetailRow(info, t('screens.my_blockchain_view.text_022'), body.key);
@@ -576,7 +577,7 @@ export function render({ navigate, chrome }, { historyOnly = false } = {}) {
const rows = await Promise.all((data.blocks || []).map(async (item) => {
if (!item?.blockBytesB64) return { item, inspection: null, parseError: t('screens.my_blockchain_view.text_066') };
try {
const inspection = await inspectBlockchainDataItem(item.blockBytesB64);
const inspection = await inspectBlockchainDataItem(item.blockBytesB64, item.thisLineNumber);
const body = inspection?.frame?.body;
if (inspection?.frame?.type === 0 && inspection?.frame?.subType === 1) {
const root = Number(inspection.frame.blockNumber);
@@ -6,6 +6,7 @@ import * as explorerCanvasView from './network-canvas-v4/network-view.js';
const NETWORK_VERSION_STORAGE_KEY = 'shine.network.version';
const MODES = new Set(['legacy', 'modern', 'explorer', 'explorer-canvas']);
const DEFAULT_MODE = 'explorer-canvas';
// Нижняя вкладка сбрасывает только исследованный граф V3/V4, не изображения и не V1/V2.
window.addEventListener('shine:network-tab-enter', explorerNetworkView.resetExplorerOnTabEntry);
@@ -15,9 +16,9 @@ export const pageMeta = modernNetworkView.pageMeta;
function selectedMode() {
try {
const saved = window.localStorage.getItem(NETWORK_VERSION_STORAGE_KEY);
return MODES.has(saved) ? saved : 'modern';
return MODES.has(saved) ? saved : DEFAULT_MODE;
} catch {
return 'modern';
return DEFAULT_MODE;
}
}
@@ -44,7 +45,7 @@ function createModeSwitcher(mode, navigate) {
`;
select.value = mode;
select.addEventListener('change', () => {
const nextMode = MODES.has(select.value) ? select.value : 'modern';
const nextMode = MODES.has(select.value) ? select.value : DEFAULT_MODE;
saveMode(nextMode);
navigate?.('network-view');
});