diff --git a/web/ajax/watch.php b/web/ajax/watch.php new file mode 100644 index 000000000..e8c551643 --- /dev/null +++ b/web/ajax/watch.php @@ -0,0 +1,75 @@ +Width()); + $imgSrc = $event->getThumbnailSrc(array(), '&'); + $streamSrc = $event->getStreamSrc(array( + 'mode'=>'jpeg', 'scale'=>$scale, 'maxfps'=>ZM_WEB_VIDEO_MAXFPS, 'replay'=>'single', 'rate'=>'400'), '&'); + + // Modify the row data as needed + $row['imgHtml'] = 'Event '.$event->Id().''; + $row['Name'] = validHtmlStr($row['Name']); + $row['StartDateTime'] = strftime(STRF_FMT_DATETIME_SHORTER, strtotime($row['StartDateTime'])); + $row['Length'] = gmdate('H:i:s', $row['Length'] ); + + $returned_rows[] = $row; +} # end foreach row matching search + +$data['rows'] = $returned_rows; +ajaxResponse($data); +?> diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 42da61fac..8b7d0c769 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -37,16 +37,19 @@ var params = // Called by bootstrap-table to retrieve zm event data function ajaxRequest(params) { // Maintain legacy behavior by statically setting these parameters - params.data.order = 'desc'; - params.data.limit = maxDisplayEvents; - params.data.sort = 'Id'; - if ( auth_hash ) params.data.auth = auth_hash; + var data = params.data; + data.order = 'desc'; + data.limit = maxDisplayEvents; + data.sort = 'Id'; + data.view = 'request'; + data.request = 'watch'; + data.mid = monitorId; + if ( auth_hash ) data.auth = auth_hash; - $j.getJSON(thisUrl + '?view=request&request=events&task=query'+filterQuery, params.data) + $j.getJSON(thisUrl, data) .done(function(data) { var rows = processRows(data.rows); - // rearrange the result into what bootstrap-table expects - params.success({total: data.total, totalNotFiltered: data.totalNotFiltered, rows: rows}); + params.success(rows); }) .fail(logAjaxFail); }