mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Further report admin enhancements made
This commit is contained in:
parent
ff88bd8f8a
commit
8596a056a7
@ -84,30 +84,23 @@ if ( isset($_GET['op']) )
|
|||||||
$content['ReportHelpArticle'] = $myReport['ReportHelpArticle'];
|
$content['ReportHelpArticle'] = $myReport['ReportHelpArticle'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// check for custom fields
|
// check for custom fields
|
||||||
if ( isset($myReport['CustomFieldsList']) && count($myReport['CustomFieldsList']) > 0 )
|
if ( $myReport['NeedsInit'] ) // && count($myReport['CustomFieldsList']) > 0 )
|
||||||
{
|
{
|
||||||
// Needs custom fields!
|
// Needs custom fields!
|
||||||
$content['EnableCustomField'] = true;
|
$content['EnableNeedsInit'] = true;
|
||||||
$content['CustomFieldsList'] = $myParser['CustomFieldsList'];
|
|
||||||
|
|
||||||
foreach( $myParser['CustomFieldsList'] as $myField )
|
if ( $myReport['Initialized'] )
|
||||||
{
|
{
|
||||||
// check if field is in define list!
|
$content['InitEnabled'] = false;
|
||||||
if ( !array_key_exists($myField['FieldID'], $fields) )
|
$content['DeleteEnabled'] = true;
|
||||||
{
|
}
|
||||||
$content['ParserInitEnabled'] = true;
|
else
|
||||||
break;
|
{
|
||||||
}
|
$content['InitEnabled'] = true;
|
||||||
else
|
$content['DeleteEnabled'] = false;
|
||||||
{
|
|
||||||
$content['ParserDeleteEnabled'] = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -261,27 +254,24 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
|||||||
$myReport['ReportHelpEnabled'] = true;
|
$myReport['ReportHelpEnabled'] = true;
|
||||||
else
|
else
|
||||||
$myReport['ReportHelpEnabled'] = false;
|
$myReport['ReportHelpEnabled'] = false;
|
||||||
|
|
||||||
/*
|
// check for custom fields
|
||||||
// Find out if we need to INIT something!
|
if ( $myReport['NeedsInit'] ) // && count($myReport['CustomFieldsList']) > 0 )
|
||||||
if ( isset($myParser['CustomFieldsList']) && count($myParser['CustomFieldsList']) > 0 )
|
|
||||||
{
|
{
|
||||||
foreach( $myParser['CustomFieldsList'] as $myField )
|
// Needs custom fields!
|
||||||
|
$myReport['EnableNeedsInit'] = true;
|
||||||
|
|
||||||
|
if ( $myReport['Initialized'] )
|
||||||
{
|
{
|
||||||
// check if field is in define list!
|
$myReport['InitEnabled'] = false;
|
||||||
if ( !array_key_exists($myField['FieldID'], $fields) )
|
$myReport['DeleteEnabled'] = true;
|
||||||
{
|
}
|
||||||
$myParser['ParserInitEnabled'] = true;
|
else
|
||||||
break;
|
{
|
||||||
}
|
$myReport['InitEnabled'] = true;
|
||||||
else
|
$myReport['DeleteEnabled'] = false;
|
||||||
{
|
|
||||||
$myParser['ParserDeleteEnabled'] = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// --- Set CSS Class
|
// --- Set CSS Class
|
||||||
if ( $i % 2 == 0 )
|
if ( $i % 2 == 0 )
|
||||||
|
@ -51,6 +51,8 @@ abstract class Report {
|
|||||||
public $_reportTitle = "Base Report Class"; // Display name for the report
|
public $_reportTitle = "Base Report Class"; // Display name for the report
|
||||||
public $_reportDescription = "This is the base class for all reports";
|
public $_reportDescription = "This is the base class for all reports";
|
||||||
public $_reportHelpArticle = "http://";
|
public $_reportHelpArticle = "http://";
|
||||||
|
public $_reportNeedsInit = false; // True means that this report needs additional init stuff
|
||||||
|
public $_reportInitialized = false; // True means report is installed
|
||||||
|
|
||||||
// Configuration Properties
|
// Configuration Properties
|
||||||
protected $_filterString = "";
|
protected $_filterString = "";
|
||||||
@ -92,6 +94,19 @@ abstract class Report {
|
|||||||
*/
|
*/
|
||||||
public abstract function verifyDataSource();
|
public abstract function verifyDataSource();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function inits data for the report
|
||||||
|
*/
|
||||||
|
public abstract function InitReport();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function removes data for the report
|
||||||
|
*/
|
||||||
|
public abstract function RemoveReport();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function using the template parser to create the report
|
* Helper function using the template parser to create the report
|
||||||
*/
|
*/
|
||||||
|
@ -52,6 +52,8 @@ class Report_monilog extends Report {
|
|||||||
public $_reportTitle = "EventLog Summary Report"; // Display name for the report
|
public $_reportTitle = "EventLog Summary Report"; // Display name for the report
|
||||||
public $_reportDescription = "This is a EventLog Summary Report based on Monilog";
|
public $_reportDescription = "This is a EventLog Summary Report based on Monilog";
|
||||||
public $_reportHelpArticle = "";
|
public $_reportHelpArticle = "";
|
||||||
|
public $_reportNeedsInit = true; // True means that this report needs additional init stuff
|
||||||
|
public $_reportInitialized = false; // True means report is installed
|
||||||
|
|
||||||
/* private $_currentOffset = -1;
|
/* private $_currentOffset = -1;
|
||||||
private $_currentStartPos = -1;
|
private $_currentStartPos = -1;
|
||||||
@ -136,6 +138,27 @@ class Report_monilog extends Report {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* InitReport, empty
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function InitReport()
|
||||||
|
{
|
||||||
|
// Nothing todo
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RemoveReport, empty
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function RemoveReport()
|
||||||
|
{
|
||||||
|
// Nothing todo
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* validateLicense, check license code
|
* validateLicense, check license code
|
||||||
|
@ -321,6 +321,10 @@ function InitReportModules()
|
|||||||
$szReportDescription = $tmpReport->_reportDescription;
|
$szReportDescription = $tmpReport->_reportDescription;
|
||||||
$szReportVersion= $tmpReport->_reportVersion;
|
$szReportVersion= $tmpReport->_reportVersion;
|
||||||
$szReportHelpArticle = $tmpReport->_reportHelpArticle;
|
$szReportHelpArticle = $tmpReport->_reportHelpArticle;
|
||||||
|
$bNeedsInit = $tmpReport->_reportNeedsInit;
|
||||||
|
$bInitialized = $tmpReport->_reportInitialized;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// check for required fields!
|
// check for required fields!
|
||||||
@ -344,6 +348,8 @@ function InitReportModules()
|
|||||||
"Description" => $szReportDescription,
|
"Description" => $szReportDescription,
|
||||||
"ReportVersion" => $szReportVersion,
|
"ReportVersion" => $szReportVersion,
|
||||||
"ReportHelpArticle" => $szReportHelpArticle,
|
"ReportHelpArticle" => $szReportHelpArticle,
|
||||||
|
"NeedsInit" => $bNeedsInit,
|
||||||
|
"Initialized" => $bInitialized,
|
||||||
// "CustomFields" => $bCustomFields,
|
// "CustomFields" => $bCustomFields,
|
||||||
// "CustomFieldsList" => $aCustomFieldList,
|
// "CustomFieldsList" => $aCustomFieldList,
|
||||||
);
|
);
|
||||||
|
@ -43,12 +43,14 @@
|
|||||||
<a href="{BASEPATH}admin/reports.php?op=details&id={ID}"><img src="{MENU_INFORMATION}" width="16" title="{LN_REPORTS_INFO}"></a>
|
<a href="{BASEPATH}admin/reports.php?op=details&id={ID}"><img src="{MENU_INFORMATION}" width="16" title="{LN_REPORTS_INFO}"></a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center" class="{cssclass}">
|
<td align="center" class="{cssclass}">
|
||||||
<!-- IF ReportInitEnabled="true" -->
|
<!-- IF EnableNeedsInit="true" -->
|
||||||
<a href="{BASEPATH}admin/reports.php?op=initreport&id={ID}"><img src="{MENU_REPORT_INIT}" width="16" title="{LN_REPORTS_INIT}"></a>
|
<!-- IF InitEnabled="true" -->
|
||||||
<!-- ENDIF ReportInitEnabled="true" -->
|
<a href="{BASEPATH}admin/reports.php?op=initreport&id={ID}"><img src="{MENU_PARSER_INIT}" width="16" title="{LN_REPORTS_INIT}"></a>
|
||||||
<!-- IF ReportDeleteEnabled="true" -->
|
<!-- ENDIF InitEnabled="true" -->
|
||||||
<a href="{BASEPATH}admin/reports.php?op=removereport&id={ID}"><img src="{MENU_REPORT_DELETE}" width="16" title="{LN_REPORTS_REMOVE}"></a>
|
<!-- IF DeleteEnabled="true" -->
|
||||||
<!-- ENDIF ReportDeleteEnabled="true" -->
|
<a href="{BASEPATH}admin/reports.php?op=removereport&id={ID}"><img src="{MENU_PARSER_DELETE}" width="16" title="{LN_REPORTS_REMOVE}"></a>
|
||||||
|
<!-- ENDIF DeleteEnabled="true" -->
|
||||||
|
<!-- ENDIF EnableNeedsInit="true" -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END REPORTS -->
|
<!-- END REPORTS -->
|
||||||
@ -72,33 +74,24 @@
|
|||||||
<td align="left" class="cellmenu2_naked" valign="top"><b>{LN_REPORTS_DESCRIPTION}</b></td>
|
<td align="left" class="cellmenu2_naked" valign="top"><b>{LN_REPORTS_DESCRIPTION}</b></td>
|
||||||
<td align="left" class="line1">{Description}</td>
|
<td align="left" class="line1">{Description}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF EnableCustomSettings="true" -->
|
|
||||||
<tr>
|
|
||||||
<td align="left" class="cellmenu2_naked" valign="top"><b>{LN_REPORTS_CUSTOMSETTINGS}</b></td>
|
|
||||||
<td align="left" class="line1">
|
|
||||||
<!-- BEGIN CustomFieldsList -->
|
|
||||||
<br><B>{FieldCaption}</B> ({FieldDefine})
|
|
||||||
<!-- END CustomFieldsList -->
|
|
||||||
<br><br>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- ENDIF EnableCustomSettings="true" -->
|
|
||||||
<!-- IF EnableHelpArticle="true" -->
|
<!-- IF EnableHelpArticle="true" -->
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" class="cellmenu2"><b>{LN_REPORTS_HELP}</b></td>
|
<td align="left" class="cellmenu2"><b>{LN_REPORTS_HELP}</b></td>
|
||||||
<td align="center" class="line2"><a href="{ReportHelpArticle}" target="_blank">{LN_REPORTS_HELP_CLICK}</a></td>
|
<td align="center" class="line2"><a href="{ReportHelpArticle}" target="_blank">{LN_REPORTS_HELP_CLICK}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF EnableHelpArticle="true" -->
|
<!-- ENDIF EnableHelpArticle="true" -->
|
||||||
|
<!-- IF EnableNeedsInit="true" -->
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="tableBackground" colspan="2">
|
<td align="center" class="tableBackground" colspan="2">
|
||||||
<!-- IF ReportInitEnabled="true" -->
|
<!-- IF InitEnabled="true" -->
|
||||||
<a href="{BASEPATH}admin/reports.php?op=initreport&id={ReportID}"><img src="{MENU_PARSER_INIT}" width="16" title="{LN_REPORTS_INIT}"> {LN_REPORTS_INIT}</a>
|
<a href="{BASEPATH}admin/reports.php?op=initreport&id={ReportID}"><img src="{MENU_PARSER_INIT}" width="16" title="{LN_REPORTS_INIT}"> {LN_REPORTS_INIT}</a>
|
||||||
<!-- ENDIF ReportInitEnabled="true" -->
|
<!-- ENDIF InitEnabled="true" -->
|
||||||
<!-- IF ReportDeleteEnabled="true" -->
|
<!-- IF DeleteEnabled="true" -->
|
||||||
<a href="{BASEPATH}admin/reports.php?op=removereport&id={ReportID}"><img src="{MENU_PARSER_DELETE}" width="16" title="{LN_REPORTS_REMOVE}"> {LN_REPORTS_REMOVE}</a>
|
<a href="{BASEPATH}admin/reports.php?op=removereport&id={ReportID}"><img src="{MENU_PARSER_DELETE}" width="16" title="{LN_REPORTS_REMOVE}"> {LN_REPORTS_REMOVE}</a>
|
||||||
<!-- ENDIF ReportDeleteEnabled="true" -->
|
<!-- ENDIF DeleteEnabled="true" -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- ENDIF EnableNeedsInit="true" -->
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user