SMS gateway api service for android application
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
Min Zeya Phyo
2026-01-27 11:24:16 +06:30
parent c883fa7128
commit 1fdff55544
3 changed files with 789 additions and 4 deletions

View File

@@ -128,7 +128,7 @@
<%= msg.phone_number %>
</td>
<td class="px-6 py-4 text-sm text-gray-700">
<div class="max-w-xs truncate"><%= msg.message_body %></div>
<div class="max-w-md whitespace-pre-wrap break-words"><%= msg.message_body %></div>
</td>
<td class="whitespace-nowrap px-6 py-4 text-sm">
<% if msg.direction == "outbound" %>
@@ -209,8 +209,71 @@
<!-- Pagination -->
<% if @pagy.pages > 1 %>
<div class="border-t border-gray-200 px-6 py-4 bg-gray-50">
<div class="flex items-center justify-center">
<%== pagy_nav(@pagy) %>
<div class="flex items-center justify-between">
<!-- Page info -->
<div class="text-sm text-gray-700">
Showing
<span class="font-semibold"><%= @pagy.from %></span>
to
<span class="font-semibold"><%= @pagy.to %></span>
of
<span class="font-semibold"><%= @pagy.count %></span>
results
</div>
<!-- Pagination controls -->
<nav class="isolate inline-flex -space-x-px rounded-md shadow-sm" aria-label="Pagination">
<% if @pagy.prev %>
<%= link_to admin_logs_path(params.permit!.merge(page: @pagy.prev)),
class: "relative inline-flex items-center rounded-l-md px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 transition-colors" do %>
<i class="fas fa-chevron-left"></i>
<span class="sr-only">Previous</span>
<% end %>
<% else %>
<span class="relative inline-flex items-center rounded-l-md px-3 py-2 text-sm font-semibold text-gray-400 ring-1 ring-inset ring-gray-300 cursor-not-allowed">
<i class="fas fa-chevron-left"></i>
</span>
<% end %>
<% @pagy.series.each do |item| %>
<% if item.is_a?(Integer) %>
<% if item == @pagy.page %>
<span class="relative z-10 inline-flex items-center bg-blue-600 px-4 py-2 text-sm font-semibold text-white ring-1 ring-inset ring-blue-600"><%= item %></span>
<% else %>
<%= link_to item, admin_logs_path(params.permit!.merge(page: item)),
class: "relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 transition-colors" %>
<% end %>
<% elsif item == :gap %>
<span class="relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-700 ring-1 ring-inset ring-gray-300">...</span>
<% end %>
<% end %>
<% if @pagy.next %>
<%= link_to admin_logs_path(params.permit!.merge(page: @pagy.next)),
class: "relative inline-flex items-center rounded-r-md px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 transition-colors" do %>
<span class="sr-only">Next</span>
<i class="fas fa-chevron-right"></i>
<% end %>
<% else %>
<span class="relative inline-flex items-center rounded-r-md px-3 py-2 text-sm font-semibold text-gray-400 ring-1 ring-inset ring-gray-300 cursor-not-allowed">
<i class="fas fa-chevron-right"></i>
</span>
<% end %>
</nav>
<!-- Page size selector -->
<div class="text-sm text-gray-700">
<%= form_with url: admin_logs_path, method: :get, local: true, class: "inline-flex items-center gap-2" do |f| %>
<label for="items" class="font-medium">Per page:</label>
<%= select_tag :items,
options_for_select([10, 25, 50, 100], params[:items] || 50),
onchange: "this.form.submit()",
class: "rounded-md border-gray-300 text-sm focus:border-blue-500 focus:ring-blue-500" %>
<% params.except(:items, :authenticity_token).each do |key, value| %>
<%= hidden_field_tag key, value %>
<% end %>
<% end %>
</div>
</div>
</div>
<% end %>