Add more debugging metadata to support tickets

pull/1/head
yflory 3 years ago
parent 1352a6d8fd
commit 1b50efe7ac

@ -2040,9 +2040,16 @@ define([
if (['drive', 'teams', 'settings'].indexOf(app) !== -1) { safe = true; }
Object.keys(teams).forEach(function (id) {
if (!ctx.teams[id]) { return; }
var proxy = ctx.teams[id].proxy || {};
var nPads = proxy.drive && Object.keys(proxy.drive.filesData || {}).length;
var nSf = proxy.drive && Object.keys(proxy.drive.sharedFolders || {}).length;
t[id] = {
owner: teams[id].owner,
name: teams[id].metadata.name,
channel: teams[id].channel,
numberPads: nPads,
numberSf: nSf,
roster: Util.find(teams[id], ['keys', 'roster', 'channel']),
edPublic: Util.find(teams[id], ['keys', 'drive', 'edPublic']),
avatar: Util.find(teams[id], ['metadata', 'avatar']),
viewer: !Util.find(teams[id], ['keys', 'drive', 'edPrivate']),

@ -272,19 +272,27 @@ define([
APP.$rightside = $('<div>', {id: 'cp-sidebarlayout-rightside'}).appendTo(APP.$container);
var sFrameChan = common.getSframeChannel();
sFrameChan.onReady(waitFor());
}).nThen(function (waitFor) {
metadataMgr = common.getMetadataMgr();
privateData = metadataMgr.getPrivateData();
common.getPinUsage(null, waitFor(function (err, data) {
if (err) { return void console.error(err); }
APP.pinUsage = data;
}));
APP.teamsUsage = {};
Object.keys(privateData.teams).forEach(function (teamId) {
common.getPinUsage(teamId, waitFor(function (err, data) {
if (err) { return void console.error(err); }
APP.teamsUsage[teamId] = data;
}));
});
}).nThen(function (/*waitFor*/) {
createToolbar();
metadataMgr = common.getMetadataMgr();
privateData = metadataMgr.getPrivateData();
common.setTabTitle(Messages.supportPage);
APP.origin = privateData.origin;
APP.readOnly = privateData.readOnly;
APP.support = Support.create(common, false, APP.pinUsage);
APP.support = Support.create(common, false, APP.pinUsage, APP.teamsUsage);
// Content
var $rightside = APP.$rightside;

@ -31,9 +31,7 @@ define([
if (typeof(ctx.pinUsage) === 'object') {
// pass pin.usage, pin.limit, and pin.plan if supplied
Object.keys(ctx.pinUsage).forEach(function (k) {
data.sender[k] = ctx.pinUsage[k];
});
data.sender.quota = ctx.pinUsage;
}
data.id = id;
@ -45,11 +43,14 @@ define([
data.sender.blockLocation = privateData.blockLocation || '';
data.sender.teams = Object.keys(teams).map(function (key) {
var team = teams[key];
if (!teams) { return; }
if (!team) { return; }
var ret = {};
['edPublic', 'owner', 'viewer', 'hasSecondaryKey', 'validKeys'].forEach(function (k) {
['channel', 'roster', 'numberPads', 'numberSf', 'edPublic', 'curvePublic', 'owner', 'viewer', 'hasSecondaryKey', 'validKeys'].forEach(function (k) {
ret[k] = team[k];
});
if (ctx.teamsUsage && ctx.teamsUsage[key]) {
ret.quota = ctx.teamsUsage[key];
}
return ret;
}).filter(Boolean);
@ -430,12 +431,13 @@ define([
]);
};
var create = function (common, isAdmin, pinUsage) {
var create = function (common, isAdmin, pinUsage, teamsUsage) {
var ui = {};
var ctx = {
common: common,
isAdmin: isAdmin,
pinUsage: pinUsage || false,
teamsUsage: teamsUsage || false,
adminKeys: Array.isArray(ApiConfig.adminKeys)? ApiConfig.adminKeys.slice(): [],
};

Loading…
Cancel
Save