Files
ubicloud/views/components/pg_state_label.erb
Burak Yucesoy fcb33a7ebf Postgres UI
This commits adds UI for basic PostgreSQL functionality like listing, viewing,
creating and deleting PostgreSQL resources. We will add UI for other features
like changing superuser password or restart separately.
2023-11-15 16:20:25 +01:00

19 lines
586 B
Plaintext

<% case state %>
<% when "running" %>
<% color = "bg-green-100 text-green-800" %>
<% when "creating" %>
<% color = "bg-yellow-100 text-yellow-800" %>
<% when "deleting" %>
<% color = "bg-red-100 text-red-800" %>
<% else %>
<% color = "bg-slate-100 text-slate-800" %>
<% end %>
<% extra_class = defined?(extra_class) ? extra_class : nil %>
<span
class="inline-flex items-baseline rounded-full px-2 text-xs font-semibold leading-5 <%= color %> <%= extra_class %>"
>
<%== render("components/icon", locals: { name: "dot", classes: "mr-1.5 h-2 w-2" }) %>
<%= state %>
</span>