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