Update developer-tools-template.ts: add independent scrollbars for left & right panels for large screens (#17765)

* Update developer-tools-template.ts

* Update developer-tools-template.ts

* fix overflow

* Update src/panels/developer-tools/template/developer-tools-template.ts

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>

* Update src/panels/developer-tools/template/developer-tools-template.ts

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>

* Update developer-tools-template.ts

* Update src/panels/developer-tools/template/developer-tools-template.ts

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>

* Update developer-tools-template.ts

* prettier

* Update developer-tools-template.ts

* Update developer-tools-template.ts

* prettier

* Update developer-tools-template.ts

* prettier

* prettier

* Update developer-tools-template.ts

* prettier

* prettier

* prettier

* Update developer-tools-template.ts

---------

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>
pull/23237/head
ildar170975 2024-12-10 12:11:48 +03:00 committed by GitHub
parent 1b0e53d3d9
commit d1c981bc19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 39 additions and 16 deletions

View File

@ -181,17 +181,21 @@ class HaPanelDevTemplate extends LitElement {
>` >`
: nothing} : nothing}
${this._templateResult ${this._templateResult
? html`${this.hass.localize( ? html`<pre
"ui.panel.developer-tools.tabs.templates.result_type" class="rendered ${classMap({
)}: [resultType]: resultType,
${resultType} })}"
<!-- prettier-ignore --> >
<pre class="rendered ${classMap({ ${type === "object"
[resultType]: resultType, ? JSON.stringify(this._templateResult.result, null, 2)
})}" : this._templateResult.result}</pre
>${type === "object" >
? JSON.stringify(this._templateResult.result, null, 2) <p>
: this._templateResult.result}</pre> ${this.hass.localize(
"ui.panel.developer-tools.tabs.templates.result_type"
)}:
${resultType}
</p>
${this._templateResult.listeners.time ${this._templateResult.listeners.time
? html` ? html`
<p> <p>
@ -249,11 +253,11 @@ class HaPanelDevTemplate extends LitElement {
</ul> </ul>
` `
: !this._templateResult.listeners.time : !this._templateResult.listeners.time
? html`<span class="all_listeners"> ? html`<p class="all_listeners">
${this.hass.localize( ${this.hass.localize(
"ui.panel.developer-tools.tabs.templates.no_listeners" "ui.panel.developer-tools.tabs.templates.no_listeners"
)} )}
</span>` </p>`
: nothing}` : nothing}`
: nothing} : nothing}
</div> </div>
@ -281,6 +285,10 @@ class HaPanelDevTemplate extends LitElement {
max(16px, env(safe-area-inset-left)); max(16px, env(safe-area-inset-left));
} }
.content.horizontal {
--code-mirror-max-height: calc(100vh - 389px);
}
ha-card { ha-card {
margin-bottom: 16px; margin-bottom: 16px;
} }
@ -293,8 +301,9 @@ class HaPanelDevTemplate extends LitElement {
color: var(--primary-color); color: var(--primary-color);
} }
.horizontal .edit-pane { .content.horizontal > * {
max-width: 50%; width: 50%;
margin-bottom: 0px;
} }
.render-spinner { .render-spinner {
@ -316,7 +325,21 @@ class HaPanelDevTemplate extends LitElement {
white-space: pre-wrap; white-space: pre-wrap;
background-color: var(--secondary-background-color); background-color: var(--secondary-background-color);
padding: 8px; padding: 8px;
margin-top: 0;
margin-bottom: 0;
direction: ltr; direction: ltr;
overflow: auto;
}
p,
ul {
margin-block-end: 0;
}
.content.horizontal .render-pane .card-content {
display: flex;
flex-direction: column;
max-height: calc(var(--code-mirror-max-height) + 47px);
} }
.all_listeners { .all_listeners {
@ -324,7 +347,7 @@ class HaPanelDevTemplate extends LitElement {
} }
@media all and (max-width: 870px) { @media all and (max-width: 870px) {
.render-pane { .content ha-card {
max-width: 100%; max-width: 100%;
} }
} }