Index: hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ChooseHwSetController.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ChooseHwSetController.groovy	(revision 68)
+++ hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ChooseHwSetController.groovy	(revision 69)
@@ -53,7 +53,7 @@
 		if(chosenHwSet) {
 			session['hwSet'] = chosenHwSet
 			flash.confirms = "<p>Changed current hardware set to " + chosenHwSet.name + "</p>"
-			redirect(controller:'sysState',action:'main')
+			redirect(controller:params.ctrl,action:params.act)
 			return true
 		} else {
 			flash.errors = "<p>Could not change current hardware set (card). The ID specified is not valid!</p>"
Index: hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ConfigController.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ConfigController.groovy	(revision 68)
+++ hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ConfigController.groovy	(revision 69)
@@ -109,6 +109,10 @@
 			
 			session.hwSet.IPaddress = params['logic-ip']
 			session.hwSet.portNumber = (params['logic-port'] as int)
+			HardwareSet toChange = HardwareSet.get(session.hwSet.id)
+			toChange.IPaddress = params['logic-ip']
+			toChange.portNumber = (params['logic-port'] as int)
+			toChange.save()
 			flash['confirms'] = "<p>Changes saved.</p>"
 			redirect(action: 'connection')
 		} else {
Index: hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/StatisticsController.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/StatisticsController.groovy	(revision 68)
+++ hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/StatisticsController.groovy	(revision 69)
@@ -101,6 +101,8 @@
 	
 	def showGraph = {
 		
+		if(!params.outputDevice) params.outputDevice = 'none'
+		
 		def graphToShow = EneGraph.get(params['id'])
 		String query
 		
@@ -107,8 +109,32 @@
 		List data = new ArrayList()
 		data = graphDataService.getGraphData(graphToShow)
 		
-		[data: "{label: '" + graphToShow.name + "', data: " + data.toString() + " }"]
+		List outputDevices = new ArrayList()
 		
+		def crit1 = DeviceInfo.createCriteria()
+		outputDevices = crit1 {
+			and {
+				eq("outputDevice",true)
+				eq("hwSet",session.hwSet)
+			}
+			order("friendlyName","asc")
+		}
+		
+		// Fetch action logged data if needed
+		List actionLog = new ArrayList()
+		if(params.outputDevice != 'none') {
+			def crit2 = LoggedData.createCriteria()
+			actionLog = crit2 {
+				and {
+					eq("deviceId",params.outputDevice)
+					between("dateRecieved",new java.util.Date(data[0][0]),new java.util.Date(data[-1][0]))
+				}
+				order("dateRecieved","asc")
+			}
+		}
+		
+		[data: "{label: '" + graphToShow.name + "', data: " + data.toString() + " }",outputDevices:outputDevices,actionLog:actionLog]
+		
 	}
 	
 	def editGraph = {
Index: hci/trunk/eneraptor-web-app/grails-app/views/layouts/main.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/layouts/main.gsp	(revision 68)
+++ hci/trunk/eneraptor-web-app/grails-app/views/layouts/main.gsp	(revision 69)
@@ -19,13 +19,13 @@
 		<!-- Energy saved -->
 		<div style="position:absolute;top:10px;">
 			<div style="position:relative;left:650px;top:15px;">
-				<select style="width:310px;" onchange="location.href=escape(this.options[this.selectedIndex].value)">
+				<select style="width:310px;" onchange="location.href=(this.options[this.selectedIndex].value)">
 					<g:each in="${com.eneraptor.hci.HardwareSet.list()}" var="hwSet">
 						<g:if test="${hwSet.id == session.hwSet.id}">
-							<option value="${createLink(controller:'chooseHwSet',action:'change',id:hwSet.id)}" selected="selected">${hwSet.name}</option>
+							<option value="${createLink(controller:'chooseHwSet',action:'change',id:hwSet.id,params:[act:params.action,ctrl:params.controller])}" selected="selected">${hwSet.name}</option>
 						</g:if>
 						<g:else>
-							<option value="${createLink(controller:'chooseHwSet',action:'change',id:hwSet.id)}">${hwSet.name}</option>
+							<option value="${createLink(controller:'chooseHwSet',action:'change',id:hwSet.id,params:[act:params.action,ctrl:params.controller])}">${hwSet.name}</option>
 						</g:else>
 					</g:each>
 				</select>
Index: hci/trunk/eneraptor-web-app/grails-app/views/statistics/showGraph.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/statistics/showGraph.gsp	(revision 68)
+++ hci/trunk/eneraptor-web-app/grails-app/views/statistics/showGraph.gsp	(revision 69)
@@ -15,7 +15,19 @@
 				lines: { show: true },
 				points: { show: true },
 				xaxis: { mode: "time", timeformat: "%y/%m/%d %H:%M" },
-				legend: { container: '#legendHolder' }
+				legend: { container: '#legendHolder' },
+				grid: {
+					markings: [
+						<g:each in="${actionLog}" var="al">
+							<g:if test="${al == actionLog[-1]}">
+								{ color: 'red', lineWidth: 1, xaxis: { from: ${al.dateRecieved.time}, to: ${al.dateRecieved.time} } }
+							</g:if>
+							<g:else>
+								{ color: 'red', lineWidth: 1, xaxis: { from: ${al.dateRecieved.time}, to: ${al.dateRecieved.time} } },
+							</g:else>
+						</g:each>
+					]
+				}
 			};
 		</g:javascript>
 		<div class="chart">
@@ -24,6 +36,15 @@
 		<br />
 		<p>Legend:</p>
 		<div id="legendHolder" name="legendHolder"></div>
+		<br />
+		<p>Display actions:</p>
+		<g:form action="showGraph" method="GET">
+			<g:hiddenField name="id" value="${params.id}" />
+			<g:select name="outputDevice" from="${outputDevices}" optionKey="deviceId" optionValue="friendlyName" noSelection="['none':'- None -']" style="width:350px;" value="${params.outputDevice}" />
+			&nbsp;&nbsp;&nbsp;
+			<g:submitButton name="outputDeviceSubmit" value="Update" />
+		</g:form>
+		<br />
 		
 	</erptr:box>
 
