mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: non-ascii project badges (resolve #357)
chore: locally generated badges (resolve #348)
This commit is contained in:
@ -525,41 +525,53 @@
|
||||
<div class="w-full lg:w-3/4">
|
||||
<div class="flex flex-wrap md:flex-nowrap mb-8 gap-x-4">
|
||||
<div class="w-full md:w-1/2 mb-4 md:mb-0 inline-block">
|
||||
<label class="font-semibold text-gray-300" for="select-timezone">Badges (Shields.IO)</label>
|
||||
<label class="font-semibold text-gray-300" for="select-timezone">Badges</label>
|
||||
<span class="block text-sm text-gray-600">
|
||||
The integration with <a class="link" href="https://shields.io" target="_blank" rel="noreferrer noopener">Shields.IO</a> allows to generate badges for README pages or forums. To enable this feature, you need to grant public, unauthorized access to the respective endpoints. See <a class="link" href="settings#permissions">Permissions</a>.<br><br>
|
||||
Only available on public instances, not on localhost.
|
||||
This integration with allows to generate badges for README pages or forums. To enable this feature, you need to grant public, unauthorized access to the respective endpoints. See <a class="link" href="settings#permissions">Permissions</a>. Adapt the URL's <i>label</i> and <i>color</i> parameters for customized badges.<br><br>
|
||||
In addition, there is an endpoint compatible with <a class="link" href="https://shields.io" target="_blank" rel="noreferrer noopener">Shields.IO</a> to allow for even more customization (e.g. different <a class="link" href="https://shields.io/#styles" target="_blank" rel="noreferrer noopener">styles</a>). Only available on public instances, not on localhost.
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="w-full md:w-1/2 ml-4">
|
||||
{{ if ne .User.ShareDataMaxDays 0 }}
|
||||
<div class="flex space-x-4 mb-4">
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center w-1/3">
|
||||
<img class="with-url-src"
|
||||
src="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:today&style=flat-square&color=2F855A&label=today"
|
||||
alt="Shields.io badge"
|
||||
style="width: 128px; max-width: inherit;"
|
||||
src="api/badge/{{ .User.ID }}/interval:today?label=today"
|
||||
alt="Badge"
|
||||
/>
|
||||
</div>
|
||||
<input
|
||||
class="with-url-value flex-shrink w-full font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
||||
value="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:today&style=flat-square&color=2F855A&label=today"
|
||||
class="with-url-value w-2/3 font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
||||
value="%s/api/badge/{{ .User.ID }}/interval:today?label=today"
|
||||
readonly
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="flex space-x-4 mt-4">
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center w-1/3">
|
||||
<img class="with-url-src"
|
||||
src="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:30_days&style=flat-square&color=2F855A&label=last 30d"
|
||||
alt="Shields.io badge"
|
||||
style="width: 128px; max-width: inherit;"
|
||||
src="api/badge/{{ .User.ID }}/interval:30_days?label=last 30d"
|
||||
alt="Badge"
|
||||
/>
|
||||
</div>
|
||||
<input
|
||||
class="with-url-value flex-shrink w-full font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
||||
value="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:30_days&style=flat-square&color=2F855A&label=last 30d"
|
||||
class="with-url-value w-2/3 font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
||||
value="%s/api/badge/{{ .User.ID }}/{{ .User.ID }}/interval:30_days?label=last 30d"
|
||||
readonly
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="flex space-x-4 mt-4">
|
||||
<div class="flex items-center w-1/3">
|
||||
<img class="with-url-src"
|
||||
src="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:30_days&label=last 30d"
|
||||
alt="Shields.io badge"
|
||||
/>
|
||||
</div>
|
||||
<input
|
||||
class="with-url-value w-2/3 font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
||||
value="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:30_days&label=last 30d"
|
||||
readonly
|
||||
>
|
||||
</div>
|
||||
|
@ -16,194 +16,201 @@
|
||||
|
||||
{{ if .User.HasData }}
|
||||
|
||||
<div class="flex justify-end mt-12 relative" id="summary-page" v-scope>
|
||||
<div v-scope="TimePicker({
|
||||
fromDate: '{{ .From | simpledate }}',
|
||||
toDate: '{{ .To | ceildate | simpledate }}',
|
||||
timeSelection: '{{ .From | datetime }} - {{ .To | ceildate | datetime }}'
|
||||
})" @vue:mounted="mounted"></div>
|
||||
<div id="summary-page" v-scope>
|
||||
<div class="flex justify-end mt-12 relative">
|
||||
<div v-scope="TimePicker({
|
||||
fromDate: '{{ .From | simpledate }}',
|
||||
toDate: '{{ .To | ceildate | simpledate }}',
|
||||
timeSelection: '{{ .From | datetime }} - {{ .To | ceildate | datetime }}'
|
||||
})" @vue:mounted="mounted"></div>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
<main class="flex flex-col items-center mt-10 flex-grow">
|
||||
|
||||
{{ if .User.HasData }}
|
||||
|
||||
{{ if not .IsProjectDetails }}
|
||||
<!-- KPIs -->
|
||||
<div class="flex gap-x-6 gap-y-6 w-full mb-4 flex-wrap">
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Total Time</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .TotalTime | duration }}">{{ .TotalTime | duration }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Total Heartbeats</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .NumHeartbeats }}">{{ .NumHeartbeats }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Top Project</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .MaxByToString 0 }}">{{ .MaxByToString 0 }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Top Language</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .MaxByToString 1 }}">{{ .MaxByToString 1 }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Top OS</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .MaxByToString 3 }}">{{ .MaxByToString 3 }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Top Editor</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .MaxByToString 2 }}">{{ .MaxByToString 2 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="mb-8 w-full">
|
||||
<h1 class="font-semibold text-3xl text-white">Project "{{ .GetProjectFilter }}"</h1>
|
||||
<div class="flex space-x-4 items-center">
|
||||
<h4 class="font-semibold text-lg text-gray-500">{{ .TotalTime | duration }}</h4>
|
||||
<div v-cloak v-show="currentInterval">
|
||||
<img :src="'api/badge/{{ .User.ID }}/interval:' + currentInterval + '/project:{{ .GetProjectFilter }}'" alt="Coding Time Badge">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="grid gap-2 grid-cols-1 md:grid-cols-2 w-full mt-4">
|
||||
<div class="row-span-2 p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col {{ if .IsProjectDetails }} hidden {{ end }}" id="project-container" style="max-height: 608px; max-width: 100vw">
|
||||
<div class="flex justify-between">
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap">Projects</span>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="project-top-picker" data-entity="0" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-projects" class="mt-2"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-span-2 p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col {{ if not .IsProjectDetails }} hidden {{ end }}" id="branch-container" style="max-height: 608px; max-width: 100vw">
|
||||
<div class="flex justify-between">
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap">Branches</span>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="branch-top-picker" data-entity="6" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-branches" class="mt-2"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col" id="language-container" style="max-height: 300px">
|
||||
<div class="flex justify-between">
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap">Languages</span>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="language-top-picker" data-entity="3" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-language" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col" id="editor-container" style="max-height: 300px">
|
||||
<div class="flex justify-between">
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap">Editors</span>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="editor-top-picker" data-entity="2" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-editor" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="{{ if .IsProjectDetails }} hidden {{ end }}" style="max-width: 100vw;">
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col" id="os-container" style="max-height: 300px">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap mr-1 cursor-pointer">Operating Systems</span>
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap ml-1 cursor-pointer text-gray-600" onclick="swapCharts('machine', 'os')">Machines</span>
|
||||
</div>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="os-top-picker" data-entity="1" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-os" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hidden" style="max-width: 100vw;">
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col" id="machine-container" style="max-height: 300px">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap mr-1 cursor-pointer text-gray-600" onclick="swapCharts('os', 'machine')">Operating Systems</span>
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap ml-1 cursor-pointer">Machines</span>
|
||||
</div>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="machine-top-picker" data-entity="4" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-machine" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="max-width: 100vw;">
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col {{ if .IsProjectDetails }} hidden {{ end }}" id="label-container" style="max-height: 300px">
|
||||
<div class="flex justify-between text-lg" style="margin-bottom: -10px">
|
||||
<span class="font-semibold whitespace-nowrap">Labels</span>
|
||||
<a href="settings#data" class="ml-4 inline p-2 hover:bg-gray-800 rounded" style="margin-top: -5px">
|
||||
<span class="iconify inline" data-icon="twemoji:gear"></span>
|
||||
</a>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="label-top-picker" data-entity="5" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-label" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ else }}
|
||||
|
||||
<div class="max-w-screen-sm flex flex-col items-center mt-12 space-y-8 text-gray-300">
|
||||
<div class="pb-4">
|
||||
<img src="assets/images/welcome.svg" width="200px" alt="User welcome illustration">
|
||||
</div>
|
||||
<h1 class="font-semibold text-3xl text-white m-0 w-full">Welcome to Wakapi!</h1>
|
||||
<p>
|
||||
It looks like there is no data available for the specified time range.<br>If you logged in to Wakapi for the first time, see the setup instructions below on how to get started.
|
||||
</p>
|
||||
<div class="w-full pt-10 flex flex-col space-y-4">
|
||||
<h1 class="font-semibold text-3xl text-white m-0 mb-2">Setup Instructions</h1>
|
||||
<div class="w-full bg-gray-850 text-left rounded-md py-4 px-8 text-xs font-mono shadow-md">
|
||||
# <strong>Step 1:</strong> Download WakaTime plugin for your IDE<br>
|
||||
# See: https://wakatime.com/plugins<br><br>
|
||||
|
||||
# <strong>Step 2:</strong> Set your ~/.wakatime.cfg to this:<br><br>
|
||||
<!-- https://github.com/muety/wakapi/issues/224#issuecomment-890855563 -->
|
||||
[settings]<br>
|
||||
api_url = <span class="with-url-inner">%s/api</span><br>
|
||||
api_key = <span id="api-key-instruction">{{ .ApiKey }}</span><br><br>
|
||||
|
||||
# <strong>Step 3:</strong> Start coding and then check back here!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
<main class="flex flex-col items-center mt-10 flex-grow">
|
||||
|
||||
{{ if .User.HasData }}
|
||||
|
||||
{{ if not .IsProjectDetails }}
|
||||
<!-- KPIs -->
|
||||
<div class="flex gap-x-6 gap-y-6 w-full mb-4 flex-wrap">
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Total Time</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .TotalTime | duration }}">{{ .TotalTime | duration }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Total Heartbeats</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .NumHeartbeats }}">{{ .NumHeartbeats }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Top Project</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .MaxByToString 0 }}">{{ .MaxByToString 0 }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Top Language</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .MaxByToString 1 }}">{{ .MaxByToString 1 }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Top OS</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .MaxByToString 3 }}">{{ .MaxByToString 3 }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 w-40 p-4 rounded-md p-4 text-gray-300 bg-gray-850 leading-none border-2 border-green-700">
|
||||
<span class="text-xs text-gray-500 font-semibold">Top Editor</span>
|
||||
<span class="font-semibold text-xl truncate" title="{{ .MaxByToString 2 }}">{{ .MaxByToString 2 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="mb-8 w-full">
|
||||
<h1 class="font-semibold text-3xl text-white">Project "{{ .GetProjectFilter }}"</h1>
|
||||
<h4 class="font-semibold text-lg text-gray-500">{{ .TotalTime | duration }}</h4>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="grid gap-2 grid-cols-1 md:grid-cols-2 w-full mt-4">
|
||||
<div class="row-span-2 p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col {{ if .IsProjectDetails }} hidden {{ end }}" id="project-container" style="max-height: 608px; max-width: 100vw">
|
||||
<div class="flex justify-between">
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap">Projects</span>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="project-top-picker" data-entity="0" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-projects" class="mt-2"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-span-2 p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col {{ if not .IsProjectDetails }} hidden {{ end }}" id="branch-container" style="max-height: 608px; max-width: 100vw">
|
||||
<div class="flex justify-between">
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap">Branches</span>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="branch-top-picker" data-entity="6" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-branches" class="mt-2"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col" id="language-container" style="max-height: 300px">
|
||||
<div class="flex justify-between">
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap">Languages</span>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="language-top-picker" data-entity="3" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-language" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col" id="editor-container" style="max-height: 300px">
|
||||
<div class="flex justify-between">
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap">Editors</span>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="editor-top-picker" data-entity="2" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-editor" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="{{ if .IsProjectDetails }} hidden {{ end }}" style="max-width: 100vw;">
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col" id="os-container" style="max-height: 300px">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap mr-1 cursor-pointer">Operating Systems</span>
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap ml-1 cursor-pointer text-gray-600" onclick="swapCharts('machine', 'os')">Machines</span>
|
||||
</div>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="os-top-picker" data-entity="1" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-os" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hidden" style="max-width: 100vw;">
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col" id="machine-container" style="max-height: 300px">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap mr-1 cursor-pointer text-gray-600" onclick="swapCharts('os', 'machine')">Operating Systems</span>
|
||||
<span class="font-semibold text-lg w-1/2 flex-1 whitespace-nowrap ml-1 cursor-pointer">Machines</span>
|
||||
</div>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="machine-top-picker" data-entity="4" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-machine" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="max-width: 100vw;">
|
||||
<div class="p-4 px-6 pb-10 bg-gray-850 text-gray-300 rounded-md shadow flex flex-col {{ if .IsProjectDetails }} hidden {{ end }}" id="label-container" style="max-height: 300px">
|
||||
<div class="flex justify-between text-lg" style="margin-bottom: -10px">
|
||||
<span class="font-semibold whitespace-nowrap">Labels</span>
|
||||
<a href="settings#data" class="ml-4 inline p-2 hover:bg-gray-800 rounded" style="margin-top: -5px">
|
||||
<span class="iconify inline" data-icon="twemoji:gear"></span>
|
||||
</a>
|
||||
<div class="flex justify-end flex-1 text-xs items-center">
|
||||
<input type="number" min="1" id="label-top-picker" data-entity="5" class="top-picker bg-gray-800 rounded-md text-center w-12" value="10">
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="chart-label" class="mt-4"></canvas>
|
||||
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
||||
<span class="text-md font-semibold text-gray-500 mt-4">No data</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ else }}
|
||||
|
||||
<div class="max-w-screen-sm flex flex-col items-center mt-12 space-y-8 text-gray-300">
|
||||
<div class="pb-4">
|
||||
<img src="assets/images/welcome.svg" width="200px" alt="User welcome illustration">
|
||||
</div>
|
||||
<h1 class="font-semibold text-3xl text-white m-0 w-full">Welcome to Wakapi!</h1>
|
||||
<p>
|
||||
It looks like there is no data available for the specified time range.<br>If you logged in to Wakapi for the first time, see the setup instructions below on how to get started.
|
||||
</p>
|
||||
<div class="w-full pt-10 flex flex-col space-y-4">
|
||||
<h1 class="font-semibold text-3xl text-white m-0 mb-2">Setup Instructions</h1>
|
||||
<div class="w-full bg-gray-850 text-left rounded-md py-4 px-8 text-xs font-mono shadow-md">
|
||||
# <strong>Step 1:</strong> Download WakaTime plugin for your IDE<br>
|
||||
# See: https://wakatime.com/plugins<br><br>
|
||||
|
||||
# <strong>Step 2:</strong> Set your ~/.wakatime.cfg to this:<br><br>
|
||||
<!-- https://github.com/muety/wakapi/issues/224#issuecomment-890855563 -->
|
||||
[settings]<br>
|
||||
api_url = <span class="with-url-inner">%s/api</span><br>
|
||||
api_key = <span id="api-key-instruction">{{ .ApiKey }}</span><br><br>
|
||||
|
||||
# <strong>Step 3:</strong> Start coding and then check back here!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
</main>
|
||||
|
||||
{{ template "footer.tpl.html" . }}
|
||||
|
||||
{{ template "foot.tpl.html" . }}
|
||||
|
Reference in New Issue
Block a user