Merge pull request #4080 from IgorA100/patch-150

More compact display of Event information Event page
pull/4082/head
Isaac Connor 2024-06-15 20:00:12 -04:00 committed by GitHub
commit 70c5d871d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 11 deletions

View File

@ -1219,12 +1219,16 @@ function getStat() {
//switch ( ( eventData[key] && eventData[key].length ) ? key : 'n/a') { //switch ( ( eventData[key] && eventData[key].length ) ? key : 'n/a') {
switch (key) { switch (key) {
case 'Name':
tdString = eventData[key] + ' (Id:' + eventData['Id'] + ')';
break;
case 'Frames': case 'Frames':
tdString = '<a href="?view=frames&amp;eid=' + eventData.Id + '">' + eventData[key] + '</a>'; tdString = '<a href="?view=frames&amp;eid=' + eventData.Id + '">' + eventData[key] + '</a>';
tdString += ' Alarm:' + '<a href="?view=frames&amp;eid=' + eventData.Id + '">' + eventData['AlarmFrames'] + '</a>';
break; break;
case 'AlarmFrames': //case 'AlarmFrames':
tdString = '<a href="?view=frames&amp;eid=' + eventData.Id + '">' + eventData[key] + '</a>'; // tdString = '<a href="?view=frames&amp;eid=' + eventData.Id + '">' + eventData[key] + '</a>';
break; // break;
case 'Location': case 'Location':
tdString = eventData.Latitude + ', ' + eventData.Longitude; tdString = eventData.Latitude + ', ' + eventData.Longitude;
break; break;
@ -1259,12 +1263,19 @@ function getStat() {
case 'Resolution': case 'Resolution':
tdString = eventData.Width + 'x' + eventData.Height; tdString = eventData.Width + 'x' + eventData.Height;
break; break;
case 'DiskSpace':
tdString = eventData[key] + ' on ' + eventData['Storage'];
break;
case 'Path': case 'Path':
tdString = '<a href="?view=files&amp;path='+eventData.Path+'">'+eventData.Path+'</a>'; tdString = '<a href="?view=files&amp;path='+eventData.Path+'">'+eventData.Path+'</a>';
break; break;
case 'Archived': //case 'Archived':
case 'Emailed': //case 'Emailed':
tdString = eventData[key] ? yesStr : noStr; // tdString = eventData[key] ? yesStr : noStr;
// break;
case 'Info':
tdString = translate["Archived"] + ':' + (eventData['Archived'] ? yesStr : noStr);
tdString += ', ' + translate["Emailed"] + ':' + (eventData['Emailed'] ? yesStr : noStr);
break; break;
case 'Length': case 'Length':
const date = new Date(0); // Have to init it fresh. setSeconds seems to add time, not set it. const date = new Date(0); // Have to init it fresh. setSeconds seems to add time, not set it.

View File

@ -53,7 +53,7 @@ var yesStr = '<?php echo translate('Yes') ?>';
var noStr = '<?php echo translate('No') ?>'; var noStr = '<?php echo translate('No') ?>';
var eventDataStrings = { var eventDataStrings = {
Id: '<?php echo translate('EventId') ?>', <!--Id: '<?php echo translate('EventId') ?>',-->
Name: '<?php echo translate('Name') ?>', Name: '<?php echo translate('Name') ?>',
MonitorId: '<?php echo translate('AttrMonitorId') ?>', MonitorId: '<?php echo translate('AttrMonitorId') ?>',
MonitorName: '<?php echo translate('Monitor') ?>', MonitorName: '<?php echo translate('Monitor') ?>',
@ -65,17 +65,18 @@ var eventDataStrings = {
EndDateTimeFormatted: '<?php echo translate('AttrEndTime') ?>', EndDateTimeFormatted: '<?php echo translate('AttrEndTime') ?>',
Length: '<?php echo translate('Duration') ?>', Length: '<?php echo translate('Duration') ?>',
Frames: '<?php echo translate('AttrFrames') ?>', Frames: '<?php echo translate('AttrFrames') ?>',
AlarmFrames: '<?php echo translate('AttrAlarmFrames') ?>', <!--AlarmFrames: '<?php echo translate('AttrAlarmFrames') ?>',-->
<!--TotScore: '<?php echo translate('AttrTotalScore') ?>',--> <!--TotScore: '<?php echo translate('AttrTotalScore') ?>',-->
<!--AvgScore: '<?php echo translate('AttrAvgScore') ?>',--> <!--AvgScore: '<?php echo translate('AttrAvgScore') ?>',-->
<!--MaxScore: '<?php echo translate('AttrMaxScore') ?>',--> <!--MaxScore: '<?php echo translate('AttrMaxScore') ?>',-->
Score: '<?php echo translate('Score') ?>', Score: '<?php echo translate('Score') ?>',
Resolution: '<?php echo translate('Resolution') ?>', Resolution: '<?php echo translate('Resolution') ?>',
DiskSpace: '<?php echo translate('DiskSpace') ?>', DiskSpace: '<?php echo translate('DiskSpace') ?>',
Storage: '<?php echo translate('Storage') ?>', <!--Storage: '<?php echo translate('Storage') ?>',-->
Path: '<?php echo translate('Path') ?>', Path: '<?php echo translate('Path') ?>',
Archived: '<?php echo translate('Archived') ?>', <!--Archived: '<?php echo translate('Archived') ?>',-->
Emailed: '<?php echo translate('Emailed') ?>' <!--Emailed: '<?php echo translate('Emailed') ?>'-->
Info: '<?php echo translate('Info') ?>'
}; };
if ( parseInt(ZM_OPT_USE_GEOLOCATION) ) { if ( parseInt(ZM_OPT_USE_GEOLOCATION) ) {
eventDataStrings.Location = '<?php echo translate('Location') ?>'; eventDataStrings.Location = '<?php echo translate('Location') ?>';
@ -114,4 +115,7 @@ var translate = {
"Live": "<?php echo translate('Live') ?>", "Live": "<?php echo translate('Live') ?>",
"Edit": "<?php echo translate('Edit') ?>", "Edit": "<?php echo translate('Edit') ?>",
"All Events": "<?php echo translate('All Events') ?>", "All Events": "<?php echo translate('All Events') ?>",
"Info": "<?php echo translate('Info') ?>",
"Archived": "<?php echo translate('Archived') ?>",
"Emailed": "<?php echo translate('Emailed') ?>",
}; };