From 06d024ae6b004ed3ec5749f5739ea8d4a75627e0 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Fri, 14 Mar 2008 14:18:30 +0100 Subject: [PATCH] - Added new images - enhanced filter dialog - minor changes --- images/icons/navigate_down.png | Bin 0 -> 718 bytes images/icons/navigate_down2.png | Bin 0 -> 976 bytes images/icons/navigate_minus.png | Bin 0 -> 485 bytes images/icons/navigate_plus.png | Bin 0 -> 709 bytes include/constants_general.php | 34 ++++++++++- include/constants_logstream.php | 1 - include/functions_filters.php | 81 +++++++++++++++++++++++--- index.php | 3 - js/common.js | 7 ++- lang/en/main.php | 12 ++++ templates/index.html | 99 +++++++++++++++++++++++++++----- themes/default/main.css | 4 +- 12 files changed, 207 insertions(+), 34 deletions(-) create mode 100644 images/icons/navigate_down.png create mode 100644 images/icons/navigate_down2.png create mode 100644 images/icons/navigate_minus.png create mode 100644 images/icons/navigate_plus.png diff --git a/images/icons/navigate_down.png b/images/icons/navigate_down.png new file mode 100644 index 0000000000000000000000000000000000000000..3643095808c7dd8e940b27ff694f46fe4479a607 GIT binary patch literal 718 zcmV;<0x|uGP)WdKBJATc-~MrC3kGB7YRATl#LF*Q0dFd!>1F)%ROt<&ZJ000McNliru z)&&<0G9{xirl9};010qNS#tmY3h)2`3h)6!tTdPa000DMK}|sb0I`n?{9y$E00JgS zL_t(|+Rc*RYf^C-#-HP9%c;ksCVGxeY)x0hAR4s@iq%cfU@W?-i!OE*LH|H>QxyFd z-F2}MC3VpjtC)r>SdCS4xe%Evf2=%adi*huM|+RCwqOKs(R!yIHkXad7Wsa}0fi1geW zct^^xi-C@AVW_G%p}e~bQZ%8c;X9L%zm&;fl|}r)O1{}s%GCFqvI-Vmv9SvbZ}-Tm zs}E-1DE9ZCY4BF4CJxH-imFaun?NR^xSpX?MIOdfjF%;Mgr z==H>1Pm&%Hl+O!{E7u`(VzyUUz9nS-ik4;S7 zzK`US4e@K@E1|OOIX8$3z6BSRid(Omgd_0nW55}J#VGLT)7LZeKIu+J6e$iT{uI3CqFE#1VC0`2YX_07*qoM6N<$f=-)1 AYybcN literal 0 HcmV?d00001 diff --git a/images/icons/navigate_down2.png b/images/icons/navigate_down2.png new file mode 100644 index 0000000000000000000000000000000000000000..e693efcfd823b0601230b5dfed47f788ec239dd5 GIT binary patch literal 976 zcmV;>126oEP)WdKBJATc-~MrC3kGB7YRATl#LF*Q0dFd!>1F)%ROt<&ZJ000McNliru z)&&<0G9{xirl9};010qNS#tmY3h)2`3h)6!tTdPa000DMK}|sb0I`n?{9y$E00SsV zL_t(|+I5pjOcP-khTrMT(9*@}0;L54RWTqI>r!zECZfSDF)A11a&UH|r7ct1>G-ukVu=39Gs(Za-+U{OT6?@J zncZz4u(qy>c6vgEscT=i6T4eGQGKnNb_Rk)`m?=#t<#>kQL|WQ>j~?tM>1v(;oHN{ zbQdF(w0M`dQk@i=%4V1xaYnakl+P9M?eQnNkysR0A6Y*~a4Q^(90Q**gq+nOolAzV z$wLoDv9)uHN*S)#=Vcj0P77Yma*-e3HTZJ3hwcL`Jhz{AN>1AtFSvL?&v3d7mBd*p zqP)`#$JR2Kw5OHA0$$SSA^jRbtv>&IQPTkK%|W(AU`I|COnPRMv8p-OfZc zdPdS%<|~4!62-*~1OfQaqoDcJO?033llTpZUyOSIBr$tM6xk*5@T*&&Low@;SWz*T zFj@e+4QX-9lLYS6HX!N=Knk{#<_Xc4$`d8=4h6rauGCq2{AZkbF1MY1AP-Gjh((Js zVblUw>mz7Bcon6qS<8lFJ4f@@`QW|sl*A*cpR*|0dAX)4XPev3t0HRK^6xRNA021v z5m3*@ySHO_R@;ch`z;pt#?4l%fzb%&@{p#?h~C>BWFX99){g0M8LLcYor>c)MrF)* z{e(?H$H|KrXz9VSLkqal%2f%20Fl)q;u{!~U!8jm@zXFF_`%}+rFZ^FR
  • RAI`s z@Dj^Y-1$Y}WI;9xtIFW2a3{@KkTqH)+Fu6c`vStvfNR z#Hd)P3MLcfnHsX;ya%sqpCdNhOK+QrRQyBZNgQ8Fy6Y%Fh`ugmK$!#ALK`9x;KGSE zc#n5OmQtPhfaoT~$u?)Ej0}?=6t#6O9D9#K8jRuV1wWKz*F^0xDBOBNN0000WdKBJAT}UMb!;FqFfcSAF*Q0cFgi0fAS*C2Ffi8GJazy800(qQO+^RR z1s4r6C8IH>p#T5?32;bRa{vGe@Bjb`@Bu=sG?)MY00d`2O+f$vv5yPs7*S3pCt7uTDZ;*bPa zHj2TLViE+q=eWl7LfpTcC_bWmEp&jneZ~GmIfu05ANcNZ^ zH0@(e&10sM%&ZAz&R?FnH>egBv`rildl=97PN)-)#HA9@T5PEyYy1awwbN((^+)>Q bzP}Xjq;{CKZX$qo00000NkvXXu0mjf%hJB> literal 0 HcmV?d00001 diff --git a/images/icons/navigate_plus.png b/images/icons/navigate_plus.png new file mode 100644 index 0000000000000000000000000000000000000000..a751af1860d3b0f2878d425d6dd16ed4a1748358 GIT binary patch literal 709 zcmV;$0y_PPP)WdKBJAT}UMb!;FqFfcSAF*Q0dGdeXeAS*C2Ffdu(WC#EN00(qQO+^RR z1s4r6C8IH>p#T5?32;bRa{vGe@Bjb`@Bu=sG?)MY00d`2O+f$vv5yPxy!6??L@Z4O7HgeV`kpGnPr$Bx1Kpmi21WaghBL7wVgp>o=|-<_l7swi@*@FULY z-)!o2`qVII@R^-q2U(#p%z==s^I~$3Sxlwy;H`sxizDhXC<>S7wSuNNBNl|rFknoh zvh1RMrwVsfp@@KwkJ5T;Nz;PF4?@aM&sxa;aFO)N0SuD=eM%w6k!m@2cHgkPSwZ \ No newline at end of file diff --git a/include/constants_logstream.php b/include/constants_logstream.php index caa6125..fed7ab4 100644 --- a/include/constants_logstream.php +++ b/include/constants_logstream.php @@ -62,5 +62,4 @@ define('IUT_SMTPLISTENER', '24'); define('IUT_AliveMonECHO', '1999998'); define('IUT_MIAP_Receiver', '1999999'); -// --- ?> \ No newline at end of file diff --git a/include/functions_filters.php b/include/functions_filters.php index f13a92e..412c937 100644 --- a/include/functions_filters.php +++ b/include/functions_filters.php @@ -34,15 +34,15 @@ function InitFilterHelpers() $filters['filter_datemode'] = DATEMODE_ALL; // Init TimeFilter Helper Array -// $content['datemodes'][0]['ID'] = DATEMODE_ALL; -// $content['datemodes'][0]['DisplayName'] = $content['LN_DATEMODE_ALL']; -// if ( $filters['filter_datemode'] == DATEMODE_ALL ) { $content['datemodes'][0]['selected'] = "selected"; } else { $content['datemodes'][0]['selected'] = ""; } - $content['datemodes'][0]['ID'] = DATEMODE_RANGE; - $content['datemodes'][0]['DisplayName'] = $content['LN_DATEMODE_RANGE']; - if ( $filters['filter_datemode'] == DATEMODE_RANGE ) { $content['datemodes'][0]['selected'] = "selected"; } else { $content['datemodes'][0]['selected'] = ""; } - $content['datemodes'][1]['ID'] = DATEMODE_LASTX; - $content['datemodes'][1]['DisplayName'] = $content['LN_DATEMODE_LASTX']; - if ( $filters['filter_datemode'] == DATEMODE_LASTX ) { $content['datemodes'][1]['selected'] = "selected"; } else { $content['datemodes'][1]['selected'] = ""; } + $content['datemodes'][0]['ID'] = DATEMODE_ALL; + $content['datemodes'][0]['DisplayName'] = $content['LN_DATEMODE_ALL']; + if ( $filters['filter_datemode'] == DATEMODE_ALL ) { $content['datemodes'][0]['selected'] = "selected"; } else { $content['datemodes'][0]['selected'] = ""; } + $content['datemodes'][1]['ID'] = DATEMODE_RANGE; + $content['datemodes'][1]['DisplayName'] = $content['LN_DATEMODE_RANGE']; + if ( $filters['filter_datemode'] == DATEMODE_RANGE ) { $content['datemodes'][1]['selected'] = "selected"; } else { $content['datemodes'][1]['selected'] = ""; } + $content['datemodes'][2]['ID'] = DATEMODE_LASTX; + $content['datemodes'][2]['DisplayName'] = $content['LN_DATEMODE_LASTX']; + if ( $filters['filter_datemode'] == DATEMODE_LASTX ) { $content['datemodes'][2]['selected'] = "selected"; } else { $content['datemodes'][2]['selected'] = ""; } // Init Date Range Parameters $currentTime = time(); @@ -128,6 +128,69 @@ function InitFilterHelpers() $content['filter_daterange_last_x_list'][4]['DisplayName'] = $content['LN_DATE_LASTX_31DAYS']; if ( $filters['filter_lastx_default'] == DATE_LASTX_31DAYS ) { $content['filter_daterange_last_x_list'][4]['selected'] = "selected"; } else { $content['filter_daterange_last_x_list'][4]['selected'] = ""; } // --- + + // Init Default Syslog Facility from SESSION! + if ( isset($_SESSION['filter_facility']) ) + $filters['filter_facility'] = intval($_SESSION['filter_facility']); + else + $filters['filter_facility'] = array ( SYSLOG_KERN, SYSLOG_USER, SYSLOG_MAIL, SYSLOG_DAEMON, SYSLOG_AUTH, SYSLOG_SYSLOG, SYSLOG_LPR, SYSLOG_NEWS, SYSLOG_UUCP, SYSLOG_CRON, SYSLOG_LOCAL0, SYSLOG_LOCAL1, SYSLOG_LOCAL2, SYSLOG_LOCAL3, SYSLOG_LOCAL4, SYSLOG_LOCAL5, SYSLOG_LOCAL6, SYSLOG_LOCAL7 ); +// $filters['filter_facility'] = SYSLOG_LOCAL0; + + + + // Init Facility LIST + $content['filter_facility_list'][] = array( "ID" => SYSLOG_KERN, "DisplayName" => "SYSLOG_KERN", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_USER, "DisplayName" => "SYSLOG_USER", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_MAIL, "DisplayName" => "SYSLOG_MAIL", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_DAEMON, "DisplayName" => "SYSLOG_DAEMON", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_AUTH, "DisplayName" => "SYSLOG_AUTH", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_SYSLOG, "DisplayName" => "SYSLOG_SYSLOG", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LPR, "DisplayName" => "SYSLOG_LPR", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_NEWS, "DisplayName" => "SYSLOG_NEWS", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_UUCP, "DisplayName" => "SYSLOG_UUCP", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_CRON, "DisplayName" => "SYSLOG_CRON", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LOCAL0, "DisplayName" => "SYSLOG_LOCAL0", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LOCAL1, "DisplayName" => "SYSLOG_LOCAL1", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LOCAL2, "DisplayName" => "SYSLOG_LOCAL2", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LOCAL3, "DisplayName" => "SYSLOG_LOCAL3", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LOCAL4, "DisplayName" => "SYSLOG_LOCAL4", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LOCAL5, "DisplayName" => "SYSLOG_LOCAL5", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LOCAL6, "DisplayName" => "SYSLOG_LOCAL6", "selected" => "" ); + $content['filter_facility_list'][] = array( "ID" => SYSLOG_LOCAL7, "DisplayName" => "SYSLOG_LOCAL7", "selected" => "" ); + + + $iCount = count($content['filter_facility_list']); + for ( $i = 0; $i < $iCount; $i++ ) + { +// echo $content['filter_facility_list'][$i]["ID"] . "-" . $filters['filter_facility'] . "
    "; + if ( in_array($content['filter_facility_list'][$i]["ID"], $filters['filter_facility']) ) + $content['filter_facility_list'][$i]["selected"] = "selected"; + } + + // Init Default Syslog Severity from SESSION! + if ( isset($_SESSION['filter_severity']) ) + $filters['filter_severity'] = intval($_SESSION['filter_severity']); + else + $filters['filter_severity'] = array ( SYSLOG_EMERG, SYSLOG_ALERT, SYSLOG_CRIT, SYSLOG_ERR, SYSLOG_WARNING, SYSLOG_NOTICE, SYSLOG_INFO, SYSLOG_DEBUG ); +// $filters['filter_severity'] = SYSLOG_NOTICE; + + // Init Severity LIST + $content['filter_severity_list'][] = array( "ID" => SYSLOG_EMERG, "DisplayName" => "SYSLOG_EMERG", "selected" => "" ); + $content['filter_severity_list'][] = array( "ID" => SYSLOG_ALERT, "DisplayName" => "SYSLOG_ALERT", "selected" => "" ); + $content['filter_severity_list'][] = array( "ID" => SYSLOG_CRIT, "DisplayName" => "SYSLOG_CRIT", "selected" => "" ); + $content['filter_severity_list'][] = array( "ID" => SYSLOG_ERR, "DisplayName" => "SYSLOG_ERR", "selected" => "" ); + $content['filter_severity_list'][] = array( "ID" => SYSLOG_WARNING, "DisplayName" => "SYSLOG_WARNING", "selected" => "" ); + $content['filter_severity_list'][] = array( "ID" => SYSLOG_NOTICE, "DisplayName" => "SYSLOG_NOTICE", "selected" => "" ); + $content['filter_severity_list'][] = array( "ID" => SYSLOG_INFO, "DisplayName" => "SYSLOG_INFO", "selected" => "" ); + $content['filter_severity_list'][] = array( "ID" => SYSLOG_DEBUG, "DisplayName" => "SYSLOG_DEBUG", "selected" => "" ); + + $iCount = count($content['filter_severity_list']); + for ( $i = 0; $i < $iCount; $i++ ) + { + if ( in_array( $content['filter_severity_list'][$i]["ID"], $filters['filter_severity']) ) + $content['filter_severity_list'][$i]["selected"] = "selected"; + } + } function FillDateRangeArray($sourcearray, $szArrayListName, $szFilterName) // $content['years'], "filter_daterange_from_year_list", "filter_daterange_from_year") diff --git a/index.php b/index.php index d9d6a9b..09f6772 100644 --- a/index.php +++ b/index.php @@ -64,7 +64,6 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren require_once($gl_root_path . 'include/constants_errors.php'); require_once($gl_root_path . 'include/constants_logstream.php'); - // Obtain Config Object $stream_config = $content['Sources'][$currentSourceID]['ObjRef']; @@ -102,8 +101,6 @@ if ( isset($content['Sources'][$currentSourceID]) && $content['Sources'][$curren $content['main_pagerenabled'] = "true"; } - - // Close file! $stream->Close(); } diff --git a/js/common.js b/js/common.js index df5b1f5..2e85864 100644 --- a/js/common.js +++ b/js/common.js @@ -99,7 +99,12 @@ function hidevisibility(ElementNameToggle, ElementNameButton) function toggleDatefiltervisibility(FormName) { var myform = document.getElementById(FormName); - if (myform.elements['filter_datemode'].value == DATEMODE_RANGE) + if (myform.elements['filter_datemode'].value == DATEMODE_ALL) + { + hidevisibility('HiddenDateFromOptions'); + hidevisibility('HiddenDateLastXOptions'); + } + else if (myform.elements['filter_datemode'].value == DATEMODE_RANGE) { togglevisibility('HiddenDateFromOptions'); hidevisibility('HiddenDateLastXOptions'); diff --git a/lang/en/main.php b/lang/en/main.php index 2405117..ca8044c 100644 --- a/lang/en/main.php +++ b/lang/en/main.php @@ -24,6 +24,12 @@ $content['LN_GRID_INFOUNIT'] = "InfoUnit"; $content['LN_GRID_HOST'] = "Source"; $content['LN_GRID_MSG'] = "Message"; +$content['LN_SEARCH_FILTER'] = "Search (filter):"; +$content['LN_SEARCH_ADVANCED'] = "Advanced Search"; +$content['LN_SEARCH_FEELSAD'] = "I'm feeling sad ..."; +$content['LN_SEARCH'] = "Search"; +$content['LN_SEARCH_RESET'] = "Reset search"; + // Filter Options $content['LN_FILTER_DATE'] = "Datetime Range"; $content['LN_FILTER_DATEMODE'] = "Select mode"; @@ -39,5 +45,11 @@ $content['LN_DATE_LASTX_12HOURS'] = "Last 12 hours"; $content['LN_DATE_LASTX_24HOURS'] = "Last 24 hours"; $content['LN_DATE_LASTX_7DAYS'] = "Last 7 days"; $content['LN_DATE_LASTX_31DAYS'] = "Last 31 days"; +$content['LN_FILTER_FACILITY'] = "Syslog Facility"; +$content['LN_FILTER_SEVERITY'] = "Syslog Severity"; +$content['LN_FILTER_OTHERS'] = "Other Filters"; +$content['LN_FILTER_MESSAGE'] = "Syslog Message"; +$content['LN_FILTER_SYSLOGTAG'] = "Syslogtag"; +$content['LN_FILTER_SOURCE'] = "Source (Hostname)"; ?> \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index d867868..d21cbfd 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,17 +4,19 @@
    - -  Search (filter): + +  {LN_SEARCH_FILTER} + +
    - - - + + +
    - Advanced Search + {LN_SEARCH_ADVANCED}
    (sample: faciliy:local0 severity:warn) @@ -23,18 +25,19 @@
    + + -
    + - - + - + + + + + + + +
    {LN_FILTER_DATE}
    {LN_FILTER_DATEMODE}{LN_FILTER_DATEMODE} - + - +
    {LN_FILTER_DATEFROM}{LN_FILTER_DATEFROM}
    {LN_FILTER_DATETO}{LN_FILTER_DATETO}
    +
      + + + + + + + + + + + +
    + {LN_FILTER_OTHERS}
    {LN_FILTER_FACILITY} + + {LN_FILTER_SEVERITY} + +
    +
    + + + + + + + + +
    + {LN_FILTER_MESSAGE}
    + +
    +
      + + + + + + + + + + +
    {LN_FILTER_SYSLOGTAG} + +
    {LN_FILTER_SOURCE} + +
    +
    +
    +
    + +
    diff --git a/themes/default/main.css b/themes/default/main.css index c7b69ef..dd1a81f 100644 --- a/themes/default/main.css +++ b/themes/default/main.css @@ -375,7 +375,7 @@ A.cellmenu1_link:hover } /* Form elements */ -select, input, button, textarea +select, input, button, textarea, .SelectSavedFilter { background-color: #E8E7E2; color:#000000; @@ -393,4 +393,4 @@ select, input, button, textarea font:bold 10px Verdana,Arial,Helvetica,sans-serif; border: 1px solid; border-color: #233B51 #124A7C #124A7C #233B51; -} \ No newline at end of file +}