Bug 981842 - Show details about current and past teleemtry experiments in about:support, r=bsmedberg

This commit is contained in:
Gregg Lind 2014-03-20 11:19:19 -04:00
Родитель d35ee16d63
Коммит f8c4280718
3 изменённых файлов: 67 добавлений и 0 удалений

Просмотреть файл

@ -111,6 +111,21 @@ let snapshotFormatters = {
}));
},
experiments: function experiments(data) {
$.append($("experiments-tbody"), data.map(function (experiment) {
return $.new("tr", [
$.new("td", experiment.name),
$.new("td", experiment.id),
$.new("td", experiment.description),
$.new("td", experiment.active),
$.new("td", experiment.endDate),
$.new("td", [
$.new("a", experiment.detailURL, null, {href : experiment.detailURL,})
]),
]);
}));
},
modifiedPreferences: function modifiedPreferences(data) {
$.append($("prefs-tbody"), sortedArrayFromObject(data).map(
function ([name, value]) {

Просмотреть файл

@ -317,6 +317,39 @@
</tbody>
</table>
<h2 class="major-section">
&aboutSupport.experimentsTitle;
</h2>
<table>
<thead>
<tr>
<th>
&aboutSupport.experimentName;
</th>
<th>
&aboutSupport.experimentId;
</th>
<th>
&aboutSupport.experimentDescription;
</th>
<th>
&aboutSupport.experimentActive;
</th>
<th>
&aboutSupport.experimentEndDate;
</th>
<th>
&aboutSupport.experimentHomepage;
</th>
</tr>
</thead>
<tbody id="experiments-tbody">
</tbody>
</table>
<!-- - - - - - - - - - - - - - - - - - - - - -->
</div>
</body>

Просмотреть файл

@ -15,6 +15,13 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/CrashReports.jsm");
#endif
let Experiments;
try {
Experiments = Cu.import("resource:///modules/experiments/Experiments.jsm").Experiments;
}
catch (e) {
}
// We use a preferences whitelist to make sure we only show preferences that
// are useful for support and won't compromise the user's privacy. Note that
// entries are *prefixes*: for example, "accessibility." applies to all prefs
@ -174,6 +181,18 @@ let dataProviders = {
});
},
experiments: function experiments(done) {
if (Experiments === undefined) {
done([]);
return;
}
// getExperiments promises experiment history
Experiments.instance().getExperiments().then(
experiments => done(experiments)
);
},
modifiedPreferences: function modifiedPreferences(done) {
function getPref(name) {
let table = {};