jokob-sk / NetAlertX

πŸ’»πŸ” WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show symbol when DB is locked and perhaps a counter of when it will unlock?

cyberbrix opened this issue Β· comments

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Am I willing to test this? πŸ§ͺ

  • I will do my best to test this feature on the netlertx-dev image when requested within 48h and report bugs to help deliver a great user experience for everyone and not to break existing installations.

Can I help implement this? πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

  • Yes
  • No

Is your feature request related to a problem? Please describe

I often try to update a device, only to be told the DB is locked.

Describe the solution you'd like

A countdown timer or indicator that the DB is locked, rather than only knowing when I try to save

Describe alternatives you've considered

patience

Anything else?

Nope

ezgif-1-6e1998e26f

This should be available in the next release. Please have a look at the netalertx-dev docker image, in about 15 minutes (or after the last action finishes) from now.

⚠If I don't get a confirmation that this is working I might pull out the feature to prevent bugs.

Make sure you refresh your browser cache - and click the πŸ”„ refresh button in the top right corner.

It would be great if you could test this (backup everything first or use a new container) on your end by switching to the above image and letting me know if the issue was resolved/the new feature is working.

Thanks in advance,
j

This doesn't not seem like it is working. I got the DB lock pop up, but not notification. I suggest a permanent marker either text that says: DB Locked/Unlocked or a Red/Green indicator.

I finally edited an entry. (removed a trailing space I found) and now it's back to the loading screen. Gonna switch back to the other container of the stable release.

Built on: 2024-05-26 | Version: 10:38:04 - Dev

Humm, have you cleared the browser cache when trying the dev build? I tested it on 2 different servers and it works on my end.

Portable browser, no cache.
netalertx

Hi @cyberbrix ,

Thanks for confirming! The icon only shows up when the DB is locked. When it's not, it's hidden. This is to try to keep the UI somewhat neat, although it's getting a bit busy as it is now. The red DB icon should only show up if the DB is in a read-only/locked state. You can also check the browser console and a corresponding entry should be logged as per code here:

console.log('πŸŸ₯ Database is locked');

function checkLock() {

You are welcome to test or suggest changes to the code, but at this point I'm unsure what to change on my end. Any suggestions and contributions are welcome!

Thanks in advance,
j

netalertx

Not seeing the indicator

Thanks for the screenshot!

If this occurs, can you try running checkDbLock() in the browser console to see if it returns an error?

image

OK, trying something different, have a look at the latest -dev image after it gets published if the results are different

netalertx

No luck

Hey,

implemented another approach if you can have a look.

Thanks for helping me

ALright - another attempt - can you check the -dev image? I implemented a 3x retry policy on SQL query executions as well

With this most recent version, nothing happens when I click Save. No pop ups, warnings, etc. I would consider rolling this back for the moment

another attempt - can you check the -dev image? I implemented a 10x retry policy on SQL query executions/db opens as well. This should now mean the application will try up to approx ~1min to finish a query execution until an error is displayed or the query finishes successfully. Just displaying a DB lock icon is actually quite difficult as I would have to check all write queries , also from the backend, let me know if this is better, I spent like 8h hours on this so hope it's better

I got more errors this time, but I do like the DB red lock icon. I think that should be perm, and either red or green. Also, I think the shorter retry on sql executions is better. The longer time often with a pop up or response from the screen can be confusing. I did get a loading, which lasted a while.

I think it should respond immediately if locked, don't retry more than 1 second. The goal is to know in advance of editing if the DB is locked. All things being equal, I'd rather have the locked pop up, than random delays wondering whats up.

netalertx
netalertx2

Hi,

Thanks for the feedback. Glad to hear it's working. The longer retry is by design to make sure queries finish. This is usually how other applications implement these scenarios (e.g. gmail - never ending retry until successful). I could make the retry number configurable.

As mentioned, displaying the icon in advance is more difficult as backend refactoring of the DB access needs to be done.

Feel free to submit a PR to enhance this functionality further, and I am happy to provide tips and guidance. For now, this is the maximum time for me to invest in this feature.

Hope that's understandable.

Thanks for all the testing and feedback,
j

closing -> releasing in ~10min