Merge pull request #424 from CanineHQ/chriszhu__clean_up_resource_constraints

clean up resoruce constraint ui
This commit is contained in:
Chris Zhu
2025-11-16 13:19:38 -08:00
committed by GitHub
3 changed files with 7 additions and 5 deletions
@@ -8,7 +8,7 @@
action: "change->resource-constraints--form#toggleField",
resource_constraints__form_field_param: key
} %>
<span class="text-sm"><%= key.to_s.titleize %></span>
<span class="text-sm">Enable <%= key.to_s.gsub("cpu", "CPU").gsub("_", " ") %></span>
</label>
<div class="flex items-center">
<%= form.text_field(
@@ -8,7 +8,7 @@
action: "change->resource-constraints--form#toggleField",
resource_constraints__form_field_param: key
} %>
<span class="text-sm"><%= key.to_s.titleize %></span>
<span class="text-sm">Enable <%= key.to_s.titleize %></span>
</label>
<div class="flex items-center">
<%= form.text_field(
@@ -19,9 +19,11 @@
</div>
<% end %>
<% end %>
<div class="mt-2">
<%= button_to "Delete", project_service_resource_constraint_path(service.project, service), method: :delete, class: "btn btn-error btn-outline" %>
</div>
<% if resource_constraint.persisted? %>
<div class="mt-2">
<%= button_to "Delete", project_service_resource_constraint_path(service.project, service), method: :delete, class: "btn btn-error btn-outline" %>
</div>
<% end %>
<% else %>
<%= link_to "Enable Resource Constraints", new_project_service_resource_constraint_path(service.project, service), class: "btn btn-primary" %>
<% end %>