remote-support: Highlight if audit log data is stale or current.

Includes has_stale_audit_log boolean in the remote support view
data so that we can style the last audit log data for the remote
server to visually highlight if it is stale or current.
This commit is contained in:
Lauryn Menard 2024-03-08 12:55:59 +01:00 committed by Tim Abbott
parent 4e1e490b40
commit 4d470a52f8
4 changed files with 17 additions and 4 deletions

View File

@ -98,6 +98,7 @@ class MobilePushData:
@dataclass
class RemoteSupportData:
date_created: datetime
has_stale_audit_log: bool
plan_data: PlanData
sponsorship_data: SponsorshipData
user_data: RemoteCustomerUserCount
@ -376,6 +377,7 @@ def get_data_for_remote_support_view(billing_session: BillingSession) -> RemoteS
return RemoteSupportData(
date_created=date_created,
has_stale_audit_log=stale_audit_log_data,
plan_data=plan_data,
sponsorship_data=sponsorship_data,
user_data=user_data,

View File

@ -2,8 +2,7 @@
<p class="support-section-header">📅 Current plan information:</p>
{% if plan_data.warning %}
<div class="current-plan-data-missing">
{{ plan_data.warning }}
<br />
<b>{{ plan_data.warning }}</b><br />
</div>
{% endif %}
<b>Plan name</b>: {{ plan_data.current_plan.name }}<br />

View File

@ -68,7 +68,11 @@
<b>Has remote realms</b>: {{ remote_realms[remote_server.id] != [] }}<br />
<br />
<b>Max monthly messages</b>: {{ remote_server_to_max_monthly_messages[remote_server.id] }}<br />
<b>Last audit log update (UTC)</b>: {{ format_optional_datetime(remote_server.last_audit_log_update, True) }}<br />
{% if remote_servers_support_data[remote_server.id].has_stale_audit_log %}
<span class="stale-audit-log"><b>Last audit log update (UTC)</b>: {{ format_optional_datetime(remote_server.last_audit_log_update, True) }}</span><br />
{% else %}
<span class="current-audit-log"><b>Last audit log update (UTC)</b>: {{ format_optional_datetime(remote_server.last_audit_log_update, True) }}</span><br />
{% endif %}
<b>Plan type</b>: {{ get_plan_type_name(remote_server.plan_type) }}<br />
<b>Non-guest user count</b>: {{ remote_servers_support_data[remote_server.id].user_data.non_guest_user_count }}<br />
<b>Guest user count</b>: {{ remote_servers_support_data[remote_server.id].user_data.guest_user_count }}<br />

View File

@ -104,7 +104,6 @@ tr.admin td:first-child {
color: hsl(120deg 100% 33%);
}
.current-plan-data-missing,
.bad {
font-weight: bold;
color: hsl(0deg 100% 39%);
@ -176,6 +175,15 @@ tr.admin td:first-child {
.remote-label {
background-color: hsl(186deg 76% 36%);
}
.current-audit-log {
color: hsl(123deg 46% 34%);
}
.current-plan-data-missing,
.stale-audit-log {
color: hsl(2deg 64% 53%);
}
}
.reactivate-remote-server-button,