Working user, Keys and chat

This commit is contained in:
2024-05-11 12:17:09 +02:00
parent a109237922
commit 3061bf7837
11 changed files with 576 additions and 88 deletions
+3 -2
View File
@@ -4,8 +4,9 @@
<div class='rows'>
{% for message in Messages %}
<div class='row is-full mt-1'>
<a {% if NotClickable %} href="#" hx-get="/messageContent?id={{ message.Id }}" class="is-clickable"
onclick="toggleGrayscale(this)" hx-target="#content-{{ ConversationAreaId }}" {% endif %}>
<a {% if not NotClickable %} href="#" hx-get="/messageContent?id={{ message.Id }}"
class="is-clickable" onclick="toggleGrayscale(this)"
hx-target="#content-{{ ConversationAreaId }}" {% endif %}>
<figure class="image is-48x48" style="flex-shrink: 0;">
<img src="icons/{{ message.Icon }}.png" alt="User Image" {% if message.Hidden %}
style="filter: grayscale(100%);" {% endif %} title="{{ message.Name }}">
+11 -9
View File
@@ -9,16 +9,18 @@
<div class="dropdown-item">
{% for CompanyInfo in CompanyInfos %}
<div class="content">
<h5 class="subtitle is-5">{{ CompanyInfo.Name }}</h5>
{% for ModelInfo in CompanyInfo.ModelInfos %}
<div class="field">
<label class="checkbox">
<input {%if ModelInfo.ID in CheckedModels %}checked{% endif %} type="checkbox"
name="model-check-{{ ModelInfo.ID }}" value="{{ ModelInfo.ID }}" />
{{ ModelInfo.Name }}
</label>
<div class="block">
{% for ModelInfo in CompanyInfo.ModelInfos %}
<div class="field">
<label class="custom-checkbox">
<input {%if ModelInfo.ID in CheckedModels %}checked{% endif %} type="checkbox"
name="model-check-{{ ModelInfo.ID }}" value="{{ ModelInfo.ID }}" />
<span class="checkmark"></span>
{{ ModelInfo.Name }}
</label>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endfor %}
</div>
+12 -1
View File
@@ -8,7 +8,7 @@
<div class="dropdown-content">
<div class="dropdown-item">
<div class="field">
<form id="api-keys-form" hx-post="/addKeys" hx-trigger="submit" hx-swap="afterend">
<form id="api-keys-form" hx-post="/addKeys" hx-trigger="submit" hx-target="#api-keys-status">
<div class="field has-addons">
<p class="control has-icons-left is-expanded">
<input class="input is-small {% if OpenaiExists %}is-success{% endif %}" type="text"
@@ -29,6 +29,16 @@
</span>
</p>
</div>
<div class="field has-addons">
<p class="control has-icons-left is-expanded">
<input class="input is-small {% if MistralExists %}is-success{% endif %}" type="text"
{%if not IsLogin %}disabled{% endif %} placeholder="Mistral API key"
name="mistral_key" autocomplete="off">
<span class="icon is-small is-left">
<i class="fas fa-lock"></i>
</span>
</p>
</div>
<div class="field has-addons">
<p class="control">
<button {% if not IsLogin %}disabled{% endif %} type="submit"
@@ -36,6 +46,7 @@
</p>
</div>
</form>
<p id="api-keys-status"></p>
</div>
</div>
</div>
+4 -2
View File
@@ -7,8 +7,10 @@
<div class="dropdown-menu" id="dropdown-menu4" role="menu">
<div class="dropdown-content">
<div class="dropdown-item">
<h5>Total Usage</h5>
<h5>{{ TotalUsage }}$</h5>
<div><strong>Total: {{ TotalUsage }}$</strong></div>
<div><strong>Month: {{ MonthUsage }}$</strong></div>
<div><strong>Week: {{ WeekUsage }}$</strong></div>
<div><strong>Today: {{ TodayUsage }}$</strong></div>
</div>
</div>
</div>