2026-06-12 15:40:12 -04:00
|
|
|
<form action="/admin/services" method="POST">
|
|
|
|
|
|
|
|
|
|
<div class="text-4xl mb-10">
|
|
|
|
|
Services
|
|
|
|
|
</div>
|
2026-06-17 22:30:32 -04:00
|
|
|
<% unless @editing %>
|
2026-06-12 15:40:12 -04:00
|
|
|
<div class="w-19/20 flex flex-none items-center justify-between ml-5 mb-2">
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
|
|
|
|
|
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="flex flex-col ml-10 space-y-2">
|
|
|
|
|
<% @services.each_with_index do |serv, index| %>
|
|
|
|
|
<div class="flex space-x-2">
|
|
|
|
|
<input type="hidden" name="services[][id]" value="<%= serv.id %>">
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
|
|
|
|
<input type="text"
|
2026-06-17 22:30:32 -04:00
|
|
|
class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
|
2026-06-12 15:40:12 -04:00
|
|
|
id="serv_<%= index %>_name"
|
|
|
|
|
name="services[][name]"
|
|
|
|
|
value="<%= serv.name %>"
|
2026-06-17 22:30:32 -04:00
|
|
|
<%= 'readonly' if @editing %> >
|
2026-06-12 15:40:12 -04:00
|
|
|
<% if index == @services.length - 1 %>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Name</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
2026-06-17 22:30:32 -04:00
|
|
|
<select class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'name="services[][service_type_id]" id="service_type_select" <%= 'disabled' if @editing %> >
|
2026-06-12 15:40:12 -04:00
|
|
|
<option value="">Select a Service Type</option>
|
|
|
|
|
<% @service_types.each do |service_type| %>
|
|
|
|
|
<option value="<%= service_type.id %>" <%= "selected" if serv.service_type_id == service_type.id %>><%= service_type.name %></option>
|
|
|
|
|
<% end %>
|
|
|
|
|
</select>
|
|
|
|
|
<% if index == @services.length - 1 %>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Service Type</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
2026-06-17 22:30:32 -04:00
|
|
|
<select class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'name="services[][machine_id]" id="machine_select" <%= 'disabled' if @editing %> >
|
2026-06-12 15:40:12 -04:00
|
|
|
<option value="">Select a Service Type</option>
|
|
|
|
|
<% @machines.each do |machine| %>
|
|
|
|
|
<option value="<%= machine.id %>" <%= "selected" if serv.machine_id == machine.id %>><%= machine.name %></option>
|
|
|
|
|
<% end %>
|
|
|
|
|
</select>
|
|
|
|
|
<% if index == @services.length - 1 %>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Machine</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
|
|
|
|
<input type="text"
|
2026-06-17 22:30:32 -04:00
|
|
|
class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
|
2026-06-12 15:40:12 -04:00
|
|
|
id="serv_<%= index %>_subdomain"
|
|
|
|
|
name="services[][subdomain]"
|
|
|
|
|
value="<%= serv.subdomain%>"
|
2026-06-17 22:30:32 -04:00
|
|
|
<%= 'readonly' if @editing %> >
|
2026-06-12 15:40:12 -04:00
|
|
|
<% if index == @services.length - 1 %>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Subdomain</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
|
|
|
|
<input type="text"
|
2026-06-17 22:30:32 -04:00
|
|
|
class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
|
2026-06-12 15:40:12 -04:00
|
|
|
id="serv_<%= index %>_port"
|
|
|
|
|
name="services[][port]"
|
|
|
|
|
value="<%= serv.port%>"
|
2026-06-17 22:30:32 -04:00
|
|
|
<%= 'readonly' if @editing %> >
|
2026-06-12 15:40:12 -04:00
|
|
|
<% if index == @services.length - 1 %>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Port</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
|
|
|
|
<input type="text"
|
2026-06-17 22:30:32 -04:00
|
|
|
class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
|
2026-06-12 15:40:12 -04:00
|
|
|
id="serv_<%= index %>_url_path"
|
|
|
|
|
name="services[][url_path]"
|
|
|
|
|
value="<%= serv.url_path%>"
|
2026-06-17 22:30:32 -04:00
|
|
|
<%= 'readonly' if @editing %> >
|
2026-06-12 15:40:12 -04:00
|
|
|
<% if index == @services.length - 1 %>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">URL Path (optional)</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col space-y-2 mt-10">
|
2026-06-17 22:30:32 -04:00
|
|
|
<% if @editing %>
|
|
|
|
|
<div class="w-19/20 flex ml-10 space-x-5">
|
|
|
|
|
<a href="/admin/services/edit" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#<%= @dark_hex %>] bg-[#<%= @light_hex %>] border-2 border-[#<%= @light_hex %>] rounded-lg hover:text-[#<%= @accent_hex %>] hover:bg-[#<%= @dark_hex %>] hover:border-[#<%= @accent_hex %>] transition-colors duration-200">
|
2026-06-12 15:40:12 -04:00
|
|
|
Edit/Add Services
|
|
|
|
|
</a>
|
2026-06-17 22:30:32 -04:00
|
|
|
<a href="/admin" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#<%= @dark_hex %>] bg-[#F80800] border-2 border-[#F80800] rounded-lg hover:text-[#F80800] hover:bg-[#<%= @dark_hex %>] hover:border-[#F80800] transition-colors duration-200">
|
|
|
|
|
Back To Admin
|
|
|
|
|
</a>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
<% else %>
|
|
|
|
|
<div class="w-19/20 flex flex-none items-center justify-between ml-5 mb-2">
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">New</div>
|
|
|
|
|
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
<div class="flex space-x-2 mb-10 ml-10"">
|
|
|
|
|
<input type="hidden" name="services[][id]" value="">
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
|
|
|
|
<input type="text"
|
2026-06-17 22:30:32 -04:00
|
|
|
class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
|
2026-06-12 15:40:12 -04:00
|
|
|
id="serv_new_name"
|
|
|
|
|
name="services[][name]"
|
|
|
|
|
value="">
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="text-[#<%= @accent_hex %>]">Name</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
2026-06-17 22:30:32 -04:00
|
|
|
<select class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center" name="services[][service_type_id]" id="service_type_select" <%= 'disabled' if @editing %> >
|
2026-06-12 15:40:12 -04:00
|
|
|
<option value="">Select a Service Type</option>
|
|
|
|
|
<% @service_types.each do |service_type| %>
|
|
|
|
|
<option value="<%= service_type.id %>"><%= service_type.name %></option>
|
|
|
|
|
<% end %>
|
|
|
|
|
</select>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="text-[#<%= @accent_hex %>]">Service Type</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
2026-06-17 22:30:32 -04:00
|
|
|
<select class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center" name="services[][machine_id]" id="machine_select" <%= 'disabled' if @editing %> >
|
2026-06-12 15:40:12 -04:00
|
|
|
<option value="">Select a Service Type</option>
|
|
|
|
|
<% @machines.each do |machine| %>
|
|
|
|
|
<option value="<%= machine.id %>"><%= machine.name %></option>
|
|
|
|
|
<% end %>
|
|
|
|
|
</select>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="text-[#<%= @accent_hex %>]">Machine</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
|
|
|
|
<input type="text"
|
2026-06-17 22:30:32 -04:00
|
|
|
class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
|
2026-06-12 15:40:12 -04:00
|
|
|
id="serv_new_subdomain"
|
|
|
|
|
name="services[][subdomain]"
|
|
|
|
|
value="">
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="text-[#<%= @accent_hex %>]">Subdomain</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
|
|
|
|
<input type="text"
|
2026-06-17 22:30:32 -04:00
|
|
|
class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
|
2026-06-12 15:40:12 -04:00
|
|
|
id="serv_new_port"
|
|
|
|
|
name="services[][port]"
|
|
|
|
|
value="">
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="text-[#<%= @accent_hex %>]">Port</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col items-center">
|
|
|
|
|
<input type="text"
|
2026-06-17 22:30:32 -04:00
|
|
|
class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
|
2026-06-12 15:40:12 -04:00
|
|
|
id="serv_new_url_path"
|
|
|
|
|
name="services[][url_path]"
|
|
|
|
|
value="">
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="text-[#<%= @accent_hex %>]">URL Path (optional)</div>
|
2026-06-12 15:40:12 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
2026-06-17 22:30:32 -04:00
|
|
|
<div class="w-19/20 flex ml-10 space-x-5">
|
|
|
|
|
<button type="submit" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#<%= @dark_hex %>] bg-[#<%= @light_hex %>] border-2 border-[#<%= @light_hex %>] rounded-lg hover:text-[#<%= @accent_hex %>] hover:bg-[#<%= @dark_hex %>] hover:border-[#<%= @accent_hex %>] transition-colors duration-200">
|
2026-06-12 15:40:12 -04:00
|
|
|
Save Services
|
|
|
|
|
</button>
|
2026-06-17 22:30:32 -04:00
|
|
|
<a href="/admin/services" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#<%= @dark_hex %>] bg-[#F80800] border-2 border-[#F80800] rounded-lg hover:text-[#F80800] hover:bg-[#<%= @dark_hex %>] hover:border-[#F80800] transition-colors duration-200">
|
2026-06-12 15:40:12 -04:00
|
|
|
Cancel
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</form>
|