Skip to content

Commit 2613a24

Browse files
committed
put server extension under ipyparallel prefix
1 parent 50a919e commit 2613a24

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ repos:
2727
hooks:
2828
- id: eslint
2929
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
30+
exclude: ipyparallel/nbextension/.*
3031
types: [file]
3132
additional_dependencies:
3233
- "@typescript-eslint/[email protected]"

ipyparallel/nbextension/handlers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,14 @@ async def delete(self, cluster_key):
9393
# -----------------------------------------------------------------------------
9494

9595

96-
_cluster_action_regex = r"(?P<action>start|stop|create)"
9796
_cluster_key_regex = (
9897
r"(?P<cluster_key>[^\/]+)" # there is almost no text that is invalid
9998
)
10099

101100
default_handlers = [
102-
(r"/clusters", ClusterListHandler),
101+
(r"/ipyparallel/clusters", ClusterListHandler),
103102
(
104-
rf"/clusters/{_cluster_key_regex}",
103+
rf"/ipyparallel/clusters/{_cluster_key_regex}",
105104
ClusterActionHandler,
106105
),
107106
]

ipyparallel/nbextension/static/clusterlist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ define(["base/js/namespace", "jquery", "base/js/utils"], function (
4949
success: $.proxy(this.load_list_success, this),
5050
error: utils.log_ajax_error,
5151
};
52-
var url = utils.url_join_encode(this.base_url, "clusters");
52+
var url = utils.url_join_encode(this.base_url, "ipyparallel/clusters");
5353
ajax(url, settings);
5454
};
5555

@@ -150,7 +150,7 @@ define(["base/js/namespace", "jquery", "base/js/utils"], function (
150150
status_col.text("starting");
151151
var url = utils.url_join_encode(
152152
that.base_url,
153-
"clusters",
153+
"ipyparallel/clusters",
154154
that.cluster_key
155155
);
156156
ajax(url, settings);
@@ -214,7 +214,7 @@ define(["base/js/namespace", "jquery", "base/js/utils"], function (
214214
status_col.text("stopping");
215215
var url = utils.url_join_encode(
216216
that.base_url,
217-
"clusters",
217+
"ipyparallel/clusters",
218218
that.cluster_key
219219
);
220220
ajax(url, settings);

lab/src/clusters.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const DRAG_THRESHOLD = 5;
5050
*/
5151
const JUPYTER_CELL_MIME = "application/vnd.jupyter.cells";
5252

53+
const CLUSTER_PREFIX = "ipyparallel/clusters";
5354
/**
5455
* A widget for IPython cluster management.
5556
*/
@@ -432,7 +433,7 @@ export class ClusterManager extends Widget {
432433
this._isReady = false;
433434
this._registry.notifyCommandChanged(this._launchClusterId);
434435
const response = await ServerConnection.makeRequest(
435-
`${this._serverSettings.baseUrl}clusters/${this._launchClusterId}`,
436+
`${this._serverSettings.baseUrl}${CLUSTER_PREFIX}/${this._launchClusterId}`,
436437
{ method: "POST" },
437438
this._serverSettings
438439
);
@@ -455,7 +456,7 @@ export class ClusterManager extends Widget {
455456
*/
456457
private async _updateClusterList(): Promise<void> {
457458
const response = await ServerConnection.makeRequest(
458-
`${this._serverSettings.baseUrl}clusters`,
459+
`${this._serverSettings.baseUrl}${CLUSTER_PREFIX}`,
459460
{},
460461
this._serverSettings
461462
);
@@ -490,7 +491,7 @@ export class ClusterManager extends Widget {
490491
*/
491492
private async _stopById(id: string): Promise<void> {
492493
const response = await ServerConnection.makeRequest(
493-
`${this._serverSettings.baseUrl}clusters/${id}`,
494+
`${this._serverSettings.baseUrl}${CLUSTER_PREFIX}/${id}`,
494495
{ method: "DELETE" },
495496
this._serverSettings
496497
);
@@ -517,7 +518,7 @@ export class ClusterManager extends Widget {
517518
}
518519

519520
const response = await ServerConnection.makeRequest(
520-
`${this._serverSettings.baseUrl}clusters/${id}`,
521+
`${this._serverSettings.baseUrl}${CLUSTER_PREFIX}/${id}`,
521522
{
522523
method: "PATCH",
523524
body: JSON.stringify(update),

0 commit comments

Comments
 (0)