Resize templates

This commit is contained in:
lowlighter
2020-10-24 21:49:19 +02:00
parent b1d290024c
commit 1d56d799c2
4 changed files with 26 additions and 22 deletions

View File

@@ -40,7 +40,7 @@
}) })
//Base routes //Base routes
const limiter = ratelimit({max:60, windowMs:60*1000}) const limiter = ratelimit({max:debug ? Number.MAX_SAFE_INTEGER : 60, windowMs:60*1000})
const templates = [...new Set([conf.settings.templates.default, ...(conf.settings.templates.enabled.length ? Object.keys(Templates).filter(key => conf.settings.templates.enabled.includes(key)) : Object.keys(Templates))])] const templates = [...new Set([conf.settings.templates.default, ...(conf.settings.templates.enabled.length ? Object.keys(Templates).filter(key => conf.settings.templates.enabled.includes(key)) : Object.keys(Templates))])]
const enabled = Object.entries(plugins).filter(([key, plugin]) => plugin.enabled).map(([key]) => key) const enabled = Object.entries(plugins).filter(([key, plugin]) => plugin.enabled).map(([key]) => key)
const actions = {flush:new Map()} const actions = {flush:new Map()}

View File

@@ -1,13 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" width="480" height="<%= 0 <svg xmlns="http://www.w3.org/2000/svg" width="480" height="<%= 0
+ (!!base.header)*(16*6) + (!!base.header)*86
+ (!!base.metadata)*(16*3) + (!!base.metadata)*42
+ ((!!base.activity)||(!!base.community))*(16*10) + ((!!base.activity)||(!!base.community))*150
+ (!!base.repositories)*(16*7) + (!!base.repositories)*100
+ ((!!computed.plugins.traffic)||(!!computed.plugins.lines))*(16*2) + ((!!computed.plugins.traffic)||(!!computed.plugins.lines))*18
+ (!!computed.plugins.followup)*(16*5) + (!!computed.plugins.followup)*72
+ (!!computed.plugins.languages)*(16*6) + (!!computed.plugins.pagespeed)*128
+ (!!computed.plugins.pagespeed)*(16*9) + (!!computed.plugins.habits)*72
+ (!!computed.plugins.habits)*(16*5) + (!!computed.plugins.languages)*96
%>"> %>">
<style> <style>
<%= style %> <%= style %>

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -1,14 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" width="480" height="<%= 48 <svg xmlns="http://www.w3.org/2000/svg" width="480" height="<%= 48
+ (!!base.header)*(16*5) + (!!base.header)*64
+ (!!base.metadata)*(16*9) + (!!base.metadata)*122
+ (!!base.activity)*(16*10) + (!!base.activity)*146
+ (!!base.community)*(16*9) + (!!base.community)*120
+ (!!base.repositories)*(16*13) + (!!base.repositories)*188
+ (!!computed.plugins.traffic)*(16*1) + (Object.entries(base).filter(([key, value]) => value).length)*8
+ (!!computed.plugins.followup)*(16*6) + (!!computed.plugins.traffic)*18
+ (!!computed.plugins.lines)*(16*3) + (!!computed.plugins.followup)*112
+ (!!computed.plugins.languages)*(16*12) + (!!computed.plugins.lines)*36
+ (!!computed.plugins.pagespeed)*(16*10) + ((!!computed.plugins.traffic)+(!!computed.plugins.followup)+(!!computed.plugins.lines))*4
+ (!!computed.plugins.pagespeed)*132
+ (!!computed.plugins.languages)*172
+ (Object.entries(computed.plugins).filter(([key, value]) => value).length)*4
%>"> %>">
<% <%
meta.$ = `<span class="ps1-path">${user.login}@metrics</span>:<span class="ps1-location">~</span>${computed.token.scopes.includes("repo") ? "#" : "$"}` meta.$ = `<span class="ps1-path">${user.login}@metrics</span>:<span class="ps1-location">~</span>${computed.token.scopes.includes("repo") ? "#" : "$"}`
@@ -52,13 +55,13 @@
<pre><div style="margin-top:-16px"></div><%# -%> <pre><div style="margin-top:-16px"></div><%# -%>
<% if (base.metadata) { %> <% if (base.metadata) { %>
<span class="banner"><%# -%> <div class="banner"><%# -%>
GitHub metrics generator <%= meta.version %> GitHub metrics generator <%= meta.version %>
These generated metrics comes with ABSOLUTELY NO WARRANTY, These generated metrics comes with ABSOLUTELY NO WARRANTY,
to the extent permitted by applicable law. to the extent permitted by applicable law.
Last generated: <%= new Date().toGMTString() %> Last generated: <%= new Date().toGMTString() %>
</span><% } -%> </div><% } -%>
<%# ============================================================= -%> <%# ============================================================= -%>
<% if (base.header) { %> <% if (base.header) { %>
<div class="stdin"><%- meta.$ %> whoami</div><%# -%> <div class="stdin"><%- meta.$ %> whoami</div><%# -%>

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -55,6 +55,7 @@
border-bottom-right-radius: 5px; border-bottom-right-radius: 5px;
font-family: monospace; font-family: monospace;
color: #DDDDDD; color: #DDDDDD;
white-space: break-spaces;
} }
.banner, footer { .banner, footer {