-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Feat: Update searchText
from stringbase
to regexbase
#5482
base: master
Are you sure you want to change the base?
Feat: Update searchText
from stringbase
to regexbase
#5482
Conversation
- Enhanced the search logic to support regular expressions with case-insensitive matching. - Escaped special characters in the search text to prevent invalid regex patterns. - Expanded search coverage to include `monitor.url`, `monitor.hostname`, and `monitor.dns_resolve_server`. - Added error handling to catch and log invalid regex patterns, ensuring robustness. - Maintained compatibility with existing search fields, such as monitor name and tags. modified: src/components/MonitorList.vue Co-authored-by: Ionys <Ionys320@users.noreply.github.com>
- Added optional chaining to safely access `this.monitor.hostname`. - Introduced default URL (`https://`) assignment to `this.monitor.url`. - Ensured `hostname` is trimmed after the URL is set. modified: src/pages/EditMonitor.vue
Before merging this PR into the master branch, we first need to decide what to do with PR #5438, as it conflicts with my PR. For more details, please refer to the PR description above. My preference is to close PR #5438 and merge this PR into the main branch. Additionally, I have added @Ionys320, to the Co-authored-by section for FR #5422, as we worked on it together. @CommanderStorm, What is your opinion on this? |
Hi, Regarding regex search, my PR #5438 is supposed to do the work. So the only thing this PR should do would be cleaning the fields, if this is mendated. That's why I didn't opened any other PR after creating my issue. We need an approval before adding a fields cleaning processs. |
b5fa9bf
to
42c9bca
Compare
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]:
Description
Feature Request
This PR addresses the following feature request:
Requested improvement: Allow search to include
hostname
andURL
fields, in addition to thefriendly name
.Fixes
This PR also fixes the following issue:
Problem
When modifying a monitor type and saving changes, inconsistent data is stored in the database. For example:
https
Test ONE
https://google.fr
Ping
Test ONE
cloudflare.com
Result:
https://google.fr
is still stored for monitor typehttps
.cloudflare.com
is stored for monitor typePing
.Searching for
.fr
orfr
usingregexbase
incorrectly includesTest ONE
due to retained database values.Solution
A default value is now provided for
monitor.url
when switching monitor types. Ifthis.monitor?.hostname
is present, it defaults to the value used by Uptime Kuma (https://
).Request for Feedback
Do you agree with this solution? If yes, could you test it to confirm?
Type of change
Checklist
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.