Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7615 spark status minimum width #7621

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion js/lab/src/theme/static/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@
}

.hidden {
display: none !important;;
display: none !important;
}

.bx-stats .bx-label, .bx-spark-stageProgressLabels .bx-label {
line-height: 1.3;
}

.bx-stats .label {
box-sizing: border-box;
}
25 changes: 23 additions & 2 deletions js/notebook/src/SparkUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ export class SparkUIView extends widgets.VBoxView {
this.connectionLabelDead = this.sparkStats.node.querySelector('.dead');

this.connectionStatusElement.insertAdjacentElement('afterend', this.sparkStats.node);

this.updateSparkStatsStyles();
}

private updateSparkStatsStyles(): void {
Expand Down Expand Up @@ -351,6 +349,29 @@ export class SparkUIView extends widgets.VBoxView {
this.connectionLabelMemory.innerText = `${bkUtils.formatBytes(storageMemory)}`;
this.connectionLabelDead.innerText = `${deadExecutors}`;
this.toolbarSparkConnectionStatus.propagateToolbarWidget();

this.updateLabelWidths();
}

private updateLabelWidths() {
const container = document.createElement('span');

container.style.visibility = 'hidden';
container.style.position = 'absolute';
container.innerText = '999';
container.classList.add('label');

this.sparkStats.node.appendChild(container);
const maxWidth1 = `${container.offsetWidth}px`;
container.innerText = '999 GB';
const maxWidth2 = `${container.offsetWidth}px`;
this.sparkStats.node.removeChild(container);

this.connectionLabelActive.style.width = maxWidth1;
this.connectionLabelDead.style.width = maxWidth1;
this.connectionLabelMemory.style.width = maxWidth2;

this.updateSparkStatsStyles();
}

private addSparkMetricsWidget() {
Expand Down