@jupyterlab/services
Advanced tools
Comparing version 0.33.1 to 0.34.0
@@ -33,3 +33,5 @@ // Copyright (c) Jupyter Development Team. | ||
this._readyPromise = this._sessionManager.ready.then(function () { | ||
return _this._terminalManager.ready; | ||
if (_this._terminalManager.isAvailable()) { | ||
return _this._terminalManager.ready; | ||
} | ||
}); | ||
@@ -36,0 +38,0 @@ } |
@@ -83,2 +83,6 @@ import { ISignal } from 'phosphor/lib/core/signaling'; | ||
/** | ||
* Whether the terminal service is available. | ||
*/ | ||
function isAvailable(): boolean; | ||
/** | ||
* Start a new terminal session. | ||
@@ -85,0 +89,0 @@ * |
@@ -7,2 +7,3 @@ // Copyright (c) Jupyter Development Team. | ||
var utils = require('../utils'); | ||
var terminal_1 = require('./terminal'); | ||
/** | ||
@@ -190,2 +191,9 @@ * The url for the terminal service. | ||
/** | ||
* Whether the terminal service is available. | ||
*/ | ||
function isAvailable() { | ||
return !!utils.getConfigOption('terminalsAvailable'); | ||
} | ||
DefaultTerminalSession.isAvailable = isAvailable; | ||
/** | ||
* Start a new terminal session. | ||
@@ -199,2 +207,5 @@ * | ||
if (options === void 0) { options = {}; } | ||
if (!terminal_1.TerminalSession.isAvailable()) { | ||
return Private.unavailable; | ||
} | ||
var baseUrl = options.baseUrl || utils.getBaseUrl(); | ||
@@ -237,2 +248,5 @@ var url = Private.getBaseUrl(baseUrl); | ||
if (options === void 0) { options = {}; } | ||
if (!terminal_1.TerminalSession.isAvailable()) { | ||
return Private.unavailable; | ||
} | ||
var baseUrl = options.baseUrl || utils.getBaseUrl(); | ||
@@ -256,2 +270,5 @@ var url = Private.getTermUrl(baseUrl, name); | ||
if (options === void 0) { options = {}; } | ||
if (!terminal_1.TerminalSession.isAvailable()) { | ||
return Private.unavailable; | ||
} | ||
var url = Private.getBaseUrl(options.baseUrl); | ||
@@ -295,2 +312,5 @@ var ajaxSettings = utils.ajaxSettingsWithToken(options.ajaxSettings, options.token); | ||
if (options === void 0) { options = {}; } | ||
if (!terminal_1.TerminalSession.isAvailable()) { | ||
return Private.unavailable; | ||
} | ||
var url = Private.getTermUrl(options.baseUrl, name); | ||
@@ -329,2 +349,6 @@ var ajaxSettings = utils.ajaxSettingsWithToken(options.ajaxSettings, options.token); | ||
/** | ||
* A promise returned for when terminals are unavailable. | ||
*/ | ||
Private.unavailable = Promise.reject(new Error('Terminals Unavailable')); | ||
/** | ||
* Get the url for a terminal. | ||
@@ -331,0 +355,0 @@ */ |
@@ -50,2 +50,6 @@ import { IIterator } from 'phosphor/lib/algorithm/iteration'; | ||
/** | ||
* Whether the terminal service is available. | ||
*/ | ||
isAvailable(): boolean; | ||
/** | ||
* Create an iterator over the most recent running terminals. | ||
@@ -52,0 +56,0 @@ * |
@@ -32,6 +32,9 @@ // Copyright (c) Jupyter Development Team. | ||
this._readyPromise = this._refreshRunning(); | ||
// Set up polling. | ||
this._refreshTimer = setInterval(function () { | ||
_this._refreshRunning(); | ||
}, 10000); | ||
// Set up polling if terminals are available. | ||
if (terminal_1.TerminalSession.isAvailable()) { | ||
// Set up polling. | ||
this._refreshTimer = setInterval(function () { | ||
_this._refreshRunning(); | ||
}, 10000); | ||
} | ||
} | ||
@@ -117,2 +120,8 @@ Object.defineProperty(TerminalManager.prototype, "isDisposed", { | ||
/** | ||
* Whether the terminal service is available. | ||
*/ | ||
TerminalManager.prototype.isAvailable = function () { | ||
return terminal_1.TerminalSession.isAvailable(); | ||
}; | ||
/** | ||
* Create an iterator over the most recent running terminals. | ||
@@ -119,0 +128,0 @@ * |
@@ -57,2 +57,6 @@ import { IIterator } from 'phosphor/lib/algorithm/iteration'; | ||
/** | ||
* Test whether the terminal service is available. | ||
*/ | ||
function isAvailable(): boolean; | ||
/** | ||
* Start a new terminal session. | ||
@@ -164,2 +168,6 @@ * | ||
/** | ||
* Whether the terminal service is available. | ||
*/ | ||
isAvailable(): boolean; | ||
/** | ||
* Create an iterator over the known running terminals. | ||
@@ -166,0 +174,0 @@ * |
@@ -11,2 +11,9 @@ // Copyright (c) Jupyter Development Team. | ||
/** | ||
* Test whether the terminal service is available. | ||
*/ | ||
function isAvailable() { | ||
return default_1.DefaultTerminalSession.isAvailable(); | ||
} | ||
TerminalSession.isAvailable = isAvailable; | ||
/** | ||
* Start a new terminal session. | ||
@@ -13,0 +20,0 @@ * |
{ | ||
"name": "@jupyterlab/services", | ||
"version": "0.33.1", | ||
"version": "0.34.0", | ||
"description": "Client APIs for the Jupyter services REST APIs", | ||
@@ -42,7 +42,7 @@ "main": "lib/index.js", | ||
"prepublish": "npm run build && webpack", | ||
"test:coverage": "istanbul cover --dir test/coverage _mocha -- test/build/**/*.spec.js --foo bar", | ||
"test:coverage": "istanbul cover --dir test/coverage _mocha -- test/build/**/*.spec.js --foo bar --terminalsAvailable true", | ||
"test:integration": "cd test && python integration_test.py", | ||
"test:devtool": "devtool node_modules/mocha/bin/_mocha -qc test/build/**/**.spec.js --foo bar", | ||
"test:debug": "mocha test/build/**/*.spec.js --foo bar --debug-brk", | ||
"test": "mocha test/build/**/*.spec.js --foo bar" | ||
"test:devtool": "devtool node_modules/mocha/bin/_mocha -qc test/build/**/**.spec.js --foo bar --terminalsAvailable true", | ||
"test:debug": "mocha test/build/**/*.spec.js --foo bar --terminalsAvailable true --debug-brk", | ||
"test": "mocha test/build/**/*.spec.js --foo bar --terminalsAvailable true" | ||
}, | ||
@@ -49,0 +49,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
730764
21441