-
-
Notifications
You must be signed in to change notification settings - Fork 562
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
Fix multi-deletion of DHCP leases #2792
Conversation
…NAME records Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
… other causeing a race-collision Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
fcb320a
to
edda66f
Compare
Rebased on latest |
@@ -178,19 +166,21 @@ function delMsg(ids) { | |||
utils.showAlert( | |||
"success", | |||
"far fa-trash-alt", | |||
"Successfully deleted " + ids.length + " message" + (ids.length > 1 ? "s" : ""), | |||
"" | |||
"Successfully deleted message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ID is returned on error. I think we could also show the ID on success.
"Successfully deleted message", | |
"Successfully deleted message ID: " + id, |
Without the ID, if you delete 5 messages there will be 5 toasts with the exactly same text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments: If we use your suggestion, I'd suggest an additional space between :
and "
. Otherwise, how about putting the ID into the second line (currently null
to be disabled)? This is also where we are putting domains/regex, etc. in other toasts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with both solutions:
- space after "ID:" (suggestion updated) or
- replacing the
null
parameter withID: XX
.
I just don't want to remove the string "ID:" to avoid confusion between the ID and the count of deleted items.
scripts/pi-hole/js/messages.js
Outdated
"Successfully deleted message", | ||
"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you said, a second option would be to change the title and also replace the empty message
with something like this:
"Successfully deleted message", | |
"", | |
"Success", | |
"Message ID: " + id + " deleted.", |
Signed-off-by: Dominik <[email protected]>
What does this implement/fix?
IP lease deletion incorrectly utilized
parseInt(..., 10)
which truncated, e.g.,127.0.0.1
to127
which was then sent to the API. This PR also adds a further improvement totoast
handling where an existing toast can be memorized by the caller to update exactly this one single toast later on with either success or error. This is only relevant for mass-events and can later trivially be extended to other places where this is meaningful.Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.