Move SLM control center groundwork onto dev

This commit is contained in:
serversdwn
2026-01-12 18:07:26 +00:00
parent 893cb96e8d
commit 8a5fadb5df
22 changed files with 3960 additions and 29 deletions

View File

@@ -0,0 +1,108 @@
<!-- Project Dashboard -->
<div class="bg-white dark:bg-slate-800 rounded-xl shadow-lg p-6 mb-6">
<div class="flex flex-col md:flex-row md:items-start md:justify-between gap-4">
<div>
<h2 class="text-2xl font-semibold text-gray-900 dark:text-white">{{ project.name }}</h2>
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
{% if project_type %}
{{ project_type.name }}
{% else %}
Project
{% endif %}
</p>
</div>
{% if project.status == 'active' %}
<span class="px-3 py-1 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 rounded-full">Active</span>
{% elif project.status == 'completed' %}
<span class="px-3 py-1 text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300 rounded-full">Completed</span>
{% elif project.status == 'archived' %}
<span class="px-3 py-1 text-xs font-medium bg-gray-200 text-gray-700 dark:bg-gray-700 dark:text-gray-300 rounded-full">Archived</span>
{% endif %}
</div>
{% if project.description %}
<p class="text-gray-600 dark:text-gray-400 mt-4 max-w-3xl">{{ project.description }}</p>
{% endif %}
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mt-6">
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4">
<p class="text-xs text-gray-500 dark:text-gray-400">Locations</p>
<p class="text-2xl font-semibold text-gray-900 dark:text-white">{{ locations | length }}</p>
</div>
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4">
<p class="text-xs text-gray-500 dark:text-gray-400">Assigned Units</p>
<p class="text-2xl font-semibold text-gray-900 dark:text-white">{{ assigned_units | length }}</p>
</div>
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4">
<p class="text-xs text-gray-500 dark:text-gray-400">Active Sessions</p>
<p class="text-2xl font-semibold text-gray-900 dark:text-white">{{ active_sessions | length }}</p>
</div>
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4">
<p class="text-xs text-gray-500 dark:text-gray-400">Completed Sessions</p>
<p class="text-2xl font-semibold text-gray-900 dark:text-white">{{ completed_sessions_count }}</p>
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<div class="bg-white dark:bg-slate-800 rounded-xl shadow-lg p-6">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Locations</h3>
{% if locations %}
<div class="space-y-3">
{% for location in locations %}
<div class="border border-gray-200 dark:border-gray-700 rounded-lg p-3">
<p class="font-medium text-gray-900 dark:text-white">{{ location.name }}</p>
{% if location.address %}
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ location.address }}</p>
{% endif %}
{% if location.coordinates %}
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ location.coordinates }}</p>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<p class="text-sm text-gray-500 dark:text-gray-400">No locations added yet.</p>
{% endif %}
</div>
<div class="bg-white dark:bg-slate-800 rounded-xl shadow-lg p-6">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Assigned Units</h3>
{% if assigned_units %}
<div class="space-y-3">
{% for item in assigned_units %}
<a href="/slm/{{ item.unit.id }}" class="block border border-gray-200 dark:border-gray-700 rounded-lg p-3 hover:border-seismo-orange transition-colors">
<p class="font-medium text-gray-900 dark:text-white">{{ item.unit.id }}</p>
{% if item.unit.slm_model %}
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ item.unit.slm_model }}</p>
{% endif %}
{% if item.unit.address %}
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ item.unit.address }}</p>
{% endif %}
</a>
{% endfor %}
</div>
{% else %}
<p class="text-sm text-gray-500 dark:text-gray-400">No units assigned yet.</p>
{% endif %}
</div>
<div class="bg-white dark:bg-slate-800 rounded-xl shadow-lg p-6">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Upcoming Actions</h3>
{% if upcoming_actions %}
<div class="space-y-3">
{% for action in upcoming_actions %}
<div class="border border-gray-200 dark:border-gray-700 rounded-lg p-3">
<p class="font-medium text-gray-900 dark:text-white">{{ action.action_type }}</p>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ action.scheduled_time.strftime('%Y-%m-%d %H:%M') }}</p>
{% if action.description %}
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ action.description }}</p>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<p class="text-sm text-gray-500 dark:text-gray-400">No scheduled actions.</p>
{% endif %}
</div>
</div>