mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 23:19:05 +00:00
Add #121
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Components\IP;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\UserSubscribe;
|
||||
use App\Models\UserSubscribeLog;
|
||||
@@ -50,7 +51,15 @@ class SubscribeController extends Controller
|
||||
$query->whereUserSubscribeId($id);
|
||||
}
|
||||
|
||||
return view('admin.subscribe.log', ['subscribeLog' => $query->latest()->paginate(20)->appends(\request('page'))]);
|
||||
$subscribeLogs = $query->latest()->paginate(20)->appends(\request('page'));
|
||||
foreach ($subscribeLogs as $log) {
|
||||
// 跳过上报多IP的
|
||||
if ($log->request_ip) {
|
||||
$log->ipInfo = implode(' ', IP::getIPInfo($log->request_ip));
|
||||
}
|
||||
}
|
||||
|
||||
return view('admin.subscribe.log', ['subscribeLog' => $subscribeLogs]);
|
||||
}
|
||||
|
||||
// 设置用户的订阅的状态
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace App\Observers;
|
||||
use App\Components\DDNS;
|
||||
use App\Jobs\VNet\reloadNode;
|
||||
use App\Models\Node;
|
||||
use App\Models\NodeAuth;
|
||||
use App\Services\NodeService;
|
||||
use Arr;
|
||||
use Log;
|
||||
@@ -20,11 +19,7 @@ class NodeObserver
|
||||
|
||||
public function created(Node $node): void
|
||||
{
|
||||
$auth = new NodeAuth();
|
||||
$auth->node_id = $node->id;
|
||||
$auth->key = Str::random();
|
||||
$auth->secret = Str::random(8);
|
||||
if (! $auth->save()) {
|
||||
if (! $node->auth()->create(['key' => Str::random(), 'secret' => Str::random(8)])) {
|
||||
Log::warning('节点生成-自动生成授权时出现错误,请稍后自行生成授权!');
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
return [
|
||||
'name' => 'ProxyPanel',
|
||||
'number' => '2.6.b',
|
||||
'number' => '2.6.c',
|
||||
];
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
<tr>
|
||||
<td>{{$log->id}}</td>
|
||||
<td>{{$log->type}}</td>
|
||||
<td>{{$log->node ? $log->node->name : '【节点已删除】'}}</td>
|
||||
<td>{{$log->user ? $log->user->email : '【用户已删除】'}}</td>
|
||||
<td>{{$log->node->name ?? '【节点已删除】'}}</td>
|
||||
<td>{{$log->user->email ?? '【用户已删除】'}}</td>
|
||||
<td>
|
||||
@if (strpos($log->ip, ',') !== false)
|
||||
@foreach (explode(',', $log->ip) as $ip)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<th> #</th>
|
||||
<th> 用户</th>
|
||||
<th> 请求IP</th>
|
||||
<th> 归属地</th>
|
||||
<th> 请求时间</th>
|
||||
<th> 访问</th>
|
||||
</tr>
|
||||
@@ -23,8 +24,15 @@
|
||||
@foreach($subscribeLog as $subscribe)
|
||||
<tr>
|
||||
<td>{{$subscribe->id}}</td>
|
||||
<td>{{empty($subscribe->user) ? '用户已删除' : $subscribe->user->email}}</td>
|
||||
<td>{{$subscribe->request_ip}}</td>
|
||||
<td>{{$subscribe->user->email ?? '用户已删除'}}</td>
|
||||
<td>
|
||||
@if ($subscribe->request_ip)
|
||||
<a href="https://www.ipip.net/ip/{{$subscribe->request_ip}}.html" target="_blank">{{$subscribe->request_ip}}</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{$subscribe->ipInfo}}
|
||||
</td>
|
||||
<td>{{$subscribe->request_time}}</td>
|
||||
<td>{{$subscribe->request_header}}</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user