{% extends "resources/base.html" %} {% import "site_shell/_macros.html" as ui %} {% block title %}Resources - Pychestrate Resources{% endblock %} {% block content %}
{% if all_tags %}
Tags{% if selected_tags %} ({{ selected_tags | length }}){% endif %}
Filter by tags {% for tag in all_tags %} {% endfor %}
{% endif %} Clear
{{ ui.icon("download") }} Download CSV {% if can_manage %} {{ ui.icon("add_circle") }} Import {{ ui.icon("add") }} Create Resource {% endif %}
{% if can_manage %}{% endif %} {% for resource in resources %} {% if can_manage %} {% endif %} {% else %} {% if filters_active %} {% else %} {% endif %} {% endfor %}
Name Type Pool Health Availability TagsActions
{{ resource.name }} {{ resource.resource_type }} {{ resource.pool_name | display }} {% set status = resource.health_status %} {% if status == 'online' %} Online {% elif status == 'offline' %} Offline {% elif status == 'degraded' %} Degraded {% elif status == 'maintenance' %} Maintenance {% else %} {{ status | capitalize }} {% endif %} {% set who = holders.get(resource.id, []) if holders else [] %} {% set free = resource.capacity - resource.current_allocations %} {% if free > 0 and resource.health_status in ['online', 'degraded'] %} Available {% if resource.capacity > 1 %}{{ free }} of {{ resource.capacity }} free{% endif %}
{% elif free > 0 %} Unavailable {{ resource.health_status | capitalize }} {% else %} In use {% if who %} by {{ who[0].username or 'someone' }}{% if who | length > 1 %} +{{ who | length - 1 }}{% endif %}{% if who[0].expected_checkin %} until {{ who[0].expected_checkin | format_datetime('%Y-%m-%d %H:%M', '') }}{% endif %} {% endif %} {% endif %}
{% for tag in resource.tags[:3] %} {{ tag }} {% endfor %} {% if resource.tags|length > 3 %} +{{ resource.tags|length - 3 }} {% endif %}
Edit
No resources match the current filters. Clear filters No resources found. {% if can_manage %}Create one{% endif %}
{{ ui.pagination('resources.resource_list', page, total_pages, {'per_page': per_page, 'pool_id': selected_pool_id, 'resource_type': (selected_resource_type or none), 'health_status': (selected_health_status or none), 'availability': (selected_availability or none), 'search': (search or none), 'tags': (selected_tags or none)}, total=total) }} {% endblock %}