Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make Jupyter Server name clickable to select Jupyter server #13657

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

Merged
merged 1 commit into from
Aug 28, 2020
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
1 change: 1 addition & 0 deletions news/1 Enhancements/13656.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make Jupyter Server name clickable to select Jupyter server
16 changes: 14 additions & 2 deletions src/datascience-ui/interactive-common/jupyterInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class JupyterInfo extends React.Component<IJupyterInfoProps> {
constructor(prop: IJupyterInfoProps) {
super(prop);
this.selectKernel = this.selectKernel.bind(this);
this.selectServer = this.selectServer.bind(this);
}

public render() {
Expand All @@ -59,11 +60,18 @@ export class JupyterInfo extends React.Component<IJupyterInfoProps> {
maxWidth: getMaxWidth(displayNameTextSize)
};

const ariaDisabled = this.props.isNotebookTrusted === undefined ? false : this.props.isNotebookTrusted;
return (
<div className="kernel-status" style={dynamicFont}>
{this.renderTrustMessage()}
<div className="kernel-status-section kernel-status-server" style={serverTextWidth} role="button">
<div className="kernel-status-text" title={jupyterServerDisplayName}>
<div className="kernel-status-section kernel-status-server" style={serverTextWidth}>
<div
className="kernel-status-text kernel-status-section-hoverable"
style={serverTextWidth}
onClick={this.selectServer}
role="button"
aria-disabled={ariaDisabled}
>
{getLocString('DataScience.jupyterServer', 'Jupyter Server')}: {jupyterServerDisplayName}
</div>
<Image
Expand Down Expand Up @@ -153,4 +161,8 @@ export class JupyterInfo extends React.Component<IJupyterInfoProps> {

return res[1];
}

private selectServer(): void {
this.props.selectServer();
}
}