diff --git a/grafana_dashboards/schema/panel/__init__.py b/grafana_dashboards/schema/panel/__init__.py index 327facc..a9a6222 100644 --- a/grafana_dashboards/schema/panel/__init__.py +++ b/grafana_dashboards/schema/panel/__init__.py @@ -22,6 +22,7 @@ from grafana_dashboards.schema.panel.stat import Stat from grafana_dashboards.schema.panel.text import Text from grafana_dashboards.schema.panel.table import Table +from grafana_dashboards.schema.panel.gauge import Gauge from grafana_dashboards.schema.panel.bargauge import Bargauge from grafana_dashboards.schema.panel.timeseries import Timeseries from grafana_dashboards.schema.panel.piechart import PieChart @@ -50,6 +51,8 @@ def validate_individually(self, panel: dict): schema = Text(usingNewSchema=self.usingNewSchema).get_schema() elif panel["type"] == "table": schema = Table(usingNewSchema=self.usingNewSchema).get_schema() + elif panel["type"] == "gauge": + schema = Gauge(usingNewSchema=self.usingNewSchema).get_schema() elif panel["type"] == "bargauge": schema = Bargauge(usingNewSchema=self.usingNewSchema).get_schema() elif panel["type"] == "timeseries": diff --git a/grafana_dashboards/schema/panel/base.py b/grafana_dashboards/schema/panel/base.py index af343ca..241b048 100644 --- a/grafana_dashboards/schema/panel/base.py +++ b/grafana_dashboards/schema/panel/base.py @@ -153,6 +153,7 @@ def __init__(self, usingNewSchema=False): "text", "stat", "table", + "gauge", "bargauge", "timeseries", "piechart", diff --git a/grafana_dashboards/schema/panel/stat.py b/grafana_dashboards/schema/panel/stat.py index ab48cff..4eef537 100644 --- a/grafana_dashboards/schema/panel/stat.py +++ b/grafana_dashboards/schema/panel/stat.py @@ -50,6 +50,7 @@ def get_schema(self): v.Required("colorMode"): v.Any(str), v.Required("graphMode"): v.Any(str), v.Required("justifyMode"): v.Any(str), + v.Optional("showPercentChange", default=False): v.Any(bool), v.Optional("reduceOptions"): v.All(reduceOptions), } diff --git a/tests/schema/panels/test_stat.py b/tests/schema/panels/test_stat.py index 22328a5..bd0499d 100644 --- a/tests/schema/panels/test_stat.py +++ b/tests/schema/panels/test_stat.py @@ -40,6 +40,7 @@ def test_defaults(self): "values": False, }, "textMode": "auto", + "showPercentChange": False, }, "span": 12, "targets": [],