mirror of
https://github.com/czhu12/canine.git
synced 2025-12-16 16:35:10 -06:00
dsiable buttons on submission
This commit is contained in:
@@ -4,7 +4,7 @@ export default class extends Controller {
|
||||
static targets = ["radio", "partial"]
|
||||
|
||||
connect() {
|
||||
//this.toggle()
|
||||
this.toggle()
|
||||
}
|
||||
|
||||
toggle() {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div data-yaml-editor-target="editor" class="mt-2"></div>
|
||||
</div>
|
||||
<div class="form-footer">
|
||||
<%= form.submit "Save", class: "btn btn-primary" %>
|
||||
<%= form.submit "Save", class: "btn btn-primary", data: { turbo_submits_with: "Saving..." } %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="text-sm text-gray-500">
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-footer">
|
||||
<%= form.button "Create Add On", class: "btn btn-primary" %>
|
||||
<%= form.button "Create Add On", class: "btn btn-primary", data: { turbo_submits_with: "Creating..." } %>
|
||||
|
||||
<% if form.object.new_record? %>
|
||||
<%= link_to t("cancel"), add_ons_path, class: "btn btn-secondary" %>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="form-footer">
|
||||
<%= form.submit "Save", class: "btn btn-primary" %>
|
||||
<%= form.submit "Save", class: "btn btn-primary", data: { turbo_submits_with: "Saving..." } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
data: { turbo_frame: dom_id(cluster, "build_cloud") } do %>
|
||||
Cancel
|
||||
<% end %>
|
||||
<%= form.submit "Save Configuration", class: "btn btn-primary" %>
|
||||
<%= form.submit "Save Configuration", class: "btn btn-primary", data: { turbo_submits_with: "Saving..." } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="form-footer">
|
||||
<%= form.button "Submit", class: "btn btn-primary" %>
|
||||
<%= form.button "Submit", class: "btn btn-primary", data: { turbo_submits_with: "Submitting..." } %>
|
||||
|
||||
<% if form.object.new_record? %>
|
||||
<%= link_to t("cancel"), clusters_path, class: "btn btn-secondary" %>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<div data-yaml-editor-target="editor" class="mt-2"></div>
|
||||
</div>
|
||||
<div class="form-footer flex gap-2">
|
||||
<%= form.submit "Save", class: "btn btn-primary" %>
|
||||
<%= form.submit "Save", class: "btn btn-primary", data: { turbo_submits_with: "Saving..." } %>
|
||||
<button type="button"
|
||||
class="btn btn-outline"
|
||||
data-action="click->content-toggle#cancelEdit">
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<label class="label mb-2">
|
||||
<span class="label-text">Build driver</span>
|
||||
</label>
|
||||
<%= render "shared/partials/radio_selector", selected: build_configuration.driver, options: [
|
||||
<%= render "shared/partials/radio_selector", selected: build_configuration.driver || (Rails.application.config.local_mode ? "docker" : "cloud"), options: [
|
||||
{
|
||||
icon: "skill-icons:docker",
|
||||
name: "project[build_configuration][driver]",
|
||||
@@ -81,7 +81,7 @@
|
||||
{
|
||||
icon: "/images/logo-compact.webp",
|
||||
name: "project[build_configuration][driver]",
|
||||
label: "Canine Cloud",
|
||||
label: "Canine Cloud (recommended)",
|
||||
value: "cloud",
|
||||
description: "We'll build the images for you on our servers, for free."
|
||||
},
|
||||
@@ -102,7 +102,7 @@
|
||||
<label class="label mb-2">
|
||||
<span class="label-text">Build method</span>
|
||||
</label>
|
||||
<%= render "shared/partials/radio_selector", selected: build_configuration.build_type, options: [
|
||||
<%= render "shared/partials/radio_selector", selected: build_configuration.build_type || "dockerfile", options: [
|
||||
{
|
||||
icon: "skill-icons:docker",
|
||||
name: "project[build_configuration][build_type]",
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-footer">
|
||||
<%= form.button "Submit", class: "btn btn-primary" %>
|
||||
<%= form.button "Submit", class: "btn btn-primary", data: { disable_with: "Submitting..." } %>
|
||||
|
||||
<% if form.object.new_record? %>
|
||||
<%= link_to t("cancel"), projects_path, class: "btn btn-secondary", data: { turbo: false } %>
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-footer">
|
||||
<%= form.button "Submit", class: "btn btn-primary" %>
|
||||
<%= form.button "Submit", class: "btn btn-primary", data: { turbo_submits_with: "Submitting..." } %>
|
||||
|
||||
<% if form.object.new_record? %>
|
||||
<%= link_to t("cancel"), projects_path, class: "btn btn-secondary", data: { turbo: false } %>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="flex flex-row justify-between">
|
||||
<div>
|
||||
<button class="btn btn-neutral btn-outline" type="button" data-action="environment-variables#add">Add new environment variable</button>
|
||||
<%= form.submit "Save", class: "btn btn-primary" %>
|
||||
<%= form.submit "Save", class: "btn btn-primary", data: { turbo_submits_with: "Saving..." } %>
|
||||
</div>
|
||||
<%= link_to "Download as .env", download_project_environment_variables_path(@project), class: "btn btn-outline", target: "_blank" %>
|
||||
</div>
|
||||
@@ -34,7 +34,7 @@
|
||||
'textarea-autogrow-resize-debounce-delay-value': "500"
|
||||
}
|
||||
) %>
|
||||
<%= form.submit "Add variables", class: "btn btn-primary" %>
|
||||
<%= form.submit "Add variables", class: "btn btn-primary", data: { turbo_submits_with: "Adding..." } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,6 +26,6 @@
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-footer">
|
||||
<%= form.submit "Save", class: "btn btn-primary" %>
|
||||
<%= form.submit "Save", class: "btn btn-primary", data: { turbo_submits_with: "Saving..." } %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-footer mt-6 flex gap-2">
|
||||
<%= form.submit @service.pod_yaml.present? ? "Update Pod Template" : "Save Pod Template", class: "btn btn-primary" %>
|
||||
<%= form.submit @service.pod_yaml.present? ? "Update Pod Template" : "Save Pod Template", class: "btn btn-primary", data: { turbo_submits_with: "Saving..." } %>
|
||||
<button type="button"
|
||||
class="btn btn-outline"
|
||||
data-action="click->content-toggle#cancelEdit">
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-footer">
|
||||
<%= form.submit class: "btn btn-primary" %>
|
||||
<%= form.submit class: "btn btn-primary", data: { turbo_submits_with: "Saving..." } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -124,7 +124,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-footer">
|
||||
<%= form.button "Submit", class: "btn btn-primary", data: { turbo: "false" } %>
|
||||
<%= form.button "Submit", class: "btn btn-primary", data: { turbo: "false", disable_with: "Submitting..." } %>
|
||||
<%= link_to "Cancel", project_services_path(@project), class: "btn btn-outline" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
<%= render "projects/services/resource_constraints/form", form: form, resource_constraint: %>
|
||||
<% if resource_constraint.persisted? %>
|
||||
<div class="form-footer mt-6">
|
||||
<%= form.submit "Update Resource Constraints", class: "btn btn-primary" %>
|
||||
<%= form.submit "Update Resource Constraints", class: "btn btn-primary", data: { turbo_submits_with: "Updating..." } %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="form-footer mt-6">
|
||||
<%= link_to "Cancel", project_service_resource_constraint_path(service.project, service), class: "btn btn-outline" %>
|
||||
<%= form.submit "Create Resource Constraints", class: "btn btn-primary" %>
|
||||
<%= form.submit "Create Resource Constraints", class: "btn btn-primary", data: { turbo_submits_with: "Creating..." } %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-footer">
|
||||
<%= form.button "Submit", class: "btn btn-primary" %>
|
||||
<%= form.button "Submit", class: "btn btn-primary", data: { turbo_submits_with: "Submitting..." } %>
|
||||
|
||||
<% if form.object.new_record? %>
|
||||
<%= link_to t("cancel"), projects_path, class: "btn btn-secondary" %>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-footer">
|
||||
<%= form.button "Submit", class: "btn btn-primary" %>
|
||||
<%= form.button "Submit", class: "btn btn-primary", data: { turbo_submits_with: "Submitting..." } %>
|
||||
|
||||
<% if form.object.new_record? %>
|
||||
<%= link_to t("cancel"), projects_path, class: "btn btn-secondary" %>
|
||||
|
||||
Reference in New Issue
Block a user