Changeset 65226 in vbox
- Timestamp:
- Jan 10, 2017 3:36:36 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 112734
- Location:
- trunk/src/VBox/ValidationKit/testmanager
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/build.py
r65053 r65226 152 152 self.dCache = None; 153 153 154 def fetchForListing(self, iStart, cMaxRows, tsNow ):154 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 155 155 """ 156 156 Fetches testboxes for listing. … … 515 515 # 516 516 517 def fetchForListing(self, iStart, cMaxRows, tsNow ):517 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 518 518 """ 519 519 Fetches builds for listing. … … 522 522 Raises exception on error. 523 523 """ 524 _ = aiSortColumns; 525 524 526 if tsNow is None: 525 527 self._oDb.execute('SELECT *\n' -
trunk/src/VBox/ValidationKit/testmanager/core/buildblacklist.py
r65040 r65226 128 128 self.dCache = None; 129 129 130 def fetchForListing(self, iStart, cMaxRows, tsNow ):130 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 131 131 """ 132 132 Fetches Build Blacklist records. … … 135 135 Raises exception on error. 136 136 """ 137 _ = aiSortColumns; 137 138 138 139 if tsNow is None: -
trunk/src/VBox/ValidationKit/testmanager/core/buildsource.py
r65040 r65226 163 163 # 164 164 165 def fetchForListing(self, iStart, cMaxRows, tsNow ):165 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 166 166 """ 167 167 Fetches build sources. … … 170 170 Raises exception on error. 171 171 """ 172 _ = aiSortColumns; 173 172 174 if tsNow is None: 173 175 self._oDb.execute('SELECT *\n' -
trunk/src/VBox/ValidationKit/testmanager/core/failurecategory.py
r62484 r65226 111 111 self.dCache = None; 112 112 113 def fetchForListing(self, iStart, cMaxRows, tsNow ):113 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 114 114 """ 115 115 Fetches Failure Category records. … … 118 118 Raises exception on error. 119 119 """ 120 _ = aiSortColumns; 120 121 121 122 if tsNow is None: -
trunk/src/VBox/ValidationKit/testmanager/core/failurereason.py
r65040 r65226 149 149 self.oUserAccountLogic = None; 150 150 151 def fetchForListing(self, iStart, cMaxRows, tsNow ):151 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 152 152 """ 153 153 Fetches Failure Category records. … … 156 156 Raises exception on error. 157 157 """ 158 _ = aiSortColumns; 158 159 self._ensureCachesPresent(); 159 160 … … 188 189 return aoRows 189 190 190 def fetchForListingInCategory(self, iStart, cMaxRows, tsNow, idFailureCategory ):191 def fetchForListingInCategory(self, iStart, cMaxRows, tsNow, idFailureCategory, aiSortColumns = None): 191 192 """ 192 193 Fetches Failure Category records. … … 195 196 Raises exception on error. 196 197 """ 198 _ = aiSortColumns; 197 199 self._ensureCachesPresent(); 198 200 -
trunk/src/VBox/ValidationKit/testmanager/core/globalresource.py
r65040 r65226 124 124 self.dCache = None; 125 125 126 def fetchForListing(self, iStart, cMaxRows, tsNow ):126 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 127 127 """ 128 128 Returns an array (list) of FailureReasonData items, empty list if none. 129 129 Raises exception on error. 130 130 """ 131 _ = aiSortColumns; 131 132 132 133 if tsNow is None: -
trunk/src/VBox/ValidationKit/testmanager/core/schedgroup.py
r65040 r65226 434 434 # 435 435 436 def fetchForListing(self, iStart, cMaxRows, tsNow ):436 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 437 437 """ 438 438 Fetches build sources. … … 441 441 Raises exception on error. 442 442 """ 443 _ = aiSortColumns; 443 444 444 445 if tsNow is None: -
trunk/src/VBox/ValidationKit/testmanager/core/systemchangelog.py
r65211 r65226 128 128 129 129 130 def fetchForListingEx(self, iStart, cMaxRows, tsNow, cDaysBack ):130 def fetchForListingEx(self, iStart, cMaxRows, tsNow, cDaysBack, aiSortColumns = None): 131 131 """ 132 132 Fetches SystemLog entries. … … 135 135 Raises exception on error. 136 136 """ 137 _ = aiSortColumns; 137 138 138 139 # -
trunk/src/VBox/ValidationKit/testmanager/core/systemlog.py
r62484 r65226 103 103 ModelLogicBase.__init__(self, oDb); 104 104 105 def fetchForListing(self, iStart, cMaxRows, tsNow ):105 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 106 106 """ 107 107 Fetches SystemLog entries. … … 110 110 Raises exception on error. 111 111 """ 112 _ = aiSortColumns; 112 113 if tsNow is None: 113 114 self._oDb.execute('SELECT *\n' -
trunk/src/VBox/ValidationKit/testmanager/core/testbox.py
r65094 r65226 671 671 """ 672 672 673 kiSortColumn_sName = 0; 674 kiSortColumn_sOs = 1; 675 kiSortColumn_sOsVersion = 2; 676 kiSortColumn_sCpuVendor = 3; 677 kiSortColumn_sCpuArch = 4; 678 kiSortColumn_lCpuRevision = 5; 679 kiSortColumn_cCpus = 6; 680 kiSortColumn_cMbMemory = 7; 681 kiSortColumn_cMbScratch = 8; 682 kiSortColumn_fNestedPaging = 9; 683 kiSortColumn_iTestBoxScriptRev = 10; 684 kiSortColumn_iPythonHexVersion = 11; 685 kcMaxSortColumns = 12; 686 kdSortColumnMap = { 687 kiSortColumn_sName: 'TestBoxesWithStrings.sName', 688 kiSortColumn_sOs: 'TestBoxesWithStrings.sOs', 689 kiSortColumn_sOsVersion: 'TestBoxesWithStrings.sOsVersion', 690 kiSortColumn_sCpuVendor: 'TestBoxesWithStrings.sCpuVendor', 691 kiSortColumn_sCpuArch: 'TestBoxesWithStrings.sCpuArch', 692 kiSortColumn_lCpuRevision: 'TestBoxesWithStrings.lCpuRevision', 693 kiSortColumn_cCpus: 'TestBoxesWithStrings.cCpus', 694 kiSortColumn_cMbMemory: 'TestBoxesWithStrings.cMbMemory', 695 kiSortColumn_cMbScratch: 'TestBoxesWithStrings.cMbScratch', 696 kiSortColumn_fNestedPaging: 'TestBoxesWithStrings.fNestedPaging', 697 kiSortColumn_iTestBoxScriptRev: 'TestBoxesWithStrings.iTestBoxScriptRev', 698 kiSortColumn_iPythonHexVersion: 'TestBoxesWithStrings.iPythonHexVersion', 699 }; 673 700 674 701 def __init__(self, oDb): … … 694 721 return oData; 695 722 696 def fetchForListing(self, iStart, cMaxRows, tsNow ):723 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 697 724 """ 698 725 Fetches testboxes for listing. … … 713 740 714 741 from testmanager.core.testboxstatus import TestBoxStatusData; 742 743 if aiSortColumns is None or len(aiSortColumns) == 0: 744 aiSortColumns = [self.kiSortColumn_sName,]; 715 745 716 746 if tsNow is None: … … 721 751 ' ON TestBoxStatuses.idTestBox = TestBoxesWithStrings.idTestBox\n' 722 752 'WHERE TestBoxesWithStrings.tsExpire = \'infinity\'::TIMESTAMP\n' 723 'ORDER BY TestBoxesWithStrings.sName\n'753 'ORDER BY ' + (', '.join([self.kdSortColumnMap[i] for i in aiSortColumns])) + '\n' 724 754 'LIMIT %s OFFSET %s\n' 725 755 , (cMaxRows, iStart,)); … … 732 762 'WHERE tsExpire > %s\n' 733 763 ' AND tsEffective <= %s\n' 734 'ORDER BY TestBoxesWithStrings.sName\n'764 'ORDER BY ' + (', '.join([self.kdSortColumnMap[i] for i in aiSortColumns])) + '\n' 735 765 'LIMIT %s OFFSET %s\n' 736 766 , ( tsNow, tsNow, cMaxRows, iStart,)); -
trunk/src/VBox/ValidationKit/testmanager/core/testcase.py
r62484 r65226 965 965 return aoRet 966 966 967 def fetchForListing(self, iStart, cMaxRows, tsNow ):967 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 968 968 """ 969 969 Fetches test cases. … … 972 972 Raises exception on error. 973 973 """ 974 _ = aiSortColumns; 974 975 if tsNow is None: 975 976 self._oDb.execute('SELECT *\n' -
trunk/src/VBox/ValidationKit/testmanager/core/testgroup.py
r65040 r65226 380 380 # 381 381 382 def fetchForListing(self, iStart, cMaxRows, tsNow ):382 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 383 383 """ 384 384 Fetches test groups. … … 387 387 Raises exception on error. 388 388 """ 389 _ = aiSortColumns; 389 390 if tsNow is None: 390 391 self._oDb.execute('SELECT *\n' -
trunk/src/VBox/ValidationKit/testmanager/core/useraccount.py
r62484 r65226 123 123 self.dCache = None; 124 124 125 def fetchForListing(self, iStart, cMaxRows, tsNow ):125 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 126 126 """ 127 127 Fetches user accounts. … … 130 130 Raises exception on error. 131 131 """ 132 _ = aiSortColumns; 132 133 if tsNow is None: 133 134 self._oDb.execute('SELECT *\n' -
trunk/src/VBox/ValidationKit/testmanager/core/vcsrevisions.py
r62484 r65226 113 113 # 114 114 115 def fetchForListing(self, iStart, cMaxRows, tsNow ):115 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 116 116 """ 117 117 Fetches VCS revisions for listing. … … 120 120 Raises exception on error. 121 121 """ 122 _ = tsNow; 122 _ = tsNow; _ = aiSortColumns; 123 123 self._oDb.execute('SELECT *\n' 124 124 'FROM VcsRevisions\n' -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestbox.py
r64986 r65226 39 39 from testmanager.core.db import TMDatabaseConnection; 40 40 from testmanager.core.schedgroup import SchedGroupLogic, SchedGroupData; 41 from testmanager.core.testbox import TestBoxData, TestBoxDataEx ;41 from testmanager.core.testbox import TestBoxData, TestBoxDataEx, TestBoxLogic; 42 42 from testmanager.core.testset import TestSetData; 43 43 from testmanager.core.db import isDbTimestampInfinity; … … 192 192 '', '', '', 'align="left"', 'align="right"', 'align="right"', 'align="right"', 193 193 'align="center"' ]); 194 self._aaiColumnSorting.extend([ 195 (TestBoxLogic.kiSortColumn_sName,), 196 None, # LOM 197 None, # Status 198 None, # Cmd 199 None, # Note 200 (TestBoxLogic.kiSortColumn_iTestBoxScriptRev,), 201 (TestBoxLogic.kiSortColumn_iPythonHexVersion,), 202 None, # Group 203 (TestBoxLogic.kiSortColumn_sOs, TestBoxLogic.kiSortColumn_sOsVersion, TestBoxLogic.kiSortColumn_sCpuArch,), 204 (TestBoxLogic.kiSortColumn_sCpuVendor, TestBoxLogic.kiSortColumn_lCpuRevision,), 205 (TestBoxLogic.kiSortColumn_fNestedPaging,), 206 (TestBoxLogic.kiSortColumn_cCpus,), 207 (TestBoxLogic.kiSortColumn_cMbMemory,), 208 (TestBoxLogic.kiSortColumn_cMbScratch,), 209 None, # Actions 210 ]); 211 assert len(self._aaiColumnSorting) == len(self._asColumnHeaders); 194 212 self._aoActions = list(self.kasTestBoxActionDescs); 195 213 self._sAction = oDisp.ksActionTestBoxListPost; -
trunk/src/VBox/ValidationKit/testmanager/webui/wuibase.py
r65086 r65226 82 82 ## The name of the list-action parameter (WuiListContentWithActionBase). 83 83 ksParamListAction = 'ListAction'; 84 85 ## One or more columns to sort by. 86 ksParamSortColumns = 'SortBy'; 84 87 85 88 ## The name of the change log enabled/disabled parameter. … … 801 804 cItemsPerPage = self.getIntParam(self.ksParamItemsPerPage, iMin = 2, iMax = 9999, iDefault = 300); 802 805 iPage = self.getIntParam(self.ksParamPageNo, iMin = 0, iMax = 999999, iDefault = 0); 806 aiSortColumnsDup = self.getListOfIntParams(self.ksParamSortColumns, iMin = 0, 807 iMax = getattr(oLogicType, 'kcMaxSortColumns', 0), aiDefaults = []); 808 aiSortColumns = []; 809 for iSortColumn in aiSortColumnsDup: 810 if iSortColumn not in aiSortColumns: 811 aiSortColumns.append(iSortColumn); 803 812 self._checkForUnknownParameters(); 804 813 805 aoEntries = oLogicType(self._oDb).fetchForListing(iPage * cItemsPerPage, cItemsPerPage + 1, tsEffective );814 aoEntries = oLogicType(self._oDb).fetchForListing(iPage * cItemsPerPage, cItemsPerPage + 1, tsEffective, aiSortColumns); 806 815 oContent = oListContentType(aoEntries, iPage, cItemsPerPage, tsEffective, 807 816 fnDPrint = self._oSrvGlue.dprint, oDisp = self); -
trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py
r65052 r65226 749 749 self._asColumnHeaders = []; 750 750 self._asColumnAttribs = []; 751 self._aaiColumnSorting = []; ##< list of list of integers 751 752 752 753 def _formatCommentCell(self, sComment, cMaxLines = 3, cchMaxLine = 63): … … 944 945 945 946 sHtml = ' <thead class="tmheader"><tr>'; 946 for oHeader in self._asColumnHeaders:947 for iHeader, oHeader in enumerate(self._asColumnHeaders): 947 948 if isinstance(oHeader, WuiHtmlBase): 948 949 sHtml += '<th>' + oHeader.toHtml() + '</th>'; 950 elif iHeader < len(self._aaiColumnSorting) and self._aaiColumnSorting[iHeader] is not None: 951 sHtml += '<th>' 952 sHtml += '<a href="javascript:ahrefActionSortByColumns(\'%s\', [%s]);">' \ 953 % (WuiDispatcherBase.ksParamSortColumns, ','.join([str(i) for i in self._aaiColumnSorting[iHeader]])); 954 sHtml += webutils.escapeElem(oHeader) + '</a></th>'; 949 955 else: 950 956 sHtml += '<th>' + webutils.escapeElem(oHeader) + '</th>'; … … 1024 1030 % ('' if sId is None else sId)), ]; 1025 1031 self._asColumnAttribs = [ 'align="center"', ]; 1032 self._aaiColumnSorting = [ None, ]; 1026 1033 1027 1034 def _getCheckBoxColumn(self, iEntry, sValue):
Note:
See TracChangeset
for help on using the changeset viewer.