diff --git a/api.py b/api.py index 8873c31..e6833d9 100644 --- a/api.py +++ b/api.py @@ -36,9 +36,11 @@ def preprocess_plugin_data(plugin): def get_all_plugins(): plugins = OrderedDict() matomo4_plugins = fetch_plugins("4.0.0") - + supported_plugins = 0 + unsupported_plugins = 0 for plugin in matomo4_plugins: plugin["supports4"] = True + supported_plugins += 1 plugin = preprocess_plugin_data(plugin) plugins[plugin["name"]] = plugin @@ -50,6 +52,7 @@ def get_all_plugins(): name = plugin["name"] if name not in plugins: + unsupported_plugins += 1 plugins[name] = plugin def function(plugin): @@ -61,6 +64,7 @@ def get_all_plugins(): for name in ["CustomDimensions"]: # CustomDimensions became a core plugin del plugins[name] + unsupported_plugins -= 1 data = load_additional_data() plugins_new = {} @@ -72,4 +76,4 @@ def get_all_plugins(): plugins = OrderedDict( sorted(plugins.items(), key=function)) - return plugins + return plugins, supported_plugins, unsupported_plugins diff --git a/main.py b/main.py index afcc393..ecc6394 100644 --- a/main.py +++ b/main.py @@ -11,10 +11,13 @@ output_html_file = Path("public/index.html") sp = run(["git", "rev-parse", "--verify", "HEAD"], capture_output=True) commit = sp.stdout.decode().strip() - +plugins, supported, unsupported = get_all_plugins() template = Template(template_file.read_text(), autoescape=True, undefined=StrictUndefined) output_html_file.write_text(template.render({ - "plugins": get_all_plugins(), + "plugins": plugins, "commit": commit, - "now": datetime.now() + "now": datetime.now(), + "supported": supported, + "unsupported": unsupported, + "fraction": supported / (supported + unsupported) * 100 })) diff --git a/template.html b/template.html index 9b7c61d..6419c0e 100644 --- a/template.html +++ b/template.html @@ -30,7 +30,7 @@ font-weight: bold; } - .card { + .card, .progress { margin-bottom: 1rem; } @@ -39,20 +39,27 @@ height: 16px; } - footer { - display: flex; - justify-content: space-between; + footer { + display: flex; + justify-content: space-between; - } - footer span,footer a { - display: block; - } + } + + footer span, footer a { + display: block; + }

Matomo Plugins

Tracking the current progress in making all Matomo plugins support Matomo 4!

+
+
+ {{ supported }} of {{ supported + unsupported }} +
+
{% for name,plugin in plugins.items() %}