Witam; Czy jest szansa by taki modulik: http://img402.imageshack.us/img402/1396/urzadzeniadf1.jpg znalazl sie na stale w lms'ie?
Dodaje on do glownej strony lms'a info o podlaczonych urzadzeniach z przyznanym adresem ip. Po zalogowaniu do lms'a od razu widzimy czy nasze urzadzonka sprawuja sie ok (sa online). Jezeli znajdzie sie cos takiego na stale mozna to rozbudowac o linki do list urzadzen online, offline, podlaczonych itp - tak jak to mam miejsce w przypadku komputerow. W zalaczniku maly diffik.
Index: lib/LMS.class.php =================================================================== RCS file: /home/cvsroot/lms/lib/LMS.class.php,v retrieving revision 1.875 diff -u -r1.875 LMS.class.php --- lib/LMS.class.php 29 Aug 2007 06:16:01 -0000 1.875 +++ lib/LMS.class.php 10 Sep 2007 21:45:24 -0000 @@ -1403,6 +1403,15 @@ return $result; }
+ function NetDevStats() + { + $result['connected'] = $this->DB->GetOne('SELECT COUNT(id) FROM nodes WHERE access=1 AND ownerid=0'); + $result['disconnected'] = $this->DB->GetOne('SELECT COUNT(id) FROM nodes WHERE access=0 AND ownerid=0'); + $result['online'] = $this->DB->GetOne('SELECT COUNT(id) FROM nodes WHERE ?NOW?-lastonline < ? AND ownerid=0', array($this->CONFIG['phpui']['lastonline_limit'])); + $result['total'] = $this->DB->GetOne('SELECT COUNT(id) FROM nodes WHERE ownerid=0'); + return $result; + } + function GetNetDevLinkedNodes($id) { return $this->DB->GetAll('SELECT nodes.id AS id, nodes.name AS name, linktype, ipaddr, Index: modules/welcome.php =================================================================== RCS file: /home/cvsroot/lms/modules/welcome.php,v retrieving revision 1.53 diff -u -r1.53 welcome.php --- modules/welcome.php 17 Aug 2007 13:06:54 -0000 1.53 +++ modules/welcome.php 10 Sep 2007 21:45:25 -0000 @@ -49,6 +49,7 @@ $SMARTY->assign('sysinfo',$SI->get_sysinfo()); $SMARTY->assign('customerstats',$LMS->CustomerStats()); $SMARTY->assign('nodestats',$LMS->NodeStats()); +$SMARTY->assign('netdevstats',$LMS->NetDevStats()); $SMARTY->display('welcome.html');
?> Index: templates/welcome.html =================================================================== RCS file: /home/cvsroot/lms/templates/welcome.html,v retrieving revision 1.81 diff -u -r1.81 welcome.html --- templates/welcome.html 10 Jul 2007 08:37:05 -0000 1.81 +++ templates/welcome.html 10 Sep 2007 21:45:25 -0000 @@ -245,6 +245,49 @@ </TABLE> </TD> <TD WIDTH="50%" style="vertical-align: top;"> + <TABLE WIDTH="100%" CELLPADDING="3"> + <TR CLASS="DARK"> + <TD COLSPAN="2" ALIGN="CENTER" CLASS="FALL"> + <IMG SRC="img/netdev.gif"> <B>{t}Net devices:{/t}</B> + </TD> + </TR> + <TR CLASS="LIGHT"> + <TD WIDTH="50%" ALIGN="RIGHT" CLASS="FLEFTU"> + <B>{t}Online:{/t}</B> + </TD> + <TD WIDTH="50%" CLASS="FRIGHTU"> + {$netdevstats.online} + </TD> + </TR> + <TR CLASS="LIGHT"> + <TD WIDTH="50%" ALIGN="RIGHT" CLASS="FLEFT"> + <B>{t}Connected devices:{/t}</B> + </TD> + <TD WIDTH="50%" CLASS="FRIGHT"> + {$netdevstats.connected} + </TD> + </TR> + <TR CLASS="LIGHT"> + <TD WIDTH="50%" ALIGN="RIGHT" CLASS="FLEFT"> + <B>{t}Disconnected:{/t}</B> + </TD> + <TD WIDTH="50%" CLASS="FRIGHT"> + {$netdevstats.disconnected} + </TD> + </TR> + <TR CLASS="LIGHT"> + <TD WIDTH="50%" ALIGN="RIGHT" CLASS="FLEFTU"> + <B><A HREF="?m=netdevlist">{t}Total:{/t}</A></B> + </TD> + <TD WIDTH="50%" CLASS="FRIGHTU"> + {$netdevstats.total} + </TD> + </TR> + </TABLE> + </TD> + </TR> + <TR> + <TD WIDTH="50%" style="vertical-align: top;"> <TABLE WIDTH="100%" CELLPADDING="3"> <TR CLASS="DARK"> <TD ALIGN="CENTER" CLASS="FALL"> @@ -264,10 +307,6 @@ </TR> </TABLE> </TD> - </TR> - <TR> - <TD WIDTH="50%" style="vertical-align: top;"> - </TD> <TD WIDTH="50%" style="vertical-align: top;"> <TABLE WIDTH="100%" CELLPADDING="3"> <TR CLASS="DARK">
_______________________________________________ lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms