2023-03-17 20:44:41 +08:00
|
|
|
<div class="connected-devices-description">
|
|
|
|
<h3><%= t("users.registrations.edit.connected_devices.title") %></h3>
|
2023-03-21 23:44:24 +08:00
|
|
|
<% if @connected_devices.present? %>
|
|
|
|
<div class="connected-devices-container">
|
|
|
|
<p><%= t("users.registrations.edit.connected_devices.description") %></p>
|
|
|
|
<div id="devicesTable">
|
|
|
|
<div class="devices-table-container">
|
|
|
|
<div class="devices-table">
|
|
|
|
<div class="table-header">
|
|
|
|
<div class="table-header-cell">
|
|
|
|
<%= t("users.registrations.edit.devices_table.device_name") %>
|
|
|
|
</div>
|
|
|
|
<div class="table-header-cell">
|
2023-04-11 03:57:43 +08:00
|
|
|
<%= t("users.registrations.edit.devices_table.last_seen") %>
|
2023-03-21 23:44:24 +08:00
|
|
|
</div>
|
|
|
|
<div class="table-header-cell">
|
|
|
|
</div>
|
2023-03-17 20:44:41 +08:00
|
|
|
</div>
|
2023-03-21 23:44:24 +08:00
|
|
|
<div class="table-body">
|
|
|
|
<% @connected_devices.each do |device| %>
|
|
|
|
<div class="table-row" data-id=<%= device.id%>>
|
|
|
|
<div class="table-body-cell">
|
|
|
|
<%= device.name %>
|
|
|
|
</div>
|
|
|
|
<div class="table-body-cell">
|
|
|
|
<%= l(device.last_seen_at, format: :full_date) %>
|
|
|
|
</div>
|
|
|
|
<div class="table-body-cell">
|
|
|
|
<button class="x-button" id="revokeDeviceBtn" data-toggle="modal" data-url=<%= connected_device_path(device.id) %> data-target="#deviceRevocationModal"><i class="fas fa-times"></i></button>
|
|
|
|
</div>
|
2023-03-17 20:44:41 +08:00
|
|
|
</div>
|
2023-03-21 23:44:24 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2023-03-17 20:44:41 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<p><%= t("users.registrations.edit.connected_devices.empty_state") %></p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<%= render partial: 'device_revocation_modal' %>
|
2023-03-21 23:44:24 +08:00
|
|
|
<%= javascript_include_tag 'users/connected_devices' %>
|