Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

define base shareUrl#7906

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
blink1073 merged 1 commit intojupyterlab:masterfromminrk:shareUrl
Feb 22, 2020
Merged
Show file tree
Hide file tree
Changes fromall 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
define base shareUrl
allows simplest override of "get shareable link" extension when sharing setup is the same,just on a different base URL.And set this when run under JupyterHub, so folks get proper shareable links by default
  • Loading branch information
@minrk
minrk committedFeb 21, 2020
commit25ca3dfedd187d87f9297408ac33b7a71a019d60
1 change: 1 addition & 0 deletionsjupyterlab/extension.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,6 +209,7 @@ def load_jupyter_server_extension(nbapp):
page_config['hubPrefix'] = nbapp.hub_prefix
page_config['hubHost'] = nbapp.hub_host
page_config['hubUser'] = nbapp.user
page_config['shareUrl'] = ujoin(nbapp.hub_prefix, 'user-redirect')
# Assume the server_name property indicates running JupyterHub 1.0.
if hasattr(nbapp, 'server_name'):
page_config['hubServerName'] = nbapp.server_name
Expand Down
16 changes: 16 additions & 0 deletionspackages/coreutils/src/pageconfig.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,6 +117,22 @@ export namespace PageConfig {
return URLExt.join(getBaseUrl(), getOption('treeUrl'));
}

/**
* Get the base url for sharing links (usually baseUrl)
*/
export function getShareUrl(): string {
return URLExt.normalize(getOption('shareUrl') || getBaseUrl());
}

/**
* Get the tree url for shareable links.
* Usually the same as treeUrl,
* but overrideable e.g. when sharing with JupyterHub.
*/
export function getTreeShareUrl(): string {
return URLExt.normalize(URLExt.join(getShareUrl(), getOption('treeUrl')));
}

/**
* Get the base websocket url for a Jupyter application, or an empty string.
*/
Expand Down
2 changes: 1 addition & 1 deletionpackages/filebrowser-extension/src/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -388,7 +388,7 @@ function activateShareFile(
return;
}
const path = encodeURI(model.path);
Clipboard.copyToSystem(URLExt.join(PageConfig.getTreeUrl(), path));
Clipboard.copyToSystem(URLExt.join(PageConfig.getTreeShareUrl(), path));
},
isVisible: () =>
!!tracker.currentWidget &&
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp