From f13031c0911d98e043e15f39cb62c6e06789d9bf Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Fri, 10 Oct 2008 17:02:50 +0200 Subject: [PATCH] Added some icons for parser admin and made some fixes to it. --- src/admin/parsers.php | 10 +++++ .../msgparsers/msgparser.wireless.class.php | 17 ++++++- src/images/icons/gear_delete.png | Bin 0 -> 1055 bytes src/images/icons/gear_new.png | Bin 0 -> 1052 bytes src/images/icons/information2.png | Bin 0 -> 884 bytes src/include/functions_common.php | 3 ++ src/include/functions_config.php | 7 +-- src/lang/en/admin.php | 6 +-- src/templates/admin/admin_parsers.html | 42 +++++++----------- 9 files changed, 52 insertions(+), 33 deletions(-) create mode 100644 src/images/icons/gear_delete.png create mode 100644 src/images/icons/gear_new.png create mode 100644 src/images/icons/information2.png diff --git a/src/admin/parsers.php b/src/admin/parsers.php index 17d4bb9..610b276 100644 --- a/src/admin/parsers.php +++ b/src/admin/parsers.php @@ -288,6 +288,16 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) ) $myParsers['ParserHelpEnabled'] = true; else $myParsers['ParserHelpEnabled'] = false; + + // Find out if we need to INIT something! + if ( isset($myParsers['CustomFieldsList']) && count($myParsers['CustomFieldsList']) > 0 ) + { + // $myParsers['CustomFieldsList']; + + $myParsers['ParserInitEnabled'] = true; + + } + // --- Set CSS Class if ( $i % 2 == 0 ) diff --git a/src/classes/msgparsers/msgparser.wireless.class.php b/src/classes/msgparsers/msgparser.wireless.class.php index 188adbd..6099847 100644 --- a/src/classes/msgparsers/msgparser.wireless.class.php +++ b/src/classes/msgparsers/msgparser.wireless.class.php @@ -73,8 +73,23 @@ class MsgParser_wireless extends MsgParser { // Public Information properties public $_ClassName = 'Custom Wireless Logfiles'; public $_ClassDescription = 'Custom logfile parser for wireless access points.'; - public $_ClassRequiredFields = null; public $_ClassHelpArticle = ""; + public $_ClassRequiredFields = array ( + "net_bytesrecieved" => array ( "FieldID" => "net_bytesrecieved", "FieldDefine" => "SYSLOG_NET_BYTESRECIEVED", "FieldCaption" => "Bytes recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytesrecieved", "DefaultWidth" => 50, "SearchOnline" => false, "Trunscate" => false, "Sortable" => false), + "net_bytessend" => array (", ", "FieldID" => "net_bytessend", "FieldDefine" => "SYSLOG_NET_BYTESSEND", "FieldCaption" => "Bytes send", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytessend", "DefaultWidth" => 50, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0 ), + "net_interface" => array (", ", "FieldID" => "net_interface", "FieldDefine" => "SYSLOG_NET_INTERFACE", "FieldCaption" => "Interface", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_interface", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_lastactivity" => array (", ", "FieldID" => "net_lastactivity", "FieldDefine" => "SYSLOG_NET_LASTACTIVITY", "FieldCaption" => "Last Activity", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_lastactivity", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_lastip" => array (", ", "FieldID" => "net_lastip", "FieldDefine" => "SYSLOG_NET_LASTIP", "FieldCaption" => "Last IP Address", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_lastip", "DefaultWidth" => 100, "SearchOnline" => 1, "Trunscate" => 0, "Sortable" => 0), + "net_mac_address" => array (", ", "FieldID" => "net_mac_address", "FieldDefine" => "SYSLOG_NET_MAC_ADDRESS", "FieldCaption" => "Mac Address", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_mac_address", "DefaultWidth" => 125, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_packetsrecieved" => array (", ", "FieldID" => "net_packetsrecieved", "FieldDefine" => "SYSLOG_NET_PACKETSRECIEVED", "FieldCaption" => "Packets recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_packetsrecieved", "DefaultWidth" => 50, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_packetssend" => array (", ", "FieldID" => "net_packetssend", "FieldDefine" => "SYSLOG_NET_PACKETSSEND", "FieldCaption" => "Packets send", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_packetssend", "DefaultWidth" => 50, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_rxrate" => array (", ", "FieldID" => "net_rxrate", "FieldDefine" => "SYSLOG_NET_RXRATE", "FieldCaption" => "RX Rate", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_rxrate", "DefaultWidth" => 65, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_signalstrength" => array (", ", "FieldID" => "net_signalstrength", "FieldDefine" => "SYSLOG_NET_SIGNALSTRENGTH", "FieldCaption" => "Signal strength", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_signalstrength", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_signaltonoise" => array (", ", "FieldID" => "net_signaltonoise", "FieldDefine" => "SYSLOG_NET_SIGNALTONOISE", "FieldCaption" => "Signal to noise", "FieldType" => 1, "FieldAlign" => "center", "SearchField" => "net_signaltonoise", "DefaultWidth" => 50, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_uptime" => array (", ", "FieldID" => "net_uptime", "FieldDefine" => "SYSLOG_NET_UPTIME", "FieldCaption" => "System Uptime", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_uptime", "DefaultWidth" => 85, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_txccq" => array (", ", "FieldID" => "net_txccq", "FieldDefine" => "SYSLOG_NET_TXCCQ", "FieldCaption" => "TX CCQ", "FieldType" => 1, "FieldAlign" => "center", "SearchField" => "net_txccq", "DefaultWidth" => 50, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0), + "net_txrate" => array (", ", "FieldID" => "net_txrate", "FieldDefine" => "SYSLOG_NET_TXRATE", "FieldCaption" => "TX Rate", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_txrate", "DefaultWidth" => 65, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0) + ); // Constructor public function MsgParser_wireless() { diff --git a/src/images/icons/gear_delete.png b/src/images/icons/gear_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..2a0f87eb9a64ab3e15c9acf36d93570e32527079 GIT binary patch literal 1055 zcmV+)1mOFLP)WdKueAT%IKVQwHYFfcSAF*!OgI65>iAS*C2FfbHbcz*x@00(qQO+^RR z1s4r65*v&It^fc432;bRa{vGe@Bjb`@Bu=sG?)MY00d`2O+f$vv5yPym6+QC{J9li|YCxwV^!EC~G|f^C4K71C99SqQA(ZUE>wOkKdGej&bb13` zzKlaABZ0x7$&asJi;&F{2nJ{J>zSEFp{wiqk@@+tCuka%6;M@GjtZ95?#tyUP%3HA z>sbheRw0+8L8nup0|`n?4X|yS2?Qal92pr-Mx!&+Xd7cLT<|*9*8VC=rP8>m1+%#r zIy-&D@Bify%TlRx=UNWe*IPM?BItA;`uh443kzeia5FNk*s?|2*WP~S%)x^@fe?~U zOkG_?)ND>h1_ys0o0@vz7sc#938QJeB(b7YYUKFW5Xx}=qM+ba-ht2O`x5i8r=z1|WoT$9 z=J9w;f*@$zZg(mci^;EV6d6E-Lg^C78j^1gSw=as2QeUWcH;$!szSVrh1)Wl9wGU6 Z@;7H;c9fF+v=jgU002ovPDHLkV1np(-je_T literal 0 HcmV?d00001 diff --git a/src/images/icons/gear_new.png b/src/images/icons/gear_new.png new file mode 100644 index 0000000000000000000000000000000000000000..8935ae669b7fa93915b59c508e0c390480a97008 GIT binary patch literal 1052 zcmV+%1mpXOP)WdKueAT%IKVQwHYFfcSAF*!OgI65>iAS*C2FfbHbcz*x@00(qQO+^RR z1s4r65*v&It^fc432;bRa{vGf5dZ)S5dnW>Uy%R+00d`2O+f$vv5yP_fMk2&T(arj%)}TIqS=gH;6dQ^y&?6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?-k)aL1DrF9g}+( z9gPheYRoy@uoW9Mv$TJ=9#gA>=C_aajxEVvC*2L9MnL=joc{u!8%UV3R8k=T0000< KMNUMnLSTX?YJ>{_ literal 0 HcmV?d00001 diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 5a5c9c9..9481060 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -621,6 +621,9 @@ function InitFrontEndVariables() $content['MENU_FIELDS'] = $content['BASEPATH'] . "images/icons/tables.png"; $content['MENU_DELETE_FROMDB'] = $content['BASEPATH'] . "images/icons/data_delete.png"; $content['MENU_DELETE_FROMDB_DISABLED'] = $content['BASEPATH'] . "images/icons/data_delete_disabled.png"; + $content['MENU_INFORMATION'] = $content['BASEPATH'] . "images/icons/information2.png"; + $content['MENU_PARSER_DELETE'] = $content['BASEPATH'] . "images/icons/gear_delete.png"; + $content['MENU_PARSER_INIT'] = $content['BASEPATH'] . "images/icons/gear_new.png"; $content['MENU_PAGER_BEGIN'] = $content['BASEPATH'] . "images/icons/media_beginning.png"; $content['MENU_PAGER_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png"; diff --git a/src/include/functions_config.php b/src/include/functions_config.php index 3758348..e57f543 100644 --- a/src/include/functions_config.php +++ b/src/include/functions_config.php @@ -238,12 +238,13 @@ function InitMessageParsers() if ( $tmpParser->_ClassRequiredFields != null && count($tmpParser->_ClassRequiredFields) > 0 ) { $bCustomFields = true; - $bCustomFieldList = $tmpParser->_ClassRequiredFields; + $aCustomFieldList = $tmpParser->_ClassRequiredFields; +// print_r ( $aCustomFieldList ); } else { $bCustomFields = false; - $bCustomFieldList = null; + $aCustomFieldList = null; } // Add entry to msg parser list! @@ -252,7 +253,7 @@ function InitMessageParsers() "DisplayName" => $szParserName, "Description" => $szParserDescription, "CustomFields" => $bCustomFields, - "CustomFieldsList" => $bCustomFieldList, + "CustomFieldsList" => $aCustomFieldList, "ParserHelpArticle" => $szParserHelpArticle, ); } diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index df19bd2..bad0540 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -304,9 +304,9 @@ $content['LN_PARSERS_NAME'] = "Parser Name"; $content['LN_PARSERS_DESCRIPTION'] = "Short Description"; $content['LN_PARSERS_ERROR_NOPARSERS'] = "There were no valid message parsers found in your installation. "; $content['LN_PARSERS_HELP'] = "Help"; -$content['LN_PARSERS_'] = ""; -$content['LN_PARSERS_'] = ""; -$content['LN_PARSERS_'] = ""; +$content['LN_PARSERS_INFO'] = "Show more Information for this message parser."; +$content['LN_PARSERS_INIT'] = "Initialize settings for this message parser."; +$content['LN_PARSERS_REMOVE'] = "Remove settings for this message parser."; $content['LN_PARSERS_'] = ""; $content['LN_PARSERS_'] = ""; $content['LN_PARSERS_'] = ""; diff --git a/src/templates/admin/admin_parsers.html b/src/templates/admin/admin_parsers.html index bf1ad51..dcfce79 100644 --- a/src/templates/admin/admin_parsers.html +++ b/src/templates/admin/admin_parsers.html @@ -27,29 +27,35 @@ {LN_PARSERS_ID} {LN_PARSERS_NAME} {LN_PARSERS_DESCRIPTION} - {LN_PARSERS_HELP} - {LN_GEN_ACTIONS} + {LN_GEN_ACTIONS} {ID} {DisplayName} {Description} - - - - + + + + -   -   + + + + +   + + +   + - +
@@ -63,22 +69,6 @@ - - - - - - - - - -
{LN_GEN_USERONLY}
{LN_GEN_USERONLY}
{LN_GEN_GROUPONLY} - -
@@ -88,7 +78,7 @@
- +