Monitor

系统监控面板,可独立集成到任何网页中

new CooWasm.Monitor(options)

Name Type Description
options Object optional

配置选项

Name Type Default Description
containerId String optional

容器div的ID,如果不提供会自动创建

mapInstance Object optional

地图实例,用于获取节点信息

position String 'bottom-right' optional

面板位置: 'bottom-right', 'bottom-left', 'top-right', 'top-left'

showNodes Boolean true optional

是否显示节点监控

maxMemory Number 4095 optional

最大内存限制(MB)

theme String 'dark' optional

主题: 'dark', 'light'

autoCreate Boolean true optional

当containerId不存在时是否自动创建容器

Example:
// 自动创建容器(最简用法)
const monitor = new CooWasm.Monitor();

// 指定容器
const monitor = new CooWasm.Monitor({
    containerId: 'monitor-container',
    mapInstance: map
});

// 自定义配置
const monitor = new CooWasm.Monitor({
    position: 'top-left',
    showNodes: false,
    theme: 'light'
});

Methods

destroy()

销毁监控器

setMapInstance(mapInstance)

设置地图实例

Name Type Description
mapInstance Object

地图实例