fix for 3262 (#3263)

This commit is contained in:
Alan Ren
2018-11-16 21:19:32 -08:00
committed by GitHub
parent bbb27aed10
commit da5194bdcb
2 changed files with 15 additions and 3 deletions

View File

@@ -14,8 +14,8 @@ const localize = nls.loadMessageBundle();
export class CreateSessionDialog {
// Top level
private readonly CancelButtonText: string = localize('createSessionDialog.cancel', 'Cancel');
private readonly CreateButtonText: string = localize('createSessionDialog.create', 'Create');
private readonly DialogTitleText: string = localize('createSessionDialog.title', 'Create New Profiler Session');
private readonly CreateButtonText: string = localize('createSessionDialog.create', 'Start');
private readonly DialogTitleText: string = localize('createSessionDialog.title', 'Start New Profiler Session');
// UI Components
private dialog: sqlops.window.modelviewdialog.Dialog;
@@ -68,6 +68,10 @@ export class CreateSessionDialog {
value: ''
}).component();
this.templatesBox.onValueChanged(() => {
this.updateSessionName();
});
let formModel = view.modelBuilder.formContainer()
.withFormItems([{
components: [{
@@ -86,6 +90,7 @@ export class CreateSessionDialog {
if (this.model.templates) {
this.templatesBox.values = this.model.getTemplateNames();
this.updateSessionName();
}
this.sessionNameBox.onTextChanged(() => {
@@ -99,6 +104,12 @@ export class CreateSessionDialog {
});
}
private updateSessionName() {
if (this.templatesBox.value) {
this.sessionNameBox.value = `ADS_${this.templatesBox.value.toString()}`
}
}
private async execute(): Promise<void> {
let profilerService = sqlops.dataprotocol.getProvider<sqlops.ProfilerProvider>(this._providerType, sqlops.DataProviderType.ProfilerProvider);