Sha256: 03edfcd89a129ba470b41da1d0708f0fb2aeab1800e3e5bb62f7f8bb02750d13

Contents?: true

Size: 1.67 KB

Versions: 1

Compression:

Stored size: 1.67 KB

Contents

<div style="width: 100%">
<% 
require "toaster/model/automation"
require "toaster/test/test_suite"

$session = session

backups = []
testresult_collections = []

$session['db.host'] = $session['db.host'] || DB.instance.db_host
$session['db.port'] = $session['db.port'] || DB.instance.db_port
$session['db.name'] = $session['db.name'] || DB.instance.db_name

if param('saveSettings') != ""
	connection_changed = 	param('dbHost') != $session['db.host'] ||
							param('dbPort') != $session['db.port'] ||
							param('dbDB') != $session['db.name']
	$session['db.host'] = param('dbHost') if param('dbHost') != ""
	$session['db.port'] = param('dbPort') if param('dbPort') != ""
	$session['db.name'] = param('dbDB') if param('dbDB') != ""
	$session['service.host'] = param('serviceHost')
	$session['service.port'] = param('servicePort')
	msg = "Settings successfully applied."
	flash[:notice] ? (flash[:notice] << msg) : flash[:notice] = [msg]
	if connection_changed
		#load_cache()
		Toaster::Cache.clear()
		msg = "Cache has been cleaned due to changes in connection settings."
		flash[:notice] ? (flash[:notice] << msg) : flash[:notice] = [msg]
	end
end

%>
<form action="" method="post">
<input type="hidden" name="sessionID" value="<%= $session['session_id'] %>"/>
<h2>Settings</h2>

<% if !Toaster::Config.get("testing.hosted_mode") %>
<h3>Test Agent Service</h3>
<table>
	<tr><td>Service Host:</td><td><input name="serviceHost" value="<%= $session['service.host'] %>"/><td/></tr>
	<tr><td>Service Port:</td><td><input name="servicePort" value="<%= $session['service.port'] %>"/><td/></tr>
	<tr><td></td><td><input type="submit" value="Update" name="saveSettings"/><td/></tr>
</table>
<% end %>

</form>
</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cloud-toaster-1.1.6 webapp/app/views/settings/config.html.erb