283 lines
17 KiB
HTML
283 lines
17 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Metrics</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="description" content="A SVG image generator which includes activity, community and repositories metrics about your GitHub account that you can includes on your profile">
|
|
<meta name="author" content="lowlighter">
|
|
<link rel="icon" href="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/microsoft/209/bar-chart_1f4ca.png">
|
|
<link rel="stylesheet" href="/.css/style.vars.css">
|
|
<link rel="stylesheet" href="/.css/style.css">
|
|
<link rel="stylesheet" href="/.css/style.prism.css" />
|
|
</head>
|
|
<body>
|
|
<!-- Vue app -->
|
|
<main :class="[palette]">
|
|
<template>
|
|
|
|
<!-- Title -->
|
|
<h1 class="title">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
|
|
<a href="https://github.com/lowlighter/metrics">Metrics v{{ version }}</a>
|
|
</h1>
|
|
|
|
<!-- Tabs -->
|
|
<nav>
|
|
<div class="left"></div>
|
|
<div class="right">
|
|
<div @click="tab = 'overview'" class="tab" :class="{active:tab === 'overview'}">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M0 1.75A.75.75 0 01.75 1h4.253c1.227 0 2.317.59 3 1.501A3.744 3.744 0 0111.006 1h4.245a.75.75 0 01.75.75v10.5a.75.75 0 01-.75.75h-4.507a2.25 2.25 0 00-1.591.659l-.622.621a.75.75 0 01-1.06 0l-.622-.621A2.25 2.25 0 005.258 13H.75a.75.75 0 01-.75-.75V1.75zm8.755 3a2.25 2.25 0 012.25-2.25H14.5v9h-3.757c-.71 0-1.4.201-1.992.572l.004-7.322zm-1.504 7.324l.004-5.073-.002-2.253A2.25 2.25 0 005.003 2.5H1.5v9h3.757a3.75 3.75 0 011.994.574z"></path></svg>
|
|
Overview
|
|
</div>
|
|
<div @click="tab = 'markdown'" class="tab" :class="{active:tab === 'markdown', disabled:!user}">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0114.25 15h-9a.75.75 0 010-1.5h9a.25.25 0 00.25-.25V6h-2.75A1.75 1.75 0 0110 4.25V1.5H5.75a.25.25 0 00-.25.25v2.5a.75.75 0 01-1.5 0v-2.5zm7.5-.188V4.25c0 .138.112.25.25.25h2.688a.252.252 0 00-.011-.013l-2.914-2.914a.272.272 0 00-.013-.011zM5.72 6.72a.75.75 0 000 1.06l1.47 1.47-1.47 1.47a.75.75 0 101.06 1.06l2-2a.75.75 0 000-1.06l-2-2a.75.75 0 00-1.06 0zM3.28 7.78a.75.75 0 00-1.06-1.06l-2 2a.75.75 0 000 1.06l2 2a.75.75 0 001.06-1.06L1.81 9.25l1.47-1.47z"></path></svg>
|
|
Markdown
|
|
</div>
|
|
<div @click="tab = 'action'" class="tab" :class="{active:tab === 'action', disabled:!user}">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zM6.379 5.227A.25.25 0 006 5.442v5.117a.25.25 0 00.379.214l4.264-2.559a.25.25 0 000-.428L6.379 5.227z"></path></svg>
|
|
Action
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section class="container">
|
|
<!-- Left section -->
|
|
<div class="left">
|
|
|
|
<!-- Avatar -->
|
|
<div class="avatar">
|
|
<div :style="{backgroundImage:`url(${avatar})`}"></div>
|
|
</div>
|
|
|
|
<!-- User -->
|
|
<div class="user step">
|
|
<input type="text" name="user" v-model="user" maxlength="39" placeholder="Your GitHub username" :disabled="generated.pending">
|
|
<button @click="generate" :disabled="(!user)||(generated.pending)">{{ generated.pending ? "Working on it :)" : "Generate your metrics !" }}</button>
|
|
<!-- GitHub requests tracker -->
|
|
<div class="gh-requests">{{ requests.remaining }} GitHub request{{ requests.remaining > 1 ? "s" : "" }} remaining</div>
|
|
</div>
|
|
|
|
<!-- Scrollable part -->
|
|
<div class="scrollable">
|
|
|
|
<!-- Template -->
|
|
<div class="step">
|
|
<h2>🖼️ Template</h2>
|
|
<div class="templates">
|
|
<label v-for="template in templates.list" :key="template" v-show="templates.descriptions[template.name] !== '(hidden)'" :class="{'not-available':!template.enabled}" :title="!template.enabled ? 'This template is not enabled on web instance, use it with GitHub actions !' : ''">
|
|
<input type="radio" v-model="templates.selected" :value="template.name" @change="load" :disabled="generated.pending">
|
|
{{ templates.descriptions[template.name] || template.name }}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Palette -->
|
|
<div class="step">
|
|
<h2>🌎 Color palette</h2>
|
|
<div class="templates">
|
|
<label>
|
|
<input type="radio" v-model="palette" value="light">
|
|
☀️ Light
|
|
</label>
|
|
<label>
|
|
<input type="radio" v-model="palette" value="dark">
|
|
🌕 Dark
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Base content -->
|
|
<div class="step" v-if="plugins.base.length">
|
|
<h2>🗃️ Base content</h2>
|
|
<div class="plugins">
|
|
<label v-for="part in plugins.base" :key="part">
|
|
<input type="checkbox" v-model="plugins.enabled.base[part]" @change="load" :disabled="generated.pending">
|
|
<span v-html="plugins.descriptions[`base.${part}`] || `base.${part}`"></span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Plugins -->
|
|
<div class="step" v-if="plugins.list.length">
|
|
<h2>🧩 Additional plugins</h2>
|
|
<div class="plugins">
|
|
<label v-for="plugin in plugins.list" :key="plugin" :class="{'not-available':!plugin.enabled}" :title="!plugin.enabled ? 'This plugin is not enabled on web instance, use it with GitHub actions !' : ''">
|
|
<input type="checkbox" v-model="plugins.enabled[plugin.name]" @change="load" :disabled="(!plugin.enabled)||(generated.pending)">
|
|
{{ plugins.descriptions[plugin.name] || plugin.name }}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Plugins options -->
|
|
<div class="step" v-if="(plugins.enabled.tweets)||(plugins.enabled.music)||(plugins.enabled.pagespeed)||(plugins.enabled.languages)||(plugins.enabled.habits)||(plugins.enabled.posts)||(plugins.enabled.isocalendar)||(plugins.enabled.projects)||(plugins.enabled.topics)">
|
|
<h2>🔧 Configure plugins</h2>
|
|
<div class="options">
|
|
<div class="options-group" v-if="plugins.enabled.tweets">
|
|
<h4>{{ plugins.descriptions.tweets }}</h4>
|
|
<label>
|
|
Number of tweets to display
|
|
<input type="number" v-model="plugins.options['tweets.limit']" min="1" max="10" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
</div>
|
|
<div class="options-group" v-if="plugins.enabled.music">
|
|
<h4>{{ plugins.descriptions.music }}</h4>
|
|
<label>
|
|
Playlist embed link
|
|
<input type="text" v-model="plugins.options['music.playlist']" placeholder="https://embed.music.apple.com/en/playlist/" :disabled="generated.pending">
|
|
</label>
|
|
<label>
|
|
Number of tracks to display
|
|
<input type="number" v-model="plugins.options['music.limit']" min="1" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
</div>
|
|
<div class="options-group" v-if="plugins.enabled.pagespeed">
|
|
<h4>{{ plugins.descriptions.pagespeed }}</h4>
|
|
<label>
|
|
Detailed PageSpeed report
|
|
<input type="checkbox" v-model="plugins.options['pagespeed.detailed']" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
<label>
|
|
Include a website screenshot
|
|
<input type="checkbox" v-model="plugins.options['pagespeed.screenshot']" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
</div>
|
|
<div class="options-group" v-if="plugins.enabled.languages">
|
|
<h4>{{ plugins.descriptions.languages }}</h4>
|
|
<label>
|
|
Ignored languages (comma separated)
|
|
<input type="text" v-model="plugins.options['languages.ignored']" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
<label>
|
|
Skipped repositories (comma separated)
|
|
<input type="text" v-model="plugins.options['languages.skipped']" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
</div>
|
|
<div class="options-group" v-if="plugins.enabled.habits">
|
|
<h4>{{ plugins.descriptions.habits }}</h4>
|
|
<label>
|
|
Number of events for habits
|
|
<input type="number" v-model="plugins.options['habits.from']" min="1" max="1000" :disabled="generated.pending">
|
|
</label>
|
|
<label>
|
|
Number of days for habits
|
|
<input type="number" v-model="plugins.options['habits.days']" min="1" max="30" :disabled="generated.pending">
|
|
</label>
|
|
<label>
|
|
Display tidbits
|
|
<input type="checkbox" v-model="plugins.options['habits.facts']" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
<label>
|
|
Display activity charts
|
|
<input type="checkbox" v-model="plugins.options['habits.charts']" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
</div>
|
|
<div class="options-group" v-if="plugins.enabled.posts">
|
|
<h4>{{ plugins.descriptions.posts }}</h4>
|
|
<label>
|
|
Posts source
|
|
<select v-model="plugins.options['posts.source']" disabled>
|
|
<option value="dev.to">dev.to</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
Number of posts to display
|
|
<input type="number" v-model="plugins.options['posts.limit']" min="1" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
</div>
|
|
<div class="options-group" v-if="plugins.enabled.isocalendar">
|
|
<h4>{{ plugins.descriptions.isocalendar }}</h4>
|
|
<label>
|
|
Isocalendar duration
|
|
<select v-model="plugins.options['isocalendar.duration']" :disabled="generated.pending">
|
|
<option value="half-year">Half year</option>
|
|
<option value="full-year">Full year</option>
|
|
</select>
|
|
</label>
|
|
</div>
|
|
<div class="options-group" v-if="plugins.enabled.topics">
|
|
<h4>{{ plugins.descriptions.topics }}</h4>
|
|
<label>
|
|
Topics display mode
|
|
<select v-model="plugins.options['topics.mode']" @change="load" :disabled="generated.pending">
|
|
<option value="starred">Starred topics</option>
|
|
<option value="mastered">Known and mastered technologies</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
Topics sorting
|
|
<select v-model="plugins.options['topics.sort']" :disabled="generated.pending">
|
|
<option value="starred">Recently starred by you</option>
|
|
<option value="stars">Most stars</option>
|
|
<option value="activity">Recent actity</option>
|
|
<option value="random">Random</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
Number of topics to display
|
|
<input type="number" v-model="plugins.options['topics.limit']" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
</div>
|
|
<div class="options-group" v-if="plugins.enabled.projects">
|
|
<h4>{{ plugins.descriptions.projects }}</h4>
|
|
<label>
|
|
Number of projects to display
|
|
<input type="number" v-model="plugins.options['projects.limit']" min="1" max="100" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
<label>
|
|
Repositories projects to display (comma separated)
|
|
<input type="text" v-model="plugins.options['projects.repositories']" @change="load" :disabled="generated.pending">
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Right section -->
|
|
<div class="right">
|
|
<div class="body">
|
|
<div class="readme">
|
|
<svg viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M1.326 1.973a1.2 1.2 0 011.49-.832c.387.112.977.307 1.575.602.586.291 1.243.71 1.7 1.296.022.027.042.056.061.084A13.22 13.22 0 018 3c.67 0 1.289.037 1.861.108l.051-.07c.457-.586 1.114-1.004 1.7-1.295a9.654 9.654 0 011.576-.602 1.2 1.2 0 011.49.832c.14.493.356 1.347.479 2.29.079.604.123 1.28.07 1.936.541.977.773 2.11.773 3.301C16 13 14.5 15 8 15s-8-2-8-5.5c0-1.034.238-2.128.795-3.117-.08-.712-.034-1.46.052-2.12.122-.943.34-1.797.479-2.29zM8 13.065c6 0 6.5-2 6-4.27C13.363 5.905 11.25 5 8 5s-5.363.904-6 3.796c-.5 2.27 0 4.27 6 4.27z"></path><path d="M4 8a1 1 0 012 0v1a1 1 0 01-2 0V8zm2.078 2.492c-.083-.264.146-.492.422-.492h3c.276 0 .505.228.422.492C9.67 11.304 8.834 12 8 12c-.834 0-1.669-.696-1.922-1.508zM10 8a1 1 0 112 0v1a1 1 0 11-2 0V8z"></path></svg>
|
|
<span>{{ user }}</span><span class="slash">/</span>README<span class="md">.md</span>
|
|
</div>
|
|
<!-- Overview -->
|
|
<section class="preview" v-if="tab == 'overview'">
|
|
Once generated, click on tabs above to see the code to embed them on your real readme !
|
|
<template v-if="generated.content">
|
|
<img class="metrics" :src="generated.content" alt="metrics">
|
|
</template>
|
|
<template v-else>
|
|
<img class="metrics" :src="templates.placeholder" alt="metrics">
|
|
</template>
|
|
<div class="error" v-if="generated.error">An error occurred. Please try again later.</div>
|
|
</section>
|
|
<!-- Markdown -->
|
|
<section v-else-if="tab == 'markdown'">
|
|
Add the markdown below in your <i>README.md</i> at <a :href="repo">{{ user }}/{{ user }}</a>
|
|
<div class="code">
|
|
<Prism language="markdown" :code="embed"></Prism>
|
|
</div>
|
|
</section>
|
|
<!-- Action -->
|
|
<section v-else-if="tab == 'action'">
|
|
Create a new workflow with the following content at <a :href="repo">{{ user }}/{{ user }}</a>
|
|
<div class="code">
|
|
<Prism language="yaml" :code="action"></Prism>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
</main>
|
|
<!-- Scripts -->
|
|
<script src="/.js/axios.min.js"></script>
|
|
<script src="/.js/prism.min.js"></script>
|
|
<script src="/.js/prism.markdown.min.js"></script>
|
|
<script src="/.js/prism.yaml.min.js"></script>
|
|
<script src="/.js/ejs.min.js"></script>
|
|
<script src="/.js/vue.min.js"></script>
|
|
<script src="/.js/vue.prism.min.js"></script>
|
|
<script src="/.js/app.js"></script>
|
|
</body>
|
|
</html> |