mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-20 23:02:08 -04:00
Added error trapping to log file exports.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3463 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
@@ -42,3 +42,12 @@ tr.log-dbg td {
|
||||
margin-right: 4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#exportError {
|
||||
display: none;
|
||||
color: #dc143c;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
#exportErrorText {
|
||||
}
|
||||
|
||||
@@ -191,13 +191,23 @@ function exportResponse( response )
|
||||
}
|
||||
}
|
||||
|
||||
function exportFail( request )
|
||||
{
|
||||
$('exportLog').unspin();
|
||||
$('exportErrorText').set('text', request.status+" / "+request.statusText );
|
||||
$('exportError').show();
|
||||
Error( "Export request failed: "+request.status+" / "+request.statusText );
|
||||
}
|
||||
|
||||
function exportRequest()
|
||||
{
|
||||
var form = $('exportForm');
|
||||
$('exportErrorText').set('text', "" );
|
||||
$('exportError').hide();
|
||||
if ( form.validate() )
|
||||
{
|
||||
var exportParms = "view=request&request=log&task=export";
|
||||
var exportReq = new Request.JSON( { url: thisUrl, method: 'post', link: 'cancel', onSuccess: exportResponse } );
|
||||
var exportReq = new Request.JSON( { url: thisUrl, method: 'post', link: 'cancel', onSuccess: exportResponse, onFailure: exportFail } );
|
||||
var selection = form.getElement('input[name=selector]:checked').get('value');
|
||||
if ( selection == 'filter' || selection == 'current' )
|
||||
{
|
||||
|
||||
@@ -102,7 +102,8 @@ xhtmlHeaders(__FILE__, $SLANG['SystemLog'] );
|
||||
<label for="formatXML">HTML</label><input type="radio" id="formatHTML" name="format" value="html"/>
|
||||
<label for="formatXML">XML</label><input type="radio" id="formatXML" name="format" value="xml" title="<?= $SLANG['ChooseLogFormat'] ?>" class="validate-one-required"/>
|
||||
</fieldset>
|
||||
<div id="exportResult" class="hidden">
|
||||
<div id="exportError">
|
||||
<?= $SLANG['ExportFailed'] ?>: <span id="exportErrorText"></span>
|
||||
</div>
|
||||
<input type="button" id="exportButton" value="<?= $SLANG['Export'] ?>" onclick="exportRequest()"/>
|
||||
<input type="button" value="<?= $SLANG['Cancel'] ?>" class="overlayCloser"/>
|
||||
|
||||
Reference in New Issue
Block a user