mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Machine Learning Model Registry - Iteration1 (#9105)
* Machine learning services extension - model registration wizard
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as azdata from 'azdata';
|
||||
import { ApiWrapper } from '../common/apiWrapper';
|
||||
import { IPageView } from './interfaces';
|
||||
|
||||
/**
|
||||
* Base class for dialog and wizard
|
||||
*/
|
||||
export class MainViewBase {
|
||||
|
||||
protected _pages: IPageView[] = [];
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
constructor(protected _apiWrapper: ApiWrapper) {
|
||||
}
|
||||
|
||||
protected registerContent(viewPanel: azdata.window.DialogTab | azdata.window.WizardPage, componentView: IPageView) {
|
||||
viewPanel.registerContent(async view => {
|
||||
if (componentView) {
|
||||
let component = componentView.registerComponent(view.modelBuilder);
|
||||
await view.initializeModel(component);
|
||||
await componentView.refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected addPage(page: IPageView, index?: number): void {
|
||||
if (index) {
|
||||
this._pages[index] = page;
|
||||
} else {
|
||||
this._pages.push(page);
|
||||
}
|
||||
}
|
||||
|
||||
public async refresh(): Promise<void> {
|
||||
if (this._pages) {
|
||||
await Promise.all(this._pages.map(p => p.refresh()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user