Changeset 65430 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Jan 24, 2017 3:58:34 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 113043
- Location:
- trunk/src/VBox/ValidationKit/testmanager
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/report.py
r65213 r65430 531 531 if/when it becomes necessary. 532 532 """ 533 534 533 535 534 kdsStatusSimplificationMap = { -
trunk/src/VBox/ValidationKit/testmanager/htdocs/js/common.js
r65227 r65430 259 259 var offValue = offMatch + 1 + sParam.length + 1; 260 260 offEnd = sArgs.indexOf('&', offValue); 261 if (offEnd < 0)261 if (offEnd < offValue) 262 262 offEnd = sArgs.length; 263 263 264 264 var iColumn = parseInt(sArgs.substring(offValue, offEnd)); 265 265 if (!isMemberOfArray(aiColumns, iColumn) && !isMemberOfArray(aiColumns, -iColumn)) 266 sNew += sArgs.substring(off , offEnd);266 sNew += sArgs.substring(offMatch, offEnd); 267 267 268 268 off = offEnd; -
trunk/src/VBox/ValidationKit/testmanager/webui/wuimain.py
r65165 r65430 1256 1256 if aidSubjects is None: 1257 1257 raise WuiException('Missing parameter %s' % (self.ksParamReportSubjectIds,)); 1258 1259 aiSortColumnsDup = self.getListOfIntParams(self.ksParamSortColumns, 1260 iMin = -getattr(oReportType, 'kcMaxSortColumns', cPeriods) + 1, 1261 iMax = getattr(oReportType, 'kcMaxSortColumns', cPeriods), aiDefaults = []); 1262 aiSortColumns = []; 1263 for iSortColumn in aiSortColumnsDup: 1264 if iSortColumn not in aiSortColumns: 1265 aiSortColumns.append(iSortColumn); 1266 1258 1267 oFilter = oFilterType().initFromParams(self); 1259 1268 self._checkForUnknownParameters(); … … 1270 1279 1271 1280 oModel = oModelType(self._oDb, tsEffective, cPeriods, cHoursPerPeriod, sSubject, aidSubjects, oFilter); 1272 oContent = oReportType(oModel, dParams, fSubReport = False, fnDPrint = self._oSrvGlue.dprint, oDisp = self); 1281 oContent = oReportType(oModel, dParams, fSubReport = False, aiSortColumns = aiSortColumns, 1282 fnDPrint = self._oSrvGlue.dprint, oDisp = self); 1273 1283 (self._sPageTitle, self._sPageBody) = oContent.show(); 1274 1284 sNavi = self._generateReportNavigation(tsEffective, cHoursPerPeriod, cPeriods); -
trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py
r62484 r65430 67 67 """ 68 68 69 def __init__(self, oModel, dParams, fSubReport = False, fnDPrint = None, oDisp = None):69 def __init__(self, oModel, dParams, fSubReport = False, aiSortColumns = None, fnDPrint = None, oDisp = None): 70 70 WuiContentBase.__init__(self, fnDPrint = fnDPrint, oDisp = oDisp); 71 71 self._oModel = oModel; … … 73 73 self._fSubReport = fSubReport; 74 74 self._sTitle = None; 75 self._aiSortColumns = aiSortColumns; 75 76 76 77 # Additional URL parameters for reports … … 283 284 sHtml += self._formatSeriesNameColumnHeadersForTable(); 284 285 for iPeriod, oPeriod in enumerate(reversed(oSet.aoPeriods)): 285 sHtml += u'<th colspan="%d">%s%s</th>' % ( cColsPerSeries, webutils.escapeElem(oPeriod.sDesc), 286 '▼' if iPeriod == iSortColumn else ''); 286 sHtml += u'<th colspan="%d"><a href="javascript:ahrefActionSortByColumns(\'%s\',[%s]);">%s</a>%s</th>' \ 287 % ( cColsPerSeries, self._oDisp.ksParamSortColumns, iPeriod, webutils.escapeElem(oPeriod.sDesc), 288 '▼' if iPeriod == iSortColumn else ''); 287 289 if fWithTotals: 288 sHtml += u'<th colspan="%d">Total%s</th>' % (cColsPerSeries, 289 '▼' if iSortColumn == len(oSet.aoPeriods) else ''); 290 sHtml += u'<th colspan="%d"><a href="javascript:ahrefActionSortByColumns(\'%s\',[%s]);">Total</a>%s</th>' \ 291 % ( cColsPerSeries, self._oDisp.ksParamSortColumns, iPeriod, 292 '▼' if iSortColumn == len(oSet.aoPeriods) else ''); 290 293 sHtml += u'</thead></td>\n'; 291 294 … … 320 323 return str(oSubject); 321 324 322 def _getSortedIds(self, oSet , fByTotal = None):325 def _getSortedIds(self, oSet): 323 326 """ 324 327 Get default sorted subject IDs and which column. 325 328 """ 326 329 327 if fByTotal is None: 328 fByTotal = oSet.cMaxTotal < 10; 329 330 if fByTotal is True: 330 # Figure the sorting column. 331 if self._aiSortColumns is not None \ 332 and len(self._aiSortColumns) > 0 \ 333 and abs(self._aiSortColumns[0]) <= len(oSet.aoPeriods): 334 iSortColumn = abs(self._aiSortColumns[0]); 335 fByTotal = iSortColumn >= len(oSet.aoPeriods); 336 elif oSet.cMaxTotal < 10: 337 iSortColumn = len(oSet.aoPeriods); 338 else: 339 iSortColumn = 0; 340 341 if iSortColumn >= len(oSet.aoPeriods): 331 342 # Sort the total. 332 343 aidSortedRaw = sorted(oSet.dSubjects, 333 344 key = lambda idKey: oSet.dcHitsPerId[idKey] * 10000 / oSet.dcTotalPerId[idKey], 334 345 reverse = True); 335 iColumn = len(oSet.aoPeriods);336 346 else: 337 347 # Sort by NOW column. 338 348 dTmp = {}; 339 349 for idKey in oSet.dSubjects: 340 oRow = oSet.aoPeriods[-1 ].dRowsById.get(idKey, None);350 oRow = oSet.aoPeriods[-1 - iSortColumn].dRowsById.get(idKey, None); 341 351 if oRow is None: dTmp[idKey] = 0; 342 352 else: dTmp[idKey] = oRow.cHits * 10000 / max(1, oRow.cTotal); 343 353 aidSortedRaw = sorted(dTmp, key = lambda idKey: dTmp[idKey], reverse = True); 344 iColumn = 0; 345 return (aidSortedRaw, iColumn); 354 return (aidSortedRaw, iSortColumn); 346 355 347 356 def _generateGraph(self, oSet, sIdBase, aidSortedRaw): … … 629 638 630 639 aoReports.append(WuiReportSuccessRate( self._oModel, self._dParams, fSubReport = True, 640 aiSortColumns = self._aiSortColumns, 631 641 fnDPrint = self._fnDPrint, oDisp = self._oDisp)); 632 642 aoReports.append(WuiReportTestCaseFailures(self._oModel, self._dParams, fSubReport = True, 643 aiSortColumns = self._aiSortColumns, 633 644 fnDPrint = self._fnDPrint, oDisp = self._oDisp)); 634 645 if self._oModel.sSubject == ReportModelBase.ksSubTestCase: 635 646 aoReports.append(WuiReportTestCaseArgsFailures(self._oModel, self._dParams, fSubReport = True, 647 aiSortColumns = self._aiSortColumns, 636 648 fnDPrint = self._fnDPrint, oDisp = self._oDisp)); 637 649 aoReports.append(WuiReportTestBoxFailures( self._oModel, self._dParams, fSubReport = True, 650 aiSortColumns = self._aiSortColumns, 638 651 fnDPrint = self._fnDPrint, oDisp = self._oDisp)); 639 652 aoReports.append(WuiReportFailureReasons( self._oModel, self._dParams, fSubReport = True, 653 aiSortColumns = self._aiSortColumns, 640 654 fnDPrint = self._fnDPrint, oDisp = self._oDisp)); 641 655
Note:
See TracChangeset
for help on using the changeset viewer.