Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-20 10:15:30

0001 {% extends 'base.html' %}
0002 {% load swf_fmt %}
0003 
0004 {% block title %}{{ user.username }}{% endblock %}
0005 
0006 {% block content %}
0007 <style>
0008     .user-tabs { margin: 14px 0 .4rem 0; }
0009     .user-tabs a {
0010         border-bottom: 2px solid transparent;
0011         color: #3d85c6;
0012         font-weight: 600;
0013         margin-right: 1.1rem;
0014         padding-bottom: 2px;
0015         text-decoration: none;
0016     }
0017     .user-tabs a.active { border-bottom-color: #3d85c6; color: #111; }
0018     .user-tab-panel {
0019         padding: 14px 0;
0020     }
0021     .my-workflows-table {
0022         border-collapse: collapse;
0023     }
0024     .my-workflows-table th, .my-workflows-table td {
0025         padding: 6px 14px;
0026         border-bottom: 1px solid #ddd;
0027         text-align: left;
0028         white-space: nowrap;
0029     }
0030     .my-workflows-table th {
0031         border-bottom: 2px solid #999;
0032     }
0033 </style>
0034 
0035 <div>
0036     <div class="user-tabs">
0037         <a href="?tab=workflows" class="{% if active_tab == 'workflows' %}active{% endif %}">My Workflows</a>
0038         <a href="?tab=account" class="{% if active_tab == 'account' %}active{% endif %}">Account</a>
0039     </div>
0040 
0041     {% if active_tab == 'workflows' %}
0042     <div class="user-tab-panel">
0043         <!-- Snapper state history: testbed activity lanes over the last 7 days -->
0044         <div class="card mb-4">
0045             <div class="card-header"><strong>Time history</strong>
0046                 {% if snapper_embed.report_query %}
0047                 <a class="ms-3" href="{% url 'snapper_ai:snapper_report' scope=snapper_embed.scope %}?{{ snapper_embed.report_query }}">Open in Snapper</a>
0048                 {% endif %}
0049             </div>
0050             <div class="card-body">
0051                 {% include 'snapper_ai/_snapper_embed.html' with embed=snapper_embed %}
0052             </div>
0053         </div>
0054         {% if not user.is_authenticated %}
0055         <p>Sign in to see your workflows.</p>
0056         {% else %}
0057         <p>PanDA tasks for username <strong>{{ panda_username }}</strong>, last 30 days.</p>
0058         {% if my_tasks_error %}
0059         <p class="error_fill" style="padding: 6px 10px;">PanDA task lookup failed: {{ my_tasks_error }}</p>
0060         {% elif my_tasks %}
0061         <table class="table table-striped table-bordered table-sm align-middle w-auto swf-sortable">
0062             <thead>
0063                 <tr><th>Task</th><th>JEDI ID</th><th>Status</th><th>Label</th><th>Created</th><th>Modified</th></tr>
0064             </thead>
0065             <tbody>
0066                 {% for t in my_tasks %}
0067                 <tr>
0068                     <td><a href="{% url 'monitor_app:panda_task_detail' t.jeditaskid %}">{{ t.taskname }}</a></td>
0069                     <td>{{ t.jeditaskid }}</td>
0070                     <td class="{{ t.status|state_class }}">{{ t.status }}</td>
0071                     <td>{{ t.prodsourcelabel }}</td>
0072                     <td>{{ t.creationdate|date:"Y-m-d H:i" }}</td>
0073                     <td>{{ t.modificationtime|date:"Y-m-d H:i" }}</td>
0074                 </tr>
0075                 {% endfor %}
0076             </tbody>
0077         </table>
0078         {% else %}
0079         <p>No PanDA tasks for <strong>{{ panda_username }}</strong> in the last 30 days.</p>
0080         {% endif %}
0081         <p style="margin-top: 14px;">
0082             <a href="{% url 'monitor_app:panda_tasks_list' %}?username={{ panda_username }}">All tasks for {{ panda_username }} in the PanDA tasks view</a>
0083         </p>
0084         {% endif %}
0085     </div>
0086     {% endif %}
0087 
0088     {% if active_tab == 'account' %}
0089     <div class="user-tab-panel">
0090         <h3>Account Details</h3>
0091         <p><strong>Username:</strong> {{ user.username }}</p>
0092         <p><strong>Email:</strong> {{ user.email|default:'Not set' }}</p>
0093 
0094         <h3 style="margin-top: 24px;">Production access</h3>
0095         <table class="table table-sm w-auto" style="font-size: 1rem;">
0096           <tr><th scope="row" style="padding-right: 1.2rem;">GitHub account</th>
0097             <td>{% if authority.record.github %}<strong>{{ authority.record.github }}</strong>{% else %}none linked{% endif %}</td></tr>
0098           <tr><th scope="row" style="padding-right: 1.2rem;">eic member</th>
0099             <td>{% if authority.record.eic is True %}<strong>yes</strong>{% elif authority.record.eic is False %}<strong>no</strong>{% else %}not recorded{% endif %}{% if authority.record.eic_at %}, checked <span data-relative-time="{{ authority.record.eic_at }}"></span> (on {{ authority.record.eic_at|slice:":10" }}){% endif %}</td></tr>
0100           {% if authority.record.check_failed %}
0101           <tr><th scope="row" style="padding-right: 1.2rem; color: #a4001d;">Last check</th>
0102             <td style="color: #a4001d;"><strong>membership could not be checked</strong>
0103               (<span data-relative-time="{{ authority.record.check_failed_at }}"></span>):
0104               {{ authority.record.check_failed }}. Reading is unaffected; signing out
0105               and in again retries, and operations has been alerted.</td></tr>
0106           {% endif %}
0107         </table>
0108         {% if authority.may_act %}
0109         <p><strong>You may act on the production system.</strong></p>
0110         <p>
0111           {% if authority.record.eic is True %}
0112             Your GitHub account {{ authority.record.github|default:"" }} is a
0113             member of the eic organization.
0114           {% else %}
0115             Your account holds
0116             {{ authority.record.rights|default:"granted" }} rights on this
0117             system.
0118           {% endif %}
0119         </p>
0120         {% else %}
0121         <p><strong>You may read monitoring information. Actions against the
0122           production system are withheld.</strong></p>
0123         {% if authority.record.rights == 'read' %}
0124         <p>Your account is set to read on this system. An administrator can
0125           change that on the User admin page.</p>
0126         {% elif authority.record.eic is False %}
0127         <p>
0128           Your GitHub account {{ authority.record.github|default:"" }} is not a
0129           member of the eic organization. ePIC production monitoring requires
0130           membership for actions against the production system; reading
0131           monitoring information does not. The joining procedure is on the
0132           ePIC Software &amp; Computing
0133           <a href="https://eic.github.io/documentation/getstarted.html"
0134              target="_blank" rel="noopener">Get Started</a> page &mdash; see
0135           "Join GitHub". Once you have been added, sign in again and your
0136           account will work.
0137         </p>
0138         {% else %}
0139         <p>
0140           No eic organization membership has been recorded for this account
0141           yet. Membership is checked when you sign in through
0142           epic-devcloud.org. The joining procedure is on the ePIC Software
0143           &amp; Computing
0144           <a href="https://eic.github.io/documentation/getstarted.html"
0145              target="_blank" rel="noopener">Get Started</a> page &mdash; see
0146           "Join GitHub".
0147         </p>
0148         {% endif %}
0149         {% endif %}
0150 
0151         <h3 style="margin-top: 24px;">Roles</h3>
0152         <p>
0153           <span class="me-3"><input type="checkbox" class="form-check-input" disabled{% if authority.is_ops %} checked{% endif %}> Ops</span>
0154           <span class="me-3"><input type="checkbox" class="form-check-input" disabled{% if authority.is_pac %} checked{% endif %}> PAC</span>
0155           <span class="me-3"><input type="checkbox" class="form-check-input" disabled{% if user.is_staff or user.is_superuser %} checked{% endif %}> Admin</span>
0156         </p>
0157         <p class="text-muted">Ops: act on the production system, administer accounts, set request priorities. PAC: set request priorities, as a physics analysis coordinator. Admin: staff on this system. Roles are granted on the <a href="{% url 'monitor_app:user_admin' %}">User admin</a> page.</p>
0158 
0159         <h3 style="margin-top: 24px;">Change Password</h3>
0160         {% if is_tunnel %}
0161         <p><a class="btn btn-primary btn-sm" href="/prod/accounts/password_change/">Change password</a></p>
0162         <p>Password changes here apply to your epic-devcloud.org account only and do not propagate upstream.</p>
0163         {% else %}
0164         {% if messages %}
0165             <ul class="messages">
0166                 {% for message in messages %}
0167                     <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
0168                 {% endfor %}
0169             </ul>
0170         {% endif %}
0171         <form method="post" action="{% url 'monitor_app:account' %}?tab=account">
0172             {% csrf_token %}
0173             {{ form.as_p }}
0174             <button type="submit">Change Password</button>
0175         </form>
0176         {% endif %}
0177     </div>
0178     {% endif %}
0179 </div>
0180 {% endblock %}