From c8ac9d5026572792baf1906c879cec4c224ef279 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 21 Mar 2022 17:25:30 +0530 Subject: [PATCH] create a new 'debugging' sidebar pane in support --- www/support/app-support.less | 5 +++++ www/support/inner.js | 27 +++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/www/support/app-support.less b/www/support/app-support.less index c364d84e7..67c76aa8d 100644 --- a/www/support/app-support.less +++ b/www/support/app-support.less @@ -47,5 +47,10 @@ br { margin: 5px; } + pre.debug-data { + background-color: @cp_markdown-block-bg; + color: @cp_markdown-block-fg; + padding: 5px; + } } diff --git a/www/support/inner.js b/www/support/inner.js index fd6a25662..2b6f761d5 100644 --- a/www/support/inner.js +++ b/www/support/inner.js @@ -49,6 +49,9 @@ define([ 'cp-support-language', 'cp-support-form', ], + 'debugging': [ + 'cp-support-debugging-data', + ], }; var supportKey = ApiConfig.supportMailbox; @@ -225,6 +228,16 @@ define([ return $div; }; + create['debugging-data'] = function () { + var key = 'debugging-data'; + var $div = makeBlock(key); // Msg.support_debuggingDataTitle.support_debuggingDataHint; + var data = APP.support.getDebuggingData().sender; + + var content = h('pre.debug-data', JSON.stringify(data, null, 2)); + $div.append(content); + + return $div; + }; var hideCategories = function () { APP.$rightside.find('> div').hide(); @@ -237,6 +250,12 @@ define([ }); }; + var icons = { + tickets: 'fa-envelope-o', + new: 'fa-life-ring', + debugging: 'fa-wrench', + }; + var createLeftside = function () { var $categories = $('
', {'class': 'cp-sidebarlayout-categories'}) .appendTo(APP.$leftside); @@ -250,8 +269,12 @@ define([ 'class': 'cp-sidebarlayout-category', 'data-category': key }).appendTo($categories); - if (key === 'tickets') { $category.append($('', {'class': 'fa fa-envelope-o'})); } - if (key === 'new') { $category.append($('', {'class': 'fa fa-life-ring'})); } + var iconClass = icons[key]; + if (iconClass) { + $category.append(h('span', { + class: 'fa ' + iconClass, + })); + } if (key === active) { $category.addClass('cp-leftside-active');