]> git.ipfire.org Git - ipfire.org.git/blame - www/webapp/handlers_stasy.py
Add netboot feature.
[ipfire.org.git] / www / webapp / handlers_stasy.py
CommitLineData
940227cb
MT
1#!/usr/bin/python
2
3import tornado.web
4
372efc19
MT
5import backend
6
940227cb
MT
7from handlers_base import *
8
9class StasyBaseHandler(BaseHandler):
10 @property
11 def stasy(self):
12 return backend.Stasy()
13
14
15class StasyIndexHandler(StasyBaseHandler):
16 def get(self):
17 profiles = self.stasy.get_profiles()
18
19 self.render("stasy-index.html", profiles=profiles)
20
21
22class StasyProfileHandler(StasyBaseHandler):
23 def get(self, profile_id):
24 profile = self.stasy.get_profile(profile_id)
25 if not profile:
26 raise tornado.web.HTTPError(404, "Profile not found: %s" % profile_id)
27
28 self.render("stasy-profile.html", profile=profile)
372efc19
MT
29
30
31class StasyStatsCPUHandler(StasyBaseHandler):
32 def get(self):
33 return self.render("stasy-stats-cpus.html",
34 cpu_vendors = self.stasy.cpu_map)
35
36
37class StasyStatsVirtualHandler(StasyBaseHandler):
38 def get(self):
39 return self.render("stasy-stats-virtual.html",
40 hypervisor_vendors = self.stasy.hypervisor_map,
41 is_virtual = self.stasy.virtual_map)