mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 11:37:43 -10:00
71 lines
2.1 KiB
JavaScript
71 lines
2.1 KiB
JavaScript
/* 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 {
|
|
createClass,
|
|
DOM,
|
|
PropTypes,
|
|
} = require("devtools/client/shared/vendor/react");
|
|
const { connect } = require("devtools/client/shared/vendor/react-redux");
|
|
const Actions = require("../actions/index");
|
|
const { ACTIVITY_TYPE } = require("../constants");
|
|
const { L10N } = require("../utils/l10n");
|
|
|
|
const { button, div, span } = DOM;
|
|
|
|
/**
|
|
* UI displayed when the request list is empty. Contains instructions on reloading
|
|
* the page and on triggering performance analysis of the page.
|
|
*/
|
|
const RequestListEmptyNotice = createClass({
|
|
displayName: "RequestListEmptyNotice",
|
|
|
|
propTypes: {
|
|
onReloadClick: PropTypes.func.isRequired,
|
|
onPerfClick: PropTypes.func.isRequired,
|
|
},
|
|
|
|
render() {
|
|
return div(
|
|
{
|
|
className: "request-list-empty-notice",
|
|
},
|
|
div({ className: "notice-reload-message" },
|
|
span(null, L10N.getStr("netmonitor.reloadNotice1")),
|
|
button(
|
|
{
|
|
className: "devtools-toolbarbutton requests-list-reload-notice-button",
|
|
"data-standalone": true,
|
|
onClick: this.props.onReloadClick,
|
|
},
|
|
L10N.getStr("netmonitor.reloadNotice2")
|
|
),
|
|
span(null, L10N.getStr("netmonitor.reloadNotice3"))
|
|
),
|
|
div({ className: "notice-perf-message" },
|
|
span(null, L10N.getStr("netmonitor.perfNotice1")),
|
|
button({
|
|
title: L10N.getStr("netmonitor.perfNotice3"),
|
|
className: "devtools-button requests-list-perf-notice-button",
|
|
"data-standalone": true,
|
|
onClick: this.props.onPerfClick,
|
|
}),
|
|
span(null, L10N.getStr("netmonitor.perfNotice2"))
|
|
)
|
|
);
|
|
}
|
|
});
|
|
|
|
module.exports = connect(
|
|
undefined,
|
|
dispatch => ({
|
|
onPerfClick: () => dispatch(Actions.openStatistics(true)),
|
|
onReloadClick: () =>
|
|
window.NetMonitorController
|
|
.triggerActivity(ACTIVITY_TYPE.RELOAD.WITH_CACHE_DEFAULT),
|
|
})
|
|
)(RequestListEmptyNotice);
|