2020-10-09 22:37:16 +03:00
<!DOCTYPE html>
< html lang = "en" >
2020-05-24 14:41:19 +03:00
{{ template "head.tpl.html" . }}
2021-02-06 01:42:20 +03:00
< body class = "relative bg-gray-850 text-gray-700 p-4 pt-10 flex flex-col min-h-screen max-w-screen-xl mx-auto justify-center" >
2020-05-24 14:41:19 +03:00
2020-11-28 22:23:40 +03:00
{{ template "header.tpl.html" . }}
2020-06-07 20:28:32 +03:00
< div class = "hidden flex bg-gray-800 shadow-md z-10 p-2 absolute top-0 right-0 mt-10 mr-8 border border-green-700 rounded popup"
id="api-key-popup">
2020-05-24 22:19:05 +03:00
< div class = "flex-grow flex flex-col px-2" >
< span class = "text-xs text-gray-500 mx-1" > API Key< / span >
2020-06-07 20:28:32 +03:00
< input type = "text" class = "bg-transparent text-sm text-white mx-1 font-mono" id = "api-key-container" readonly
value="{{ .ApiKey }}" style="min-width: 330px">
2020-05-24 22:19:05 +03:00
< / div >
< div class = "flex items-center px-2 border-l border-gray-700" >
< button title = "Copy to clipboard" onclick = "copyApiKey(event)" > 📋< / button >
< / div >
< / div >
2020-06-07 20:28:32 +03:00
< div class = "absolute flex top-0 right-0 mr-8 mt-10 py-2" >
< div class = "mx-1" >
< button type = "button" class = "py-1 px-3 h-8 rounded border border-green-700 text-white text-sm"
onclick="showApiKeyPopup(event)">🔐
< / button >
< / div >
< div class = "mx-1" >
< a href = "settings" class = "py-1 px-3 h-8 block rounded border border-green-700 text-white text-sm" > ⚙️< / a >
< / div >
< div class = "mx-1" >
< form action = "logout" method = "post" >
< button type = "submit" class = "py-1 px-3 h-8 rounded border border-green-700 text-white text-sm" > Logout< / button >
< / form >
< / div >
2020-05-24 14:41:19 +03:00
< / div >
< div class = "flex items-center justify-center" >
< h1 class = "font-semibold text-2xl text-white m-0 border-b-4 border-green-700" > Your Coding Statistics 🤓< / h1 >
< / div >
2020-09-12 13:40:38 +03:00
< div class = "text-white text-sm flex items-center justify-center mt-4 self-center max-w-lg flex-wrap" >
< a href = "summary?interval=today" class = "mx-2 my-1 border-b border-green-700" > Today< / a >
2021-02-06 18:05:34 +03:00
< a href = "summary?interval=yesterday" class = "mx-2 my-1 border-b border-green-700" > Yesterday< / a >
2020-09-12 13:40:38 +03:00
< a href = "summary?interval=week" class = "mx-2 my-1 border-b border-green-700" > This Week< / a >
< a href = "summary?interval=month" class = "mx-2 my-1 border-b border-green-700" > This Month< / a >
< a href = "summary?interval=year" class = "mx-2 my-1 border-b border-green-700" > This Year< / a >
2021-02-06 18:05:34 +03:00
< a href = "summary?interval=last_7_days" class = "mx-2 my-1 border-b border-green-700" > Past 7 Days< / a >
< a href = "summary?interval=last_30_days" class = "mx-2 my-1 border-b border-green-700" > Past 30 Days< / a >
< a href = "summary?interval=last_12_months" class = "mx-2 my-1 border-b border-green-700" > Past 12 Months< / a >
2020-09-12 13:40:38 +03:00
< a href = "summary?interval=any" class = "mx-2 my-1 border-b border-green-700" > All Time< / a >
2020-05-24 14:41:19 +03:00
< / div >
{{ template "alerts.tpl.html" . }}
2021-02-12 12:10:44 +03:00
< main class = "flex flex-col items-center mt-10 flex-grow" >
2020-05-24 14:41:19 +03:00
< div class = "flex justify-center" >
< div class = "p-1" >
2021-02-06 01:42:20 +03:00
< div class = "flex justify-center p-4 bg-gray-900 border border-gray-700 text-gray-300 rounded-md shadow" >
2020-10-16 15:49:22 +03:00
< p class = "mx-2" > < strong > ▶️< / strong > < span title = "Start Time" > {{ .FromTime.T | date }}< / span > < / p >
2021-02-06 01:42:20 +03:00
< p class = "mx-2" > < strong > ⏹️< / strong > < span title = "End Time" > {{ .ToTime.T | date }}< / span > < / p >
2021-02-12 12:10:44 +03:00
< p class = "mx-2" >
< strong > ⏱️< / strong >
{{ if gt .Summary.TotalTime 0 }}
< span id = "total-span" title = "Total Hours" > < / span >
{{ else }}
< span title = "Total Hours" > No Data< / span >
{{ end }}
< / p >
2020-05-24 14:41:19 +03:00
< / div >
< / div >
< / div >
2021-02-12 12:10:44 +03:00
{{ if or (gt .Summary.TotalTime 0) (ne .RawQuery "") }}
2020-05-24 14:41:19 +03:00
< div class = "flex flex-wrap justify-center" >
< div class = "w-full lg:w-1/2 p-1" >
2021-02-06 01:42:20 +03:00
< div class = "p-4 pb-10 bg-gray-900 border border-gray-700 text-gray-300 rounded-md shadow m-2 flex flex-col" id = "project-container" style = "height: 300px" >
2021-01-05 14:41:01 +03:00
< div class = "flex justify-between" >
< div class = "w-1/4 flex-1" > < / div >
< span class = "font-semibold w-1/2 text-center flex-1" > Projects< / span >
< div class = "flex justify-end flex-1 text-xs items-center" >
< label for = "project-top-picker" class = "mr-1" > Show: < / label >
2021-02-06 01:42:20 +03:00
< input type = "number" min = "1" id = "project-top-picker" data-entity = "0" class = "w-1/4 top-picker bg-gray-800 rounded-md text-center" value = "10" >
2021-01-05 14:41:01 +03:00
< / div >
2020-08-30 17:51:37 +03:00
< / div >
2021-02-06 01:42:20 +03:00
< canvas id = "chart-projects" class = "mt-2" > < / canvas >
2020-08-30 17:51:37 +03:00
< div class = "hidden placeholder-container flex items-center justify-center h-full flex-col" >
2021-02-12 12:10:44 +03:00
< span class = "text-md font-semibold text-gray-500 mt-4" > No data ...< / span >
2020-08-30 17:51:37 +03:00
< / div >
2020-05-24 14:41:19 +03:00
< / div >
< / div >
< div class = "w-full lg:w-1/2 p-1" >
2021-02-06 01:42:20 +03:00
< div class = "p-4 pb-10 bg-gray-900 border border-gray-700 text-gray-300 rounded-md shadow m-2 flex flex-col" id = "os-container" style = "height: 300px" >
2021-01-05 14:41:01 +03:00
< div class = "flex justify-between" >
< div class = "w-1/4 flex-1" > < / div >
< span class = "font-semibold w-1/2 text-center flex-1" > Operating Systems< / span >
< div class = "flex justify-end flex-1 text-xs items-center" >
< label for = "os-top-picker" class = "mr-1" > Show: < / label >
2021-02-06 01:42:20 +03:00
< input type = "number" min = "1" id = "os-top-picker" data-entity = "1" class = "w-1/4 top-picker bg-gray-800 rounded-md text-center" value = "10" >
2021-01-05 14:41:01 +03:00
< / div >
2020-08-30 17:51:37 +03:00
< / div >
2020-05-24 14:41:19 +03:00
< canvas id = "chart-os" > < / canvas >
2020-08-30 17:51:37 +03:00
< div class = "hidden placeholder-container flex items-center justify-center h-full flex-col" >
2021-02-12 12:10:44 +03:00
< span class = "text-md font-semibold text-gray-500 mt-4" > No data ...< / span >
2020-08-30 17:51:37 +03:00
< / div >
2020-05-24 14:41:19 +03:00
< / div >
< / div >
< div class = "w-full lg:w-1/2 p-1" >
2021-02-06 01:42:20 +03:00
< div class = "p-4 pb-10 bg-gray-900 border border-gray-700 text-gray-300 rounded-md shadow m-2 flex flex-col relative" id = "language-container" style = "height: 300px" >
2021-01-05 14:41:01 +03:00
< div class = "flex justify-between" >
< div class = "w-1/4 flex-1" > < / div >
< span class = "font-semibold w-1/2 text-center flex-1" > Languages< / span >
< div class = "flex justify-end flex-1 text-xs items-center" >
< label for = "language-top-picker" class = "mr-1" > Show: < / label >
2021-02-06 01:42:20 +03:00
< input type = "number" min = "1" id = "language-top-picker" data-entity = "3" class = "w-1/4 top-picker bg-gray-800 rounded-md text-center" value = "10" >
2021-01-05 14:41:01 +03:00
< / div >
2020-08-30 17:51:37 +03:00
< / div >
2020-05-24 14:41:19 +03:00
< canvas id = "chart-language" > < / canvas >
2020-08-30 17:51:37 +03:00
< div class = "hidden placeholder-container flex items-center justify-center h-full flex-col" >
2021-02-12 12:10:44 +03:00
< span class = "text-md font-semibold text-gray-500 mt-4" > No data ...< / span >
2020-08-30 17:51:37 +03:00
< / div >
2020-05-24 14:41:19 +03:00
< / div >
< / div >
< div class = "w-full lg:w-1/2 p-1" >
2021-02-06 01:42:20 +03:00
< div class = "p-4 pb-10 bg-gray-900 border border-gray-700 text-gray-300 rounded-md shadow m-2 flex flex-col" id = "editor-container" style = "height: 300px" >
2021-01-05 14:41:01 +03:00
< div class = "flex justify-between" >
< div class = "w-1/4 flex-1" > < / div >
< span class = "font-semibold w-1/2 text-center flex-1" > Editors< / span >
< div class = "flex justify-end flex-1 text-xs items-center" >
< label for = "editor-top-picker" class = "mr-1" > Show: < / label >
2021-02-06 01:42:20 +03:00
< input type = "number" min = "1" id = "editor-top-picker" data-entity = "2" class = "w-1/4 top-picker bg-gray-800 rounded-md text-center" value = "10" >
2021-01-05 14:41:01 +03:00
< / div >
2020-08-30 17:51:37 +03:00
< / div >
2020-05-24 14:41:19 +03:00
< canvas id = "chart-editor" > < / canvas >
2020-08-30 17:51:37 +03:00
< div class = "hidden placeholder-container flex items-center justify-center h-full flex-col" >
2021-02-12 12:10:44 +03:00
< span class = "text-md font-semibold text-gray-500 mt-4" > No data ...< / span >
2020-08-30 17:51:37 +03:00
< / div >
2020-05-24 14:41:19 +03:00
< / div >
< / div >
2020-08-29 23:03:01 +03:00
< div class = "w-full lg:w-1/2 p-1" >
2021-02-06 01:42:20 +03:00
< div class = "p-4 pb-10 bg-gray-900 border border-gray-700 text-gray-300 rounded-md shadow m-2 flex flex-col" id = "machine-container" style = "height: 300px" >
2021-01-05 14:41:01 +03:00
< div class = "flex justify-between" >
< div class = "w-1/4 flex-1" > < / div >
< span class = "font-semibold w-1/2 text-center flex-1" > Machines< / span >
< div class = "flex justify-end flex-1 text-xs items-center" >
< label for = "machine-top-picker" class = "mr-1" > Show: < / label >
2021-02-06 01:42:20 +03:00
< input type = "number" min = "1" id = "machine-top-picker" data-entity = "4" class = "w-1/4 top-picker bg-gray-800 rounded-md text-center" value = "10" >
2021-01-05 14:41:01 +03:00
< / div >
2020-08-30 17:51:37 +03:00
< / div >
2020-08-29 23:03:01 +03:00
< canvas id = "chart-machine" > < / canvas >
2020-08-30 17:51:37 +03:00
< div class = "hidden placeholder-container flex items-center justify-center h-full flex-col" >
2021-02-12 12:10:44 +03:00
< span class = "text-md font-semibold text-gray-500 mt-4" > No data ...< / span >
2020-08-30 17:51:37 +03:00
< / div >
2020-08-29 23:03:01 +03:00
< / div >
< / div >
2020-05-24 14:41:19 +03:00
< / div >
2021-02-12 12:10:44 +03:00
{{ else }}
< div class = "max-w-screen-sm flex flex-col items-center mt-12 space-y-8 text-gray-300 text-center" >
< div class = "pb-4" >
2021-02-12 21:25:59 +03:00
< img src = "assets/images/welcome.svg" width = "200px" alt = "User welcome illustration" >
2021-02-12 12:10:44 +03:00
< / div >
< p class = "text-sm" >
< strong > Welcome to Wakapi! 👋< / strong > 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" >
< div >
< h3 class = "inline-block font-semibold text-md border-b border-green-700" > Setup Instructions< / h3 >
< / div >
< div class = "w-full bg-gray-900 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 > Adapt your config< br >
$ vi ~/.wakatime.cfg< br >
2021-02-12 21:25:59 +03:00
# Set < em > api_url = < span class = "with-url-inner" > %s/api/heartbeat< / span > < / em > < br >
# Set < em > api_key = < span id = "api-key-instruction" > < / span > < / em > < br > < br >
2021-02-12 12:10:44 +03:00
# < strong > Step 3:< / strong > Start coding and then check back here!
< / div >
< p class = "pt-4 text-sm" >
More at < a href = "https://github.com/muety/wakapi" target = "_blank" rel = "noreferrer noopener" class = "font-mono border-b border-green-700" > github.com/muety/wakapi< / a > .
< / p >
< / div >
< / div >
{{ end }}
2020-05-24 14:41:19 +03:00
< / main >
{{ template "footer.tpl.html" . }}
{{ template "foot.tpl.html" . }}
2020-12-03 01:16:12 +03:00
2021-02-12 12:10:44 +03:00
< script type = "text/javascript" >
document.querySelector('#api-key-instruction').innerHTML = document.querySelector('#api-key-container').value
< / script >
2020-12-03 01:16:12 +03:00
< script >
const languageColors = {{ .LanguageColors | json }}
2021-01-30 11:51:36 +03:00
const editorColors = {{ .EditorColors | json }}
const osColors = {{ .OSColors | json }}
2020-12-03 01:16:12 +03:00
const wakapiData = {}
wakapiData.projects = {{ .Projects | json }}
wakapiData.operatingSystems = {{ .OperatingSystems | json }}
wakapiData.editors = {{ .Editors | json }}
wakapiData.languages = {{ .Languages | json }}
wakapiData.machines = {{ .Machines | json }}
< / script >
< script src = "assets/app.js" > < / script >
2020-05-24 14:41:19 +03:00
< / body >
< / html >