新功能: - instances 应用:OpenClaw 实例管理 - Instance 模型:实例注册,Agent 列表,Webhook URL - MeetingInstanceMap:会议 - 实例映射 - Webhook 推送:消息发送时自动通知相关实例 API 端点: - POST /api/v1/instances/register/ - 实例注册 - POST /api/v1/instances/join-meeting/ - 加入会议 - GET /api/v1/instances/ - 实例列表 - POST /api/v1/instances/webhook-test/ - Webhook 测试 集成: - send_message API 自动触发 Webhook 推送 - 支持广播和定向推送 测试: - test_webhook.py: 完整测试流程 使用场景: 1. 每台 OpenClaw 机器注册实例 2. Agent 加入会议时关联实例 3. 消息发送时推送到对应机器 4. 本机 OpenClaw 收到通知,触发 Agent 响应
16 lines
564 B
Python
16 lines
564 B
Python
from django.contrib import admin
|
|
from .models import Instance, MeetingInstanceMap
|
|
|
|
|
|
@admin.register(Instance)
|
|
class InstanceAdmin(admin.ModelAdmin):
|
|
list_display = ['instance_id', 'instance_name', 'agent_ids', 'webhook_url', 'is_active', 'last_heartbeat']
|
|
list_filter = ['is_active', 'webhook_enabled']
|
|
search_fields = ['instance_id', 'instance_name']
|
|
|
|
|
|
@admin.register(MeetingInstanceMap)
|
|
class MeetingInstanceMapAdmin(admin.ModelAdmin):
|
|
list_display = ['meeting_id', 'instance', 'agent_ids', 'joined_at', 'left_at']
|
|
list_filter = ['left_at']
|