npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@riil-frontend/component-manage-metric-select

v1.0.2

Published

intro component

Downloads

13

Readme

监控指标选择 ManageMetrics

manage-metrics

ManageMetrics

主资源或者主资源组件的指标选择

ManageMetrics

value 字段的结构

const value = {
	metricList: [
		{
			code: 'A', //指标行的id(指标)
			resType: 'switch', //资产类型
			resId: '000000001a8f4818', //主资产实例id
			metricCode: 'ping_status/network.interface-COM-operate_status', //指标code
			comId: '000000001a8f4875', //组件资产实例id
			color: '$color-data3-2', //指标折线颜色
			isDisabled: true / false, //是否隐藏
		},
	],
	funcList: [
		{
			code: 'FN-0', //函数行的id(统计值)
			func: 'SUM/AVG', //函数类型
			formula: 'A,B', //函数计算的指标行id
			displayName: '求和', //函数统计后折线名
			color: '$color-data3-2', //指标折线颜色
			isDisabled: true / false, //是否隐藏
		},
	],
};

API

| 参数名 | 说明 | 必填 | 类型 | 默认值 | 备注 | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | | request | 请求 | 是 | any | - | - | | comClassName | 组件类名 | 否 | string | manage-metric-select | - | | onChange | 组件指标改变时的回调函数签名:Function(value: mixed, error: mixed) => void参数:value: {mixed} 指标行记录error: {mixed} 表单返回的校验结果 | 是 | function | - | - | | value | 组件的值(受控字段) | 否 | object | - | value={{metricList:[],funcList:[]}} | | maxMetricNum | 添加指标最大值 | 否 | number | 5 | - | | maxFunNum | 添加函数最大值 | 否 | number | 3 | - | | colorComProps | 颜色组件属性 | 否 | object | colorComProps={dataSource: ['rgba(0,214,225,1)','rgba(0,161,255,1)','rgba(45,222,152,1)','rgba(131,188,9,1)','rgba(0,180,65,1)','rgba(0,180,154,1)','rgba(88,66,255,1)','rgba(142,67,231,1)','rgba(255,174,58,1)','rgba(255,76,127,1)','rgba(220,15,45,1)','rgba(116,142,166,1)',]} | - | | chartType | 趋势图显示类型可选值'line':线形图'bar':柱状图'area':面积图'scatter':散点图 | 否 | string | 'line' | - | | mode | 趋势图内部选择显示可选值'single':单个组件形式'combine':组合时序图 | 否 | string | 'single' | 值为'combine'时显示可定义元素 | | theme | 主题包 | 否 | string | 'theme-19926' | - | | isShowMsg | 控制添加指标数和函数数的显示 | 否 | boolean | true | - | | onDeleteItem | 指标删除事件签名:Function(record: mixed) => void参数:record: {mixed} 行记录消息 | 否 | Function | - | 可自定义删除事件 | | hasLoading | 控制组件的 loading | 否 | boolean | false | - | | renderDom | 自定义元素(mode 为'combine'时使用) | 否 | ReactDOM | - | - | | validatorMsg | 自定义校验函数 | 否 | function | - | - | | onChangeFormula | 组件函数改变时的回调函数签名:Function(value: mixed, record: mixed,name:string) => boolean参数:value: {mixed} 函数表单值record: {mixed} 函数行记录name: {string} 校验名 | 是 | function | - | 返回值为 true 即有非法输入 | | formulaText | 函数表达式输入框提示信息 | 否 | string | - | - | | setLoading | 外层整体 loading 控制 | 否 | function | - | setState |