alarmCues to status.php

Switched alarm cues from API to ajax/status.php.  Less overhead due to only requesting the information it needs and avoids a weird problem with authentication after sitting logged in for hours.
pull/2077/head
digital-gnome 2017-11-16 21:03:03 -05:00
parent 617a92e33e
commit 64346a031d
2 changed files with 13 additions and 2 deletions

View File

@ -137,6 +137,17 @@ $statusData = array(
//'Path' => array( 'postFunc' => 'getEventPath' ),
),
),
'frames' => array(
'permission' => 'Events',
'table' => 'Frames',
'selector' => 'EventId',
'elements' => array(
'EventId' => true,
'FrameId' => true,
'Type' => true,
'Delta' => true,
),
),
'frame' => array(
'permission' => 'Events',
'table' => 'Frames',

View File

@ -45,11 +45,11 @@ $j.ajaxSetup ({timeout: AJAX_TIMEOUT }); //sets timeout for all getJSON.
var cueFrames = null; //make cueFrames availaible even if we don't send another ajax query
function initialAlarmCues (eventId) {
$j.getJSON("api/events/"+eventId+".json", setAlarmCues); //get frames data for alarmCues and inserts into html
$j.getJSON(thisUrl + '?view=request&request=status&entity=frames&id=' + eventId, setAlarmCues); //get frames data for alarmCues and inserts into html
}
function setAlarmCues (data) {
cueFrames = data.event.Frame;
cueFrames = data.frames;
alarmSpans = renderAlarmCues();
$j(".alarmCue").html(alarmSpans);
}