Admin setting to enable or disable mini-profiler?

Continuing the discussion from How can you hide the MiniProfiler?:

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

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… :frowning:

Any chance that the keyboard shortcut could be configurable, or can be eventually turned off/on via the admin settings?

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

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

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

Thanks for your reply. I noticed it appear one day and had no idea why, so your answer helped a lot.

「いいね!」 2

Apparently the mini profiler interface only appears for users that are designated as developers, not just any admin. Is that right?

Yes, only users in the developers role will see it.

「いいね!」 1

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.

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

ユーザーは「開発者ロール」にどのように追加または削除されますか?グループが見当たりません。

「いいね!」 1

標準では、app.yml で指定されたメールアドレスと一致します。

他のユーザーに追加したい場合は、データベースを直接編集する必要があります。

「いいね!」 3

app.ymlDISCOURSE_DEVELOPER_EMAILS には、カンマで区切って複数の開発者を追加できます。その変数からメールを削除すると、データベースに追加するような(私が可能だと知らなかった)工夫をしていない限り、そのロールからも削除されます。

「いいね!」 6

UIにおけるミニプロファイラーに関する情報不足により、私も被害に遭いました。ミニプロファイラーとは何か、その名称、なぜ表示されるのか、そして非表示にする方法についての情報が不足しています。私はサイトをセットアップしますが、開発者ではないため、それを見る必要はありませんが、慣れてしまいました。

最低限、現在の動作を説明するためにドキュメントを更新することをお勧めします。

  • メタに専用のトピックを作成するか、既存のトピック(もしあれば、見つけられなかったのですが :sweat_smile: )を更新し、人々が検索する可能性のあるキーワードを含め、それに関するトピックを削除または更新し、#miniprofiler(または mini-profiler?)タグを追加します。
  • discourse/docs/ADMIN-QUICK-START-GUIDE.md at main · discourse/discourse · GitHub を更新してミニプロファイラーを参照し、メタトピックにリンクします。

さらに、可能であれば、混乱していてそれを消したいと思っている人のために、「ミニプロファイラー - ALT+Pを押して表示を切り替える」のようなヘルプテキストを表示したいです。

以下は、サイトのユーザーにそれを追加するための良いステップバイステップガイドのようです。

「いいね!」 3

デフォルトでオフにするのが良いのではないでしょうか。そうすれば、それを望む人がオンにでき、他の人は気づくこともありません。

「いいね!」 4

はい、そのアイデアに惹かれます。DISCOURSE_DEVELOPER_EMAILS にいても、デフォルトではオフになります。

app.yml から DISCOURSE_DEVELOPER_EMAILS を削除して再構築したところ、ミニプロファイラーが完全に表示されなくなったことに気づきました。ALT+P を使用しても表示されると予想していましたが、おそらく私が知らない技術的な詳細があるのでしょう。

「いいね!」 2

それがミニプロファイラーを確認できる理由です。

しかし、デフォルトでオフに変更し、それを望む人がALT-Pでオンにすることもできます。これにより、ほとんどすべての人が問題を解決できると思います。デフォルトでオフになった場合、多くの人がオンにする方法を尋ねることはないでしょう(ショートカットはショートカットメニューにあると推測します)。

「いいね!」 2