1 |
diff -up smolt-1.4.3/smoon/hardware/controllers/root.py.smoon-sme smolt-1.4.3/smoon/hardware/controllers/root.py |
2 |
--- smolt-1.4.3/smoon/hardware/controllers/root.py.smoon-sme 2010-02-27 12:05:44.000000000 -0700 |
3 |
+++ smolt-1.4.3/smoon/hardware/controllers/root.py 2010-07-21 08:53:13.000000000 -0600 |
4 |
@@ -53,27 +53,27 @@ class Root(controllers.RootController): |
5 |
import math |
6 |
from turboflot import TurboFlot |
7 |
#archs = session.query(Arch).select() |
8 |
- topVendors = session.query(Host).group_by(Host.vendor).filter_by(rating=5).add_column(func.count(Host.rating).label('count')).order_by(desc('count')).limit(7) |
9 |
+ topVendors = session.query(Host).group_by(Host.os).add_column(func.count(Host.rating).label('count')).order_by(desc('count')).limit(7) |
10 |
types = [] |
11 |
count = [] |
12 |
i = 1 |
13 |
- vendors = [] |
14 |
+ versions = [] |
15 |
counts = [] |
16 |
for vend in topVendors: |
17 |
- vendors.append([i + .5, vend[0].vendor]) |
18 |
+ versions.append([i + .5, vend[0].os.split('release')[-1]]) |
19 |
counts.append([i, vend[1]]) |
20 |
i = i + 1 |
21 |
- vendorFlot = TurboFlot([ |
22 |
+ versionFlot = TurboFlot([ |
23 |
{ |
24 |
'data' : counts, |
25 |
'bars' : { 'show' : True }, |
26 |
- 'label' : 'Vendors', |
27 |
+ 'label' : 'Version', |
28 |
}], |
29 |
{ |
30 |
- 'xaxis' : { 'ticks' : vendors }, |
31 |
+ 'xaxis' : { 'ticks' : versions }, |
32 |
} |
33 |
) |
34 |
- return dict(now=time.ctime(), vendorFlot=vendorFlot) |
35 |
+ return dict(now=time.ctime(), versionFlot=versionFlot) |
36 |
|
37 |
@exception_handler(error.error_web,rules="isinstance(tg_exceptions,ValueError)") |
38 |
@expose(template="hardware.templates.token", allow_json=True) |
39 |
diff -up smolt-1.4.3/smoon/hardware/templates/welcome.html.smoon-sme smolt-1.4.3/smoon/hardware/templates/welcome.html |
40 |
--- smolt-1.4.3/smoon/hardware/templates/welcome.html.smoon-sme 2010-02-27 12:05:44.000000000 -0700 |
41 |
+++ smolt-1.4.3/smoon/hardware/templates/welcome.html 2010-07-21 08:53:23.000000000 -0600 |
42 |
@@ -26,7 +26,7 @@ |
43 |
<p> |
44 |
${_("For detailed statistics about the devices in the database see <a href='/static/stats/stats.html'>/stats</a> or <a href='/static/stats/devices.html'>/devices</a>")} |
45 |
</p> |
46 |
- <h2> ${_('Top Vendor Chart')} </h2> |
47 |
- ${ET(vendorFlot.display())} |
48 |
+ <h2> ${_('OS Version Chart')} </h2> |
49 |
+ ${ET(versionFlot.display())} |
50 |
</body> |
51 |
</html> |