v1 finished

This commit is contained in:
2026-06-17 22:30:32 -04:00
parent 521653e5de
commit d5cf541f6b
13 changed files with 1750 additions and 169 deletions
+33 -19
View File
@@ -11,6 +11,13 @@ class ApplicationController < Sinatra::Base
set :port, 4567 set :port, 4567
end end
before do
local_network = LocalNetwork.first
@dark_hex = local_network.primary_dark_hex || "140029"
@light_hex = local_network.primary_light_hex || "8000FF"
@accent_hex = local_network.accent_hex || "2FD400"
end
get '/' do get '/' do
client_ip = request.ip.to_s client_ip = request.ip.to_s
puts client_ip puts client_ip
@@ -37,13 +44,13 @@ class ApplicationController < Sinatra::Base
get '/admin/local_network' do get '/admin/local_network' do
@local_network = LocalNetwork.first || LocalNetwork.new @local_network = LocalNetwork.first || LocalNetwork.new
@is_readonly = true @editing = true
erb :'admin/local_network/index' erb :'admin/local_network/index'
end end
get '/admin/local_network/edit' do get '/admin/local_network/edit' do
@local_network = LocalNetwork.first || LocalNetwork.create @local_network = LocalNetwork.first || LocalNetwork.create
@is_readonly = false @editing = false
erb :'admin/local_network/index' erb :'admin/local_network/index'
end end
@@ -58,13 +65,13 @@ class ApplicationController < Sinatra::Base
get '/admin/machines' do get '/admin/machines' do
@machines = Machine.all @machines = Machine.all
@is_readonly = true @editing = true
erb :'admin/machines/index' erb :'admin/machines/index'
end end
get '/admin/machines/edit' do get '/admin/machines/edit' do
@machines = Machine.all @machines = Machine.all
@is_readonly = false @editing = false
erb :'admin/machines/index' erb :'admin/machines/index'
end end
@@ -83,37 +90,44 @@ class ApplicationController < Sinatra::Base
get '/admin/service_types' do get '/admin/service_types' do
@service_types = ServiceType.all @service_types = ServiceType.all
@is_readonly = true @editing = true
erb :'admin/service_types/index' erb :'admin/service_types/index'
end end
get '/admin/service_types/edit' do get '/admin/service_types/edit' do
@service_types = ServiceType.all @service_types = ServiceType.all
@is_readonly = false @editing = false
erb :'admin/service_types/index' erb :'admin/service_types/index'
end end
get '/admin/service_types/media' do get '/admin/service_types/:name' do
@service_type = ServiceType.media type_name = params[:name]
@service_type = ServiceType.public_send(type_name)
# @service_type = ServiceType.media
erb :'admin/service_types/position' erb :'admin/service_types/position'
end end
get '/admin/service_types/admin' do # get '/admin/service_types/media' do
@service_type = ServiceType.admin # @service_type = ServiceType.media
erb :'admin/service_types/position' # erb :'admin/service_types/position'
end # end
get '/admin/service_types/support' do # get '/admin/service_types/admin' do
@service_type = ServiceType.support # @service_type = ServiceType.admin
erb :'admin/service_types/position' # erb :'admin/service_types/position'
end # end
# get '/admin/service_types/support' do
# @service_type = ServiceType.support
# erb :'admin/service_types/position'
# end
post '/admin/service_types' do post '/admin/service_types' do
puts params puts params
params[:service_types].each do |service_type_data| params[:service_types].each do |service_type_data|
if service_type_data[:id].empty? && service_type_data[:name].present? if service_type_data[:id].empty? && service_type_data[:name].present?
ServiceType.create(service_type_data) ServiceType.create(service_type_data)
elsif service_type_data[:id].present? elsif service_type_data[:id].present? && service_type_data[:name].present?
@service_type = ServiceType.find(service_type_data[:id]) @service_type = ServiceType.find(service_type_data[:id])
@service_type.update(service_type_data) @service_type.update(service_type_data)
end end
@@ -125,7 +139,7 @@ class ApplicationController < Sinatra::Base
@services = Service.all @services = Service.all
@service_types = ServiceType.all @service_types = ServiceType.all
@machines = Machine.all @machines = Machine.all
@is_readonly = true @editing = true
erb :'admin/services/index' erb :'admin/services/index'
end end
@@ -133,7 +147,7 @@ class ApplicationController < Sinatra::Base
@services = Service.all @services = Service.all
@service_types = ServiceType.all @service_types = ServiceType.all
@machines = Machine.all @machines = Machine.all
@is_readonly = false @editing = false
erb :'admin/services/index' erb :'admin/services/index'
end end
+11 -6
View File
@@ -1,23 +1,28 @@
<div class="w-full flex flex-col items-center">
<div class="text-4xl mb-10"> <div class="text-4xl mb-10">
Network Directory Admin Network Directory Admin
</div> </div>
<div class="w-1/2 flex flex-col space-y-10 ml-20 mt-10"> <div class="flex flex-col space-y-10 mt-10">
<a href="/admin/local_network" class="inline-block w-50 px-3 py-1 text-center font-semibold text-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <a href="/admin/local_network" class="inline-block w-50 px-3 py-1 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">
Local Network Local Network
</a> </a>
<a href="/admin/machines" class="inline-block w-50 px-3 py-1 text-center font-semibold text-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <a href="/admin/machines" class="inline-block w-50 px-3 py-1 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">
Machines Machines
</a> </a>
<a href="/admin/service_types" class="inline-block w-50 px-3 py-1 text-center font-semibold text-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <a href="/admin/service_types" class="inline-block w-50 px-3 py-1 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">
Service Types Service Types
</a> </a>
<a href="/admin/services" class="inline-block w-50 px-3 py-1 text-center font-semibold text-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <a href="/admin/services" class="inline-block w-50 px-3 py-1 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">
Services Services
</a> </a>
</div> <a href="/" 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 Directory
</a>
</div>
</div>
+33 -15
View File
@@ -3,10 +3,10 @@
<div class="text-4xl mb-10"> <div class="text-4xl mb-10">
Local Network Settings Local Network Settings
</div> </div>
<% unless @is_readonly %> <% unless @editing %>
<div class="w-1/2 flex flex-none items-center justify-between ml-5 mb-2"> <div class="w-1/2 flex flex-none items-center justify-between ml-5 mb-2">
<div class="flex-none text-xl text-[#2FD400]">Edit</div> <div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
<div class="grow h-[1px] mt-1 bg-[#2FD400]"></div> <div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
</div> </div>
<% end %> <% end %>
<div class="flex ml-10 space-x-2"> <div class="flex ml-10 space-x-2">
@@ -14,35 +14,53 @@
<input type="hidden" name="local_network[id]" value="<%= @local_network.id %>"> <input type="hidden" name="local_network[id]" value="<%= @local_network.id %>">
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input class="h-8 border-2 border-[#8000FF] rounded-lg text-center" type="text" id="local_network_name" name="local_network[name]" value="<%= @local_network.name %>" <%= 'readonly' if @is_readonly %> > <input class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>' type="text" id="local_network_name" name="local_network[name]" value="<%= @local_network.name %>" <%= 'readonly' if @editing %> >
<div class="text-[#2FD400]">Name</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Name</div>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input class="h-8 border-2 border-[#8000FF] rounded-lg text-center" type="text" id="local_network_subnet" name="local_network[subnet]" value="<%= @local_network.subnet %>" <%= 'readonly' if @is_readonly %> > <input class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>' type="text" id="local_network_subnet" name="local_network[subnet]" value="<%= @local_network.subnet %>" <%= 'readonly' if @editing %> >
<div class="text-[#2FD400]">Subnet</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Subnet</div>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input class="h-8 border-2 border-[#8000FF] rounded-lg text-center" type="text" id="local_network_tld" name="local_network[tld]" value="<%= @local_network.tld %>" <%= 'readonly' if @is_readonly %> > <input class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>' type="text" id="local_network_tld" name="local_network[tld]" value="<%= @local_network.tld %>" <%= 'readonly' if @editing %> >
<div class="text-[#2FD400]">Top Level Domain</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Top Level Domain</div>
</div>
<div class="flex flex-col items-center">
<input class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= @editing ? "text-[##{@local_network.primary_dark_hex}] bg-white" : "text-[##{@accent_hex}]" %>' type="text" id="local_network_primary_dark_hex" name="local_network[primary_dark_hex]" value="<%= @local_network.primary_dark_hex %>" <%= 'readonly' if @editing %> >
<div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Site Primary Dark Hex</div>
</div>
<div class="flex flex-col items-center">
<input class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= @editing ? "text-[##{@local_network.primary_light_hex}]" : "text-[##{@accent_hex}]" %>' type="text" id="local_network_primary_light_hex" name="local_network[primary_light_hex]" value="<%= @local_network.primary_light_hex %>" <%= 'readonly' if @editing %> >
<div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Site Primary Light Hex</div>
</div>
<div class="flex flex-col items-center">
<input class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= @editing ? "text-[##{@local_network.accent_hex}]" : "text-[##{@accent_hex}]" %>' type="text" id="local_network_accent_hex" name="local_network[accent_hex]" value="<%= @local_network.accent_hex %>" <%= 'readonly' if @editing %> >
<div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Site Accent Hex</div>
</div> </div>
</div> </div>
<div class="flex flex-col space-y-2 mt-10"> <div class="flex flex-col space-y-2 mt-10">
<% if @is_readonly %> <% if @editing %>
<div class="w-1/2 flex justify-end space-x-5"> <div class="w-1/2 flex ml-10 space-x-5">
<a href="/admin/local_network/edit" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <a href="/admin/local_network/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">
Edit Local Network Edit Local Network
</a> </a>
<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>
</div> </div>
<% else %> <% else %>
<div class="w-1/2 flex justify-end space-x-5"> <div class="w-1/2 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-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <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">
Save Local Network Save Local Network
</button> </button>
<a href="/admin/local_network" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#140029] bg-[#F80800] border-2 border-[#F80800] rounded-lg hover:text-[#F80800] hover:bg-[#140029] hover:border-[#F80800] transition-colors duration-200"> <a href="/admin/local_network" 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">
Cancel Cancel
</a> </a>
</div> </div>
+38 -35
View File
@@ -3,10 +3,10 @@
<div class="text-4xl mb-10"> <div class="text-4xl mb-10">
Network Machines Network Machines
</div> </div>
<% unless @is_readonly %> <% unless @editing %>
<div class="w-2/3 flex flex-none items-center justify-between ml-5 mb-2"> <div class="w-2/3 flex flex-none items-center justify-between ml-5 mb-2">
<div class="flex-none text-xl text-[#2FD400]">Edit</div> <div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
<div class="grow h-[1px] mt-1 bg-[#2FD400]"></div> <div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
</div> </div>
<% end %> <% end %>
<div class="flex flex-col ml-10 space-y-2"> <div class="flex flex-col ml-10 space-y-2">
@@ -16,49 +16,49 @@
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="mach_<%= index %>_name" id="mach_<%= index %>_name"
name="machines[][name]" name="machines[][name]"
value="<%= mach.name %>" value="<%= mach.name %>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @machines.length - 1 %> <% if index == @machines.length - 1 %>
<div class="text-[#2FD400]">Name</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Name</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="mach_<%= index %>_domain" id="mach_<%= index %>_domain"
name="machines[][domain]" name="machines[][domain]"
value="<%= mach.domain %>" value="<%= mach.domain %>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @machines.length - 1 %> <% if index == @machines.length - 1 %>
<div class="text-[#2FD400]">Domain</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Domain</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="mach_<%= index %>_local_ip_octet" id="mach_<%= index %>_local_ip_octet"
name="machines[][local_ip_octet]" name="machines[][local_ip_octet]"
value="<%= mach.local_ip_octet %>" value="<%= mach.local_ip_octet %>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @machines.length - 1 %> <% if index == @machines.length - 1 %>
<div class="text-[#2FD400]">Local IP Octet</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Local IP Octet</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="mach_<%= index %>_tailscale_ip" id="mach_<%= index %>_tailscale_ip"
name="machines[][tailscale_ip]" name="machines[][tailscale_ip]"
value="<%= mach.tailscale_ip %>" value="<%= mach.tailscale_ip %>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @machines.length - 1 %> <% if index == @machines.length - 1 %>
<div class="text-[#2FD400]">Tailscale IP</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Tailscale IP</div>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -67,65 +67,68 @@
<div class="flex flex-col space-y-2 mt-10"> <div class="flex flex-col space-y-2 mt-10">
<% if @is_readonly %> <% if @editing %>
<div class="w-2/3 flex justify-end space-x-5"> <div class="w-2/3 flex ml-10 space-x-5">
<a href="/admin/machines/edit" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <a href="/admin/machines/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">
Edit/Add Machines Edit/Add Machines
</a> </a>
<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>
</div> </div>
<% else %> <% else %>
<div class="w-2/3 flex flex-none items-center justify-between ml-5 mb-2"> <div class="w-2/3 flex flex-none items-center justify-between ml-5 mb-2">
<div class="flex-none text-xl text-[#2FD400]">New</div> <div class="flex-none text-xl text-[#<%= @accent_hex %>]">New</div>
<div class="grow h-[1px] mt-1 bg-[#2FD400]"></div> <div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
</div> </div>
<div class="flex space-x-2 mb-10 ml-10"> <div class="flex space-x-2 mb-10 ml-10">
<input type="hidden" name="machines[][id]" value=""> <input type="hidden" name="machines[][id]" value="">
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="mach_new_name" id="mach_new_name"
name="machines[][name]" name="machines[][name]"
value="" value=""
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<label for="mach_new_name" class="text-[#2FD400]">Name</label> <label for="mach_new_name" class="text-[#<%= @accent_hex %>]">Name</label>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="mach_new_domain" id="mach_new_domain"
name="machines[][domain]" name="machines[][domain]"
value="" value=""
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<label for="mach_new_domain" class="text-[#2FD400]">Domain</label> <label for="mach_new_domain" class="text-[#<%= @accent_hex %>]">Domain</label>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="mach_new_local_ip_octet" id="mach_new_local_ip_octet"
name="machines[][local_ip_octet]" name="machines[][local_ip_octet]"
value="" value=""
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<label for="mach_new_local_ip_octet" class="text-[#2FD400]">Local IP Octet</label> <label for="mach_new_local_ip_octet" class="text-[#<%= @accent_hex %>]">Local IP Octet</label>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="mach_new_tailscale_ip" id="mach_new_tailscale_ip"
name="machines[][tailscale_ip]" name="machines[][tailscale_ip]"
value="" value=""
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<label for="mach_new_tailscale_ip" class="text-[#2FD400]">Tailscale IP</label> <label for="mach_new_tailscale_ip" class="text-[#<%= @accent_hex %>]">Tailscale IP</label>
</div> </div>
</div> </div>
<div class="w-2/3 flex justify-end space-x-5"> <div class="w-2/3 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-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <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">
Save Machines Save Machines
</button> </button>
<a href="/admin/machines" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#140029] bg-[#F80800] border-2 border-[#F80800] rounded-lg hover:text-[#F80800] hover:bg-[#140029] hover:border-[#F80800] transition-colors duration-200"> <a href="/admin/machines" 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">
Cancel Cancel
</a> </a>
</div> </div>
+41 -23
View File
@@ -3,10 +3,10 @@
<div class="text-4xl mb-10"> <div class="text-4xl mb-10">
Service Types Service Types
</div> </div>
<% unless @is_readonly %> <% unless @editing %>
<div class="w-1/2 flex flex-none items-center justify-between ml-5 mb-2"> <div class="w-1/2 flex flex-none items-center justify-between ml-5 mb-2">
<div class="flex-none text-xl text-[#2FD400]">Edit</div> <div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
<div class="grow h-[1px] mt-1 bg-[#2FD400]"></div> <div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
</div> </div>
<% end %> <% end %>
<div class="flex flex-col ml-10 space-y-2"> <div class="flex flex-col ml-10 space-y-2">
@@ -16,72 +16,90 @@
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="servt_<%= index %>_name" id="servt_<%= index %>_name"
name="service_types[][name]" name="service_types[][name]"
value="<%= servt.name %>" value="<%= servt.name %>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @service_types.length - 1 %> <% if index == @service_types.length - 1 %>
<div class="text-[#2FD400]">Name</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Name</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= @editing ? "text-[##{servt.hex_color}]" : "text-[##{@accent_hex}]" %>'
id="servt_<%= index %>_hex_color" id="servt_<%= index %>_hex_color"
name="service_types[][hex_color]" name="service_types[][hex_color]"
value="<%= servt.hex_color %>" value="<%= servt.hex_color %>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @service_types.length - 1 %> <% if index == @service_types.length - 1 %>
<div class="text-[#2FD400]">Hex Color</div> <div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Hex Color</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center">
<div class="h-8 w-40 border-2 border-[#<%= @light_hex %>] rounded-lg text-center">
<%= servt.services.count %>
</div>
<% if index == @service_types.length - 1 %>
<div class='<%= "text-[##{@accent_hex}]" if @editing %> text-center'>Services Count</div>
<% end %>
</div>
<div class="flex flex-col items-center">
<a href="/admin/service_types/<%= servt.name.downcase %>" class="h-8 w-80 border-2 border-[#<%= @light_hex %>] rounded-lg text-center font-semibold text-[#<%= @accent_hex %>] hover:text-[#<%= @light_hex %>]">
Update <%= servt.name %> Services Order
</a>
</div>
</div> </div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col space-y-2 mt-10"> <div class="flex flex-col space-y-2 mt-10">
<% if @is_readonly %> <% if @editing %>
<div class="w-1/2 flex justify-end space-x-5"> <div class="w-1/2 flex ml-10 space-x-5">
<a href="/admin/service_types/edit" class="inline-block w-60 px-3 py-1 mt-20 text-center font-semibold text-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <a href="/admin/service_types/edit" class="inline-block w-60 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">
Edit/Add Service Types Edit/Add Service Types
</a> </a>
<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>
</div> </div>
<% else %> <% else %>
<div class="w-1/2 flex flex-none items-center justify-between ml-5 mb-2"> <div class="w-1/2 flex flex-none items-center justify-between ml-5 mb-2">
<div class="flex-none text-xl text-[#2FD400]">New</div> <div class="flex-none text-xl text-[#<%= @accent_hex %>]">New</div>
<div class="grow h-[1px] mt-1 bg-[#2FD400]"></div> <div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
</div> </div>
<div class="flex space-x-2 mb-10 ml-10"> <div class="flex space-x-2 mb-10 ml-10">
<input type="hidden" name="service_types[][id]" value=""> <input type="hidden" name="service_types[][id]" value="">
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="servt_new_name" id="servt_new_name"
name="service_types[][name]" name="service_types[][name]"
value="" value=""
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<label for="servt_new_name" class="text-[#2FD400]">Name</label> <label for="servt_new_name" class="text-[#<%= @accent_hex %>]">Name</label>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="servt_new_hex_color" id="servt_new_hex_color"
name="service_types[][hex_color]" name="service_types[][hex_color]"
value="" value=""
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<label for="servt_new_hex_color" class="text-[#2FD400]">Hex Color</label> <label for="servt_new_hex_color" class="text-[#<%= @accent_hex %>]">Hex Color</label>
</div> </div>
</div> </div>
<div class="w-1/2 flex justify-end space-x-5"> <div class="w-1/2 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-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <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">
Save Service Types Save Service Types
</button> </button>
<a href="/admin/service_types" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#140029] bg-[#F80800] border-2 border-[#F80800] rounded-lg hover:text-[#F80800] hover:bg-[#140029] hover:border-[#F80800] transition-colors duration-200"> <a href="/admin/service_types" 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">
Cancel Cancel
</a> </a>
</div> </div>
+7 -7
View File
@@ -10,33 +10,33 @@
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="service_<%= index %>_name" id="service_<%= index %>_name"
name="services[][name]" name="services[][name]"
value="<%= service.name %>" value="<%= service.name %>"
readonly > readonly >
<% if index == @service_type.services.length - 1 %> <% if index == @service_type.services.length - 1 %>
<div class="text-[#2FD400]">Name</div> <div class="">Name</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center text-[#<%= @accent_hex %>]"
id="service_<%= index %>_position" id="service_<%= index %>_position"
name="services[][position]" name="services[][position]"
value="<%= service.position %>" > value="<%= service.position %>" >
<% if index == @service_type.services.length - 1 %> <% if index == @service_type.services.length - 1 %>
<div class="text-[#2FD400]">Position</div> <div class="">Position</div>
<% end %> <% end %>
</div> </div>
</div> </div>
<% end %> <% end %>
<div class="w-1/2 flex justify-end space-x-5"> <div class="w-1/2 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-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <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">
Save Service Positions Save Service Positions
</button> </button>
<a href="/admin/service_types" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#140029] bg-[#F80800] border-2 border-[#F80800] rounded-lg hover:text-[#F80800] hover:bg-[#140029] hover:border-[#F80800] transition-colors duration-200"> <a href="/admin/service_types" 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">
Cancel Cancel
</a> </a>
</div> </div>
+42 -39
View File
@@ -3,10 +3,10 @@
<div class="text-4xl mb-10"> <div class="text-4xl mb-10">
Services Services
</div> </div>
<% unless @is_readonly %> <% unless @editing %>
<div class="w-19/20 flex flex-none items-center justify-between ml-5 mb-2"> <div class="w-19/20 flex flex-none items-center justify-between ml-5 mb-2">
<div class="flex-none text-xl text-[#2FD400]">Edit</div> <div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
<div class="grow h-[1px] mt-1 bg-[#2FD400]"></div> <div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
</div> </div>
<% end %> <% end %>
<div class="flex flex-col ml-10 space-y-2"> <div class="flex flex-col ml-10 space-y-2">
@@ -16,73 +16,73 @@
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="serv_<%= index %>_name" id="serv_<%= index %>_name"
name="services[][name]" name="services[][name]"
value="<%= serv.name %>" value="<%= serv.name %>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @services.length - 1 %> <% if index == @services.length - 1 %>
<div class="text-[#2FD400]">Name</div> <div class="<%= "text-[##{@accent_hex}]" if @editing %>">Name</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<select class="h-8 border-2 border-[#8000FF] rounded-lg text-center" name="services[][service_type_id]" id="service_type_select" <%= 'disabled' if @is_readonly %> > <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 %> >
<option value="">Select a Service Type</option> <option value="">Select a Service Type</option>
<% @service_types.each do |service_type| %> <% @service_types.each do |service_type| %>
<option value="<%= service_type.id %>" <%= "selected" if serv.service_type_id == service_type.id %>><%= service_type.name %></option> <option value="<%= service_type.id %>" <%= "selected" if serv.service_type_id == service_type.id %>><%= service_type.name %></option>
<% end %> <% end %>
</select> </select>
<% if index == @services.length - 1 %> <% if index == @services.length - 1 %>
<div class="text-[#2FD400]">Service Type</div> <div class="<%= "text-[##{@accent_hex}]" if @editing %>">Service Type</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<select class="h-8 border-2 border-[#8000FF] rounded-lg text-center" name="services[][machine_id]" id="machine_select" <%= 'disabled' if @is_readonly %> > <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 %> >
<option value="">Select a Service Type</option> <option value="">Select a Service Type</option>
<% @machines.each do |machine| %> <% @machines.each do |machine| %>
<option value="<%= machine.id %>" <%= "selected" if serv.machine_id == machine.id %>><%= machine.name %></option> <option value="<%= machine.id %>" <%= "selected" if serv.machine_id == machine.id %>><%= machine.name %></option>
<% end %> <% end %>
</select> </select>
<% if index == @services.length - 1 %> <% if index == @services.length - 1 %>
<div class="text-[#2FD400]">Machine</div> <div class="<%= "text-[##{@accent_hex}]" if @editing %>">Machine</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="serv_<%= index %>_subdomain" id="serv_<%= index %>_subdomain"
name="services[][subdomain]" name="services[][subdomain]"
value="<%= serv.subdomain%>" value="<%= serv.subdomain%>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @services.length - 1 %> <% if index == @services.length - 1 %>
<div class="text-[#2FD400]">Subdomain</div> <div class="<%= "text-[##{@accent_hex}]" if @editing %>">Subdomain</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="serv_<%= index %>_port" id="serv_<%= index %>_port"
name="services[][port]" name="services[][port]"
value="<%= serv.port%>" value="<%= serv.port%>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @services.length - 1 %> <% if index == @services.length - 1 %>
<div class="text-[#2FD400]">Port</div> <div class="<%= "text-[##{@accent_hex}]" if @editing %>">Port</div>
<% end %> <% end %>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class='h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center <%= "text-[##{@accent_hex}]" if !@editing %>'
id="serv_<%= index %>_url_path" id="serv_<%= index %>_url_path"
name="services[][url_path]" name="services[][url_path]"
value="<%= serv.url_path%>" value="<%= serv.url_path%>"
<%= 'readonly' if @is_readonly %> > <%= 'readonly' if @editing %> >
<% if index == @services.length - 1 %> <% if index == @services.length - 1 %>
<div class="text-[#2FD400]">URL Path (optional)</div> <div class="<%= "text-[##{@accent_hex}]" if @editing %>">URL Path (optional)</div>
<% end %> <% end %>
</div> </div>
@@ -92,82 +92,85 @@
<div class="flex flex-col space-y-2 mt-10"> <div class="flex flex-col space-y-2 mt-10">
<% if @is_readonly %> <% if @editing %>
<div class="w-19/20 flex justify-end space-x-5"> <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-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <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">
Edit/Add Services Edit/Add Services
</a> </a>
<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>
</div> </div>
<% else %> <% else %>
<div class="w-19/20 flex flex-none items-center justify-between ml-5 mb-2"> <div class="w-19/20 flex flex-none items-center justify-between ml-5 mb-2">
<div class="flex-none text-xl text-[#2FD400]">New</div> <div class="flex-none text-xl text-[#<%= @accent_hex %>]">New</div>
<div class="grow h-[1px] mt-1 bg-[#2FD400]"></div> <div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
</div> </div>
<div class="flex space-x-2 mb-10 ml-10""> <div class="flex space-x-2 mb-10 ml-10"">
<input type="hidden" name="services[][id]" value=""> <input type="hidden" name="services[][id]" value="">
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="serv_new_name" id="serv_new_name"
name="services[][name]" name="services[][name]"
value=""> value="">
<div class="text-[#2FD400]">Name</div> <div class="text-[#<%= @accent_hex %>]">Name</div>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<select class="h-8 border-2 border-[#8000FF] rounded-lg text-center" name="services[][service_type_id]" id="service_type_select" <%= 'disabled' if @is_readonly %> > <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 %> >
<option value="">Select a Service Type</option> <option value="">Select a Service Type</option>
<% @service_types.each do |service_type| %> <% @service_types.each do |service_type| %>
<option value="<%= service_type.id %>"><%= service_type.name %></option> <option value="<%= service_type.id %>"><%= service_type.name %></option>
<% end %> <% end %>
</select> </select>
<div class="text-[#2FD400]">Service Type</div> <div class="text-[#<%= @accent_hex %>]">Service Type</div>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<select class="h-8 border-2 border-[#8000FF] rounded-lg text-center" name="services[][machine_id]" id="machine_select" <%= 'disabled' if @is_readonly %> > <select class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center" name="services[][machine_id]" id="machine_select" <%= 'disabled' if @editing %> >
<option value="">Select a Service Type</option> <option value="">Select a Service Type</option>
<% @machines.each do |machine| %> <% @machines.each do |machine| %>
<option value="<%= machine.id %>"><%= machine.name %></option> <option value="<%= machine.id %>"><%= machine.name %></option>
<% end %> <% end %>
</select> </select>
<div class="text-[#2FD400]">Machine</div> <div class="text-[#<%= @accent_hex %>]">Machine</div>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="serv_new_subdomain" id="serv_new_subdomain"
name="services[][subdomain]" name="services[][subdomain]"
value=""> value="">
<div class="text-[#2FD400]">Subdomain</div> <div class="text-[#<%= @accent_hex %>]">Subdomain</div>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="serv_new_port" id="serv_new_port"
name="services[][port]" name="services[][port]"
value=""> value="">
<div class="text-[#2FD400]">Port</div> <div class="text-[#<%= @accent_hex %>]">Port</div>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<input type="text" <input type="text"
class="h-8 border-2 border-[#8000FF] rounded-lg text-center" class="h-8 border-2 border-[#<%= @light_hex %>] rounded-lg text-center"
id="serv_new_url_path" id="serv_new_url_path"
name="services[][url_path]" name="services[][url_path]"
value=""> value="">
<div class="text-[#2FD400]">URL Path (optional)</div> <div class="text-[#<%= @accent_hex %>]">URL Path (optional)</div>
</div> </div>
</div> </div>
<div class="w-19/20 flex justify-end space-x-5"> <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-[#140029] bg-[#8000FF] border-2 border-[#8000FF] rounded-lg hover:text-[#2FD400] hover:bg-[#140029] hover:border-[#2FD400] transition-colors duration-200"> <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">
Save Services Save Services
</button> </button>
<a href="/admin/services" class="inline-block w-50 px-3 py-1 mt-20 text-center font-semibold text-[#140029] bg-[#F80800] border-2 border-[#F80800] rounded-lg hover:text-[#F80800] hover:bg-[#140029] hover:border-[#F80800] transition-colors duration-200"> <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">
Cancel Cancel
</a> </a>
</div> </div>
+14 -14
View File
@@ -1,27 +1,27 @@
<div class="flex flex-col gap-y-2 bg-[url('/images/purpleandblackfire.svg')] bg-size-[auto_113%] bg-center bg-no-repeat"> <div class="flex flex-col gap-y-2 bg-[url('/images/purplegreenblackfire.svg')] bg-size-[auto_113%] bg-center bg-no-repeat">
<div class="flex flex-none items-center py-2 mb-13"> <div class="flex flex-none items-center py-2 mb-13">
<div class="flex-none text-5xl text-[#8000FF]">Local Network Directory</div> <div class="flex-none text-5xl text-[#<%= @light_hex %>]">Local Network Directory</div>
<div class="grow-5 h-[3px] mt-3 bg-[#8000FF]"></div> <div class="grow-5 h-[3px] mt-3 bg-[#<%= @light_hex %>]"></div>
<div class="flex-none mx-1 mt-2 text-2xl text-[#2FD400]"> <div class="flex-none mx-1 mt-2 text-2xl text-[#<%= @accent_hex %>]">
<% if @url_type == 'tailscale' %> <% if @url_type == 'tailscale' %>
<%= @url_type.gsub('_', ' ') %> <%= @url_type.gsub('_', ' ') %>
<% elsif @url_type == 'local_ip' %> <% elsif @url_type == 'local_ip' %>
<a href="/" class="flex h-full text-center hover:text-[#009fff]"> <a href="/" class="flex h-full text-center hover:text-[#<%= @light_hex %>]">
<%= @url_type.gsub('_', ' ') %> <%= @url_type.gsub('_', ' ') %>
</a> </a>
<% else %> <% else %>
<a href="?local_ip=true" class="flex h-full text-center hover:text-[#009fff]"> <a href="?local_ip=true" class="flex h-full text-center hover:text-[#<%= @light_hex %>]">
<%= @url_type.gsub('_', ' ') %> <%= @url_type.gsub('_', ' ') %>
</a> </a>
<% end %> <% end %>
</div> </div>
<div class="grow-1 h-[3px] mt-3 bg-[#8000FF]"></div> <div class="grow-1 h-[3px] mt-3 bg-[#<%= @light_hex %>]"></div>
</div> </div>
<div class="flex gap-x-7"> <div class="flex gap-x-7">
<div class="flex flex-col w-3/5 items-start"> <div class="flex flex-col w-3/5 items-start">
<div class="flex bg-[#140029] text-center text-3xl text-[#<%= @media.hex_color %>] ml-15 -mb-4 px-2 z-1"> <div class="flex bg-[#<%= @dark_hex %>] text-center text-3xl text-[#<%= @media.hex_color %>] ml-15 -mb-4 px-2 z-1">
<%= @media.name %> <%= @media.name %>
</div> </div>
<div class="flex flex-wrap text-2xl gap-1 py-4 justify-evenly items-center border-4 border-[#<%= @media.hex_color %>] rounded-lg"> <div class="flex flex-wrap text-2xl gap-1 py-4 justify-evenly items-center border-4 border-[#<%= @media.hex_color %>] rounded-lg">
@@ -34,14 +34,14 @@
</div> </div>
<div class="flex flex-col w-2/5 items-start"> <div class="flex flex-col w-2/5 items-start">
<div class="bg-[#140029] text-center text-3xl text-[#<%= @support.hex_color %>] ml-15 -mb-4 px-2 z-1"> <div class="bg-[#<%= @dark_hex %>] text-center text-3xl text-[#<%= @support.hex_color %>] ml-15 -mb-4 px-2 z-1">
<%= @support.name %> <%= @support.name %>
</div> </div>
<div class="flex flex-wrap text-2xl gap-1 py-4 justify-evenly items-center border-4 border-[#<%= @support.hex_color %>] rounded-lg"> <div class="flex flex-wrap text-2xl gap-1 py-4 justify-evenly items-center border-4 border-[#<%= @support.hex_color %>] rounded-lg">
<% @support.services.each do |service| %> <% @support.services.each do |service| %>
<a href=<%= service.current_url %> class="flex justify-center items-center h-15 w-55 px-2 py-10 my-4 text-center font-bold text-[#<%= @support.hex_color %>] bg-transparent border-2 border-[#<%= @support.hex_color %>] rounded-lg hover:text-[#140029] hover:bg-[#<%= @support.hex_color %>] transition-colors duration-200"> <a href=<%= service.current_url %> class="flex justify-center items-center h-15 w-55 px-2 py-10 my-4 text-center font-bold text-[#<%= @support.hex_color %>] bg-transparent border-2 border-[#<%= @support.hex_color %>] rounded-lg hover:text-[#<%= @dark_hex %>] hover:bg-[#<%= @support.hex_color %>] transition-colors duration-200">
<%= service.name %> <%= service.name %>
</a> </a>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -49,13 +49,13 @@
</div> </div>
<div class="flex flex-col w-full items-start"> <div class="flex flex-col w-full items-start">
<div class="bg-[#140029] text-center text-3xl text-[#<%= @admin.hex_color %>] ml-15 -mb-4 px-2 z-1"> <div class="bg-[#<%= @dark_hex %>] text-center text-3xl text-[#<%= @admin.hex_color %>] ml-15 -mb-4 px-2 z-1">
<%= @admin.name %> <%= @admin.name %>
</div> </div>
<div class="flex flex-wrap w-full text-2xl gap-1 py-4 justify-evenly items-center border-4 border-[#<%= @admin.hex_color %>] rounded-lg"> <div class="flex flex-wrap w-full text-2xl gap-1 py-4 justify-evenly items-center border-4 border-[#<%= @admin.hex_color %>] rounded-lg">
<% @admin.services.each do |service| %> <% @admin.services.each do |service| %>
<div class="flex w-[21%] justify-center items-center"> <div class="flex w-[21%] justify-center items-center">
<a href=<%= service.current_url %> class="flex justify-center items-center h-15 w-55 px-2 py-10 my-4 text-center font-bold text-[#<%= @admin.hex_color %>] bg-transparent border-2 border-[#<%= @admin.hex_color %>] rounded-lg hover:text-[#140029] hover:bg-[#<%= @admin.hex_color %>] transition-colors duration-200"> <a href=<%= service.current_url %> class="flex justify-center items-center h-15 w-55 px-2 py-10 my-4 text-center font-bold text-[#<%= @admin.hex_color %>] bg-transparent border-2 border-[#<%= @admin.hex_color %>] rounded-lg hover:text-[#<%= @dark_hex %>] hover:bg-[#<%= @admin.hex_color %>] transition-colors duration-200">
<%= service.name %> <%= service.name %>
</a> </a>
</div> </div>
+1 -1
View File
@@ -5,7 +5,7 @@
<title>Network Directory</title> <title>Network Directory</title>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
</head> </head>
<body class="bg-[#140029] text-[#8000FF] font-semibold antialiased"> <body class="bg-[#<%= @dark_hex %>] text-[#<%= @light_hex %>] font-semibold antialiased">
<div class="container mx-auto px-4 py-8"> <div class="container mx-auto px-4 py-8">
<%= yield %> <%= yield %>
</div> </div>
@@ -0,0 +1,7 @@
class AddColorsToLocalNetwork < ActiveRecord::Migration[7.2]
def change
add_column :local_networks, :primary_dark_hex, :string
add_column :local_networks, :primary_light_hex, :string
add_column :local_networks, :accent_hex, :string
end
end
+4 -1
View File
@@ -10,13 +10,16 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.2].define(version: 2026_05_27_212837) do ActiveRecord::Schema[7.2].define(version: 2026_06_16_133017) do
create_table "local_networks", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "local_networks", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "name" t.string "name"
t.string "subnet" t.string "subnet"
t.string "tld" t.string "tld"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.string "primary_dark_hex"
t.string "primary_light_hex"
t.string "accent_hex"
end end
create_table "machines", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "machines", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 60 KiB

+8 -8
View File
@@ -5,7 +5,7 @@
width="347pt" width="347pt"
version="1.1" version="1.1"
id="svg1497" id="svg1497"
sodipodi:docname="fullyblackfire.svg" sodipodi:docname="purplegreenblackfire.svg"
inkscape:version="1.4.2 (ebf0e940, 2025-05-08)" inkscape:version="1.4.2 (ebf0e940, 2025-05-08)"
inkscape:export-filename="fullyblackfire.svg" inkscape:export-filename="fullyblackfire.svg"
inkscape:export-xdpi="96" inkscape:export-xdpi="96"
@@ -1094,24 +1094,24 @@
</clipPath> </clipPath>
<linearGradient <linearGradient
id="Grad49" id="Grad49"
x1="4.6900301" x1="6.7444921"
y2="2.89008" y2="-1.8348559"
gradientUnits="userSpaceOnUse" gradientUnits="userSpaceOnUse"
y1="2.89008" y1="7.615016"
x2="17.611099" x2="15.556641"
gradientTransform="matrix(0.80350378,4.8995797,-5.0590639,0.77817376,106.50342,44.187461)"> gradientTransform="matrix(0.80350378,4.8995797,-5.0590639,0.77817376,106.50342,44.187461)">
<stop <stop
offset="0.00320513" offset="0"
stop-opacity="1" stop-opacity="1"
stop-color="#ff1e00" stop-color="#ff1e00"
id="stop1056" id="stop1056"
style="stop-color:#2fd400;stop-opacity:1;" /> style="stop-color:#2fd400;stop-opacity:1;" />
<stop <stop
offset="0.43589744" offset="0.528534"
stop-opacity="1" stop-opacity="1"
stop-color="#ffed00" stop-color="#ffed00"
id="stop1058" id="stop1058"
style="stop-color:#000000;stop-opacity:1;" /> style="stop-color:#46008a;stop-opacity:1;" />
</linearGradient> </linearGradient>
<linearGradient <linearGradient
id="Grad50" id="Grad50"

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB