Skip to content

Commit

Permalink
Fix config file saving
Browse files Browse the repository at this point in the history
Comment AAS-TestMap so that it's not selected as part of Random startup maps
  • Loading branch information
Joe-Klauza committed Feb 19, 2023
1 parent 618b2e7 commit 54b3b26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion admin-interface/docroot/views/server-config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
<textarea id="admins-cfg" class="m-2 config-file" file="admins_cfg"><%= @admins_cfg %></textarea>
</div>
<div class="tab-pane fade horizontal-expand" id="mapcycle-cfg-tab">
<textarea id="mapcycle-cfg" class="m-2 config-file" file="map_cycle_cfg"><%= @mapcycle_cfg %></textarea>
<textarea id="mapcycle-cfg" class="m-2 config-file" file="mapcycle_cfg"><%= @mapcycle_cfg %></textarea>
</div>
<div class="tab-pane fade horizontal-expand" id="bans-cfg-tab">
<textarea id="bans-cfg" class="m-2 config-file" file="bans_cfg"><%= @bans_cfg %></textarea>
Expand Down
4 changes: 2 additions & 2 deletions admin-interface/lib/config-handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
'Montecassino' => ' Monte Cassino',
'LamDong' => 'Lam Dong',
'Khafji_P' => 'Khafji_P',
'Risala' => 'Risala',
'AAS-TestMap' => 'Test Map (AAS)'
'Risala' => 'Risala'
# 'AAS-TestMap' => 'Test Map (AAS)'
# 'SaintQuentin' => 'Saint Quentin',
# 'OmahaBeach' => 'OmahaBeach',
# 'Carentan' => 'Carentan',
Expand Down
4 changes: 2 additions & 2 deletions admin-interface/lib/webapp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ def redirect_to_config(config_id, path)
config = get_config(params['config-id'])
file_type = params['file']
halt(400, "File type not found: #{file_type}") unless CONFIG_FILES[file_type.to_sym]
file = ERB.new(CONFIG_FILES[:bans_cfg][:local_erb]).result(binding)
file = ERB.new(CONFIG_FILES[file_type.to_sym][:local_erb]).result(binding)
halt(400, "File not found: #{file.sub(USER_HOME, '~')}") unless File.exist? file
File.read(file)
end
Expand All @@ -989,7 +989,7 @@ def redirect_to_config(config_id, path)
config = get_config(config_id)
file_type = params['file']
halt(400, "File type not found: #{file_type}") unless CONFIG_FILES[file_type.to_sym]
file = ERB.new(CONFIG_FILES[:bans_cfg][:local_erb]).result(binding)
file = ERB.new(CONFIG_FILES[file_type.to_sym][:local_erb]).result(binding)
content = params['content']
content << "\n" unless content.end_with? "\n"
FileUtils.mkdir_p(File.dirname(file))
Expand Down

0 comments on commit 54b3b26

Please sign in to comment.