mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
- Added new features to the index page like detail popups, currently done as plain css popups.
- Implemented a few from the new frontend options - hidden not implemented menu entries
This commit is contained in:
parent
6bfc736ab4
commit
0f0e88a40f
@ -21,3 +21,29 @@
|
||||
/* position: relative; */
|
||||
display: none;
|
||||
}
|
||||
|
||||
.syslogdetails, a.syslogdetails, a.syslogdetails:link
|
||||
{
|
||||
font-weight:normal;
|
||||
text-decoration:none;
|
||||
}
|
||||
.syslogdetails
|
||||
{
|
||||
position:relative; /*this is the key*/
|
||||
z-index:24;
|
||||
}
|
||||
|
||||
.syslogdetails:hover
|
||||
{
|
||||
z-index:25;
|
||||
/* font-weight:normal;*/
|
||||
}
|
||||
.syslogdetails span {display: none}
|
||||
/*the span will display just on :hover state*/
|
||||
.syslogdetails:hover span
|
||||
{
|
||||
display:block;
|
||||
position:absolute;
|
||||
top:15px;
|
||||
left:15px;
|
||||
}
|
||||
|
@ -81,17 +81,18 @@ function CreateCurrentUrl()
|
||||
|
||||
function GetFormatedDate($evttimearray)
|
||||
{
|
||||
global $content;
|
||||
global $content, $CFG;
|
||||
|
||||
if ( date('d', $evttimearray[EVTIME_TIMESTAMP]) == date('d') )
|
||||
$szDateFormatted = "Today " . date("H:i:s", $evttimearray[EVTIME_TIMESTAMP] );
|
||||
else if ( date('d', $evttimearray[EVTIME_TIMESTAMP] + 86400) == date('d') )
|
||||
$szDateFormatted = "Yesterday " . date("H:i:s", $evttimearray[EVTIME_TIMESTAMP] );
|
||||
else
|
||||
$szDateFormatted = date("Y-m-d H:i:s", $evttimearray[EVTIME_TIMESTAMP] );
|
||||
if ( isset($CFG['ViewUseTodayYesterday']) && $CFG['ViewUseTodayYesterday'] == 1 )
|
||||
{
|
||||
if ( date('d', $evttimearray[EVTIME_TIMESTAMP]) == date('d') )
|
||||
return "Today " . date("H:i:s", $evttimearray[EVTIME_TIMESTAMP] );
|
||||
else if ( date('d', $evttimearray[EVTIME_TIMESTAMP] + 86400) == date('d') )
|
||||
return "Yesterday " . date("H:i:s", $evttimearray[EVTIME_TIMESTAMP] );
|
||||
}
|
||||
|
||||
// return formated string
|
||||
return $szDateFormatted;
|
||||
// Reach return normal format!
|
||||
return $szDateFormatted = date("Y-m-d H:i:s", $evttimearray[EVTIME_TIMESTAMP] );
|
||||
}
|
||||
|
||||
?>
|
@ -199,10 +199,15 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) && (isset($_POST['filte
|
||||
|
||||
if ( strlen($content['highlightstr']) > 0 )
|
||||
{
|
||||
$searchArray = array("\\", "/", ".", ">");
|
||||
$replaceArray = array("\\\\", "\/", "\.", ">");
|
||||
|
||||
// user also wants to highlight words!
|
||||
if ( strpos($content['highlightstr'], ",") === false)
|
||||
{
|
||||
$content['highlightwords'][0]['highlight'] = $content['highlightstr'];
|
||||
|
||||
$content['highlightwords'][0]['highlight_raw'] = $content['highlightstr'];
|
||||
$content['highlightwords'][0]['highlight'] = str_replace( $searchArray, $replaceArray, $content['highlightstr']);
|
||||
$content['highlightwords'][0]['cssclass'] = "highlight_1";
|
||||
$content['highlightwords'][0]['htmlcode'] = '<span class="' . $content['highlightwords'][0]['cssclass'] . '">' . $content['highlightwords'][0]['highlight']. '</span>';
|
||||
}
|
||||
@ -211,13 +216,12 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) && (isset($_POST['filte
|
||||
// Split array into words
|
||||
$tmparray = explode( ",", $content['highlightstr'] );
|
||||
foreach( $tmparray as $word )
|
||||
{
|
||||
$content['highlightwords'][]['highlight'] = $word;
|
||||
}
|
||||
$content['highlightwords'][]['highlight_raw'] = $word;
|
||||
|
||||
// Assign CSS Class to highlight words
|
||||
// Assign other variables needed for this array entry
|
||||
for ($i = 0; $i < count($content['highlightwords']); $i++)
|
||||
{
|
||||
$content['highlightwords'][$i]['highlight'] = str_replace( $searchArray, $replaceArray, $content['highlightwords'][$i]['highlight_raw']);
|
||||
$content['highlightwords'][$i]['cssclass'] = "highlight_" . ($i+1);
|
||||
$content['highlightwords'][$i]['htmlcode'] = '<span class="' . $content['highlightwords'][$i]['cssclass'] . '">' . $content['highlightwords'][$i]['highlight']. '</span>';
|
||||
}
|
||||
@ -267,9 +271,37 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren
|
||||
// Copy UID
|
||||
$content['syslogmessages'][$counter]['UID'] = $uID;
|
||||
|
||||
// --- Popup Details
|
||||
if ( isset($CFG['ViewEnableDetailPopups']) && $CFG['ViewEnableDetailPopups'] == 1 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['popupcaption'] = GetAndReplaceLangStr( $content['LN_GRID_POPUPDETAILS'], $content['syslogmessages'][$counter]['UID']);
|
||||
$content['syslogmessages'][$counter]['popupdetails'] = "true";
|
||||
foreach($content['syslogmessages'][$counter] as $mykey => $myfield)
|
||||
{
|
||||
// Set key!
|
||||
$content['syslogmessages'][$counter]['messagesdetails'][]['fieldtitle']= $mykey;
|
||||
|
||||
// Get ArrayIndex
|
||||
$myIndex = count($content['syslogmessages'][$counter]['messagesdetails']) - 1;
|
||||
|
||||
// --- Set CSS Class
|
||||
if ( $myIndex % 2 == 0 )
|
||||
$content['syslogmessages'][$counter]['messagesdetails'][$myIndex]['cssclass'] = "line1";
|
||||
else
|
||||
$content['syslogmessages'][$counter]['messagesdetails'][$myIndex]['cssclass'] = "line2";
|
||||
// ---
|
||||
|
||||
// Set field value
|
||||
$content['syslogmessages'][$counter]['messagesdetails'][$myIndex]['fieldvalue']= $myfield;
|
||||
}
|
||||
}
|
||||
else
|
||||
$content['syslogmessages'][$counter]['popupdetails'] = "false";
|
||||
// ---
|
||||
|
||||
// Set truncasted message for display
|
||||
if ( isset($logArray[SYSLOG_MESSAGE]) )
|
||||
$content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] = GetStringWithHTMLCodes(strlen($logArray[SYSLOG_MESSAGE]) > 100 ? substr($logArray[SYSLOG_MESSAGE], 0, 100 ) . " ..." : $logArray[SYSLOG_MESSAGE]);
|
||||
$content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] = GetStringWithHTMLCodes(strlen($logArray[SYSLOG_MESSAGE]) > $CFG['ViewMessageCharacterLimit'] ? substr($logArray[SYSLOG_MESSAGE], 0, $CFG['ViewMessageCharacterLimit'] ) . " ..." : $logArray[SYSLOG_MESSAGE]);
|
||||
else
|
||||
$content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] = "";
|
||||
|
||||
@ -278,19 +310,20 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren
|
||||
// We need to highlight some words ^^!
|
||||
foreach( $content['highlightwords'] as $highlightword )
|
||||
$content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] = preg_replace( "/(" . $highlightword['highlight'] . ")/i", '<span class="' . $highlightword['cssclass'] . '">\\1</span>', $content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] );
|
||||
// $content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] = str_ireplace( $highlightword['highlight'], $highlightword['htmlcode'], $content['syslogmessages'][$counter][SYSLOG_MESSAGETRUNSCATED] );
|
||||
}
|
||||
|
||||
// Create Displayable DataStamp
|
||||
// --- Create Displayable DataStamp
|
||||
$content['syslogmessages'][$counter][SYSLOG_DATE_FORMATED] = GetFormatedDate($content['syslogmessages'][$counter][SYSLOG_DATE]);
|
||||
// ---
|
||||
|
||||
// --- Set CSS Class
|
||||
if ( $counter % 2 == 0 )
|
||||
$content['syslogmessages'][$counter]['cssclass'] = "line1";
|
||||
else
|
||||
$content['syslogmessages'][$counter]['cssclass'] = "line2";
|
||||
// ---
|
||||
|
||||
// Set Syslog severity and facility col colors
|
||||
// --- Set Syslog severity and facility col colors
|
||||
if ( isset($content['syslogmessages'][$counter][SYSLOG_SEVERITY]) && strlen($content['syslogmessages'][$counter][SYSLOG_SEVERITY]) > 0)
|
||||
{
|
||||
$content['syslogmessages'][$counter]['severity_color'] = $severity_colors[$content['syslogmessages'][$counter][SYSLOG_SEVERITY]];
|
||||
@ -314,7 +347,6 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren
|
||||
$content['syslogmessages'][$counter]['facility_color'] = $facility_colors[SYSLOG_LOCAL0];
|
||||
$content['syslogmessages'][$counter]['facility_cssclass'] = $content['syslogmessages'][$counter]['cssclass'];
|
||||
}
|
||||
|
||||
// ---
|
||||
|
||||
// Increment Counter
|
||||
|
@ -23,6 +23,7 @@ $content['LN_GRID_SYSLOGTAG'] = "SyslogTag";
|
||||
$content['LN_GRID_INFOUNIT'] = "InfoUnit";
|
||||
$content['LN_GRID_HOST'] = "Source";
|
||||
$content['LN_GRID_MSG'] = "Message";
|
||||
$content['LN_GRID_POPUPDETAILS'] = "Details for Syslogmessage with ID '%1'";
|
||||
|
||||
$content['LN_SEARCH_USETHISBLA'] = "Use the form below and your advanced search will appear here";
|
||||
$content['LN_SEARCH_FILTER'] = "Search (filter):";
|
||||
|
@ -2,11 +2,11 @@
|
||||
<tr>
|
||||
<td class="topmenu1" nowrap align="center" width="100"><a class="topmenu1_link" href="search.php?{additional_url}" target="_top">Search</a></td>
|
||||
<td class="topmenu1" nowrap align="center" width="100"><a class="topmenu1_link" href="index.php?{additional_url}" target="_top">Show Events</a></td>
|
||||
<td class="topmenu1" nowrap align="center" width="125"><a class="topmenu1_link" href="" target="_top">Show SysLogTags</a></td>
|
||||
<td class="topmenu1" nowrap align="center" width="100"><a class="topmenu1_link" href="" target="_top">User Options</a></td>
|
||||
<td class="topmenu1" nowrap align="center" width="125"><a class="topmenu1_link" href="" target="_top">Database Options</a></td>
|
||||
<td class="topmenu1" nowrap align="center" width="100"><a class="topmenu1_link" href="" target="_top">Refresh</a></td>
|
||||
<td class="topmenu1" nowrap align="center" width="100"><a class="topmenu1_link" href="" target="_top">Help</a></td>
|
||||
<!-- <td class="topmenu1" nowrap align="center" width="125"><a class="topmenu1_link" href="" target="_top">Show SysLogTags</a></td>-->
|
||||
<!-- <td class="topmenu1" nowrap align="center" width="100"><a class="topmenu1_link" href="" target="_top">User Options</a></td>-->
|
||||
<!-- <td class="topmenu1" nowrap align="center" width="125"><a class="topmenu1_link" href="" target="_top">Database Options</a></td>-->
|
||||
<!-- <td class="topmenu1" nowrap align="center" width="100"><a class="topmenu1_link" href="?" target="_top">Refresh</a></td>-->
|
||||
<!-- <td class="topmenu1" nowrap align="center" width="100"><a class="topmenu1_link" href="" target="_top">Help</a></td>-->
|
||||
<td class="topmenuend" nowrap align="center" width="max"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -42,7 +42,7 @@
|
||||
<table border="0" cellpadding="1" cellspacing="1" width="100%" align="center">
|
||||
<tr>
|
||||
<!-- BEGIN highlightwords -->
|
||||
<td class="{cssclass}" align="center"><b>{highlight}</b></td>
|
||||
<td class="{cssclass}" align="center"><b>{highlight_raw}</b></td>
|
||||
<!-- END highlightwords -->
|
||||
</tr>
|
||||
</table>
|
||||
@ -111,7 +111,28 @@
|
||||
<td align="left" class="{cssclass}" nowrap><B>{syslogtag}</B></td>
|
||||
<td align="center" class="{cssclass}"><B>{IUT}</B></td>
|
||||
<td align="left" class="{cssclass}" nowrap><B>{FROMHOST}</B></td>
|
||||
<td align="left" class="{cssclass}"><B>{msgtrunscated}</B></td>
|
||||
<td align="left" class="{cssclass}">
|
||||
<!-- IF popupdetails="true" -->
|
||||
<a href="?todo" class="syslogdetails">{msgtrunscated}
|
||||
<span>
|
||||
<table cellpadding="0" cellspacing="1" border="0" align="center" class="with_border_alternate">
|
||||
<tr>
|
||||
<td colspan="2" class="cellmenu1" align="center"><B>{popupcaption}</B></td>
|
||||
</tr>
|
||||
<!-- BEGIN messagesdetails -->
|
||||
<tr>
|
||||
<td width="150" nowrap class="cellmenu2">{fieldtitle}</td>
|
||||
<td width="100%" class="{cssclass}" >{fieldvalue}</td>
|
||||
</tr>
|
||||
<!-- END messagesdetails -->
|
||||
</table>
|
||||
</span>
|
||||
</a>
|
||||
<!-- ENDIF popupdetails="true" -->
|
||||
<!-- IF popupdetails="false" -->
|
||||
<B>{msgtrunscated}</B>
|
||||
<!-- ENDIF popupdetails="false" -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END syslogmessages -->
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user