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 (key) {
case 'Name':
tdString = eventData[key] + ' (Id:' + eventData['Id'] + ')';
break;
case 'Frames':
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;
case 'AlarmFrames':
tdString = '<a href="?view=frames&amp;eid=' + eventData.Id + '">' + eventData[key] + '</a>';
break;
//case 'AlarmFrames':
// tdString = '<a href="?view=frames&amp;eid=' + eventData.Id + '">' + eventData[key] + '</a>';
// break;
case 'Location':
tdString = eventData.Latitude + ', ' + eventData.Longitude;
break;
@ -1259,12 +1263,19 @@ function getStat() {
case 'Resolution':
tdString = eventData.Width + 'x' + eventData.Height;
break;
case 'DiskSpace':
tdString = eventData[key] + ' on ' + eventData['Storage'];
break;
case 'Path':
tdString = '<a href="?view=files&amp;path='+eventData.Path+'">'+eventData.Path+'</a>';
break;
case 'Archived':
case 'Emailed':
tdString = eventData[key] ? yesStr : noStr;
//case 'Archived':
//case 'Emailed':
// tdString = eventData[key] ? yesStr : noStr;
// break;
case 'Info':
tdString = translate["Archived"] + ':' + (eventData['Archived'] ? yesStr : noStr);
tdString += ', ' + translate["Emailed"] + ':' + (eventData['Emailed'] ? yesStr : noStr);
break;
case 'Length':
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 eventDataStrings = {
Id: '<?php echo translate('EventId') ?>',
<!--Id: '<?php echo translate('EventId') ?>',-->
Name: '<?php echo translate('Name') ?>',
MonitorId: '<?php echo translate('AttrMonitorId') ?>',
MonitorName: '<?php echo translate('Monitor') ?>',
@ -65,17 +65,18 @@ var eventDataStrings = {
EndDateTimeFormatted: '<?php echo translate('AttrEndTime') ?>',
Length: '<?php echo translate('Duration') ?>',
Frames: '<?php echo translate('AttrFrames') ?>',
AlarmFrames: '<?php echo translate('AttrAlarmFrames') ?>',
<!--AlarmFrames: '<?php echo translate('AttrAlarmFrames') ?>',-->
<!--TotScore: '<?php echo translate('AttrTotalScore') ?>',-->
<!--AvgScore: '<?php echo translate('AttrAvgScore') ?>',-->
<!--MaxScore: '<?php echo translate('AttrMaxScore') ?>',-->
Score: '<?php echo translate('Score') ?>',
Resolution: '<?php echo translate('Resolution') ?>',
DiskSpace: '<?php echo translate('DiskSpace') ?>',
Storage: '<?php echo translate('Storage') ?>',
<!--Storage: '<?php echo translate('Storage') ?>',-->
Path: '<?php echo translate('Path') ?>',
Archived: '<?php echo translate('Archived') ?>',
Emailed: '<?php echo translate('Emailed') ?>'
<!--Archived: '<?php echo translate('Archived') ?>',-->
<!--Emailed: '<?php echo translate('Emailed') ?>'-->
Info: '<?php echo translate('Info') ?>'
};
if ( parseInt(ZM_OPT_USE_GEOLOCATION) ) {
eventDataStrings.Location = '<?php echo translate('Location') ?>';
@ -114,4 +115,7 @@ var translate = {
"Live": "<?php echo translate('Live') ?>",
"Edit": "<?php echo translate('Edit') ?>",
"All Events": "<?php echo translate('All Events') ?>",
"Info": "<?php echo translate('Info') ?>",
"Archived": "<?php echo translate('Archived') ?>",
"Emailed": "<?php echo translate('Emailed') ?>",
};