diff --git a/src/lang/en.json b/src/lang/en.json
index e215f1031..b0f801db7 100644
--- a/src/lang/en.json
+++ b/src/lang/en.json
@@ -1051,5 +1051,7 @@
"RabbitMQ Password": "RabbitMQ Password",
"rabbitmqHelpText": "To use the monitor, you will need to enable the Management Plugin in your RabbitMQ setup. For more information, please consult the {rabitmq_documentation}.",
"SendGrid API Key": "SendGrid API Key",
- "Separate multiple email addresses with commas": "Separate multiple email addresses with commas"
+ "Separate multiple email addresses with commas": "Separate multiple email addresses with commas",
+ "Public URL": "Public URL",
+ "publicUrlDescription": "The public URL of the monitor. Can be displayed on the status page as the monitor link."
}
diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue
index a83f91cab..d656c95ac 100644
--- a/src/pages/EditMonitor.vue
+++ b/src/pages/EditMonitor.vue
@@ -719,6 +719,16 @@
+
+
+
+
+
+
+ {{ $t("publicUrlDescription") }}
+
+
+
@@ -1727,6 +1737,10 @@ message HealthCheckResponse {
this.monitor.url = this.monitor.url.trim();
}
+ if (this.monitor.publicUrl) {
+ this.monitor.publicUrl = this.monitor.publicUrl.trim();
+ }
+
let createdNewParent = false;
if (this.draftGroupName && this.monitor.parent === -1) {
diff --git a/test/e2e/specs/status-page.spec.js b/test/e2e/specs/status-page.spec.js
index f525dfc6f..18aadba52 100644
--- a/test/e2e/specs/status-page.spec.js
+++ b/test/e2e/specs/status-page.spec.js
@@ -12,6 +12,8 @@ test.describe("Status Page", () => {
const monitorName = "Monitor for Status Page";
const tagName = "Client";
const tagValue = "Acme Inc";
+ const monitorUrl = "https://www.example.com/status";
+ const monitorPublicUrl = "https://www.example.com";
// Status Page
const footerText = "This is footer text.";
@@ -30,13 +32,14 @@ test.describe("Status Page", () => {
await expect(page.getByTestId("monitor-type-select")).toBeVisible();
await page.getByTestId("monitor-type-select").selectOption("http");
await page.getByTestId("friendly-name-input").fill(monitorName);
- await page.getByTestId("url-input").fill("https://www.example.com/");
+ await page.getByTestId("url-input").fill(monitorUrl);
await page.getByTestId("add-tag-button").click();
await page.getByTestId("tag-name-input").fill(tagName);
await page.getByTestId("tag-value-input").fill(tagValue);
await page.getByTestId("tag-color-select").click(); // Vue-Multiselect component
await page.getByTestId("tag-color-select").getByRole("option", { name: "Orange" }).click();
await page.getByTestId("tag-submit-button").click();
+ await page.getByTestId("public-url-input").fill(monitorPublicUrl);
await page.getByTestId("save-button").click();
await page.waitForURL("/dashboard/*"); // wait for the monitor to be created
@@ -79,6 +82,12 @@ test.describe("Status Page", () => {
await page.getByTestId("monitor-select").getByRole("option", { name: monitorName }).click();
await expect(page.getByTestId("monitor")).toHaveCount(1);
await expect(page.getByTestId("monitor-name")).toContainText(monitorName);
+ await expect(page.getByTestId("monitor-name")).not.toHaveAttribute("href");
+
+ // Set public url on
+ await page.getByTestId("monitor-settings").click();
+ await page.getByTestId("show-clickable-link").check();
+ await page.getByTestId("monitor-settings-close").click();
// Save the changes
await screenshot(testInfo, page);
@@ -94,6 +103,8 @@ test.describe("Status Page", () => {
await expect(page.getByTestId("footer-text")).toContainText(footerText);
await expect(page.getByTestId("powered-by")).toHaveCount(0);
+ await expect(page.getByTestId("monitor-name")).toHaveAttribute("href", monitorPublicUrl);
+
await expect(page.getByTestId("update-countdown-text")).toContainText("00:");
const updateCountdown = Number((await page.getByTestId("update-countdown-text").textContent()).match(/(\d+):(\d+)/)[2]);
expect(updateCountdown).toBeGreaterThanOrEqual(refreshInterval); // cant be certain when the timer will start, so ensure it's within expected range
From 69d1e332174d52b78650fa2bf06337d489165650 Mon Sep 17 00:00:00 2001
From: Ionys <9364594+Ionys320@users.noreply.github.com>
Date: Fri, 13 Dec 2024 09:47:42 +0100
Subject: [PATCH 2/5] lint: Fix `data-testid` position
---
src/components/MonitorSettingDialog.vue | 2 +-
src/components/PublicGroupList.vue | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/MonitorSettingDialog.vue b/src/components/MonitorSettingDialog.vue
index d0ff80b00..9e2b780b0 100644
--- a/src/components/MonitorSettingDialog.vue
+++ b/src/components/MonitorSettingDialog.vue
@@ -10,7 +10,7 @@