mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: CSS tweak and production position fix for miniprofiler (#17493)
* DEV: Format miniprofiler html * FIX: Move miniprofiler to the right in production * UX: Fix and merge miniprofiler css
This commit is contained in:
parent
737c0a7b9f
commit
4b935b61eb
4 changed files with 34 additions and 10 deletions
|
@ -141,10 +141,30 @@ function bodyFooter(buffer, bootstrap, headers) {
|
||||||
|
|
||||||
let v = generateUID();
|
let v = generateUID();
|
||||||
buffer.push(`
|
buffer.push(`
|
||||||
<script async type="text/javascript" id="mini-profiler" src="/mini-profiler-resources/includes.js?v=${v}" data-css-url="/mini-profiler-resources/includes.css?v=${v}" data-version="${v}" data-path="/mini-profiler-resources/" data-horizontal-position="right" data-vertical-position="top" data-trivial="false" data-children="false" data-max-traces="20" data-controls="false" data-total-sql-count="false" data-authorized="true" data-toggle-shortcut="alt+p" data-start-hidden="false" data-collapse-results="true" data-html-container="body" data-hidden-custom-fields="x" data-ids="${headers.get(
|
<script
|
||||||
"x-miniprofiler-ids"
|
async
|
||||||
)}"></script>
|
type="text/javascript"
|
||||||
`);
|
id="mini-profiler"
|
||||||
|
src="/mini-profiler-resources/includes.js?v=${v}"
|
||||||
|
data-css-url="/mini-profiler-resources/includes.css?v=${v}"
|
||||||
|
data-version="${v}"
|
||||||
|
data-path="/mini-profiler-resources/"
|
||||||
|
data-horizontal-position="right"
|
||||||
|
data-vertical-position="top"
|
||||||
|
data-trivial="false"
|
||||||
|
data-children="false"
|
||||||
|
data-max-traces="20"
|
||||||
|
data-controls="false"
|
||||||
|
data-total-sql-count="false"
|
||||||
|
data-authorized="true"
|
||||||
|
data-toggle-shortcut="alt+p"
|
||||||
|
data-start-hidden="false"
|
||||||
|
data-collapse-results="true"
|
||||||
|
data-html-container="body"
|
||||||
|
data-hidden-custom-fields="x"
|
||||||
|
data-ids="${headers.get("x-miniprofiler-ids")}"
|
||||||
|
></script>
|
||||||
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hiddenLoginForm(buffer, bootstrap) {
|
function hiddenLoginForm(buffer, bootstrap) {
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
// Some basic overrides to https://github.com/MiniProfiler/rack-mini-profiler/blob/master/lib/html/includes.scss
|
// Some basic overrides to https://github.com/MiniProfiler/rack-mini-profiler/blob/master/lib/html/includes.scss
|
||||||
// which make the badge conform to the current site theme.
|
// which make the badge conform to the current site theme.
|
||||||
|
|
||||||
div.profiler-results {
|
div.profiler-results.profiler-top {
|
||||||
|
top: var(--header-offset);
|
||||||
|
|
||||||
.profiler-button {
|
.profiler-button {
|
||||||
background-color: var(--header_background);
|
background-color: var(--header_background);
|
||||||
color: var(--header_primary);
|
color: var(--header_primary);
|
||||||
|
@ -16,7 +18,11 @@ div.profiler-results {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.profiler-left.profiler-top .profiler-button {
|
&.profiler-left .profiler-button {
|
||||||
border-right: 1px solid var(--header_primary-low);
|
border-right: 1px solid var(--header_primary-low);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.profiler-right .profiler-button {
|
||||||
|
border-left: 1px solid var(--header_primary-low);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -380,10 +380,6 @@ table {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profiler-results.profiler-right {
|
|
||||||
top: var(--header-offset) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-center-align {
|
.flex-center-align {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -72,6 +72,8 @@ if defined?(Rack::MiniProfiler) && defined?(Rack::MiniProfiler::Config)
|
||||||
# does not get clobbered.
|
# does not get clobbered.
|
||||||
Rack::MiniProfiler.config.cookie_path = Discourse.base_path.presence || "/"
|
Rack::MiniProfiler.config.cookie_path = Discourse.base_path.presence || "/"
|
||||||
|
|
||||||
|
Rack::MiniProfiler.config.position = "right"
|
||||||
|
|
||||||
Rack::MiniProfiler.config.backtrace_ignores ||= []
|
Rack::MiniProfiler.config.backtrace_ignores ||= []
|
||||||
Rack::MiniProfiler.config.backtrace_ignores << /lib\/rack\/message_bus.rb/
|
Rack::MiniProfiler.config.backtrace_ignores << /lib\/rack\/message_bus.rb/
|
||||||
Rack::MiniProfiler.config.backtrace_ignores << /config\/initializers\/silence_logger/
|
Rack::MiniProfiler.config.backtrace_ignores << /config\/initializers\/silence_logger/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue