Explorar el Código

用户在线IP

admin hace 7 años
padre
commit
5d5bd42b35

+ 1 - 1
app/Http/Controllers/AdminController.php

@@ -2406,7 +2406,7 @@ EOF;
         $userList = $query->paginate(15);
         if (!$userList->isEmpty()) {
             foreach ($userList as &$user) {
-                $user->onlineIPList = SsNodeIp::query()->with(['node', 'user'])->where('port', $user->port)->orderBy('id', 'desc')->limit(5)->get();
+                $user->onlineIPList = SsNodeIp::query()->with(['node', 'user'])->where('port', $user->port)->orderBy('id', 'desc')->limit(10)->get();
             }
         }
 

+ 20 - 18
resources/views/admin/userOnlineIPList.blade.php

@@ -96,24 +96,26 @@
                                                 </td>
                                                 <td>
                                                     @if($user->onlineIPList)
-                                                        @foreach($user->onlineIPList as $vo)
-                                                            <table class="table table-hover table-light">
-                                                                <thead>
-                                                                    <tr>
-                                                                        <th> 时间 </th>
-                                                                        <th> 节点 </th>
-                                                                        <th> 类型 </th>
-                                                                        <th> IP </th>
-                                                                    </tr>
-                                                                </thead>
-                                                                <tbody>
-                                                                    <td>{{$vo->created_at}}</td>
-                                                                    <td>{{$vo->node->name}}</td>
-                                                                    <td>{{$vo->type}}</td>
-                                                                    <td>{{$vo->ip}}</td>
-                                                                </tbody>
-                                                            </table>
-                                                        @endforeach
+                                                        <table class="table table-hover table-light">
+                                                            <thead>
+                                                            <tr>
+                                                                <th> 时间 </th>
+                                                                <th> 节点 </th>
+                                                                <th> 类型 </th>
+                                                                <th> IP </th>
+                                                            </tr>
+                                                            </thead>
+                                                            <tbody>
+                                                            @foreach($user->onlineIPList as $vo)
+                                                                <tr>
+                                                                        <td>{{$vo->created_at}}</td>
+                                                                        <td>{{$vo->node->name}}</td>
+                                                                        <td>{{$vo->type}}</td>
+                                                                        <td>{{$vo->ip}}</td>
+                                                                </tr>
+                                                            @endforeach
+                                                            </tbody>
+                                                        </table>
                                                     @endif
                                                 </td>
                                             </tr>