Page 1 of 1

Events list - truncate/limit 'cause' column width

Posted: Thu Nov 18, 2021 10:43 pm
by lightguy48
Is there any way to limit or truncate the 'cause' field when listing events. I have some cameras pointing at a field and have them set pretty sensitive to pick up small motion. However, if you get a partly cloudy day with a lot of moving clouds it can trigger a bunch of zones all at once and currently the Cause field will literally grow to the point that it pushes the event numbers completely off the left of the screen making it impossible to select the events without zooming way out on the browser window.

It would be nice if the list of tripped zones could word wrap, or just give a ... indicator to show there is too much text to show. The current behavior expanding pass the margins of the screen and the inability to scroll back to left causes a real problem with viewing the event list.

Re: Events list - truncate/limit 'cause' column width

Posted: Fri Nov 19, 2021 1:06 am
by dougmccrary
I take it turning "cause" off is too drastic?

Re: Events list - truncate/limit 'cause' column width

Posted: Fri Nov 19, 2021 1:32 am
by lightguy48
Where do you turn it off? I'm looking under Web and I don't see an option box to disable the Cause field/column.

Re: Events list - truncate/limit 'cause' column width

Posted: Fri Nov 19, 2021 1:39 am
by lightguy48
Ok I figured it out, I did not see the option to be able to enable/disable columns.

Re: Events list - truncate/limit 'cause' column width

Posted: Fri Nov 19, 2021 1:45 am
by dougmccrary
That was pretty quick :lol:
They sneak in cool stuff every now and then...

Re: Events list - truncate/limit 'cause' column width

Posted: Fri Nov 19, 2021 2:18 am
by lightguy48
Yep definitely, still kind of seems like a bug of sorts because when it pushes stuff off the left side of the screen you should be able to use the left/right scrollbar to get over to the left side of the screen but you can't. But this a good workaround.

Re: Events list - truncate/limit 'cause' column width

Posted: Fri Nov 19, 2021 2:23 am
by iconnor
Figuring out how to size table columns is hard.

We have basically just handed all the logic off to this third party javascript library, so we don't have too much control over it.

However... we should have line breaks at regular intervals.

Can you give an a cutn paste of your content so that we can maybe figure out where we could insert some whitespace.

Re: Events list - truncate/limit 'cause' column width

Posted: Fri Nov 19, 2021 3:00 pm
by lightguy48
I assume there is not a way to insert a screen shot? I've tried a couple of different ways and couldn't do it.

But here is an example, I've got a megapixel camera looking into a field and thus I have a ton of zones to break the field up into smaller areas. I've tried playing around with the overload value to help prevent this from happening but maybe I'm not setting the value high enough (i.e. for lightning) but on a day when the sun is breaking through the clouds it looks more like motion that a complete overload. (I'm open to any suggestions if you have any)

TWR2_TWR3_SE-57592
TWR2_TWR3-SE Motion
Motion: CENTER, CENTER_WALKWAY, FAR-CENTER, FAR-RIGHT, FENCE NORTH, Genset_S, LEFT, NE_Fence, RIGHT, SE_AC_Unit, SE_Fence, T1_ROAD_EAST, T2 FRONT, T2-BACK, T2_Base, T2_FENCE, T2_N_WALKWAY, T2_WALKWAY, VENT-TANK
17/11/21 09:18:44 17/11/21 09:18:58

(when I did the cut and paste it wrapped the text)

Re: Events list - truncate/limit 'cause' column width

Posted: Sat Nov 20, 2021 1:20 am
by dougmccrary
I assume there is not a way to insert a screen shot?
Attachments, tab below.
Screenshot from 2021-11-19 17-17-48.png
Screenshot from 2021-11-19 17-17-48.png (216.85 KiB) Viewed 14916 times

Re: Events list - truncate/limit 'cause' column width

Posted: Wed Nov 24, 2021 12:09 am
by kitkat
A fix for this is to edit the file /usr/share/zoneminder/www/skins/classic/views/js/events.js and remove the text-nowrap CSS class from the Notes field of the output.

In my copy of the file (ZM 1.36.10 on CentOS 7) line 66 reads

Code: Select all

row.Cause = row.Cause + '<a href="#" class="objDetectLink" data-eid=' +eid+ '><div class="small text-nowrap text-muted"><u>' + row.Notes +  '</u></div></div></a>';
It should be changed to

Code: Select all

row.Cause = row.Cause + '<a href="#" class="objDetectLink" data-eid=' +eid+ '><div class="small text-muted"><u>' + row.Notes + '</u></div></div></a>';
Line 68 reads

Code: Select all

row.Cause = row.Cause + '<br/><div class="small text-nowrap text-muted">' + row.Notes + '</div>';
And should be changed to

Code: Select all

row.Cause = row.Cause + '<br/><div class="small text-muted">' + row.Notes + '</div>';
Reload the events list page in the browser after making the changes.

Re: Events list - truncate/limit 'cause' column width

Posted: Wed Nov 24, 2021 1:11 pm
by iconnor
@kitkat thanks for figuring that out. I'll apply it in the next release.

Re: Events list - truncate/limit 'cause' column width

Posted: Wed Nov 24, 2021 4:06 pm
by lightguy48
Awesome!! Works perfectly!

@kitkat That is great thank you so much!!

Re: Events list - truncate/limit 'cause' column width

Posted: Sat Nov 27, 2021 12:12 am
by kitkat
You're welcome @iconnor and @lightguy48 - Glad I could help :)