mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-23 19:37:35 +08:00
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:
@@ -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));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user