Revision 16 hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/SysLogController.groovy

View differences:

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
		

Also available in: Unified diff