Changeset 61424 in vbox for trunk/src/VBox/ValidationKit/testmanager/webui
- Timestamp:
- Jun 3, 2016 2:22:30 AM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager/webui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmin.py
r61422 r61424 405 405 return False 406 406 407 def _actionGenericDoRemove(self, oLogicType, sParamId, sRedirAction):408 """409 Delete entry (using oLogicType.removeEntry).410 411 oLogicType is a class that implements addEntry.412 413 sParamId is the name (ksParam_...) of the HTTP variable hold the ID of414 the database entry to delete.415 416 sRedirAction is what action to redirect to on success.417 """418 idEntry = self.getIntParam(sParamId, iMin = 1, iMax = 0x7fffffe)419 fCascade = self.getBoolParam('fCascadeDelete', False);420 self._checkForUnknownParameters()421 422 try:423 self._sPageTitle = None424 self._sPageBody = None425 self._sRedirectTo = self._sActionUrlBase + sRedirAction;426 return oLogicType(self._oDb).removeEntry(self._oCurUser.uid, idEntry, fCascade = fCascade, fCommit = True);427 except Exception as oXcpt:428 self._oDb.rollback();429 self._sPageTitle = 'Unable to delete entry';430 self._sPageBody = str(oXcpt);431 if config.g_kfDebugDbXcpt:432 self._sPageBody += cgitb.html(sys.exc_info());433 self._sRedirectTo = None;434 return False;435 436 407 437 408 # -
trunk/src/VBox/ValidationKit/testmanager/webui/wuibase.py
r61267 r61424 822 822 return True 823 823 824 def _actionGenericDoRemove(self, oLogicType, sParamId, sRedirAction): 825 """ 826 Delete entry (using oLogicType.removeEntry). 827 828 oLogicType is a class that implements addEntry. 829 830 sParamId is the name (ksParam_...) of the HTTP variable hold the ID of 831 the database entry to delete. 832 833 sRedirAction is what action to redirect to on success. 834 """ 835 idEntry = self.getIntParam(sParamId, iMin = 1, iMax = 0x7ffffffe) 836 fCascade = self.getBoolParam('fCascadeDelete', False); 837 self._checkForUnknownParameters() 838 839 try: 840 self._sPageTitle = None 841 self._sPageBody = None 842 self._sRedirectTo = self._sActionUrlBase + sRedirAction; 843 return oLogicType(self._oDb).removeEntry(self._oCurUser.uid, idEntry, fCascade = fCascade, fCommit = True); 844 except Exception as oXcpt: 845 self._oDb.rollback(); 846 self._sPageTitle = 'Unable to delete entry'; 847 self._sPageBody = str(oXcpt); 848 if config.g_kfDebugDbXcpt: 849 self._sPageBody += cgitb.html(sys.exc_info()); 850 self._sRedirectTo = None; 851 return False; 824 852 825 853 def _actionGenericFormEdit(self, oDataType, oFormType, sIdParamName = None, sRedirectTo = None): -
trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py
r61272 r61424 606 606 aoActions.append(WuiTmLink('Details', '', dParams)); 607 607 608 # Add delete operation if available. 609 if hasattr(self._oDisp, self._sActionBase + 'DoRemove'): 610 dParams = self._oDisp.getParameters(); 611 dParams[WuiDispatcherBase.ksParamAction] = getattr(self._oDisp, self._sActionBase + 'DoRemove'); 612 dParams[getattr(oData, 'ksParam_' + oData.ksIdAttr)] = getattr(oData, oData.ksIdAttr); 613 aoActions.append(WuiTmLink('Delete', '', dParams, sConfirm = "Are you absolutely sure?")); 614 608 615 return aoActions; 609 616 -
trunk/src/VBox/ValidationKit/testmanager/webui/wuimain.py
r61422 r61424 68 68 ksActionTestResultFailureEdit = 'TestResultFailureEdit' 69 69 ksActionTestResultFailureEditPost = 'TestResultFailureEditPost' 70 ksActionTestResultFailureDoRemove = 'TestResultFailureDoRemove' 70 71 ksActionViewLog = 'ViewLog' 71 72 ksActionGetFile = 'GetFile' … … 208 209 self._dDispatch[self.ksActionTestResultFailureAddPost] = self._actionTestResultFailureAddPost; 209 210 self._dDispatch[self.ksActionTestResultFailureDetails] = self._actionTestResultFailureDetails; 211 self._dDispatch[self.ksActionTestResultFailureDoRemove] = self._actionTestResultFailureDoRemove; 210 212 self._dDispatch[self.ksActionTestResultFailureEdit] = self._actionTestResultFailureEdit; 211 213 self._dDispatch[self.ksActionTestResultFailureEditPost] = self._actionTestResultFailureEditPost; … … 969 971 WuiTestResultFailure, self.ksActionResultsUnGrouped); 970 972 973 def _actionTestResultFailureDoRemove(self): 974 """ Action wrapper. """ 975 from testmanager.core.testresultfailures import TestResultFailureData, TestResultFailureLogic; 976 from testmanager.webui.wuitestresultfailure import WuiTestResultFailure; 977 return self._actionGenericDoRemove(TestResultFailureLogic, TestResultFailureData.ksParam_idTestResult, 978 self.ksActionResultsUnGrouped); 979 971 980 def _actionTestResultFailureDetails(self): 972 981 """ Pro forma. """ -
trunk/src/VBox/ValidationKit/testmanager/webui/wuitestresult.py
r61306 r61424 182 182 if oTestResult.tsElapsed is not None: 183 183 tsEvent += oTestResult.tsElapsed; 184 sHtml = ' <tr class="%s tmtbl-events-leaf tmtbl-events-lvl%s tmstatusrow-%s" >\n' \185 ' <td >%s</td>\n' \184 sHtml = ' <tr class="%s tmtbl-events-leaf tmtbl-events-lvl%s tmstatusrow-%s" id="S%u">\n' \ 185 ' <td id="E%u">%s</td>\n' \ 186 186 ' <td>%s</td>\n' \ 187 187 ' <td>%s</td>\n' \ … … 190 190 ' <td>%s</td>\n' \ 191 191 ' </tr>\n' \ 192 % ( 'tmodd' if iRow & 1 else 'tmeven', iDepth, oTestResult.enmStatus, 193 webutils.escapeElem(self.formatTsShort(tsEvent)),192 % ( 'tmodd' if iRow & 1 else 'tmeven', iDepth, oTestResult.enmStatus, oTestResult.idTestResult, 193 oTestResult.idTestResult, webutils.escapeElem(self.formatTsShort(tsEvent)), 194 194 sElapsedGraph, 195 195 webutils.escapeElem(self.formatIntervalShort(oTestResult.tsElapsed)) if oTestResult.tsElapsed is not None … … 307 307 # Done? 308 308 if oTestResult.tsElapsed is not None: 309 sHtml += ' <tr class="%s tmtbl-events-final tmtbl-events-lvl%s tmstatusrow-%s" >\n' \309 sHtml += ' <tr class="%s tmtbl-events-final tmtbl-events-lvl%s tmstatusrow-%s" id="E%d">\n' \ 310 310 ' <td>%s</td>\n' \ 311 311 ' <td>%s</td>\n' \ … … 315 315 ' <td>%s</td>\n' \ 316 316 ' </tr>\n' \ 317 % ( 'tmodd' if iRow & 1 else 'tmeven', iDepth, oTestResult.enmStatus, 317 % ( 'tmodd' if iRow & 1 else 'tmeven', iDepth, oTestResult.enmStatus, oTestResult.idTestResult, 318 318 webutils.escapeElem(self.formatTsShort(oTestResult.tsCreated + oTestResult.tsElapsed)), 319 319 sElapsedGraph,
Note:
See TracChangeset
for help on using the changeset viewer.