2020-10-09 22:37:16 +03:00
<!DOCTYPE html>
< html lang = "en" >
2020-06-07 20:28:32 +03:00
{{ template "head.tpl.html" . }}
< body class = "bg-gray-800 text-gray-700 p-4 pt-10 flex flex-col min-h-screen max-w-screen-xl mx-auto justify-center" >
2020-11-28 22:23:40 +03:00
{{ template "header.tpl.html" . }}
2020-06-07 20:28:32 +03:00
< div class = "w-full flex justify-center" >
2020-11-28 22:23:40 +03:00
< div class = "flex items-center justify-between max-w-xl flex-grow" >
2020-06-07 20:28:32 +03:00
< div > < a href = "" class = "text-gray-500 text-sm" > ← Go back< / a > < / div >
< div > < h1 class = "font-semibold text-2xl text-white m-0 border-b-4 border-green-700" > Settings< / h1 > < / div >
2020-11-28 22:23:40 +03:00
< div > < / div >
2020-06-07 20:28:32 +03:00
< / div >
< / div >
{{ template "alerts.tpl.html" . }}
2020-06-07 20:58:06 +03:00
< main class = "mt-4 flex-grow flex justify-center w-full" >
2020-11-28 22:23:40 +03:00
< div class = "flex flex-col flex-grow max-w-xl mt-8" >
2020-06-07 20:58:06 +03:00
< div class = "w-full my-8 pb-8 border-b border-gray-700" >
< div class = "font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" >
Change Password
< / div >
< form class = "mt-10" action = "settings/credentials" method = "post" >
< div class = "mb-8" >
< label class = "inline-block text-sm mb-1 text-gray-500" for = "password_old" > Current Password< / label >
< input class = "shadow appearance-none bg-gray-800 focus:bg-gray-700 text-gray-300 border-green-700 focus:border-gray-500 border rounded w-full py-1 px-3"
type="password" id="password_old"
name="password_old" placeholder="Enter your old password" minlength="6" required>
< / div >
< div class = "mb-8" >
< label class = "inline-block text-sm mb-1 text-gray-500" for = "password_new" > New Password< / label >
< input class = "shadow appearance-none bg-gray-800 focus:bg-gray-700 text-gray-300 border-green-700 focus:border-gray-500 border rounded w-full py-1 px-3"
type="password" id="password_new"
2020-10-26 05:00:24 +03:00
name="password_new" placeholder="Choose a password" minlength="6" required>
< / div >
2020-06-07 20:58:06 +03:00
< div class = "mb-8" >
< label class = "inline-block text-sm mb-1 text-gray-500" for = "password_repeat" > And again ...< / label >
< input class = "shadow appearance-none bg-gray-800 focus:bg-gray-700 text-gray-300 border-green-700 focus:border-gray-500 border rounded w-full py-1 px-3"
type="password" id="password_repeat"
name="password_repeat" placeholder="Repeat your password" minlength="6" required>
< / div >
< div class = "flex justify-between float-right" >
< button type = "submit" class = "py-1 px-3 rounded bg-green-700 hover:bg-green-800 text-white text-sm" >
Save
< / button >
< / div >
< / form >
2020-06-07 20:28:32 +03:00
< / div >
2020-11-06 19:09:41 +03:00
< div class = "w-full mt-4 mb-8 pb-8 border-b border-gray-700" >
2020-06-07 20:58:06 +03:00
< div class = "font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" >
Reset API Key
2020-06-07 20:28:32 +03:00
< / div >
2020-06-07 20:58:06 +03:00
< form class = "mt-6" action = "settings/reset" method = "post" >
< div class = "text-gray-300 text-sm mb-4" >
< strong > ⚠️ Caution:< / strong > Resetting your API key requires you to update your < span class = "font-mono" > .wakatime.cfg< / span > files on all of your computers to make the WakaTime client send heartbeats again.
< / div >
< div class = "flex justify-between float-right" >
< button type = "submit" class = "py-1 px-3 rounded bg-red-500 hover:bg-red-600 text-white text-sm" >
Reset
< / button >
< / div >
< / form >
< / div >
2020-09-12 17:09:23 +03:00
2020-11-06 19:09:41 +03:00
< div class = "w-full mt-4 mb-8 pb-8 border-b border-gray-700" >
2020-10-25 09:22:10 +03:00
< div class = "font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" >
2020-11-01 22:14:10 +03:00
Language Mappings
2020-10-25 09:22:10 +03:00
< / div >
2020-10-26 07:27:07 +03:00
< div class = "text-gray-300 text-sm mb-4 mt-6" >
2020-11-01 22:14:10 +03:00
You can specify custom mapping from file extensions to programming languages (e.g. a < span class = "text-xs bg-gray-900 rounded py-1 px-2 font-mono" > .jsx< / span > file could be mapped to < span class = "text-xs bg-gray-900 rounded py-1 px-2 font-mono" > React< / span > .
2020-10-26 07:27:07 +03:00
< / div >
2020-10-25 09:22:10 +03:00
2020-11-01 22:14:10 +03:00
{{ if .LanguageMappings }}
{{ range $i, $mapping := .LanguageMappings }}
2020-10-26 07:27:07 +03:00
< div class = "text-white border-1 w-full border-green-700 inline-block my-1 py-1 text-align" >
< label class = "inline-block text-sm mb-1 text-gray-500" > When filename ends in:< / label >
2020-11-01 22:14:10 +03:00
{{ $mapping.Extension }}
2020-10-26 07:27:07 +03:00
< label class = "inline-block text-sm mb-1 text-gray-500" > Change the language to:< / label >
2020-11-01 22:14:10 +03:00
{{ $mapping.Language }}
2020-10-26 07:27:07 +03:00
2020-11-01 22:14:10 +03:00
< form class = "float-right" action = "settings/language_mappings/delete" method = "post" >
< input type = "hidden" id = "mapping_id" name = "mapping_id" required value = "{{ $mapping.ID }}" >
2020-10-26 07:27:07 +03:00
< button type = "submit" class = "py-1 px-3 rounded bg-red-500 hover:bg-red-600 text-white text-sm" >
Remove
< / button >
< / form >
< / div >
{{end}}
2020-10-25 09:22:10 +03:00
{{else}}
2020-10-26 07:27:07 +03:00
< div class = "text-white border-1 w-full border-green-700 inline-block my-1 py-1" >
No rules.
< / div >
2020-10-25 09:22:10 +03:00
{{end}}
2020-11-01 22:14:10 +03:00
< form action = "settings/language_mappings" method = "post" >
2020-10-26 07:27:07 +03:00
< div class = "inline-block justify-around mt-4 w-full" >
2020-10-25 09:22:10 +03:00
< label class = "inline-block text-sm mb-1 text-gray-500" for = "extension" > When filename ends in:< / label >
2020-10-26 07:27:07 +03:00
< input class = "shadow appearance-nonshadow appearance-none bg-gray-800 focus:bg-gray-700 text-gray-300 border-green-700 focus:border-gray-500 border rounded w-full py-1 px-3"
2020-10-25 09:22:10 +03:00
type="text" id="extension"
2020-11-01 22:14:10 +03:00
name="extension" placeholder=".py" minlength="1" required>
2020-10-25 09:22:10 +03:00
< / div >
2020-10-26 07:27:07 +03:00
< div class = "inline-block justify-around mt-4 w-full" >
2020-10-25 09:22:10 +03:00
< label class = "inline-block text-sm mb-1 text-gray-500" for = "language" > Change the language to:< / label >
2020-10-26 07:27:07 +03:00
< input class = "shadow appearance-nonshadow appearance-none bg-gray-800 focus:bg-gray-700 text-gray-300 border-green-700 focus:border-gray-500 border rounded w-full py-1 px-3"
2020-10-25 09:22:10 +03:00
type="text" id="language"
name="language" placeholder="Python" minlength="1" required>
< / div >
< div class = "flex justify-between float-right" >
< button type = "submit" class = "py-1 px-3 my-3 rounded bg-green-700 hover:bg-green-800 text-white text-sm" >
2020-11-01 22:14:10 +03:00
Add
2020-10-25 09:22:10 +03:00
< / button >
< / div >
< / form >
< / div >
2020-11-06 19:09:41 +03:00
< div class = "w-full mt-4 mb-8 pb-8 border-b border-gray-700" >
2020-09-12 17:09:23 +03:00
< div class = "font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" >
Badges
< / div >
< form class = "mt-6" action = "settings/badges" method = "post" >
< div class = "text-gray-300 text-sm mb-4" >
{{ if .User.BadgesEnabled }}
< p > Badges are currently enabled. You can disable the feature by deactivating the respective API endpoint.< / p >
< div class = "flex justify-around mt-4" >
< span class = "font-mono font-normal bg-gray-900 p-1 rounded whitespace-no-wrap" > GET /api/compat/shields/v1< / span >
< button type = "submit" class = "py-1 px-2 rounded bg-orange-700 hover:bg-orange-800 text-white text-xs" title = "Disable support for badges to secure endpoint" >
Status: public
< / button >
< / div >
< h3 class = "font-semibold mb-2 mt-8" > Examples< / h3 >
< div class = "flex flex-col mb-4" >
< div class = "flex justify-between my-2" >
< div >
2020-10-09 22:37:16 +03:00
< 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=blue&label=today" alt = "Shields.io badge" / >
2020-09-12 17:09:23 +03:00
< / div >
< span class = "with-url-inner text-xs bg-gray-900 rounded py-1 px-2 font-mono whitespace-no-wrap overflow-auto" style = "max-width: 300px;" >
https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:today& style=flat-square& color=blue& label=today
< / span >
< / div >
< div class = "flex justify-between my-2" >
< div >
2020-10-09 22:37:16 +03:00
< 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=blue&label=last 30d" alt = "Shields.io badge" / >
2020-09-12 17:09:23 +03:00
< / div >
< span class = "with-url-inner text-xs bg-gray-900 rounded py-1 px-2 font-mono whitespace-no-wrap overflow-auto" style = "max-width: 300px;" >
https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:30_days& style=flat-square& color=blue& label=last 30d
< / span >
< / div >
< / div >
2020-10-26 05:00:24 +03:00
< p > You can also add < span class = "text-xs bg-gray-900 rounded py-1 px-2 font-mono" > /project:your-cool-project< / span > to the URL to filter by project.< / p >
2020-09-12 17:09:23 +03:00
{{ else }}
2020-10-09 22:37:16 +03:00
< p > You have the ability to create badges from your coding statistics using < a href = "https://shields.io" target = "_blank" class = "border-b border-green-800" rel = "noopener noreferrer" > Shields.io< / a > . To do so, you need to grant public, unauthorized access to the respective endpoint.< / p >
2020-09-12 17:09:23 +03:00
< div class = "flex justify-around mt-4" >
< span class = "font-mono font-normal bg-gray-900 p-1 rounded whitespace-no-wrap" > GET /api/compat/shields/v1< / span >
< button type = "submit" class = "py-1 px-2 rounded bg-green-700 hover:bg-green-800 text-white text-xs" title = "Make endpoint public to enable badges" >
Status: protected
< / button >
< / div >
{{ end }}
< / div >
< / form >
< / div >
2020-11-06 19:09:41 +03:00
< div class = "w-full mt-4 mb-8 pb-8" >
< div class = "font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" >
⚠️ Danger Zone
< / div >
< div class = "mt-10 text-gray-300 text-sm" >
< h3 class = "font-semibold text-md mb-4 border-b border-green-700 inline-block" >
Regenerate summaries
< / h3 >
< p >
Wakapi improves its efficiency and speed by automatically aggregating individual heartbeats to summaries on a per-day basis.
That is, historic summaries, i.e. such from past days, are generated once and only fetched from the database in a static fashion afterwards, unless you pass < span class = "font-mono font-normal bg-gray-900 p-1 rounded whitespace-no-wrap" > & recompute=true< / span > with your request.
< / p >
< p class = "mt-2" >
If, for some reason, these aggregated summaries are faulty or preconditions have change (e.g. you modified language mappings retrospectively), you may want to re-generate them from raw heartbeats.
< / p >
< p class = "mt-2" >
< strong > Note:< / strong > Only run this action if you know what you are doing. Data might be lost is case heartbeats were deleted after the respective summaries had been generated.
< / p >
< / div >
< div class = "mt-10 flex justify-center" >
< form action = "settings/regenerate" method = "post" id = "form-regenerate-summaries" >
< button type = "button" class = "py-1 px-3 rounded bg-red-500 hover:bg-red-600 text-white text-sm" id = "btn-regenerate-summaries" >
Clear & Regenerate
< / button >
< / form >
< / div >
< / div >
2020-06-07 20:28:32 +03:00
< / div >
< / main >
2020-09-12 17:09:23 +03:00
< script type = "text/javascript" >
const baseUrl = location.href.substring(0, location.href.indexOf('/settings'))
document.querySelectorAll('.with-url-src').forEach(e => {
e.setAttribute('src', e.getAttribute('src').replace('%s', baseUrl))
e.classList.remove('hidden')
})
document.querySelectorAll('.with-url-inner').forEach(e => {
e.innerHTML = e.innerHTML.replace('%s', baseUrl)
e.classList.remove('hidden')
})
2020-11-06 19:09:41 +03:00
const btnRegenerate = document.querySelector("#btn-regenerate-summaries")
const formRegenerate = document.querySelector('#form-regenerate-summaries')
btnRegenerate.addEventListener('click', () => {
if (confirm('Are you sure?')) {
formRegenerate.submit()
}
})
2020-09-12 17:09:23 +03:00
< / script >
2020-06-07 20:28:32 +03:00
{{ template "footer.tpl.html" . }}
{{ template "foot.tpl.html" . }}
< / body >
2020-10-25 09:22:10 +03:00
< / html >
2020-10-26 05:00:24 +03:00