diff --git a/app.mjs b/app.mjs index 84582ac..af225e2 100755 --- a/app.mjs +++ b/app.mjs @@ -167,19 +167,21 @@ async function GenerateHtml() { '25': '0.13.0', }; let repoHistories = []; + const repoFields = [ + 'forks', + 'stars', + 'watchers', + 'open_pulls', + 'closed_pulls', + 'merged_pulls', + 'open_issues', + 'closed_issues', + ]; { const rs = await client.execute( ` SELECT - created_at, - forks, - stars, - watchers, - open_pulls, - closed_pulls, - merged_pulls, - open_issues, - closed_issues + created_at, ${repoFields.join(', ')} FROM repo_histories ORDER BY @@ -203,9 +205,9 @@ limit 1000 } const idsToShow = [ - '25', // 0.13.0 - '23', // 0.12.0 - // '20', // '0.14.0', + // '25', // 0.13.0 + // '23', // 0.12.0 + '20', // '0.14.0', // '19', // '0.15.0', ]; @@ -237,6 +239,7 @@ limit 1000 repoHistoriesStr: JSON.stringify(repoHistories), idToTitle: idToTitle, idsToShow: idsToShow, + repoFields: repoFields, }); fs.writeFileSync('web/raw.html', body, fileOpts); } diff --git a/template.ejs b/template.ejs index c70cb63..483b5ba 100644 --- a/template.ejs +++ b/template.ejs @@ -14,7 +14,10 @@ const repoHistories = <%- repoHistoriesStr %>; window.onload = function() { const charts = [ - renderRepoChart(repoHistories, "repo-chart"), + <% for(const [index, field] of repoFields.entries()) { %> + renderRepoChart(repoHistories, '<%= field %>', <%= index+1 %>), + <% } %> + <% for(const id of idsToShow) { %> renderMilestoneChart(historiesById, <%= id %>), <% } %> @@ -31,8 +34,6 @@

Zig Milestone Monitor

-

Zig repository

-
<% for(const id of idsToShow) { %>

<%= idToTitle[id] %>

@@ -55,6 +56,11 @@
<% } %> +

Zig repository

+ <% for(const field of repoFields) { %> +
+ <% } %> +