mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-13 04:44:46 +00:00
Compare commits
5 commits
bb1d7dfcf3
...
510bb9e551
Author | SHA1 | Date | |
---|---|---|---|
|
510bb9e551 | ||
|
d0d03c05d6 | ||
|
1e0342949f | ||
|
be2faf64ce | ||
|
0b76e19401 |
2 changed files with 16 additions and 8 deletions
|
@ -62,6 +62,7 @@ Requirements:
|
|||
- Platform
|
||||
- ✅ Major Linux distros such as Debian, Ubuntu, CentOS, Fedora and ArchLinux etc.
|
||||
- ✅ Windows 10 (x64), Windows Server 2012 R2 (x64) or higher
|
||||
- ❌ FreeBSD / OpenBSD / NetBSD
|
||||
- ❌ Replit / Heroku
|
||||
- [Node.js](https://nodejs.org/en/download/) 18 / 20.4
|
||||
- [npm](https://docs.npmjs.com/cli/) 9
|
||||
|
|
|
@ -324,14 +324,21 @@ export default {
|
|||
// finds monitor name, tag name or tag value
|
||||
let searchTextMatch = true;
|
||||
if (this.searchText !== "") {
|
||||
const loweredSearchText = this.searchText.toLowerCase();
|
||||
searchTextMatch =
|
||||
monitor.name.toLowerCase().includes(loweredSearchText)
|
||||
|| monitor.url?.toLowerCase().includes(loweredSearchText)
|
||||
|| monitor.hostname?.toLowerCase().includes(loweredSearchText)
|
||||
|| monitor.dns_resolve_server?.toLowerCase().includes(loweredSearchText)
|
||||
|| monitor.tags.find(tag => tag.name.toLowerCase().includes(loweredSearchText)
|
||||
|| tag.value?.toLowerCase().includes(loweredSearchText));
|
||||
try {
|
||||
const regex = new RegExp(this.searchText, "i"); // "i" for case-insensitive matching
|
||||
|
||||
const safeRegexTest = (str) => str && regex.test(str);
|
||||
|
||||
searchTextMatch =
|
||||
regex.test(monitor.name) ||
|
||||
safeRegexTest(monitor.url) ||
|
||||
safeRegexTest(monitor.hostname) ||
|
||||
safeRegexTest(monitor.dns_resolve_server) ||
|
||||
monitor.tags.some(tag => regex.test(tag.name) || safeRegexTest(tag.value));
|
||||
} catch (e) {
|
||||
console.error("Invalid regex pattern:", e);
|
||||
searchTextMatch = false;
|
||||
}
|
||||
}
|
||||
|
||||
// filter by status
|
||||
|
|
Loading…
Add table
Reference in a new issue