Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add two more global reports #375

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions _data/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ const REPORTS = {
url: "global__device_category__last30.[end_date].csv",
columnKeys: ["deviceCategory", "activeUsers", "percentage"]
},
MOST_DOWNLOADED_DATASETS: {
title: "Most Downloaded Dataset Files",
description: "Top 10 downloaded files",
url: "global__download_requests__last30.[end_date].csv",
columnKeys: ["linkUrl", "eventCount"]
},
MOST_CLICKED_OUTBOUND_LINKS: {
title: "Most Clicked Outbound Links",
description: "Top 10 external link clicks",
url: "global__link_requests__last30.[end_date].csv",
columnKeys: ["linkUrl", "eventCount"]
},
DATASETS_PER_ORG: {
title: "Number of Datasets per Organization",
description: "Count of datasets by organization",
Expand All @@ -36,6 +48,7 @@ const REPORTS = {
url: "global__harvest_sources.[end_date].csv",
columnKeys: ["organization", "count"]
}

},
// ORG is a meta constructor for orgs
ORG: {
Expand Down
22 changes: 12 additions & 10 deletions pages/metrics/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,19 @@ <h4>{{block.meta.title}}</h4>
{% for row in block.data offset:1 %}
<tr>
{% for column in row %}
{%- if block.meta.columnKeys contains block.data[0][forloop.index0] -%}
{%- if forloop.first -%}
{%- if cacheKey == "DATASETS_PER_ORG" or cacheKey == "HARVEST_SOURCES_PER_ORG" -%}
<td><a href="{{helpers.baseUrl}}/metrics/organization/{{column}}/index.html">{{metrics.orgDict[column]}}</a></td>
{%- else -%}
<td>{{column}}</td>
{%- if block.meta.columnKeys contains block.data[0][forloop.index0] -%}
{%- if forloop.first -%}
{%- if cacheKey == "DATASETS_PER_ORG" or cacheKey == "HARVEST_SOURCES_PER_ORG" -%}
<td><a href="{{helpers.baseUrl}}/metrics/organization/{{column}}/index.html">{{metrics.orgDict[column]}}</a></td>
{%- elsif cacheKey == "MOST_DOWNLOADED_DATASETS" or cacheKey == "MOST_CLICKED_OUTBOUND_LINKS" -%}
<td><a href="{{column}}">{{column}}</a></td>
{%- else -%}
<td>{{column}}</td>
{%- endif -%}
{%- else -%}
<td align="right">{{column | toLocaleString}}</td>
{%- endif -%}
{%- endif -%}
{%- else -%}
<td align="right">{{column | toLocaleString}}</td>
{%- endif -%}
{%- endif -%}
{% endfor %}
</tr>
{% endfor %}
Expand Down
Loading