mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-24 10:28:10 +02:00
charts orderby config; see readme for more details
This commit is contained in:
parent
27bb2db6d6
commit
0e1114846d
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
src/config.php
|
||||||
|
|
@ -3,6 +3,10 @@
|
|||||||
Adiscon LogAnalyzer, a web frontend to log data from the same folks the created rsyslog
|
Adiscon LogAnalyzer, a web frontend to log data from the same folks the created rsyslog
|
||||||
|
|
||||||
# changes
|
# changes
|
||||||
|
- Maximize view by default
|
||||||
|
- fix chart double adding same key into search
|
||||||
|
- allow to configure ORDER BY clause
|
||||||
|
- add custom filter to chart value redirection link if such exists
|
||||||
- support number ranges in filter, i.e. severity:3-6 -> where severity in (3,4,5,6)
|
- support number ranges in filter, i.e. severity:3-6 -> where severity in (3,4,5,6)
|
||||||
- support quoted filters, i.e. syslogtag:-="dhcp,info",-="wireless,info",-"system%,account" -> where (syslogtag <> 'dhcp,info' AND syslogtag <> 'wireless,info' AND syslogtag NOT LIKE '%system%,account%' )
|
- support quoted filters, i.e. syslogtag:-="dhcp,info",-="wireless,info",-"system%,account" -> where (syslogtag <> 'dhcp,info' AND syslogtag <> 'wireless,info' AND syslogtag NOT LIKE '%system%,account%' )
|
||||||
- support TRACE syslog level;
|
- support TRACE syslog level;
|
||||||
|
@ -155,6 +155,7 @@ if ( isset($_GET['op']) )
|
|||||||
$content['chart_defaultfilter'] = "";
|
$content['chart_defaultfilter'] = "";
|
||||||
// Chart Field
|
// Chart Field
|
||||||
$content['chart_field'] = SYSLOG_HOST;
|
$content['chart_field'] = SYSLOG_HOST;
|
||||||
|
$content['chart_orderby'] = '';
|
||||||
CreateChartFields($content['chart_field']);
|
CreateChartFields($content['chart_field']);
|
||||||
|
|
||||||
// COMMON Fields
|
// COMMON Fields
|
||||||
@ -194,7 +195,6 @@ if ( isset($_GET['op']) )
|
|||||||
{
|
{
|
||||||
// Get Source reference
|
// Get Source reference
|
||||||
$myChart = $content['Charts'][ $content['CHARTID'] ];
|
$myChart = $content['Charts'][ $content['CHARTID'] ];
|
||||||
|
|
||||||
// Copy basic properties
|
// Copy basic properties
|
||||||
$content['Name'] = $myChart['DisplayName'];
|
$content['Name'] = $myChart['DisplayName'];
|
||||||
$content['chart_type'] = $myChart['chart_type'];
|
$content['chart_type'] = $myChart['chart_type'];
|
||||||
@ -216,6 +216,7 @@ if ( isset($_GET['op']) )
|
|||||||
// Chart Field
|
// Chart Field
|
||||||
$content['chart_field'] = $myChart['chart_field'];
|
$content['chart_field'] = $myChart['chart_field'];
|
||||||
CreateChartFields($content['chart_field']);
|
CreateChartFields($content['chart_field']);
|
||||||
|
$content['chart_orderby'] = $myChart['chart_orderby'];
|
||||||
|
|
||||||
// COMMON Fields
|
// COMMON Fields
|
||||||
$content['userid'] = $myChart['userid'];
|
$content['userid'] = $myChart['userid'];
|
||||||
@ -317,6 +318,7 @@ if ( isset($_POST['op']) )
|
|||||||
if ( isset($_POST['chart_type']) ) { $content['chart_type'] = intval(DB_RemoveBadChars($_POST['chart_type'])); }
|
if ( isset($_POST['chart_type']) ) { $content['chart_type'] = intval(DB_RemoveBadChars($_POST['chart_type'])); }
|
||||||
if ( isset($_POST['chart_width']) ) { $content['chart_width'] = intval(DB_RemoveBadChars($_POST['chart_width'])); } else {$content['chart_width'] = 400; }
|
if ( isset($_POST['chart_width']) ) { $content['chart_width'] = intval(DB_RemoveBadChars($_POST['chart_width'])); } else {$content['chart_width'] = 400; }
|
||||||
if ( isset($_POST['chart_field']) ) { $content['chart_field'] = DB_RemoveBadChars($_POST['chart_field']); }
|
if ( isset($_POST['chart_field']) ) { $content['chart_field'] = DB_RemoveBadChars($_POST['chart_field']); }
|
||||||
|
if ( isset($_POST['chart_orderby']) ) { $content['chart_orderby'] = DB_RemoveBadChars($_POST['chart_orderby']); }
|
||||||
if ( isset($_POST['maxrecords']) ) { $content['maxrecords'] = intval(DB_RemoveBadChars($_POST['maxrecords'])); }
|
if ( isset($_POST['maxrecords']) ) { $content['maxrecords'] = intval(DB_RemoveBadChars($_POST['maxrecords'])); }
|
||||||
if ( isset($_POST['showpercent']) ) { $content['showpercent'] = intval(DB_RemoveBadChars($_POST['showpercent'])); } else {$content['showpercent'] = 0; }
|
if ( isset($_POST['showpercent']) ) { $content['showpercent'] = intval(DB_RemoveBadChars($_POST['showpercent'])); } else {$content['showpercent'] = 0; }
|
||||||
if ( isset($_POST['chart_defaultfilter']) ) { $content['chart_defaultfilter'] = DB_RemoveBadChars($_POST['chart_defaultfilter']); }
|
if ( isset($_POST['chart_defaultfilter']) ) { $content['chart_defaultfilter'] = DB_RemoveBadChars($_POST['chart_defaultfilter']); }
|
||||||
@ -369,12 +371,13 @@ if ( isset($_POST['op']) )
|
|||||||
if ( $_POST['op'] == "addnewchart" )
|
if ( $_POST['op'] == "addnewchart" )
|
||||||
{
|
{
|
||||||
// Add custom search now!
|
// Add custom search now!
|
||||||
$sqlquery = "INSERT INTO " . DB_CHARTS . " (DisplayName, chart_enabled, chart_type, chart_width, chart_field, chart_defaultfilter, maxrecords, showpercent, userid, groupid)
|
$sqlquery = "INSERT INTO " . DB_CHARTS . " (DisplayName, chart_enabled, chart_type, chart_width, chart_field, chart_orderby, chart_defaultfilter, maxrecords, showpercent, userid, groupid)
|
||||||
VALUES ('" . $content['Name'] . "',
|
VALUES ('" . $content['Name'] . "',
|
||||||
" . $content['chart_enabled'] . ",
|
" . $content['chart_enabled'] . ",
|
||||||
" . $content['chart_type'] . ",
|
" . $content['chart_type'] . ",
|
||||||
" . $content['chart_width'] . ",
|
" . $content['chart_width'] . ",
|
||||||
'" . $content['chart_field'] . "',
|
'" . $content['chart_field'] . "',
|
||||||
|
'" . $content['chart_orderby'] . "',
|
||||||
'" . $content['chart_defaultfilter'] . "',
|
'" . $content['chart_defaultfilter'] . "',
|
||||||
" . $content['maxrecords'] . ",
|
" . $content['maxrecords'] . ",
|
||||||
" . $content['showpercent'] . ",
|
" . $content['showpercent'] . ",
|
||||||
@ -405,6 +408,7 @@ if ( isset($_POST['op']) )
|
|||||||
chart_type = " . $content['chart_type'] . ",
|
chart_type = " . $content['chart_type'] . ",
|
||||||
chart_width = " . $content['chart_width'] . ",
|
chart_width = " . $content['chart_width'] . ",
|
||||||
chart_field = '" . $content['chart_field'] . "',
|
chart_field = '" . $content['chart_field'] . "',
|
||||||
|
chart_orderby = '" . $content['chart_orderby'] . "',
|
||||||
chart_defaultfilter = '" . $content['chart_defaultfilter'] . "',
|
chart_defaultfilter = '" . $content['chart_defaultfilter'] . "',
|
||||||
maxrecords = " . $content['maxrecords'] . ",
|
maxrecords = " . $content['maxrecords'] . ",
|
||||||
showpercent = " . $content['showpercent'] . ",
|
showpercent = " . $content['showpercent'] . ",
|
||||||
@ -514,6 +518,12 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
|||||||
$myChart['chart_defaultfilter_urldecoded'] = urlencode($myChart['chart_defaultfilter']);
|
$myChart['chart_defaultfilter_urldecoded'] = urlencode($myChart['chart_defaultfilter']);
|
||||||
else
|
else
|
||||||
$myChart['chart_defaultfilter_urldecoded'] = "";
|
$myChart['chart_defaultfilter_urldecoded'] = "";
|
||||||
|
|
||||||
|
if ( ( isset($myChart['chart_orderby']) ) && ( strlen($myChart['chart_orderby']) > 0 ) )
|
||||||
|
$myChart['chart_orderby_urldecoded'] = urlencode($myChart['chart_orderby']);
|
||||||
|
else
|
||||||
|
$myChart['chart_orderby_urldecoded'] = "";
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// --- Set CSS Class
|
// --- Set CSS Class
|
||||||
|
@ -98,6 +98,11 @@ else
|
|||||||
$content['error_details'] = $content['LN_GEN_ERROR_MISSINGCHARTFIELD'];
|
$content['error_details'] = $content['LN_GEN_ERROR_MISSINGCHARTFIELD'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( isset($_GET['orderby']) )
|
||||||
|
{
|
||||||
|
$content['chart_orderby'] = $_GET['orderby'];
|
||||||
|
}else { $content['chart_orderby'] = NULL; }
|
||||||
|
|
||||||
if ( isset($_GET['maxrecords']) )
|
if ( isset($_GET['maxrecords']) )
|
||||||
{
|
{
|
||||||
// read and verify value
|
// read and verify value
|
||||||
@ -148,7 +153,7 @@ if ( !$content['error_occured'] )
|
|||||||
{
|
{
|
||||||
// Obtain and get the Config Object
|
// Obtain and get the Config Object
|
||||||
$stream_config = $content['Sources'][$currentSourceID]['ObjRef'];
|
$stream_config = $content['Sources'][$currentSourceID]['ObjRef'];
|
||||||
|
//echo "filter:".$content['chart_defaultfilter']."<br>";
|
||||||
// Create LogStream Object
|
// Create LogStream Object
|
||||||
$stream = $stream_config->LogStreamFactory($stream_config);
|
$stream = $stream_config->LogStreamFactory($stream_config);
|
||||||
$stream->SetFilter($content['chart_defaultfilter']);
|
$stream->SetFilter($content['chart_defaultfilter']);
|
||||||
@ -160,7 +165,7 @@ if ( !$content['error_occured'] )
|
|||||||
if ( $aFilterFields != null )
|
if ( $aFilterFields != null )
|
||||||
$content['ChartColumns'] = $aFilterFields;
|
$content['ChartColumns'] = $aFilterFields;
|
||||||
|
|
||||||
// Append mandetory fields
|
// Append mandatory fields
|
||||||
if ( !in_array(SYSLOG_UID, $content['ChartColumns']) )
|
if ( !in_array(SYSLOG_UID, $content['ChartColumns']) )
|
||||||
$content['ChartColumns'][] = SYSLOG_UID;
|
$content['ChartColumns'][] = SYSLOG_UID;
|
||||||
if ( !in_array($content['chart_field'], $content['ChartColumns']) )
|
if ( !in_array($content['chart_field'], $content['ChartColumns']) )
|
||||||
@ -182,9 +187,9 @@ if ( !$content['error_occured'] )
|
|||||||
// Split key and value
|
// Split key and value
|
||||||
$tmpArray = explode(":", $myFilter, 2);
|
$tmpArray = explode(":", $myFilter, 2);
|
||||||
|
|
||||||
// Check if keyfield is valid and add to our Columns array if available
|
// Check if keyfield is valid and add to our Columns array only if it's not there yet
|
||||||
$newField = $stream->ReturnFilterKeyBySearchField($tmpArray[FILTER_TMP_KEY]);
|
$newField = $stream->ReturnFilterKeyBySearchField($tmpArray[FILTER_TMP_KEY]);
|
||||||
if ( $newField )
|
if ( $newField && !in_array($newField,$content['ChartColumns']))
|
||||||
$content['ChartColumns'][] = $newField;
|
$content['ChartColumns'][] = $newField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,8 +200,8 @@ if ( !$content['error_occured'] )
|
|||||||
if ( $res == SUCCESS )
|
if ( $res == SUCCESS )
|
||||||
{
|
{
|
||||||
// Obtain data from the logstream!
|
// Obtain data from the logstream!
|
||||||
$chartData = $stream->GetCountSortedByField($content['chart_field'], $content['chart_fieldtype'], $content['maxrecords']);
|
$chartData = $stream->GetCountSortedByField($content['chart_field'], $content['chart_fieldtype'], $content['maxrecords'], $content['chart_orderby']);
|
||||||
|
//echo "<pre>";echo print_r($chartData); echo "</pre><br>";
|
||||||
// If data is valid, we have an array!
|
// If data is valid, we have an array!
|
||||||
if ( is_array($chartData) && count($chartData) > 0 )
|
if ( is_array($chartData) && count($chartData) > 0 )
|
||||||
{
|
{
|
||||||
@ -210,7 +215,7 @@ if ( !$content['error_occured'] )
|
|||||||
$YchartData[] = intval($myData);
|
$YchartData[] = intval($myData);
|
||||||
$XchartData[] = strlen($myKey) > 0 ? $myKey : "Unknown";
|
$XchartData[] = strlen($myKey) > 0 ? $myKey : "Unknown";
|
||||||
if ( isset($fields[$content['chart_field']]['SearchField']) && strlen($myKey) > 0 )
|
if ( isset($fields[$content['chart_field']]['SearchField']) && strlen($myKey) > 0 )
|
||||||
$chartImageMapLinks[] = $content['custombasepath'] . "index.php?filter=" . $fields[$content['chart_field']]['SearchField'] . "%3A%3D" . urlencode($szEncodedKeyStr) . "&search=Search";
|
$chartImageMapLinks[] = $content['custombasepath'] . "index.php?filter=" . $fields[$content['chart_field']]['SearchField'] . "%3A%3D" . urlencode($szEncodedKeyStr) .(empty($content['chart_defaultfilter'])?"":urlencode(" ".$content['chart_defaultfilter'])). "&search=Search";
|
||||||
else
|
else
|
||||||
$chartImageMapLinks[] = "";
|
$chartImageMapLinks[] = "";
|
||||||
|
|
||||||
|
@ -1270,8 +1270,11 @@ class LogStreamDB extends LogStream {
|
|||||||
*
|
*
|
||||||
* @return integer Error stat
|
* @return integer Error stat
|
||||||
*/
|
*/
|
||||||
public function GetCountSortedByField($szFieldId, $nFieldType, $nRecordLimit)
|
public function GetCountSortedByField($szFieldId, $nFieldType, $nRecordLimit, $orderBy='')
|
||||||
{
|
{
|
||||||
|
if(empty($orderBy)){
|
||||||
|
$orderBy = 'totalcount DESC';
|
||||||
|
}
|
||||||
global $content, $dbmapping;
|
global $content, $dbmapping;
|
||||||
|
|
||||||
// Copy helper variables, this is just for better readability
|
// Copy helper variables, this is just for better readability
|
||||||
@ -1290,6 +1293,7 @@ class LogStreamDB extends LogStream {
|
|||||||
// Helper variable for the select statement
|
// Helper variable for the select statement
|
||||||
$mySelectFieldName = $mySelectFieldName . "grouped";
|
$mySelectFieldName = $mySelectFieldName . "grouped";
|
||||||
$myDBQueryFieldName = "DATE( " . $myDBFieldName . ") AS " . $mySelectFieldName ;
|
$myDBQueryFieldName = "DATE( " . $myDBFieldName . ") AS " . $mySelectFieldName ;
|
||||||
|
//$orderBy = $mySelectFieldName." DESC";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create SQL Where Clause!
|
// Create SQL Where Clause!
|
||||||
@ -1307,7 +1311,7 @@ class LogStreamDB extends LogStream {
|
|||||||
" FROM `" . $this->_logStreamConfigObj->DBTableName . "`" .
|
" FROM `" . $this->_logStreamConfigObj->DBTableName . "`" .
|
||||||
$this->_SQLwhereClause .
|
$this->_SQLwhereClause .
|
||||||
" GROUP BY " . $mySelectFieldName .
|
" GROUP BY " . $mySelectFieldName .
|
||||||
" ORDER BY totalcount DESC" .
|
" ORDER BY ".$orderBy.
|
||||||
" LIMIT " . $nRecordLimit;
|
" LIMIT " . $nRecordLimit;
|
||||||
|
|
||||||
// Perform Database Query
|
// Perform Database Query
|
||||||
@ -1365,6 +1369,7 @@ class LogStreamDB extends LogStream {
|
|||||||
|
|
||||||
// --- Build Query Array
|
// --- Build Query Array
|
||||||
$arrayQueryProperties = $this->_arrProperties;
|
$arrayQueryProperties = $this->_arrProperties;
|
||||||
|
//"<pre>".$arrayQueryProperties."</pre><br>"
|
||||||
if ( isset($this->_arrFilterProperties) && $this->_arrFilterProperties != null)
|
if ( isset($this->_arrFilterProperties) && $this->_arrFilterProperties != null)
|
||||||
{
|
{
|
||||||
foreach ( $this->_arrFilterProperties as $filterproperty )
|
foreach ( $this->_arrFilterProperties as $filterproperty )
|
||||||
@ -1374,7 +1379,8 @@ class LogStreamDB extends LogStream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ---
|
// ---
|
||||||
|
//echo 'DEBUG <pre>'; print_r($arrayQueryProperties); echo '</pre>';
|
||||||
|
//echo 'DEBUG <pre>'; print_r($this->_filters); echo '</pre>';
|
||||||
// Loop through all available properties
|
// Loop through all available properties
|
||||||
foreach( $arrayQueryProperties as $propertyname )
|
foreach( $arrayQueryProperties as $propertyname )
|
||||||
{
|
{
|
||||||
@ -1496,26 +1502,8 @@ class LogStreamDB extends LogStream {
|
|||||||
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
|
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
|
||||||
{
|
{
|
||||||
// Get current timestamp
|
// Get current timestamp
|
||||||
|
|
||||||
$nNowTimeStamp = time() - (60 * 60 * intval($myfilter[FILTER_VALUE]));
|
$nNowTimeStamp = time() - (60 * 60 * intval($myfilter[FILTER_VALUE]));
|
||||||
|
|
||||||
/*if ( $myfilter[FILTER_VALUE] == DATE_LASTX_HOUR )
|
|
||||||
$nNowTimeStamp -= 60 * 60; // One Hour!
|
|
||||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_12HOURS )
|
|
||||||
$nNowTimeStamp -= 60 * 60 * 12; // 12 Hours!
|
|
||||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_24HOURS )
|
|
||||||
$nNowTimeStamp -= 60 * 60 * 24; // 24 Hours!
|
|
||||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_7DAYS )
|
|
||||||
$nNowTimeStamp -= 60 * 60 * 24 * 7; // 7 days
|
|
||||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_31DAYS )
|
|
||||||
$nNowTimeStamp -= 60 * 60 * 24 * 31; // 31 days
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Set filter to unknown and Abort in this case!
|
|
||||||
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_UNKNOWN;
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Append filter
|
// Append filter
|
||||||
$tmpfilters[$propertyname][FILTER_VALUE] .= $dbmapping[$szTableType]['DBMAPPINGS'][$propertyname] . " > '" . date("Y-m-d H:i:s", $nNowTimeStamp) . "'";
|
$tmpfilters[$propertyname][FILTER_VALUE] .= $dbmapping[$szTableType]['DBMAPPINGS'][$propertyname] . " > '" . date("Y-m-d H:i:s", $nNowTimeStamp) . "'";
|
||||||
}
|
}
|
||||||
@ -1554,7 +1542,6 @@ class LogStreamDB extends LogStream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check and combine all filters now!
|
// Check and combine all filters now!
|
||||||
if ( isset($tmpfilters) )
|
if ( isset($tmpfilters) )
|
||||||
{
|
{
|
||||||
@ -1587,7 +1574,7 @@ class LogStreamDB extends LogStream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo $this->_SQLwhereClause;
|
//echo $this->_SQLwhereClause."<br>";
|
||||||
//$dbmapping[$szTableType][SYSLOG_UID]
|
//$dbmapping[$szTableType][SYSLOG_UID]
|
||||||
}
|
}
|
||||||
else // No filters means nothing to do!
|
else // No filters means nothing to do!
|
||||||
|
7
src/include/db_update_v14.txt
Normal file
7
src/include/db_update_v14.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
-- New Database Structure Updates
|
||||||
|
ALTER TABLE `logcon_charts` ADD `chart_orderby` VARCHAR( 255 ) NULL AFTER `chart_defaultfilter` ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Insert data
|
||||||
|
|
||||||
|
-- Updated Data
|
@ -510,6 +510,8 @@ function CreateReloadTimesList()
|
|||||||
$tmpReloadSeconds = GetConfigSetting("ViewEnableAutoReloadSeconds", "", CFGLEVEL_USER);
|
$tmpReloadSeconds = GetConfigSetting("ViewEnableAutoReloadSeconds", "", CFGLEVEL_USER);
|
||||||
if ( $tmpReloadSeconds > 0 )
|
if ( $tmpReloadSeconds > 0 )
|
||||||
{
|
{
|
||||||
|
//by default select predefined value
|
||||||
|
$_SESSION['AUTORELOAD_ID'] = 1;
|
||||||
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => $content['LN_AUTORELOAD_PRECONFIGURED'] . " (" . $tmpReloadSeconds . " " . $content['LN_AUTORELOAD_SECONDS'] . ") ", "Value" => $tmpReloadSeconds ); $iCounter++;
|
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => $content['LN_AUTORELOAD_PRECONFIGURED'] . " (" . $tmpReloadSeconds . " " . $content['LN_AUTORELOAD_SECONDS'] . ") ", "Value" => $tmpReloadSeconds ); $iCounter++;
|
||||||
}
|
}
|
||||||
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 5 " . $content['LN_AUTORELOAD_SECONDS'], "Value" => 5 ); $iCounter++;
|
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 5 " . $content['LN_AUTORELOAD_SECONDS'], "Value" => 5 ); $iCounter++;
|
||||||
|
@ -931,6 +931,7 @@ function LoadChartsFromDatabase()
|
|||||||
DB_CHARTS . ".chart_type, " .
|
DB_CHARTS . ".chart_type, " .
|
||||||
DB_CHARTS . ".chart_width, " .
|
DB_CHARTS . ".chart_width, " .
|
||||||
DB_CHARTS . ".chart_field, " .
|
DB_CHARTS . ".chart_field, " .
|
||||||
|
DB_CHARTS . ".chart_orderby, " .
|
||||||
DB_CHARTS . ".chart_defaultfilter, " .
|
DB_CHARTS . ".chart_defaultfilter, " .
|
||||||
DB_CHARTS . ".maxrecords, " .
|
DB_CHARTS . ".maxrecords, " .
|
||||||
DB_CHARTS . ".showpercent, " .
|
DB_CHARTS . ".showpercent, " .
|
||||||
|
@ -122,11 +122,14 @@ $content['main_pager_last_found'] = false;
|
|||||||
// Init Sorting variables
|
// Init Sorting variables
|
||||||
$content['sorting'] = "";
|
$content['sorting'] = "";
|
||||||
$content['searchstr'] = "";
|
$content['searchstr'] = "";
|
||||||
$content['searchstr_htmlform'] = "datelastx:6";
|
$content['searchstr_htmlform'] = "datelastx:6 severity:-8";
|
||||||
$content['highlightstr'] = "";
|
$content['highlightstr'] = "";
|
||||||
$content['highlightstr_htmlform'] = "";
|
$content['highlightstr_htmlform'] = "";
|
||||||
$content['EXPAND_HIGHLIGHT'] = "false";
|
$content['EXPAND_HIGHLIGHT'] = "false";
|
||||||
|
|
||||||
|
// hide header by default
|
||||||
|
$_SESSION['SESSION_MAXIMIZED'] = true;
|
||||||
|
|
||||||
// --- Read and process filters from search dialog!
|
// --- Read and process filters from search dialog!
|
||||||
if ( (isset($_POST['search']) || isset($_GET['search'])) || (isset($_POST['filter']) || isset($_GET['filter'])) )
|
if ( (isset($_POST['search']) || isset($_GET['search'])) || (isset($_POST['filter']) || isset($_GET['filter'])) )
|
||||||
{
|
{
|
||||||
|
@ -110,6 +110,12 @@ if ( isset($content['Charts']) )
|
|||||||
$myChart['chart_defaultfilter_urldecoded'] = urlencode($myChart['chart_defaultfilter']);
|
$myChart['chart_defaultfilter_urldecoded'] = urlencode($myChart['chart_defaultfilter']);
|
||||||
else
|
else
|
||||||
$myChart['chart_defaultfilter_urldecoded'] = "";
|
$myChart['chart_defaultfilter_urldecoded'] = "";
|
||||||
|
|
||||||
|
if ( isset($myChart['chart_orderby']) && strlen($myChart['chart_orderby']) > 0 )
|
||||||
|
$myChart['chart_orderby_urldecoded'] = urlencode($myChart['chart_orderby']);
|
||||||
|
else
|
||||||
|
$myChart['chart_orderby_urldecoded'] = "";
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// --- Set CSS Class
|
// --- Set CSS Class
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
<a href="#" id="dialog-chart_{ID}"><img src="{MENU_CHART_PREVIEW}" width="16" title="{LN_CHARTS_PREVIEW}"></a>
|
<a href="#" id="dialog-chart_{ID}"><img src="{MENU_CHART_PREVIEW}" width="16" title="{LN_CHARTS_PREVIEW}"></a>
|
||||||
<script> $( "#dialog-chart_{ID}" ).click(function( event ) {
|
<script> $( "#dialog-chart_{ID}" ).click(function( event ) {
|
||||||
$( "#dialog").html('<center></br><img src="{BASEPATH}images/ajax-loader.gif"></br></br></center>');
|
$( "#dialog").html('<center></br><img src="{BASEPATH}images/ajax-loader.gif"></br></br></center>');
|
||||||
$( "#dialog").load('{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}&defaultfilter={chart_defaultfilter_urldecoded}&basepath={BASEPATH}');
|
$( "#dialog").load('{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&orderby={chart_orderby_urldecoded}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}&defaultfilter={chart_defaultfilter_urldecoded}&basepath={BASEPATH}');
|
||||||
$( "#dialog").dialog("option","position",$("#dialog").dialog("option","position"));
|
$( "#dialog").dialog("option","position",$("#dialog").dialog("option","position"));
|
||||||
$( "#dialog").dialog( {title: "Chartgenerator"});
|
$( "#dialog").dialog( {title: "Chartgenerator"});
|
||||||
$( "#dialog").dialog( "open" );
|
$( "#dialog").dialog( "open" );
|
||||||
@ -119,6 +119,11 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CHART_ORDERBY}</b></td>
|
||||||
|
<td align="left" class="line1"><input type="text" name="chart_orderby" size="55" maxlength="255" value='{chart_orderby}' class="maxwidth"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" class="cellmenu2" nowrap><b>{LN_CHART_WIDTH}</b></td>
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CHART_WIDTH}</b></td>
|
||||||
<td align="left" class="line1"><input type="text" name="chart_width" size="55" maxlength="255" value="{chart_width}" class="maxwidth"></td>
|
<td align="left" class="line1"><input type="text" name="chart_width" size="55" maxlength="255" value="{chart_width}" class="maxwidth"></td>
|
||||||
@ -133,7 +138,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" class="cellmenu2_naked" valign="top" nowrap><b>{LN_CHARTS_FILTERSTRING}</b></td>
|
<td align="left" class="cellmenu2_naked" valign="top" nowrap><b>{LN_CHARTS_FILTERSTRING}</b></td>
|
||||||
<td align="left" class="line1"><font class="ErrorMsg">{LN_CHARTS_FILTERSTRING_HELP}</font></br><input type="text" name="chart_defaultfilter" size="100" maxlength="1024" value="{chart_defaultfilter}" class="maxwidth"></td>
|
<td align="left" class="line1"><font class="ErrorMsg">{LN_CHARTS_FILTERSTRING_HELP}</font></br><input type="text" name="chart_defaultfilter" size="100" maxlength="1024" value='{chart_defaultfilter}' class="maxwidth"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -43,6 +43,15 @@
|
|||||||
<td class="cellmenu2" nowrap><B>{LN_CHART_FIELD}</B></td>
|
<td class="cellmenu2" nowrap><B>{LN_CHART_FIELD}</B></td>
|
||||||
<td class="line2"> {CHART_FIELD_DISPLAYNAME}</td>
|
<td class="line2"> {CHART_FIELD_DISPLAYNAME}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cellmenu2" nowrap><B>{LN_CHART_ORDERBY}</B></td>
|
||||||
|
<td class="line2"> {chart_orderby}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cellmenu2" nowrap><B>{LN_CHART_FILTER}</B></td>
|
||||||
|
<td class="line2"> {chart_defaultfilter}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cellmenu2" nowrap><B>{LN_CHART_WIDTH}</B></td>
|
<td class="cellmenu2" nowrap><B>{LN_CHART_WIDTH}</B></td>
|
||||||
<td class="line1"> {chart_width}</td>
|
<td class="line1"> {chart_width}</td>
|
||||||
@ -59,7 +68,7 @@
|
|||||||
<div id="Chart{CHART_ID}"></div>
|
<div id="Chart{CHART_ID}"></div>
|
||||||
<script>
|
<script>
|
||||||
$( "#Chart{CHART_ID}").html('<center></br><img src="images/ajax-loader.gif"></br></br></center>');
|
$( "#Chart{CHART_ID}").html('<center></br><img src="images/ajax-loader.gif"></br></br></center>');
|
||||||
$( "#Chart{CHART_ID}").load('{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}&defaultfilter={chart_defaultfilter_urldecoded}');
|
$( "#Chart{CHART_ID}").load('{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&orderby={chart_orderby_urldecoded}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}&defaultfilter={chart_defaultfilter_urldecoded}');
|
||||||
</script>
|
</script>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user