From b97e374cdbc7988e193f6377f2604f1d4b6264ea Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 4 Aug 2017 19:23:18 +1000 Subject: minimaws: expose system BIOS, better way of dropping tables --- scripts/minimaws/lib/wsgiserve.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'scripts/minimaws/lib/wsgiserve.py') diff --git a/scripts/minimaws/lib/wsgiserve.py b/scripts/minimaws/lib/wsgiserve.py index 370ca811fa6..e8182f06077 100644 --- a/scripts/minimaws/lib/wsgiserve.py +++ b/scripts/minimaws/lib/wsgiserve.py @@ -207,7 +207,25 @@ class MachineHandler(QueryPageHandler): tuple(imperfect)).encode('utf-8'); yield '\n'.encode('utf-8') + # allow system BIOS selection + haveoptions = False + for name, desc, isdef in self.dbcurs.get_biossets(id): + if not haveoptions: + haveoptions = True; + yield htmltmpl.MACHINE_OPTIONS_HEADING.substitute().encode('utf-8') + yield htmltmpl.MACHINE_BIOS_PROLOGUE.substitute().encode('utf-8') + yield htmltmpl.MACHINE_BIOS_OPTION.substitute( + name=cgi.escape(name, True), + description=cgi.escape(desc), + isdefault=('yes' if isdef else 'no')).encode('utf-8') + if haveoptions: + yield '\n\n'.encode('utf-8') + + # placeholder for machine slots - populated by client-side JavaScript if self.dbcurs.count_slots(id): + if not haveoptions: + haveoptions = True + yield htmltmpl.MACHINE_OPTIONS_HEADING.substitute().encode('utf-8') yield htmltmpl.MACHINE_SLOTS_PLACEHOLDER.substitute( machine=self.js_escape(self.shortname)).encode('utf=8') -- cgit v1.2.3-70-g09d2