mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
New Operator, Alert and Proxy request handlers (#1846)
* Add agent dialog class * Rename agent dialog data classes * Alert dialog data updates * Create operator and proxy handlers
This commit is contained in:
79
extensions/agent/src/data/alertData.ts
Normal file
79
extensions/agent/src/data/alertData.ts
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { IAgentDialogData } from '../interfaces';
|
||||||
|
|
||||||
|
export class AlertData implements IAgentDialogData {
|
||||||
|
ownerUri: string;
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
delayBetweenResponses: number;
|
||||||
|
eventDescriptionKeyword: string;
|
||||||
|
eventSource: string;
|
||||||
|
hasNotification: number;
|
||||||
|
includeEventDescription: string;
|
||||||
|
isEnabled: boolean;
|
||||||
|
jobId: string;
|
||||||
|
jobName: string;
|
||||||
|
lastOccurrenceDate: string;
|
||||||
|
lastResponseDate: string;
|
||||||
|
messageId: number;
|
||||||
|
notificationMessage: string;
|
||||||
|
occurrenceCount: number;
|
||||||
|
performanceCondition: string;
|
||||||
|
severity: number;
|
||||||
|
databaseName: string;
|
||||||
|
countResetDate: string;
|
||||||
|
categoryName: string;
|
||||||
|
alertType: string;
|
||||||
|
wmiEventNamespace: string;
|
||||||
|
wmiEventQuery: string;
|
||||||
|
|
||||||
|
constructor(ownerUri:string) {
|
||||||
|
this.ownerUri = ownerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async initialize() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public async save() {
|
||||||
|
let agentService = await AgentUtils.getAgentService();
|
||||||
|
let result = await agentService.createAlert(this.ownerUri, this.toAgentAlertInfo());
|
||||||
|
if (!result || !result.success) {
|
||||||
|
// TODO handle error here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public toAgentAlertInfo(): sqlops.AgentAlertInfo {
|
||||||
|
return {
|
||||||
|
id: this.id,
|
||||||
|
name: this.name,
|
||||||
|
delayBetweenResponses: this.delayBetweenResponses,
|
||||||
|
eventDescriptionKeyword: this.eventDescriptionKeyword,
|
||||||
|
eventSource: this.eventSource,
|
||||||
|
hasNotification: this.hasNotification,
|
||||||
|
includeEventDescription: sqlops.NotifyMethods.none, // this.includeEventDescription,
|
||||||
|
isEnabled: this.isEnabled,
|
||||||
|
jobId: this.jobId,
|
||||||
|
jobName: this.jobName,
|
||||||
|
lastOccurrenceDate: this.lastOccurrenceDate,
|
||||||
|
lastResponseDate: this.lastResponseDate,
|
||||||
|
messageId: this.messageId,
|
||||||
|
notificationMessage: this.notificationMessage,
|
||||||
|
occurrenceCount: this.occurrenceCount,
|
||||||
|
performanceCondition: this.performanceCondition,
|
||||||
|
severity: this.severity,
|
||||||
|
databaseName: this.databaseName,
|
||||||
|
countResetDate: this.countResetDate,
|
||||||
|
categoryName: this.categoryName,
|
||||||
|
alertType: sqlops.AlertType.sqlServerEvent, //this.alertType,
|
||||||
|
wmiEventNamespace: this.wmiEventNamespace,
|
||||||
|
wmiEventQuery: this.wmiEventQuery
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
|
||||||
import { AgentUtils } from '../agentUtils';
|
|
||||||
|
|
||||||
export class CreateOperatorData {
|
|
||||||
public ownerUri: string;
|
|
||||||
private _alert: sqlops.AgentOperatorInfo;
|
|
||||||
|
|
||||||
constructor(ownerUri:string) {
|
|
||||||
this.ownerUri = ownerUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async initialize() {
|
|
||||||
let agentService = await AgentUtils.getAgentService();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public async save() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
|
||||||
import { AgentUtils } from '../agentUtils';
|
|
||||||
|
|
||||||
export class CreateProxyData {
|
|
||||||
public ownerUri: string;
|
|
||||||
private _alert: sqlops.AgentProxyInfo;
|
|
||||||
|
|
||||||
constructor(ownerUri:string) {
|
|
||||||
this.ownerUri = ownerUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async initialize() {
|
|
||||||
let agentService = await AgentUtils.getAgentService();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public async save() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import { AgentUtils } from '../agentUtils';
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { IAgentDialogData } from '../interfaces';
|
||||||
|
|
||||||
export class CreateJobData {
|
export class JobData implements IAgentDialogData {
|
||||||
|
|
||||||
private readonly JobCompletionActionCondition_Always: string = 'When the job completes';
|
private readonly JobCompletionActionCondition_Always: string = 'When the job completes';
|
||||||
private readonly JobCompletionActionCondition_OnFailure: string = 'When the job fails';
|
private readonly JobCompletionActionCondition_OnFailure: string = 'When the job fails';
|
||||||
@@ -5,8 +5,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { AgentUtils } from '../agentUtils';
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { IAgentDialogData } from '../interfaces';
|
||||||
|
|
||||||
export class CreateStepData {
|
export class JobStepData implements IAgentDialogData {
|
||||||
public ownerUri: string;
|
public ownerUri: string;
|
||||||
public jobId: string; //
|
public jobId: string; //
|
||||||
public jobName: string;
|
public jobName: string;
|
||||||
@@ -37,6 +38,9 @@ export class CreateStepData {
|
|||||||
this.ownerUri = ownerUri;
|
this.ownerUri = ownerUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async initialize() {
|
||||||
|
}
|
||||||
|
|
||||||
public async save() {
|
public async save() {
|
||||||
let agentService = await AgentUtils.getAgentService();
|
let agentService = await AgentUtils.getAgentService();
|
||||||
agentService.createJobStep(this.ownerUri, {
|
agentService.createJobStep(this.ownerUri, {
|
||||||
67
extensions/agent/src/data/operatorData.ts
Normal file
67
extensions/agent/src/data/operatorData.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { IAgentDialogData } from '../interfaces';
|
||||||
|
|
||||||
|
export class OperatorData implements IAgentDialogData {
|
||||||
|
ownerUri: string;
|
||||||
|
name: string;
|
||||||
|
id: number;
|
||||||
|
emailAddress: string;
|
||||||
|
enabled: boolean;
|
||||||
|
lastEmailDate: string;
|
||||||
|
lastNetSendDate: string;
|
||||||
|
lastPagerDate: string;
|
||||||
|
pagerAddress: string;
|
||||||
|
categoryName: string;
|
||||||
|
pagerDays: string;
|
||||||
|
saturdayPagerEndTime: string;
|
||||||
|
saturdayPagerStartTime: string;
|
||||||
|
sundayPagerEndTime: string;
|
||||||
|
sundayPagerStartTime: string;
|
||||||
|
netSendAddress: string;
|
||||||
|
weekdayPagerStartTime: string;
|
||||||
|
weekdayPagerEndTime: string;
|
||||||
|
|
||||||
|
constructor(ownerUri:string) {
|
||||||
|
this.ownerUri = ownerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async initialize() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public async save() {
|
||||||
|
let agentService = await AgentUtils.getAgentService();
|
||||||
|
let result = await agentService.createOperator(this.ownerUri, this.toAgentOperatorInfo());
|
||||||
|
if (!result || !result.success) {
|
||||||
|
// TODO handle error here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public toAgentOperatorInfo(): sqlops.AgentOperatorInfo {
|
||||||
|
return {
|
||||||
|
name: this.name,
|
||||||
|
id: this.id,
|
||||||
|
emailAddress: this.emailAddress,
|
||||||
|
enabled: this.enabled,
|
||||||
|
lastEmailDate: this.lastEmailDate,
|
||||||
|
lastNetSendDate: this.lastNetSendDate,
|
||||||
|
lastPagerDate: this.lastPagerDate,
|
||||||
|
pagerAddress: this.pagerAddress,
|
||||||
|
categoryName: this.categoryName,
|
||||||
|
pagerDays: sqlops.WeekDays.weekDays, //this.pagerDays,
|
||||||
|
saturdayPagerEndTime: this.saturdayPagerEndTime,
|
||||||
|
saturdayPagerStartTime: this.saturdayPagerStartTime,
|
||||||
|
sundayPagerEndTime: this.sundayPagerEndTime,
|
||||||
|
sundayPagerStartTime: this.sundayPagerStartTime,
|
||||||
|
netSendAddress: this.netSendAddress,
|
||||||
|
weekdayPagerStartTime: this.weekdayPagerStartTime,
|
||||||
|
weekdayPagerEndTime: this.weekdayPagerEndTime
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import { AgentUtils } from '../agentUtils';
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { IAgentDialogData } from '../interfaces';
|
||||||
|
|
||||||
export class PickScheduleData {
|
export class PickScheduleData implements IAgentDialogData {
|
||||||
public ownerUri: string;
|
public ownerUri: string;
|
||||||
public schedules: sqlops.AgentJobScheduleInfo[];
|
public schedules: sqlops.AgentJobScheduleInfo[];
|
||||||
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
||||||
|
|||||||
47
extensions/agent/src/data/proxyData.ts
Normal file
47
extensions/agent/src/data/proxyData.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { IAgentDialogData } from '../interfaces';
|
||||||
|
|
||||||
|
export class ProxyData implements IAgentDialogData {
|
||||||
|
ownerUri: string;
|
||||||
|
id: number;
|
||||||
|
accountName: string;
|
||||||
|
description: string;
|
||||||
|
credentialName: string;
|
||||||
|
credentialIdentity: string;
|
||||||
|
credentialId: number;
|
||||||
|
isEnabled: boolean;
|
||||||
|
|
||||||
|
constructor(ownerUri:string) {
|
||||||
|
this.ownerUri = ownerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async initialize() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public async save() {
|
||||||
|
let agentService = await AgentUtils.getAgentService();
|
||||||
|
let result = await agentService.createProxy(this.ownerUri, this.toAgentProxyInfo());
|
||||||
|
if (!result || !result.success) {
|
||||||
|
// TODO handle error here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public toAgentProxyInfo(): sqlops.AgentProxyInfo {
|
||||||
|
return {
|
||||||
|
id: this.id,
|
||||||
|
accountName: this.accountName,
|
||||||
|
description: this.description,
|
||||||
|
credentialName: this.credentialName,
|
||||||
|
credentialIdentity: this.credentialIdentity,
|
||||||
|
credentialId: this.credentialId,
|
||||||
|
isEnabled: this.isEnabled
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import { AgentUtils } from '../agentUtils';
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { IAgentDialogData } from '../interfaces';
|
||||||
|
|
||||||
export class CreateScheduleData {
|
export class ScheduleData implements IAgentDialogData {
|
||||||
public ownerUri: string;
|
public ownerUri: string;
|
||||||
public schedules: sqlops.AgentJobScheduleInfo[];
|
public schedules: sqlops.AgentJobScheduleInfo[];
|
||||||
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
||||||
74
extensions/agent/src/dialogs/agentDialog.ts
Normal file
74
extensions/agent/src/dialogs/agentDialog.ts
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as nls from 'vscode-nls';
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
|
import * as vscode from 'vscode';
|
||||||
|
import { IAgentDialogData } from '../interfaces';
|
||||||
|
|
||||||
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
|
export abstract class AgentDialog<T extends IAgentDialogData> {
|
||||||
|
|
||||||
|
private static readonly OkButtonText: string = localize('createAlert.OK', 'OK');
|
||||||
|
private static readonly CancelButtonText: string = localize('createAlert.Cancel', 'Cancel');
|
||||||
|
|
||||||
|
protected _onSuccess: vscode.EventEmitter<T> = new vscode.EventEmitter<T>();
|
||||||
|
public readonly onSuccess: vscode.Event<T> = this._onSuccess.event;
|
||||||
|
public dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
|
|
||||||
|
constructor(public ownerUri: string, public model: T, public title: string) {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract async updateModel();
|
||||||
|
|
||||||
|
protected abstract async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog);
|
||||||
|
|
||||||
|
public async openDialog() {
|
||||||
|
this.dialog = sqlops.window.modelviewdialog.createDialog(this.title);
|
||||||
|
|
||||||
|
await this.model.initialize();
|
||||||
|
|
||||||
|
await this.initializeDialog(this.dialog);
|
||||||
|
|
||||||
|
this.dialog.okButton.label = AgentDialog.OkButtonText;
|
||||||
|
this.dialog.okButton.onClick(async () => await this.execute());
|
||||||
|
|
||||||
|
this.dialog.cancelButton.label = AgentDialog.CancelButtonText;
|
||||||
|
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
||||||
|
|
||||||
|
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async execute() {
|
||||||
|
this.updateModel();
|
||||||
|
let success = await this.model.save();
|
||||||
|
if (success) {
|
||||||
|
this._onSuccess.fire(this.model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async cancel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected getActualConditionValue(checkbox: sqlops.CheckBoxComponent, dropdown: sqlops.DropDownComponent): sqlops.JobCompletionActionCondition {
|
||||||
|
return checkbox.checked ? Number(this.getDropdownValue(dropdown)) : sqlops.JobCompletionActionCondition.Never;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected getDropdownValue(dropdown: sqlops.DropDownComponent): string {
|
||||||
|
return (typeof dropdown.value === 'string') ? dropdown.value : dropdown.value.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected setConditionDropdownSelectedValue(dropdown: sqlops.DropDownComponent, selectedValue: number) {
|
||||||
|
let idx: number = 0;
|
||||||
|
for (idx = 0; idx < dropdown.values.length; idx++) {
|
||||||
|
if (Number((<sqlops.CategoryValue>dropdown.values[idx]).name) === selectedValue) {
|
||||||
|
dropdown.value = dropdown.values[idx];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,20 +5,18 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
|
||||||
import * as vscode from 'vscode';
|
|
||||||
import { AgentUtils } from '../agentUtils';
|
|
||||||
import { CreateAlertData } from '../data/createAlertData';
|
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
|
import { AgentDialog } from './agentDialog';
|
||||||
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { AlertData } from '../data/alertData';
|
||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
export class AlertDialog {
|
export class AlertDialog extends AgentDialog<AlertData> {
|
||||||
|
|
||||||
// Top level
|
// Top level
|
||||||
private static readonly DialogTitle: string = localize('createAlert.createAlert', 'Create Alert');
|
private static readonly DialogTitle: string = localize('createAlert.createAlert', 'Create Alert');
|
||||||
private static readonly OkButtonText: string = localize('createAlert.OK', 'OK');
|
|
||||||
private static readonly CancelButtonText: string = localize('createAlert.Cancel', 'Cancel');
|
|
||||||
private static readonly GeneralTabText: string = localize('createAlert.General', 'General');
|
private static readonly GeneralTabText: string = localize('createAlert.General', 'General');
|
||||||
private static readonly ResponseTabText: string = localize('createAlert.Response', 'Response');
|
private static readonly ResponseTabText: string = localize('createAlert.Response', 'Response');
|
||||||
private static readonly OptionsTabText: string = localize('createAlert.Options', 'Options');
|
private static readonly OptionsTabText: string = localize('createAlert.Options', 'Options');
|
||||||
@@ -115,7 +113,6 @@ export class AlertDialog {
|
|||||||
private static readonly DelaySecondsTextBoxLabel: string = localize('createAlert.DelaySeconds', 'Delay Seconds');
|
private static readonly DelaySecondsTextBoxLabel: string = localize('createAlert.DelaySeconds', 'Delay Seconds');
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
|
||||||
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;
|
||||||
@@ -144,21 +141,12 @@ export class AlertDialog {
|
|||||||
private delayMinutesTextBox: sqlops.InputBoxComponent;
|
private delayMinutesTextBox: sqlops.InputBoxComponent;
|
||||||
private delaySecondsTextBox: sqlops.InputBoxComponent;
|
private delaySecondsTextBox: sqlops.InputBoxComponent;
|
||||||
|
|
||||||
|
constructor(ownerUri: string) {
|
||||||
private model: CreateAlertData;
|
super(ownerUri, new AlertData(ownerUri), AlertDialog.DialogTitle);
|
||||||
|
|
||||||
private _onSuccess: vscode.EventEmitter<CreateAlertData> = new vscode.EventEmitter<CreateAlertData>();
|
|
||||||
public readonly onSuccess: vscode.Event<CreateAlertData> = this._onSuccess.event;
|
|
||||||
|
|
||||||
constructor(public ownerUri: string) {
|
|
||||||
this.model = new CreateAlertData(ownerUri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async showDialog() {
|
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
|
||||||
|
|
||||||
let databases = await AgentUtils.getDatabases(this.ownerUri);
|
let databases = await AgentUtils.getDatabases(this.ownerUri);
|
||||||
await this.model.initialize();
|
|
||||||
this.dialog = sqlops.window.modelviewdialog.createDialog(AlertDialog.DialogTitle);
|
|
||||||
this.generalTab = sqlops.window.modelviewdialog.createTab(AlertDialog.GeneralTabText);
|
this.generalTab = sqlops.window.modelviewdialog.createTab(AlertDialog.GeneralTabText);
|
||||||
this.responseTab = sqlops.window.modelviewdialog.createTab(AlertDialog.ResponseTabText);
|
this.responseTab = sqlops.window.modelviewdialog.createTab(AlertDialog.ResponseTabText);
|
||||||
this.optionsTab = sqlops.window.modelviewdialog.createTab(AlertDialog.OptionsTabText);
|
this.optionsTab = sqlops.window.modelviewdialog.createTab(AlertDialog.OptionsTabText);
|
||||||
@@ -167,13 +155,7 @@ export class AlertDialog {
|
|||||||
this.initializeResponseTab();
|
this.initializeResponseTab();
|
||||||
this.initializeOptionsTab();
|
this.initializeOptionsTab();
|
||||||
|
|
||||||
this.dialog.content = [this.generalTab, this.responseTab, this.optionsTab];
|
dialog.content = [this.generalTab, this.responseTab, this.optionsTab];
|
||||||
this.dialog.okButton.onClick(async () => await this.execute());
|
|
||||||
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
|
||||||
this.dialog.okButton.label = AlertDialog.OkButtonText;
|
|
||||||
this.dialog.cancelButton.label = AlertDialog.CancelButtonText;
|
|
||||||
|
|
||||||
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private initializeGeneralTab(databases: string[]) {
|
private initializeGeneralTab(databases: string[]) {
|
||||||
@@ -223,6 +205,9 @@ export class AlertDialog {
|
|||||||
}, {
|
}, {
|
||||||
component: this.databaseDropDown,
|
component: this.databaseDropDown,
|
||||||
title: AlertDialog.DatabaseLabel
|
title: AlertDialog.DatabaseLabel
|
||||||
|
}, {
|
||||||
|
component: this.severityDropDown,
|
||||||
|
title: AlertDialog.SeverityLabel
|
||||||
}, {
|
}, {
|
||||||
component: this.raiseAlertMessageCheckBox,
|
component: this.raiseAlertMessageCheckBox,
|
||||||
title: AlertDialog.RaiseIfMessageContainsLabel
|
title: AlertDialog.RaiseIfMessageContainsLabel
|
||||||
@@ -335,15 +320,29 @@ export class AlertDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async execute() {
|
private getSeverityNumber(): number {
|
||||||
this.updateModel();
|
let selected = this.getDropdownValue(this.severityDropDown);
|
||||||
await this.model.save();
|
let severityNumber: number = 0;
|
||||||
this._onSuccess.fire(this.model);
|
if (selected) {
|
||||||
|
let index = AlertDialog.AlertSeverities.indexOf(selected);
|
||||||
|
if (index >= 0) {
|
||||||
|
severityNumber = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return severityNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async cancel() {
|
protected updateModel() {
|
||||||
}
|
this.model.name = this.nameTextBox.value;
|
||||||
|
this.model.isEnabled = this.enabledCheckBox.checked;
|
||||||
|
|
||||||
private updateModel() {
|
this.model.alertType = this.getDropdownValue(this.typeDropDown);
|
||||||
|
this.model.databaseName = this.getDropdownValue(this.databaseDropDown);
|
||||||
|
this.model.severity = this.getSeverityNumber();
|
||||||
|
|
||||||
|
let raiseIfError = this.raiseAlertMessageCheckBox.checked;
|
||||||
|
if (raiseIfError) {
|
||||||
|
let messageText = this.raiseAlertMessageTextBox.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,18 +4,17 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
'use strict';
|
'use strict';
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import { CreateJobData } from '../data/createJobData';
|
import { JobData } from '../data/jobData';
|
||||||
import { JobStepDialog } from './jobStepDialog';
|
import { JobStepDialog } from './jobStepDialog';
|
||||||
import { PickScheduleDialog } from './pickScheduleDialog';
|
import { PickScheduleDialog } from './pickScheduleDialog';
|
||||||
import { AlertDialog } from './alertDialog';
|
import { AlertDialog } from './alertDialog';
|
||||||
|
import { AgentDialog } from './agentDialog';
|
||||||
|
|
||||||
export class JobDialog {
|
export class JobDialog extends AgentDialog<JobData> {
|
||||||
|
|
||||||
// TODO: localize
|
// TODO: localize
|
||||||
// Top level
|
// Top level
|
||||||
private readonly DialogTitle: string = 'New Job';
|
private static readonly DialogTitle: string = 'New Job';
|
||||||
private readonly OkButtonText: string = 'OK';
|
|
||||||
private readonly CancelButtonText: string = 'Cancel';
|
|
||||||
private readonly GeneralTabText: string = 'General';
|
private readonly GeneralTabText: string = 'General';
|
||||||
private readonly StepsTabText: string = 'Steps';
|
private readonly StepsTabText: string = 'Steps';
|
||||||
private readonly SchedulesTabText: string = 'Schedules';
|
private readonly SchedulesTabText: string = 'Schedules';
|
||||||
@@ -57,7 +56,6 @@ export class JobDialog {
|
|||||||
private readonly NewAlertButtonString: string = 'New Alert';
|
private readonly NewAlertButtonString: string = 'New Alert';
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
|
||||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
private stepsTab: sqlops.window.modelviewdialog.DialogTab;
|
private stepsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
private alertsTab: sqlops.window.modelviewdialog.DialogTab;
|
private alertsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
@@ -99,15 +97,11 @@ export class JobDialog {
|
|||||||
private alertsTable: sqlops.TableComponent;
|
private alertsTable: sqlops.TableComponent;
|
||||||
private newAlertButton: sqlops.ButtonComponent;
|
private newAlertButton: sqlops.ButtonComponent;
|
||||||
|
|
||||||
private model: CreateJobData;
|
|
||||||
|
|
||||||
constructor(ownerUri: string) {
|
constructor(ownerUri: string) {
|
||||||
this.model = new CreateJobData(ownerUri);
|
super(ownerUri, new JobData(ownerUri), JobDialog.DialogTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async showDialog() {
|
protected async initializeDialog() {
|
||||||
await this.model.initialize();
|
|
||||||
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
|
|
||||||
this.generalTab = sqlops.window.modelviewdialog.createTab(this.GeneralTabText);
|
this.generalTab = sqlops.window.modelviewdialog.createTab(this.GeneralTabText);
|
||||||
this.stepsTab = sqlops.window.modelviewdialog.createTab(this.StepsTabText);
|
this.stepsTab = sqlops.window.modelviewdialog.createTab(this.StepsTabText);
|
||||||
this.alertsTab = sqlops.window.modelviewdialog.createTab(this.AlertsTabText);
|
this.alertsTab = sqlops.window.modelviewdialog.createTab(this.AlertsTabText);
|
||||||
@@ -119,10 +113,6 @@ export class JobDialog {
|
|||||||
this.initializeSchedulesTab();
|
this.initializeSchedulesTab();
|
||||||
this.initializeNotificationsTab();
|
this.initializeNotificationsTab();
|
||||||
this.dialog.content = [this.generalTab, this.stepsTab, this.schedulesTab, this.alertsTab, this.notificationsTab];
|
this.dialog.content = [this.generalTab, this.stepsTab, this.schedulesTab, this.alertsTab, this.notificationsTab];
|
||||||
this.dialog.okButton.onClick(async () => await this.execute());
|
|
||||||
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
|
||||||
this.dialog.okButton.label = this.OkButtonText;
|
|
||||||
this.dialog.cancelButton.label = this.CancelButtonText;
|
|
||||||
|
|
||||||
this.dialog.registerCloseValidator(() => {
|
this.dialog.registerCloseValidator(() => {
|
||||||
this.updateModel();
|
this.updateModel();
|
||||||
@@ -134,8 +124,6 @@ export class JobDialog {
|
|||||||
|
|
||||||
return validationResult.valid;
|
return validationResult.valid;
|
||||||
});
|
});
|
||||||
|
|
||||||
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private initializeGeneralTab() {
|
private initializeGeneralTab() {
|
||||||
@@ -250,7 +238,7 @@ export class JobDialog {
|
|||||||
let alertDialog = new AlertDialog(this.model.ownerUri);
|
let alertDialog = new AlertDialog(this.model.ownerUri);
|
||||||
alertDialog.onSuccess((dialogModel) => {
|
alertDialog.onSuccess((dialogModel) => {
|
||||||
});
|
});
|
||||||
alertDialog.showDialog();
|
alertDialog.openDialog();
|
||||||
});
|
});
|
||||||
|
|
||||||
let formModel = view.modelBuilder.formContainer()
|
let formModel = view.modelBuilder.formContainer()
|
||||||
@@ -421,34 +409,7 @@ export class JobDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async execute() {
|
protected updateModel() {
|
||||||
this.updateModel();
|
|
||||||
await this.model.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async cancel() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private getActualConditionValue(checkbox: sqlops.CheckBoxComponent, dropdown: sqlops.DropDownComponent): sqlops.JobCompletionActionCondition {
|
|
||||||
return checkbox.checked ? Number(this.getDropdownValue(dropdown)) : sqlops.JobCompletionActionCondition.Never;
|
|
||||||
}
|
|
||||||
|
|
||||||
private getDropdownValue(dropdown: sqlops.DropDownComponent): string {
|
|
||||||
return (typeof dropdown.value === 'string') ? dropdown.value : dropdown.value.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
private setConditionDropdownSelectedValue(dropdown: sqlops.DropDownComponent, selectedValue: number) {
|
|
||||||
let idx: number = 0;
|
|
||||||
for (idx = 0; idx < dropdown.values.length; idx++) {
|
|
||||||
if (Number((<sqlops.CategoryValue>dropdown.values[idx]).name) === selectedValue) {
|
|
||||||
dropdown.value = dropdown.values[idx];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private updateModel() {
|
|
||||||
this.model.name = this.nameTextBox.value;
|
this.model.name = this.nameTextBox.value;
|
||||||
this.model.owner = this.ownerTextBox.value;
|
this.model.owner = this.ownerTextBox.value;
|
||||||
this.model.enabled = this.enabledCheckBox.checked;
|
this.model.enabled = this.enabledCheckBox.checked;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { CreateStepData } from '../data/createStepData';
|
import { JobStepData } from '../data/jobStepData';
|
||||||
import { AgentUtils } from '../agentUtils';
|
import { AgentUtils } from '../agentUtils';
|
||||||
import { CreateJobData } from '../data/createJobData';
|
import { JobData } from '../data/jobData';
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
export class JobStepDialog {
|
export class JobStepDialog {
|
||||||
@@ -75,8 +75,8 @@ export class JobStepDialog {
|
|||||||
private logToTableCheckbox: sqlops.CheckBoxComponent;
|
private logToTableCheckbox: sqlops.CheckBoxComponent;
|
||||||
|
|
||||||
private fileBrowserTree: sqlops.FileBrowserTreeComponent;
|
private fileBrowserTree: sqlops.FileBrowserTreeComponent;
|
||||||
private jobModel: CreateJobData;
|
private jobModel: JobData;
|
||||||
private model: CreateStepData;
|
private model: JobStepData;
|
||||||
private ownerUri: string;
|
private ownerUri: string;
|
||||||
private jobName: string;
|
private jobName: string;
|
||||||
private server: string;
|
private server: string;
|
||||||
@@ -87,9 +87,9 @@ export class JobStepDialog {
|
|||||||
jobName: string,
|
jobName: string,
|
||||||
server: string,
|
server: string,
|
||||||
stepId: number,
|
stepId: number,
|
||||||
jobModel?: CreateJobData
|
jobModel?: JobData
|
||||||
) {
|
) {
|
||||||
this.model = new CreateStepData(ownerUri);
|
this.model = new JobStepData(ownerUri);
|
||||||
this.stepId = stepId;
|
this.stepId = stepId;
|
||||||
this.ownerUri = ownerUri;
|
this.ownerUri = ownerUri;
|
||||||
this.jobName = jobName;
|
this.jobName = jobName;
|
||||||
|
|||||||
@@ -7,17 +7,16 @@
|
|||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { CreateOperatorData } from '../data/createOperatorData';
|
import { OperatorData } from '../data/operatorData';
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
|
import { AgentDialog } from './agentDialog';
|
||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
export class OperatorDialog {
|
export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||||
|
|
||||||
// Top level
|
// Top level
|
||||||
private static readonly DialogTitle: string = localize('createOperator.createOperator', 'Create Operator');
|
private static readonly DialogTitle: string = localize('createOperator.createOperator', 'Create Operator');
|
||||||
private static readonly OkButtonText: string = localize('createOperator.OK', 'OK');
|
|
||||||
private static readonly CancelButtonText: string = localize('createOperator.Cancel', 'Cancel');
|
|
||||||
private static readonly GeneralTabText: string = localize('createOperator.General', 'General');
|
private static readonly GeneralTabText: string = localize('createOperator.General', 'General');
|
||||||
private static readonly NotificationsTabText: string = localize('createOperator.Notifications', 'Notifications');
|
private static readonly NotificationsTabText: string = localize('createOperator.Notifications', 'Notifications');
|
||||||
|
|
||||||
@@ -41,7 +40,6 @@ export class OperatorDialog {
|
|||||||
private static readonly AlertPagerColumnLabel: string = localize('createOperator.AlertPagerColumnLabel', 'Pager');
|
private static readonly AlertPagerColumnLabel: string = localize('createOperator.AlertPagerColumnLabel', 'Pager');
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
|
||||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
private notificationsTab: sqlops.window.modelviewdialog.DialogTab;
|
private notificationsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
|
||||||
@@ -61,18 +59,11 @@ export class OperatorDialog {
|
|||||||
// Notification tab controls
|
// Notification tab controls
|
||||||
private alertsTable: sqlops.TableComponent;
|
private alertsTable: sqlops.TableComponent;
|
||||||
|
|
||||||
private model: CreateOperatorData;
|
|
||||||
|
|
||||||
private _onSuccess: vscode.EventEmitter<CreateOperatorData> = new vscode.EventEmitter<CreateOperatorData>();
|
|
||||||
public readonly onSuccess: vscode.Event<CreateOperatorData> = this._onSuccess.event;
|
|
||||||
|
|
||||||
constructor(ownerUri: string) {
|
constructor(ownerUri: string) {
|
||||||
this.model = new CreateOperatorData(ownerUri);
|
super(ownerUri, new OperatorData(ownerUri), OperatorDialog.DialogTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async showDialog() {
|
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
|
||||||
await this.model.initialize();
|
|
||||||
this.dialog = sqlops.window.modelviewdialog.createDialog(OperatorDialog.DialogTitle);
|
|
||||||
this.generalTab = sqlops.window.modelviewdialog.createTab(OperatorDialog.GeneralTabText);
|
this.generalTab = sqlops.window.modelviewdialog.createTab(OperatorDialog.GeneralTabText);
|
||||||
this.notificationsTab = sqlops.window.modelviewdialog.createTab(OperatorDialog.NotificationsTabText);
|
this.notificationsTab = sqlops.window.modelviewdialog.createTab(OperatorDialog.NotificationsTabText);
|
||||||
|
|
||||||
@@ -80,12 +71,6 @@ export class OperatorDialog {
|
|||||||
this.initializeNotificationTab();
|
this.initializeNotificationTab();
|
||||||
|
|
||||||
this.dialog.content = [this.generalTab, this.notificationsTab];
|
this.dialog.content = [this.generalTab, this.notificationsTab];
|
||||||
this.dialog.okButton.onClick(async () => await this.execute());
|
|
||||||
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
|
||||||
this.dialog.okButton.label = OperatorDialog.OkButtonText;
|
|
||||||
this.dialog.cancelButton.label = OperatorDialog.CancelButtonText;
|
|
||||||
|
|
||||||
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private initializeGeneralTab() {
|
private initializeGeneralTab() {
|
||||||
@@ -202,15 +187,9 @@ export class OperatorDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async execute() {
|
protected updateModel() {
|
||||||
this.updateModel();
|
this.model.name = this.nameTextBox.value;
|
||||||
await this.model.save();
|
this.model.enabled = this.enabledCheckBox.checked;
|
||||||
this._onSuccess.fire(this.model);
|
this.model.emailAddress = this.emailNameTextBox.value;
|
||||||
}
|
|
||||||
|
|
||||||
private async cancel() {
|
|
||||||
}
|
|
||||||
|
|
||||||
private updateModel() {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,19 +5,17 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
|
||||||
import * as vscode from 'vscode';
|
|
||||||
import { CreateProxyData } from '../data/createProxyData';
|
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
|
import { AgentDialog } from './agentDialog';
|
||||||
|
import { ProxyData } from '../data/proxyData';
|
||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
export class ProxyDialog {
|
export class ProxyDialog extends AgentDialog<ProxyData> {
|
||||||
|
|
||||||
// Top level
|
// Top level
|
||||||
private static readonly DialogTitle: string = localize('createProxy.createAlert', 'Create Alert');
|
private static readonly DialogTitle: string = localize('createProxy.createAlert', 'Create Alert');
|
||||||
private static readonly OkButtonText: string = localize('createProxy.OK', 'OK');
|
|
||||||
private static readonly CancelButtonText: string = localize('createProxy.Cancel', 'Cancel');
|
|
||||||
private static readonly GeneralTabText: string = localize('createProxy.General', 'General');
|
private static readonly GeneralTabText: string = localize('createProxy.General', 'General');
|
||||||
|
|
||||||
// General tab strings
|
// General tab strings
|
||||||
@@ -28,7 +26,6 @@ export class ProxyDialog {
|
|||||||
private static readonly SubsystemNameColumnLabel: string = localize('createProxy.SubsystemName', 'Subsystem');
|
private static readonly SubsystemNameColumnLabel: string = localize('createProxy.SubsystemName', 'Subsystem');
|
||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
|
||||||
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
|
||||||
// General tab controls
|
// General tab controls
|
||||||
@@ -37,29 +34,16 @@ export class ProxyDialog {
|
|||||||
private descriptionTextBox: sqlops.InputBoxComponent;
|
private descriptionTextBox: sqlops.InputBoxComponent;
|
||||||
private subsystemsTable: sqlops.TableComponent;
|
private subsystemsTable: sqlops.TableComponent;
|
||||||
|
|
||||||
private model: CreateProxyData;
|
|
||||||
|
|
||||||
private _onSuccess: vscode.EventEmitter<CreateProxyData> = new vscode.EventEmitter<CreateProxyData>();
|
|
||||||
public readonly onSuccess: vscode.Event<CreateProxyData> = this._onSuccess.event;
|
|
||||||
|
|
||||||
constructor(ownerUri: string) {
|
constructor(ownerUri: string) {
|
||||||
this.model = new CreateProxyData(ownerUri);
|
super(ownerUri, new ProxyData(ownerUri), ProxyDialog.DialogTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async showDialog() {
|
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
|
||||||
await this.model.initialize();
|
|
||||||
this.dialog = sqlops.window.modelviewdialog.createDialog(ProxyDialog.DialogTitle);
|
|
||||||
this.generalTab = sqlops.window.modelviewdialog.createTab(ProxyDialog.GeneralTabText);
|
this.generalTab = sqlops.window.modelviewdialog.createTab(ProxyDialog.GeneralTabText);
|
||||||
|
|
||||||
this.initializeGeneralTab();
|
this.initializeGeneralTab();
|
||||||
|
|
||||||
this.dialog.content = [this.generalTab];
|
this.dialog.content = [this.generalTab];
|
||||||
this.dialog.okButton.onClick(async () => await this.execute());
|
|
||||||
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
|
||||||
this.dialog.okButton.label = ProxyDialog.OkButtonText;
|
|
||||||
this.dialog.cancelButton.label = ProxyDialog.CancelButtonText;
|
|
||||||
|
|
||||||
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private initializeGeneralTab() {
|
private initializeGeneralTab() {
|
||||||
@@ -99,15 +83,9 @@ export class ProxyDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async execute() {
|
protected updateModel() {
|
||||||
this.updateModel();
|
this.model.accountName = this.proxyNameTextBox.value;
|
||||||
await this.model.save();
|
this.model.credentialName = this.credentialNameTextBox.value;
|
||||||
this._onSuccess.fire(this.model);
|
this.model.description = this.descriptionTextBox.value;
|
||||||
}
|
|
||||||
|
|
||||||
private async cancel() {
|
|
||||||
}
|
|
||||||
|
|
||||||
private updateModel() {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { CreateScheduleData } from '../data/createScheduleData';
|
import { ScheduleData } from '../data/scheduleData';
|
||||||
|
|
||||||
export class ScheduleDialog {
|
export class ScheduleDialog {
|
||||||
|
|
||||||
@@ -20,13 +20,13 @@ export class ScheduleDialog {
|
|||||||
private dialog: sqlops.window.modelviewdialog.Dialog;
|
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
private schedulesTable: sqlops.TableComponent;
|
private schedulesTable: sqlops.TableComponent;
|
||||||
|
|
||||||
private model: CreateScheduleData;
|
private model: ScheduleData;
|
||||||
|
|
||||||
private _onSuccess: vscode.EventEmitter<CreateScheduleData> = new vscode.EventEmitter<CreateScheduleData>();
|
private _onSuccess: vscode.EventEmitter<ScheduleData> = new vscode.EventEmitter<ScheduleData>();
|
||||||
public readonly onSuccess: vscode.Event<CreateScheduleData> = this._onSuccess.event;
|
public readonly onSuccess: vscode.Event<ScheduleData> = this._onSuccess.event;
|
||||||
|
|
||||||
constructor(ownerUri: string) {
|
constructor(ownerUri: string) {
|
||||||
this.model = new CreateScheduleData(ownerUri);
|
this.model = new ScheduleData(ownerUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async showDialog() {
|
public async showDialog() {
|
||||||
|
|||||||
@@ -4,22 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
export interface IAgentDialogData {
|
||||||
import { AgentUtils } from '../agentUtils';
|
initialize(): void;
|
||||||
|
save(): void;
|
||||||
export class CreateAlertData {
|
|
||||||
public ownerUri: string;
|
|
||||||
private _alert: sqlops.AgentAlertInfo;
|
|
||||||
|
|
||||||
constructor(ownerUri:string) {
|
|
||||||
this.ownerUri = ownerUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async initialize() {
|
|
||||||
let agentService = await AgentUtils.getAgentService();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public async save() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ export class MainController {
|
|||||||
public activate(): void {
|
public activate(): void {
|
||||||
vscode.commands.registerCommand('agent.openCreateJobDialog', (ownerUri: string) => {
|
vscode.commands.registerCommand('agent.openCreateJobDialog', (ownerUri: string) => {
|
||||||
let dialog = new JobDialog(ownerUri);
|
let dialog = new JobDialog(ownerUri);
|
||||||
dialog.showDialog();
|
dialog.openDialog();
|
||||||
});
|
});
|
||||||
vscode.commands.registerCommand('agent.openNewStepDialog', (ownerUri: string, jobId: string, server: string, stepId: number) => {
|
vscode.commands.registerCommand('agent.openNewStepDialog', (ownerUri: string, jobId: string, server: string, stepId: number) => {
|
||||||
let dialog = new JobStepDialog(ownerUri, jobId, server, stepId);
|
let dialog = new JobStepDialog(ownerUri, jobId, server, stepId);
|
||||||
@@ -40,15 +40,15 @@ export class MainController {
|
|||||||
});
|
});
|
||||||
vscode.commands.registerCommand('agent.openCreateAlertDialog', (ownerUri: string) => {
|
vscode.commands.registerCommand('agent.openCreateAlertDialog', (ownerUri: string) => {
|
||||||
let dialog = new AlertDialog(ownerUri);
|
let dialog = new AlertDialog(ownerUri);
|
||||||
dialog.showDialog();
|
dialog.openDialog();
|
||||||
});
|
});
|
||||||
vscode.commands.registerCommand('agent.openCreateOperatorDialog', (ownerUri: string) => {
|
vscode.commands.registerCommand('agent.openCreateOperatorDialog', (ownerUri: string) => {
|
||||||
let dialog = new OperatorDialog(ownerUri);
|
let dialog = new OperatorDialog(ownerUri);
|
||||||
dialog.showDialog();
|
dialog.openDialog();
|
||||||
});
|
});
|
||||||
vscode.commands.registerCommand('agent.openCreateProxyDialog', (ownerUri: string) => {
|
vscode.commands.registerCommand('agent.openCreateProxyDialog', (ownerUri: string) => {
|
||||||
let dialog = new ProxyDialog(ownerUri);
|
let dialog = new ProxyDialog(ownerUri);
|
||||||
dialog.showDialog();
|
dialog.openDialog();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import * as assert from 'assert';
|
|||||||
import 'mocha';
|
import 'mocha';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import { CreateJobData } from '../data/createJobData';
|
import { JobData } from '../data/jobData';
|
||||||
import { TestAgentService } from './testAgentService';
|
import { TestAgentService } from './testAgentService';
|
||||||
|
|
||||||
const testOwnerUri = 'agent://testuri';
|
const testOwnerUri = 'agent://testuri';
|
||||||
@@ -15,7 +15,7 @@ const testOwnerUri = 'agent://testuri';
|
|||||||
suite('Agent extension', () => {
|
suite('Agent extension', () => {
|
||||||
test('Create Job Data', async () => {
|
test('Create Job Data', async () => {
|
||||||
let testAgentService = new TestAgentService();
|
let testAgentService = new TestAgentService();
|
||||||
let data = new CreateJobData(testOwnerUri, testAgentService);
|
let data = new JobData(testOwnerUri, testAgentService);
|
||||||
data.save();
|
data.save();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export interface IJobActionInfo {
|
|||||||
|
|
||||||
export class JobsRefreshAction extends Action {
|
export class JobsRefreshAction extends Action {
|
||||||
public static ID = 'jobaction.refresh';
|
public static ID = 'jobaction.refresh';
|
||||||
public static LABEL = nls.localize('jobaction.refresh', "Refresh Jobs");
|
public static LABEL = nls.localize('jobaction.refresh', "Refresh");
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user