|
| 1 | +{# SPDX-License-Identifier: Apache-2.0 -#} |
| 2 | + |
| 3 | +{% extends "admin/base.html" %} |
| 4 | + |
| 5 | +{% block title %}Quarantine{% endblock %} |
| 6 | + |
| 7 | +{% block breadcrumb %} |
| 8 | + <li class="breadcrumb-item active">Quarantine</li> |
| 9 | +{% endblock %} |
| 10 | + |
| 11 | +{% block content %} |
| 12 | + <div class="card"> |
| 13 | + <div class="card-header"> |
| 14 | + <h3 class="card-title">Projects in Quarantine</h3> |
| 15 | + </div> |
| 16 | + <div class="card-body"> |
| 17 | + {% if quarantined_projects %} |
| 18 | + <div class="table-responsive"> |
| 19 | + <table class="table table-striped quarantine-table"> |
| 20 | + <thead> |
| 21 | + <tr> |
| 22 | + <th>Project</th> |
| 23 | + <th class="d-none d-md-table-cell">Days in Quarantine</th> |
| 24 | + <th class="d-none d-lg-table-cell">Quarantined Date</th> |
| 25 | + <th class="d-none d-xl-table-cell">Note</th> |
| 26 | + <th>Actions</th> |
| 27 | + </tr> |
| 28 | + </thead> |
| 29 | + <tbody> |
| 30 | + {% for project in quarantined_projects %} |
| 31 | + <tr> |
| 32 | + <td> |
| 33 | + <div class="project-info"> |
| 34 | + <div class="project-name"> |
| 35 | + <a href="{{ request.route_path('admin.project.detail', project_name=project.name) }}"> |
| 36 | + <strong>{{ project.name }}</strong> |
| 37 | + </a> |
| 38 | + </div> |
| 39 | + <!-- Mobile-only information shown under project name --> |
| 40 | + <div class="d-md-none text-muted small mt-1"> |
| 41 | + {% if project.lifecycle_status_changed %} |
| 42 | + {% set days_quarantined = (now() - project.lifecycle_status_changed).days %} |
| 43 | + <span class="badge badge-{{ 'warning' if days_quarantined > 30 else ('info' if days_quarantined > 7 else 'secondary') }} mr-2"> |
| 44 | + {{ days_quarantined }} days |
| 45 | + </span> |
| 46 | + {{ project.lifecycle_status_changed.strftime('%Y-%m-%d') }} |
| 47 | + {% else %} |
| 48 | + <span class="badge badge-secondary">Unknown</span> |
| 49 | + {% endif %} |
| 50 | + </div> |
| 51 | + {% if project.lifecycle_status_note %} |
| 52 | + <div class="d-xl-none text-muted small mt-1"> |
| 53 | + <strong>Note:</strong> {{ project.lifecycle_status_note }} |
| 54 | + </div> |
| 55 | + {% endif %} |
| 56 | + </div> |
| 57 | + </td> |
| 58 | + <td class="d-none d-md-table-cell"> |
| 59 | + {% if project.lifecycle_status_changed %} |
| 60 | + {% set days_quarantined = (now() - project.lifecycle_status_changed).days %} |
| 61 | + <span class="badge badge-{{ 'warning' if days_quarantined > 30 else ('info' if days_quarantined > 7 else 'secondary') }}"> |
| 62 | + {{ days_quarantined }} days |
| 63 | + </span> |
| 64 | + {% else %} |
| 65 | + <em>Unknown</em> |
| 66 | + {% endif %} |
| 67 | + </td> |
| 68 | + <td class="d-none d-lg-table-cell"> |
| 69 | + {% if project.lifecycle_status_changed %} |
| 70 | + {{ project.lifecycle_status_changed.strftime('%Y-%m-%d %H:%M:%S UTC') }} |
| 71 | + {% else %} |
| 72 | + <em>Unknown</em> |
| 73 | + {% endif %} |
| 74 | + </td> |
| 75 | + <td class="d-none d-xl-table-cell"> |
| 76 | + {% if project.lifecycle_status_note %} |
| 77 | + {{ project.lifecycle_status_note }} |
| 78 | + {% else %} |
| 79 | + <em>No note</em> |
| 80 | + {% endif %} |
| 81 | + </td> |
| 82 | + <td> |
| 83 | + <div class="btn-group-vertical d-md-none"> |
| 84 | + <a href="{{ request.route_path('admin.project.detail', project_name=project.name) }}" |
| 85 | + class="btn btn-sm btn-info mb-1" title="View Project Details"> |
| 86 | + <i class="fa fa-eye"></i> View |
| 87 | + </a> |
| 88 | + <button type="button" |
| 89 | + class="btn btn-sm btn-success" |
| 90 | + data-toggle="modal" |
| 91 | + data-target="#modal-exit-quarantine-{{ loop.index }}" |
| 92 | + title="Clear from Quarantine"> |
| 93 | + <i class="fa fa-unlock"></i> Release |
| 94 | + </button> |
| 95 | + </div> |
| 96 | + <div class="btn-group d-none d-md-flex" role="group"> |
| 97 | + <a href="{{ request.route_path('admin.project.detail', project_name=project.name) }}" |
| 98 | + class="btn btn-sm btn-info" title="View Project Details"> |
| 99 | + <i class="fa fa-eye"></i> View |
| 100 | + </a> |
| 101 | + <button type="button" |
| 102 | + class="btn btn-sm btn-success" |
| 103 | + data-toggle="modal" |
| 104 | + data-target="#modal-exit-quarantine-{{ loop.index }}" |
| 105 | + title="Clear from Quarantine"> |
| 106 | + <i class="fa fa-unlock"></i> Release |
| 107 | + </button> |
| 108 | + </div> |
| 109 | + </td> |
| 110 | + </tr> |
| 111 | + {% endfor %} |
| 112 | + </tbody> |
| 113 | + </table> |
| 114 | + </div> |
| 115 | + |
| 116 | + <!-- Modals --> |
| 117 | + {% for project in quarantined_projects %} |
| 118 | + <div class="modal fade" id="modal-exit-quarantine-{{ loop.index }}"> |
| 119 | + <div class="modal-dialog modal-exit-quarantine"> |
| 120 | + <form id="exit-quarantine-{{ loop.index }}" |
| 121 | + action="{{ request.route_path('admin.project.remove_from_quarantine', project_name=project.name) }}" |
| 122 | + method="post"> |
| 123 | + <input name="csrf_token" |
| 124 | + type="hidden" |
| 125 | + value="{{ request.session.get_csrf_token() }}"> |
| 126 | + <div class="modal-content"> |
| 127 | + <div class="modal-header bg-success"> |
| 128 | + <h4 class="modal-title">Clear Project from Quarantine</h4> |
| 129 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| 130 | + <span aria-hidden="true">×</span> |
| 131 | + </button> |
| 132 | + </div> |
| 133 | + <div class="modal-body"> |
| 134 | + <p> |
| 135 | + Confirming that <code>{{ project.name }}</code> will no longer be quarantined. |
| 136 | + </p> |
| 137 | + <p> |
| 138 | + This will restore the project to the index for installation. |
| 139 | + It will not affect any frozen user accounts - those will need to be handled separately. |
| 140 | + </p> |
| 141 | + </div> |
| 142 | + <div class="modal-footer justify-content-between"> |
| 143 | + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> |
| 144 | + <button type="submit" class="btn btn-outline-success">Clear from Quarantine</button> |
| 145 | + </div> |
| 146 | + </div> |
| 147 | + </form> |
| 148 | + </div> |
| 149 | + </div> |
| 150 | + {% endfor %} |
| 151 | + |
| 152 | + <div class="mt-3"> |
| 153 | + <div class="alert alert-info"> |
| 154 | + <i class="fa fa-info-circle"></i> |
| 155 | + <strong>{{ quarantined_projects|length }}</strong> project{{ 's' if quarantined_projects|length != 1 else '' }} currently in quarantine. |
| 156 | + Projects are sorted by quarantine date (oldest first). |
| 157 | + </div> |
| 158 | + </div> |
| 159 | + {% else %} |
| 160 | + <div class="alert alert-success"> |
| 161 | + <i class="fa fa-check-circle"></i> |
| 162 | + No projects are currently in quarantine. |
| 163 | + </div> |
| 164 | + {% endif %} |
| 165 | + </div> |
| 166 | + </div> |
| 167 | +{% endblock %} |
0 commit comments