mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
173 lines
9.2 KiB
HTML
173 lines
9.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
{{ template "head.tpl.html" . }}
|
|
|
|
<body class="relative bg-gray-800 text-gray-700 p-4 pt-10 flex flex-col min-h-screen max-w-screen-xl mx-auto justify-center">
|
|
|
|
{{ template "header.tpl.html" . }}
|
|
|
|
<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">
|
|
<div class="flex-grow flex flex-col px-2">
|
|
<span class="text-xs text-gray-500 mx-1">API Key</span>
|
|
<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">
|
|
</div>
|
|
<div class="flex items-center px-2 border-l border-gray-700">
|
|
<button title="Copy to clipboard" onclick="copyApiKey(event)">📋</button>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
</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>
|
|
|
|
<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>
|
|
<a href="summary?interval=day" class="mx-2 my-1 border-b border-green-700">Yesterday</a>
|
|
<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>
|
|
<a href="summary?interval=7_days" class="mx-2 my-1 border-b border-green-700">Past 7 Days</a>
|
|
<a href="summary?interval=30_days" class="mx-2 my-1 border-b border-green-700">Past 30 Days</a>
|
|
<a href="summary?interval=12_months" class="mx-2 my-1 border-b border-green-700">Past 12 Months</a>
|
|
<a href="summary?interval=any" class="mx-2 my-1 border-b border-green-700">All Time</a>
|
|
</div>
|
|
|
|
{{ template "alerts.tpl.html" . }}
|
|
|
|
<main class="mt-10 flex-grow">
|
|
<div class="flex justify-center">
|
|
<div class="p-1">
|
|
<div class="flex justify-center p-4 bg-white rounded shadow">
|
|
<p class="mx-2"><strong>▶️</strong> <span title="Start Time">{{ .FromTime.T | date }}</span></p>
|
|
<p class="mx-2"><strong>⏹</strong> <span title="End Time">{{ .ToTime.T | date }}</span></p>
|
|
<p class="mx-2"><strong>⏱</strong> <span id="total-span" title="Total Hours"></span></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex flex-wrap justify-center">
|
|
<div class="w-full lg:w-1/2 p-1">
|
|
<div class="p-4 pb-10 bg-white rounded shadow m-2 flex flex-col" id="project-container" style="height: 300px">
|
|
<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>
|
|
<input type="number" min="1" id="project-top-picker" data-entity="0" class="w-1/4 top-picker bg-gray-200 rounded-md text-center" value="10">
|
|
</div>
|
|
</div>
|
|
<canvas id="chart-projects"></canvas>
|
|
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
|
<img src="assets/images/no_data.svg" class="w-20" alt="No data"/>
|
|
<span class="text-sm mt-4">No data available ...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="w-full lg:w-1/2 p-1">
|
|
<div class="p-4 pb-10 bg-white rounded shadow m-2 flex flex-col" id="os-container" style="height: 300px">
|
|
<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>
|
|
<input type="number" min="1" id="os-top-picker" data-entity="1" class="w-1/4 top-picker bg-gray-200 rounded-md text-center" value="10">
|
|
</div>
|
|
</div>
|
|
<canvas id="chart-os"></canvas>
|
|
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
|
<img src="assets/images/no_data.svg" class="w-20" alt="No data"/>
|
|
<span class="text-sm mt-4">No data available ...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="w-full lg:w-1/2 p-1">
|
|
<div class="p-4 pb-10 bg-white rounded shadow m-2 flex flex-col relative" id="language-container" style="height: 300px">
|
|
<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>
|
|
<input type="number" min="1" id="language-top-picker" data-entity="3" class="w-1/4 top-picker bg-gray-200 rounded-md text-center" value="10">
|
|
</div>
|
|
</div>
|
|
<canvas id="chart-language"></canvas>
|
|
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
|
<img src="assets/images/no_data.svg" class="w-20" alt="No data"/>
|
|
<span class="text-sm mt-4">No data available ...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="w-full lg:w-1/2 p-1">
|
|
<div class="p-4 pb-10 bg-white rounded shadow m-2 flex flex-col" id="editor-container" style="height: 300px">
|
|
<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>
|
|
<input type="number" min="1" id="editor-top-picker" data-entity="2" class="w-1/4 top-picker bg-gray-200 rounded-md text-center" value="10">
|
|
</div>
|
|
</div>
|
|
<canvas id="chart-editor"></canvas>
|
|
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
|
<img src="assets/images/no_data.svg" class="w-20" alt="No data"/>
|
|
<span class="text-sm mt-4">No data available ...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="w-full lg:w-1/2 p-1">
|
|
<div class="p-4 pb-10 bg-white rounded shadow m-2 flex flex-col" id="machine-container" style="height: 300px">
|
|
<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>
|
|
<input type="number" min="1" id="machine-top-picker" data-entity="4" class="w-1/4 top-picker bg-gray-200 rounded-md text-center" value="10">
|
|
</div>
|
|
</div>
|
|
<canvas id="chart-machine"></canvas>
|
|
<div class="hidden placeholder-container flex items-center justify-center h-full flex-col">
|
|
<img src="assets/images/no_data.svg" class="w-20" alt="No data"/>
|
|
<span class="text-sm mt-4">No data available ...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
{{ template "footer.tpl.html" . }}
|
|
|
|
{{ template "foot.tpl.html" . }}
|
|
|
|
<script>
|
|
const languageColors = {{ .LanguageColors | json }}
|
|
|
|
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>
|
|
|
|
</body>
|
|
|
|
</html> |