sitecheckultra 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -6
- package/bin/sitecheckultra.js +82 -12
- package/lib/analyzer.js +162 -11
- package/lib/crawl-error.js +171 -0
- package/lib/crawler.js +297 -186
- package/lib/exporter.js +126 -110
- package/lib/page-preview.js +311 -0
- package/lib/scorer.js +50 -17
- package/package.json +7 -7
- package/public/app.js +490 -58
- package/public/index.html +27 -9
- package/public/styles.css +138 -1
- package/server.js +66 -2
package/public/app.js
CHANGED
|
@@ -105,6 +105,7 @@ const state = {
|
|
|
105
105
|
scriptSearch: '',
|
|
106
106
|
drawerPageUrl: null,
|
|
107
107
|
drawerTab: 'headings',
|
|
108
|
+
drawerFocus: null,
|
|
108
109
|
sse: null,
|
|
109
110
|
settings: { trackers: [] },
|
|
110
111
|
lastAuth: null
|
|
@@ -121,6 +122,52 @@ function escapeHtml(str) {
|
|
|
121
122
|
.replace(/'/g, ''');
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
/* Humanize crawl/network errors for the UI (mirrors lib/crawl-error.js for legacy crawls). */
|
|
126
|
+
function humanizeCrawlErrorMessage(raw) {
|
|
127
|
+
if (raw == null || raw === '') return null;
|
|
128
|
+
const msg = String(raw).trim();
|
|
129
|
+
if (!msg) return null;
|
|
130
|
+
if (/^(Timeout nach \d+s|DNS nicht auflösbar|SSL-Zertifikat ungültig|Verbindung abgelehnt|Zu viele Redirects|Kein HTML|Durch robots\.txt|HTTP \d{3}\b)/i.test(msg)) {
|
|
131
|
+
return msg;
|
|
132
|
+
}
|
|
133
|
+
if (msg === 'Timeout' || /^The operation was aborted/i.test(msg) || /^This operation was aborted/i.test(msg)) {
|
|
134
|
+
return 'Timeout';
|
|
135
|
+
}
|
|
136
|
+
if (/ENOTFOUND|getaddrinfo|ERR_NAME_NOT_RESOLVED/i.test(msg)) return 'DNS nicht auflösbar';
|
|
137
|
+
if (/ECONNREFUSED|ERR_CONNECTION_REFUSED/i.test(msg)) return 'Verbindung abgelehnt';
|
|
138
|
+
if (/ECONNRESET|ERR_CONNECTION_RESET|socket hang up/i.test(msg)) return 'Verbindung zurückgesetzt';
|
|
139
|
+
if (/ETIMEDOUT|ESOCKETTIMEDOUT|ERR_CONNECTION_TIMED_OUT|Connect Timeout/i.test(msg)) return 'Verbindungs-Timeout';
|
|
140
|
+
if (/ENETUNREACH|EHOSTUNREACH|ERR_ADDRESS_UNREACHABLE/i.test(msg)) return 'Host nicht erreichbar';
|
|
141
|
+
if (/CERT|UNABLE_TO_VERIFY|ERR_TLS|ERR_SSL|certificate/i.test(msg) || (/SSL|TLS/i.test(msg) && /error|fail|invalid/i.test(msg))) {
|
|
142
|
+
return 'SSL-Zertifikat ungültig';
|
|
143
|
+
}
|
|
144
|
+
if (/ERR_TOO_MANY_REDIRECTS|too many redirects/i.test(msg)) return 'Zu viele Redirects';
|
|
145
|
+
if (/EAI_AGAIN/i.test(msg)) return 'DNS vorübergehend nicht verfügbar';
|
|
146
|
+
if (/^Netzwerkfehler$/i.test(msg) || /^network error$/i.test(msg) || /^fetch failed$/i.test(msg)) return 'Netzwerkfehler';
|
|
147
|
+
const cleaned = msg.replace(/^Error:\s*/i, '').replace(/^fetch failed:\s*/i, '').trim();
|
|
148
|
+
return cleaned.length > 120 ? `${cleaned.slice(0, 117)}…` : (cleaned || 'Netzwerkfehler');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function pageCrawlFailureReason(page) {
|
|
152
|
+
if (!page) return null;
|
|
153
|
+
if (page.error) return humanizeCrawlErrorMessage(page.error);
|
|
154
|
+
const status = Number(page.status || page.finalStatus || 0);
|
|
155
|
+
if (status === 0) return 'Verbindungsfehler';
|
|
156
|
+
const ct = (page.contentType || '').toLowerCase();
|
|
157
|
+
const hasHtmlHint = !ct || ct.includes('html') || ct.includes('xhtml');
|
|
158
|
+
if (!hasHtmlHint && !(page.title || page.h1Text || (page.headings || []).length)) {
|
|
159
|
+
return `Kein HTML (content-type: ${(page.contentType || '').trim() || 'unbekannt'})`;
|
|
160
|
+
}
|
|
161
|
+
if (status === 401) return 'HTTP 401 Unauthorized';
|
|
162
|
+
if (status === 403) return 'HTTP 403 Forbidden';
|
|
163
|
+
if (page.blockedByRobotsTxt) {
|
|
164
|
+
return page.robotsDisallowRule
|
|
165
|
+
? `Durch robots.txt blockiert: Disallow ${page.robotsDisallowRule}`
|
|
166
|
+
: 'Durch robots.txt blockiert';
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
|
|
124
171
|
function showToast(msg) {
|
|
125
172
|
const el = $('toast');
|
|
126
173
|
el.textContent = msg;
|
|
@@ -404,10 +451,13 @@ function renderScorePill(score, grade = null, pageUrl = null) {
|
|
|
404
451
|
}
|
|
405
452
|
|
|
406
453
|
function renderStatusPill(status, error) {
|
|
407
|
-
|
|
454
|
+
const reason = humanizeCrawlErrorMessage(error) || (status === 0 ? 'Verbindungsfehler' : null);
|
|
455
|
+
if (reason || status === 0) {
|
|
456
|
+
return `<span class="pill pill-red" title="${escapeHtml(reason || 'Fehler')}">ERR</span>`;
|
|
457
|
+
}
|
|
408
458
|
if (status >= 200 && status < 300) return `<span class="pill pill-green">${status}</span>`;
|
|
409
459
|
if (status >= 300 && status < 400) return `<span class="pill pill-amber">${status}</span>`;
|
|
410
|
-
return `<span class="pill pill-red">${status}</span>`;
|
|
460
|
+
return `<span class="pill pill-red" title="${escapeHtml(`HTTP ${status}`)}">${status}</span>`;
|
|
411
461
|
}
|
|
412
462
|
|
|
413
463
|
function renderHeadingSummaryCell(p) {
|
|
@@ -437,7 +487,8 @@ function getNumberedHeadings(headings = []) {
|
|
|
437
487
|
|
|
438
488
|
function renderFullHOutlineCell(p) {
|
|
439
489
|
if (p.error || p.status === 0) {
|
|
440
|
-
|
|
490
|
+
const reason = pageCrawlFailureReason(p) || 'Seite nicht geladen';
|
|
491
|
+
return `<span class="pill pill-red" title="${escapeHtml(reason)}">⚠ ${escapeHtml(reason)}</span>`;
|
|
441
492
|
}
|
|
442
493
|
const headings = getNumberedHeadings(p.headings || []);
|
|
443
494
|
if (!headings.length) {
|
|
@@ -468,7 +519,7 @@ function renderFullHOutlineCell(p) {
|
|
|
468
519
|
|
|
469
520
|
function renderSingleLevelHCell(p, level) {
|
|
470
521
|
if (p.error || p.status === 0) {
|
|
471
|
-
return `<span class="dash-muted" title="${escapeHtml(p
|
|
522
|
+
return `<span class="dash-muted" title="${escapeHtml(pageCrawlFailureReason(p) || 'Nicht geladen')}">–</span>`;
|
|
472
523
|
}
|
|
473
524
|
const items = (p.headings || []).filter((h) => h.level === level);
|
|
474
525
|
if (!items.length) {
|
|
@@ -510,7 +561,7 @@ function getHeadingSlotText(p, level, index) {
|
|
|
510
561
|
|
|
511
562
|
function renderIndividualHSlotCell(p, level, index) {
|
|
512
563
|
if (p.error || p.status === 0) {
|
|
513
|
-
return `<span class="dash-muted" title="${escapeHtml(p
|
|
564
|
+
return `<span class="dash-muted" title="${escapeHtml(pageCrawlFailureReason(p) || 'Nicht geladen')}">–</span>`;
|
|
514
565
|
}
|
|
515
566
|
const h = getHeadingSlotText(p, level, index);
|
|
516
567
|
if (!h) {
|
|
@@ -576,8 +627,9 @@ const TABLE_COLUMNS = [
|
|
|
576
627
|
sortValue: (p) => (p.title || '').toLowerCase(),
|
|
577
628
|
cellClass: 'cell-site',
|
|
578
629
|
render: (p) => {
|
|
630
|
+
const failReason = pageCrawlFailureReason(p);
|
|
579
631
|
if (p.error || p.status === 0) {
|
|
580
|
-
return `<div class="site-title" style="color:var(--red-text)">
|
|
632
|
+
return `<div class="site-title" style="color:var(--red-text)">Seite nicht crawlbar</div><div class="site-sub warn" title="${escapeHtml(failReason || '')}">⚠ ${escapeHtml(failReason || 'Verbindungsfehler')}</div>`;
|
|
581
633
|
}
|
|
582
634
|
const h1Sub = p.h1Text
|
|
583
635
|
? `<div class="site-sub" title="H1: ${escapeHtml(p.h1Text)}">H1: ${escapeHtml(p.h1Text)}</div>`
|
|
@@ -623,6 +675,8 @@ const TABLE_COLUMNS = [
|
|
|
623
675
|
defaultVisible: true,
|
|
624
676
|
defaultWidth: 85,
|
|
625
677
|
sortable: true,
|
|
678
|
+
drawerTab: 'audit',
|
|
679
|
+
drawerFocus: 'audit-score',
|
|
626
680
|
sortValue: (p) => Number(p.status || 0),
|
|
627
681
|
render: (p) => renderStatusPill(p.status, p.error)
|
|
628
682
|
},
|
|
@@ -635,6 +689,8 @@ const TABLE_COLUMNS = [
|
|
|
635
689
|
defaultWidth: 96,
|
|
636
690
|
sortable: true,
|
|
637
691
|
numeric: true,
|
|
692
|
+
drawerTab: 'audit',
|
|
693
|
+
drawerFocus: 'audit-score',
|
|
638
694
|
sortValue: (p) => Number(p.audit?.overall ?? 0),
|
|
639
695
|
render: (p) => renderScorePill(p.audit?.overall ?? 0, p.audit?.grade || '–', p.url)
|
|
640
696
|
},
|
|
@@ -647,6 +703,8 @@ const TABLE_COLUMNS = [
|
|
|
647
703
|
defaultWidth: 74,
|
|
648
704
|
sortable: true,
|
|
649
705
|
numeric: true,
|
|
706
|
+
drawerTab: 'audit',
|
|
707
|
+
drawerFocus: 'audit-score',
|
|
650
708
|
sortValue: (p) => Number(p.audit?.categories?.seo ?? 0),
|
|
651
709
|
render: (p) => renderScorePill(p.audit?.categories?.seo ?? 0, null, p.url)
|
|
652
710
|
},
|
|
@@ -659,65 +717,77 @@ const TABLE_COLUMNS = [
|
|
|
659
717
|
defaultWidth: 74,
|
|
660
718
|
sortable: true,
|
|
661
719
|
numeric: true,
|
|
720
|
+
drawerTab: 'audit',
|
|
721
|
+
drawerFocus: 'audit-score',
|
|
662
722
|
sortValue: (p) => Number(p.audit?.categories?.aeo ?? 0),
|
|
663
723
|
render: (p) => renderScorePill(p.audit?.categories?.aeo ?? 0, null, p.url)
|
|
664
724
|
},
|
|
665
725
|
{
|
|
666
726
|
id: 'audit_hygiene',
|
|
667
|
-
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG)',
|
|
727
|
+
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG 2.2)',
|
|
668
728
|
label: 'Hygiene Score',
|
|
669
729
|
header: 'HYGIENE',
|
|
670
730
|
defaultVisible: false,
|
|
671
731
|
defaultWidth: 84,
|
|
672
732
|
sortable: true,
|
|
673
733
|
numeric: true,
|
|
734
|
+
drawerTab: 'audit',
|
|
735
|
+
drawerFocus: 'audit-score',
|
|
674
736
|
sortValue: (p) => Number(p.audit?.categories?.hygiene ?? 0),
|
|
675
737
|
render: (p) => renderScorePill(p.audit?.categories?.hygiene ?? 0, null, p.url)
|
|
676
738
|
},
|
|
677
739
|
{
|
|
678
740
|
id: 'audit_speed',
|
|
679
|
-
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG)',
|
|
741
|
+
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG 2.2)',
|
|
680
742
|
label: 'Speed Score',
|
|
681
743
|
header: 'SPEED',
|
|
682
744
|
defaultVisible: false,
|
|
683
745
|
defaultWidth: 74,
|
|
684
746
|
sortable: true,
|
|
685
747
|
numeric: true,
|
|
748
|
+
drawerTab: 'audit',
|
|
749
|
+
drawerFocus: 'audit-score',
|
|
686
750
|
sortValue: (p) => Number(p.audit?.categories?.speed ?? 0),
|
|
687
751
|
render: (p) => renderScorePill(p.audit?.categories?.speed ?? 0, null, p.url)
|
|
688
752
|
},
|
|
689
753
|
{
|
|
690
754
|
id: 'audit_mobile',
|
|
691
|
-
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG)',
|
|
755
|
+
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG 2.2)',
|
|
692
756
|
label: 'Mobile Score',
|
|
693
757
|
header: 'MOBILE',
|
|
694
758
|
defaultVisible: false,
|
|
695
759
|
defaultWidth: 78,
|
|
696
760
|
sortable: true,
|
|
697
761
|
numeric: true,
|
|
762
|
+
drawerTab: 'audit',
|
|
763
|
+
drawerFocus: 'audit-score',
|
|
698
764
|
sortValue: (p) => Number(p.audit?.categories?.mobile ?? 0),
|
|
699
765
|
render: (p) => renderScorePill(p.audit?.categories?.mobile ?? 0, null, p.url)
|
|
700
766
|
},
|
|
701
767
|
{
|
|
702
768
|
id: 'audit_wcag',
|
|
703
|
-
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG)',
|
|
704
|
-
label: 'WCAG Score',
|
|
705
|
-
header: 'WCAG',
|
|
769
|
+
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG 2.2)',
|
|
770
|
+
label: 'WCAG 2.2 Score',
|
|
771
|
+
header: 'WCAG 2.2',
|
|
706
772
|
defaultVisible: false,
|
|
707
|
-
defaultWidth:
|
|
773
|
+
defaultWidth: 88,
|
|
708
774
|
sortable: true,
|
|
709
775
|
numeric: true,
|
|
776
|
+
drawerTab: 'audit',
|
|
777
|
+
drawerFocus: 'audit-score',
|
|
710
778
|
sortValue: (p) => Number(p.audit?.categories?.wcag ?? 0),
|
|
711
779
|
render: (p) => renderScorePill(p.audit?.categories?.wcag ?? 0, null, p.url)
|
|
712
780
|
},
|
|
713
781
|
{
|
|
714
782
|
id: 'audit_reason',
|
|
715
|
-
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG)',
|
|
783
|
+
group: 'Audit Score (SEO · AEO · Hygiene · Speed · Mobile · WCAG 2.2)',
|
|
716
784
|
label: 'Score-Begründung',
|
|
717
785
|
header: 'BEGRÜNDUNG',
|
|
718
786
|
defaultVisible: true,
|
|
719
787
|
defaultWidth: 270,
|
|
720
788
|
sortable: true,
|
|
789
|
+
drawerTab: 'audit',
|
|
790
|
+
drawerFocus: 'audit-issues',
|
|
721
791
|
sortValue: (p) => (p.audit?.summary || '').toLowerCase(),
|
|
722
792
|
cellClass: 'cell-reason',
|
|
723
793
|
render: (p) => `<div data-open-audit="${escapeHtml(p.url)}" title="Klicken für vollständige Auswertung">${escapeHtml(p.audit?.summary || '–')}</div>`
|
|
@@ -730,6 +800,8 @@ const TABLE_COLUMNS = [
|
|
|
730
800
|
defaultVisible: true,
|
|
731
801
|
defaultWidth: 95,
|
|
732
802
|
sortable: true,
|
|
803
|
+
drawerTab: 'seo',
|
|
804
|
+
drawerFocus: 'meta-robots',
|
|
733
805
|
sortValue: (p) => (p.indexable ? 1 : 0),
|
|
734
806
|
render: (p) => `<span class="pill ${p.indexable ? 'pill-green' : 'pill-amber'}">${p.indexable ? 'Index' : 'Noindex'}</span>`
|
|
735
807
|
},
|
|
@@ -741,6 +813,8 @@ const TABLE_COLUMNS = [
|
|
|
741
813
|
defaultVisible: true,
|
|
742
814
|
defaultWidth: 95,
|
|
743
815
|
sortable: true,
|
|
816
|
+
drawerTab: 'seo',
|
|
817
|
+
drawerFocus: 'meta-robots',
|
|
744
818
|
sortValue: (p) => (p.followable ? 1 : 0),
|
|
745
819
|
render: (p) => `<span class="pill ${p.followable ? 'pill-green' : 'pill-amber'}">${p.followable ? 'Follow' : 'Nofollow'}</span>`
|
|
746
820
|
},
|
|
@@ -752,6 +826,8 @@ const TABLE_COLUMNS = [
|
|
|
752
826
|
defaultVisible: true,
|
|
753
827
|
defaultWidth: 145,
|
|
754
828
|
sortable: true,
|
|
829
|
+
drawerTab: 'seo',
|
|
830
|
+
drawerFocus: 'meta-robots',
|
|
755
831
|
sortValue: (p) => {
|
|
756
832
|
const st = p.robotsTxtStatus ?? state.currentCrawl?.robotsTxtStatus;
|
|
757
833
|
if (p.blockedByRobotsTxt) return `0_blockiert_${p.robotsDisallowRule || ''}`;
|
|
@@ -764,7 +840,9 @@ const TABLE_COLUMNS = [
|
|
|
764
840
|
const st = p.robotsTxtStatus ?? state.currentCrawl?.robotsTxtStatus;
|
|
765
841
|
const stLabel = st !== null && st !== undefined ? ` (${st})` : '';
|
|
766
842
|
if (p.blockedByRobotsTxt) {
|
|
767
|
-
const ruleTip = p.robotsDisallowRule
|
|
843
|
+
const ruleTip = p.robotsDisallowRule
|
|
844
|
+
? `Durch robots.txt blockiert: Disallow ${p.robotsDisallowRule}`
|
|
845
|
+
: 'Durch robots.txt blockiert';
|
|
768
846
|
return `<span class="pill pill-red" title="${escapeHtml(ruleTip)} – robots.txt HTTP ${st || 200}">Blockiert${escapeHtml(stLabel)}</span>`;
|
|
769
847
|
}
|
|
770
848
|
if (st === 404) {
|
|
@@ -784,6 +862,8 @@ const TABLE_COLUMNS = [
|
|
|
784
862
|
defaultVisible: true,
|
|
785
863
|
defaultWidth: 95,
|
|
786
864
|
sortable: true,
|
|
865
|
+
drawerTab: 'seo',
|
|
866
|
+
drawerFocus: 'meta-robots',
|
|
787
867
|
sortValue: (p) => (p.inSitemap ? 1 : 0),
|
|
788
868
|
render: (p) => `<span class="pill ${p.inSitemap ? 'pill-green' : 'pill-gray'}">${p.inSitemap ? 'Ja' : 'Nein'}</span>`
|
|
789
869
|
},
|
|
@@ -795,6 +875,8 @@ const TABLE_COLUMNS = [
|
|
|
795
875
|
defaultVisible: true,
|
|
796
876
|
defaultWidth: 145,
|
|
797
877
|
sortable: true,
|
|
878
|
+
drawerTab: 'seo',
|
|
879
|
+
drawerFocus: 'meta-robots',
|
|
798
880
|
sortValue: (p) => {
|
|
799
881
|
if (!p.inSitemap) return '0_nicht_in_sitemap';
|
|
800
882
|
if (!p.sitemapLastmod) return '1_kein_lastmod';
|
|
@@ -819,6 +901,8 @@ const TABLE_COLUMNS = [
|
|
|
819
901
|
defaultVisible: true,
|
|
820
902
|
defaultWidth: 160,
|
|
821
903
|
sortable: true,
|
|
904
|
+
drawerTab: 'seo',
|
|
905
|
+
drawerFocus: 'meta-canonical',
|
|
822
906
|
sortValue: (p) => (p.canonicalType === 'other' ? `2_${p.canonical || ''}` : p.canonicalType === 'self' ? '1_self' : '0_none').toLowerCase(),
|
|
823
907
|
cellClass: 'cell-nowrap',
|
|
824
908
|
render: (p) => p.canonicalType === 'other'
|
|
@@ -835,6 +919,8 @@ const TABLE_COLUMNS = [
|
|
|
835
919
|
defaultVisible: true,
|
|
836
920
|
defaultWidth: 180,
|
|
837
921
|
sortable: true,
|
|
922
|
+
drawerTab: 'links',
|
|
923
|
+
drawerFocus: 'redirect-chain',
|
|
838
924
|
sortValue: (p) => (p.hasRedirect ? `${p.redirectStatus}_${p.redirectTarget || ''}` : '').toLowerCase(),
|
|
839
925
|
cellClass: 'cell-nowrap',
|
|
840
926
|
render: (p) => p.hasRedirect
|
|
@@ -851,6 +937,8 @@ const TABLE_COLUMNS = [
|
|
|
851
937
|
defaultVisible: true,
|
|
852
938
|
defaultWidth: 340,
|
|
853
939
|
sortable: true,
|
|
940
|
+
drawerTab: 'headings',
|
|
941
|
+
drawerFocus: 'headings-tree',
|
|
854
942
|
sortValue: (p) => Number(p.headingCounts?.total || 0),
|
|
855
943
|
cellClass: 'cell-h-outline',
|
|
856
944
|
render: (p) => renderFullHOutlineCell(p)
|
|
@@ -863,6 +951,8 @@ const TABLE_COLUMNS = [
|
|
|
863
951
|
defaultVisible: false,
|
|
864
952
|
defaultWidth: 190,
|
|
865
953
|
sortable: true,
|
|
954
|
+
drawerTab: 'headings',
|
|
955
|
+
drawerFocus: 'headings-tree',
|
|
866
956
|
sortValue: (p) => Number(p.headingCounts?.total || 0),
|
|
867
957
|
render: (p) => renderHeadingSummaryCell(p)
|
|
868
958
|
},
|
|
@@ -874,6 +964,8 @@ const TABLE_COLUMNS = [
|
|
|
874
964
|
defaultVisible: false,
|
|
875
965
|
defaultWidth: 230,
|
|
876
966
|
sortable: true,
|
|
967
|
+
drawerTab: 'headings',
|
|
968
|
+
drawerFocus: 'headings-tree',
|
|
877
969
|
sortValue: (p) => getHeadingsOfLevel(p, 1),
|
|
878
970
|
cellClass: 'cell-h-level',
|
|
879
971
|
render: (p) => renderSingleLevelHCell(p, 1)
|
|
@@ -886,6 +978,8 @@ const TABLE_COLUMNS = [
|
|
|
886
978
|
defaultVisible: false,
|
|
887
979
|
defaultWidth: 220,
|
|
888
980
|
sortable: true,
|
|
981
|
+
drawerTab: 'headings',
|
|
982
|
+
drawerFocus: 'headings-tree',
|
|
889
983
|
sortValue: (p) => getHeadingsOfLevel(p, 2),
|
|
890
984
|
cellClass: 'cell-h-level',
|
|
891
985
|
render: (p) => renderSingleLevelHCell(p, 2)
|
|
@@ -898,6 +992,8 @@ const TABLE_COLUMNS = [
|
|
|
898
992
|
defaultVisible: false,
|
|
899
993
|
defaultWidth: 220,
|
|
900
994
|
sortable: true,
|
|
995
|
+
drawerTab: 'headings',
|
|
996
|
+
drawerFocus: 'headings-tree',
|
|
901
997
|
sortValue: (p) => getHeadingsOfLevel(p, 3),
|
|
902
998
|
cellClass: 'cell-h-level',
|
|
903
999
|
render: (p) => renderSingleLevelHCell(p, 3)
|
|
@@ -910,6 +1006,8 @@ const TABLE_COLUMNS = [
|
|
|
910
1006
|
defaultVisible: false,
|
|
911
1007
|
defaultWidth: 200,
|
|
912
1008
|
sortable: true,
|
|
1009
|
+
drawerTab: 'headings',
|
|
1010
|
+
drawerFocus: 'headings-tree',
|
|
913
1011
|
sortValue: (p) => getHeadingsOfLevel(p, 4),
|
|
914
1012
|
cellClass: 'cell-h-level',
|
|
915
1013
|
render: (p) => renderSingleLevelHCell(p, 4)
|
|
@@ -922,6 +1020,8 @@ const TABLE_COLUMNS = [
|
|
|
922
1020
|
defaultVisible: false,
|
|
923
1021
|
defaultWidth: 180,
|
|
924
1022
|
sortable: true,
|
|
1023
|
+
drawerTab: 'headings',
|
|
1024
|
+
drawerFocus: 'headings-tree',
|
|
925
1025
|
sortValue: (p) => getHeadingsOfLevel(p, 5),
|
|
926
1026
|
cellClass: 'cell-h-level',
|
|
927
1027
|
render: (p) => renderSingleLevelHCell(p, 5)
|
|
@@ -934,6 +1034,8 @@ const TABLE_COLUMNS = [
|
|
|
934
1034
|
defaultVisible: false,
|
|
935
1035
|
defaultWidth: 180,
|
|
936
1036
|
sortable: true,
|
|
1037
|
+
drawerTab: 'headings',
|
|
1038
|
+
drawerFocus: 'headings-tree',
|
|
937
1039
|
sortValue: (p) => getHeadingsOfLevel(p, 6),
|
|
938
1040
|
cellClass: 'cell-h-level',
|
|
939
1041
|
render: (p) => renderSingleLevelHCell(p, 6)
|
|
@@ -948,6 +1050,8 @@ const TABLE_COLUMNS = [
|
|
|
948
1050
|
defaultVisible: false,
|
|
949
1051
|
defaultWidth: 240,
|
|
950
1052
|
sortable: true,
|
|
1053
|
+
drawerTab: 'seo',
|
|
1054
|
+
drawerFocus: 'meta-title',
|
|
951
1055
|
sortValue: (p) => Number(p.titleLength || 0),
|
|
952
1056
|
cellClass: 'cell-meta-text',
|
|
953
1057
|
render: (p) => {
|
|
@@ -963,6 +1067,8 @@ const TABLE_COLUMNS = [
|
|
|
963
1067
|
defaultVisible: false,
|
|
964
1068
|
defaultWidth: 260,
|
|
965
1069
|
sortable: true,
|
|
1070
|
+
drawerTab: 'seo',
|
|
1071
|
+
drawerFocus: 'meta-desc',
|
|
966
1072
|
sortValue: (p) => Number(p.metaDescriptionLength || 0),
|
|
967
1073
|
cellClass: 'cell-meta-text',
|
|
968
1074
|
render: (p) => {
|
|
@@ -978,6 +1084,8 @@ const TABLE_COLUMNS = [
|
|
|
978
1084
|
defaultVisible: true,
|
|
979
1085
|
defaultWidth: 150,
|
|
980
1086
|
sortable: true,
|
|
1087
|
+
drawerTab: 'schema',
|
|
1088
|
+
drawerFocus: 'schema-jsonld',
|
|
981
1089
|
sortValue: (p) => (p.schemaTypes || []).join(', ').toLowerCase(),
|
|
982
1090
|
cellClass: 'cell-nowrap',
|
|
983
1091
|
render: (p) => p.schemaTypes?.length
|
|
@@ -992,6 +1100,8 @@ const TABLE_COLUMNS = [
|
|
|
992
1100
|
defaultVisible: true,
|
|
993
1101
|
defaultWidth: 155,
|
|
994
1102
|
sortable: true,
|
|
1103
|
+
drawerTab: 'schema',
|
|
1104
|
+
drawerFocus: 'tracking',
|
|
995
1105
|
sortValue: (p) => Number(p.tracking?.tools?.length || 0) || Number(p.tracking?.detectedIds?.length || 0),
|
|
996
1106
|
render: (p) => renderTrackingBadges(p)
|
|
997
1107
|
},
|
|
@@ -1003,6 +1113,8 @@ const TABLE_COLUMNS = [
|
|
|
1003
1113
|
defaultVisible: true,
|
|
1004
1114
|
defaultWidth: 85,
|
|
1005
1115
|
sortable: true,
|
|
1116
|
+
drawerTab: 'links',
|
|
1117
|
+
drawerFocus: 'internal-links',
|
|
1006
1118
|
sortValue: (p) => Number(p.linkCount || 0),
|
|
1007
1119
|
numeric: true,
|
|
1008
1120
|
render: (p) => p.brokenLinksCount > 0
|
|
@@ -1012,11 +1124,13 @@ const TABLE_COLUMNS = [
|
|
|
1012
1124
|
{
|
|
1013
1125
|
id: 'missing_alt',
|
|
1014
1126
|
group: 'SEO, Schema & Technik',
|
|
1015
|
-
label: 'Bilder ohne Alt-
|
|
1127
|
+
label: 'Bilder ohne Alt-Attribut',
|
|
1016
1128
|
header: 'OHNE ALT',
|
|
1017
1129
|
defaultVisible: false,
|
|
1018
1130
|
defaultWidth: 105,
|
|
1019
1131
|
sortable: true,
|
|
1132
|
+
drawerTab: 'seo',
|
|
1133
|
+
drawerFocus: 'images-alt',
|
|
1020
1134
|
sortValue: (p) => Number(p.imagesMissingAltCount || 0),
|
|
1021
1135
|
numeric: true,
|
|
1022
1136
|
render: (p) => p.imagesMissingAltCount > 0
|
|
@@ -1031,6 +1145,8 @@ const TABLE_COLUMNS = [
|
|
|
1031
1145
|
defaultVisible: false,
|
|
1032
1146
|
defaultWidth: 90,
|
|
1033
1147
|
sortable: true,
|
|
1148
|
+
drawerTab: 'seo',
|
|
1149
|
+
drawerFocus: 'meta-robots',
|
|
1034
1150
|
sortValue: (p) => Number(p.wordCount || 0),
|
|
1035
1151
|
numeric: true,
|
|
1036
1152
|
render: (p) => `${p.wordCount || 0}`
|
|
@@ -1043,6 +1159,8 @@ const TABLE_COLUMNS = [
|
|
|
1043
1159
|
defaultVisible: false,
|
|
1044
1160
|
defaultWidth: 95,
|
|
1045
1161
|
sortable: true,
|
|
1162
|
+
drawerTab: 'audit',
|
|
1163
|
+
drawerFocus: 'audit-score',
|
|
1046
1164
|
sortValue: (p) => Number(p.responseTimeMs || 0),
|
|
1047
1165
|
numeric: true,
|
|
1048
1166
|
render: (p) => `<span class="muted">${p.responseTimeMs || 0} ms</span>`
|
|
@@ -1055,6 +1173,8 @@ const TABLE_COLUMNS = [
|
|
|
1055
1173
|
defaultVisible: true,
|
|
1056
1174
|
defaultWidth: 150,
|
|
1057
1175
|
sortable: true,
|
|
1176
|
+
drawerTab: 'note',
|
|
1177
|
+
drawerFocus: 'note-editor',
|
|
1058
1178
|
sortValue: (p) => (p.note || '').toLowerCase(),
|
|
1059
1179
|
cellClass: 'cell-nowrap',
|
|
1060
1180
|
render: (p) => `<div class="note-preview" title="${escapeHtml(p.note || '')}">${p.note ? escapeHtml(p.note) : '<span class="dash-muted">–</span>'}</div>`
|
|
@@ -1115,6 +1235,8 @@ function buildDynamicHColumn(level) {
|
|
|
1115
1235
|
defaultVisible: level > 6,
|
|
1116
1236
|
defaultWidth: 200,
|
|
1117
1237
|
sortable: true,
|
|
1238
|
+
drawerTab: 'headings',
|
|
1239
|
+
drawerFocus: 'headings-tree',
|
|
1118
1240
|
sortValue: (p) => getHeadingsOfLevel(p, level),
|
|
1119
1241
|
cellClass: 'cell-h-level',
|
|
1120
1242
|
render: (p) => renderSingleLevelHCell(p, level)
|
|
@@ -1130,6 +1252,8 @@ function buildIndividualHSlotColumn(level, index) {
|
|
|
1130
1252
|
defaultVisible: false,
|
|
1131
1253
|
defaultWidth: 210,
|
|
1132
1254
|
sortable: true,
|
|
1255
|
+
drawerTab: 'headings',
|
|
1256
|
+
drawerFocus: 'headings-tree',
|
|
1133
1257
|
sortValue: (p) => (getHeadingSlotText(p, level, index)?.text || '').toLowerCase(),
|
|
1134
1258
|
cellClass: 'cell-h-level',
|
|
1135
1259
|
render: (p) => renderIndividualHSlotCell(p, level, index)
|
|
@@ -1317,7 +1441,7 @@ const PAGE_FILTERS = [
|
|
|
1317
1441
|
{ id: 'tracking_off', label: 'Tracking aus', test: (p) => !p.tracking?.hasAnyTracking },
|
|
1318
1442
|
{ id: 'broken_links', label: 'Mit Linkfehlern', test: (p) => (p.brokenLinksCount || 0) > 0 },
|
|
1319
1443
|
{ id: 'with_schema', label: 'Mit Schema', test: (p) => (p.schemaTypes?.length || 0) > 0 },
|
|
1320
|
-
{ id: 'missing_alt', label: 'Ohne Alt-
|
|
1444
|
+
{ id: 'missing_alt', label: 'Ohne Alt-Attribut', test: (p) => (p.imagesMissingAltCount || 0) > 0 }
|
|
1321
1445
|
];
|
|
1322
1446
|
|
|
1323
1447
|
/* ==================== INITIALIZATION ==================== */
|
|
@@ -1989,7 +2113,10 @@ function renderPagesTable({ rebuildHeader = true } = {}) {
|
|
|
1989
2113
|
tbody.innerHTML = slice.map((p) => {
|
|
1990
2114
|
const cells = activeCols.map((col) => {
|
|
1991
2115
|
const cls = [col.cellClass || '', col.numeric ? 'num' : ''].filter(Boolean).join(' ');
|
|
1992
|
-
|
|
2116
|
+
const drawerAttrs = col.drawerTab
|
|
2117
|
+
? ` data-drawer-tab="${escapeHtml(col.drawerTab)}"${col.drawerFocus ? ` data-drawer-focus="${escapeHtml(col.drawerFocus)}"` : ''}`
|
|
2118
|
+
: '';
|
|
2119
|
+
return `<td${cls ? ` class="${cls}"` : ''}${drawerAttrs}>${col.render(p, origin)}</td>`;
|
|
1993
2120
|
}).join('');
|
|
1994
2121
|
return `<tr data-page-url="${escapeHtml(p.url)}">${cells}</tr>`;
|
|
1995
2122
|
}).join('');
|
|
@@ -2055,7 +2182,7 @@ function renderAuditTab() {
|
|
|
2055
2182
|
const c = state.currentCrawl;
|
|
2056
2183
|
if (!c) return;
|
|
2057
2184
|
const sum = computeClientAuditSummary(c);
|
|
2058
|
-
const catNames = { seo: 'SEO', aeo: 'AEO / KI', hygiene: 'Hygiene', speed: 'Speed', mobile: 'Mobile', wcag: 'WCAG' };
|
|
2185
|
+
const catNames = { seo: 'SEO', aeo: 'AEO / KI', hygiene: 'Hygiene', speed: 'Speed', mobile: 'Mobile', wcag: 'WCAG 2.2' };
|
|
2059
2186
|
|
|
2060
2187
|
$('auditSubtitle').textContent = `${sum.totalPages.toLocaleString('de-DE')} geprüfte Seiten auf ${c.origin.replace(/^https?:\/\//i, '')} – Gesamt-Score ${sum.overall}/100 (Note ${sum.grade}).`;
|
|
2061
2188
|
|
|
@@ -2065,7 +2192,7 @@ function renderAuditTab() {
|
|
|
2065
2192
|
{ key: 'hygiene', label: 'Hygiene (15 %)', desc: 'H-Hierarchie, Redirect-Ketten, JSON-LD Gültigkeit, Tracking, URLs', val: sum.categories.hygiene },
|
|
2066
2193
|
{ key: 'speed', label: 'Speed (15 %)', desc: 'Antwortzeit (TTFB), HTML-Größe, Anzahl externer Scripts', val: sum.categories.speed },
|
|
2067
2194
|
{ key: 'mobile', label: 'Mobile (15 %)', desc: 'Viewport, responsive Bilder, Touch-Icon, Open Graph', val: sum.categories.mobile },
|
|
2068
|
-
{ key: 'wcag', label: 'WCAG (15 %)', desc: 'Alt-
|
|
2195
|
+
{ key: 'wcag', label: 'WCAG 2.2 (15 %)', desc: 'lang, Alt-Attribute, H-Struktur, Linktexte/Namen, iframe-title, main, tabindex', val: sum.categories.wcag }
|
|
2069
2196
|
];
|
|
2070
2197
|
|
|
2071
2198
|
$('auditHeroGrid').innerHTML = `
|
|
@@ -2397,6 +2524,43 @@ function showLinkSourcesPopover(anchorBtn, resultUrl) {
|
|
|
2397
2524
|
document.addEventListener('click', onLinkSourcesOutsideClick, true);
|
|
2398
2525
|
}
|
|
2399
2526
|
|
|
2527
|
+
function setJobProgressUi(kind, { visible, phase, checked = 0, total = 0, indeterminate = false }) {
|
|
2528
|
+
const wrap = $(kind === 'links' ? 'linkCheckProgress' : 'redirectCheckProgress');
|
|
2529
|
+
const phaseEl = $(kind === 'links' ? 'linkCheckPhase' : 'redirectCheckPhase');
|
|
2530
|
+
const metaEl = $(kind === 'links' ? 'linkCheckMeta' : 'redirectCheckMeta');
|
|
2531
|
+
const fillEl = $(kind === 'links' ? 'linkCheckBarFill' : 'redirectCheckBarFill');
|
|
2532
|
+
const barEl = $(kind === 'links' ? 'linkCheckBar' : 'redirectCheckBar');
|
|
2533
|
+
if (!wrap || !phaseEl || !metaEl || !fillEl) return;
|
|
2534
|
+
|
|
2535
|
+
wrap.classList.toggle('hidden', !visible);
|
|
2536
|
+
phaseEl.textContent = phase || '';
|
|
2537
|
+
const pct = indeterminate || total <= 0
|
|
2538
|
+
? (indeterminate ? 12 : 0)
|
|
2539
|
+
: Math.min(100, Math.round((checked / total) * 100));
|
|
2540
|
+
metaEl.textContent = total > 0 ? `${checked} / ${total} geprüft · ${pct}%` : (indeterminate ? 'Wird vorbereitet…' : '');
|
|
2541
|
+
fillEl.style.width = `${Math.max(indeterminate ? 12 : 0, pct)}%`;
|
|
2542
|
+
if (barEl) barEl.setAttribute('aria-valuenow', String(pct));
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
function startCheckProgressPoll(crawlId, type, onTick) {
|
|
2546
|
+
let stopped = false;
|
|
2547
|
+
const tick = async () => {
|
|
2548
|
+
if (stopped) return;
|
|
2549
|
+
try {
|
|
2550
|
+
const data = await api(`/api/crawls/${encodeURIComponent(crawlId)}/check-progress?type=${encodeURIComponent(type)}`);
|
|
2551
|
+
if (!stopped && data?.progress) onTick(data.progress);
|
|
2552
|
+
} catch {
|
|
2553
|
+
// ignore transient poll errors while the POST is still running
|
|
2554
|
+
}
|
|
2555
|
+
};
|
|
2556
|
+
tick();
|
|
2557
|
+
const timer = setInterval(tick, 350);
|
|
2558
|
+
return () => {
|
|
2559
|
+
stopped = true;
|
|
2560
|
+
clearInterval(timer);
|
|
2561
|
+
};
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2400
2564
|
async function triggerLinkCheck(scope = 'all') {
|
|
2401
2565
|
if (!state.currentCrawl) return;
|
|
2402
2566
|
const btn1 = $('btnCheckLinks');
|
|
@@ -2405,21 +2569,40 @@ async function triggerLinkCheck(scope = 'all') {
|
|
|
2405
2569
|
btn2.disabled = true;
|
|
2406
2570
|
btn1.textContent = 'Prüfe…';
|
|
2407
2571
|
btn2.textContent = 'Prüfe Links…';
|
|
2572
|
+
setJobProgressUi('links', { visible: true, phase: 'Sammle Links…', checked: 0, total: 0, indeterminate: true });
|
|
2573
|
+
const stopPoll = startCheckProgressPoll(state.currentCrawl.id, 'links', (p) => {
|
|
2574
|
+
setJobProgressUi('links', {
|
|
2575
|
+
visible: true,
|
|
2576
|
+
phase: p.phase || 'Prüfe Links…',
|
|
2577
|
+
checked: p.checked || 0,
|
|
2578
|
+
total: p.total || 0,
|
|
2579
|
+
indeterminate: !(p.total > 0)
|
|
2580
|
+
});
|
|
2581
|
+
});
|
|
2408
2582
|
try {
|
|
2409
2583
|
const { linkCheck } = await api(`/api/crawls/${encodeURIComponent(state.currentCrawl.id)}/check-links`, {
|
|
2410
2584
|
method: 'POST',
|
|
2411
2585
|
body: JSON.stringify({ scope, auth: state.lastAuth })
|
|
2412
2586
|
});
|
|
2413
2587
|
state.currentCrawl.linkCheck = linkCheck;
|
|
2588
|
+
setJobProgressUi('links', {
|
|
2589
|
+
visible: true,
|
|
2590
|
+
phase: 'Fertig',
|
|
2591
|
+
checked: linkCheck.checked || linkCheck.total || 0,
|
|
2592
|
+
total: linkCheck.total || 0
|
|
2593
|
+
});
|
|
2414
2594
|
await loadCrawlById(state.currentCrawl.id);
|
|
2415
2595
|
showToast(`Link-Check fertig: ${linkCheck.brokenCount} defekte Links gefunden.`);
|
|
2416
2596
|
} catch (err) {
|
|
2597
|
+
setJobProgressUi('links', { visible: true, phase: `Fehler: ${err.message}`, checked: 0, total: 0 });
|
|
2417
2598
|
showToast(`Link-Check Fehler: ${err.message}`);
|
|
2418
2599
|
} finally {
|
|
2600
|
+
stopPoll();
|
|
2419
2601
|
btn1.disabled = false;
|
|
2420
2602
|
btn2.disabled = false;
|
|
2421
2603
|
btn1.textContent = 'Links prüfen';
|
|
2422
2604
|
btn2.textContent = 'Link-Check starten';
|
|
2605
|
+
setTimeout(() => setJobProgressUi('links', { visible: false, phase: '' }), 1800);
|
|
2423
2606
|
}
|
|
2424
2607
|
}
|
|
2425
2608
|
|
|
@@ -2525,6 +2708,22 @@ async function runRedirectCheck() {
|
|
|
2525
2708
|
const btn = $('btnRunRedirectCheck');
|
|
2526
2709
|
btn.disabled = true;
|
|
2527
2710
|
$('redirectCheckStatus').textContent = 'Prüfe Weiterleitungen…';
|
|
2711
|
+
setJobProgressUi('redirects', {
|
|
2712
|
+
visible: true,
|
|
2713
|
+
phase: oldSitemapUrl ? 'Lade alte Sitemap…' : 'Prüfe Weiterleitungen…',
|
|
2714
|
+
checked: 0,
|
|
2715
|
+
total: entries.length || 0,
|
|
2716
|
+
indeterminate: !entries.length
|
|
2717
|
+
});
|
|
2718
|
+
const stopPoll = startCheckProgressPoll(state.currentCrawl.id, 'redirects', (p) => {
|
|
2719
|
+
setJobProgressUi('redirects', {
|
|
2720
|
+
visible: true,
|
|
2721
|
+
phase: p.phase || 'Prüfe Weiterleitungen…',
|
|
2722
|
+
checked: p.checked || 0,
|
|
2723
|
+
total: p.total || 0,
|
|
2724
|
+
indeterminate: !(p.total > 0)
|
|
2725
|
+
});
|
|
2726
|
+
});
|
|
2528
2727
|
try {
|
|
2529
2728
|
const { redirectChecks } = await api(`/api/crawls/${encodeURIComponent(state.currentCrawl.id)}/check-redirects`, {
|
|
2530
2729
|
method: 'POST',
|
|
@@ -2533,13 +2732,22 @@ async function runRedirectCheck() {
|
|
|
2533
2732
|
state.currentCrawl.redirectChecks = redirectChecks;
|
|
2534
2733
|
renderHeaderState();
|
|
2535
2734
|
renderRedirectsTab();
|
|
2735
|
+
setJobProgressUi('redirects', {
|
|
2736
|
+
visible: true,
|
|
2737
|
+
phase: 'Fertig',
|
|
2738
|
+
checked: redirectChecks.length,
|
|
2739
|
+
total: redirectChecks.length
|
|
2740
|
+
});
|
|
2536
2741
|
$('redirectCheckStatus').textContent = `${redirectChecks.length} URLs geprüft.`;
|
|
2537
2742
|
showToast(`${redirectChecks.length} Redirects geprüft!`);
|
|
2538
2743
|
} catch (err) {
|
|
2744
|
+
setJobProgressUi('redirects', { visible: true, phase: `Fehler: ${err.message}`, checked: 0, total: 0 });
|
|
2539
2745
|
$('redirectCheckStatus').textContent = `Fehler: ${err.message}`;
|
|
2540
2746
|
showToast(err.message);
|
|
2541
2747
|
} finally {
|
|
2748
|
+
stopPoll();
|
|
2542
2749
|
btn.disabled = false;
|
|
2750
|
+
setTimeout(() => setJobProgressUi('redirects', { visible: false, phase: '' }), 1800);
|
|
2543
2751
|
}
|
|
2544
2752
|
}
|
|
2545
2753
|
|
|
@@ -2605,18 +2813,36 @@ function renderScriptsTab() {
|
|
|
2605
2813
|
}
|
|
2606
2814
|
|
|
2607
2815
|
/* ==================== DETAIL DRAWER ==================== */
|
|
2608
|
-
function
|
|
2816
|
+
function highlightDrawerFocus(focusId) {
|
|
2817
|
+
const body = $('drawerBody');
|
|
2818
|
+
if (!body || !focusId) return;
|
|
2819
|
+
body.querySelectorAll('.drawer-focus-flash').forEach((el) => el.classList.remove('drawer-focus-flash'));
|
|
2820
|
+
const target = body.querySelector(`[data-drawer-focus="${CSS.escape(focusId)}"]`);
|
|
2821
|
+
if (!target) return;
|
|
2822
|
+
target.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
2823
|
+
void target.offsetWidth;
|
|
2824
|
+
target.classList.add('drawer-focus-flash');
|
|
2825
|
+
clearTimeout(highlightDrawerFocus._t);
|
|
2826
|
+
highlightDrawerFocus._t = setTimeout(() => target.classList.remove('drawer-focus-flash'), 1300);
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
function openDrawer(pageUrl, initialTab = 'headings', focusId = null) {
|
|
2609
2830
|
const page = (state.currentCrawl?.pages || []).find((p) => p.url === pageUrl);
|
|
2610
2831
|
if (!page) return;
|
|
2611
2832
|
state.drawerPageUrl = pageUrl;
|
|
2612
2833
|
state.drawerTab = initialTab;
|
|
2834
|
+
state.drawerFocus = focusId || null;
|
|
2613
2835
|
state.drawerTrigger = state.drawerPageUrl === null ? document.activeElement : state.drawerTrigger;
|
|
2614
2836
|
|
|
2615
|
-
|
|
2837
|
+
const failReason = pageCrawlFailureReason(page);
|
|
2838
|
+
$('drawerTitle').textContent = (page.error || page.status === 0)
|
|
2839
|
+
? (failReason || 'Seite nicht crawlbar')
|
|
2840
|
+
: (page.title || page.path);
|
|
2616
2841
|
$('drawerUrlLink').textContent = page.url;
|
|
2617
2842
|
$('drawerUrlLink').href = page.url;
|
|
2618
2843
|
$('drawerStatusBadges').innerHTML = `
|
|
2619
2844
|
${renderStatusPill(page.status, page.error)}
|
|
2845
|
+
${failReason && (page.error || page.status === 0) ? `<span class="pill pill-red" title="${escapeHtml(failReason)}">${escapeHtml(failReason)}</span>` : ''}
|
|
2620
2846
|
<span class="pill ${page.indexable ? 'pill-green' : 'pill-amber'}">${page.indexable ? 'Index' : 'Noindex'}</span>
|
|
2621
2847
|
<span class="pill ${page.followable ? 'pill-green' : 'pill-amber'}">${page.followable ? 'Follow' : 'Nofollow'}</span>
|
|
2622
2848
|
<span class="pill ${page.inSitemap ? 'pill-green' : 'pill-gray'}">Sitemap: ${page.inSitemap ? 'Ja' : 'Nein'}</span>
|
|
@@ -2628,6 +2854,7 @@ function openDrawer(pageUrl, initialTab = 'headings') {
|
|
|
2628
2854
|
$('detailDrawer').classList.remove('hidden');
|
|
2629
2855
|
$('detailDrawer').setAttribute('aria-hidden', 'false');
|
|
2630
2856
|
renderDrawerBody();
|
|
2857
|
+
if (focusId) requestAnimationFrame(() => highlightDrawerFocus(focusId));
|
|
2631
2858
|
$('btnCloseDrawer').focus();
|
|
2632
2859
|
}
|
|
2633
2860
|
|
|
@@ -2641,8 +2868,8 @@ function closeDrawer() {
|
|
|
2641
2868
|
}
|
|
2642
2869
|
|
|
2643
2870
|
/* ==================== BILD-VORSCHAU (ALT-FEHLER) ====================
|
|
2644
|
-
*
|
|
2645
|
-
*
|
|
2871
|
+
* Thumbnail im Drawer; Klick öffnet Seitenvorschau (HTML re-fetch + scroll/highlight).
|
|
2872
|
+
* Optional: reines Bild in Lightbox. */
|
|
2646
2873
|
const IMG_THUMB_FALLBACK_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56"><rect width="56" height="56" rx="8" fill="#1f1f1f"/><path d="M20 36 L26 28 L32 34 L36 30 L44 38" stroke="#777" stroke-width="2" fill="none"/><circle cx="24" cy="22" r="3" fill="#777"/></svg>';
|
|
2647
2874
|
|
|
2648
2875
|
function resolveImgSrc(page, src) {
|
|
@@ -2685,6 +2912,176 @@ function openImageLightbox(src, label) {
|
|
|
2685
2912
|
box.classList.remove('hidden');
|
|
2686
2913
|
}
|
|
2687
2914
|
|
|
2915
|
+
/** Close in-page image preview modal (iframe srcdoc). */
|
|
2916
|
+
function closePageImagePreview() {
|
|
2917
|
+
const box = $('pageImgPreview');
|
|
2918
|
+
if (!box) return;
|
|
2919
|
+
const frame = box.querySelector('.page-img-preview-frame');
|
|
2920
|
+
if (frame) {
|
|
2921
|
+
frame.removeAttribute('srcdoc');
|
|
2922
|
+
frame.src = 'about:blank';
|
|
2923
|
+
}
|
|
2924
|
+
box.classList.add('hidden');
|
|
2925
|
+
if (closePageImagePreview._onMsg) {
|
|
2926
|
+
window.removeEventListener('message', closePageImagePreview._onMsg);
|
|
2927
|
+
closePageImagePreview._onMsg = null;
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
/**
|
|
2932
|
+
* Opens a same-origin HTML preview of the crawled page, scrolls to the
|
|
2933
|
+
* matching <img>, and briefly highlights it. Fallback: German miss message
|
|
2934
|
+
* + open page / image-only lightbox.
|
|
2935
|
+
*/
|
|
2936
|
+
function openPageImagePreview(page, imgEntry) {
|
|
2937
|
+
const crawlId = state.currentCrawl?.id;
|
|
2938
|
+
if (!crawlId || !page) return;
|
|
2939
|
+
|
|
2940
|
+
const pageUrl = page.url;
|
|
2941
|
+
const rawSrc = imgEntry?.src || '';
|
|
2942
|
+
const resolvedSrc = resolveImgSrc(page, rawSrc);
|
|
2943
|
+
if (!resolvedSrc || resolvedSrc.startsWith('data:')) {
|
|
2944
|
+
openImageLightbox(resolvedSrc || '', `${rawSrc || '(inline/data)'} — Kein alt-Attribut`);
|
|
2945
|
+
return;
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
let box = $('pageImgPreview');
|
|
2949
|
+
if (!box) {
|
|
2950
|
+
box = document.createElement('div');
|
|
2951
|
+
box.id = 'pageImgPreview';
|
|
2952
|
+
box.className = 'modal-backdrop page-img-preview-backdrop';
|
|
2953
|
+
box.innerHTML = `
|
|
2954
|
+
<div class="page-img-preview-card" role="dialog" aria-modal="true" aria-label="Bild auf der Seite">
|
|
2955
|
+
<div class="page-img-preview-head">
|
|
2956
|
+
<div class="page-img-preview-titles">
|
|
2957
|
+
<strong>Bild auf der Seite</strong>
|
|
2958
|
+
<span class="page-img-preview-url mono-src"></span>
|
|
2959
|
+
</div>
|
|
2960
|
+
<button type="button" class="btn-close" aria-label="Schließen">×</button>
|
|
2961
|
+
</div>
|
|
2962
|
+
<div class="page-img-preview-status muted small" hidden></div>
|
|
2963
|
+
<div class="page-img-preview-frame-wrap">
|
|
2964
|
+
<div class="page-img-preview-loading">Lade Seitenvorschau…</div>
|
|
2965
|
+
<iframe class="page-img-preview-frame" title="Seitenvorschau" sandbox="allow-scripts allow-same-origin allow-popups"></iframe>
|
|
2966
|
+
</div>
|
|
2967
|
+
<div class="page-img-preview-foot">
|
|
2968
|
+
<a class="btn btn-outline btn-xs page-img-preview-open-page" href="#" target="_blank" rel="noopener">Seite öffnen ↗</a>
|
|
2969
|
+
<button type="button" class="btn btn-outline btn-xs page-img-preview-only-img">Nur Bild</button>
|
|
2970
|
+
<button type="button" class="btn btn-primary btn-xs page-img-preview-close">Schließen</button>
|
|
2971
|
+
</div>
|
|
2972
|
+
</div>`;
|
|
2973
|
+
box.querySelector('.btn-close').addEventListener('click', closePageImagePreview);
|
|
2974
|
+
box.querySelector('.page-img-preview-close').addEventListener('click', closePageImagePreview);
|
|
2975
|
+
box.addEventListener('click', (e) => { if (e.target === box) closePageImagePreview(); });
|
|
2976
|
+
box.querySelector('.page-img-preview-only-img').addEventListener('click', () => {
|
|
2977
|
+
const src = box.dataset.imgSrc || '';
|
|
2978
|
+
const label = box.dataset.imgLabel || '';
|
|
2979
|
+
openImageLightbox(src, label);
|
|
2980
|
+
});
|
|
2981
|
+
document.body.appendChild(box);
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
box.dataset.imgSrc = resolvedSrc;
|
|
2985
|
+
box.dataset.imgLabel = `${rawSrc || resolvedSrc} — Kein alt-Attribut`;
|
|
2986
|
+
box.querySelector('.page-img-preview-url').textContent = pageUrl;
|
|
2987
|
+
const openPage = box.querySelector('.page-img-preview-open-page');
|
|
2988
|
+
openPage.href = pageUrl;
|
|
2989
|
+
const statusEl = box.querySelector('.page-img-preview-status');
|
|
2990
|
+
statusEl.hidden = true;
|
|
2991
|
+
statusEl.textContent = '';
|
|
2992
|
+
statusEl.classList.remove('is-miss', 'is-ok');
|
|
2993
|
+
const loading = box.querySelector('.page-img-preview-loading');
|
|
2994
|
+
loading.hidden = false;
|
|
2995
|
+
loading.textContent = 'Lade Seitenvorschau…';
|
|
2996
|
+
const frame = box.querySelector('.page-img-preview-frame');
|
|
2997
|
+
frame.removeAttribute('srcdoc');
|
|
2998
|
+
frame.src = 'about:blank';
|
|
2999
|
+
box.classList.remove('hidden');
|
|
3000
|
+
|
|
3001
|
+
if (closePageImagePreview._onMsg) {
|
|
3002
|
+
window.removeEventListener('message', closePageImagePreview._onMsg);
|
|
3003
|
+
}
|
|
3004
|
+
closePageImagePreview._onMsg = (ev) => {
|
|
3005
|
+
const data = ev?.data;
|
|
3006
|
+
if (!data || data.type !== 'scu-img-preview') return;
|
|
3007
|
+
if (data.found) {
|
|
3008
|
+
statusEl.hidden = true;
|
|
3009
|
+
statusEl.classList.remove('is-miss');
|
|
3010
|
+
} else {
|
|
3011
|
+
statusEl.hidden = false;
|
|
3012
|
+
statusEl.classList.add('is-miss');
|
|
3013
|
+
statusEl.textContent = 'Bild im geladenen HTML nicht gefunden (oft lazy/JS-gerendert). Seite oder Einzelbild öffnen.';
|
|
3014
|
+
}
|
|
3015
|
+
};
|
|
3016
|
+
window.addEventListener('message', closePageImagePreview._onMsg);
|
|
3017
|
+
|
|
3018
|
+
const headers = {};
|
|
3019
|
+
const needsClientAuth = Boolean(state.lastAuth && (state.lastAuth.username || state.lastAuth.password));
|
|
3020
|
+
if (needsClientAuth) {
|
|
3021
|
+
try {
|
|
3022
|
+
headers.Authorization = `Basic ${btoa(`${state.lastAuth.username || ''}:${state.lastAuth.password || ''}`)}`;
|
|
3023
|
+
} catch {
|
|
3024
|
+
/* ignore btoa failures on unusual credentials */
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
const qs = new URLSearchParams({
|
|
3029
|
+
url: pageUrl,
|
|
3030
|
+
targetSrc: resolvedSrc
|
|
3031
|
+
});
|
|
3032
|
+
const previewApi = `/api/crawls/${encodeURIComponent(crawlId)}/pages/preview?${qs}`;
|
|
3033
|
+
|
|
3034
|
+
const showPreviewError = (msg) => {
|
|
3035
|
+
loading.hidden = false;
|
|
3036
|
+
loading.textContent = msg;
|
|
3037
|
+
statusEl.hidden = false;
|
|
3038
|
+
statusEl.classList.add('is-miss');
|
|
3039
|
+
statusEl.textContent = `${msg} Du kannst die Originalseite oder nur das Bild öffnen.`;
|
|
3040
|
+
};
|
|
3041
|
+
|
|
3042
|
+
// Prefer iframe src=API (response CSP allows remote CSS/imgs). Use srcdoc only
|
|
3043
|
+
// when Basic auth must be sent as a request header (navigations cannot).
|
|
3044
|
+
if (!needsClientAuth) {
|
|
3045
|
+
frame.addEventListener('load', () => {
|
|
3046
|
+
loading.hidden = true;
|
|
3047
|
+
try {
|
|
3048
|
+
const doc = frame.contentDocument;
|
|
3049
|
+
const raw = (doc?.body?.innerText || '').trim();
|
|
3050
|
+
if (raw.startsWith('{') && raw.includes('"error"')) {
|
|
3051
|
+
const parsed = JSON.parse(raw);
|
|
3052
|
+
frame.src = 'about:blank';
|
|
3053
|
+
showPreviewError(parsed.error || 'Vorschau fehlgeschlagen.');
|
|
3054
|
+
}
|
|
3055
|
+
} catch {
|
|
3056
|
+
/* cross-read should not fail for same-origin API iframe */
|
|
3057
|
+
}
|
|
3058
|
+
}, { once: true });
|
|
3059
|
+
frame.src = previewApi;
|
|
3060
|
+
return;
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
(async () => {
|
|
3064
|
+
try {
|
|
3065
|
+
const res = await fetch(previewApi, { headers });
|
|
3066
|
+
const ct = res.headers.get('content-type') || '';
|
|
3067
|
+
if (!res.ok) {
|
|
3068
|
+
let msg = `Vorschau fehlgeschlagen (HTTP ${res.status}).`;
|
|
3069
|
+
if (ct.includes('application/json')) {
|
|
3070
|
+
const body = await res.json().catch(() => null);
|
|
3071
|
+
if (body?.error) msg = body.error;
|
|
3072
|
+
}
|
|
3073
|
+
showPreviewError(msg);
|
|
3074
|
+
return;
|
|
3075
|
+
}
|
|
3076
|
+
const html = await res.text();
|
|
3077
|
+
loading.hidden = true;
|
|
3078
|
+
frame.srcdoc = html;
|
|
3079
|
+
} catch (err) {
|
|
3080
|
+
showPreviewError(`Netzwerkfehler: ${err.message || err}`);
|
|
3081
|
+
}
|
|
3082
|
+
})();
|
|
3083
|
+
}
|
|
3084
|
+
|
|
2688
3085
|
function renderDrawerBody() {
|
|
2689
3086
|
const page = (state.currentCrawl?.pages || []).find((p) => p.url === state.drawerPageUrl);
|
|
2690
3087
|
if (!page) return;
|
|
@@ -2701,17 +3098,17 @@ function renderDrawerBody() {
|
|
|
2701
3098
|
if (state.drawerTab === 'audit') {
|
|
2702
3099
|
const a = page.audit || { overall: 0, grade: '–', categories: { seo: 0, aeo: 0, hygiene: 0, speed: 0, mobile: 0, wcag: 0 }, issues: [], passedCount: 0 };
|
|
2703
3100
|
a.categories = { seo: 0, aeo: 0, hygiene: 0, speed: 0, mobile: 0, wcag: 0, ...(a.categories || {}) };
|
|
2704
|
-
const catNames = { seo: 'SEO', aeo: 'AEO / KI', hygiene: 'Hygiene', speed: 'Speed', mobile: 'Mobile', wcag: 'WCAG' };
|
|
3101
|
+
const catNames = { seo: 'SEO', aeo: 'AEO / KI', hygiene: 'Hygiene', speed: 'Speed', mobile: 'Mobile', wcag: 'WCAG 2.2' };
|
|
2705
3102
|
const catMeta = [
|
|
2706
3103
|
{ k: 'seo', label: 'SEO (25 %)', v: a.categories.seo },
|
|
2707
3104
|
{ k: 'aeo', label: 'AEO / KI (15 %)', v: a.categories.aeo },
|
|
2708
3105
|
{ k: 'hygiene', label: 'Hygiene (15 %)', v: a.categories.hygiene },
|
|
2709
3106
|
{ k: 'speed', label: 'Speed (15 %)', v: a.categories.speed },
|
|
2710
3107
|
{ k: 'mobile', label: 'Mobile (15 %)', v: a.categories.mobile },
|
|
2711
|
-
{ k: 'wcag', label: 'WCAG (15 %)', v: a.categories.wcag }
|
|
3108
|
+
{ k: 'wcag', label: 'WCAG 2.2 (15 %)', v: a.categories.wcag }
|
|
2712
3109
|
];
|
|
2713
3110
|
body.innerHTML = `
|
|
2714
|
-
<div class="detail-section">
|
|
3111
|
+
<div class="detail-section" data-drawer-focus="audit-score">
|
|
2715
3112
|
<div class="audit-hero-grid" style="margin-top:0;grid-template-columns:150px 1fr">
|
|
2716
3113
|
<div class="audit-overall-box" style="padding:14px">
|
|
2717
3114
|
<div class="kpi-label">Score</div>
|
|
@@ -2730,7 +3127,7 @@ function renderDrawerBody() {
|
|
|
2730
3127
|
</div>
|
|
2731
3128
|
</div>
|
|
2732
3129
|
|
|
2733
|
-
<div class="detail-section">
|
|
3130
|
+
<div class="detail-section" data-drawer-focus="audit-issues">
|
|
2734
3131
|
<h3>Begründungen & Punktabzüge (${a.issues?.length || 0})</h3>
|
|
2735
3132
|
${a.issues?.length ? a.issues.map((iss) => {
|
|
2736
3133
|
const boxCls = iss.severity === 'critical' ? 'err' : iss.severity === 'warning' ? 'warn' : '';
|
|
@@ -2743,13 +3140,13 @@ function renderDrawerBody() {
|
|
|
2743
3140
|
<div class="small" style="color:var(--text-secondary)">${escapeHtml(iss.reason)}</div>
|
|
2744
3141
|
</div>
|
|
2745
3142
|
`;
|
|
2746
|
-
}).join('') : `<div class="issue-callout ok">Keine Abzüge – diese Seite erfüllt alle geprüften SEO-, AEO-, Hygiene-, Speed-, Mobile- und WCAG-Kriterien!</div>`}
|
|
3143
|
+
}).join('') : `<div class="issue-callout ok">Keine Abzüge – diese Seite erfüllt alle geprüften SEO-, AEO-, Hygiene-, Speed-, Mobile- und WCAG 2.2-Kriterien!</div>`}
|
|
2747
3144
|
</div>
|
|
2748
3145
|
`;
|
|
2749
3146
|
} else if (state.drawerTab === 'headings') {
|
|
2750
3147
|
const c = page.headingCounts || { h1: 0, h2: 0, h3: 0, h4: 0, h5: 0, h6: 0, total: 0 };
|
|
2751
3148
|
body.innerHTML = `
|
|
2752
|
-
<div class="detail-section">
|
|
3149
|
+
<div class="detail-section" data-drawer-focus="headings-tree">
|
|
2753
3150
|
<div class="toolbar-row" style="margin-bottom:10px">
|
|
2754
3151
|
<div class="heading-counts-row">
|
|
2755
3152
|
<span class="h-mini ${c.h1 === 1 ? 'ok' : c.h1 === 0 ? 'err' : 'warn'}">H1: ${c.h1}</span>
|
|
@@ -2773,25 +3170,31 @@ function renderDrawerBody() {
|
|
|
2773
3170
|
} else if (state.drawerTab === 'seo') {
|
|
2774
3171
|
const titleStatus = page.titleLength === 0 ? 'pill-red' : (page.titleLength <= 60 ? 'pill-green' : 'pill-amber');
|
|
2775
3172
|
const descStatus = page.metaDescriptionLength === 0 ? 'pill-red' : (page.metaDescriptionLength <= 160 ? 'pill-green' : 'pill-amber');
|
|
3173
|
+
const robotsBlockedLabel = page.blockedByRobotsTxt
|
|
3174
|
+
? (page.robotsDisallowRule
|
|
3175
|
+
? `Durch robots.txt blockiert: Disallow ${page.robotsDisallowRule}`
|
|
3176
|
+
: 'Durch robots.txt blockiert')
|
|
3177
|
+
: null;
|
|
2776
3178
|
body.innerHTML = `
|
|
2777
3179
|
<div class="detail-section meta-grid">
|
|
2778
|
-
<div class="meta-box">
|
|
3180
|
+
<div class="meta-box" data-drawer-focus="meta-title">
|
|
2779
3181
|
<div class="meta-box-label"><span>${uiIcon('title')}Meta Title</span><span class="pill ${titleStatus}">${page.titleLength} Zeichen</span></div>
|
|
2780
3182
|
<div>${escapeHtml(page.title || '- Fehlt -')}</div>
|
|
2781
3183
|
</div>
|
|
2782
|
-
<div class="meta-box">
|
|
3184
|
+
<div class="meta-box" data-drawer-focus="meta-desc">
|
|
2783
3185
|
<div class="meta-box-label"><span>${uiIcon('description')}Meta Description</span><span class="pill ${descStatus}">${page.metaDescriptionLength} Zeichen</span></div>
|
|
2784
3186
|
<div>${escapeHtml(page.metaDescription || '- Fehlt -')}</div>
|
|
2785
3187
|
</div>
|
|
2786
|
-
<div class="meta-box">
|
|
3188
|
+
<div class="meta-box" data-drawer-focus="meta-canonical">
|
|
2787
3189
|
<div class="meta-box-label"><span>${uiIcon('link')}Canonical</span><span class="pill ${page.canonicalType === 'self' ? 'pill-green' : page.canonicalType === 'other' ? 'pill-blue' : 'pill-amber'}">${escapeHtml(page.canonicalType)}</span></div>
|
|
2788
3190
|
<div style="font-family:monospace;font-size:12px;word-break:break-all">${escapeHtml(page.canonical || 'Kein Canonical-Tag gesetzt')}</div>
|
|
2789
3191
|
</div>
|
|
2790
|
-
<div class="meta-box">
|
|
2791
|
-
<div class="meta-box-label"><span>${uiIcon('shield')}Robots & Crawlability</span><span>${
|
|
3192
|
+
<div class="meta-box" data-drawer-focus="meta-robots">
|
|
3193
|
+
<div class="meta-box-label"><span>${uiIcon('shield')}Robots & Crawlability</span><span>${robotsBlockedLabel ? `<span class="pill pill-red" title="${escapeHtml(robotsBlockedLabel)}">In robots.txt blockiert</span>` : '<span class="pill pill-green">robots.txt OK</span>'}</span></div>
|
|
2792
3194
|
<div class="meta-box-facts"><span>Robots <code>${escapeHtml(page.robotsRaw || 'index, follow')}</code></span><span>Sprache <code>${escapeHtml(page.lang || '-')}</code></span><span>Wörter <strong>${page.wordCount}</strong></span></div>
|
|
3195
|
+
${robotsBlockedLabel ? `<div class="small" style="color:var(--red-text);margin-top:6px">${escapeHtml(robotsBlockedLabel)}</div>` : ''}
|
|
2793
3196
|
</div>
|
|
2794
|
-
<div class="meta-box">
|
|
3197
|
+
<div class="meta-box" data-drawer-focus="meta-og">
|
|
2795
3198
|
<div class="meta-box-label"><span>${uiIcon('image')}Open Graph (Social Preview)</span><span>${escapeHtml(page.og?.type || '')}</span></div>
|
|
2796
3199
|
<div><strong>${escapeHtml(page.og?.title || '–')}</strong></div>
|
|
2797
3200
|
<div class="muted small">${escapeHtml(page.og?.description || '–')}</div>
|
|
@@ -2799,14 +3202,14 @@ function renderDrawerBody() {
|
|
|
2799
3202
|
</div>
|
|
2800
3203
|
</div>
|
|
2801
3204
|
|
|
2802
|
-
<div class="detail-section">
|
|
2803
|
-
<h3>Bilder & Alt-Texte (${page.imageCount} Bilder · ${page.imagesMissingAltCount} ohne Alt)</h3>
|
|
3205
|
+
<div class="detail-section" data-drawer-focus="images-alt">
|
|
3206
|
+
<h3>Bilder & Alt-Texte (${page.imageCount} Bilder · ${page.imagesMissingAltCount} ohne Alt-Attribut)</h3>
|
|
2804
3207
|
${page.imagesMissingAlt?.length ? `
|
|
2805
3208
|
<div class="meta-grid">
|
|
2806
3209
|
${page.imagesMissingAlt.map((img, i) => `
|
|
2807
|
-
<button type="button" class="meta-box img-issue-box" data-img-issue="${i}" title="Klicken: Bild
|
|
3210
|
+
<button type="button" class="meta-box img-issue-box" data-img-issue="${i}" title="Klicken: Bild auf der Seite anzeigen">
|
|
2808
3211
|
<span class="img-issue-left">
|
|
2809
|
-
<span class="pill
|
|
3212
|
+
<span class="pill pill-red">Kein alt-Attribut</span>
|
|
2810
3213
|
<img class="img-issue-thumb" src="${escapeHtml(resolveImgSrc(page, img.src))}" alt="" loading="lazy"
|
|
2811
3214
|
onerror="this.classList.add('img-thumb-fail')" />
|
|
2812
3215
|
</span>
|
|
@@ -2814,7 +3217,7 @@ function renderDrawerBody() {
|
|
|
2814
3217
|
</button>
|
|
2815
3218
|
`).join('')}
|
|
2816
3219
|
</div>
|
|
2817
|
-
` : `<div class="issue-callout ok">
|
|
3220
|
+
` : `<div class="issue-callout ok">Keine fehlenden Alt-Attribute (dekorative alt="" sind OK). ${page.imageCount} Bilder geprüft.</div>`}
|
|
2818
3221
|
</div>
|
|
2819
3222
|
`;
|
|
2820
3223
|
} else if (state.drawerTab === 'schema') {
|
|
@@ -2824,7 +3227,7 @@ function renderDrawerBody() {
|
|
|
2824
3227
|
const manualRows = detected.filter((t) => !seenToolNames.has(t.name));
|
|
2825
3228
|
const totalRows = autoTools.length + manualRows.length;
|
|
2826
3229
|
body.innerHTML = `
|
|
2827
|
-
<div class="detail-section">
|
|
3230
|
+
<div class="detail-section" data-drawer-focus="tracking">
|
|
2828
3231
|
<h3>${uiIcon('tracking')}Erkanntes Tracking (${totalRows})</h3>
|
|
2829
3232
|
${totalRows ? (
|
|
2830
3233
|
autoTools.map((t) => `
|
|
@@ -2842,7 +3245,7 @@ function renderDrawerBody() {
|
|
|
2842
3245
|
) : `<div class="issue-callout warn">Kein bekanntes Tracking-Script auf dieser Seite erkannt.</div>`}
|
|
2843
3246
|
</div>
|
|
2844
3247
|
|
|
2845
|
-
<div class="detail-section">
|
|
3248
|
+
<div class="detail-section" data-drawer-focus="schema-jsonld">
|
|
2846
3249
|
<h3>${uiIcon('schema')}JSON-LD Schema (${page.schemas?.length || 0})</h3>
|
|
2847
3250
|
${page.schemas?.length ? page.schemas.map((s) => `
|
|
2848
3251
|
<div style="margin-bottom:12px">
|
|
@@ -2855,7 +3258,7 @@ function renderDrawerBody() {
|
|
|
2855
3258
|
`).join('') : `<div class="muted">Kein JSON-LD Schema gefunden.</div>`}
|
|
2856
3259
|
</div>
|
|
2857
3260
|
|
|
2858
|
-
<div class="detail-section">
|
|
3261
|
+
<div class="detail-section" data-drawer-focus="external-scripts">
|
|
2859
3262
|
<h3>Externe Scripts auf dieser Seite (${page.externalScripts?.length || 0})</h3>
|
|
2860
3263
|
${page.externalScripts?.length ? `
|
|
2861
3264
|
<div class="meta-box" style="font-family:monospace;font-size:11.5px;line-height:1.7;word-break:break-all">
|
|
@@ -2891,26 +3294,26 @@ function renderDrawerBody() {
|
|
|
2891
3294
|
|
|
2892
3295
|
body.innerHTML = `
|
|
2893
3296
|
${chain.length ? `
|
|
2894
|
-
<div class="detail-section">
|
|
3297
|
+
<div class="detail-section" data-drawer-focus="redirect-chain">
|
|
2895
3298
|
<h3>Redirect-Kette (${chain.length} Hop${chain.length > 1 ? 's' : ''})</h3>
|
|
2896
3299
|
<div class="meta-box" style="font-family:monospace;font-size:12px">
|
|
2897
3300
|
${chain.map((h) => `<div><span class="pill pill-amber">${h.status}</span> ${escapeHtml(h.url)} → ${escapeHtml(h.location)}</div>`).join('')}
|
|
2898
3301
|
<div style="margin-top:4px"><span class="pill pill-green">${page.finalStatus}</span> ${escapeHtml(page.finalUrl)}</div>
|
|
2899
3302
|
</div>
|
|
2900
3303
|
</div>
|
|
2901
|
-
` :
|
|
2902
|
-
<div class="detail-section">
|
|
3304
|
+
` : `<div class="detail-section" data-drawer-focus="redirect-chain" hidden></div>`}
|
|
3305
|
+
<div class="detail-section" data-drawer-focus="external-links">
|
|
2903
3306
|
<h3>Externe Links (${page.externalLinks?.length || 0})</h3>
|
|
2904
3307
|
${renderLinkList(page.externalLinks || [])}
|
|
2905
3308
|
</div>
|
|
2906
|
-
<div class="detail-section">
|
|
3309
|
+
<div class="detail-section" data-drawer-focus="internal-links">
|
|
2907
3310
|
<h3>Interne Links (${page.internalLinks?.length || 0})</h3>
|
|
2908
3311
|
${renderLinkList(page.internalLinks || [])}
|
|
2909
3312
|
</div>
|
|
2910
3313
|
`;
|
|
2911
3314
|
} else if (state.drawerTab === 'note') {
|
|
2912
3315
|
body.innerHTML = `
|
|
2913
|
-
<div class="detail-section">
|
|
3316
|
+
<div class="detail-section" data-drawer-focus="note-editor">
|
|
2914
3317
|
<h3>Persönliche Notiz für ${escapeHtml(page.path)}</h3>
|
|
2915
3318
|
<label class="sr-only" for="drawerNoteInput">Persönliche Notiz für ${escapeHtml(page.path)}</label>
|
|
2916
3319
|
<textarea id="drawerNoteInput" class="drawer-note-input" rows="6" placeholder="z. B. H1 anpassen, Canonical prüfen, Redirect fehlt...">${escapeHtml(page.note || '')}</textarea>
|
|
@@ -3247,14 +3650,22 @@ function bindEvents() {
|
|
|
3247
3650
|
renderPagesTable();
|
|
3248
3651
|
return;
|
|
3249
3652
|
}
|
|
3653
|
+
const deepCell = e.target.closest('td[data-drawer-tab]');
|
|
3654
|
+
if (deepCell) {
|
|
3655
|
+
const tr = deepCell.closest('tr[data-page-url]');
|
|
3656
|
+
if (tr) {
|
|
3657
|
+
openDrawer(tr.dataset.pageUrl, deepCell.dataset.drawerTab, deepCell.dataset.drawerFocus || null);
|
|
3658
|
+
return;
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3250
3661
|
const auditCell = e.target.closest('[data-open-audit]');
|
|
3251
3662
|
if (auditCell) {
|
|
3252
|
-
openDrawer(auditCell.dataset.openAudit, 'audit');
|
|
3663
|
+
openDrawer(auditCell.dataset.openAudit, 'audit', 'audit-score');
|
|
3253
3664
|
return;
|
|
3254
3665
|
}
|
|
3255
3666
|
const hCell = e.target.closest('[data-open-headings]');
|
|
3256
3667
|
if (hCell) {
|
|
3257
|
-
openDrawer(hCell.dataset.openHeadings, 'headings');
|
|
3668
|
+
openDrawer(hCell.dataset.openHeadings, 'headings', 'headings-tree');
|
|
3258
3669
|
return;
|
|
3259
3670
|
}
|
|
3260
3671
|
const tr = e.target.closest('tr[data-page-url]');
|
|
@@ -3389,10 +3800,14 @@ function bindEvents() {
|
|
|
3389
3800
|
$('btnExportAuditXlsx').addEventListener('click', () => downloadFile('xlsx', 'audit'));
|
|
3390
3801
|
$('btnExportAuditCsv').addEventListener('click', () => downloadFile('csv', 'audit'));
|
|
3391
3802
|
|
|
3392
|
-
// CSV & Excel (.xlsx) Exports
|
|
3393
|
-
const downloadFile = (ext, type) => {
|
|
3803
|
+
// CSV & Excel (.xlsx) Exports — pages/all respect visible column picker
|
|
3804
|
+
const downloadFile = (ext, type, withColumns = false) => {
|
|
3394
3805
|
if (!state.currentCrawl) return;
|
|
3395
|
-
|
|
3806
|
+
const params = new URLSearchParams({ type });
|
|
3807
|
+
if (withColumns && state.visibleColumns.size > 0) {
|
|
3808
|
+
params.set('cols', [...state.visibleColumns].join(','));
|
|
3809
|
+
}
|
|
3810
|
+
window.location.href = `/api/crawls/${encodeURIComponent(state.currentCrawl.id)}/export.${ext}?${params}`;
|
|
3396
3811
|
};
|
|
3397
3812
|
const currentExportType = () => (
|
|
3398
3813
|
state.activeTab === 'audit' ? 'audit'
|
|
@@ -3402,8 +3817,14 @@ function bindEvents() {
|
|
|
3402
3817
|
: state.activeTab === 'scripts' ? 'scripts'
|
|
3403
3818
|
: 'pages'
|
|
3404
3819
|
);
|
|
3405
|
-
$('btnExportCsv').addEventListener('click', () =>
|
|
3406
|
-
|
|
3820
|
+
$('btnExportCsv').addEventListener('click', () => {
|
|
3821
|
+
const type = currentExportType();
|
|
3822
|
+
downloadFile('csv', type, type === 'pages');
|
|
3823
|
+
});
|
|
3824
|
+
$('btnExportXlsx').addEventListener('click', () => {
|
|
3825
|
+
const type = state.activeTab === 'pages' ? 'all' : currentExportType();
|
|
3826
|
+
downloadFile('xlsx', type, type === 'all' || type === 'pages');
|
|
3827
|
+
});
|
|
3407
3828
|
$('btnExportHeadingsCsv').addEventListener('click', () => downloadFile('csv', 'headings'));
|
|
3408
3829
|
$('btnExportHeadingsXlsx').addEventListener('click', () => downloadFile('xlsx', 'headings'));
|
|
3409
3830
|
$('btnExportLinksCsv').addEventListener('click', () => downloadFile('csv', 'links'));
|
|
@@ -3508,7 +3929,7 @@ function bindEvents() {
|
|
|
3508
3929
|
// Drawer
|
|
3509
3930
|
$('btnCloseDrawer').addEventListener('click', closeDrawer);
|
|
3510
3931
|
$('drawerBackdrop').addEventListener('click', closeDrawer);
|
|
3511
|
-
// Alt-Fehler-Eintrag: Klick
|
|
3932
|
+
// Alt-Fehler-Eintrag: Klick → Seitenvorschau mit Scroll/Highlight (Lightbox optional)
|
|
3512
3933
|
$('drawerBody').addEventListener('click', (e) => {
|
|
3513
3934
|
const imgBox = e.target.closest('[data-img-issue]');
|
|
3514
3935
|
if (!imgBox) return;
|
|
@@ -3516,7 +3937,7 @@ function bindEvents() {
|
|
|
3516
3937
|
if (!page) return;
|
|
3517
3938
|
const img = (page.imagesMissingAlt || [])[Number(imgBox.dataset.imgIssue)];
|
|
3518
3939
|
if (!img) return;
|
|
3519
|
-
|
|
3940
|
+
openPageImagePreview(page, img);
|
|
3520
3941
|
});
|
|
3521
3942
|
// Link-Herkunft im Drawer: Klick springt zur Ursprungsseite (öffnet deren Drawer)
|
|
3522
3943
|
$('drawerBody').addEventListener('click', (e) => {
|
|
@@ -3535,6 +3956,7 @@ function bindEvents() {
|
|
|
3535
3956
|
const tab = e.target.closest('.drawer-tab');
|
|
3536
3957
|
if (!tab) return;
|
|
3537
3958
|
state.drawerTab = tab.dataset.dtab;
|
|
3959
|
+
state.drawerFocus = null;
|
|
3538
3960
|
renderDrawerBody();
|
|
3539
3961
|
});
|
|
3540
3962
|
$('drawerTabs').addEventListener('keydown', (e) => {
|
|
@@ -3603,6 +4025,16 @@ function bindEvents() {
|
|
|
3603
4025
|
return;
|
|
3604
4026
|
}
|
|
3605
4027
|
if (e.key === 'Escape') {
|
|
4028
|
+
const pagePreview = $('pageImgPreview');
|
|
4029
|
+
const imgLb = $('imgLightbox');
|
|
4030
|
+
if (pagePreview && !pagePreview.classList.contains('hidden')) {
|
|
4031
|
+
closePageImagePreview();
|
|
4032
|
+
return;
|
|
4033
|
+
}
|
|
4034
|
+
if (imgLb && !imgLb.classList.contains('hidden')) {
|
|
4035
|
+
imgLb.classList.add('hidden');
|
|
4036
|
+
return;
|
|
4037
|
+
}
|
|
3606
4038
|
closeDrawer();
|
|
3607
4039
|
$('newCrawlModal').classList.add('hidden');
|
|
3608
4040
|
$('settingsModal').classList.add('hidden');
|