From 82cb26b4651fccc0bc829aefa60747ee7d053419 Mon Sep 17 00:00:00 2001 From: Doruk Date: Sun, 15 Jun 2025 01:10:43 +0200 Subject: [PATCH 1/9] change btn info to btn primary --- src/layouts/Layout.vue | 2 +- src/pages/StatusPage.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layouts/Layout.vue b/src/layouts/Layout.vue index 9faedf589..e93a5159e 100644 --- a/src/layouts/Layout.vue +++ b/src/layouts/Layout.vue @@ -16,7 +16,7 @@ {{ $t("Uptime Kuma") }} - + {{ $t("New Update") }} diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 116968282..e0df74fde 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -157,12 +157,12 @@
- - + {{ $t("Go to Dashboard") }} From b1bf26289e3169614bb1975c809727ef1abbd96f Mon Sep 17 00:00:00 2001 From: Doruk Date: Sun, 15 Jun 2025 18:09:23 +0200 Subject: [PATCH 2/9] add tooltip --- src/components/HeartbeatBar.vue | 199 ++++++++++++++++++++++++++-- src/components/Tooltip.vue | 226 ++++++++++++++++++++++++++++++++ 2 files changed, 415 insertions(+), 10 deletions(-) create mode 100644 src/components/Tooltip.vue diff --git a/src/components/HeartbeatBar.vue b/src/components/HeartbeatBar.vue index 429ca9f91..3a523997a 100644 --- a/src/components/HeartbeatBar.vue +++ b/src/components/HeartbeatBar.vue @@ -7,11 +7,17 @@ class="beat-hover-area" :class="{ 'empty': (beat === 0) }" :style="beatHoverAreaStyle" - :title="getBeatTitle(beat)" + :aria-label="getBeatAriaLabel(beat)" + role="status" + tabindex="0" + @mouseenter="showTooltip(beat, $event)" + @mouseleave="hideTooltip" + @focus="showTooltip(beat, $event)" + @blur="hideTooltip" >
@@ -24,13 +30,27 @@
{{ timeSinceLastBeat }}
+ + + +
+ + \ No newline at end of file From 89fc5f16657027ab707eb1650629c3e5e607a473 Mon Sep 17 00:00:00 2001 From: Doruk Date: Sun, 15 Jun 2025 18:13:50 +0200 Subject: [PATCH 3/9] lint fix --- src/components/HeartbeatBar.vue | 39 +++++++-------- src/components/Tooltip.vue | 88 ++++++++++++++++++--------------- 2 files changed, 67 insertions(+), 60 deletions(-) diff --git a/src/components/HeartbeatBar.vue b/src/components/HeartbeatBar.vue index 3a523997a..43406b922 100644 --- a/src/components/HeartbeatBar.vue +++ b/src/components/HeartbeatBar.vue @@ -30,11 +30,10 @@
{{ timeSinceLastBeat }}
- - + - { this.tooltipContent = beat; - + // Calculate position relative to viewport const rect = event.target.getBoundingClientRect(); - + // Position relative to viewport const x = rect.left + (rect.width / 2); const y = rect.top; - + // Check if tooltip would go off-screen and adjust position const tooltipHeight = 80; // Approximate tooltip height const viewportHeight = window.innerHeight; const spaceAbove = y; const spaceBelow = viewportHeight - y - rect.height; - + if (spaceAbove > tooltipHeight && spaceBelow < tooltipHeight) { // Show above - arrow points down - this.tooltipPosition = 'above'; + this.tooltipPosition = "above"; this.tooltipY = y - 10; } else { // Show below - arrow points up - this.tooltipPosition = 'below'; + this.tooltipPosition = "below"; this.tooltipY = y + rect.height + 10; } - + // Ensure tooltip doesn't go off the left or right edge const tooltipWidth = 120; // Approximate tooltip width let adjustedX = x; - - if (x - tooltipWidth/2 < 10) { - adjustedX = tooltipWidth/2 + 10; - } else if (x + tooltipWidth/2 > window.innerWidth - 10) { - adjustedX = window.innerWidth - tooltipWidth/2 - 10; + + if (x - tooltipWidth / 2 < 10) { + adjustedX = tooltipWidth / 2 + 10; + } else if (x + tooltipWidth / 2 > window.innerWidth - 10) { + adjustedX = window.innerWidth - tooltipWidth / 2 - 10; } - + this.tooltipX = adjustedX; this.tooltipVisible = true; }, 150); @@ -443,7 +442,7 @@ export default { clearTimeout(this.tooltipTimeoutId); this.tooltipTimeoutId = null; } - + this.tooltipVisible = false; this.tooltipContent = null; }, diff --git a/src/components/Tooltip.vue b/src/components/Tooltip.vue index 8106949b8..e1f025601 100644 --- a/src/components/Tooltip.vue +++ b/src/components/Tooltip.vue @@ -1,6 +1,6 @@