Events list - truncate/limit 'cause' column width

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
lightguy48
Posts: 101
Joined: Sun Nov 15, 2015 7:19 pm

Events list - truncate/limit 'cause' column width

Post 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.
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

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

Post by dougmccrary »

I take it turning "cause" off is too drastic?
lightguy48
Posts: 101
Joined: Sun Nov 15, 2015 7:19 pm

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

Post 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.
lightguy48
Posts: 101
Joined: Sun Nov 15, 2015 7:19 pm

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

Post by lightguy48 »

Ok I figured it out, I did not see the option to be able to enable/disable columns.
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

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

Post by dougmccrary »

That was pretty quick :lol:
They sneak in cool stuff every now and then...
lightguy48
Posts: 101
Joined: Sun Nov 15, 2015 7:19 pm

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

Post 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.
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

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

Post 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.
lightguy48
Posts: 101
Joined: Sun Nov 15, 2015 7:19 pm

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

Post 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)
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

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

Post 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 14473 times
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

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

Post 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.
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

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

Post by iconnor »

@kitkat thanks for figuring that out. I'll apply it in the next release.
lightguy48
Posts: 101
Joined: Sun Nov 15, 2015 7:19 pm

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

Post by lightguy48 »

Awesome!! Works perfectly!

@kitkat That is great thank you so much!!
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

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

Post by kitkat »

You're welcome @iconnor and @lightguy48 - Glad I could help :)
Post Reply