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'];
|
||||
}
|
||||
|
||||
/*
|
||||
// check for custom fields
|
||||
if ( isset($myReport['CustomFieldsList']) && count($myReport['CustomFieldsList']) > 0 )
|
||||
if ( $myReport['NeedsInit'] ) // && count($myReport['CustomFieldsList']) > 0 )
|
||||
{
|
||||
// Needs custom fields!
|
||||
$content['EnableCustomField'] = true;
|
||||
$content['CustomFieldsList'] = $myParser['CustomFieldsList'];
|
||||
$content['EnableNeedsInit'] = true;
|
||||
|
||||
foreach( $myParser['CustomFieldsList'] as $myField )
|
||||
if ( $myReport['Initialized'] )
|
||||
{
|
||||
// check if field is in define list!
|
||||
if ( !array_key_exists($myField['FieldID'], $fields) )
|
||||
{
|
||||
$content['ParserInitEnabled'] = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ParserDeleteEnabled'] = true;
|
||||
break;
|
||||
}
|
||||
$content['InitEnabled'] = false;
|
||||
$content['DeleteEnabled'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['InitEnabled'] = true;
|
||||
$content['DeleteEnabled'] = false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
else
|
||||
@ -261,27 +254,24 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
$myReport['ReportHelpEnabled'] = true;
|
||||
else
|
||||
$myReport['ReportHelpEnabled'] = false;
|
||||
|
||||
/*
|
||||
// Find out if we need to INIT something!
|
||||
if ( isset($myParser['CustomFieldsList']) && count($myParser['CustomFieldsList']) > 0 )
|
||||
|
||||
// check for custom fields
|
||||
if ( $myReport['NeedsInit'] ) // && count($myReport['CustomFieldsList']) > 0 )
|
||||
{
|
||||
foreach( $myParser['CustomFieldsList'] as $myField )
|
||||
// Needs custom fields!
|
||||
$myReport['EnableNeedsInit'] = true;
|
||||
|
||||
if ( $myReport['Initialized'] )
|
||||
{
|
||||
// check if field is in define list!
|
||||
if ( !array_key_exists($myField['FieldID'], $fields) )
|
||||
{
|
||||
$myParser['ParserInitEnabled'] = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$myParser['ParserDeleteEnabled'] = true;
|
||||
break;
|
||||
}
|
||||
$myReport['InitEnabled'] = false;
|
||||
$myReport['DeleteEnabled'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$myReport['InitEnabled'] = true;
|
||||
$myReport['DeleteEnabled'] = false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// --- Set CSS Class
|
||||
if ( $i % 2 == 0 )
|
||||
|
@ -51,6 +51,8 @@ abstract class Report {
|
||||
public $_reportTitle = "Base Report Class"; // Display name for the report
|
||||
public $_reportDescription = "This is the base class for all reports";
|
||||
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
|
||||
protected $_filterString = "";
|
||||
@ -92,6 +94,19 @@ abstract class Report {
|
||||
*/
|
||||
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
|
||||
*/
|
||||
|
@ -52,6 +52,8 @@ class Report_monilog extends Report {
|
||||
public $_reportTitle = "EventLog Summary Report"; // Display name for the report
|
||||
public $_reportDescription = "This is a EventLog Summary Report based on Monilog";
|
||||
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 $_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
|
||||
|
@ -321,6 +321,10 @@ function InitReportModules()
|
||||
$szReportDescription = $tmpReport->_reportDescription;
|
||||
$szReportVersion= $tmpReport->_reportVersion;
|
||||
$szReportHelpArticle = $tmpReport->_reportHelpArticle;
|
||||
$bNeedsInit = $tmpReport->_reportNeedsInit;
|
||||
$bInitialized = $tmpReport->_reportInitialized;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// check for required fields!
|
||||
@ -344,6 +348,8 @@ function InitReportModules()
|
||||
"Description" => $szReportDescription,
|
||||
"ReportVersion" => $szReportVersion,
|
||||
"ReportHelpArticle" => $szReportHelpArticle,
|
||||
"NeedsInit" => $bNeedsInit,
|
||||
"Initialized" => $bInitialized,
|
||||
// "CustomFields" => $bCustomFields,
|
||||
// "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>
|
||||
</td>
|
||||
<td align="center" class="{cssclass}">
|
||||
<!-- IF ReportInitEnabled="true" -->
|
||||
<a href="{BASEPATH}admin/reports.php?op=initreport&id={ID}"><img src="{MENU_REPORT_INIT}" width="16" title="{LN_REPORTS_INIT}"></a>
|
||||
<!-- ENDIF ReportInitEnabled="true" -->
|
||||
<!-- IF ReportDeleteEnabled="true" -->
|
||||
<a href="{BASEPATH}admin/reports.php?op=removereport&id={ID}"><img src="{MENU_REPORT_DELETE}" width="16" title="{LN_REPORTS_REMOVE}"></a>
|
||||
<!-- ENDIF ReportDeleteEnabled="true" -->
|
||||
<!-- IF EnableNeedsInit="true" -->
|
||||
<!-- IF InitEnabled="true" -->
|
||||
<a href="{BASEPATH}admin/reports.php?op=initreport&id={ID}"><img src="{MENU_PARSER_INIT}" width="16" title="{LN_REPORTS_INIT}"></a>
|
||||
<!-- ENDIF InitEnabled="true" -->
|
||||
<!-- IF DeleteEnabled="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>
|
||||
</tr>
|
||||
<!-- END REPORTS -->
|
||||
@ -72,33 +74,24 @@
|
||||
<td align="left" class="cellmenu2_naked" valign="top"><b>{LN_REPORTS_DESCRIPTION}</b></td>
|
||||
<td align="left" class="line1">{Description}</td>
|
||||
</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" -->
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
<!-- ENDIF EnableHelpArticle="true" -->
|
||||
<!-- IF EnableNeedsInit="true" -->
|
||||
<tr>
|
||||
<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>
|
||||
<!-- ENDIF ReportInitEnabled="true" -->
|
||||
<!-- IF ReportDeleteEnabled="true" -->
|
||||
<!-- ENDIF InitEnabled="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>
|
||||
<!-- ENDIF ReportDeleteEnabled="true" -->
|
||||
<!-- ENDIF DeleteEnabled="true" -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF EnableNeedsInit="true" -->
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user