From 627f167bf41935cad572b04c5b412f9294293ecb Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 28 Feb 2018 12:17:13 +0100 Subject: Bug 1309194: Implement summary info in Net Panel Toolbar; Bug 1317205: CSS improvement for summary button Required for: https://github.com/MoonchildProductions/moebius/pull/93 --- devtools/client/netmonitor/actions/index.js | 5 +- devtools/client/netmonitor/actions/moz.build | 3 +- devtools/client/netmonitor/actions/requests.js | 25 +++++ devtools/client/netmonitor/actions/sidebar.js | 49 ---------- devtools/client/netmonitor/actions/ui.js | 36 +++++++ devtools/client/netmonitor/components/moz.build | 1 + .../client/netmonitor/components/summary-button.js | 57 +++++++++++ .../client/netmonitor/components/toggle-button.js | 32 +++---- devtools/client/netmonitor/constants.js | 8 +- devtools/client/netmonitor/netmonitor-view.js | 5 +- devtools/client/netmonitor/netmonitor.xul | 5 +- devtools/client/netmonitor/reducers/index.js | 6 +- devtools/client/netmonitor/reducers/moz.build | 3 +- devtools/client/netmonitor/reducers/requests.js | 28 ++++++ devtools/client/netmonitor/reducers/sidebar.js | 43 --------- devtools/client/netmonitor/reducers/ui.js | 40 ++++++++ devtools/client/netmonitor/requests-menu-view.js | 105 ++------------------- devtools/client/netmonitor/selectors/index.js | 57 ++++++++++- .../netmonitor/test/browser_net_footer-summary.js | 22 ++--- devtools/client/netmonitor/toolbar-view.js | 13 ++- 20 files changed, 305 insertions(+), 238 deletions(-) create mode 100644 devtools/client/netmonitor/actions/requests.js delete mode 100644 devtools/client/netmonitor/actions/sidebar.js create mode 100644 devtools/client/netmonitor/actions/ui.js create mode 100644 devtools/client/netmonitor/components/summary-button.js create mode 100644 devtools/client/netmonitor/reducers/requests.js delete mode 100644 devtools/client/netmonitor/reducers/sidebar.js create mode 100644 devtools/client/netmonitor/reducers/ui.js (limited to 'devtools/client/netmonitor') diff --git a/devtools/client/netmonitor/actions/index.js b/devtools/client/netmonitor/actions/index.js index 3f7b0bd2f..2ce23448e 100644 --- a/devtools/client/netmonitor/actions/index.js +++ b/devtools/client/netmonitor/actions/index.js @@ -4,6 +4,7 @@ "use strict"; const filters = require("./filters"); -const sidebar = require("./sidebar"); +const requests = require("./requests"); +const ui = require("./ui"); -module.exports = Object.assign({}, filters, sidebar); +module.exports = Object.assign({}, filters, requests, ui); diff --git a/devtools/client/netmonitor/actions/moz.build b/devtools/client/netmonitor/actions/moz.build index 477cafb41..d0ac61944 100644 --- a/devtools/client/netmonitor/actions/moz.build +++ b/devtools/client/netmonitor/actions/moz.build @@ -6,5 +6,6 @@ DevToolsModules( 'filters.js', 'index.js', - 'sidebar.js', + 'requests.js', + 'ui.js', ) diff --git a/devtools/client/netmonitor/actions/requests.js b/devtools/client/netmonitor/actions/requests.js new file mode 100644 index 000000000..ae794a437 --- /dev/null +++ b/devtools/client/netmonitor/actions/requests.js @@ -0,0 +1,25 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + UPDATE_REQUESTS, +} = require("../constants"); + +/** + * Update request items + * + * @param {array} requests - visible request items + */ +function updateRequests(items) { + return { + type: UPDATE_REQUESTS, + items, + }; +} + +module.exports = { + updateRequests, +}; diff --git a/devtools/client/netmonitor/actions/sidebar.js b/devtools/client/netmonitor/actions/sidebar.js deleted file mode 100644 index 7e8dca5c1..000000000 --- a/devtools/client/netmonitor/actions/sidebar.js +++ /dev/null @@ -1,49 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; - -const { - DISABLE_TOGGLE_BUTTON, - SHOW_SIDEBAR, - TOGGLE_SIDEBAR, -} = require("../constants"); - -/** - * Change ToggleButton disabled state. - * - * @param {boolean} disabled - expected button disabled state - */ -function disableToggleButton(disabled) { - return { - type: DISABLE_TOGGLE_BUTTON, - disabled: disabled, - }; -} - -/** - * Change sidebar visible state. - * - * @param {boolean} visible - expected sidebar visible state - */ -function showSidebar(visible) { - return { - type: SHOW_SIDEBAR, - visible: visible, - }; -} - -/** - * Toggle to show/hide sidebar. - */ -function toggleSidebar() { - return { - type: TOGGLE_SIDEBAR, - }; -} - -module.exports = { - disableToggleButton, - showSidebar, - toggleSidebar, -}; diff --git a/devtools/client/netmonitor/actions/ui.js b/devtools/client/netmonitor/actions/ui.js new file mode 100644 index 000000000..c6df307ed --- /dev/null +++ b/devtools/client/netmonitor/actions/ui.js @@ -0,0 +1,36 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + OPEN_SIDEBAR, + TOGGLE_SIDEBAR, +} = require("../constants"); + +/** + * Change sidebar open state. + * + * @param {boolean} open - open state + */ +function openSidebar(open) { + return { + type: OPEN_SIDEBAR, + open, + }; +} + +/** + * Toggle sidebar open state. + */ +function toggleSidebar() { + return { + type: TOGGLE_SIDEBAR, + }; +} + +module.exports = { + openSidebar, + toggleSidebar, +}; diff --git a/devtools/client/netmonitor/components/moz.build b/devtools/client/netmonitor/components/moz.build index 47ef7f026..42459584d 100644 --- a/devtools/client/netmonitor/components/moz.build +++ b/devtools/client/netmonitor/components/moz.build @@ -6,5 +6,6 @@ DevToolsModules( 'filter-buttons.js', 'search-box.js', + 'summary-button.js', 'toggle-button.js', ) diff --git a/devtools/client/netmonitor/components/summary-button.js b/devtools/client/netmonitor/components/summary-button.js new file mode 100644 index 000000000..9465d3147 --- /dev/null +++ b/devtools/client/netmonitor/components/summary-button.js @@ -0,0 +1,57 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* globals NetMonitorView */ + +"use strict"; + +const { + CONTENT_SIZE_DECIMALS, + REQUEST_TIME_DECIMALS, +} = require("../constants"); +const { DOM, PropTypes } = require("devtools/client/shared/vendor/react"); +const { connect } = require("devtools/client/shared/vendor/react-redux"); +const { PluralForm } = require("devtools/shared/plural-form"); +const { L10N } = require("../l10n"); +const { getSummary } = require("../selectors/index"); + +const { button, span } = DOM; + +function SummaryButton({ + summary, + triggerSummary, +}) { + let { count, totalBytes, totalMillis } = summary; + const text = (count === 0) ? L10N.getStr("networkMenu.empty") : + PluralForm.get(count, L10N.getStr("networkMenu.summary")) + .replace("#1", count) + .replace("#2", L10N.numberWithDecimals(totalBytes / 1024, + CONTENT_SIZE_DECIMALS)) + .replace("#3", L10N.numberWithDecimals(totalMillis / 1000, + REQUEST_TIME_DECIMALS)); + + return button({ + id: "requests-menu-network-summary-button", + className: "devtools-button", + title: count ? text : L10N.getStr("netmonitor.toolbar.perf"), + onClick: triggerSummary, + }, + span({ className: "summary-info-icon" }), + span({ className: "summary-info-text" }, text)); +} + +SummaryButton.propTypes = { + summary: PropTypes.object.isRequired, +}; + +module.exports = connect( + (state) => ({ + summary: getSummary(state), + }), + (dispatch) => ({ + triggerSummary: () => { + NetMonitorView.toggleFrontendMode(); + }, + }) +)(SummaryButton); diff --git a/devtools/client/netmonitor/components/toggle-button.js b/devtools/client/netmonitor/components/toggle-button.js index db546c55d..c9a59a76b 100644 --- a/devtools/client/netmonitor/components/toggle-button.js +++ b/devtools/client/netmonitor/components/toggle-button.js @@ -1,5 +1,3 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -11,47 +9,43 @@ const { connect } = require("devtools/client/shared/vendor/react-redux"); const { L10N } = require("../l10n"); const Actions = require("../actions/index"); -// Shortcuts const { button } = DOM; -/** - * Button used to toggle sidebar - */ function ToggleButton({ disabled, - onToggle, - visible, + open, + triggerSidebar, }) { let className = ["devtools-button"]; - if (!visible) { + if (!open) { className.push("pane-collapsed"); } - let titleMsg = visible ? L10N.getStr("collapseDetailsPane") : - L10N.getStr("expandDetailsPane"); + + const title = open ? L10N.getStr("collapseDetailsPane") : + L10N.getStr("expandDetailsPane"); return button({ id: "details-pane-toggle", className: className.join(" "), - title: titleMsg, - disabled: disabled, + title, + disabled, tabIndex: "0", - onMouseDown: onToggle, + onMouseDown: triggerSidebar, }); } ToggleButton.propTypes = { disabled: PropTypes.bool.isRequired, - onToggle: PropTypes.func.isRequired, - visible: PropTypes.bool.isRequired, + triggerSidebar: PropTypes.func.isRequired, }; module.exports = connect( (state) => ({ - disabled: state.sidebar.toggleButtonDisabled, - visible: state.sidebar.visible, + disabled: state.requests.items.length === 0, + open: state.ui.sidebar.open, }), (dispatch) => ({ - onToggle: () => { + triggerSidebar: () => { dispatch(Actions.toggleSidebar()); let requestsMenu = NetMonitorView.RequestsMenu; diff --git a/devtools/client/netmonitor/constants.js b/devtools/client/netmonitor/constants.js index a540d74b2..33bc71ea7 100644 --- a/devtools/client/netmonitor/constants.js +++ b/devtools/client/netmonitor/constants.js @@ -5,15 +5,17 @@ const general = { FREETEXT_FILTER_SEARCH_DELAY: 200, + CONTENT_SIZE_DECIMALS: 2, + REQUEST_TIME_DECIMALS: 2, }; const actionTypes = { TOGGLE_FILTER_TYPE: "TOGGLE_FILTER_TYPE", ENABLE_FILTER_TYPE_ONLY: "ENABLE_FILTER_TYPE_ONLY", - TOGGLE_SIDEBAR: "TOGGLE_SIDEBAR", - SHOW_SIDEBAR: "SHOW_SIDEBAR", - DISABLE_TOGGLE_BUTTON: "DISABLE_TOGGLE_BUTTON", SET_FILTER_TEXT: "SET_FILTER_TEXT", + OPEN_SIDEBAR: "OPEN_SIDEBAR", + TOGGLE_SIDEBAR: "TOGGLE_SIDEBAR", + UPDATE_REQUESTS: "UPDATE_REQUESTS", }; module.exports = Object.assign({}, general, actionTypes); diff --git a/devtools/client/netmonitor/netmonitor-view.js b/devtools/client/netmonitor/netmonitor-view.js index 68470f7a9..8da5a2038 100644 --- a/devtools/client/netmonitor/netmonitor-view.js +++ b/devtools/client/netmonitor/netmonitor-view.js @@ -125,7 +125,6 @@ var NetMonitorView = { if (!Prefs.statistics) { $("#request-menu-context-perf").hidden = true; $("#notice-perf-message").hidden = true; - $("#requests-menu-network-summary-button").hidden = true; } }, @@ -171,10 +170,10 @@ var NetMonitorView = { if (flags.visible) { this._body.classList.remove("pane-collapsed"); - gStore.dispatch(Actions.showSidebar(true)); + gStore.dispatch(Actions.openSidebar(true)); } else { this._body.classList.add("pane-collapsed"); - gStore.dispatch(Actions.showSidebar(false)); + gStore.dispatch(Actions.openSidebar(false)); } if (tabIndex !== undefined) { diff --git a/devtools/client/netmonitor/netmonitor.xul b/devtools/client/netmonitor/netmonitor.xul index bb580f7ad..8a0c60389 100644 --- a/devtools/client/netmonitor/netmonitor.xul +++ b/devtools/client/netmonitor/netmonitor.xul @@ -28,9 +28,8 @@ id="react-filter-buttons-hook"/> - + { + const oldValue = currentValue; const newValue = reduceValue(currentValue); - if (newValue !== currentValue) { - onChange(newValue, currentValue); + if (newValue !== oldValue) { currentValue = newValue; + onChange(newValue, oldValue); } }; } @@ -129,8 +129,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { let widgetParentEl = $("#requests-menu-contents"); this.widget = new SideMenuWidget(widgetParentEl); this._splitter = $("#network-inspector-view-splitter"); - this._summary = $("#requests-menu-network-summary-button"); - this._summary.setAttribute("label", L10N.getStr("networkMenu.empty")); // Create a tooltip for the newly appended network request item. this.tooltip = new HTMLTooltip(NetMonitorController._toolbox.doc, { type: "arrow" }); @@ -211,13 +209,10 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { if (NetMonitorController.supportsPerfStats) { $("#requests-menu-perf-notice-button").addEventListener("command", this._onContextPerfCommand, false); - $("#requests-menu-network-summary-button").addEventListener("command", - this._onContextPerfCommand, false); $("#network-statistics-back-button").addEventListener("command", this._onContextPerfCommand, false); } else { $("#notice-perf-message").hidden = true; - $("#requests-menu-network-summary-button").hidden = true; } if (!NetMonitorController.supportsTransferredResponseSize) { @@ -257,8 +252,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { this._onReloadCommand, false); $("#requests-menu-perf-notice-button").removeEventListener("command", this._onContextPerfCommand, false); - $("#requests-menu-network-summary-button").removeEventListener("command", - this._onContextPerfCommand, false); $("#network-statistics-back-button").removeEventListener("command", this._onContextPerfCommand, false); @@ -422,7 +415,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { */ reFilterRequests: function () { this.filterContents(this._filterPredicate); - this.refreshSummary(); + this.updateRequests(); this.refreshZebra(); }, @@ -541,7 +534,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { break; } - this.refreshSummary(); + this.updateRequests(); this.refreshZebra(); }, @@ -552,41 +545,17 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { NetMonitorController.NetworkEventsHandler.clearMarkers(); NetMonitorView.Sidebar.toggle(false); - this.store.dispatch(Actions.disableToggleButton(true)); $("#requests-menu-empty-notice").hidden = false; this.empty(); - this.refreshSummary(); + this.updateRequests(); }, /** - * Refreshes the status displayed in this container's footer, providing - * concise information about all requests. + * Update store request itmes and trigger related UI update */ - refreshSummary: function () { - let visibleItems = this.visibleItems; - let visibleRequestsCount = visibleItems.length; - if (!visibleRequestsCount) { - this._summary.setAttribute("label", L10N.getStr("networkMenu.empty")); - return; - } - - let totalBytes = this._getTotalBytesOfRequests(visibleItems); - let totalMillis = - this._getNewestRequest(visibleItems).attachment.endedMillis - - this._getOldestRequest(visibleItems).attachment.startedMillis; - - // https://developer.mozilla.org/en-US/docs/Localization_and_Plurals - let str = PluralForm.get(visibleRequestsCount, - L10N.getStr("networkMenu.summary")); - - this._summary.setAttribute("label", str - .replace("#1", visibleRequestsCount) - .replace("#2", L10N.numberWithDecimals((totalBytes || 0) / 1024, - CONTENT_SIZE_DECIMALS)) - .replace("#3", L10N.numberWithDecimals((totalMillis || 0) / 1000, - REQUEST_TIME_DECIMALS)) - ); + updateRequests: function () { + this.store.dispatch(Actions.updateRequests(this.visibleItems)); }, /** @@ -865,7 +834,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { this._updateQueue = []; this._addQueue = []; - this.store.dispatch(Actions.disableToggleButton(!this.itemCount)); $("#requests-menu-empty-notice").hidden = !!this.itemCount; // Make sure all the requests are sorted and filtered. @@ -875,7 +843,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { // so this doesn't happen once per network event update). this.sortContents(); this.filterContents(); - this.refreshSummary(); + this.updateRequests(); this.refreshZebra(); // Rescale all the waterfalls so that everything is visible at once. @@ -1558,59 +1526,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { } }, - /** - * Gets the total number of bytes representing the cumulated content size of - * a set of requests. Returns 0 for an empty set. - * - * @param array itemsArray - * @return number - */ - _getTotalBytesOfRequests: function (itemsArray) { - if (!itemsArray.length) { - return 0; - } - - let result = 0; - itemsArray.forEach(item => { - let size = item.attachment.contentSize; - result += (typeof size == "number") ? size : 0; - }); - - return result; - }, - - /** - * Gets the oldest (first performed) request in a set. Returns null for an - * empty set. - * - * @param array itemsArray - * @return object - */ - _getOldestRequest: function (itemsArray) { - if (!itemsArray.length) { - return null; - } - return itemsArray.reduce((prev, curr) => - prev.attachment.startedMillis < curr.attachment.startedMillis ? - prev : curr); - }, - - /** - * Gets the newest (latest performed) request in a set. Returns null for an - * empty set. - * - * @param array itemsArray - * @return object - */ - _getNewestRequest: function (itemsArray) { - if (!itemsArray.length) { - return null; - } - return itemsArray.reduce((prev, curr) => - prev.attachment.startedMillis > curr.attachment.startedMillis ? - prev : curr); - }, - /** * Gets the available waterfall width in this container. * @return number diff --git a/devtools/client/netmonitor/selectors/index.js b/devtools/client/netmonitor/selectors/index.js index f473149b5..8cd6b6ffc 100644 --- a/devtools/client/netmonitor/selectors/index.js +++ b/devtools/client/netmonitor/selectors/index.js @@ -1,8 +1,63 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + "use strict"; +const { createSelector } = require("devtools/client/shared/vendor/reselect"); + +/** + * Gets the total number of bytes representing the cumulated content size of + * a set of requests. Returns 0 for an empty set. + * + * @param {array} items - an array of request items + * @return {number} total bytes of requests + */ +function getTotalBytesOfRequests(items) { + if (!items.length) { + return 0; + } + + let result = 0; + items.forEach((item) => { + let size = item.attachment.contentSize; + result += (typeof size == "number") ? size : 0; + }); + + return result; +} + +/** + * Gets the total milliseconds for all requests. Returns null for an + * empty set. + * + * @param {array} items - an array of request items + * @return {object} total milliseconds for all requests + */ +function getTotalMillisOfRequests(items) { + if (!items.length) { + return null; + } + + const oldest = items.reduce((prev, curr) => + prev.attachment.startedMillis < curr.attachment.startedMillis ? + prev : curr); + const newest = items.reduce((prev, curr) => + prev.attachment.startedMillis > curr.attachment.startedMillis ? + prev : curr); + + return newest.attachment.endedMillis - oldest.attachment.startedMillis; +} + +const getSummary = createSelector( + (state) => state.requests.items, + (requests) => ({ + count: requests.length, + totalBytes: getTotalBytesOfRequests(requests), + totalMillis: getTotalMillisOfRequests(requests), + }) +); + module.exports = { - // selectors... + getSummary, }; diff --git a/devtools/client/netmonitor/test/browser_net_footer-summary.js b/devtools/client/netmonitor/test/browser_net_footer-summary.js index e484b2097..94bfa604b 100644 --- a/devtools/client/netmonitor/test/browser_net_footer-summary.js +++ b/devtools/client/netmonitor/test/browser_net_footer-summary.js @@ -10,13 +10,14 @@ add_task(function* () { requestLongerTimeout(2); + let { getSummary } = require("devtools/client/netmonitor/selectors/index"); let { L10N } = require("devtools/client/netmonitor/l10n"); let { PluralForm } = require("devtools/shared/plural-form"); let { tab, monitor } = yield initNetMonitor(FILTERING_URL); info("Starting test... "); - let { $, NetMonitorView } = monitor.panelWin; + let { $, NetMonitorView, gStore } = monitor.panelWin; let { RequestsMenu } = NetMonitorView; RequestsMenu.lazyUpdate = false; @@ -43,31 +44,24 @@ add_task(function* () { yield teardown(monitor); function testStatus() { - let summary = $("#requests-menu-network-summary-button"); - let value = summary.getAttribute("label"); + const { count, totalBytes, totalMillis } = getSummary(gStore.getState()); + let value = $("#requests-menu-network-summary-button").textContent; info("Current summary: " + value); - let visibleItems = RequestsMenu.visibleItems; - let visibleRequestsCount = visibleItems.length; let totalRequestsCount = RequestsMenu.itemCount; - info("Current requests: " + visibleRequestsCount + " of " + totalRequestsCount + "."); + info("Current requests: " + count + " of " + totalRequestsCount + "."); - if (!totalRequestsCount || !visibleRequestsCount) { + if (!totalRequestsCount || !count) { is(value, L10N.getStr("networkMenu.empty"), "The current summary text is incorrect, expected an 'empty' label."); return; } - let totalBytes = RequestsMenu._getTotalBytesOfRequests(visibleItems); - let totalMillis = - RequestsMenu._getNewestRequest(visibleItems).attachment.endedMillis - - RequestsMenu._getOldestRequest(visibleItems).attachment.startedMillis; - info("Computed total bytes: " + totalBytes); info("Computed total millis: " + totalMillis); - is(value, PluralForm.get(visibleRequestsCount, L10N.getStr("networkMenu.summary")) - .replace("#1", visibleRequestsCount) + is(value, PluralForm.get(count, L10N.getStr("networkMenu.summary")) + .replace("#1", count) .replace("#2", L10N.numberWithDecimals((totalBytes || 0) / 1024, 2)) .replace("#3", L10N.numberWithDecimals((totalMillis || 0) / 1000, 2)) , "The current summary text is incorrect."); diff --git a/devtools/client/netmonitor/toolbar-view.js b/devtools/client/netmonitor/toolbar-view.js index 28c3cf99b..1834d3ee9 100644 --- a/devtools/client/netmonitor/toolbar-view.js +++ b/devtools/client/netmonitor/toolbar-view.js @@ -7,6 +7,7 @@ const Provider = createFactory(require("devtools/client/shared/vendor/react-redu const FilterButtons = createFactory(require("./components/filter-buttons")); const ToggleButton = createFactory(require("./components/toggle-button")); const SearchBox = createFactory(require("./components/search-box")); +const SummaryButton = createFactory(require("./components/summary-button")); const { L10N } = require("./l10n"); // Shortcuts @@ -28,8 +29,9 @@ ToolbarView.prototype = { this._clearContainerNode = $("#react-clear-button-hook"); this._filterContainerNode = $("#react-filter-buttons-hook"); - this._toggleContainerNode = $("#react-details-pane-toggle-hook"); + this._summaryContainerNode = $("#react-summary-button-hook"); this._searchContainerNode = $("#react-search-box-hook"); + this._toggleContainerNode = $("#react-details-pane-toggle-hook"); // clear button ReactDOM.render(button({ @@ -47,6 +49,12 @@ ToolbarView.prototype = { FilterButtons() ), this._filterContainerNode); + // summary button + ReactDOM.render(Provider( + { store }, + SummaryButton() + ), this._summaryContainerNode); + // search box ReactDOM.render(Provider( { store }, @@ -68,8 +76,9 @@ ToolbarView.prototype = { ReactDOM.unmountComponentAtNode(this._clearContainerNode); ReactDOM.unmountComponentAtNode(this._filterContainerNode); - ReactDOM.unmountComponentAtNode(this._toggleContainerNode); + ReactDOM.unmountComponentAtNode(this._summaryContainerNode); ReactDOM.unmountComponentAtNode(this._searchContainerNode); + ReactDOM.unmountComponentAtNode(this._toggleContainerNode); } }; -- cgit v1.2.3 From abf60058584772437a317fbc27ea32cbda4a07cb Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 28 Feb 2018 16:02:31 +0100 Subject: Bug 1168376: Show transferred size in request summary instead of decompressed size https://github.com/MoonchildProductions/moebius/pull/93 - without: DOMContentLoaded and load --- .../client/netmonitor/components/summary-button.js | 18 +++++---- devtools/client/netmonitor/netmonitor-view.js | 2 +- .../netmonitor/performance-statistics-view.js | 36 ++++++++++++----- devtools/client/netmonitor/selectors/index.js | 27 ++++++++++--- .../netmonitor/test/browser_net_charts-03.js | 45 ++++++++++++++-------- .../netmonitor/test/browser_net_charts-04.js | 16 +++++--- .../netmonitor/test/browser_net_charts-05.js | 10 +++-- .../netmonitor/test/browser_net_charts-07.js | 16 +++++--- .../netmonitor/test/browser_net_footer-summary.js | 13 ++++--- 9 files changed, 123 insertions(+), 60 deletions(-) (limited to 'devtools/client/netmonitor') diff --git a/devtools/client/netmonitor/components/summary-button.js b/devtools/client/netmonitor/components/summary-button.js index 9465d3147..223552fbf 100644 --- a/devtools/client/netmonitor/components/summary-button.js +++ b/devtools/client/netmonitor/components/summary-button.js @@ -14,21 +14,25 @@ const { DOM, PropTypes } = require("devtools/client/shared/vendor/react"); const { connect } = require("devtools/client/shared/vendor/react-redux"); const { PluralForm } = require("devtools/shared/plural-form"); const { L10N } = require("../l10n"); -const { getSummary } = require("../selectors/index"); +const { + getDisplayedRequestsSummary +} = require("../selectors/index"); const { button, span } = DOM; function SummaryButton({ summary, - triggerSummary, + triggerSummary }) { - let { count, totalBytes, totalMillis } = summary; + let { count, contentSize, transferredSize, millis } = summary; const text = (count === 0) ? L10N.getStr("networkMenu.empty") : - PluralForm.get(count, L10N.getStr("networkMenu.summary")) + PluralForm.get(count, L10N.getStr("networkMenu.summary2")) .replace("#1", count) - .replace("#2", L10N.numberWithDecimals(totalBytes / 1024, + .replace("#2", L10N.numberWithDecimals(contentSize / 1024, CONTENT_SIZE_DECIMALS)) - .replace("#3", L10N.numberWithDecimals(totalMillis / 1000, + .replace("#3", L10N.numberWithDecimals(transferredSize / 1024, + CONTENT_SIZE_DECIMALS)) + .replace("#4", L10N.numberWithDecimals(millis / 1000, REQUEST_TIME_DECIMALS)); return button({ @@ -47,7 +51,7 @@ SummaryButton.propTypes = { module.exports = connect( (state) => ({ - summary: getSummary(state), + summary: getDisplayedRequestsSummary(state), }), (dispatch) => ({ triggerSummary: () => { diff --git a/devtools/client/netmonitor/netmonitor-view.js b/devtools/client/netmonitor/netmonitor-view.js index 8da5a2038..1f957db1b 100644 --- a/devtools/client/netmonitor/netmonitor-view.js +++ b/devtools/client/netmonitor/netmonitor-view.js @@ -233,7 +233,7 @@ var NetMonitorView = { // populating the statistics view. // • The response mime type is used for categorization. yield whenDataAvailable(requestsView, [ - "responseHeaders", "status", "contentSize", "mimeType", "totalTime" + "responseHeaders", "status", "contentSize", "transferredSize", "mimeType", "totalTime" ]); } catch (ex) { // Timed out while waiting for data. Continue with what we have. diff --git a/devtools/client/netmonitor/performance-statistics-view.js b/devtools/client/netmonitor/performance-statistics-view.js index c712c083d..38b98fb68 100644 --- a/devtools/client/netmonitor/performance-statistics-view.js +++ b/devtools/client/netmonitor/performance-statistics-view.js @@ -92,27 +92,35 @@ PerformanceStatisticsView.prototype = { let string = L10N.numberWithDecimals(value / 1024, CONTENT_SIZE_DECIMALS); return L10N.getFormatStr("charts.sizeKB", string); }, + transferredSize: value => { + let string = L10N.numberWithDecimals(value / 1024, CONTENT_SIZE_DECIMALS); + return L10N.getFormatStr("charts.transferredSizeKB", string); + }, time: value => { let string = L10N.numberWithDecimals(value / 1000, REQUEST_TIME_DECIMALS); return L10N.getFormatStr("charts.totalS", string); } }, _commonChartTotals: { + cached: total => { + return L10N.getFormatStr("charts.totalCached", total); + }, + count: total => { + return L10N.getFormatStr("charts.totalCount", total); + }, size: total => { let string = L10N.numberWithDecimals(total / 1024, CONTENT_SIZE_DECIMALS); return L10N.getFormatStr("charts.totalSize", string); }, + transferredSize: total => { + let string = L10N.numberWithDecimals(total / 1024, CONTENT_SIZE_DECIMALS); + return L10N.getFormatStr("charts.totalTransferredSize", string); + }, time: total => { let seconds = total / 1000; let string = L10N.numberWithDecimals(seconds, REQUEST_TIME_DECIMALS); return PluralForm.get(seconds, L10N.getStr("charts.totalSeconds")).replace("#1", string); - }, - cached: total => { - return L10N.getFormatStr("charts.totalCached", total); - }, - count: total => { - return L10N.getFormatStr("charts.totalCount", total); } }, @@ -136,6 +144,14 @@ PerformanceStatisticsView.prototype = { let chart = Chart.PieTable(document, { diameter: NETWORK_ANALYSIS_PIE_CHART_DIAMETER, title: L10N.getStr(title), + header: { + cached: "", + count: "", + label: L10N.getStr("charts.type"), + size: L10N.getStr("charts.size"), + transferredSize: L10N.getStr("charts.transferred"), + time: L10N.getStr("charts.time") + }, data: data, strings: strings, totals: totals, @@ -161,13 +177,14 @@ PerformanceStatisticsView.prototype = { * True if the cache is considered enabled, false for disabled. */ _sanitizeChartDataSource: function (items, emptyCache) { - let data = [ + const data = [ "html", "css", "js", "xhr", "fonts", "images", "media", "flash", "ws", "other" - ].map(e => ({ + ].map((type) => ({ cached: 0, count: 0, - label: e, + label: type, size: 0, + transferredSize: 0, time: 0 })); @@ -211,6 +228,7 @@ PerformanceStatisticsView.prototype = { if (emptyCache || !responseIsFresh(details)) { data[type].time += details.totalTime || 0; data[type].size += details.contentSize || 0; + data[type].transferredSize += details.transferredSize || 0; } else { data[type].cached++; } diff --git a/devtools/client/netmonitor/selectors/index.js b/devtools/client/netmonitor/selectors/index.js index 8cd6b6ffc..60d6007cd 100644 --- a/devtools/client/netmonitor/selectors/index.js +++ b/devtools/client/netmonitor/selectors/index.js @@ -13,7 +13,7 @@ const { createSelector } = require("devtools/client/shared/vendor/reselect"); * @param {array} items - an array of request items * @return {number} total bytes of requests */ -function getTotalBytesOfRequests(items) { +function getContentSizeOfRequests(items) { if (!items.length) { return 0; } @@ -27,6 +27,20 @@ function getTotalBytesOfRequests(items) { return result; } +function getTransferredSizeOfRequests(items) { + if (!items.length) { + return 0; + } + + let result = 0; + items.forEach((item) => { + let size = item.attachment.transferredSize; + result += (typeof size == "number") ? size : 0; + }); + + return result; +} + /** * Gets the total milliseconds for all requests. Returns null for an * empty set. @@ -34,7 +48,7 @@ function getTotalBytesOfRequests(items) { * @param {array} items - an array of request items * @return {object} total milliseconds for all requests */ -function getTotalMillisOfRequests(items) { +function getMillisOfRequests(items) { if (!items.length) { return null; } @@ -49,15 +63,16 @@ function getTotalMillisOfRequests(items) { return newest.attachment.endedMillis - oldest.attachment.startedMillis; } -const getSummary = createSelector( +const getDisplayedRequestsSummary = createSelector( (state) => state.requests.items, (requests) => ({ count: requests.length, - totalBytes: getTotalBytesOfRequests(requests), - totalMillis: getTotalMillisOfRequests(requests), + contentSize: getContentSizeOfRequests(requests), + transferredSize: getTransferredSizeOfRequests(requests), + millis: getMillisOfRequests(requests), }) ); module.exports = { - getSummary, + getDisplayedRequestsSummary, }; diff --git a/devtools/client/netmonitor/test/browser_net_charts-03.js b/devtools/client/netmonitor/test/browser_net_charts-03.js index c7d9b0c1a..4a655a8ca 100644 --- a/devtools/client/netmonitor/test/browser_net_charts-03.js +++ b/devtools/client/netmonitor/test/browser_net_charts-03.js @@ -33,6 +33,10 @@ add_task(function* () { totals: { label1: value => "Hello " + L10N.numberWithDecimals(value, 2), label2: value => "World " + L10N.numberWithDecimals(value, 2) + }, + header: { + label1: "label1header", + label2: "label2header", } }); @@ -51,39 +55,48 @@ add_task(function* () { is(title.getAttribute("value"), "Table title", "The title node displays the correct text."); - is(rows.length, 3, "There should be 3 table chart rows created."); + is(rows.length, 4, "There should be 3 table chart rows and a header created."); - ok(rows[0].querySelector(".table-chart-row-box.chart-colored-blob"), - "A colored blob exists for the firt row."); is(rows[0].querySelectorAll("label")[0].getAttribute("name"), "label1", - "The first column of the first row exists."); + "The first column of the header exists."); is(rows[0].querySelectorAll("label")[1].getAttribute("name"), "label2", + "The second column of the header exists."); + is(rows[0].querySelectorAll("span")[0].textContent, "label1header", + "The first column of the header displays the correct text."); + is(rows[0].querySelectorAll("span")[1].textContent, "label2header", + "The second column of the header displays the correct text."); + + ok(rows[1].querySelector(".table-chart-row-box.chart-colored-blob"), + "A colored blob exists for the firt row."); + is(rows[1].querySelectorAll("span")[0].getAttribute("name"), "label1", + "The first column of the first row exists."); + is(rows[1].querySelectorAll("span")[1].getAttribute("name"), "label2", "The second column of the first row exists."); - is(rows[0].querySelectorAll("label")[0].getAttribute("value"), "1", + is(rows[1].querySelectorAll("label")[0].getAttribute("value"), "1", "The first column of the first row displays the correct text."); - is(rows[0].querySelectorAll("label")[1].getAttribute("value"), "11.1foo", + is(rows[1].querySelectorAll("label")[1].getAttribute("value"), "11.1foo", "The second column of the first row displays the correct text."); - ok(rows[1].querySelector(".table-chart-row-box.chart-colored-blob"), + ok(rows[2].querySelector(".table-chart-row-box.chart-colored-blob"), "A colored blob exists for the second row."); - is(rows[1].querySelectorAll("label")[0].getAttribute("name"), "label1", + is(rows[2].querySelectorAll("label")[0].getAttribute("name"), "label1", "The first column of the second row exists."); - is(rows[1].querySelectorAll("label")[1].getAttribute("name"), "label2", + is(rows[2].querySelectorAll("label")[1].getAttribute("name"), "label2", "The second column of the second row exists."); - is(rows[1].querySelectorAll("label")[0].getAttribute("value"), "2", + is(rows[2].querySelectorAll("label")[0].getAttribute("value"), "2", "The first column of the second row displays the correct text."); - is(rows[1].querySelectorAll("label")[1].getAttribute("value"), "12.2bar", + is(rows[2].querySelectorAll("label")[1].getAttribute("value"), "12.2bar", "The second column of the first row displays the correct text."); - ok(rows[2].querySelector(".table-chart-row-box.chart-colored-blob"), + ok(rows[3].querySelector(".table-chart-row-box.chart-colored-blob"), "A colored blob exists for the third row."); - is(rows[2].querySelectorAll("label")[0].getAttribute("name"), "label1", + is(rows[3].querySelectorAll("label")[0].getAttribute("name"), "label1", "The first column of the third row exists."); - is(rows[2].querySelectorAll("label")[1].getAttribute("name"), "label2", + is(rows[3].querySelectorAll("label")[1].getAttribute("name"), "label2", "The second column of the third row exists."); - is(rows[2].querySelectorAll("label")[0].getAttribute("value"), "3", + is(rows[3].querySelectorAll("label")[0].getAttribute("value"), "3", "The first column of the third row displays the correct text."); - is(rows[2].querySelectorAll("label")[1].getAttribute("value"), "13.3baz", + is(rows[3].querySelectorAll("label")[1].getAttribute("value"), "13.3baz", "The second column of the third row displays the correct text."); is(sums.length, 2, "There should be 2 total summaries created."); diff --git a/devtools/client/netmonitor/test/browser_net_charts-04.js b/devtools/client/netmonitor/test/browser_net_charts-04.js index 0d150c409..921701ae5 100644 --- a/devtools/client/netmonitor/test/browser_net_charts-04.js +++ b/devtools/client/netmonitor/test/browser_net_charts-04.js @@ -22,6 +22,10 @@ add_task(function* () { totals: { label1: value => "Hello " + L10N.numberWithDecimals(value, 2), label2: value => "World " + L10N.numberWithDecimals(value, 2) + }, + header: { + label1: "", + label2: "" } }); @@ -40,17 +44,17 @@ add_task(function* () { is(title.getAttribute("value"), "Table title", "The title node displays the correct text."); - is(rows.length, 1, "There should be 1 table chart row created."); + is(rows.length, 2, "There should be 1 table chart row and a 1 header created."); - ok(rows[0].querySelector(".table-chart-row-box.chart-colored-blob"), + ok(rows[1].querySelector(".table-chart-row-box.chart-colored-blob"), "A colored blob exists for the firt row."); - is(rows[0].querySelectorAll("label")[0].getAttribute("name"), "size", + is(rows[1].querySelectorAll("label")[0].getAttribute("name"), "size", "The first column of the first row exists."); - is(rows[0].querySelectorAll("label")[1].getAttribute("name"), "label", + is(rows[1].querySelectorAll("label")[1].getAttribute("name"), "label", "The second column of the first row exists."); - is(rows[0].querySelectorAll("label")[0].getAttribute("value"), "", + is(rows[1].querySelectorAll("label")[0].getAttribute("value"), "", "The first column of the first row displays the correct text."); - is(rows[0].querySelectorAll("label")[1].getAttribute("value"), + is(rows[1].querySelectorAll("label")[1].getAttribute("value"), L10N.getStr("tableChart.loading"), "The second column of the first row displays the correct text."); diff --git a/devtools/client/netmonitor/test/browser_net_charts-05.js b/devtools/client/netmonitor/test/browser_net_charts-05.js index 00445b132..c444d2c65 100644 --- a/devtools/client/netmonitor/test/browser_net_charts-05.js +++ b/devtools/client/netmonitor/test/browser_net_charts-05.js @@ -33,6 +33,10 @@ add_task(function* () { totals: { size: value => "Hello " + L10N.numberWithDecimals(value, 2), label: value => "World " + L10N.numberWithDecimals(value, 2) + }, + header: { + label1: "", + label2: "" } }); @@ -53,9 +57,9 @@ add_task(function* () { ok(node.querySelector(".table-chart-container"), "A table chart was created successfully."); - is(rows.length, 3, "There should be 3 pie chart slices created."); - is(rows.length, 3, "There should be 3 table chart rows created."); - is(sums.length, 2, "There should be 2 total summaries created."); + is(rows.length, 4, "There should be 3 pie chart slices and 1 header created."); + is(rows.length, 4, "There should be 3 table chart rows and 1 header created."); + is(sums.length, 2, "There should be 2 total summaries and 1 header created."); yield teardown(monitor); }); diff --git a/devtools/client/netmonitor/test/browser_net_charts-07.js b/devtools/client/netmonitor/test/browser_net_charts-07.js index bb992e4eb..a655f258c 100644 --- a/devtools/client/netmonitor/test/browser_net_charts-07.js +++ b/devtools/client/netmonitor/test/browser_net_charts-07.js @@ -20,6 +20,10 @@ add_task(function* () { totals: { label1: value => "Hello " + L10N.numberWithDecimals(value, 2), label2: value => "World " + L10N.numberWithDecimals(value, 2) + }, + header: { + label1: "", + label2: "" } }); @@ -29,17 +33,17 @@ add_task(function* () { let rows = grid.querySelectorAll(".table-chart-row"); let sums = node.querySelectorAll(".table-chart-summary-label"); - is(rows.length, 1, "There should be 1 table chart row created."); + is(rows.length, 2, "There should be 1 table chart row and 1 header created."); - ok(rows[0].querySelector(".table-chart-row-box.chart-colored-blob"), + ok(rows[1].querySelector(".table-chart-row-box.chart-colored-blob"), "A colored blob exists for the firt row."); - is(rows[0].querySelectorAll("label")[0].getAttribute("name"), "size", + is(rows[1].querySelectorAll("label")[0].getAttribute("name"), "size", "The first column of the first row exists."); - is(rows[0].querySelectorAll("label")[1].getAttribute("name"), "label", + is(rows[1].querySelectorAll("label")[1].getAttribute("name"), "label", "The second column of the first row exists."); - is(rows[0].querySelectorAll("label")[0].getAttribute("value"), "", + is(rows[1].querySelectorAll("label")[0].getAttribute("value"), "", "The first column of the first row displays the correct text."); - is(rows[0].querySelectorAll("label")[1].getAttribute("value"), + is(rows[1].querySelectorAll("label")[1].getAttribute("value"), L10N.getStr("tableChart.unavailable"), "The second column of the first row displays the correct text."); diff --git a/devtools/client/netmonitor/test/browser_net_footer-summary.js b/devtools/client/netmonitor/test/browser_net_footer-summary.js index 94bfa604b..8faa8470b 100644 --- a/devtools/client/netmonitor/test/browser_net_footer-summary.js +++ b/devtools/client/netmonitor/test/browser_net_footer-summary.js @@ -44,7 +44,7 @@ add_task(function* () { yield teardown(monitor); function testStatus() { - const { count, totalBytes, totalMillis } = getSummary(gStore.getState()); + const { count, contentSize, transferredSize, millis } = getSummary(gStore.getState()); let value = $("#requests-menu-network-summary-button").textContent; info("Current summary: " + value); @@ -57,13 +57,14 @@ add_task(function* () { return; } - info("Computed total bytes: " + totalBytes); - info("Computed total millis: " + totalMillis); + info("Computed total bytes: " + contentSize); + info("Computed total millis: " + millis); - is(value, PluralForm.get(count, L10N.getStr("networkMenu.summary")) + is(value, PluralForm.get(count, L10N.getStr("networkMenu.summary2")) .replace("#1", count) - .replace("#2", L10N.numberWithDecimals((totalBytes || 0) / 1024, 2)) - .replace("#3", L10N.numberWithDecimals((totalMillis || 0) / 1000, 2)) + .replace("#2", L10N.numberWithDecimals((contentSize || 0) / 1024, 2)) + .replace("#3", L10N.numberWithDecimals((transferredSize || 0) / 1024, 2)) + .replace("#4", L10N.numberWithDecimals((millis || 0) / 1000, 2)) , "The current summary text is incorrect."); } }); -- cgit v1.2.3 From 228d252ab14f65f8433c8d53122a7d1e9429c23e Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 09:02:37 +0100 Subject: DevTools - network - security (improvements) https://github.com/MoonchildProductions/moebius/pull/113 https://github.com/MoonchildProductions/moebius/pull/118 https://github.com/MoonchildProductions/moebius/pull/127 --- devtools/client/netmonitor/netmonitor-view.js | 2 ++ devtools/client/netmonitor/netmonitor.xul | 20 ++++++++++++++++++++ .../netmonitor/test/browser_net_security-details.js | 4 ++++ 3 files changed, 26 insertions(+) (limited to 'devtools/client/netmonitor') diff --git a/devtools/client/netmonitor/netmonitor-view.js b/devtools/client/netmonitor/netmonitor-view.js index 1f957db1b..19dd96ff1 100644 --- a/devtools/client/netmonitor/netmonitor-view.js +++ b/devtools/client/netmonitor/netmonitor-view.js @@ -1124,6 +1124,8 @@ NetworkDetailsView.prototype = { setValue("#security-protocol-version-value", securityInfo.protocolVersion); setValue("#security-ciphersuite-value", securityInfo.cipherSuite); + setValue("#security-keagroup-value", securityInfo.keaGroupName); + setValue("#security-signaturescheme-value", securityInfo.signatureSchemeName); // Host header let domain = getUriHostPort(url); diff --git a/devtools/client/netmonitor/netmonitor.xul b/devtools/client/netmonitor/netmonitor.xul index 8a0c60389..117ecf261 100644 --- a/devtools/client/netmonitor/netmonitor.xul +++ b/devtools/client/netmonitor/netmonitor.xul @@ -550,6 +550,26 @@ id="security-warning-cipher" data-localization="tooltiptext=netmonitor.security.warning.cipher" /> + + + + "); + // These two values can change. So only check they're not empty. + checkLabelNotEmpty("#security-keagroup-value"); + checkLabelNotEmpty("#security-signaturescheme-value"); + // Locale sensitive and varies between timezones. Cant't compare equality or // the test fails depending on which part of the world the test is executed. checkLabelNotEmpty("#security-cert-validity-begins"); -- cgit v1.2.3 From 644e9db1092df1477b1facc52cd3ee45ebd13040 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 11:52:50 +0100 Subject: DevTools - network - implement the secureConnectionStart property for the PerformanceTiming https://github.com/MoonchildProductions/moebius/pull/116 ("/testing" and "/toolkit" in in the previous commit) --- devtools/client/netmonitor/netmonitor-view.js | 11 ++++++++++- devtools/client/netmonitor/netmonitor.xul | 8 ++++++++ devtools/client/netmonitor/requests-menu-view.js | 2 +- .../client/netmonitor/test/browser_net_simple-request-data.js | 2 ++ 4 files changed, 21 insertions(+), 2 deletions(-) (limited to 'devtools/client/netmonitor') diff --git a/devtools/client/netmonitor/netmonitor-view.js b/devtools/client/netmonitor/netmonitor-view.js index 19dd96ff1..414b9ab8f 100644 --- a/devtools/client/netmonitor/netmonitor-view.js +++ b/devtools/client/netmonitor/netmonitor-view.js @@ -963,7 +963,7 @@ NetworkDetailsView.prototype = { if (!response) { return; } - let { blocked, dns, connect, send, wait, receive } = response.timings; + let { blocked, dns, connect, ssl, send, wait, receive } = response.timings; let tabboxWidth = $("#details-pane").getAttribute("width"); @@ -988,6 +988,11 @@ NetworkDetailsView.prototype = { $("#timings-summary-connect .requests-menu-timings-total") .setAttribute("value", L10N.getFormatStr("networkMenu.totalMS", connect)); + $("#timings-summary-ssl .requests-menu-timings-box") + .setAttribute("width", ssl * scale); + $("#timings-summary-ssl .requests-menu-timings-total") + .setAttribute("value", L10N.getFormatStr("networkMenu.totalMS", ssl)); + $("#timings-summary-send .requests-menu-timings-box") .setAttribute("width", send * scale); $("#timings-summary-send .requests-menu-timings-total") @@ -1007,6 +1012,8 @@ NetworkDetailsView.prototype = { .style.transform = "translateX(" + (scale * blocked) + "px)"; $("#timings-summary-connect .requests-menu-timings-box") .style.transform = "translateX(" + (scale * (blocked + dns)) + "px)"; + $("#timings-summary-ssl .requests-menu-timings-box") + .style.transform = "translateX(" + (scale * blocked) + "px)"; $("#timings-summary-send .requests-menu-timings-box") .style.transform = "translateX(" + (scale * (blocked + dns + connect)) + "px)"; @@ -1022,6 +1029,8 @@ NetworkDetailsView.prototype = { .style.transform = "translateX(" + (scale * blocked) + "px)"; $("#timings-summary-connect .requests-menu-timings-total") .style.transform = "translateX(" + (scale * (blocked + dns)) + "px)"; + $("#timings-summary-ssl .requests-menu-timings-total") + .style.transform = "translateX(" + (scale * blocked) + "px)"; $("#timings-summary-send .requests-menu-timings-total") .style.transform = "translateX(" + (scale * (blocked + dns + connect)) + "px)"; diff --git a/devtools/client/netmonitor/netmonitor.xul b/devtools/client/netmonitor/netmonitor.xul index 117ecf261..aa5c4d848 100644 --- a/devtools/client/netmonitor/netmonitor.xul +++ b/devtools/client/netmonitor/netmonitor.xul @@ -478,6 +478,14 @@ + +