X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=web%2FMonitorWeb%2Fmonitorweb%2Ftemplates%2Fnodelist.kid;fp=web%2FMonitorWeb%2Fmonitorweb%2Ftemplates%2Fnodelist.kid;h=e07fb635aac6d9e839645788dde1081e13b03412;hp=2c1ae70a4169a0b509f0b4d6316b72145f66a83f;hb=09a4319e30f5fadf17cbc5fbbef03bb2a35c5f0f;hpb=fbe2fbd7f5d866205f878e68968dcef14a3812ab diff --git a/web/MonitorWeb/monitorweb/templates/nodelist.kid b/web/MonitorWeb/monitorweb/templates/nodelist.kid index 2c1ae70..e07fb63 100644 --- a/web/MonitorWeb/monitorweb/templates/nodelist.kid +++ b/web/MonitorWeb/monitorweb/templates/nodelist.kid @@ -5,6 +5,15 @@ from monitor.util import diff_time from time import mktime from links import * +def up_label (query): + up=len([agg for agg in query if agg.node.status in ('online', 'good')]) + total=len(query) + return "%d (%d %%)" %(up,100*up/total) +def down_label (query): + down=len([agg for agg in query if agg.node.status not in ('online', 'good')]) + total=len(query) + return "%d (%d %%)" %(down,100*down/total) + ?> - +