Skip to content

Commit

Permalink
Merge branch 'master' of github.com:twosigma/beakerx into lmitusinski…
Browse files Browse the repository at this point in the history
…/7535
  • Loading branch information
piorek committed Jun 20, 2018
2 parents 187d42e + d14d9bf commit 6ec3672
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
8 changes: 8 additions & 0 deletions js/notebook/src/SparkUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ export class SparkUIView extends widgets.VBoxView {
window.open(`${this.sparkUiWebUrl}/executors`, '_blank');
}

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).");
}

private handleFormState() {
const startButton = this.el.querySelector('.bx-spark-connect');

Expand Down Expand Up @@ -196,6 +203,7 @@ export class SparkUIView extends widgets.VBoxView {
this.addSparkUrls();
this.handleFormState();
this.toggleExecutorConfigInputs();
this.setupTooltips();
}, 10);
});
}, noop);
Expand Down
11 changes: 9 additions & 2 deletions js/notebook/src/shared/style/spark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,18 @@
.bx-spark-connect-error {
margin-left: 20px;
}

.bx-spark-configuration {
.bx-properties-add-label {
width: 298px;
text-align: right;
}
}
}

.bx-spark-save-button {
margin-left: 10px;
width: 80px;
margin-left: 10px;
width: 80px;
}

.bx-toolbar-spark-widget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public class SparkConfiguration extends VBox {
SparkConfiguration(Map<String, String> advancedSettings, String sparkVersion) {
super(new ArrayList<>());
this.add = createAddButton();
this.header = new HBox(asList(this.add, sparkVersionWidget(sparkVersion)));
this.header = new HBox(asList(sparkVersionWidget(sparkVersion), this.add));
List<PropertyItem> propertyItems = createPropertyItems(advancedSettings);
this.properties = new PropertiesWidget(propertyItems);
VBox configuration = new VBox(asList(this.header, this.properties.getWidget()));
VBox configuration = new VBox(asList(this.properties.getWidget(), this.header));
configuration.setDomClasses(new ArrayList<>(asList("bx-spark-configuration")));
add(configuration);
}
Expand All @@ -47,6 +47,7 @@ private HTML sparkVersionWidget(String version) {
HTML html = new HTML();
String ap = String.format("https://spark.apache.org/docs/%s/configuration.html#available-properties", version);
html.setValue("<a target=\"_blank\" href=\"" + ap + "\">Available properties" + "</a>");
html.setDomClasses(new ArrayList<>(asList("bx-properties-add-label")));
return html;
}

Expand All @@ -59,7 +60,7 @@ private List<PropertyItem> createPropertyItems(Map<String, String> advancedSetti
private Button createAddButton() {
Button add = new Button();
add.setTooltip("Add property");
add.setDomClasses(new ArrayList<>(asList("bx-button", "icon-add")));
add.setDomClasses(new ArrayList<>(asList("bx-button", "icon-add", "bx-properties-add-button")));
add.registerOnClick((content, message) -> addProperty());
return add;
}
Expand Down Expand Up @@ -122,7 +123,7 @@ public void setConfiguration(Map<String, String> advancedSettings) {
List<PropertyItem> propertyItems = createPropertyItems(advancedSettings);
this.properties = new PropertiesWidget(propertyItems);
this.remove(this.getChildren().get(0));
add(new VBox(asList(this.header, this.properties.getWidget())));
add(new VBox(asList(this.properties.getWidget(), this.header)));
}

public void setDisabledToAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private Text createExecutorMemory() {

private Text createExecutorCores() {
Text cores = new Text();
cores.setDescription("Executor cores");
cores.setDescription("Executor Cores");
cores.setDomClasses(new ArrayList<>(asList("bx-spark-config", "bx-spark-executor-cores")));
if (getSparkConf().contains(SPARK_EXECUTOR_CORES)) {
cores.setValue(getSparkConf().get(SPARK_EXECUTOR_CORES));
Expand Down

0 comments on commit 6ec3672

Please sign in to comment.