v1 finished
This commit is contained in:
@@ -11,6 +11,13 @@ class ApplicationController < Sinatra::Base
|
||||
set :port, 4567
|
||||
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
|
||||
client_ip = request.ip.to_s
|
||||
puts client_ip
|
||||
@@ -37,13 +44,13 @@ class ApplicationController < Sinatra::Base
|
||||
|
||||
get '/admin/local_network' do
|
||||
@local_network = LocalNetwork.first || LocalNetwork.new
|
||||
@is_readonly = true
|
||||
@editing = true
|
||||
erb :'admin/local_network/index'
|
||||
end
|
||||
|
||||
get '/admin/local_network/edit' do
|
||||
@local_network = LocalNetwork.first || LocalNetwork.create
|
||||
@is_readonly = false
|
||||
@editing = false
|
||||
erb :'admin/local_network/index'
|
||||
end
|
||||
|
||||
@@ -58,13 +65,13 @@ class ApplicationController < Sinatra::Base
|
||||
|
||||
get '/admin/machines' do
|
||||
@machines = Machine.all
|
||||
@is_readonly = true
|
||||
@editing = true
|
||||
erb :'admin/machines/index'
|
||||
end
|
||||
|
||||
get '/admin/machines/edit' do
|
||||
@machines = Machine.all
|
||||
@is_readonly = false
|
||||
@editing = false
|
||||
erb :'admin/machines/index'
|
||||
end
|
||||
|
||||
@@ -83,37 +90,44 @@ class ApplicationController < Sinatra::Base
|
||||
|
||||
get '/admin/service_types' do
|
||||
@service_types = ServiceType.all
|
||||
@is_readonly = true
|
||||
@editing = true
|
||||
erb :'admin/service_types/index'
|
||||
end
|
||||
|
||||
get '/admin/service_types/edit' do
|
||||
@service_types = ServiceType.all
|
||||
@is_readonly = false
|
||||
@editing = false
|
||||
erb :'admin/service_types/index'
|
||||
end
|
||||
|
||||
get '/admin/service_types/media' do
|
||||
@service_type = ServiceType.media
|
||||
get '/admin/service_types/:name' do
|
||||
type_name = params[:name]
|
||||
@service_type = ServiceType.public_send(type_name)
|
||||
# @service_type = ServiceType.media
|
||||
erb :'admin/service_types/position'
|
||||
end
|
||||
|
||||
get '/admin/service_types/admin' do
|
||||
@service_type = ServiceType.admin
|
||||
erb :'admin/service_types/position'
|
||||
end
|
||||
# get '/admin/service_types/media' do
|
||||
# @service_type = ServiceType.media
|
||||
# erb :'admin/service_types/position'
|
||||
# end
|
||||
|
||||
get '/admin/service_types/support' do
|
||||
@service_type = ServiceType.support
|
||||
erb :'admin/service_types/position'
|
||||
end
|
||||
# get '/admin/service_types/admin' do
|
||||
# @service_type = ServiceType.admin
|
||||
# erb :'admin/service_types/position'
|
||||
# end
|
||||
|
||||
# get '/admin/service_types/support' do
|
||||
# @service_type = ServiceType.support
|
||||
# erb :'admin/service_types/position'
|
||||
# end
|
||||
|
||||
post '/admin/service_types' do
|
||||
puts params
|
||||
params[:service_types].each do |service_type_data|
|
||||
if service_type_data[:id].empty? && service_type_data[:name].present?
|
||||
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.update(service_type_data)
|
||||
end
|
||||
@@ -125,7 +139,7 @@ class ApplicationController < Sinatra::Base
|
||||
@services = Service.all
|
||||
@service_types = ServiceType.all
|
||||
@machines = Machine.all
|
||||
@is_readonly = true
|
||||
@editing = true
|
||||
erb :'admin/services/index'
|
||||
end
|
||||
|
||||
@@ -133,7 +147,7 @@ class ApplicationController < Sinatra::Base
|
||||
@services = Service.all
|
||||
@service_types = ServiceType.all
|
||||
@machines = Machine.all
|
||||
@is_readonly = false
|
||||
@editing = false
|
||||
erb :'admin/services/index'
|
||||
end
|
||||
|
||||
|
||||
@@ -1,23 +1,28 @@
|
||||
<div class="w-full flex flex-col items-center">
|
||||
<div class="text-4xl mb-10">
|
||||
Network Directory Admin
|
||||
</div>
|
||||
|
||||
<div class="w-1/2 flex flex-col space-y-10 ml-20 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">
|
||||
<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-[#<%= @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
|
||||
</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
|
||||
</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
|
||||
</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
|
||||
</a>
|
||||
|
||||
<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>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<div class="text-4xl mb-10">
|
||||
Local Network Settings
|
||||
</div>
|
||||
<% unless @is_readonly %>
|
||||
<% unless @editing %>
|
||||
<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="grow h-[1px] mt-1 bg-[#2FD400]"></div>
|
||||
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
|
||||
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex ml-10 space-x-2">
|
||||
@@ -14,35 +14,53 @@
|
||||
<input type="hidden" name="local_network[id]" value="<%= @local_network.id %>">
|
||||
|
||||
<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 %> >
|
||||
<div class="text-[#2FD400]">Name</div>
|
||||
<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-[##{@accent_hex}]" if @editing %>'>Name</div>
|
||||
</div>
|
||||
|
||||
<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 %> >
|
||||
<div class="text-[#2FD400]">Subnet</div>
|
||||
<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-[##{@accent_hex}]" if @editing %>'>Subnet</div>
|
||||
</div>
|
||||
|
||||
<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 %> >
|
||||
<div class="text-[#2FD400]">Top Level Domain</div>
|
||||
<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-[##{@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 class="flex flex-col space-y-2 mt-10">
|
||||
<% if @is_readonly %>
|
||||
<div class="w-1/2 flex justify-end 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">
|
||||
<% if @editing %>
|
||||
<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-[#<%= @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
|
||||
</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>
|
||||
<% else %>
|
||||
<div class="w-1/2 flex justify-end 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">
|
||||
<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-[#<%= @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
|
||||
</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
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<div class="text-4xl mb-10">
|
||||
Network Machines
|
||||
</div>
|
||||
<% unless @is_readonly %>
|
||||
<% unless @editing %>
|
||||
<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="grow h-[1px] mt-1 bg-[#2FD400]"></div>
|
||||
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
|
||||
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex flex-col ml-10 space-y-2">
|
||||
@@ -16,49 +16,49 @@
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="machines[][name]"
|
||||
value="<%= mach.name %>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% if index == @machines.length - 1 %>
|
||||
<div class="text-[#2FD400]">Name</div>
|
||||
<div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Name</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="machines[][domain]"
|
||||
value="<%= mach.domain %>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% if index == @machines.length - 1 %>
|
||||
<div class="text-[#2FD400]">Domain</div>
|
||||
<div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Domain</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="machines[][local_ip_octet]"
|
||||
value="<%= mach.local_ip_octet %>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% 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 %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="machines[][tailscale_ip]"
|
||||
value="<%= mach.tailscale_ip %>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% if index == @machines.length - 1 %>
|
||||
<div class="text-[#2FD400]">Tailscale IP</div>
|
||||
<div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Tailscale IP</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,65 +67,68 @@
|
||||
|
||||
|
||||
<div class="flex flex-col space-y-2 mt-10">
|
||||
<% if @is_readonly %>
|
||||
<div class="w-2/3 flex justify-end 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">
|
||||
<% if @editing %>
|
||||
<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-[#<%= @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
|
||||
</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>
|
||||
<% else %>
|
||||
<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="grow h-[1px] mt-1 bg-[#2FD400]"></div>
|
||||
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">New</div>
|
||||
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
||||
</div>
|
||||
<div class="flex space-x-2 mb-10 ml-10">
|
||||
<input type="hidden" name="machines[][id]" value="">
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="machines[][name]"
|
||||
value=""
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<label for="mach_new_name" class="text-[#2FD400]">Name</label>
|
||||
<%= 'readonly' if @editing %> >
|
||||
<label for="mach_new_name" class="text-[#<%= @accent_hex %>]">Name</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="machines[][domain]"
|
||||
value=""
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<label for="mach_new_domain" class="text-[#2FD400]">Domain</label>
|
||||
<%= 'readonly' if @editing %> >
|
||||
<label for="mach_new_domain" class="text-[#<%= @accent_hex %>]">Domain</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="machines[][local_ip_octet]"
|
||||
value=""
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<label for="mach_new_local_ip_octet" class="text-[#2FD400]">Local IP Octet</label>
|
||||
<%= 'readonly' if @editing %> >
|
||||
<label for="mach_new_local_ip_octet" class="text-[#<%= @accent_hex %>]">Local IP Octet</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="machines[][tailscale_ip]"
|
||||
value=""
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<label for="mach_new_tailscale_ip" class="text-[#2FD400]">Tailscale IP</label>
|
||||
<%= 'readonly' if @editing %> >
|
||||
<label for="mach_new_tailscale_ip" class="text-[#<%= @accent_hex %>]">Tailscale IP</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-2/3 flex justify-end 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">
|
||||
<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-[#<%= @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
|
||||
</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
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<div class="text-4xl mb-10">
|
||||
Service Types
|
||||
</div>
|
||||
<% unless @is_readonly %>
|
||||
<% unless @editing %>
|
||||
<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="grow h-[1px] mt-1 bg-[#2FD400]"></div>
|
||||
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
|
||||
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex flex-col ml-10 space-y-2">
|
||||
@@ -16,72 +16,90 @@
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="service_types[][name]"
|
||||
value="<%= servt.name %>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% if index == @service_types.length - 1 %>
|
||||
<div class="text-[#2FD400]">Name</div>
|
||||
<div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Name</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="service_types[][hex_color]"
|
||||
value="<%= servt.hex_color %>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% if index == @service_types.length - 1 %>
|
||||
<div class="text-[#2FD400]">Hex Color</div>
|
||||
<div class='<%= "text-[##{@accent_hex}]" if @editing %>'>Hex Color</div>
|
||||
<% end %>
|
||||
</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>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex flex-col space-y-2 mt-10">
|
||||
<% if @is_readonly %>
|
||||
<div class="w-1/2 flex justify-end 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">
|
||||
<% if @editing %>
|
||||
<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-[#<%= @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
|
||||
</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>
|
||||
<% else %>
|
||||
<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="grow h-[1px] mt-1 bg-[#2FD400]"></div>
|
||||
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">New</div>
|
||||
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
||||
</div>
|
||||
<div class="flex space-x-2 mb-10 ml-10">
|
||||
<input type="hidden" name="service_types[][id]" value="">
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="service_types[][name]"
|
||||
value=""
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<label for="servt_new_name" class="text-[#2FD400]">Name</label>
|
||||
<%= 'readonly' if @editing %> >
|
||||
<label for="servt_new_name" class="text-[#<%= @accent_hex %>]">Name</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="service_types[][hex_color]"
|
||||
value=""
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<label for="servt_new_hex_color" class="text-[#2FD400]">Hex Color</label>
|
||||
<%= 'readonly' if @editing %> >
|
||||
<label for="servt_new_hex_color" class="text-[#<%= @accent_hex %>]">Hex Color</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/2 flex justify-end 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">
|
||||
<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-[#<%= @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
|
||||
</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
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -10,33 +10,33 @@
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][name]"
|
||||
value="<%= service.name %>"
|
||||
readonly >
|
||||
<% if index == @service_type.services.length - 1 %>
|
||||
<div class="text-[#2FD400]">Name</div>
|
||||
<div class="">Name</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][position]"
|
||||
value="<%= service.position %>" >
|
||||
<% if index == @service_type.services.length - 1 %>
|
||||
<div class="text-[#2FD400]">Position</div>
|
||||
<div class="">Position</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="w-1/2 flex justify-end 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">
|
||||
<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-[#<%= @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
|
||||
</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
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<div class="text-4xl mb-10">
|
||||
Services
|
||||
</div>
|
||||
<% unless @is_readonly %>
|
||||
<% unless @editing %>
|
||||
<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="grow h-[1px] mt-1 bg-[#2FD400]"></div>
|
||||
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">Edit</div>
|
||||
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex flex-col ml-10 space-y-2">
|
||||
@@ -16,73 +16,73 @@
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][name]"
|
||||
value="<%= serv.name %>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% if index == @services.length - 1 %>
|
||||
<div class="text-[#2FD400]">Name</div>
|
||||
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Name</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<% @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 %>
|
||||
<div class="text-[#2FD400]">Service Type</div>
|
||||
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Service Type</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<% @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 %>
|
||||
<div class="text-[#2FD400]">Machine</div>
|
||||
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Machine</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][subdomain]"
|
||||
value="<%= serv.subdomain%>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% if index == @services.length - 1 %>
|
||||
<div class="text-[#2FD400]">Subdomain</div>
|
||||
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Subdomain</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][port]"
|
||||
value="<%= serv.port%>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% if index == @services.length - 1 %>
|
||||
<div class="text-[#2FD400]">Port</div>
|
||||
<div class="<%= "text-[##{@accent_hex}]" if @editing %>">Port</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][url_path]"
|
||||
value="<%= serv.url_path%>"
|
||||
<%= 'readonly' if @is_readonly %> >
|
||||
<%= 'readonly' if @editing %> >
|
||||
<% 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 %>
|
||||
</div>
|
||||
|
||||
@@ -92,82 +92,85 @@
|
||||
|
||||
|
||||
<div class="flex flex-col space-y-2 mt-10">
|
||||
<% if @is_readonly %>
|
||||
<div class="w-19/20 flex justify-end 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">
|
||||
<% 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">
|
||||
Edit/Add Services
|
||||
</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>
|
||||
<% else %>
|
||||
<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="grow h-[1px] mt-1 bg-[#2FD400]"></div>
|
||||
<div class="flex-none text-xl text-[#<%= @accent_hex %>]">New</div>
|
||||
<div class="grow h-[1px] mt-1 bg-[#<%= @accent_hex %>]"></div>
|
||||
</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"
|
||||
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"
|
||||
name="services[][name]"
|
||||
value="">
|
||||
<div class="text-[#2FD400]">Name</div>
|
||||
<div class="text-[#<%= @accent_hex %>]">Name</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<% @service_types.each do |service_type| %>
|
||||
<option value="<%= service_type.id %>"><%= service_type.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
<div class="text-[#2FD400]">Service Type</div>
|
||||
<div class="text-[#<%= @accent_hex %>]">Service Type</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<% @machines.each do |machine| %>
|
||||
<option value="<%= machine.id %>"><%= machine.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
<div class="text-[#2FD400]">Machine</div>
|
||||
<div class="text-[#<%= @accent_hex %>]">Machine</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][subdomain]"
|
||||
value="">
|
||||
<div class="text-[#2FD400]">Subdomain</div>
|
||||
<div class="text-[#<%= @accent_hex %>]">Subdomain</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][port]"
|
||||
value="">
|
||||
<div class="text-[#2FD400]">Port</div>
|
||||
<div class="text-[#<%= @accent_hex %>]">Port</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<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"
|
||||
name="services[][url_path]"
|
||||
value="">
|
||||
<div class="text-[#2FD400]">URL Path (optional)</div>
|
||||
<div class="text-[#<%= @accent_hex %>]">URL Path (optional)</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="w-19/20 flex justify-end 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">
|
||||
<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">
|
||||
Save Services
|
||||
</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
|
||||
</a>
|
||||
</div>
|
||||
|
||||
+15
-15
@@ -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-none text-5xl text-[#8000FF]">Local Network Directory</div>
|
||||
<div class="grow-5 h-[3px] mt-3 bg-[#8000FF]"></div>
|
||||
<div class="flex-none mx-1 mt-2 text-2xl text-[#2FD400]">
|
||||
<div class="flex-none text-5xl text-[#<%= @light_hex %>]">Local Network Directory</div>
|
||||
<div class="grow-5 h-[3px] mt-3 bg-[#<%= @light_hex %>]"></div>
|
||||
<div class="flex-none mx-1 mt-2 text-2xl text-[#<%= @accent_hex %>]">
|
||||
<% if @url_type == 'tailscale' %>
|
||||
<%= @url_type.gsub('_', ' ') %>
|
||||
<% 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('_', ' ') %>
|
||||
</a>
|
||||
<% 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('_', ' ') %>
|
||||
</a>
|
||||
<% end %>
|
||||
</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 class="flex gap-x-7">
|
||||
<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 %>
|
||||
</div>
|
||||
<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 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 %>
|
||||
</div>
|
||||
<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| %>
|
||||
<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">
|
||||
<%= service.name %>
|
||||
</a>
|
||||
<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 %>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -49,13 +49,13 @@
|
||||
</div>
|
||||
|
||||
<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 %>
|
||||
</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">
|
||||
<% @admin.services.each do |service| %>
|
||||
<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 %>
|
||||
</a>
|
||||
</div>
|
||||
@@ -63,4 +63,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<title>Network Directory</title>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
||||
</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">
|
||||
<%= yield %>
|
||||
</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
@@ -10,13 +10,16 @@
|
||||
#
|
||||
# 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|
|
||||
t.string "name"
|
||||
t.string "subnet"
|
||||
t.string "tld"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "primary_dark_hex"
|
||||
t.string "primary_light_hex"
|
||||
t.string "accent_hex"
|
||||
end
|
||||
|
||||
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 |
@@ -5,7 +5,7 @@
|
||||
width="347pt"
|
||||
version="1.1"
|
||||
id="svg1497"
|
||||
sodipodi:docname="fullyblackfire.svg"
|
||||
sodipodi:docname="purplegreenblackfire.svg"
|
||||
inkscape:version="1.4.2 (ebf0e940, 2025-05-08)"
|
||||
inkscape:export-filename="fullyblackfire.svg"
|
||||
inkscape:export-xdpi="96"
|
||||
@@ -1094,24 +1094,24 @@
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
id="Grad49"
|
||||
x1="4.6900301"
|
||||
y2="2.89008"
|
||||
x1="6.7444921"
|
||||
y2="-1.8348559"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y1="2.89008"
|
||||
x2="17.611099"
|
||||
y1="7.615016"
|
||||
x2="15.556641"
|
||||
gradientTransform="matrix(0.80350378,4.8995797,-5.0590639,0.77817376,106.50342,44.187461)">
|
||||
<stop
|
||||
offset="0.00320513"
|
||||
offset="0"
|
||||
stop-opacity="1"
|
||||
stop-color="#ff1e00"
|
||||
id="stop1056"
|
||||
style="stop-color:#2fd400;stop-opacity:1;" />
|
||||
<stop
|
||||
offset="0.43589744"
|
||||
offset="0.528534"
|
||||
stop-opacity="1"
|
||||
stop-color="#ffed00"
|
||||
id="stop1058"
|
||||
style="stop-color:#000000;stop-opacity:1;" />
|
||||
style="stop-color:#46008a;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="Grad50"
|
||||
|
||||
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Reference in New Issue
Block a user