openhab / org.openhab.ui.habmin

HABmin - a graphical user interface for openHAB 2
231 stars 92 forks source link

Enhancement: Add filtering capability in Log Viewer #230

Closed mhilbush closed 7 years ago

mhilbush commented 7 years ago

While trying to debug what was going on with my ST-814 nodes, I wanted to be able to filter the view so that I could see just the activity for a single node. A moderate to large size network can generate quite a few large log files. It can be a bit tedious to try to see what's going on with a single node.

To make it easier, I just hacked logreader.js so I could see just one node. It was quick and dirty, but it served my purpose.

            if (log.node !== undefined && log.node !== 0 && log.node != 255) {
                log.stage = getNodeInfo(log.node, "Stage");
            }

            log.time = time.format("HH:mm:ss.SSS");
            log.start = time.valueOf();

            // Added this conditional to filter on a specific node  :-)
            if (log.node === 5) {
                return log;
            } else {
                return null;
            }
        }

It would be great to have a more friendly interface where the node can be specified on the UI. :-)

Of course, the filtering could be expanded to other criteria, such as command classes, etc. But something very simple just for nodes would be a great starting point.

cdjackson commented 7 years ago

The version in HABmin itself already provides filtering by node, but as it runs with AngularJS it’s a lot slower. I want to add that function to the online version as well, but it’s only available in HABmin at the moment

mhilbush commented 7 years ago

Ah. I only use the online version. I've never had much luck with the one in HABmin. I'm sure I'm doing something wrong, but after I select a file, I get nothing in the box where the log is supposed to display. And, all the buttons are grayed out.

capture1

cdjackson commented 7 years ago

I’ve not used the HABmin version for a while myself so I need to take a look at this. HABmin is a lot slower to process the logs and can only handle small logs due to the overhead of Angular.

On 11 Sep 2016, at 14:08, Mark Hilbush notifications@github.com wrote:

Ah. I only use the online version. I've never had much luck with the one in HABmin. I'm sure I'm doing something wrong, but after I select a file, I get nothing in the box where the log is supposed to display. And, all the buttons are grayed out.

https://cloud.githubusercontent.com/assets/19286354/18417430/d4343194-77fe-11e6-9f47-fbf4841f65aa.JPG — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openhab/org.openhab.ui.habmin/issues/230#issuecomment-246179386, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_kQ7GhdNBfU2ewEAqA16IrIDSmLTpSks5qo_1NgaJpZM4J5_-l.

cdjackson commented 7 years ago

Implemented a filter now in the online viewer :)

mhilbush commented 7 years ago

Nice!