feat: Add node load submission and display functionality

- Implemented node load status submission in UniProxyController with dynamic cache expiration based on server push interval.
- Added log filtering capability in the admin panel for better log management and analysis.
This commit is contained in:
xboard
2025-05-24 12:31:18 +08:00
parent 61300fbcc3
commit a3700ad685
13 changed files with 270 additions and 75 deletions
+15
View File
@@ -47,6 +47,7 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
* @property int|null $u 上行流量
* @property int|null $d 下行流量
* @property int|null $total 总流量
* @property-read array|null $load_status 负载状态(包含CPU、内存、交换区、磁盘信息)
*/
class Server extends Model
{
@@ -432,4 +433,18 @@ class Server extends Model
}
);
}
/**
* 负载状态访问器
*/
protected function loadStatus(): Attribute
{
return Attribute::make(
get: function () {
$type = strtoupper($this->type);
$serverId = $this->parent_id ?: $this->id;
return Cache::get(CacheKey::get("SERVER_{$type}_LOAD_STATUS", $serverId));
}
);
}
}