downey
(Michael Downey)
2014 年4 月 1 日 17:40
1
Continuing the discussion from How can you hide the MiniProfiler? :
Note there seems to now be a setting in config/discourse.conf for this:
# enable MiniProfiler for administrators
enable_mini_profiler = true
It would be nice to see this move into the Admin settings in the future.
Is this (in the admin settings) something possible to do? Since the mini-profiler is always on the left side of the screen, it’s often in the way for a language that has left-to-right reading and left-justified text. It’d be great if we could toggle it on only when needed for troubleshooting.
3 个赞
You can press alt +P to hide or show it at any time.
18 个赞
Where could I have learned that alt-p trick?
4 个赞
mlapida
(Michael Lapidakis)
2014 年4 月 2 日 03:16
4
It’s in the source code, at the bottom of the page:
data-toggle-shortcut="Alt+P" data-start-hidden="false"></script>
5 个赞
@codinghorror I use
chrome-extension://jlpkojjdgbllmedoapgfodplfhcbnbpn/update.html#help
Which uses Alt-P…
Any chance that the keyboard shortcut could be configurable, or can be eventually turned off/on via the admin settings?
downey
(Michael Downey)
2015 年7 月 5 日 22:26
6
Did you try disabling your extension for a moment, then disabling the profiler, then re-enabling your extension? Seems like that would do it.
1 个赞
pnoeric
(Eric)
2020 年4 月 4 日 16:18
7
Hi @downey , is this first message still accurate? You reference enable_mini_profiler but here in Github the flag appears to be named load_mini_profiler
Also, after changing this setting, do I need to do an app reload, an app rebuild, or nothing (changes take effect immediately)?
Thanks-- E
2 个赞
downey
(Michael Downey)
2020 年4 月 4 日 16:21
8
Well much has changed in 5 years. I don’t know about a global disable, someone else might. AFAIK the Alt+P still works.
4 个赞
rsmithlal
(Robert Smith)
2021 年5 月 18 日 13:52
9
Thanks for your reply. I noticed it appear one day and had no idea why, so your answer helped a lot.
2 个赞
rsmithlal
(Robert Smith)
2021 年6 月 30 日 15:32
10
Apparently the mini profiler interface only appears for users that are designated as developers, not just any admin. Is that right?
Falco
(Falco)
2021 年6 月 30 日 15:53
11
Yes, only users in the developers role will see it.
1 个赞
Jagster
(Jakke Lehtonen)
2021 年10 月 7 日 19:17
12
What if there isn’t ALT-key… like in my iPhone or logitech-made-mac-keybord of iPad?
This isn’t any bigger issue and like to see snapshot of loading time, but when I take screenshots for users it looks a bit odd.
sam
(Sam Saffron)
2021 年10 月 8 日 02:31
13
Note it is only visible to developers (you need to explicitly insert a row into a table)
You can always use the UI directly to tweak visibility.
2 个赞
Falco:
是的,只有开发人员角色的用户才能看到它。
用户如何被添加到“开发人员角色”或从中移除? 我没有看到这样的组。
1 个赞
Stephen
(Stephen)
2023 年6 月 1 日 19:10
15
与 app.yml 中指定的电子邮件地址默认匹配。
如果您想将其添加到其他用户,则需要直接编辑数据库。
3 个赞
pfaffman
(Jay Pfaffman)
2023 年6 月 2 日 16:56
16
你可以在 app.yml 中通过逗号分隔来添加多个开发者到 DISCOURSE_DEVELOPER_EMAILS。从该变量中删除电子邮件也会将他们从该角色中移除,除非你设法将其添加到数据库(我不知道这是可能的)。
6 个赞
我刚刚亲身体验了 UI 中关于 mini-profiler 信息不足的问题,不知道它是什么、叫什么、为什么会显示给我,以及如何隐藏它。我设置了网站但不是开发者,所以不需要看到它,只是习惯了它的存在。
至少,我建议更新文档来解释当前的行为:
除此之外,如果可能的话,我希望看到一些帮助文本,为那些对它感到困惑并想让它消失的用户提供指导,例如“Miniprofiler - 按 ALT+P 切换显示”。
下面的内容似乎是一个很好的向用户添加它的分步指南。
Falco:
为了确切地知道问题所在:
编辑 app.yml 文件,并将您的管理员用户邮箱添加到 DISCOURSE_DEVELOPER_EMAILS。
重建
以步骤 1 中设置的用户身份登录并加载慢速页面。
分享 mini-profiler 的结果
分享此内容和展开窗口中的内容:
3 个赞
pfaffman
(Jay Pfaffman)
2024 年1 月 5 日 23:13
19
也许它应该默认关闭。然后想要它的人可以打开它,其他人则不会知道。
4 个赞
是的,我喜欢这个想法。即使你在 DISCOURSE_DEVELOPER_EMAILS 中,它也会默认关闭。
我注意到当我从 app.yml 中的 DISCOURSE_DEVELOPER_EMAILS 中删除我的电子邮件地址并重建时,我完全失去了 miniprofiler。我本以为它仍然会通过 ALT+P 显示,但可能有一些我不知道的技术细节。
2 个赞
pfaffman
(Jay Pfaffman)
2024 年1 月 5 日 23:51
21
这使得您能够看到 miniprofiler。
但是,可以将其更改为默认关闭,然后想要它的人可以按 ALT-P 键打开它。我认为这可以为几乎所有人解决这个问题。我怀疑如果默认关闭它,是否会有一堆人询问如何将其重新打开(我推测快捷方式在快捷方式菜单中)。
2 个赞