dasdasd
This commit is contained in:
@@ -48,6 +48,34 @@
|
||||
})();
|
||||
const initialDebugMode = normalizedOptions.moduleDebugEnabled === true
|
||||
|| (document.body && document.body.dataset.moduleDebugEnabled === '1');
|
||||
const fallbackSections = [
|
||||
['overview', 'Übersicht'],
|
||||
['upload', 'Upload'],
|
||||
['measurements', 'Mining-History'],
|
||||
['wallet', 'Wallet'],
|
||||
['mining', 'Miner-Daten'],
|
||||
['dashboards', 'Dashboards'],
|
||||
['settings', 'Settings'],
|
||||
];
|
||||
const sectionEntries = (() => {
|
||||
const ordered = [];
|
||||
const seen = new Set();
|
||||
const register = (key, label) => {
|
||||
const normalizedKey = String(key || '').trim();
|
||||
const normalizedLabel = String(label || '').trim();
|
||||
if (!normalizedKey || !normalizedLabel || seen.has(normalizedKey)) {
|
||||
return;
|
||||
}
|
||||
seen.add(normalizedKey);
|
||||
ordered.push([normalizedKey, normalizedLabel]);
|
||||
};
|
||||
|
||||
configuredSections.forEach((entry) => register(entry[0], entry[1]));
|
||||
fallbackSections.forEach((entry) => register(entry[0], entry[1]));
|
||||
|
||||
return ordered;
|
||||
})();
|
||||
const sectionMap = new Map(sectionEntries);
|
||||
function getCookie(name) {
|
||||
const pattern = `; ${document.cookie}`;
|
||||
const parts = pattern.split(`; ${name}=`);
|
||||
@@ -262,6 +290,36 @@
|
||||
return `${map.year}-${map.month}-${map.day}`;
|
||||
}
|
||||
|
||||
function currentSectionLabel(sectionId) {
|
||||
return sectionMap.get(String(sectionId || '').trim()) || 'Bereich';
|
||||
}
|
||||
|
||||
function currentSectionSummary(sectionId) {
|
||||
if (sectionId === 'overview') {
|
||||
return 'Kernkennzahlen, ROI, Break-even und Zielmonitor.';
|
||||
}
|
||||
if (sectionId === 'upload') {
|
||||
return 'Neue Mining-Daten per OCR, Import oder manueller Eingabe erfassen.';
|
||||
}
|
||||
if (sectionId === 'measurements') {
|
||||
return 'Historie der letzten Uploads mit Performance- und Trendwerten.';
|
||||
}
|
||||
if (sectionId === 'wallet') {
|
||||
return 'Wallet-Snapshots und erkannte Asset-Bestände auswerten.';
|
||||
}
|
||||
if (sectionId === 'mining') {
|
||||
return 'Miner, Angebote, Auszahlungen und operative Daten verwalten.';
|
||||
}
|
||||
if (sectionId === 'dashboards') {
|
||||
return 'Gespeicherte Auswertungen und Visualisierungen anzeigen.';
|
||||
}
|
||||
if (sectionId === 'settings') {
|
||||
return 'Schema, Modulrechte, DB-Checks und Basis-Settings steuern.';
|
||||
}
|
||||
|
||||
return 'Bereich des Mining-Checkers';
|
||||
}
|
||||
|
||||
function fmtDate(value) {
|
||||
if (!value) {
|
||||
return 'n/a';
|
||||
@@ -2233,11 +2291,55 @@
|
||||
return h('div', {
|
||||
className: 'mc-grid-bg',
|
||||
}, [
|
||||
h('div', { key: 'shell', className: 'mc-shell mc-stack' }, [
|
||||
error ? h('div', { key: 'error', className: 'mc-alert mc-alert--error' }, error) : null,
|
||||
message ? h('div', { key: 'message', className: 'mc-alert mc-alert--success' }, message) : null,
|
||||
loading ? h('div', { key: 'loading', className: 'mc-alert mc-alert--warning' }, 'Mining-Checker Daten werden aktualisiert …') : null,
|
||||
renderTab(),
|
||||
h('div', { key: 'shell', className: 'mc-shell' }, [
|
||||
h('div', { key: 'frame', className: 'mc-app-shell' }, [
|
||||
h('aside', { key: 'sidebar', className: 'mc-sidebar' }, [
|
||||
h('div', { key: 'brand', className: 'mc-sidebar-brand' }, [
|
||||
h('div', { key: 'kicker', className: 'mc-kicker' }, 'Modul'),
|
||||
h('h1', { key: 'title', className: 'mc-sidebar-title' }, 'Mining-Checker'),
|
||||
h('p', { key: 'copy', className: 'mc-text' }, 'Erfassung, OCR-Auswertung und Analyse von Mining-Messwerten in einer gemeinsamen Modulansicht.'),
|
||||
]),
|
||||
h('div', { key: 'nav', className: 'mc-nav-list' },
|
||||
sectionEntries.map(([key, label]) => h('button', {
|
||||
key,
|
||||
type: 'button',
|
||||
className: cx('mc-nav-button', activeTab === key && 'is-active'),
|
||||
onClick: () => {
|
||||
if (key === activeTab) {
|
||||
return;
|
||||
}
|
||||
window.history.pushState({ miningCheckerView: key }, '', `/module/mining-checker?view=${encodeURIComponent(key)}`);
|
||||
setActiveTab(key);
|
||||
},
|
||||
}, [
|
||||
h('strong', { key: 'label' }, label),
|
||||
h('span', { key: 'meta', className: 'mc-nav-meta' }, currentSectionSummary(key)),
|
||||
]))
|
||||
),
|
||||
]),
|
||||
h('main', { key: 'main', className: 'mc-main' }, [
|
||||
h('section', { key: 'hero', className: 'mc-hero-panel' }, [
|
||||
h('div', { key: 'hero-copy', className: 'mc-hero-copy' }, [
|
||||
h('div', { key: 'hero-kicker', className: 'mc-kicker' }, 'Mining-Checker'),
|
||||
h('h2', { key: 'hero-title', className: 'mc-section-title' }, currentSectionLabel(activeTab)),
|
||||
h('p', { key: 'hero-text', className: 'mc-text' }, currentSectionSummary(activeTab)),
|
||||
]),
|
||||
h('div', { key: 'hero-badges', className: 'mc-inline-row mc-inline-row--wrap' }, [
|
||||
h(Badge, { key: 'project', tone: 'info' }, `Projekt ${projectKey}`),
|
||||
h(Badge, { key: 'report-currency', tone: 'info' }, `Report ${reportCurrency}`),
|
||||
latest && latest.measured_at
|
||||
? h(Badge, { key: 'latest', tone: 'success' }, `Letzter Upload ${fmtDate(latest.measured_at)}`)
|
||||
: h(Badge, { key: 'latest-empty', tone: 'warn' }, 'Noch kein Upload'),
|
||||
]),
|
||||
]),
|
||||
h('div', { key: 'content', className: 'mc-stack' }, [
|
||||
error ? h('div', { key: 'error', className: 'mc-alert mc-alert--error' }, error) : null,
|
||||
message ? h('div', { key: 'message', className: 'mc-alert mc-alert--success' }, message) : null,
|
||||
loading ? h('div', { key: 'loading', className: 'mc-alert mc-alert--warning' }, 'Mining-Checker Daten werden aktualisiert …') : null,
|
||||
renderTab(),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user