Skip to content

Commit

Permalink
Show community field in admin interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Sep 2, 2024
1 parent b20102f commit afd2c59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/dashboards/api_key_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class ApiKeyDashboard < Administrate::BaseDashboard
id: Field::Number,
bulk: YesNoBooleanField,
commercial: YesNoBooleanField,
community: YesNoBooleanField,
daily_limit: Field::Number,
disabled: YesNoBooleanField,
user: Field::BelongsTo,
Expand All @@ -35,6 +36,7 @@ class ApiKeyDashboard < Administrate::BaseDashboard
bulk
disabled
commercial
community
daily_limit
].freeze, T::Array[Symbol])

Expand All @@ -47,6 +49,7 @@ class ApiKeyDashboard < Administrate::BaseDashboard
expires_at
disabled
commercial
community
daily_limit
created_at
updated_at
Expand All @@ -58,6 +61,7 @@ class ApiKeyDashboard < Administrate::BaseDashboard
FORM_ATTRIBUTES = T.let(%i[
bulk
commercial
community
daily_limit
expires_at
disabled
Expand Down
2 changes: 2 additions & 0 deletions app/views/admin/api_usages/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<th>Email</th>
<th>Disabled</th>
<th>Commercial</th>
<th>Community</th>
<th>Daily Limit</th>
<th>Average daily requests</th>
</thead>
Expand All @@ -31,6 +32,7 @@
<td><%= link_to api_key.user.email, admin_api_key_path(api_key) %></td>
<td><%= link_to api_key.disabled.to_s, admin_api_key_path(api_key) %></td>
<td><%= link_to api_key.commercial.to_s, admin_api_key_path(api_key) %></td>
<td><%= link_to api_key.community.to_s, admin_api_key_path(api_key) %></td>
<td><%= link_to api_key.daily_limit.to_s, admin_api_key_path(api_key) %></td>
<td><%= requests.round %></td>
</tr>
Expand Down

0 comments on commit afd2c59

Please sign in to comment.