Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions desktop/js/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,24 @@ if (!jeeFrontEnd.log) {

//searching
document.getElementById('in_searchLogFilter')?.addEventListener('keyup', function(event) {
var search = event.target.value
if (search == '') {
var raw = event.target.value
if (raw == '') {
jeeP.logListButtons.seen()
return
}
var not = search.startsWith(":not(")
if (not) {
search = search.replace(':not(', '')
}
search = jeedomUtils.normTextLower(search)

// Découpe sur la virgule → liste de termes (avec support :not par terme)
Copy link
Copy Markdown
Collaborator

@Mips2648 Mips2648 Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • no comment in french
  • I don't think this is relevant to let a comment here as the code speak by itself

var terms = raw.split(',').map(t => t.trim()).filter(t => t.length > 0)

jeeP.logListButtons.unseen()
var match, text
jeeP.logListButtons.forEach(_bt => {
match = false
text = jeedomUtils.normTextLower(_bt.textContent)
if (text.includes(search)) {
match = true
}
if (not) match = !match
if (match) {
_bt.seen()
}
var text = jeedomUtils.normTextLower(_bt.textContent)
var match = terms.some(term => {
var not = term.startsWith(':not(')
var search = jeedomUtils.normTextLower(not ? term.slice(5, -1) : term)
return not ? !text.includes(search) : text.includes(search)
})
if (match) _bt.seen()
})
})

Expand Down
Loading