forked from enviPath/enviPy
This PR moves all the collection pages into the new UI in a rough push. I did not put the same amount of care into these as into search, index, and predict. ## Major changes - All modals are now migrated to a state based alpine.js implementation. - jQuery is no longer present in the base layout; ajax is replace by native fetch api - most of the pps.js is now obsolte (as I understand it; the code is not referenced any more @jebus please double check) - in-memory pagination for large result lists (set to 50; we can make that configurable later; performance degrades at around 1k) stukk a bit rough tracked in #235 ## Minor things - Sarch and index also use alpine now - The loading spinner is now CSS animated (not sure if it currently gets correctly called) ## Not done - Ihave not even cheked the admin pages. Not sure If these need migrations - The temporary migration pages still use the old template. Not sure what is supposed to happen with those? @jebus ## What I did to test - opend all pages in browse, and user ; plus all pages reachable from there. - Interacted and tested the functionality of each modal superfically with exception of the API key modal (no functional test). --- This PR is massive sorry for that; just did not want to push half-brokenn state. @jebus @liambrydon I would be glad if you could click around and try to break it :) Finally closes #133 Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#236 Co-authored-by: Tobias O <tobias.olenyi@envipath.com> Co-committed-by: Tobias O <tobias.olenyi@envipath.com>
171 lines
5.8 KiB
HTML
171 lines
5.8 KiB
HTML
{% extends "framework_modern.html" %}
|
|
|
|
{% block content %}
|
|
|
|
{% block action_modals %}
|
|
{% include "modals/objects/edit_user_modal.html" %}
|
|
{% include "modals/objects/edit_password_modal.html" %}
|
|
{% include "modals/collections/new_prediction_setting_modal.html" %}
|
|
{% include "modals/objects/manage_api_token_modal.html" %}
|
|
{% include "modals/objects/generic_delete_modal.html" %}
|
|
{% endblock action_modals %}
|
|
|
|
<div class="space-y-2 p-4">
|
|
<!-- Header Section -->
|
|
<div class="card bg-base-100">
|
|
<div class="card-body">
|
|
<div class="flex items-center justify-between">
|
|
<h2 class="card-title text-2xl">{{ user.username }}</h2>
|
|
<div id="actionsButton" class="dropdown dropdown-end hidden">
|
|
<div tabindex="0" role="button" class="btn btn-ghost btn-sm">
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
width="16"
|
|
height="16"
|
|
viewBox="0 0 24 24"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
stroke-width="2"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
class="lucide lucide-wrench"
|
|
>
|
|
<path
|
|
d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"
|
|
/>
|
|
</svg>
|
|
Actions
|
|
</div>
|
|
<ul
|
|
tabindex="-1"
|
|
class="dropdown-content menu bg-base-100 rounded-box z-50 w-52 p-2"
|
|
>
|
|
{% block actions %}
|
|
{% include "actions/objects/user.html" %}
|
|
{% endblock %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<p class="mt-2">
|
|
On this page you can modify your account or set preferences such as
|
|
prediction settings.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Default Package -->
|
|
<div class="collapse-arrow bg-base-200 collapse">
|
|
<input type="checkbox" checked />
|
|
<div class="collapse-title text-xl font-medium">Default Package</div>
|
|
<div class="collapse-content">
|
|
<a href="{{ user.default_package.url }}" class="link link-primary"
|
|
>{{ user.default_package.name }}</a
|
|
>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Groups -->
|
|
{% if meta.available_groups|length > 0 %}
|
|
<div class="collapse-arrow bg-base-200 collapse">
|
|
<input type="checkbox" checked />
|
|
<div class="collapse-title text-xl font-medium">Groups</div>
|
|
<div class="collapse-content">
|
|
<ul class="menu bg-base-100 rounded-box">
|
|
{% for g in meta.available_groups %}
|
|
<li>
|
|
<a href="{{ g.url }}" class="hover:bg-base-200">{{ g.name }}</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Current Prediction Setting -->
|
|
<div class="collapse-arrow bg-base-200 collapse">
|
|
<input type="checkbox" checked />
|
|
<div class="collapse-title text-xl font-medium">
|
|
Current Prediction Setting
|
|
</div>
|
|
<div class="collapse-content">
|
|
<div class="overflow-x-auto">
|
|
<table class="table-zebra table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% if user.default_setting.model %}
|
|
<tr>
|
|
<td>Model</td>
|
|
<td>
|
|
<div class="space-y-2">
|
|
<a
|
|
href="{{ user.default_setting.model.url }}"
|
|
class="link link-primary"
|
|
>
|
|
{{ user.default_setting.model.name }}
|
|
</a>
|
|
<table class="table-xs table">
|
|
<thead>
|
|
<tr>
|
|
<th>Model Parameter</th>
|
|
<th>Parameter Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Threshold</td>
|
|
<td>{{ user.default_setting.model_threshold }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if user.default_setting.rule_packages.all %}
|
|
<tr>
|
|
<td>Rule Packages</td>
|
|
<td>
|
|
<ul class="menu bg-base-200 rounded-box">
|
|
{% for p in user.default_setting.rule_packages.all %}
|
|
<li>
|
|
<a href="{{ p.url }}" class="hover:bg-base-300"
|
|
>{{ p.name }}</a
|
|
>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
<tr>
|
|
<td>Max Nodes</td>
|
|
<td>{{ user.default_setting.max_nodes }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Max Depth</td>
|
|
<td>{{ user.default_setting.max_depth }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// Show actions button if there are actions
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
const actionsButton = document.getElementById("actionsButton");
|
|
const actionsList = actionsButton?.querySelector("ul");
|
|
if (actionsList && actionsList.children.length > 0) {
|
|
actionsButton?.classList.remove("hidden");
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock content %}
|