我该如何使用MiniProfiler.Settings.CustomUITemplates我该、如何使用、MiniProfiler、Settings

2023-09-03 06:52:34 作者:墨锦倾城染青衣

美好的一天。

我在这里看着的previous后以及在 http://miniprofiler.com/ 但无法找到如何使用任何文档 MiniProfiler.Settings.CustomUITemplates

我也看到如何定制迷你探查器UI 这是不是有什么要求。

我们在我们的MVC4页面布局都有一个调试以下部分,我想列出一个弹出显示它的结果在一个div在页面的底部,而不是。

我看,你可以改变弹出窗口的位置,但我想显示的结果在表代替。

您可以请点我在正确的方向。

在code最高审计机关如下:

  ///<总结>
  ///其中,自定义UI元素的存储路径。
  ///如果自定义文件不存在,标准的资源被使用。
  ///此设置应该是在APP相对格式,例如: 〜/ App_Data文件/ MiniProfilerUI
  ///
  ///< /总结>
  ///
  ///<说明>
  ///一个网页需要重新启动服务器重新加载新的文件。
  ///< /说明>
  [默认值(〜/ App_Data文件/ MiniProfilerUI)]
  公共静态字符串CustomUITemplates {获得;组; }
 
使用 MiniProfiler 来分析 ASP.NET Core 应用

解决方案

CustomUITemplates 让你提供你自己版本的任何是的 UI项目 - 即处理所有的客户端操作的文件

默认是使用这些文件,因为它们都包含在.NET项目(子模块包含在的 StackExchange.Profiling .UI。如果包括与指定为 CustomUITemplates 文件夹中的文件夹名称完全相同的文件(默认为〜/ App_Data_MiniProfilerUI ,但你可以把它改成别的东西,如果你喜欢),那么它会使用这些文件,而不是。

在你的榜样,你想改变其结果被在客户端呈现的地方。要做到这一点,你会想复制现有 include.js 文件,把它放在你的模板文件夹,再有改变功能,输出结果的表在你的页面,而不是内置的功能(你可能要开始通过查看修改 buttonShow在include.js 功能,并改变它来处理JSON,你会喜欢的方式)。

Good day.

I have looked here on the previous post as well as on http://miniprofiler.com/ but cannot find any documentation on how to use MiniProfiler.Settings.CustomUITemplates.

I also seen How to customize the Mini-Profiler UI which is not what require.

We have a debug section below in our MVC4 layout page and I would like to list the results in a div at the bottom of the page instead of displaying it in a popup.

I see that you can change the position of the popup but I would like to show the results in a table instead.

Can you please point me in the right direction.

The code sais the following:

  /// <summary>
  /// The path where custom ui elements are stored.
  ///             If the custom file doesn't exist, the standard resource is used.
  ///             This setting should be in APP RELATIVE FORM, e.g. "~/App_Data/MiniProfilerUI"
  /// 
  /// </summary>
  /// 
  /// <remarks>
  /// A web server restart is required to reload new files.
  /// </remarks>
  [DefaultValue("~/App_Data/MiniProfilerUI")]
  public static string CustomUITemplates { get; set; }

解决方案

CustomUITemplates allow you to supply your own version of any of the files that are part of the UI project - the files that handle all of the client-side operations.

The default is to use these files as they are included in the .net project (submodule included in StackExchange.Profiling.ui. If you include files with the exact same name in the folder specified as the CustomUITemplates folder (defaults to ~/App_Data_MiniProfilerUI, but you can change it to something else if you like) then it will use those files instead.

In your example, you want to change the place in which the results are being rendered on the client side. To do this, you would want to copy the existing include.js file, put it in your templates folder, and then change the functionality there to output results to a table in your page, rather than the built in functionality (you might want to start by looking at modifying the buttonShow function in include.js and change it to process the json the way that you would like).