VirtualBox

Changeset 83391 in vbox for trunk


Ignore:
Timestamp:
Mar 24, 2020 4:59:31 PM (5 years ago)
Author:
vboxsync
Message:

TestManager/changelogs: Made the tsEffective value a link (typically works).

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

Legend:

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

    r83360 r83391  
    356356    #
    357357
     358    def getUrlNoParams(self):
     359        """
     360        Returns the base URL without any parameters (no trailing '?' or &).
     361        """
     362        return self._sUrlBase[:self._sUrlBase.rindex('?')];
     363
     364    def getUrlBase(self):
     365        """
     366        Returns the base URL, ending with '?' or '&'.
     367        This may already include some debug parameters.
     368        """
     369        return self._sUrlBase;
     370
    358371    def getParameters(self):
    359372        """
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py

    r83366 r83391  
    485485
    486486    @staticmethod
    487     def formatChangeLogEntry(aoEntries, iEntry):
     487    def formatChangeLogEntry(aoEntries, iEntry, sUrl, dParams):
    488488        """
    489489        Formats one change log entry into one or more HTML table rows.
     490
     491        The sUrl and dParams arguments are used to construct links to historical
     492        data using the tsEffective value.  If no links wanted, they'll both be None.
    490493
    491494        Note! The parameters are given as array + index in case someone wishes
     
    494497        """
    495498        oEntry = aoEntries[iEntry];
     499
     500        # Turn the effective date into a URL if we can:
     501        if sUrl:
     502            dParams[WuiDispatcherBase.ksParamEffectiveDate] = oEntry.tsEffective;
     503            sEffective = WuiLinkBase(WuiFormContentBase.formatTsShort(oEntry.tsEffective), sUrl,
     504                                     dParams, fBracketed = False).toHtml();
     505        else:
     506            sEffective = webutils.escapeElem(WuiFormContentBase.formatTsShort(oEntry.tsEffective))
    496507
    497508        # The primary row.
     
    503514                   '    </tr>\n' \
    504515                 % ( sRowClass,
    505                      len(oEntry.aoChanges) + 1, webutils.escapeElem(WuiFormContentBase.formatTsShort(oEntry.tsEffective)),
     516                     len(oEntry.aoChanges) + 1, sEffective,
    506517                     len(oEntry.aoChanges) + 1, webutils.escapeElem(WuiFormContentBase.formatTsShort(oEntry.tsExpire)),
    507518                     WuiFormContentBase._guessChangeLogEntryDescription(aoEntries, iEntry),
     
    624635                    '    <tbody>\n';
    625636
     637        if self._sMode == self.ksMode_Show:
     638            sUrl    = self._oDisp.getUrlNoParams();
     639            dParams = self._oDisp.getParameters();
     640        else:
     641            sUrl    = None;
     642            dParams = None;
     643
    626644        for iEntry, _ in enumerate(aoEntries):
    627             sContent += self.formatChangeLogEntry(aoEntries, iEntry);
     645            sContent += self.formatChangeLogEntry(aoEntries, iEntry, sUrl, dParams);
    628646
    629647        sContent += '    <tbody>\n' \
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