abusesa: Generate Live config with JSON.generate, add mapurl parameter

This commit is contained in:
Ossi Salmi 2015-11-30 12:08:28 +00:00
parent a0453bfd16
commit 9d75a9a706
2 changed files with 19 additions and 4 deletions

View file

@ -1,4 +1,18 @@
{
"authUrl": "<%= @authurl %>",
"boshUrl": "<%= @boshurl %>"
<%
require 'json'
config = {
'authUrl' => @authurl,
'boshUrl' => @boshurl,
}
if @mapurl
config['viewPlugins'] = [{
'id' => 'map',
'name' => 'Map',
'type' => 'PolymapsView',
'settings' => { 'mapUrl' => @mapurl },
}]
end
-%>
<%= JSON.generate(config) %>