Skip to content

Commit

Permalink
#7535 fix tooltips error when there is no connect button, fix stop bu…
Browse files Browse the repository at this point in the history
…tton possitioning
  • Loading branch information
piorek committed Jun 21, 2018
1 parent b92c698 commit a26cd88
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
27 changes: 23 additions & 4 deletions js/notebook/src/SparkUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,23 @@ export class SparkUIView extends widgets.VBoxView {
}

private setupTooltips(): void {
this.el.querySelector('.bx-spark-connect').setAttribute('title', "Start a session with a cluster (or a local instance)");
this.el.querySelector('.bx-spark-profile select').setAttribute('title', "Set all properties from a named profile");
this.el.querySelector('.bx-spark-executor-cores input').setAttribute('title', "The number of cores to use on each executor");
this.el.querySelector('.bx-spark-executor-memory input').setAttribute('title', "Amount of memory to use per executor process, in MiB unless otherwise specified. (e.g. 2g, 8g).");
const startButton = this.el.querySelector('.bx-spark-connect');
const profileSelect = this.el.querySelector('.bx-spark-profile select');
const executorCoresInput = this.el.querySelector('.bx-spark-executor-cores input');
const executorMemmoryInput = this.el.querySelector('.bx-spark-executor-memory input');

if (startButton) {
startButton.setAttribute('title', "Start a session with a cluster (or a local instance)");
}
if (profileSelect) {
profileSelect.setAttribute('title', "Set all properties from a named profile");
}
if (executorCoresInput) {
executorCoresInput.setAttribute('title', "The number of cores to use on each executor");
}
if (executorMemmoryInput) {
executorMemmoryInput.setAttribute('title', "Amount of memory to use per executor process, in MiB unless otherwise specified. (e.g. 2g, 8g).");
}
}

private handleFormState() {
Expand Down Expand Up @@ -246,6 +259,12 @@ 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 {
this.sparkStats.node.style.marginRight = `${290 - (this.sparkStats.node.offsetWidth + this.connectionStatusElement.offsetWidth)}px`;
}

private connectToApi() {
Expand Down
2 changes: 1 addition & 1 deletion js/notebook/src/shared/style/spark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
}

.bx-status-panel {
padding: 2px 0;
.bx-button {
margin-left: 20px;
height: 24px;
padding: 0 6px;
}
Expand Down

0 comments on commit a26cd88

Please sign in to comment.