diff --git a/src/app/plugins/notebooks/components/edit-notebook/edit-notebook.component.html b/src/app/plugins/notebooks/components/edit-notebook/edit-notebook.component.html index 96d59fd6..d3c87ffc 100644 --- a/src/app/plugins/notebooks/components/edit-notebook/edit-notebook.component.html +++ b/src/app/plugins/notebooks/components/edit-notebook/edit-notebook.component.html @@ -1,4 +1,4 @@ - + @@ -162,7 +162,7 @@ -
+

{{name}}

diff --git a/src/app/plugins/notebooks/components/edit-notebook/edit-notebook.component.ts b/src/app/plugins/notebooks/components/edit-notebook/edit-notebook.component.ts index 4443a62e..4254c4f9 100644 --- a/src/app/plugins/notebooks/components/edit-notebook/edit-notebook.component.ts +++ b/src/app/plugins/notebooks/components/edit-notebook/edit-notebook.component.ts @@ -29,6 +29,7 @@ import {delay, mergeMap, take, tap} from 'rxjs/operators'; import {LoadingScreenService} from '../../../../components/loading-screen/loading-screen.service'; import {FormControl, FormGroup, Validators} from '@angular/forms'; import {ToasterService} from '../../../../components/toast-exposer/toaster.service'; +import {WebuiSettingsService} from "../../../../services/webui-settings.service"; @Component({ selector: 'app-edit-notebook', @@ -39,11 +40,14 @@ export class EditNotebookComponent implements OnInit, OnChanges, OnDestroy { private readonly _notebooks = inject(NotebooksService); public readonly _sidebar = inject(NotebooksSidebarService); private readonly _content = inject(NotebooksContentService); + private readonly _toast = inject(ToasterService); private readonly _router = inject(Router); private readonly _route = inject(ActivatedRoute); private readonly _loading = inject(LoadingScreenService); + private readonly _settings = inject(WebuiSettingsService); + @Input() sessionId: string; @Output() openChangeSessionModal = new EventEmitter<{ name: string, path: string }>(); path: string; @@ -91,22 +95,24 @@ export class EditNotebookComponent implements OnInit, OnChanges, OnDestroy { ngOnChanges(changes: SimpleChanges): void { if (changes.sessionId) { // Handle changes to sessionId - this._notebooks.getSession(this.sessionId).subscribe(session => { - this.session = session; - this.path = this._notebooks.getPathFromSession(session); - this.name = this._notebooks.getNameFromSession(session); - const urlPath = 'notebooks/' + this._route.snapshot.url.map(segment => decodeURIComponent(segment.toString())).join('/'); - if (this.path !== urlPath) { - this.closeEdit(true); - return; - } - if (!this.renameNotebookModal.isShown) { - this.renameNotebookForm.patchValue({name: this.name}); + this._notebooks.getSession(this.sessionId).subscribe({ + next: session => { + this.session = session; + this.path = this._notebooks.getPathFromSession(session); + this.name = this._notebooks.getNameFromSession(session); + const urlPath = 'notebooks/' + this._route.snapshot.url.map(segment => decodeURIComponent(segment.toString())).join('/'); + if (this.path !== urlPath) { + this.closeEdit(true); + return; + } + if (!this.renameNotebookModal.isShown) { + this.renameNotebookForm.patchValue({name: this.name}); + } + this._content.setPreferredSessionId(this.path, this.sessionId); + this.loadNotebook(); + }, error: () => { + this.closeEdit(); } - this._content.setPreferredSessionId(this.path, this.sessionId); - this.loadNotebook(); - }, () => { - this.closeEdit(); }); } } @@ -165,9 +171,10 @@ export class EditNotebookComponent implements OnInit, OnChanges, OnDestroy { this.nb = null; } this._content.getNotebookContent(this.path, this.nb == null).subscribe(res => { + if (res) { this.nb = new NotebookWrapper(res, this.busyCellIds, - new NotebooksWebSocket(this.session.kernel.id), + new NotebooksWebSocket(this.session.kernel.id, this._settings), id => this.getCellComponent(id)?.renderMd(), (id, output) => this.getCellComponent(id)?.renderError(output), (id, output) => this.getCellComponent(id)?.renderStream(output), diff --git a/src/app/plugins/notebooks/components/notebooks-dashboard/notebooks-dashboard.component.html b/src/app/plugins/notebooks/components/notebooks-dashboard/notebooks-dashboard.component.html index b43d3f93..31518b2b 100644 --- a/src/app/plugins/notebooks/components/notebooks-dashboard/notebooks-dashboard.component.html +++ b/src/app/plugins/notebooks/components/notebooks-dashboard/notebooks-dashboard.component.html @@ -1,90 +1,92 @@ -

Notebooks

-
- -
- - - Jupyter Server - - -
{{serverStatus ? 'Online' : 'Offline'}}
- -

Started: {{serverStatus.started | date: 'yyyy-MM-dd HH:mm:SS'}}

-

Last Activity: {{serverStatus.last_activity | date: 'yyyy-MM-dd HH:mm:SS'}}

-
-
- - - - - - -
-
-
- - - Kernels - - -
No Kernel Running
- -
Running Kernels ({{sessions.length}})
- - - - - - - - - - - - - - - - - - - - - - - - -
NotebookKernelLast ActivityStatusConnections
{{notebookPaths[i]}}{{session.kernel.name}}{{session.kernel.last_activity | date: 'yyyy-MM-dd HH:mm:SS'}}{{session.kernel.execution_state}}{{session.kernel.connections}}
-
-
- - -
- - -
-
-
-
-
+ + + +
+
+ + + Kernels + + +
No Kernel Running
+ +
Running Kernels ({{ sessions.length }})
+ + + + + + + + + + + + + + + + + + + + + + + + +
NotebookKernelLast ActivityStatusConnections
{{ notebookPaths[i] }}{{ session.kernel.name }}{{ session.kernel.last_activity | date: 'yyyy-MM-dd HH:mm:SS' }}{{ session.kernel.execution_state }}{{ session.kernel.connections }}
+
+
+ + +
+ + +
+
+
+
+ +

The Jupyter Plugin is not loaded. Refresh the page to try again.

@@ -112,11 +114,13 @@

Shut Down All Kernels

-