chore: minor ui changes for api key settings

This commit is contained in:
Ferdinand Mütsch
2025-11-21 10:52:06 +01:00
parent 4e08ccd151
commit 02e057883c
3 changed files with 49 additions and 56 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -889,7 +889,8 @@
{{ if ne .User.Email "" }}
<button type="submit" class="btn-primary mt-4">Subscribe ({{ .SubscriptionPrice }} / mo)</button>
{{ else }}
<button type="submit" class="btn-disabled cursor-pointer mt-4" disabled title="">Subscribe ({{ .SubscriptionPrice }} / mo)</button><br>
<button type="submit" class="btn-disabled cursor-pointer mt-4" disabled title="">Subscribe ({{ .SubscriptionPrice }} / mo)</button>
<br>
<span class="text-xs text-muted">You have to provide an e-mail address to purchase a subscription.</span>
{{ end }}
</form>
@@ -908,9 +909,9 @@
<input type="hidden" name="action" value="reset_apikey">
<div class="w-1/2 mr-4">
<span class="font-semibold text-foreground text-lg">Reset Main API Key</span>
<span class="font-semibold text-foreground text-lg">Reset primary API key</span>
<span class="block text-sm text-muted">
Please note that resetting your API key requires you to update your .wakatime.cfg files on all of your computers to make the WakaTime client send heartbeats again.
Please note that resetting your API key requires you to update your <code>.wakatime.cfg</code> files on all of your computers to make the WakaTime client send heartbeats again.
</span>
</div>
<div class="w-1/2 ml-4 flex items-center justify-end">
@@ -919,40 +920,32 @@
</form>
</div>
<div class="flex w-full lg:w-3/4" id="form-generate-api-key">
<div class="w-1/2 mr-4">
<span class="font-semibold text-foreground text-lg">Generate API Key</span>
<div class="flex w-full lg:w-3/4 justify-between items-center" id="form-generate-api-key">
<div class="w-1/2 mb-8">
<span class="font-semibold text-foreground text-lg">Add API keys</span>
<span class="block text-sm text-muted">
Add a new API key to access the Wakapi API. You can have multiple API keys active at the same time.
Besides the primary (aka. <i>main</i>) API key, which always exists, you can create additional API keys for different applications to access Wakapi. You can either grant read-only access or read-write access, which additionally allows to ingest heartbeats.
</span>
</div>
<form action="" method="post" class="flex w-full ml-4 justify-end">
<form action="" method="post" class="flex justify-end shrink-0">
<input type="hidden" name="action" value="add_api_key">
<div class="flex flex-col gap-2 items-end">
<div class="flex gap-2 items-center justify-end">
<input class="appearance-none bg-card text-foreground outline-none rounded py-2 px-4 focus:bg-focused"
type="text" id="api-name" name="api_name" placeholder="Key Name" minlength="1"
maxlength="64" required>
<div class="flex gap-2 items-center justify-end mt-4 float-left">
<label class="font-semibold text-foreground" for="api-readonly">Read Only</label>
<div>
<select autocomplete="off" id="api-readonly" name="api_readonly" class="select-default grow">
<option value="false" class="cursor-pointer">No</option>
<option value="true" class="cursor-pointer">Yes</option>
<option value="false" class="cursor-pointer">Read / write</option>
<option value="true" class="cursor-pointer">Read only</option>
</select>
</div>
</div>
<div class="flex items-center justify-end">
<button type="submit" class="w-1/2 btn-primary justify-end float-right mt-4">Generate</button>
</div>
<button type="submit" class="btn-primary">Add</button>
</div>
</form>
</div>
<div class="w-full lg:w-3/4">
<span class="flex font-semibold text-foreground text-lg mb-4">API Keys</span>
<span class="flex font-semibold text-foreground text-lg mb-2">API Keys</span>
<table class="w-full">
<thead>