mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Agent - dialog finishes (#1910)
* fixed crashes from job dialog and new step dialog group options UI * added placeholder for retry counters * fixed alert general UI * fixed misc dialog errors * localized all strings
This commit is contained in:
@@ -10,6 +10,8 @@ import * as sqlops from 'sqlops';
|
|||||||
import { AgentDialog } from './agentDialog';
|
import { AgentDialog } from './agentDialog';
|
||||||
import { AgentUtils } from '../agentUtils';
|
import { AgentUtils } from '../agentUtils';
|
||||||
import { AlertData } from '../data/alertData';
|
import { AlertData } from '../data/alertData';
|
||||||
|
import { OperatorDialog } from './operatorDialog';
|
||||||
|
import { JobDialog } from './jobDialog';
|
||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
@@ -21,6 +23,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
private static readonly GeneralTabText: string = localize('alertDialog.General', 'General');
|
private static readonly GeneralTabText: string = localize('alertDialog.General', 'General');
|
||||||
private static readonly ResponseTabText: string = localize('alertDialog.Response', 'Response');
|
private static readonly ResponseTabText: string = localize('alertDialog.Response', 'Response');
|
||||||
private static readonly OptionsTabText: string = localize('alertDialog.Options', 'Options');
|
private static readonly OptionsTabText: string = localize('alertDialog.Options', 'Options');
|
||||||
|
private static readonly EventAlertText: string = localize('alertDialog.eventAlert', 'Event alert definition');
|
||||||
|
|
||||||
// General tab strings
|
// General tab strings
|
||||||
private static readonly NameLabel: string = localize('alertDialog.Name', 'Name');
|
private static readonly NameLabel: string = localize('alertDialog.Name', 'Name');
|
||||||
@@ -111,89 +114,26 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
private static readonly DelayMinutesTextBoxLabel: string = localize('alertDialog.DelayMinutes', 'Delay Minutes');
|
private static readonly DelayMinutesTextBoxLabel: string = localize('alertDialog.DelayMinutes', 'Delay Minutes');
|
||||||
private static readonly DelaySecondsTextBoxLabel: string = localize('alertDialog.DelaySeconds', 'Delay Seconds');
|
private static readonly DelaySecondsTextBoxLabel: string = localize('alertDialog.DelaySeconds', 'Delay Seconds');
|
||||||
|
|
||||||
// Object dropdown strings
|
|
||||||
private static readonly AccessMethodsLabel: string = localize('alertDialog.AccessMethods', 'Access Methods');
|
|
||||||
private static readonly AdvancedAnalyticsLabel: string = localize('alertDialog.AdvancedAnalyticsLabel', 'Advanced Analytics');
|
|
||||||
private static readonly AvailabilityReplicaLabel: string = localize('alertDialog.AvailabilityReplica', 'Availability Replica');
|
|
||||||
private static readonly BatchRespStatisticsLabel: string = localize('alertDialog.BatchRespStatistics', 'Batch Resp Statistics');
|
|
||||||
private static readonly BrokerActivationLabel: string = localize('alertDialog.BrokerActivation', 'Broker Activation');
|
|
||||||
private static readonly BrokerStatisticsLabel: string = localize('alertDialog.BrokerStatistics', 'Broker Statistics');
|
|
||||||
private static readonly BrokerTOStatisticsLabel: string = localize('alertDialog.BrokerTOStatistics', 'Broker TO Statistics');
|
|
||||||
private static readonly BrokerDBMTransportLabel: string = localize('alertDialog.BrokerDBMTransport', 'Broker/DBM Transport');
|
|
||||||
private static readonly BufferManagerLabel: string = localize('alertDialog.BufferManager', 'Buffer Manager');
|
|
||||||
private static readonly BufferNodeLabel: string = localize('alertDialog.BufferNode', 'Buffer Node');
|
|
||||||
private static readonly CatalogMetadataLabel: string = localize('alertDialog.CatalogMetadata', 'Catalog Metadata');
|
|
||||||
private static readonly CLRLabel: string = localize('alertDialog.CLR', 'CLR');
|
|
||||||
private static readonly ColumnstoreLabel: string = localize('alertDialog.Columnstore', 'Columnstore');
|
|
||||||
private static readonly CursorManagerLabel: string = localize('alertDialog.CursorManagerLabel', 'Cursor Manager by Type');
|
|
||||||
private static readonly CursorManagerTotalLabel: string = localize('alertDialog.CursorManagerTotalLabel', 'Cursor Manager Total');
|
|
||||||
private static readonly DatabaseReplicaLabel: string = localize('alertDialog.DatabaseReplica', 'Database Replica');
|
|
||||||
private static readonly DatabasesLabel: string = localize('alertDialog.DatabasesLabel', 'Databases');
|
|
||||||
private static readonly DeprecatedFeaturesLabel: string = localize('alertDialog.DeprecatedFeatures', 'Deprecated Features');
|
|
||||||
private static readonly ExecStatisticsLabel: string = localize('alertDialog.ExecStatistics', 'Exec Statistics');
|
|
||||||
private static readonly ExternalScriptsLabel: string = localize('alertDialog.ExternalScripts', 'External Scripts');
|
|
||||||
private static readonly FileTableLabel: string = localize('alertDialog.FileTable', 'File Table');
|
|
||||||
private static readonly GeneralStatisticsLabel: string = localize('alertDialog.GeneralStatistics', 'General Statistics');
|
|
||||||
private static readonly HTTPStorageLabel: string = localize('alertDialog.HTTPStorage', 'HTTP Storage');
|
|
||||||
private static readonly LatchesLabel: string = localize('alertDialog.Latches', 'Latches');
|
|
||||||
private static readonly LocksLabel: string = localize('alertDialog.Locks', 'Locks');
|
|
||||||
private static readonly LogPoolFreePoolLabel: string = localize('alertDialog.LogPoolFreePool', 'LogPool FreePool');
|
|
||||||
private static readonly MemoryBrokerClerksLabel: string = localize('alertDialog.MemoryBrokerClerks', 'Memory Broker Clerks');
|
|
||||||
private static readonly MemoryManagerLabel: string = localize('alertDialog.MemoryManager', 'Memory Manager');
|
|
||||||
private static readonly MemoryNodeLabel: string = localize('alertDialog.MemoryNode', 'Memory Node');
|
|
||||||
private static readonly PlanCacheLabel: string = localize('alertDialog.PlanCache', 'Plan Cache');
|
|
||||||
private static readonly QueryStoreLabel: string = localize('alertDialog.QueryStore', 'Query Store');
|
|
||||||
private static readonly ResourcePoolStatsLabel: string = localize('alertDialog.ResourcePoolStats', 'Resource Pool Stats');
|
|
||||||
private static readonly SQLErrorsLabel: string = localize('alertDialog.SQLErrors', 'SQL Errors');
|
|
||||||
private static readonly SQLServer2017XTPCursorsLabel: string = localize('alertDialog.SQLServer2017XTPCursors', 'SQL Server 2017 XTP Cursors');
|
|
||||||
private static readonly SQLServer2017XTPGarbageCollectionLabel: string = localize('alertDialog.SQLServer2017XTPGarbageCollection', 'SQL Server 2017 XTP Garbage Collection');
|
|
||||||
private static readonly SQLServer2017XTPIOGovernerLabel: string = localize('alertDialog.SQLServer2017XTPIOGoverner', 'SQL Server 2017 XTP IO Governer');
|
|
||||||
private static readonly SQLServer2017XTPPhantomProcessorLabel: string = localize('alertDialog.SQLServer2017XTPPhantomProcessor', 'SQL Server 2017 XTP Phantom Processor');
|
|
||||||
private static readonly SQLServer2017XTPStorageLabel: string = localize('alertDialog.SQLServer2017XTPStorage', 'SQL Server 2017 XTP Storage');
|
|
||||||
private static readonly SQLServer2017XTPTransactionLogLabel: string = localize('alertDialog.SQLServer2017XTPTransactionLog', 'SQL Server 2017 XTP Transaction Log');
|
|
||||||
private static readonly SQLServer2017XTPTransactionsLabel: string = localize('alertDialog.SQLServer2017XTPTransactions', 'SQL Server 2017 XTP Transactions');
|
|
||||||
private static readonly TransactionsLabel: string = localize('alertDialog.Transactions', 'Transactions');
|
|
||||||
private static readonly UserSettableLabel: string = localize('alertDialog.UserSettable', 'User Settable');
|
|
||||||
private static readonly WaitStatisticsLabel: string = localize('alertDialog.WaitStatistics', 'Wait Statistics');
|
|
||||||
private static readonly WorkloadGroupStats: string = localize('alertDialog.WorkloadGroupStats', 'Workload Group Stats');
|
|
||||||
private static readonly ObjectDropdownOptions: string[] = [AlertDialog.AccessMethodsLabel, AlertDialog.AdvancedAnalyticsLabel, AlertDialog.AvailabilityReplicaLabel,
|
|
||||||
AlertDialog.BatchRespStatisticsLabel, AlertDialog.BrokerActivationLabel, AlertDialog.BrokerStatisticsLabel, AlertDialog.BrokerTOStatisticsLabel, AlertDialog.BrokerDBMTransportLabel,
|
|
||||||
AlertDialog.BufferManagerLabel, AlertDialog.BufferNodeLabel, AlertDialog.CatalogMetadataLabel, AlertDialog.CLRLabel, AlertDialog.ColumnstoreLabel,
|
|
||||||
AlertDialog.CursorManagerLabel, AlertDialog.CursorManagerTotalLabel, AlertDialog.DatabaseReplicaLabel, AlertDialog.DatabasesLabel, AlertDialog.DeprecatedFeaturesLabel,
|
|
||||||
AlertDialog.ExecStatisticsLabel, AlertDialog.ExternalScriptsLabel, AlertDialog.FileTableLabel, AlertDialog.GeneralStatisticsLabel, AlertDialog.HTTPStorageLabel,
|
|
||||||
AlertDialog.LatchesLabel, AlertDialog.LocksLabel, AlertDialog.LogPoolFreePoolLabel, AlertDialog.MemoryBrokerClerksLabel, AlertDialog.MemoryManagerLabel,
|
|
||||||
AlertDialog.MemoryNodeLabel, AlertDialog.PlanCacheLabel, AlertDialog.QueryStoreLabel, AlertDialog.ResourcePoolStatsLabel, AlertDialog.SQLErrorsLabel,
|
|
||||||
AlertDialog.SQLServer2017XTPCursorsLabel, AlertDialog.SQLServer2017XTPGarbageCollectionLabel, AlertDialog.SQLServer2017XTPIOGovernerLabel,
|
|
||||||
AlertDialog.SQLServer2017XTPPhantomProcessorLabel, AlertDialog.SQLServer2017XTPStorageLabel, AlertDialog.SQLServer2017XTPTransactionLogLabel,
|
|
||||||
AlertDialog.SQLServer2017XTPTransactionsLabel, AlertDialog.TransactionsLabel, AlertDialog.UserSettableLabel, AlertDialog.WaitStatisticsLabel,
|
|
||||||
AlertDialog.WorkloadGroupStats];
|
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
private responseTab: sqlops.window.modelviewdialog.DialogTab;
|
private responseTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
private optionsTab: sqlops.window.modelviewdialog.DialogTab;
|
private optionsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
|
||||||
// Form Models
|
|
||||||
private eventAlertFormModel: sqlops.FormContainer;
|
|
||||||
private performanceConditionAlertFormModel: sqlops.FormContainer;
|
|
||||||
private wmiEventFormModel: sqlops.FormContainer;
|
|
||||||
|
|
||||||
// General tab controls
|
// General tab controls
|
||||||
private nameTextBox: sqlops.InputBoxComponent;
|
private nameTextBox: sqlops.InputBoxComponent;
|
||||||
private typeDropDown: sqlops.DropDownComponent;
|
private typeDropDown: sqlops.DropDownComponent;
|
||||||
private severityDropDown: sqlops.DropDownComponent;
|
private severityDropDown: sqlops.DropDownComponent;
|
||||||
private errorNumberTextBox: sqlops.InputBoxComponent;
|
|
||||||
private databaseDropDown: sqlops.DropDownComponent;
|
private databaseDropDown: sqlops.DropDownComponent;
|
||||||
private enabledCheckBox: sqlops.CheckBoxComponent;
|
private enabledCheckBox: sqlops.CheckBoxComponent;
|
||||||
|
private errorNumberRadioButton: sqlops.RadioButtonComponent;
|
||||||
|
private severityRadioButton: sqlops.RadioButtonComponent;
|
||||||
|
private errorNumberTextBox: sqlops.InputBoxComponent;
|
||||||
|
|
||||||
private raiseAlertMessageCheckBox: sqlops.CheckBoxComponent;
|
private raiseAlertMessageCheckBox: sqlops.CheckBoxComponent;
|
||||||
private raiseAlertMessageTextBox: sqlops.InputBoxComponent;
|
private raiseAlertMessageTextBox: sqlops.InputBoxComponent;
|
||||||
private severityRadioButton: sqlops.RadioButtonComponent;
|
|
||||||
private errorNumberRadioButton: sqlops.RadioButtonComponent;
|
|
||||||
private objectDropDown: sqlops.DropDownComponent;
|
|
||||||
|
|
||||||
// Response tab controls
|
// Response tab controls
|
||||||
private executeJobDropdown: sqlops.DropDownComponent;
|
private executeJobTextBox: sqlops.InputBoxComponent;
|
||||||
private executeJobCheckBox: sqlops.CheckBoxComponent;
|
private executeJobCheckBox: sqlops.CheckBoxComponent;
|
||||||
private newJobButton: sqlops.ButtonComponent;
|
private newJobButton: sqlops.ButtonComponent;
|
||||||
private notifyOperatorsCheckBox: sqlops.CheckBoxComponent;
|
private notifyOperatorsCheckBox: sqlops.CheckBoxComponent;
|
||||||
@@ -244,7 +184,6 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
dialog.okButton.enabled = false;
|
dialog.okButton.enabled = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.enabledCheckBox = view.modelBuilder.checkBox()
|
this.enabledCheckBox = view.modelBuilder.checkBox()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: AlertDialog.EnabledCheckboxLabel
|
label: AlertDialog.EnabledCheckboxLabel
|
||||||
@@ -252,123 +191,116 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
|
|
||||||
this.enabledCheckBox.checked = true;
|
this.enabledCheckBox.checked = true;
|
||||||
|
|
||||||
|
this.databaseDropDown = view.modelBuilder.dropDown()
|
||||||
|
.withProperties({
|
||||||
|
value: databases[0],
|
||||||
|
values: databases,
|
||||||
|
width: '100%'
|
||||||
|
}).component();
|
||||||
|
|
||||||
this.typeDropDown = view.modelBuilder.dropDown()
|
this.typeDropDown = view.modelBuilder.dropDown()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
value: '',
|
value: '',
|
||||||
values: AlertDialog.AlertTypes
|
values: AlertDialog.AlertTypes,
|
||||||
}).component();
|
width: '100%'
|
||||||
|
}).component();
|
||||||
|
|
||||||
this.initializeSqlServerEventAlert(view, databases);
|
this.severityRadioButton = view.modelBuilder.radioButton()
|
||||||
});
|
.withProperties({
|
||||||
}
|
value: 'serverity',
|
||||||
|
name: 'alertTypeOptions',
|
||||||
|
label: AlertDialog.SeverityLabel,
|
||||||
|
checked: true
|
||||||
|
}).component();
|
||||||
|
this.severityRadioButton.checked = true;
|
||||||
|
|
||||||
private async initializeSqlServerPerformanceConditionAlert(view: sqlops.ModelView) {
|
this.severityDropDown = view.modelBuilder.dropDown()
|
||||||
this.objectDropDown = view.modelBuilder.dropDown()
|
.withProperties({
|
||||||
.withProperties({
|
value: AlertDialog.AlertSeverities[0],
|
||||||
value: '',
|
values: AlertDialog.AlertSeverities,
|
||||||
values: AlertDialog.ObjectDropdownOptions
|
width: '100%'
|
||||||
}).component();
|
}).component();
|
||||||
this.performanceConditionAlertFormModel = view.modelBuilder.formContainer()
|
|
||||||
.withFormItems([{
|
|
||||||
component: this.nameTextBox,
|
|
||||||
title: AlertDialog.NameLabel
|
|
||||||
}, {
|
|
||||||
component: this.typeDropDown,
|
|
||||||
title: AlertDialog.TypeLabel
|
|
||||||
}, {
|
|
||||||
component: this.objectDropDown,
|
|
||||||
title: 'Object'
|
|
||||||
}]).component();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async initializeSqlServerEventAlert(view: sqlops.ModelView, databases: string[]) {
|
this.errorNumberRadioButton = view.modelBuilder.radioButton()
|
||||||
this.databaseDropDown = view.modelBuilder.dropDown()
|
.withProperties({
|
||||||
.withProperties({
|
value: 'errorNumber',
|
||||||
value: databases[0],
|
name: 'alertTypeOptions',
|
||||||
values: databases
|
label: AlertDialog.ErrorNumberLabel
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.severityDropDown = view.modelBuilder.dropDown()
|
this.errorNumberTextBox = view.modelBuilder.inputBox()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
value: AlertDialog.AlertSeverities[0],
|
width: '100%'
|
||||||
values: AlertDialog.AlertSeverities,
|
})
|
||||||
width: 320
|
.component();
|
||||||
}).component();
|
|
||||||
|
|
||||||
let severityFormContainer = view.modelBuilder.formContainer()
|
|
||||||
.withFormItems([{
|
|
||||||
component: this.severityDropDown,
|
|
||||||
title: ''
|
|
||||||
}]).component();
|
|
||||||
|
|
||||||
this.severityRadioButton = view.modelBuilder.radioButton()
|
|
||||||
.withProperties({
|
|
||||||
value: 'Severity',
|
|
||||||
name: 'radioButtonOptions',
|
|
||||||
label: AlertDialog.SeverityLabel
|
|
||||||
}).component();
|
|
||||||
|
|
||||||
this.severityRadioButton.checked = true;
|
|
||||||
this.severityDropDown.enabled = true;
|
|
||||||
|
|
||||||
this.severityRadioButton.onDidClick(() => {
|
|
||||||
this.errorNumberTextBox.enabled = false;
|
this.errorNumberTextBox.enabled = false;
|
||||||
this.errorNumberRadioButton.checked = false;
|
|
||||||
this.severityDropDown.enabled = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.errorNumberTextBox = view.modelBuilder.inputBox()
|
this.errorNumberRadioButton.onDidClick(() => {
|
||||||
.withProperties({
|
this.errorNumberTextBox.enabled = true;
|
||||||
inputType: 'text',
|
this.severityDropDown.enabled = false;
|
||||||
placeHolder: '1',
|
});
|
||||||
width: 320
|
|
||||||
}).component();
|
|
||||||
|
|
||||||
let errorNumberFormContainer = view.modelBuilder.formContainer()
|
this.severityRadioButton.onDidClick(() => {
|
||||||
.withFormItems([{
|
this.errorNumberTextBox.enabled = false;
|
||||||
component: this.errorNumberTextBox,
|
this.severityDropDown.enabled = true;
|
||||||
title: ''
|
});
|
||||||
}]).component();
|
|
||||||
|
|
||||||
this.errorNumberRadioButton = view.modelBuilder.radioButton()
|
this.raiseAlertMessageCheckBox = view.modelBuilder.checkBox()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
value: 'Error Number',
|
label: AlertDialog.RaiseIfMessageContainsLabel
|
||||||
name: 'radioButtonOptions',
|
}).component();
|
||||||
label: AlertDialog.ErrorNumberLabel
|
|
||||||
}).component();
|
|
||||||
|
|
||||||
this.errorNumberRadioButton.checked = false;
|
this.raiseAlertMessageTextBox = view.modelBuilder.inputBox().component();
|
||||||
|
this.raiseAlertMessageTextBox.enabled = false;
|
||||||
|
|
||||||
this.errorNumberRadioButton.onDidClick(() => {
|
this.raiseAlertMessageCheckBox.onChanged(() => {
|
||||||
this.severityRadioButton.checked = false;
|
this.raiseAlertMessageTextBox.enabled = this.raiseAlertMessageCheckBox.checked;
|
||||||
this.errorNumberTextBox.enabled = true;
|
});
|
||||||
this.severityDropDown.enabled = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.raiseAlertMessageCheckBox = view.modelBuilder.checkBox()
|
let formModel = view.modelBuilder.formContainer()
|
||||||
.withProperties({
|
.withFormItems([{
|
||||||
label: AlertDialog.RaiseIfMessageContainsLabel
|
component: this.nameTextBox,
|
||||||
}).component();
|
title: AlertDialog.NameLabel
|
||||||
|
}, {
|
||||||
|
component: this.enabledCheckBox,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: this.typeDropDown,
|
||||||
|
title: AlertDialog.TypeLabel
|
||||||
|
}, {
|
||||||
|
components: [{
|
||||||
|
component: this.databaseDropDown,
|
||||||
|
title: AlertDialog.DatabaseLabel
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: this.severityRadioButton,
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: this.severityDropDown,
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: this.errorNumberRadioButton,
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: this.errorNumberTextBox,
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: this.raiseAlertMessageCheckBox,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: this.raiseAlertMessageTextBox,
|
||||||
|
title: AlertDialog.MessageTextLabel
|
||||||
|
}],
|
||||||
|
title: AlertDialog.EventAlertText
|
||||||
|
}
|
||||||
|
]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
this.raiseAlertMessageTextBox = view.modelBuilder.inputBox()
|
await view.initializeModel(formModel);
|
||||||
.withProperties({
|
|
||||||
width: 320
|
|
||||||
})
|
|
||||||
.component();
|
|
||||||
this.raiseAlertMessageTextBox.enabled = false;
|
|
||||||
let raiseAlertMessageContainer = view.modelBuilder.formContainer()
|
|
||||||
.withFormItems([{
|
|
||||||
component: this.raiseAlertMessageTextBox,
|
|
||||||
title: AlertDialog.MessageTextLabel
|
|
||||||
}])
|
|
||||||
.component();
|
|
||||||
|
|
||||||
this.raiseAlertMessageCheckBox.onChanged(() => {
|
|
||||||
if (this.raiseAlertMessageCheckBox.checked) {
|
|
||||||
this.raiseAlertMessageTextBox.enabled = true;
|
|
||||||
} else {
|
|
||||||
this.raiseAlertMessageTextBox.enabled = false;
|
|
||||||
}
|
|
||||||
// initialize control values
|
// initialize control values
|
||||||
this.nameTextBox.value = this.model.name;
|
this.nameTextBox.value = this.model.name;
|
||||||
this.raiseAlertMessageTextBox.value = this.model.eventDescriptionKeyword;
|
this.raiseAlertMessageTextBox.value = this.model.eventDescriptionKeyword;
|
||||||
@@ -392,40 +324,6 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let flexRadioButtonContainer = view.modelBuilder.flexContainer()
|
|
||||||
.withLayout({
|
|
||||||
flexFlow: 'column'
|
|
||||||
}).withItems([this.errorNumberRadioButton, errorNumberFormContainer,
|
|
||||||
this.severityRadioButton, severityFormContainer, this.raiseAlertMessageCheckBox,
|
|
||||||
raiseAlertMessageContainer])
|
|
||||||
.component();
|
|
||||||
|
|
||||||
this.eventAlertFormModel = view.modelBuilder.formContainer()
|
|
||||||
.withFormItems([{
|
|
||||||
component: this.nameTextBox,
|
|
||||||
title: AlertDialog.NameLabel
|
|
||||||
}, {
|
|
||||||
component: this.enabledCheckBox,
|
|
||||||
title: ''
|
|
||||||
}, {
|
|
||||||
component: this.typeDropDown,
|
|
||||||
title: AlertDialog.TypeLabel
|
|
||||||
}, {
|
|
||||||
component: this.databaseDropDown,
|
|
||||||
title: AlertDialog.DatabaseLabel
|
|
||||||
}, {
|
|
||||||
component: flexRadioButtonContainer,
|
|
||||||
title: ''
|
|
||||||
}
|
|
||||||
]).withLayout({ width: '100%' }).component();
|
|
||||||
|
|
||||||
let flexModel = view.modelBuilder.flexContainer()
|
|
||||||
.withItems([this.eventAlertFormModel]).component();
|
|
||||||
|
|
||||||
await view.initializeModel(flexModel);
|
|
||||||
|
|
||||||
this.nameTextBox.value = this.model.name;
|
|
||||||
this.enabledCheckBox.checked = this.model.isEnabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private initializeResponseTab() {
|
private initializeResponseTab() {
|
||||||
@@ -435,40 +333,39 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
label: AlertDialog.ExecuteJobCheckBoxLabel
|
label: AlertDialog.ExecuteJobCheckBoxLabel
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.executeJobDropdown = view.modelBuilder.dropDown()
|
this.executeJobTextBox = view.modelBuilder.inputBox()
|
||||||
.withProperties({
|
.withProperties({ width: 375 })
|
||||||
value: this.jobs[0],
|
.component();
|
||||||
values: this.jobs,
|
this.executeJobTextBox.enabled = false;
|
||||||
width: 380
|
|
||||||
}).component();
|
|
||||||
|
|
||||||
this.executeJobDropdown.editable = true;
|
|
||||||
this.executeJobDropdown.enabled = false;
|
|
||||||
this.newJobButton = view.modelBuilder.button().withProperties({
|
this.newJobButton = view.modelBuilder.button().withProperties({
|
||||||
label: AlertDialog.NewJobButtonLabel,
|
label: AlertDialog.NewJobButtonLabel,
|
||||||
width: 80
|
width: 80
|
||||||
}).component();
|
}).component();
|
||||||
this.newJobButton.enabled = false;
|
this.newJobButton.enabled = false;
|
||||||
|
this.newJobButton.onDidClick(() => {
|
||||||
let executeJobContainer = view.modelBuilder.formContainer()
|
let jobDialog = new JobDialog(this.ownerUri);
|
||||||
.withFormItems([{
|
jobDialog.openDialog();
|
||||||
component: this.executeJobDropdown,
|
});
|
||||||
title: AlertDialog.ExecuteJobTextBoxLabel
|
|
||||||
},{ component: this.newJobButton,
|
|
||||||
title: ''
|
|
||||||
}])
|
|
||||||
.component();
|
|
||||||
|
|
||||||
this.executeJobCheckBox.onChanged(() => {
|
this.executeJobCheckBox.onChanged(() => {
|
||||||
if (this.executeJobCheckBox.checked) {
|
if (this.executeJobCheckBox.checked) {
|
||||||
this.executeJobDropdown.enabled = true;
|
this.executeJobTextBox.enabled = true;
|
||||||
this.newJobButton.enabled = true;
|
this.newJobButton.enabled = true;
|
||||||
} else {
|
} else {
|
||||||
this.executeJobDropdown.enabled = false;
|
this.executeJobTextBox.enabled = false;
|
||||||
this.newJobButton.enabled = false;
|
this.newJobButton.enabled = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let executeJobContainer = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.executeJobTextBox,
|
||||||
|
title: AlertDialog.ExecuteJobTextBoxLabel
|
||||||
|
}, {
|
||||||
|
component: this.newJobButton,
|
||||||
|
title: AlertDialog.NewJobButtonLabel
|
||||||
|
}], { componentWidth: '100%'}).component();
|
||||||
|
|
||||||
this.notifyOperatorsCheckBox = view.modelBuilder.checkBox()
|
this.notifyOperatorsCheckBox = view.modelBuilder.checkBox()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: AlertDialog.NotifyOperatorsTextBoxLabel
|
label: AlertDialog.NotifyOperatorsTextBoxLabel
|
||||||
@@ -483,7 +380,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
],
|
],
|
||||||
data: [],
|
data: [],
|
||||||
height: 500,
|
height: 500,
|
||||||
width: 380
|
width: 375
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.newOperatorButton = view.modelBuilder.button().withProperties({
|
this.newOperatorButton = view.modelBuilder.button().withProperties({
|
||||||
@@ -494,15 +391,10 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
this.operatorsTable.enabled = false;
|
this.operatorsTable.enabled = false;
|
||||||
this.newOperatorButton.enabled = false;
|
this.newOperatorButton.enabled = false;
|
||||||
|
|
||||||
let operatorContainer = view.modelBuilder.formContainer()
|
this.newOperatorButton.onDidClick(() => {
|
||||||
.withFormItems([{
|
let operatorDialog = new OperatorDialog(this.ownerUri);
|
||||||
component: this.operatorsTable,
|
operatorDialog.openDialog();
|
||||||
title: AlertDialog.OperatorListLabel
|
});
|
||||||
}, {
|
|
||||||
component: this.newOperatorButton,
|
|
||||||
title: ''
|
|
||||||
}])
|
|
||||||
.component();
|
|
||||||
|
|
||||||
this.notifyOperatorsCheckBox.onChanged(() => {
|
this.notifyOperatorsCheckBox.onChanged(() => {
|
||||||
if (this.notifyOperatorsCheckBox.checked) {
|
if (this.notifyOperatorsCheckBox.checked) {
|
||||||
@@ -514,18 +406,30 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let flexModel = view.modelBuilder.flexContainer()
|
let notifyOperatorContainer = view.modelBuilder.formContainer()
|
||||||
.withLayout({
|
.withFormItems([{
|
||||||
flexFlow: 'column'
|
component: this.operatorsTable,
|
||||||
})
|
title: AlertDialog.OperatorListLabel
|
||||||
.withItems([this.executeJobCheckBox, executeJobContainer, this.notifyOperatorsCheckBox, operatorContainer])
|
}, {
|
||||||
.component();
|
component: this.newOperatorButton,
|
||||||
|
title: ''
|
||||||
|
}], { componentWidth: '100%'}).component();
|
||||||
|
|
||||||
let formModel = view.modelBuilder.formContainer()
|
let formModel = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: flexModel,
|
component: this.executeJobCheckBox,
|
||||||
title: ''
|
title: ''
|
||||||
}]).withLayout({ width: '100%' }).component();
|
}, {
|
||||||
|
component: executeJobContainer,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: this.notifyOperatorsCheckBox,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: notifyOperatorContainer,
|
||||||
|
title: ''
|
||||||
|
}])
|
||||||
|
.withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
await view.initializeModel(formModel);
|
await view.initializeModel(formModel);
|
||||||
});
|
});
|
||||||
@@ -544,29 +448,21 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
label: AlertDialog.IncludeErrorInPagerCheckBoxLabel
|
label: AlertDialog.IncludeErrorInPagerCheckBoxLabel
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.additionalMessageTextBox = view.modelBuilder.inputBox()
|
this.additionalMessageTextBox = view.modelBuilder.inputBox().component();
|
||||||
.withProperties({
|
|
||||||
multiline: true,
|
|
||||||
height: 150,
|
|
||||||
inputType: 'text'
|
|
||||||
})
|
|
||||||
.component();
|
|
||||||
|
|
||||||
this.delayMinutesTextBox = view.modelBuilder.inputBox()
|
this.delayMinutesTextBox = view.modelBuilder.inputBox()
|
||||||
.withValidation(component => +component.value >= 0)
|
|
||||||
.withProperties({
|
.withProperties({
|
||||||
inputType: 'number'
|
inputType: 'number',
|
||||||
|
placeHolder: 0
|
||||||
})
|
})
|
||||||
.component();
|
.component();
|
||||||
this.delayMinutesTextBox.required = true;
|
|
||||||
|
|
||||||
this.delaySecondsTextBox = view.modelBuilder.inputBox()
|
this.delaySecondsTextBox = view.modelBuilder.inputBox()
|
||||||
.withValidation(component => +component.value >= 0)
|
|
||||||
.withProperties({
|
.withProperties({
|
||||||
inputType: 'number'
|
inputType: 'number',
|
||||||
|
placeHolder: 0
|
||||||
})
|
})
|
||||||
.component();
|
.component();
|
||||||
this.delaySecondsTextBox.required = true;
|
|
||||||
|
|
||||||
let formModel = view.modelBuilder.formContainer()
|
let formModel = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
@@ -598,11 +494,6 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
severityNumber = index + 1;
|
severityNumber = index + 1;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
let errorNumber = +this.errorNumberTextBox.value;
|
|
||||||
if (errorNumber) {
|
|
||||||
severityNumber = errorNumber;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return severityNumber;
|
return severityNumber;
|
||||||
}
|
}
|
||||||
@@ -610,6 +501,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
protected updateModel() {
|
protected updateModel() {
|
||||||
this.model.name = this.nameTextBox.value;
|
this.model.name = this.nameTextBox.value;
|
||||||
this.model.isEnabled = this.enabledCheckBox.checked;
|
this.model.isEnabled = this.enabledCheckBox.checked;
|
||||||
|
|
||||||
this.model.alertType = this.getDropdownValue(this.typeDropDown);
|
this.model.alertType = this.getDropdownValue(this.typeDropDown);
|
||||||
let databaseName = this.getDropdownValue(this.databaseDropDown);
|
let databaseName = this.getDropdownValue(this.databaseDropDown);
|
||||||
this.model.databaseName = (databaseName !== AlertDialog.AllDatabases) ? databaseName : undefined;
|
this.model.databaseName = (databaseName !== AlertDialog.AllDatabases) ? databaseName : undefined;
|
||||||
@@ -627,7 +519,9 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
|||||||
} else {
|
} else {
|
||||||
this.model.eventDescriptionKeyword = '';
|
this.model.eventDescriptionKeyword = '';
|
||||||
}
|
}
|
||||||
this.model.notificationMessage = this.additionalMessageTextBox.value;
|
let minutes = this.delayMinutesTextBox.value ? +this.delayMinutesTextBox.value : 0;
|
||||||
this.model.delayBetweenResponses = +this.delayMinutesTextBox.value * 60 + +this.delaySecondsTextBox.value;
|
let seconds = this.delaySecondsTextBox.value ? +this.delaySecondsTextBox : 0;
|
||||||
|
this.model.delayBetweenResponses = minutes + seconds;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
import * as nls from 'vscode-nls';
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import { JobData } from '../data/jobData';
|
import { JobData } from '../data/jobData';
|
||||||
import { JobStepDialog } from './jobStepDialog';
|
import { JobStepDialog } from './jobStepDialog';
|
||||||
@@ -10,51 +11,57 @@ import { PickScheduleDialog } from './pickScheduleDialog';
|
|||||||
import { AlertDialog } from './alertDialog';
|
import { AlertDialog } from './alertDialog';
|
||||||
import { AgentDialog } from './agentDialog';
|
import { AgentDialog } from './agentDialog';
|
||||||
|
|
||||||
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
export class JobDialog extends AgentDialog<JobData> {
|
export class JobDialog extends AgentDialog<JobData> {
|
||||||
|
|
||||||
// TODO: localize
|
// TODO: localize
|
||||||
// Top level
|
// Top level
|
||||||
private static readonly CreateDialogTitle: string = 'New Job';
|
private static readonly CreateDialogTitle: string = localize('jobDialog.newJob', 'New Job');
|
||||||
private static readonly EditDialogTitle: string = 'Edit Job';
|
private static readonly EditDialogTitle: string = localize('jobDialog.editJob', 'Edit Job');
|
||||||
private readonly GeneralTabText: string = 'General';
|
private readonly GeneralTabText: string = localize('jobDialog.general', 'General');
|
||||||
private readonly StepsTabText: string = 'Steps';
|
private readonly StepsTabText: string = localize('jobDialog.steps', 'Steps');
|
||||||
private readonly SchedulesTabText: string = 'Schedules';
|
private readonly SchedulesTabText: string = localize('jobDialog.schedules', 'Schedules');
|
||||||
private readonly AlertsTabText: string = 'Alerts';
|
private readonly AlertsTabText: string = localize('jobDialog.alerts', 'Alerts');
|
||||||
private readonly NotificationsTabText: string = 'Notifications';
|
private readonly NotificationsTabText: string = localize('jobDialog.notifications', 'Notifications');
|
||||||
|
private readonly BlankJobNameErrorText: string = localize('jobDialog.blankJobNameError', 'The name of the job cannot be blank.');
|
||||||
|
|
||||||
// General tab strings
|
// General tab strings
|
||||||
private readonly NameTextBoxLabel: string = 'Name';
|
private readonly NameTextBoxLabel: string = localize('jobDialog.name', 'Name');
|
||||||
private readonly OwnerTextBoxLabel: string = 'Owner';
|
private readonly OwnerTextBoxLabel: string = localize('jobDialog.owner', 'Owner');
|
||||||
private readonly CategoryDropdownLabel: string = 'Category';
|
private readonly CategoryDropdownLabel: string = localize('jobDialog.category', 'Category');
|
||||||
private readonly DescriptionTextBoxLabel: string = 'Description';
|
private readonly DescriptionTextBoxLabel: string = localize('jobDialog.description', 'Description');
|
||||||
private readonly EnabledCheckboxLabel: string = 'Enabled';
|
private readonly EnabledCheckboxLabel: string = localize('jobDialog.enabled', 'Enabled');
|
||||||
|
|
||||||
// Steps tab strings
|
// Steps tab strings
|
||||||
private readonly JobStepsTopLabelString: string = 'Job step list';
|
private readonly JobStepsTopLabelString: string = localize('jobDialog.jobStepList', 'Job step list');
|
||||||
private readonly StepsTable_StepColumnString: string = 'Step';
|
private readonly StepsTable_StepColumnString: string = localize('jobDialog.step', 'Step');
|
||||||
private readonly StepsTable_NameColumnString: string = 'Name';
|
private readonly StepsTable_NameColumnString: string = localize('jobDialog.name', 'Name');
|
||||||
private readonly StepsTable_TypeColumnString: string = 'Type';
|
private readonly StepsTable_TypeColumnString: string = localize('jobDialog.type', 'Type');
|
||||||
private readonly StepsTable_SuccessColumnString: string = 'On Success';
|
private readonly StepsTable_SuccessColumnString: string = localize('jobDialog.onSuccess', 'On Success');
|
||||||
private readonly StepsTable_FailureColumnString: string = 'On Failure';
|
private readonly StepsTable_FailureColumnString: string = localize('jobDialog.onFailure', 'On Failure');
|
||||||
private readonly NewStepButtonString: string = 'New...';
|
private readonly NewStepButtonString: string = localize('jobDialog.new', 'New...');
|
||||||
private readonly InsertStepButtonString: string = 'Insert...';
|
private readonly EditStepButtonString: string = localize('jobDialog.edit', 'Edit');
|
||||||
private readonly EditStepButtonString: string = 'Edit';
|
private readonly DeleteStepButtonString: string = localize('jobDialog.delete', 'Delete');
|
||||||
private readonly DeleteStepButtonString: string = 'Delete';
|
private readonly MoveStepUpButtonString: string = localize('jobDialog.moveUp', 'Move Step Up');
|
||||||
|
private readonly MoveStepDownButtonString: string = localize('jobDialog.moveDown', 'Move Step Up');
|
||||||
|
|
||||||
// Notifications tab strings
|
// Notifications tab strings
|
||||||
private readonly NotificationsTabTopLabelString: string = 'Actions to perform when the job completes';
|
private readonly NotificationsTabTopLabelString: string = localize('jobDialog.notificationsTabTop', 'Actions to perform when the job completes');
|
||||||
private readonly EmailCheckBoxString: string = 'Email';
|
private readonly EmailCheckBoxString: string = localize('jobDialog.email', 'Email');
|
||||||
private readonly PagerCheckBoxString: string = 'Page';
|
private readonly PagerCheckBoxString: string = localize('jobDialog.page', 'Page');
|
||||||
private readonly EventLogCheckBoxString: string = 'Write to the Windows Application event log';
|
private readonly EventLogCheckBoxString: string = localize('jobDialog.eventLogCheckBoxLabel', 'Write to the Windows Application event log');
|
||||||
private readonly DeleteJobCheckBoxString: string = 'Automatically delete job';
|
private readonly DeleteJobCheckBoxString: string = localize('jobDialog.deleteJobLabel', 'Automatically delete job');
|
||||||
|
|
||||||
// Schedules tab strings
|
// Schedules tab strings
|
||||||
private readonly SchedulesTopLabelString: string = 'Schedules list';
|
private readonly SchedulesTopLabelString: string = localize('jobDialog.schedulesaLabel', 'Schedules list');
|
||||||
private readonly PickScheduleButtonString: string = 'Pick Schedule';
|
private readonly PickScheduleButtonString: string = localize('jobDialog.pickSchedule', 'Pick Schedule');
|
||||||
|
private readonly ScheduleNameLabelString: string = localize('jobDialog.scheduleNameLabel', 'Schedule Name');
|
||||||
|
|
||||||
// Alerts tab strings
|
// Alerts tab strings
|
||||||
private readonly AlertsTopLabelString: string = 'Alerts list';
|
private readonly AlertsTopLabelString: string = localize('jobDialog.alertsList', 'Alerts list');
|
||||||
private readonly NewAlertButtonString: string = 'New Alert';
|
private readonly NewAlertButtonString: string = localize('jobDialog.newAlert', 'New Alert');
|
||||||
|
private readonly AlertNameLabelString: string = localize('jobDialog.alertNameLabel', 'Alert Name');
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
@@ -73,7 +80,8 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
// Steps tab controls
|
// Steps tab controls
|
||||||
private stepsTable: sqlops.TableComponent;
|
private stepsTable: sqlops.TableComponent;
|
||||||
private newStepButton: sqlops.ButtonComponent;
|
private newStepButton: sqlops.ButtonComponent;
|
||||||
private insertStepButton: sqlops.ButtonComponent;
|
private moveStepUpButton: sqlops.ButtonComponent;
|
||||||
|
private moveStepDownButton: sqlops.ButtonComponent;
|
||||||
private editStepButton: sqlops.ButtonComponent;
|
private editStepButton: sqlops.ButtonComponent;
|
||||||
private deleteStepButton: sqlops.ButtonComponent;
|
private deleteStepButton: sqlops.ButtonComponent;
|
||||||
|
|
||||||
@@ -133,6 +141,12 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
private initializeGeneralTab() {
|
private initializeGeneralTab() {
|
||||||
this.generalTab.registerContent(async view => {
|
this.generalTab.registerContent(async view => {
|
||||||
this.nameTextBox = view.modelBuilder.inputBox().component();
|
this.nameTextBox = view.modelBuilder.inputBox().component();
|
||||||
|
this.nameTextBox.required = true;
|
||||||
|
this.nameTextBox.onTextChanged(() => {
|
||||||
|
if (this.nameTextBox.value && this.nameTextBox.value.length > 0) {
|
||||||
|
this.dialog.message = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
this.ownerTextBox = view.modelBuilder.inputBox().component();
|
this.ownerTextBox = view.modelBuilder.inputBox().component();
|
||||||
this.categoryDropdown = view.modelBuilder.dropDown().component();
|
this.categoryDropdown = view.modelBuilder.dropDown().component();
|
||||||
this.descriptionTextBox = view.modelBuilder.inputBox().withProperties({
|
this.descriptionTextBox = view.modelBuilder.inputBox().withProperties({
|
||||||
@@ -187,21 +201,32 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
height: 800
|
height: 800
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
|
this.moveStepUpButton = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
label: this.MoveStepUpButtonString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.moveStepDownButton = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
label: this.MoveStepDownButtonString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
this.newStepButton = view.modelBuilder.button().withProperties({
|
this.newStepButton = view.modelBuilder.button().withProperties({
|
||||||
label: this.NewStepButtonString,
|
label: this.NewStepButtonString,
|
||||||
width: 80
|
width: 80
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.newStepButton.onDidClick((e)=>{
|
this.newStepButton.onDidClick((e)=>{
|
||||||
let stepDialog = new JobStepDialog(this.model.ownerUri, '', '', 1, this.model);
|
if (this.nameTextBox.value && this.nameTextBox.value.length > 0) {
|
||||||
stepDialog.openNewStepDialog();
|
let stepDialog = new JobStepDialog(this.model.ownerUri, this.nameTextBox.value, '' , 1, this.model);
|
||||||
|
stepDialog.openNewStepDialog();
|
||||||
|
} else {
|
||||||
|
this.dialog.message = { text: this.BlankJobNameErrorText };
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.insertStepButton = view.modelBuilder.button().withProperties({
|
|
||||||
label: this.InsertStepButtonString,
|
|
||||||
width: 80
|
|
||||||
}).component();
|
|
||||||
|
|
||||||
this.editStepButton = view.modelBuilder.button().withProperties({
|
this.editStepButton = view.modelBuilder.button().withProperties({
|
||||||
label: this.EditStepButtonString,
|
label: this.EditStepButtonString,
|
||||||
width: 80
|
width: 80
|
||||||
@@ -216,7 +241,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.stepsTable,
|
component: this.stepsTable,
|
||||||
title: this.JobStepsTopLabelString,
|
title: this.JobStepsTopLabelString,
|
||||||
actions: [this.newStepButton, this.insertStepButton, this.editStepButton, this.deleteStepButton]
|
actions: [this.moveStepUpButton, this.moveStepDownButton, this.newStepButton, this.editStepButton, this.deleteStepButton]
|
||||||
}]).withLayout({ width: '100%' }).component();
|
}]).withLayout({ width: '100%' }).component();
|
||||||
await view.initializeModel(formModel);
|
await view.initializeModel(formModel);
|
||||||
});
|
});
|
||||||
@@ -227,7 +252,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
this.alertsTable = view.modelBuilder.table()
|
this.alertsTable = view.modelBuilder.table()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
columns: [
|
columns: [
|
||||||
'Alert Name'
|
this.AlertNameLabelString
|
||||||
],
|
],
|
||||||
data: [],
|
data: [],
|
||||||
height: 600,
|
height: 600,
|
||||||
@@ -262,11 +287,11 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
this.schedulesTable = view.modelBuilder.table()
|
this.schedulesTable = view.modelBuilder.table()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
columns: [
|
columns: [
|
||||||
'Schedule Name'
|
this.ScheduleNameLabelString
|
||||||
],
|
],
|
||||||
data: [],
|
data: [],
|
||||||
height: 600,
|
height: 600,
|
||||||
width: 400
|
width: 420
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.pickScheduleButton = view.modelBuilder.button().withProperties({
|
this.pickScheduleButton = view.modelBuilder.button().withProperties({
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
import * as nls from 'vscode-nls';
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { JobStepData } from '../data/jobStepData';
|
import { JobStepData } from '../data/jobStepData';
|
||||||
@@ -10,31 +11,57 @@ import { AgentUtils } from '../agentUtils';
|
|||||||
import { JobData } from '../data/jobData';
|
import { JobData } from '../data/jobData';
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
export class JobStepDialog {
|
export class JobStepDialog {
|
||||||
|
|
||||||
// TODO: localize
|
// TODO: localize
|
||||||
// Top level
|
// Top level
|
||||||
//
|
//
|
||||||
private static readonly DialogTitle: string = 'New Job Step';
|
private readonly DialogTitle: string = localize('jobStepDialog.newJobStep', 'New Job Step');
|
||||||
private static readonly FileBrowserDialogTitle: string = 'Locate Database Files - ';
|
private readonly FileBrowserDialogTitle: string = localize('jobStepDialog.fileBrowserTitle', 'Locate Database Files - ');
|
||||||
private static readonly OkButtonText: string = 'OK';
|
private readonly OkButtonText: string = localize('jobStepDialog.ok', 'OK');
|
||||||
private static readonly CancelButtonText: string = 'Cancel';
|
private readonly CancelButtonText: string = localize('jobStepDialog.cancel', 'Cancel');
|
||||||
private static readonly GeneralTabText: string = 'General';
|
private readonly GeneralTabText: string = localize('jobStepDialog.general', 'General');
|
||||||
private static readonly AdvancedTabText: string = 'Advanced';
|
private readonly AdvancedTabText: string = localize('jobStepDialog.advanced', 'Advanced');
|
||||||
private static readonly OpenCommandText: string = 'Open...';
|
private readonly OpenCommandText: string = localize('jobStepDialog.open', 'Open...');
|
||||||
private static readonly ParseCommandText: string = 'Parse';
|
private readonly ParseCommandText: string = localize('jobStepDialog.parse','Parse');
|
||||||
private static readonly NextButtonText: string = 'Next';
|
private readonly NextButtonText: string = localize('jobStepDialog.next', 'Next');
|
||||||
private static readonly PreviousButtonText: string = 'Previous';
|
private readonly PreviousButtonText: string = localize('jobStepDialog.previous','Previous');
|
||||||
private static readonly SuccessAction: string = 'On success action';
|
private readonly SuccessfulParseText: string = localize('jobStepDialog.successParse', 'The command was successfully parsed.');
|
||||||
private static readonly FailureAction: string = 'On failure action';
|
private readonly FailureParseText: string = localize('jobStepDialog.failParse', 'The command failed.');
|
||||||
|
|
||||||
|
// General Control Titles
|
||||||
|
private readonly StepNameLabelString: string = localize('jobStepDialog.stepNameLabel', 'Step Name');
|
||||||
|
private readonly TypeLabelString: string = localize('jobStepDialog.typeLabel', 'Type');
|
||||||
|
private readonly RunAsLabelString: string = localize('jobStepDialog.runAsLabel', 'Run as');
|
||||||
|
private readonly DatabaseLabelString: string = localize('jobStepDialog.databaseLabel', 'Database');
|
||||||
|
private readonly CommandLabelString: string = localize('jobStepDialog.commandLabel', 'Command');
|
||||||
|
|
||||||
|
// Advanced Control Titles
|
||||||
|
private readonly SuccessActionLabel: string = localize('jobStepDialog.successAction', 'On success action');
|
||||||
|
private readonly FailureActionLabel: string = localize('jobStepDialog.failureAction', 'On failure action');
|
||||||
|
private readonly RunAsUserLabel: string = localize('jobStepDialog.runAsUser', 'Run as user');
|
||||||
|
private readonly RetryAttemptsLabel: string = localize('jobStepDialog.retryAttempts', 'Retry Attempts');
|
||||||
|
private readonly RetryIntervalLabel: string = localize('jobStepDialog.retryInterval', 'Retry Interval (minutes)');
|
||||||
|
private readonly LogToTableLabel: string = localize('jobStepDialog.logToTable', 'Log to table');
|
||||||
|
private readonly AppendExistingTableEntryLabel: string = localize('jobStepDialog.appendExistingTableEntry', 'Append output to exisiting entry in table');
|
||||||
|
private readonly IncludeStepOutputHistoryLabel: string = localize('jobStepDialog.includeStepOutputHistory', 'Include step output in history');
|
||||||
|
private readonly OutputFileNameLabel: string = localize('jobStepDialog.outputFile', 'Output File');
|
||||||
|
private readonly AppendOutputToFileLabel: string = localize('jobStepDialog.appendOutputToFile', 'Append output to existing file');
|
||||||
|
|
||||||
|
// File Browser Control Titles
|
||||||
|
private readonly SelectedPathLabelString: string = localize('jobStepDialog.selectedPath', 'Selected path');
|
||||||
|
private readonly FilesOfTypeLabelString: string = localize('jobStepDialog.filesOfType', 'Files of type');
|
||||||
|
private readonly FileNameLabelString: string = localize('jobStepDialog.fileName', 'File name');
|
||||||
|
private readonly AllFilesLabelString: string = localize('jobStepDialog.allFiles', 'All Files (*)');
|
||||||
|
|
||||||
// Dropdown options
|
// Dropdown options
|
||||||
private static readonly TSQLScript: string = 'Transact-SQL script (T-SQL)';
|
private readonly TSQLScript: string = localize('jobStepDialog.TSQL', 'Transact-SQL script (T-SQL)');
|
||||||
private static readonly AgentServiceAccount: string = 'SQL Server Agent Service Account';
|
private readonly AgentServiceAccount: string = localize('jobStepDialog.agentServiceAccount', 'SQL Server Agent Service Account');
|
||||||
private static readonly NextStep: string = 'Go to the next step';
|
private readonly NextStep: string = localize('jobStepDialog.nextStep', 'Go to the next step');
|
||||||
private static readonly QuitJobReportingSuccess: string = 'Quit the job reporting success';
|
private readonly QuitJobReportingSuccess: string = localize('jobStepDialog.quitJobSuccess', 'Quit the job reporting success');
|
||||||
private static readonly QuitJobReportingFailure: string = 'Quit the job reporting failure';
|
private readonly QuitJobReportingFailure: string = localize('jobStepDialog.quitJobFailure', 'Quit the job reporting failure');
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
|
|
||||||
@@ -54,6 +81,7 @@ export class JobStepDialog {
|
|||||||
private retryIntervalBox: sqlops.InputBoxComponent;
|
private retryIntervalBox: sqlops.InputBoxComponent;
|
||||||
private outputFileNameBox: sqlops.InputBoxComponent;
|
private outputFileNameBox: sqlops.InputBoxComponent;
|
||||||
private fileBrowserNameBox: sqlops.InputBoxComponent;
|
private fileBrowserNameBox: sqlops.InputBoxComponent;
|
||||||
|
private userInputBox: sqlops.InputBoxComponent;
|
||||||
|
|
||||||
// Dropdowns
|
// Dropdowns
|
||||||
private typeDropdown: sqlops.DropDownComponent;
|
private typeDropdown: sqlops.DropDownComponent;
|
||||||
@@ -98,33 +126,33 @@ export class JobStepDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private initializeUIComponents() {
|
private initializeUIComponents() {
|
||||||
this.dialog = sqlops.window.modelviewdialog.createDialog(JobStepDialog.DialogTitle);
|
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
|
||||||
this.generalTab = sqlops.window.modelviewdialog.createTab(JobStepDialog.GeneralTabText);
|
this.generalTab = sqlops.window.modelviewdialog.createTab(this.GeneralTabText);
|
||||||
this.advancedTab = sqlops.window.modelviewdialog.createTab(JobStepDialog.AdvancedTabText);
|
this.advancedTab = sqlops.window.modelviewdialog.createTab(this.AdvancedTabText);
|
||||||
this.dialog.content = [this.generalTab, this.advancedTab];
|
this.dialog.content = [this.generalTab, this.advancedTab];
|
||||||
this.dialog.okButton.onClick(async () => await this.execute());
|
this.dialog.okButton.onClick(async () => await this.execute());
|
||||||
this.dialog.okButton.label = JobStepDialog.OkButtonText;
|
this.dialog.okButton.label = this.OkButtonText;
|
||||||
this.dialog.cancelButton.label = JobStepDialog.CancelButtonText;
|
this.dialog.cancelButton.label = this.CancelButtonText;
|
||||||
}
|
}
|
||||||
|
|
||||||
private createCommands(view, queryProvider: sqlops.QueryProvider) {
|
private createCommands(view, queryProvider: sqlops.QueryProvider) {
|
||||||
this.openButton = view.modelBuilder.button()
|
this.openButton = view.modelBuilder.button()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: JobStepDialog.OpenCommandText,
|
label: this.OpenCommandText,
|
||||||
width: '80px'
|
width: '80px'
|
||||||
}).component();
|
}).component();
|
||||||
this.parseButton = view.modelBuilder.button()
|
this.parseButton = view.modelBuilder.button()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: JobStepDialog.ParseCommandText,
|
label: this.ParseCommandText,
|
||||||
width: '80px'
|
width: '80px'
|
||||||
}).component();
|
}).component();
|
||||||
this.parseButton.onDidClick(e => {
|
this.parseButton.onDidClick(e => {
|
||||||
if (this.commandTextBox.value) {
|
if (this.commandTextBox.value) {
|
||||||
queryProvider.parseSyntax(this.ownerUri, this.commandTextBox.value).then(result => {
|
queryProvider.parseSyntax(this.ownerUri, this.commandTextBox.value).then(result => {
|
||||||
if (result && result.parseable) {
|
if (result && result.parseable) {
|
||||||
this.dialog.message = { text: 'The command was successfully parsed.', level: 2};
|
this.dialog.message = { text: this.SuccessfulParseText, level: 2};
|
||||||
} else if (result && !result.parseable) {
|
} else if (result && !result.parseable) {
|
||||||
this.dialog.message = { text: 'The command failed' };
|
this.dialog.message = { text: this.FailureParseText };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -139,13 +167,13 @@ export class JobStepDialog {
|
|||||||
.component();
|
.component();
|
||||||
this.nextButton = view.modelBuilder.button()
|
this.nextButton = view.modelBuilder.button()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: JobStepDialog.NextButtonText,
|
label: this.NextButtonText,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
width: '80px'
|
width: '80px'
|
||||||
}).component();
|
}).component();
|
||||||
this.previousButton = view.modelBuilder.button()
|
this.previousButton = view.modelBuilder.button()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: JobStepDialog.PreviousButtonText,
|
label: this.PreviousButtonText,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
width: '80px'
|
width: '80px'
|
||||||
}).component();
|
}).component();
|
||||||
@@ -159,8 +187,8 @@ export class JobStepDialog {
|
|||||||
this.nameTextBox.required = true;
|
this.nameTextBox.required = true;
|
||||||
this.typeDropdown = view.modelBuilder.dropDown()
|
this.typeDropdown = view.modelBuilder.dropDown()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
value: JobStepDialog.TSQLScript,
|
value: this.TSQLScript,
|
||||||
values: [JobStepDialog.TSQLScript]
|
values: [this.TSQLScript]
|
||||||
})
|
})
|
||||||
.component();
|
.component();
|
||||||
this.runAsDropdown = view.modelBuilder.dropDown()
|
this.runAsDropdown = view.modelBuilder.dropDown()
|
||||||
@@ -171,8 +199,8 @@ export class JobStepDialog {
|
|||||||
.component();
|
.component();
|
||||||
this.runAsDropdown.enabled = false;
|
this.runAsDropdown.enabled = false;
|
||||||
this.typeDropdown.onValueChanged((type) => {
|
this.typeDropdown.onValueChanged((type) => {
|
||||||
if (type.selected !== JobStepDialog.TSQLScript) {
|
if (type.selected !== this.TSQLScript) {
|
||||||
this.runAsDropdown.value = JobStepDialog.AgentServiceAccount;
|
this.runAsDropdown.value = this.AgentServiceAccount;
|
||||||
this.runAsDropdown.values = [this.runAsDropdown.value];
|
this.runAsDropdown.values = [this.runAsDropdown.value];
|
||||||
} else {
|
} else {
|
||||||
this.runAsDropdown.value = '';
|
this.runAsDropdown.value = '';
|
||||||
@@ -200,19 +228,19 @@ export class JobStepDialog {
|
|||||||
let formModel = view.modelBuilder.formContainer()
|
let formModel = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.nameTextBox,
|
component: this.nameTextBox,
|
||||||
title: 'Step name'
|
title: this.StepNameLabelString
|
||||||
}, {
|
}, {
|
||||||
component: this.typeDropdown,
|
component: this.typeDropdown,
|
||||||
title: 'Type'
|
title: this.TypeLabelString
|
||||||
}, {
|
}, {
|
||||||
component: this.runAsDropdown,
|
component: this.runAsDropdown,
|
||||||
title: 'Run as'
|
title: this.RunAsLabelString
|
||||||
}, {
|
}, {
|
||||||
component: this.databaseDropdown,
|
component: this.databaseDropdown,
|
||||||
title: 'Database'
|
title: this.DatabaseLabelString
|
||||||
}, {
|
}, {
|
||||||
component: this.commandTextBox,
|
component: this.commandTextBox,
|
||||||
title: 'Command',
|
title: this.CommandLabelString,
|
||||||
actions: [buttonContainer]
|
actions: [buttonContainer]
|
||||||
}], {
|
}], {
|
||||||
horizontal: false,
|
horizontal: false,
|
||||||
@@ -224,81 +252,57 @@ export class JobStepDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private createRunAsUserOptions(view) {
|
|
||||||
let userInputBox = view.modelBuilder.inputBox()
|
|
||||||
.withProperties({ inputType: 'text', width: '100px' }).component();
|
|
||||||
let viewButton = view.modelBuilder.button()
|
|
||||||
.withProperties({ label: '...', width: '20px' }).component();
|
|
||||||
let viewButtonContainer = view.modelBuilder.flexContainer()
|
|
||||||
.withLayout({ width: 100, textAlign: 'right' })
|
|
||||||
.withItems([viewButton], { flex: '1 1 50%' }).component();
|
|
||||||
let userInputBoxContainer = view.modelBuilder.flexContainer()
|
|
||||||
.withLayout({ width: 200, textAlign: 'left' })
|
|
||||||
.withItems([userInputBox], { flex: '1 1 50%' }).component();
|
|
||||||
let runAsUserContainer = view.modelBuilder.flexContainer()
|
|
||||||
.withLayout({ width: 200 })
|
|
||||||
.withItems([userInputBoxContainer, viewButtonContainer], { flex: '1 1 50%' })
|
|
||||||
.component();
|
|
||||||
let runAsUserForm = view.modelBuilder.formContainer()
|
|
||||||
.withFormItems([{
|
|
||||||
component: runAsUserContainer,
|
|
||||||
title: 'Run as user'
|
|
||||||
}], { horizontal: true, componentWidth: 200 }).component();
|
|
||||||
return runAsUserForm;
|
|
||||||
}
|
|
||||||
|
|
||||||
private createAdvancedTab() {
|
private createAdvancedTab() {
|
||||||
this.advancedTab.registerContent(async (view) => {
|
this.advancedTab.registerContent(async (view) => {
|
||||||
this.successActionDropdown = view.modelBuilder.dropDown()
|
this.successActionDropdown = view.modelBuilder.dropDown()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
value: JobStepDialog.NextStep,
|
width: '100%',
|
||||||
values: [JobStepDialog.NextStep, JobStepDialog.QuitJobReportingSuccess, JobStepDialog.QuitJobReportingFailure]
|
value: this.NextStep,
|
||||||
|
values: [this.NextStep, this.QuitJobReportingSuccess, this.QuitJobReportingFailure]
|
||||||
})
|
})
|
||||||
.component();
|
.component();
|
||||||
let retryFlexContainer = this.createRetryCounters(view);
|
let retryFlexContainer = this.createRetryCounters(view);
|
||||||
|
|
||||||
this.failureActionDropdown = view.modelBuilder.dropDown()
|
this.failureActionDropdown = view.modelBuilder.dropDown()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
value: JobStepDialog.QuitJobReportingFailure,
|
value: this.QuitJobReportingFailure,
|
||||||
values: [JobStepDialog.QuitJobReportingFailure, JobStepDialog.NextStep, JobStepDialog.QuitJobReportingSuccess]
|
values: [this.QuitJobReportingFailure, this.NextStep, this.QuitJobReportingSuccess]
|
||||||
})
|
})
|
||||||
.component();
|
.component();
|
||||||
let optionsGroup = this.createTSQLOptions(view);
|
let optionsGroup = this.createTSQLOptions(view);
|
||||||
let viewButton = view.modelBuilder.button()
|
|
||||||
.withProperties({ label: 'View', width: '50px' }).component();
|
|
||||||
viewButton.enabled = false;
|
|
||||||
this.logToTableCheckbox = view.modelBuilder.checkBox()
|
this.logToTableCheckbox = view.modelBuilder.checkBox()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: 'Log to table'
|
label: this.LogToTableLabel
|
||||||
}).component();
|
}).component();
|
||||||
let appendToExistingEntryInTableCheckbox = view.modelBuilder.checkBox()
|
let appendToExistingEntryInTableCheckbox = view.modelBuilder.checkBox()
|
||||||
.withProperties({ label: 'Append output to existing entry in table' }).component();
|
.withProperties({ label: this.AppendExistingTableEntryLabel }).component();
|
||||||
appendToExistingEntryInTableCheckbox.enabled = false;
|
appendToExistingEntryInTableCheckbox.enabled = false;
|
||||||
this.logToTableCheckbox.onChanged(e => {
|
this.logToTableCheckbox.onChanged(e => {
|
||||||
viewButton.enabled = e;
|
|
||||||
appendToExistingEntryInTableCheckbox.enabled = e;
|
appendToExistingEntryInTableCheckbox.enabled = e;
|
||||||
});
|
});
|
||||||
let appendCheckboxContainer = view.modelBuilder.groupContainer()
|
let appendCheckboxContainer = view.modelBuilder.groupContainer()
|
||||||
.withItems([appendToExistingEntryInTableCheckbox]).component();
|
.withItems([appendToExistingEntryInTableCheckbox]).component();
|
||||||
let logToTableContainer = view.modelBuilder.flexContainer()
|
let logToTableContainer = view.modelBuilder.flexContainer()
|
||||||
.withLayout({ flexFlow: 'row', justifyContent: 'space-between', width: 300 })
|
.withLayout({ flexFlow: 'row', justifyContent: 'space-between', width: 300 })
|
||||||
.withItems([this.logToTableCheckbox, viewButton]).component();
|
.withItems([this.logToTableCheckbox]).component();
|
||||||
let logStepOutputHistoryCheckbox = view.modelBuilder.checkBox()
|
let logStepOutputHistoryCheckbox = view.modelBuilder.checkBox()
|
||||||
.withProperties({ label: 'Include step output in history' }).component();
|
.withProperties({ label: this.IncludeStepOutputHistoryLabel }).component();
|
||||||
let runAsUserOptions = this.createRunAsUserOptions(view);
|
this.userInputBox = view.modelBuilder.inputBox()
|
||||||
|
.withProperties({ inputType: 'text', width: '100%' }).component();
|
||||||
let formModel = view.modelBuilder.formContainer()
|
let formModel = view.modelBuilder.formContainer()
|
||||||
.withFormItems(
|
.withFormItems(
|
||||||
[{
|
[{
|
||||||
component: this.successActionDropdown,
|
component: this.successActionDropdown,
|
||||||
title: JobStepDialog.SuccessAction
|
title: this.SuccessActionLabel
|
||||||
}, {
|
}, {
|
||||||
component: retryFlexContainer,
|
component: retryFlexContainer,
|
||||||
title: ''
|
title: ''
|
||||||
}, {
|
}, {
|
||||||
component: this.failureActionDropdown,
|
component: this.failureActionDropdown,
|
||||||
title: JobStepDialog.FailureAction
|
title: this.FailureActionLabel
|
||||||
}, {
|
}, {
|
||||||
component: optionsGroup,
|
component: optionsGroup,
|
||||||
title: 'Transact-SQL script (T-SQL)'
|
title: this.TSQLScript
|
||||||
}, {
|
}, {
|
||||||
component: logToTableContainer,
|
component: logToTableContainer,
|
||||||
title: ''
|
title: ''
|
||||||
@@ -309,8 +313,8 @@ export class JobStepDialog {
|
|||||||
component: logStepOutputHistoryCheckbox,
|
component: logStepOutputHistoryCheckbox,
|
||||||
title: ''
|
title: ''
|
||||||
}, {
|
}, {
|
||||||
component: runAsUserOptions,
|
component: this.userInputBox,
|
||||||
title: ''
|
title: this.RunAsUserLabel
|
||||||
}], {
|
}], {
|
||||||
componentWidth: 400
|
componentWidth: 400
|
||||||
}).component();
|
}).component();
|
||||||
@@ -323,32 +327,37 @@ export class JobStepDialog {
|
|||||||
|
|
||||||
private createRetryCounters(view) {
|
private createRetryCounters(view) {
|
||||||
this.retryAttemptsBox = view.modelBuilder.inputBox()
|
this.retryAttemptsBox = view.modelBuilder.inputBox()
|
||||||
.withValidation(component => component.value >= 0)
|
.withValidation(component => component.value >= 0)
|
||||||
.withProperties({
|
.withProperties({
|
||||||
inputType: 'number'
|
inputType: 'number',
|
||||||
})
|
width: '100%',
|
||||||
.component();
|
placeHolder: '0'
|
||||||
|
})
|
||||||
|
.component();
|
||||||
this.retryIntervalBox = view.modelBuilder.inputBox()
|
this.retryIntervalBox = view.modelBuilder.inputBox()
|
||||||
.withValidation(component => component.value >= 0)
|
.withValidation(component => component.value >= 0)
|
||||||
.withProperties({
|
.withProperties({
|
||||||
inputType: 'number'
|
inputType: 'number',
|
||||||
|
width: '100%',
|
||||||
|
placeHolder: '0'
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
let retryAttemptsContainer = view.modelBuilder.formContainer()
|
let retryAttemptsContainer = view.modelBuilder.formContainer()
|
||||||
.withFormItems(
|
.withFormItems(
|
||||||
[{
|
[{
|
||||||
component: this.retryAttemptsBox,
|
component: this.retryAttemptsBox,
|
||||||
title: 'Retry Attempts'
|
title: this.RetryAttemptsLabel
|
||||||
}], {
|
}], {
|
||||||
horizontal: false
|
horizontal: false,
|
||||||
})
|
componentWidth: '100%'
|
||||||
|
})
|
||||||
.component();
|
.component();
|
||||||
|
|
||||||
let retryIntervalContainer = view.modelBuilder.formContainer()
|
let retryIntervalContainer = view.modelBuilder.formContainer()
|
||||||
.withFormItems(
|
.withFormItems(
|
||||||
[{
|
[{
|
||||||
component: this.retryIntervalBox,
|
component: this.retryIntervalBox,
|
||||||
title: 'Retry Interval (minutes)'
|
title: this.RetryIntervalLabel
|
||||||
}], {
|
}], {
|
||||||
horizontal: false
|
horizontal: false
|
||||||
})
|
})
|
||||||
@@ -362,7 +371,7 @@ export class JobStepDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private openFileBrowserDialog() {
|
private openFileBrowserDialog() {
|
||||||
let fileBrowserTitle = JobStepDialog.FileBrowserDialogTitle + `${this.server}`;
|
let fileBrowserTitle = this.FileBrowserDialogTitle + `${this.server}`;
|
||||||
this.fileBrowserDialog = sqlops.window.modelviewdialog.createDialog(fileBrowserTitle);
|
this.fileBrowserDialog = sqlops.window.modelviewdialog.createDialog(fileBrowserTitle);
|
||||||
let fileBrowserTab = sqlops.window.modelviewdialog.createTab('File Browser');
|
let fileBrowserTab = sqlops.window.modelviewdialog.createTab('File Browser');
|
||||||
this.fileBrowserDialog.content = [fileBrowserTab];
|
this.fileBrowserDialog.content = [fileBrowserTab];
|
||||||
@@ -379,8 +388,8 @@ export class JobStepDialog {
|
|||||||
});
|
});
|
||||||
this.fileTypeDropdown = view.modelBuilder.dropDown()
|
this.fileTypeDropdown = view.modelBuilder.dropDown()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
value: 'All Files (*)',
|
value: this.AllFilesLabelString,
|
||||||
values: ['All Files (*)']
|
values: [this.AllFilesLabelString]
|
||||||
})
|
})
|
||||||
.component();
|
.component();
|
||||||
this.fileBrowserNameBox = view.modelBuilder.inputBox()
|
this.fileBrowserNameBox = view.modelBuilder.inputBox()
|
||||||
@@ -392,13 +401,13 @@ export class JobStepDialog {
|
|||||||
title: ''
|
title: ''
|
||||||
}, {
|
}, {
|
||||||
component: this.selectedPathTextBox,
|
component: this.selectedPathTextBox,
|
||||||
title: 'Selected path:'
|
title: this.SelectedPathLabelString
|
||||||
}, {
|
}, {
|
||||||
component: this.fileTypeDropdown,
|
component: this.fileTypeDropdown,
|
||||||
title: 'Files of type:'
|
title: this.FilesOfTypeLabelString
|
||||||
}, {
|
}, {
|
||||||
component: this.fileBrowserNameBox,
|
component: this.fileBrowserNameBox,
|
||||||
title: 'File name:'
|
title: this.FileNameLabelString
|
||||||
}
|
}
|
||||||
]).component();
|
]).component();
|
||||||
view.initializeModel(fileBrowserContainer);
|
view.initializeModel(fileBrowserContainer);
|
||||||
@@ -406,8 +415,8 @@ export class JobStepDialog {
|
|||||||
this.fileBrowserDialog.okButton.onClick(() => {
|
this.fileBrowserDialog.okButton.onClick(() => {
|
||||||
this.outputFileNameBox.value = path.join(path.dirname(this.selectedPathTextBox.value), this.fileBrowserNameBox.value);
|
this.outputFileNameBox.value = path.join(path.dirname(this.selectedPathTextBox.value), this.fileBrowserNameBox.value);
|
||||||
});
|
});
|
||||||
this.fileBrowserDialog.okButton.label = JobStepDialog.OkButtonText;
|
this.fileBrowserDialog.okButton.label = this.OkButtonText;
|
||||||
this.fileBrowserDialog.cancelButton.label = JobStepDialog.CancelButtonText;
|
this.fileBrowserDialog.cancelButton.label = this.CancelButtonText;
|
||||||
sqlops.window.modelviewdialog.openDialog(this.fileBrowserDialog);
|
sqlops.window.modelviewdialog.openDialog(this.fileBrowserDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,21 +426,15 @@ export class JobStepDialog {
|
|||||||
this.outputFileBrowserButton.onDidClick(() => this.openFileBrowserDialog());
|
this.outputFileBrowserButton.onDidClick(() => this.openFileBrowserDialog());
|
||||||
this.outputFileNameBox = view.modelBuilder.inputBox()
|
this.outputFileNameBox = view.modelBuilder.inputBox()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
width: '150px',
|
width: 250,
|
||||||
inputType: 'text'
|
inputType: 'text'
|
||||||
}).component();
|
}).component();
|
||||||
let outputViewButton = view.modelBuilder.button()
|
|
||||||
.withProperties({
|
|
||||||
width: '50px',
|
|
||||||
label: 'View'
|
|
||||||
}).component();
|
|
||||||
outputViewButton.enabled = false;
|
|
||||||
let outputButtonContainer = view.modelBuilder.flexContainer()
|
let outputButtonContainer = view.modelBuilder.flexContainer()
|
||||||
.withLayout({
|
.withLayout({
|
||||||
flexFlow: 'row',
|
flexFlow: 'row',
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
width: 120
|
width: '100%'
|
||||||
}).withItems([this.outputFileBrowserButton, outputViewButton], { flex: '1 1 50%' }).component();
|
}).withItems([this.outputFileBrowserButton], { flex: '1 1 50%' }).component();
|
||||||
let outputFlexBox = view.modelBuilder.flexContainer()
|
let outputFlexBox = view.modelBuilder.flexContainer()
|
||||||
.withLayout({
|
.withLayout({
|
||||||
flexFlow: 'row',
|
flexFlow: 'row',
|
||||||
@@ -441,7 +444,7 @@ export class JobStepDialog {
|
|||||||
}).component();
|
}).component();
|
||||||
this.appendToExistingFileCheckbox = view.modelBuilder.checkBox()
|
this.appendToExistingFileCheckbox = view.modelBuilder.checkBox()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
label: 'Append output to existing file'
|
label: this.AppendOutputToFileLabel
|
||||||
}).component();
|
}).component();
|
||||||
this.appendToExistingFileCheckbox.enabled = false;
|
this.appendToExistingFileCheckbox.enabled = false;
|
||||||
this.outputFileNameBox.onTextChanged((input) => {
|
this.outputFileNameBox.onTextChanged((input) => {
|
||||||
@@ -454,11 +457,11 @@ export class JobStepDialog {
|
|||||||
let outputFileForm = view.modelBuilder.formContainer()
|
let outputFileForm = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: outputFlexBox,
|
component: outputFlexBox,
|
||||||
title: 'Output file'
|
title: this.OutputFileNameLabel
|
||||||
}, {
|
}, {
|
||||||
component: this.appendToExistingFileCheckbox,
|
component: this.appendToExistingFileCheckbox,
|
||||||
title: ''
|
title: ''
|
||||||
}], { horizontal: true, componentWidth: 200 }).component();
|
}], { horizontal: false, componentWidth: 200 }).component();
|
||||||
return outputFileForm;
|
return outputFileForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,8 +474,8 @@ export class JobStepDialog {
|
|||||||
this.model.databaseName = this.databaseDropdown.value as string;
|
this.model.databaseName = this.databaseDropdown.value as string;
|
||||||
this.model.script = this.commandTextBox.value;
|
this.model.script = this.commandTextBox.value;
|
||||||
this.model.successAction = this.successActionDropdown.value as string;
|
this.model.successAction = this.successActionDropdown.value as string;
|
||||||
this.model.retryAttempts = +this.retryAttemptsBox.value;
|
this.model.retryAttempts = this.retryAttemptsBox.value ? +this.retryAttemptsBox.value : 0;
|
||||||
this.model.retryInterval = +this.retryIntervalBox.value;
|
this.model.retryInterval = +this.retryIntervalBox.value ? +this.retryIntervalBox.value : 0;
|
||||||
this.model.failureAction = this.failureActionDropdown.value as string;
|
this.model.failureAction = this.failureActionDropdown.value as string;
|
||||||
this.model.outputFileName = this.outputFileNameBox.value;
|
this.model.outputFileName = this.outputFileNameBox.value;
|
||||||
this.model.appendToLogFile = this.appendToExistingFileCheckbox.checked;
|
this.model.appendToLogFile = this.appendToExistingFileCheckbox.checked;
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
|||||||
private static readonly PagerFridayCheckBoxLabel: string = localize('createOperator.PagerFridayCheckBox', 'Friday ');
|
private static readonly PagerFridayCheckBoxLabel: string = localize('createOperator.PagerFridayCheckBox', 'Friday ');
|
||||||
private static readonly PagerSaturdayCheckBoxLabel: string = localize('createOperator.PagerSaturdayCheckBox', 'Saturday');
|
private static readonly PagerSaturdayCheckBoxLabel: string = localize('createOperator.PagerSaturdayCheckBox', 'Saturday');
|
||||||
private static readonly PagerSundayCheckBoxLabel: string = localize('createOperator.PagerSundayCheckBox', 'Sunday');
|
private static readonly PagerSundayCheckBoxLabel: string = localize('createOperator.PagerSundayCheckBox', 'Sunday');
|
||||||
|
private static readonly WorkdayBeginLabel: string = localize('createOperator.workdayBegin', 'Workday begin');
|
||||||
|
private static readonly WorkdayEndLabel: string = localize('createOperator.workdayEnd', 'Workday end');
|
||||||
|
|
||||||
// Notifications tab strings
|
// Notifications tab strings
|
||||||
private static readonly AlertsTableLabel: string = localize('createOperator.AlertListHeading', 'Alert list');
|
private static readonly AlertsTableLabel: string = localize('createOperator.AlertListHeading', 'Alert list');
|
||||||
@@ -184,7 +186,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
|||||||
let weekdayStartInputContainer = view.modelBuilder.formContainer()
|
let weekdayStartInputContainer = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.weekdayPagerStartTimeInput,
|
component: this.weekdayPagerStartTimeInput,
|
||||||
title: 'Workday begin'
|
title: OperatorDialog.WorkdayBeginLabel
|
||||||
}]).component();
|
}]).component();
|
||||||
|
|
||||||
this.weekdayPagerEndTimeInput = view.modelBuilder.inputBox()
|
this.weekdayPagerEndTimeInput = view.modelBuilder.inputBox()
|
||||||
@@ -196,7 +198,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
|||||||
let weekdayEndInputContainer = view.modelBuilder.formContainer()
|
let weekdayEndInputContainer = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.weekdayPagerEndTimeInput,
|
component: this.weekdayPagerEndTimeInput,
|
||||||
title: 'Workday end'
|
title: OperatorDialog.WorkdayEndLabel
|
||||||
}]).component();
|
}]).component();
|
||||||
|
|
||||||
this.pagerFridayCheckBox = view.modelBuilder.checkBox()
|
this.pagerFridayCheckBox = view.modelBuilder.checkBox()
|
||||||
@@ -249,7 +251,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
|||||||
let saturdayStartInputContainer = view.modelBuilder.formContainer()
|
let saturdayStartInputContainer = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.saturdayPagerStartTimeInput,
|
component: this.saturdayPagerStartTimeInput,
|
||||||
title: 'Workday begin'
|
title: OperatorDialog.WorkdayBeginLabel
|
||||||
}]).component();
|
}]).component();
|
||||||
|
|
||||||
this.saturdayPagerEndTimeInput = view.modelBuilder.inputBox()
|
this.saturdayPagerEndTimeInput = view.modelBuilder.inputBox()
|
||||||
@@ -261,7 +263,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
|||||||
let saturdayEndInputContainer = view.modelBuilder.formContainer()
|
let saturdayEndInputContainer = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.saturdayPagerEndTimeInput,
|
component: this.saturdayPagerEndTimeInput,
|
||||||
title: 'Workday end'
|
title: OperatorDialog.WorkdayEndLabel
|
||||||
}]).component();
|
}]).component();
|
||||||
|
|
||||||
let pagerSaturdayCheckboxContainer = view.modelBuilder.flexContainer()
|
let pagerSaturdayCheckboxContainer = view.modelBuilder.flexContainer()
|
||||||
@@ -296,7 +298,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
|||||||
let sundayStartInputContainer = view.modelBuilder.formContainer()
|
let sundayStartInputContainer = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.sundayPagerStartTimeInput,
|
component: this.sundayPagerStartTimeInput,
|
||||||
title: 'Workday begin'
|
title: OperatorDialog.WorkdayBeginLabel
|
||||||
}]).component();
|
}]).component();
|
||||||
|
|
||||||
this.sundayPagerEndTimeInput = view.modelBuilder.inputBox()
|
this.sundayPagerEndTimeInput = view.modelBuilder.inputBox()
|
||||||
@@ -308,7 +310,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
|||||||
let sundayEndInputContainer = view.modelBuilder.formContainer()
|
let sundayEndInputContainer = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.sundayPagerEndTimeInput,
|
component: this.sundayPagerEndTimeInput,
|
||||||
title: 'Workday end'
|
title: OperatorDialog.WorkdayEndLabel
|
||||||
}]).component();
|
}]).component();
|
||||||
|
|
||||||
let pagerSundayCheckboxContainer = view.modelBuilder.flexContainer()
|
let pagerSundayCheckboxContainer = view.modelBuilder.flexContainer()
|
||||||
|
|||||||
@@ -4,18 +4,22 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
import * as nls from 'vscode-nls';
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { PickScheduleData } from '../data/pickScheduleData';
|
import { PickScheduleData } from '../data/pickScheduleData';
|
||||||
|
|
||||||
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
export class PickScheduleDialog {
|
export class PickScheduleDialog {
|
||||||
|
|
||||||
// TODO: localize
|
// TODO: localize
|
||||||
// Top level
|
// Top level
|
||||||
private readonly DialogTitle: string = 'Job Schedules';
|
private readonly DialogTitle: string = localize('pickSchedule.jobSchedules', 'Job Schedules');
|
||||||
private readonly OkButtonText: string = 'OK';
|
private readonly OkButtonText: string = localize('pickSchedule.ok', 'OK');
|
||||||
private readonly CancelButtonText: string = 'Cancel';
|
private readonly CancelButtonText: string = localize('pickSchedule.cancel', 'Cancel');
|
||||||
private readonly SchedulesTabText: string = 'Schedules';
|
private readonly ScheduleNameLabelText: string = localize('pickSchedule.scheduleName', 'Schedule Name');
|
||||||
|
private readonly SchedulesLabelText: string = localize('pickSchedule.schedules', 'Schedules');
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
@@ -38,7 +42,6 @@ export class PickScheduleDialog {
|
|||||||
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
||||||
this.dialog.okButton.label = this.OkButtonText;
|
this.dialog.okButton.label = this.OkButtonText;
|
||||||
this.dialog.cancelButton.label = this.CancelButtonText;
|
this.dialog.cancelButton.label = this.CancelButtonText;
|
||||||
|
|
||||||
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,17 +50,17 @@ export class PickScheduleDialog {
|
|||||||
this.schedulesTable = view.modelBuilder.table()
|
this.schedulesTable = view.modelBuilder.table()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
columns: [
|
columns: [
|
||||||
'Schedule Name'
|
this.ScheduleNameLabelText
|
||||||
],
|
],
|
||||||
data: [],
|
data: [],
|
||||||
height: 600,
|
height: '80em',
|
||||||
width: 400
|
width: '40em'
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
let formModel = view.modelBuilder.formContainer()
|
let formModel = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.schedulesTable,
|
component: this.schedulesTable,
|
||||||
title: 'Schedules'
|
title: this.SchedulesLabelText
|
||||||
}]).withLayout({ width: '100%' }).component();
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
await view.initializeModel(formModel);
|
await view.initializeModel(formModel);
|
||||||
|
|||||||
@@ -4,17 +4,21 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
import * as nls from 'vscode-nls';
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { ScheduleData } from '../data/scheduleData';
|
import { ScheduleData } from '../data/scheduleData';
|
||||||
|
|
||||||
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
export class ScheduleDialog {
|
export class ScheduleDialog {
|
||||||
|
|
||||||
// Top level
|
// Top level
|
||||||
private readonly DialogTitle: string = 'New Schedule';
|
private readonly DialogTitle: string = localize('scheduleDialog.newSchedule', 'New Schedule');
|
||||||
private readonly OkButtonText: string = 'OK';
|
private readonly OkButtonText: string = localize('scheduleDialog.ok', 'OK');
|
||||||
private readonly CancelButtonText: string = 'Cancel';
|
private readonly CancelButtonText: string = localize('scheduleDialog.cancel', 'Cancel');
|
||||||
|
private readonly ScheduleNameText: string = localize('scheduleDialog.scheduleName', 'Schedule Name');
|
||||||
|
private readonly SchedulesLabelText: string = localize('scheduleDialog.schedules', 'Schedules');
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
@@ -46,7 +50,7 @@ export class ScheduleDialog {
|
|||||||
this.schedulesTable = view.modelBuilder.table()
|
this.schedulesTable = view.modelBuilder.table()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
columns: [
|
columns: [
|
||||||
'Schedule Name'
|
this.ScheduleNameText
|
||||||
],
|
],
|
||||||
data: [],
|
data: [],
|
||||||
height: 600,
|
height: 600,
|
||||||
@@ -56,7 +60,7 @@ export class ScheduleDialog {
|
|||||||
let formModel = view.modelBuilder.formContainer()
|
let formModel = view.modelBuilder.formContainer()
|
||||||
.withFormItems([{
|
.withFormItems([{
|
||||||
component: this.schedulesTable,
|
component: this.schedulesTable,
|
||||||
title: 'Schedules'
|
title: this.SchedulesLabelText
|
||||||
}]).withLayout({ width: '100%' }).component();
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
await view.initializeModel(formModel);
|
await view.initializeModel(formModel);
|
||||||
|
|||||||
@@ -285,7 +285,6 @@ export default class MainController implements vscode.Disposable {
|
|||||||
tab1.registerContent(async (view) => {
|
tab1.registerContent(async (view) => {
|
||||||
await this.getTabContent(view, customButton1, customButton2, 400);
|
await this.getTabContent(view, customButton1, customButton2, 400);
|
||||||
});
|
});
|
||||||
|
|
||||||
sqlops.window.modelviewdialog.openDialog(dialog);
|
sqlops.window.modelviewdialog.openDialog(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,8 +134,9 @@ export abstract class ComponentBase extends Disposable implements IComponent, On
|
|||||||
if (size && typeof (size) === 'string') {
|
if (size && typeof (size) === 'string') {
|
||||||
if (size.toLowerCase().endsWith('px')) {
|
if (size.toLowerCase().endsWith('px')) {
|
||||||
return +size.replace('px', '');
|
return +size.replace('px', '');
|
||||||
|
} else if (size.toLowerCase().endsWith('em')) {
|
||||||
|
return +size.replace('em', '') * 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (!size) {
|
} else if (!size) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user