Skip to content

Commit

Permalink
fix: add scroll to the lablup-activity-panel
Browse files Browse the repository at this point in the history
  • Loading branch information
ironAiken2 committed Sep 25, 2024
1 parent 9b7c75e commit 675fdca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/backend-ai-resource-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ export default class BackendAIResourcePanel extends BackendAIPage {
elevation="1"
narrow
height="${this.height}"
scrollableY="true"
>
<div slot="message">
<div class="horizontal justified layout wrap indicators">
Expand Down
1 change: 1 addition & 0 deletions src/components/backend-ai-summary-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ export default class BackendAISummary extends BackendAIPage {
elevation="1"
narrow
height="500"
scrollableY="true"
>
<div slot="message">
<backend-ai-resource-monitor
Expand Down
17 changes: 12 additions & 5 deletions src/components/lablup-activity-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default class LablupActivityPanel extends LitElement {
@click="${() => this._removePanel()}"
></mwc-icon-button>
</h4>
<div class="${this.disabled ? `disabled` : `enabled`}">
<div class="content ${this.disabled ? `disabled` : `enabled`}">
<slot name="message"></slot>
</div>
</div>
Expand All @@ -168,6 +168,9 @@ export default class LablupActivityPanel extends LitElement {
}

const card = this.shadowRoot?.querySelector('.card') as HTMLDivElement;
const content = this.shadowRoot?.querySelector(
'.content',
) as HTMLDivElement;
const header = this.shadowRoot?.querySelector(
'#header',
) as HTMLHeadingElement;
Expand Down Expand Up @@ -208,17 +211,21 @@ export default class LablupActivityPanel extends LitElement {
}

if (this.height > 0) {
this.height == 130
? (card.style.height = 'fit-content')
: (card.style.height = this.height + 'px');
if (this.height == 130) {
card.style.height = 'fit-content';
} else {
content.style.height = this.height - 70 + 'px';
card.style.height = this.height + 'px';
}
}

if (this.noheader) {
header.style.display = 'none';
}

if (this.scrollableY) {
card.style.overflowY = 'auto';
content.style.overflowY = 'auto';
content.style.overflowX = 'hidden';
}
}

Expand Down

0 comments on commit 675fdca

Please sign in to comment.