Revision 67 hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ConfigController.groovy
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 |
/* |
|
21 |
def db_sql = new Sql(dataSource) |
|
22 |
|
|
23 |
def single = db_sql.firstRow("show data_directory") |
|
24 |
def loca = single.data_directory |
|
25 |
def partition = new File(loca) |
|
26 |
totalSpace = partition.getTotalSpace() |
|
27 |
freeSpace = partition.getFreeSpace() |
|
28 |
|
|
29 |
totalSpace = (int)((totalSpace/1024)/1024) |
|
30 |
freeSpace = (int)((freeSpace/1024)/1024) |
|
31 |
|
|
32 |
percent = 100 - ((int) ((freeSpace/totalSpace)*100)) |
|
33 |
|
|
34 |
*/ |
|
35 |
|
|
36 | 14 |
def allDevices = HardwareSet.get(session.hwSet.id).devices |
37 | 15 |
|
38 |
[conf: InternalConfig, devices: allDevices, totalSpace: totalSpace, freeSpace: freeSpace, percent: percent]
|
|
16 |
[conf: InternalConfig, devices: allDevices] |
|
39 | 17 |
} |
40 | 18 |
|
41 | 19 |
def addDevice = { |
Also available in: Unified diff