wuiadmintestbox.py revision 3f8c00daa9a41eeb005842cd21f9edbe0ed61193
# -*- coding: utf-8 -*-
# $Id$
"""
Test Manager WUI - TestBox.
"""
__copyright__ = \
"""
Copyright (C) 2012-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
General Public License (GPL) as published by the Free Software
Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
The contents of this file may alternatively be used under the terms
of the Common Development and Distribution License Version 1.0
(CDDL) only, as it comes in the "COPYING.CDDL" file of the
VirtualBox OSE distribution, in which case the provisions of the
CDDL are applicable instead of those of the GPL.
You may elect to license modified versions of this file under the
terms and conditions of either the GPL or the CDDL or both.
"""
__version__ = "$Revision$"
# Standard python imports.
import socket;
# Validation Kit imports.
from testmanager.webui.wuicontentbase import WuiListContentWithActionBase, WuiFormContentBase, WuiLinkBase, WuiSvnLink, \
class WuiTestBox(WuiFormContentBase):
"""
WUI TestBox Form Content Generator.
"""
sTitle = 'Create TextBox';
else:
# Try enter sName as hostname (no domain) when creating the testbox.
try:
except:
pass;
if offDot > 0:
oForm.addInt( TestBoxData.ksParam_pctScaleTimeout, oData.pctScaleTimeout, 'Timeout scale factor (%)');
## @todo Pretty format the read-only fields and use hidden fields for
# passing the actual values. (Yes, we need the values so we can
# display the form correctly on input error.)
if oData.lCpuRevision:
oForm.addTextRO( TestBoxData.ksParam_lCpuRevision, '%#x' % (oData.lCpuRevision,), 'TestBox CPU revision',
sPostHtml = ' (family=%#x model=%#x stepping=%#x)'
sSubClass = 'long');
else:
oForm.addCheckBoxRO( TestBoxData.ksParam_fCpuNestedPaging, oData.fCpuNestedPaging, 'Nested paging supported');
oForm.addCheckBoxRO( TestBoxData.ksParam_fCpu64BitGuest, oData.fCpu64BitGuest, '64-bit guest supported');
'TestBox Script SVN revision');
# Later:
#if not self.isAttributeNull(''):
# sHexVer = '%s.%s.%.%s' % (oData.iPythonHexVersion >> 24, (oData.iPythonHexVersion >> 16) & 0xff,
# (oData.iPythonHexVersion >> 8) & 0xff, oData.iPythonHexVersion & 0xff);
#else:
# sHexVer = str(oData.iPythonHexVersion);
'Python version (hex)');
else:
oForm.addSubmit('Create TestBox' if self._sMode == WuiFormContentBase.ksMode_Add else 'Change TestBox');
return True;
"""
WUI TestBox List Content Generator.
"""
## Descriptors for the combo box.
[ \
[ 'none', 'Select an action...', '' ],
[ 'enable', 'Enable', '' ],
[ 'disable', 'Disable', '' ],
];
'Cmd', 'Script', 'Python', 'Group',
'OS', 'CPU', 'Features', 'CPUs', 'RAM', 'Scratch',
'Actions' ]);
'align="center"', 'align="center"', 'align="center"', 'align="center"',
'', '', '', 'align="right"', 'align="right"', 'align="right"',
'align="center"' ]);
# Lights outs managment.
aoLom = [ 'Apple LOM' ];
aoLom = [ 'none' ];
else:
# State and Last seen.
oState = '';
else:
oSeen = WuiSpanText('tmspan-online', u'%s\u00a0s\u00a0ago' % (oDelta.days * 24 * 3600 + oDelta.seconds,));
else:
else:
fBracketed = False);
# Group link.
fBracketed = False);
# Reformat the OS version to take less space.
aoOs = [ 'N/A' ];
sVer1 = sOsVersion;
sVer2 = None;
if iSep > 0:
aoOs = [
];
if sVer2 is not None:
# Format the CPU revision.
oCpu = None;
if oEntry.lCpuRevision is not None and oEntry.sCpuVendor is not None and oEntry.sCpuName is not None:
oCpu = [
u'%s (fam:%xh\u00a0m:%xh\u00a0s:%xh)'
WuiRawHtml('<br>'),
];
else:
oCpu = [];
if oEntry.sCpuVendor is not None:
if oEntry.lCpuRevision is not None:
asFeatures = []
# Collection applicable actions.
aoActions = [
]
aoActions += [
]
[
WuiRawHtml('<br>'),
],
aoOs,
oCpu,
utils.formatNumberNbsp(oEntry.cMbScratch) + u'\u00a0MB' if oEntry.cMbScratch is not None else 'N/A',
];