Revision 16

View differences:

hci/trunk/eneraptor-web-app/application.properties
3 3
app.grails.version=1.3.6
4 4
app.name=eneraptor-web-app
5 5
app.servlet.version=2.4
6
app.version=0.1
6
app.version=0.2
7 7
plugins.flot=0.2.2
8 8
plugins.hibernate=1.3.6
9 9
plugins.navigation=1.1.1
hci/trunk/eneraptor-web-app/grails-app/views/sysLog/main.gsp
11 11
		<p>TODO: Some information about log.</p>
12 12
	</erptr:box>
13 13
	
14
	<!-- DISK USAGE - ONLY IF ENERAPOTR HCI IS SUPERUSER
14 15
	<erptr:box title="Disk usage">
15 16
		<div style="float:left;">
16 17
			<div style="width: 100px;border:1px solid grey;">
......
24 25
				<i style="color:red;">&nbsp;&nbsp;&nbsp;Warning: disk is almost full. You should erase some old log entries.</i>
25 26
		</g:if>
26 27
	</erptr:box>
28
	 -->
27 29

  
28 30
</body>
29 31

  
hci/trunk/eneraptor-web-app/grails-app/views/config/hci.gsp
10 10
	<erptr:box title="Information">
11 11
		
12 12
		<p>HCI Version: &nbsp;&nbsp;&nbsp;<span style="font-family:monospace;">${conf.findByConfigId('hci-version').configVal}</span></p>
13
			
13
		
14
		<!-- DISK USAGE - ONLY IF ENERAPTOR HCI IS SUPERUSER	
14 15
		<p style="float: left;">Disk usage: &nbsp;&nbsp;&nbsp;</p>
15 16
		<div style="float:left;">
16 17
			<div style="width: 100px;border:1px solid grey;">
......
23 24
		<g:if test="${percent >= 95}">
24 25
				<i style="color:red;">&nbsp;&nbsp;&nbsp;Warning: disk is almost full. You should erase some old log entries.</i>
25 26
		</g:if>
27
		-->
26 28
		
27 29
	</erptr:box>
28 30
	
hci/trunk/eneraptor-web-app/grails-app/conf/DataSource.groovy
33 33
        dataSource {
34 34
            dbCreate = "update" // one of 'create', 'create-drop','update'
35 35
			driverClassName = "org.postgresql.Driver"
36
            url = "jdbc:postgresql://localhost/eneraptor-db"
36
            url = "jdbc:postgresql://localhost/eneraptor"
37 37
			username = "eneraptor-hci"
38
			password = "eneraptor-hci-2010"
38
			password = "eneraptor-hci"
39 39
        }
40 40
    }
41 41
}
hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/SysLogController.groovy
11 11
	
12 12
	def main = {
13 13
		
14
		/*
15
		 * DISK USAGE - ONLY IF ENERAPOTR HCI IS SUPERUSER
16
		 */
17
		def freeSpace = 0
18
		def totalSpace = 0
19
		def percent = 0
20
		/*
14 21
		def db_sql = new Sql(dataSource)
15 22
		
16 23
		def single = db_sql.firstRow("show data_directory")
17 24
		def loca = single.data_directory
18 25
		def partition = new File(loca)
19
		def totalSpace = partition.getTotalSpace()
20
		def freeSpace  = partition.getFreeSpace()
26
		totalSpace = partition.getTotalSpace()
27
		freeSpace  = partition.getFreeSpace()
21 28
		
22 29
		totalSpace = (int)((totalSpace/1024)/1024)
23 30
		freeSpace = (int)((freeSpace/1024)/1024)
24 31
		
25
		def percent = 100 - ((int) ((freeSpace/totalSpace)*100))
32
		percent = 100 - ((int) ((freeSpace/totalSpace)*100))
33
		*/
26 34
		
27 35
		[totalSpace: totalSpace, freeSpace: freeSpace, percent: percent]
28 36
		
hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ConfigController.groovy
11 11
	
12 12
	def hci = {
13 13
		
14
		/*
15
		 * DISK USAGE - ONLY IF ENERAPTOR HCI IS SUPERUSER
16
		 */ 
17
		def totalSpace = 0
18
		def freeSpace = 0
19
		def percent = 0
20
		/*
14 21
		def db_sql = new Sql(dataSource)
15 22
		
16 23
		def single = db_sql.firstRow("show data_directory")
17 24
		def loca = single.data_directory
18 25
		def partition = new File(loca)
19
		def totalSpace = partition.getTotalSpace()
20
		def freeSpace  = partition.getFreeSpace()
26
		totalSpace = partition.getTotalSpace()
27
		freeSpace  = partition.getFreeSpace()
21 28
		
22 29
		totalSpace = (int)((totalSpace/1024)/1024)
23 30
		freeSpace = (int)((freeSpace/1024)/1024)
24 31
		
25
		def percent = 100 - ((int) ((freeSpace/totalSpace)*100))
32
		percent = 100 - ((int) ((freeSpace/totalSpace)*100))
26 33
		
34
		*/
35
		
27 36
		def allDevices = DeviceInfo.list()
28 37
		[conf: InternalConfig, devices: allDevices, totalSpace: totalSpace, freeSpace: freeSpace, percent: percent]		
29 38
	}

Also available in: Unified diff