X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=web%2FMonitorWeb%2Fmonitorweb%2Ftemplates%2Fnodefast.kid;h=2052b85c43dbeae12768fb4c84f8218fd6a12b8a;hb=09a4319e30f5fadf17cbc5fbbef03bb2a35c5f0f;hp=97072d21638be12efef84ec8680ad005f520a2e0;hpb=09b59c841e16304b3f0826e6866e212bad922840;p=monitor.git diff --git a/web/MonitorWeb/monitorweb/templates/nodefast.kid b/web/MonitorWeb/monitorweb/templates/nodefast.kid index 97072d2..2052b85 100644 --- a/web/MonitorWeb/monitorweb/templates/nodefast.kid +++ b/web/MonitorWeb/monitorweb/templates/nodefast.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) + ?>
- | -
+ | +
- +
-