1 | # -*- coding: utf-8 -*-
|
---|
2 | # "$Id: wuiadminschedqueue.py 83362 2020-03-21 17:06:38Z vboxsync $"
|
---|
3 |
|
---|
4 | """
|
---|
5 | Test Manager WUI - Admin - Scheduling Queue.
|
---|
6 | """
|
---|
7 |
|
---|
8 | __copyright__ = \
|
---|
9 | """
|
---|
10 | Copyright (C) 2012-2020 Oracle Corporation
|
---|
11 |
|
---|
12 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
13 | available from http://www.virtualbox.org. This file is free software;
|
---|
14 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
15 | General Public License (GPL) as published by the Free Software
|
---|
16 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
17 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
18 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
19 |
|
---|
20 | The contents of this file may alternatively be used under the terms
|
---|
21 | of the Common Development and Distribution License Version 1.0
|
---|
22 | (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
23 | VirtualBox OSE distribution, in which case the provisions of the
|
---|
24 | CDDL are applicable instead of those of the GPL.
|
---|
25 |
|
---|
26 | You may elect to license modified versions of this file under the
|
---|
27 | terms and conditions of either the GPL or the CDDL or both.
|
---|
28 | """
|
---|
29 | __version__ = "$Revision: 83362 $"
|
---|
30 |
|
---|
31 |
|
---|
32 | # Validation Kit imports
|
---|
33 | from testmanager.webui.wuicontentbase import WuiListContentBase
|
---|
34 |
|
---|
35 |
|
---|
36 | class WuiAdminSchedQueueList(WuiListContentBase):
|
---|
37 | """
|
---|
38 | WUI Scheduling Queue Content Generator.
|
---|
39 | """
|
---|
40 | def __init__(self, aoEntries, iPage, cItemsPerPage, tsEffective, fnDPrint, oDisp, aiSelectedSortColumns = None):
|
---|
41 | tsEffective = None; # Not relevant, no history on the scheduling queue.
|
---|
42 | WuiListContentBase.__init__(self, aoEntries, iPage, cItemsPerPage, tsEffective, 'Scheduling Queue',
|
---|
43 | fnDPrint = fnDPrint, oDisp = oDisp, aiSelectedSortColumns = aiSelectedSortColumns,
|
---|
44 | fTimeNavigation = False);
|
---|
45 | self._asColumnHeaders = [
|
---|
46 | 'Last Run', 'Scheduling Group', 'Test Group', 'Test Case', 'Config State', 'Item ID'
|
---|
47 | ];
|
---|
48 | self._asColumnAttribs = [
|
---|
49 | 'align="center"', 'align="center"', 'align="center"', 'align="center"', 'align="center"', 'align="center"'
|
---|
50 | ];
|
---|
51 | self._iPrevPerSchedGroupRowNumber = 0;
|
---|
52 |
|
---|
53 | def _formatListEntry(self, iEntry):
|
---|
54 | oEntry = self._aoEntries[iEntry] # type: SchedQueueEntry
|
---|
55 | sState = 'up-to-date' if oEntry.fUpToDate else 'outdated';
|
---|
56 | return [ oEntry.tsLastScheduled, oEntry.sSchedGroup, oEntry.sTestGroup, oEntry.sTestCase, sState, oEntry.idItem ];
|
---|
57 |
|
---|
58 | def _formatListEntryHtml(self, iEntry):
|
---|
59 | sHtml = WuiListContentBase._formatListEntryHtml(self, iEntry);
|
---|
60 |
|
---|
61 | # Insert separator row?
|
---|
62 | if iEntry < len(self._aoEntries):
|
---|
63 | oEntry = self._aoEntries[iEntry] # type: SchedQueueEntry
|
---|
64 | if oEntry.iPerSchedGroupRowNumber != self._iPrevPerSchedGroupRowNumber:
|
---|
65 | if iEntry > 0 and iEntry + 1 < min(len(self._aoEntries), self._cItemsPerPage):
|
---|
66 | sHtml += '<tr class="tmseparator"><td colspan=%s> </td></tr>\n' % (len(self._asColumnHeaders),);
|
---|
67 | self._iPrevPerSchedGroupRowNumber = oEntry.iPerSchedGroupRowNumber;
|
---|
68 | return sHtml;
|
---|
69 |
|
---|