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
嗨 @downey ,这条第一条消息仍然准确吗?你提到了 enable_mini_profiler,但在这里的 GitHub 中,该标志似乎名为 load_mini_profiler(discourse/config/discourse_defaults.conf at main · discourse/discourse · GitHub
另外,在更改此设置后,我需要重新加载应用、重建应用,还是无需任何操作(更改会立即生效)?
谢谢——E
2 个赞
downey
(Michael Downey)
2020 年4 月 4 日 16:21
8
好吧,五年间变化很大。关于全局禁用,我不太清楚,或许其他人知道。据我所知,Alt+P 仍然有效。
4 个赞
rsmithlal
(Robert Smith)
2021 年5 月 18 日 13:52
9
谢谢您的回复。我注意到它出现了一天,却不知原因,所以您的回答帮了大忙。
2 个赞
rsmithlal
(Robert Smith)
2021 年6 月 30 日 15:32
10
显然,Mini Profiler 界面仅对指定为开发者的用户显示,而非所有管理员。是这样吗?
Jagster
(Jakke Flemming)
2021 年10 月 7 日 19:17
12
如果没有 ALT 键怎么办……比如在我的 iPhone 或罗技为 iPad 设计的 Mac 键盘上?
这并非什么大问题,我希望能看到加载时间的截图,但当我为用户截取屏幕时,看起来有点奇怪。
sam
(Sam Saffron)
2021 年10 月 8 日 02:31
13
注意,它仅对开发者可见(您需要显式地向表中插入一行)
您可以始终直接使用 UI 来调整可见性。
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 个赞