Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding custom html code to head #4817

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

CommanderStorm
Copy link
Collaborator

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

With this PR a new text field will be added that allows setting custom html code to the <head> of a status page.
The implementation will be similar to
https://github.com/louislam/uptime-kuma/pull/2567/files, but with a multi-line text field and without escaping any special chars.

This will allow tracking with most analytic platforms and has been requested several times.
Closes #2818

Successor of #3693

Type of change

Please delete any options that are not relevant.

  • User interface (UI)
  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings

Screenshots (if any)

Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.

mueller-ma and others added 2 commits June 4, 2024 00:31
With this PR a new text field will be added that allows setting custom
html code to the `<head>` of a status page.
The implementation will be similar to
https://github.com/louislam/uptime-kuma/pull/2567/files, but with a
multi-line text field and without escaping any special chars.

For security reasons the env var `UPTIME_KUMA_ALLOW_CUSTOM_HTML` must be set to `1` to enable this feature.

This will allow tracking with most analytic platforms and has been
requested several times.

Closes #2818
@CommanderStorm CommanderStorm mentioned this pull request Jun 3, 2024
7 tasks
@CommanderStorm CommanderStorm changed the title Add custom html code to head Allow adding custom html code to head Jun 3, 2024
@CommanderStorm CommanderStorm added area:status-page Everything related to the status page pr:needs review this PR needs a review by maintainers or other community members labels Jun 3, 2024
@OpenSourceSimon
Copy link

Would love to see this feature! Is there any roadmap of merging this PR? And is it possible to test this?

@CommanderStorm
Copy link
Collaborator Author

You can test PRs via the methods set out here https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests
For this PR, this is not going to bring you far, as the import.meta.env.UPTIME_KUMA_ALLOW_CUSTOM_HTML does crash the e2e test.

The regular esm vs commonjs shenanigans, I guess...

@github-actions github-actions bot added the pr:please resolve merge conflict A merge-conflict needs to be addressed before reviewing makes sense again label Jun 24, 2024
@CommanderStorm CommanderStorm removed the pr:needs review this PR needs a review by maintainers or other community members label Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:status-page Everything related to the status page needs:resolve-merge-conflict pr:please resolve merge conflict A merge-conflict needs to be addressed before reviewing makes sense again
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add custom header option to status page
4 participants