walkor %!s(int64=11) %!d(string=hai) anos
pai
achega
b3d0dc5da2

+ 1 - 1
applications/Statistics/Lib/Cache.php

@@ -3,7 +3,7 @@ namespace Statistics\Lib;
 class Cache
 {
     public static $statisticDataCache = array();
-    public static $ServerIpList = array('127.0.0.1');
+    public static $ServerIpList = array();
     public static $modulesDataCache = array();
     public static $lastFailedIpArray = array();
     public static $lastSuccessIpArray = array();

+ 8 - 0
applications/Statistics/Modules/admin.php

@@ -33,14 +33,17 @@ function admin()
             }
             
             // 过滤掉已经保存的ip
+            $count = 0;
             foreach($ip_list as $ip)
             {
                 if(!isset(\Statistics\Lib\Cache::$ServerIpList[$ip]))
                 {
                     $ip_list_str .= $ip."\r\n";
+                    $count ++;
                 }
             }
             $action = 'add_to_server_list';
+            $notice_msg = "探测到{$count}个节点";
             break;
         case 'add_to_server_list':
             if(empty($_POST['ip_list']))
@@ -91,6 +94,11 @@ function admin()
                 $ip_list_str .= $ip."\r\n";
             }
             break;
+        default:
+            foreach(\Statistics\Lib\Cache::$ServerIpList as $ip)
+            {
+                $ip_list_str .= $ip."\r\n";
+            }
     }
     
     include ST_ROOT . '/Views/header.tpl.php';

+ 4 - 1
applications/Statistics/Views/admin.tpl.php

@@ -15,9 +15,12 @@
 					<a href="#">告警</a>
 				</li>
 				<li class="dropdown pull-right">
-					 <a href="#" data-toggle="dropdown" class="dropdown-toggle">探测节点<strong class="caret"></strong></a>
+					 <a href="#" data-toggle="dropdown" class="dropdown-toggle">其它<strong class="caret"></strong></a>
 					<ul class="dropdown-menu">
 						<li>
+							<a href="/?fn=admin&act=detect_server">探测节点</a>
+						</li>
+						<li>
 							<a href="/?fn=admin">节点管理</a>
 						</li>
 					</ul>