Doc: update schema for percent type config

This commit is contained in:
李通洲
2024-11-14 14:22:24 +08:00
parent 1c41c6ccb1
commit 6801fe3d9c
2 changed files with 51 additions and 5 deletions
+33 -5
View File
@@ -34,6 +34,35 @@
"description": "Output color of the module. Left empty to use `display.color.output`",
"$ref": "#/$defs/colors"
},
"percentType": {
"description": "Set the percentage output type",
"oneOf": [
{
"type": "number",
"description": "1 for percentage number, 2 for multi-color bar, 3 for both, 6 for bar only, 9 for colored number, 10 for monochrome bar",
"minimum": 0,
"maximum": 255,
"default": 9
},
{
"type": "array",
"description": "array of string flags",
"items": {
"enum": [
"num",
"bar",
"hide-others",
"num-color",
"bar-monochrome"
]
},
"default": [
"num",
"num-color"
]
}
]
},
"percent": {
"description": "Threshold of percentage colors",
"type": "object",
@@ -50,6 +79,9 @@
"minimum": 0,
"maximum": 100,
"description": "Value greater than green and less then yellow will be shown in yellow.\nValue greater than yellow will be shown in red"
},
"type": {
"$ref": "#/$defs/percentType"
}
}
},
@@ -576,11 +608,7 @@
"description": "Set how a percentage value should be displayed",
"properties": {
"type": {
"type": "number",
"description": "Set the percentage output type. 1 for percentage number, 2 for multi-color bar, 3 for both, 6 for bar only, 9 for colored number, 10 for monochrome bar",
"minimum": 0,
"maximum": 255,
"default": 9
"$ref": "#/$defs/percentType"
},
"ndigits": {
"type": "number",
+18
View File
@@ -1602,6 +1602,24 @@
},
"pseudo": true
},
{
"long": "<module>-percent-type",
"desc": "Set the percentage output type",
"remark": [
"0 for use global `--percent-type` value",
"1 for percentage number",
"2 for multi-color bar",
"3 for both",
"6 for bar only",
"9 for colored number",
"10 for monochrome bar"
],
"arg": {
"type": "num",
"default": 0
},
"pseudo": true
},
{
"long": "<module>-temp-green",
"desc": [