mirror of
https://github.com/Findus23/matomo4-plugins.git
synced 2024-09-19 15:23:43 +02:00
add progress bar
This commit is contained in:
parent
3791d469b5
commit
534c6bd7e8
3 changed files with 27 additions and 13 deletions
8
api.py
8
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
|
||||
|
|
9
main.py
9
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
|
||||
}))
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="mt-5">Matomo Plugins</h1>
|
||||
<p class="lead">Tracking the current progress in making all Matomo plugins support Matomo 4!</p>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" role="progressbar" style="width: {{ fraction }}%;" aria-valuenow="{{ fraction }}"
|
||||
aria-valuemin="0" aria-valuemax="100">
|
||||
{{ supported }} of {{ supported + unsupported }}
|
||||
</div>
|
||||
</div>
|
||||
{% for name,plugin in plugins.items() %}
|
||||
<div class="card {% if plugin.supports4 %}matomo4{% else %}matomo3{% endif %}">
|
||||
<div class="card-body">
|
||||
|
|
Loading…
Reference in a new issue