diff --git a/src/httprest.py b/src/httprest.py
index 08f11f9..5d283bc 100755
--- a/src/httprest.py
+++ b/src/httprest.py
@@ -342,7 +342,8 @@ class DockletHttpHandler(http.server.BaseHTTPRequestHandler):
res['mem_use'] = fetcher.get_mem_use(cmds[2])
elif cmds[3] == 'basic_info':
res['basic_info'] = fetcher.get_basic_info(cmds[2])
- self.response(200, {'success':'true', 'monitor':res})
+ user_info = G_usermgr.selfQuery(cur_user = cur_user)
+ self.response(200, {'success':'true', 'monitor':res, 'groupinfo':user_info['data']['groupinfo']})
elif cmds[1] == 'user':
if not user == 'root':
self.response(400, {'success':'false', 'message':'Root Required'})
diff --git a/web/static/js/plot_monitor.js b/web/static/js/plot_monitor.js
index 5dcb2f7..c3729b1 100755
--- a/web/static/js/plot_monitor.js
+++ b/web/static/js/plot_monitor.js
@@ -7,9 +7,9 @@ function processMemData(data)
mem_usedp = data.monitor.mem_use.usedp;
var usedp = data.monitor.mem_use.usedp;
var unit = data.monitor.mem_use.unit;
- var quota = data.monitor.mem_use.quota;
+ var quota = data.groupinfo.memory;
var val = data.monitor.mem_use.val;
- var out = "("+val+unit+"/"+quota+unit+")";
+ var out = "("+val+unit+"/"+quota+"MB)";
$("#con_mem").html((usedp/0.01).toFixed(2)+"%
"+out);
}
function getMemY()
@@ -21,7 +21,10 @@ function processCpuData(data)
cpu_usedp = data.monitor.cpu_use.usedp;
var val = data.monitor.cpu_use.val;
var unit = data.monitor.cpu_use.unit;
+ var quota = data.groupinfo.cpu;
+ quota = quota/1000.0;
$("#con_cpu").html(val +" "+ unit);
+ $("#con_cpuquota").html(quota.toFixed(2)+"% Cores");
}
function getCpuY()
{
diff --git a/web/templates/monitor/status.html b/web/templates/monitor/status.html
index 24e860c..826fa6e 100644
--- a/web/templates/monitor/status.html
+++ b/web/templates/monitor/status.html
@@ -34,13 +34,14 @@
Node ID | -Node Name | +Node ID | +Node Name | IP Address | Status | -Cpu used | -Mem used | -Summary | +Cpu used | +Cpu quota | +Mem used | +Summary | Running |
{% endif %}
-- | +-- | -- | Realtime | @@ -97,21 +99,25 @@ $("#"+index+"_pid").html('--'); $("#"+index+"_ip").html('--'); $("#"+index+"_cpu").html('--'); + $("#"+index+"_cpuquota").html('--'); $("#"+index+"_mem").html('--'); return; } $.post(url+"/cpu_use",{},function(data){ var usedp = data.monitor.cpu_use.usedp; + var quota = data.groupinfo.cpu; + quota = quota/100000.0; $("#"+index+"_cpu").html((usedp/0.01).toFixed(2)+"%"); + $("#"+index+"_cpuquota").html((quota*100).toFixed(2)+"% Cores"); },"json"); $.post(url+"/mem_use",{},function(data){ var usedp = data.monitor.mem_use.usedp; var unit = data.monitor.mem_use.unit; - var quota = data.monitor.mem_use.quota; + var quota = data.groupinfo.memory; var val = data.monitor.mem_use.val; - var out = "("+val+unit+"/"+quota+unit+")"; + var out = "("+val+unit+"/"+quota+"MB)"; $("#"+index+"_mem").html((usedp/0.01).toFixed(2)+"%State | IP Address | CPU Use | +CPU Quota | Mem Use | @@ -57,6 +58,7 @@{{ container['IP'] }} | {% endif %}-- | +-- | -- |
---|