VirtualBox

Ignore:
Timestamp:
Jun 3, 2016 2:22:30 AM (9 years ago)
Author:
vboxsync
Message:

vsheriff: Some progress.

Location:
trunk/src/VBox/ValidationKit/testmanager/webui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmin.py

    r61422 r61424  
    405405        return False
    406406
    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 of
    414         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  = None
    424             self._sPageBody   = None
    425             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 
    436407
    437408    #
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuibase.py

    r61267 r61424  
    822822        return True
    823823
     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;
    824852
    825853    def _actionGenericFormEdit(self, oDataType, oFormType, sIdParamName = None, sRedirectTo = None):
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py

    r61272 r61424  
    606606            aoActions.append(WuiTmLink('Details', '', dParams));
    607607
     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
    608615        return aoActions;
    609616
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuimain.py

    r61422 r61424  
    6868    ksActionTestResultFailureEdit       = 'TestResultFailureEdit'
    6969    ksActionTestResultFailureEditPost   = 'TestResultFailureEditPost'
     70    ksActionTestResultFailureDoRemove   = 'TestResultFailureDoRemove'
    7071    ksActionViewLog                     = 'ViewLog'
    7172    ksActionGetFile                     = 'GetFile'
     
    208209        self._dDispatch[self.ksActionTestResultFailureAddPost]      = self._actionTestResultFailureAddPost;
    209210        self._dDispatch[self.ksActionTestResultFailureDetails]      = self._actionTestResultFailureDetails;
     211        self._dDispatch[self.ksActionTestResultFailureDoRemove]     = self._actionTestResultFailureDoRemove;
    210212        self._dDispatch[self.ksActionTestResultFailureEdit]         = self._actionTestResultFailureEdit;
    211213        self._dDispatch[self.ksActionTestResultFailureEditPost]     = self._actionTestResultFailureEditPost;
     
    969971                                              WuiTestResultFailure, self.ksActionResultsUnGrouped);
    970972
     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
    971980    def _actionTestResultFailureDetails(self):
    972981        """ Pro forma. """
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuitestresult.py

    r61306 r61424  
    182182            if oTestResult.tsElapsed is not None:
    183183                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' \
    186186                     '  <td>%s</td>\n' \
    187187                     '  <td>%s</td>\n' \
     
    190190                     '  <td>%s</td>\n' \
    191191                     ' </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)),
    194194                       sElapsedGraph,
    195195                       webutils.escapeElem(self.formatIntervalShort(oTestResult.tsElapsed)) if oTestResult.tsElapsed is not None
     
    307307            # Done?
    308308            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' \
    310310                         '  <td>%s</td>\n' \
    311311                         '  <td>%s</td>\n' \
     
    315315                         '  <td>%s</td>\n' \
    316316                         ' </tr>\n' \
    317                        % ( 'tmodd' if iRow & 1 else 'tmeven', iDepth, oTestResult.enmStatus,
     317                       % ( 'tmodd' if iRow & 1 else 'tmeven', iDepth, oTestResult.enmStatus, oTestResult.idTestResult,
    318318                           webutils.escapeElem(self.formatTsShort(oTestResult.tsCreated + oTestResult.tsElapsed)),
    319319                           sElapsedGraph,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette