From ad1b0c10a03f61ab274871182ac616f8219a2d85 Mon Sep 17 00:00:00 2001 From: leonace924 Date: Mon, 5 Jan 2026 20:26:15 -0500 Subject: [PATCH] fix: address the comments --- db/knex_init_db.js | 1 - server/model/status_page.js | 11 ++++------- src/pages/StatusPage.vue | 18 +++++++++--------- test/e2e/specs/status-page.spec.js | 3 +-- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/db/knex_init_db.js b/db/knex_init_db.js index 95a6fb55..46bff4bf 100644 --- a/db/knex_init_db.js +++ b/db/knex_init_db.js @@ -202,7 +202,6 @@ async function createTables() { table.text("footer_text"); table.text("custom_css"); table.boolean("show_powered_by").notNullable().defaultTo(true); - table.string("rss_title", 255); table.string("google_analytics_tag_id"); }); diff --git a/server/model/status_page.js b/server/model/status_page.js index ecb73088..e43fbe2a 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -32,8 +32,9 @@ class StatusPage extends BeanModel { ]); if (statusPage) { + const feedUrl = await StatusPage.buildRSSUrl(slug, request); response.type("application/rss+xml"); - response.send(await StatusPage.renderRSS(statusPage, slug, request)); + response.send(await StatusPage.renderRSS(statusPage, feedUrl)); } else { response.status(404).send(UptimeKumaServer.getInstance().indexHTML); } @@ -67,16 +68,12 @@ class StatusPage extends BeanModel { /** * SSR for RSS feed * @param {StatusPage} statusPage Status page object - * @param {string} slug Status page slug - * @param {Request} request Express request object + * @param {string} feedUrl The URL for the RSS feed * @returns {Promise} The rendered RSS XML */ - static async renderRSS(statusPage, slug, request) { + static async renderRSS(statusPage, feedUrl) { const { heartbeats, statusDescription } = await StatusPage.getRSSPageData(statusPage); - // Build the feed URL, respecting proxy headers if trustProxy is enabled - const feedUrl = await StatusPage.buildRSSUrl(slug, request); - // Use custom RSS title if set, otherwise fall back to status page title let feedTitle = "Uptime Kuma RSS Feed"; if (statusPage.rss_title) { diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 14a20a93..81ae55e1 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -34,15 +34,6 @@ - -
- - -
- {{ $t("Leave blank to use status page title") }} -
-
-
@@ -125,6 +116,15 @@
+ +
+ + +
+ {{ $t("Leave blank to use status page title") }} +
+
+
{{ $t("Custom CSS") }}
diff --git a/test/e2e/specs/status-page.spec.js b/test/e2e/specs/status-page.spec.js index 12211bd2..183709ca 100644 --- a/test/e2e/specs/status-page.spec.js +++ b/test/e2e/specs/status-page.spec.js @@ -326,8 +326,7 @@ test.describe("Status Page", () => { expect(rssContent).toContain(`${statusPageTitle} RSS Feed`); // Verify RSS link uses the correct domain (not localhost hardcoded) - expect(rssContent).toContain("http://"); - expect(rssContent).toContain("/status/rss-test"); + expect(rssContent).toMatch(/https?:\/\/[^<]+\/status\/rss-test<\/link>/); await testInfo.attach("rss-feed-default-title.xml", { body: rssContent,