mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Started implementing context link generation within the message
This commit is contained in:
parent
a1c27ade3f
commit
5641cc8b61
@ -47,6 +47,7 @@
|
||||
}
|
||||
.syslogdetails span {display: none}
|
||||
/*the span will display just on :hover state*/
|
||||
/*
|
||||
.syslogdetails:hover span
|
||||
{
|
||||
display:block;
|
||||
@ -54,6 +55,15 @@
|
||||
top:15px;
|
||||
left:15px;
|
||||
}
|
||||
*/
|
||||
.syslogdetails_popup span
|
||||
{
|
||||
display:block;
|
||||
position:absolute;
|
||||
z-index:5;
|
||||
/* top:15px; */
|
||||
/* left:15px; */
|
||||
}
|
||||
|
||||
.gridline
|
||||
{
|
||||
|
@ -849,6 +849,32 @@ function GetMonthFromString($szMonth)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* AddContextLinks
|
||||
*/
|
||||
function AddContextLinks($sourceTxt)
|
||||
{
|
||||
// Create Search Array
|
||||
$search = array
|
||||
(
|
||||
'|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|',
|
||||
// '/([\w\d\_\/]+)\.(de|com)/x',
|
||||
);
|
||||
|
||||
// Create Replace Array
|
||||
$replace = array
|
||||
(
|
||||
'<a href="http://kb.monitorware.com/kbsearch.php?sa=whois&oid=ip&q=$1" target="_top" class="contextlink">$1</a>',
|
||||
// '<a href="http://kb.monitorware.com/kbsearch.php?sa=whois&oid=name&q=$1.$2" target="_top" class="contextlink">$1.$2</a>',
|
||||
);
|
||||
|
||||
// Replace and return!
|
||||
$outTxt = preg_replace( $search, $replace, $sourceTxt );
|
||||
|
||||
//echo $outTxt . " <br>" ;
|
||||
|
||||
return $outTxt;
|
||||
}
|
||||
|
||||
// --- BEGIN Usermanagement Function ---
|
||||
function StartPHPSession()
|
||||
|
@ -457,6 +457,10 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = "";
|
||||
}
|
||||
|
||||
// --- HOOK here to add context links!
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = AddContextLinks($content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue']);
|
||||
// ---
|
||||
|
||||
// If we need to highlight some words ^^!
|
||||
if ( isset($content['highlightwords']) )
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = HighLightString( $content['highlightwords'], $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] );
|
||||
|
@ -241,8 +241,11 @@
|
||||
</div>
|
||||
<!-- ENDIF hasbuttons="true" -->
|
||||
|
||||
<!-- IF hasdetails="false" -->
|
||||
<!-- IF ismessagefield="true" -->
|
||||
<a href="{detaillink}{additional_url_sourceonly}" class="syslogdetails"><img align="left" src="{MENU_LINK_VIEW}" width="16" height="16" border="1" title="{LN_GEN_AVAILABLESEARCHES}"></a>
|
||||
<!-- ENDIF ismessagefield="true" -->
|
||||
|
||||
<!-- IF hasdetails="false" -->
|
||||
<!-- IF ismessagefield!="true" -->
|
||||
|
||||
<!-- IF hasbuttons="true" -->
|
||||
@ -265,8 +268,7 @@
|
||||
|
||||
<!-- ENDIF hasdetails="false" -->
|
||||
<!-- IF hasdetails="true" -->
|
||||
|
||||
<a href="{detaillink}{additional_url_sourceonly}" class="syslogdetails">{fieldvalue}
|
||||
<div OnClick="document.location='{detaillink}{additional_url_sourceonly}';" style="cursor:pointer" class="syslogdetails" OnMouseOver="this.className='syslogdetails_popup';" OnMouseOut="this.className='syslogdetails';">{fieldvalue}<br />
|
||||
<span>
|
||||
<table cellpadding="0" cellspacing="1" border="0" width="500" align="left" class="with_border_alternate">
|
||||
<tr><td colspan="2" class="cellmenu1" align="center"><B>{popupcaption}</B></td></tr>
|
||||
@ -278,7 +280,7 @@
|
||||
<!-- END messagesdetails -->
|
||||
</table>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- ENDIF hasdetails="true" -->
|
||||
</td>
|
||||
<!-- END values -->
|
||||
|
@ -32,6 +32,25 @@ a:hover
|
||||
font-weight:bold;
|
||||
color:#FF0000;
|
||||
}
|
||||
/*---*/
|
||||
|
||||
/* Context Link Classes */
|
||||
a.contextlink:link,a.contextlink:active,a.contextlink:visited,a.contextlink
|
||||
{
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-weight:bold;
|
||||
background-color: transparent;
|
||||
color:#3814BB;
|
||||
text-decoration:underline;
|
||||
}
|
||||
a.contextlink:hover
|
||||
{
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-weight:bold;
|
||||
color:#3844FF;
|
||||
text-decoration:none;
|
||||
}
|
||||
/*---*/
|
||||
|
||||
img
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user