{% extends "resources/base.html" %} {% import "site_shell/_macros.html" as ui %} {% block title %}{{ resource.name }} - Pychestrate Resources{% endblock %} {% block content %}

Resource Information

ID {{ resource.id }}
Name {{ resource.name }}
Type {{ resource.resource_type }}
Pool {{ resource.pool_name | display }}
Description {{ resource.description or '—' }}
Health Status {% 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 %}
Capacity {{ resource.current_allocations }}/{{ resource.capacity }} allocated
Tags {% for tag in resource.tags %} {{ tag }} {% else %} No tags {% endfor %}
Created {{ resource.created_at | local_datetime(true, '—') }}
Updated {{ resource.updated_at | local_datetime(true, '—') }}
{% if resource.metadata %}

Metadata

{{ resource.metadata | tojson(indent=2) }}
{% endif %}

Active Allocations

{% if active_allocations %}
{% for alloc in active_allocations %} {% endfor %}
ID User Job ID Mode Check Out Time Expected Check In Actions
{{ alloc.id }} {{ alloc.username or '—' }} {{ alloc.job_id or '—' }} {{ ui.status_badge(alloc.mode) }} {{ alloc.checkout_time | local_datetime(true, '—') }} {{ alloc.expected_checkin | local_datetime(true, '—') }} {% if alloc.user_id|string == current_user_id|string %}
{% elif can_manage %} Force check in… {% endif %}
{% else %}

No active allocations

{% endif %}

Upcoming Reservations

{% if upcoming_reservations %}
{% for res in upcoming_reservations %} {% endfor %}
ID User Job ID Mode Start Time End Time
{{ res.id }} {{ res.username or '—' }} {{ res.job_id or '—' }} {{ res.mode | state_words }} {{ res.start_time | local_datetime(false, '—') }} {{ res.end_time | local_datetime(false, '—') }}
{% else %}

No upcoming reservations

{% endif %}

Actions

{% if can_manage %} {{ ui.icon("edit") }} Edit Resource {% endif %} {{ ui.icon("monitor_heart") }} Health History {% if can_manage %}
{% endif %}
{% set status = resource.health_status %} {% if status in ['online', 'degraded'] %} {% if resource.current_allocations < resource.capacity %}

Check Out Resource

{% if next_reservation_by_other %}

Reserved by {{ next_reservation_by_other.username or 'someone else' }} from {{ next_reservation_by_other.start_time | local_datetime(false, '—') }} to {{ next_reservation_by_other.end_time | local_datetime(false, '—') }}. Check it out with a timeout that ends before then; a request that runs into a reservation is refused.

{% endif %}

Leave empty for no timeout

{% elif my_allocation %}

Check Out Resource

You have this checked out, since {{ my_allocation.checkout_time | local_datetime(false, '—') }}{% if my_allocation.expected_checkin %}, until {{ my_allocation.expected_checkin | local_datetime(false, '—') }}{% endif %}. Open your allocation to check it in.

{% if resource.current_allocations > 1 %}

{{ resource.current_allocations - 1 }} other allocation{{ 's' if resource.current_allocations != 2 else '' }} {{ 'are' if resource.current_allocations != 2 else 'is' }} also active.

{% endif %}
{% else %}

Check Out Resource

At capacity: held by {% for allocation in active_allocations %}{{ allocation.username or 'someone' }}{% if allocation.expected_checkin %} (until {{ allocation.expected_checkin | local_datetime(false, '—') }}){% endif %}{% if not loop.last %}, {% endif %}{% endfor %}. Checking out becomes available when an allocation is checked in.

{% endif %} {% else %}

Check Out Resource

Checking out is blocked: this resource is {% if status == 'maintenance' %}in maintenance{% else %}{{ status }}{% endif %}{% if blocking_transition %} since {{ blocking_transition.timestamp | local_datetime(false, '—') }}{% if blocking_transition.username %} (set by {{ blocking_transition.username }}){% endif %}{% endif %}. {% if blocking_transition and blocking_transition.reason %}Reason: {{ blocking_transition.reason }}.{% endif %} {% if can_manage %}Change its status under Health to allow checking out again.{% else %}Ask a lab manager to bring it back online.{% endif %}

{% endif %}
{% include "site_shell/_local_times.html" %} {% endblock %}