Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9baee1c22c | ||
|
|
8cb67b4f9d | ||
|
|
0cd47bc328 | ||
|
|
07fb58d5e1 | ||
|
|
2d80d5e611 | ||
|
|
4bd63b615b | ||
|
|
335f667507 | ||
|
|
1819036d7d | ||
|
|
4f76f116ac | ||
|
|
1eba7c7d2a | ||
|
|
83234dd52c | ||
|
|
bae23b7fce | ||
|
|
3db61eaa82 | ||
|
|
5cf85a0361 | ||
|
|
ffe27f5bde | ||
|
|
78bcd9d54c | ||
|
|
1a9797f0ff | ||
|
|
0de94ff8a4 | ||
|
|
472233d9a7 | ||
|
|
f69e31b0d5 | ||
|
|
60b696cc31 | ||
|
|
549037f744 | ||
|
|
ca5e1e6133 | ||
|
|
3e3ff163db | ||
|
|
ca755365ce | ||
|
|
ea979de19f | ||
|
|
473ddfcdf1 | ||
|
|
a627285a4c | ||
|
|
322847469d | ||
|
|
6c5fac997f | ||
|
|
1871fd383e | ||
|
|
f5b147ca4b | ||
|
|
9d2b206156 | ||
|
|
a372c76e07 | ||
|
|
b1ce07d3ae | ||
|
|
bc09fb30d8 | ||
|
|
c13f219318 | ||
|
|
6b018c5d06 | ||
|
|
e69158d9b2 | ||
|
|
520cfb780a | ||
|
|
e686fed209 | ||
|
|
80ab19ac23 | ||
|
|
25228fa58e | ||
|
|
676d35090f | ||
|
|
e1a36a356c | ||
|
|
3274c0b734 | ||
|
|
9c95e1289f | ||
|
|
ef29871b62 | ||
|
|
a2a87f8d2b | ||
|
|
83c01c6bcb | ||
|
|
c1d850804c | ||
|
|
6590d5f58a | ||
|
|
a225925bc4 | ||
|
|
ab39f1f44f | ||
|
|
8d89364d72 | ||
|
|
af2bc859d1 | ||
|
|
8e72fdaa52 | ||
|
|
e9661f90d0 | ||
|
|
30b111034d | ||
|
|
df18359309 | ||
|
|
03857e0afd | ||
|
|
eaf1e08752 | ||
|
|
d39ceffa94 | ||
|
|
406b171c66 | ||
|
|
6d89b9e203 | ||
|
|
733bb69d25 | ||
|
|
4609694141 | ||
|
|
3be0c5130a | ||
|
|
e50b512580 | ||
|
|
eb62d054de | ||
|
|
e870a309c0 | ||
|
|
3afd3b0ff3 | ||
|
|
e3a2ed95d4 | ||
|
|
20c4f085c8 | ||
|
|
02af7e9299 | ||
|
|
0ae9b36d93 | ||
|
|
2bbb2842e5 |
3
.vscode/settings.json
vendored
@@ -38,5 +38,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"typescript.tsdk": "node_modules/typescript/lib"
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
|
"git.ignoreLimitWarning": true
|
||||||
}
|
}
|
||||||
|
|||||||
13
CHANGELOG.md
@@ -1,5 +1,18 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## Version 0.30.6
|
||||||
|
* Release date: June 20, 2018
|
||||||
|
* Release status: Public Preview
|
||||||
|
|
||||||
|
## What's new in this version
|
||||||
|
* **SQL Server Profiler for SQL Operations Studio *Preview*** extension initial release
|
||||||
|
* The new **SQL Data Warehouse** extension includes rich customizable dashboard widgets surfacing insights to your data warehouse. This unlocks key scenarios around managing and tuning your data warehouse to ensure it is optimized for consistent performance.
|
||||||
|
* **Edit Data "Filtering and Sorting"** support
|
||||||
|
* **SQL Server Agent for SQL Operations Studio *Preview*** extension enhancements for Jobs and Job History views
|
||||||
|
* Improved **Wizard & Dialog UI Builder Framework** extensibility APIs
|
||||||
|
* Update VS Code Platform source code integrating [March 2018 (1.22)](https://code.visualstudio.com/updates/v1_22) and [April 2018 (1.23)](https://code.visualstudio.com/updates/v1_23) releases
|
||||||
|
* Fix GitHub Issues
|
||||||
|
|
||||||
## Version 0.29.3
|
## Version 0.29.3
|
||||||
* Release date: May 7, 2018
|
* Release date: May 7, 2018
|
||||||
* Release status: Public Preview
|
* Release status: Public Preview
|
||||||
|
|||||||
15
README.md
@@ -4,16 +4,16 @@
|
|||||||
|
|
||||||
SQL Operations Studio is a data management tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.
|
SQL Operations Studio is a data management tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.
|
||||||
|
|
||||||
**Download SQL Operations Studio May Public Preview**
|
**Download SQL Operations Studio June Public Preview**
|
||||||
|
|
||||||
Platform | Link
|
Platform | Link
|
||||||
-- | --
|
-- | --
|
||||||
Windows Setup Installer | https://go.microsoft.com/fwlink/?linkid=873386
|
Windows Setup Installer | https://go.microsoft.com/fwlink/?linkid=875602
|
||||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=873387
|
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=875603
|
||||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=873388
|
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=875604
|
||||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=873389
|
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=875605
|
||||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=873390
|
Linux RPM | https://go.microsoft.com/fwlink/?linkid=875606
|
||||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=873391
|
Linux DEB | https://go.microsoft.com/fwlink/?linkid=875607
|
||||||
|
|
||||||
Go to our [download page](https://aka.ms/sqlopsstudio) for more specific instructions.
|
Go to our [download page](https://aka.ms/sqlopsstudio) for more specific instructions.
|
||||||
|
|
||||||
@@ -61,6 +61,7 @@ The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.micro
|
|||||||
## Contributions and "thank you"
|
## Contributions and "thank you"
|
||||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||||
|
|
||||||
|
* lanceklinger `Fix for double clicking column handle in results table #1504`
|
||||||
* westerncj for `Removed duplicate contribution from README.md (#753)`
|
* westerncj for `Removed duplicate contribution from README.md (#753)`
|
||||||
* ntovas for `Fix for duplicate extensions shown in "Save File" dialog. (#779)`
|
* ntovas for `Fix for duplicate extensions shown in "Save File" dialog. (#779)`
|
||||||
* SebastianPfliegel for `Add cursor snippet (#475)`
|
* SebastianPfliegel for `Add cursor snippet (#475)`
|
||||||
|
|||||||
38
extensions/agent/client/src/agentUtils.ts
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
|
|
||||||
|
export class AgentUtils {
|
||||||
|
|
||||||
|
private static _agentService: sqlops.AgentServicesProvider;
|
||||||
|
private static _connectionService: sqlops.ConnectionProvider;
|
||||||
|
private static _queryProvider: sqlops.QueryProvider;
|
||||||
|
|
||||||
|
public static async getAgentService(): Promise<sqlops.AgentServicesProvider> {
|
||||||
|
if (!AgentUtils._agentService) {
|
||||||
|
let currentConnection = await sqlops.connection.getCurrentConnection();
|
||||||
|
this._agentService = sqlops.dataprotocol.getProvider<sqlops.AgentServicesProvider>(currentConnection.providerName, sqlops.DataProviderType.AgentServicesProvider);
|
||||||
|
}
|
||||||
|
return AgentUtils._agentService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async getDatabases(ownerUri: string): Promise<string[]> {
|
||||||
|
if (!AgentUtils._connectionService) {
|
||||||
|
let currentConnection = await sqlops.connection.getCurrentConnection();
|
||||||
|
this._connectionService = sqlops.dataprotocol.getProvider<sqlops.ConnectionProvider>(currentConnection.providerName, sqlops.DataProviderType.ConnectionProvider);
|
||||||
|
}
|
||||||
|
return AgentUtils._connectionService.listDatabases(ownerUri).then(result => {
|
||||||
|
if (result && result.databaseNames && result.databaseNames.length > 0) {
|
||||||
|
return result.databaseNames;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async getQueryProvider(): Promise<sqlops.QueryProvider> {
|
||||||
|
if (!AgentUtils._queryProvider) {
|
||||||
|
let currentConnection = await sqlops.connection.getCurrentConnection();
|
||||||
|
this._queryProvider = sqlops.dataprotocol.getProvider<sqlops.QueryProvider>(currentConnection.providerName, sqlops.DataProviderType.QueryProvider);
|
||||||
|
}
|
||||||
|
return this._queryProvider;
|
||||||
|
}
|
||||||
|
}
|
||||||
25
extensions/agent/client/src/data/createAlertData.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 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() {
|
||||||
|
}
|
||||||
|
}
|
||||||
150
extensions/agent/client/src/data/createJobData.ts
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 CreateJobData {
|
||||||
|
|
||||||
|
private readonly JobCompletionActionCondition_Always: string = 'When the job completes';
|
||||||
|
private readonly JobCompletionActionCondition_OnFailure: string = 'When the job fails';
|
||||||
|
private readonly JobCompletionActionCondition_OnSuccess: string = 'When the job succeeds';
|
||||||
|
|
||||||
|
// Error Messages
|
||||||
|
private readonly CreateJobErrorMessage_NameIsEmpty = 'Job name must be provided';
|
||||||
|
|
||||||
|
private _ownerUri: string;
|
||||||
|
private _jobCategories: string[];
|
||||||
|
private _operators: string[];
|
||||||
|
private _agentService: sqlops.AgentServicesProvider;
|
||||||
|
private _defaultOwner: string;
|
||||||
|
private _jobCompletionActionConditions: sqlops.CategoryValue[];
|
||||||
|
|
||||||
|
public name: string;
|
||||||
|
public enabled: boolean = true;
|
||||||
|
public description: string;
|
||||||
|
public category: string;
|
||||||
|
public categoryId: number;
|
||||||
|
public owner: string;
|
||||||
|
public emailLevel: sqlops.JobCompletionActionCondition = sqlops.JobCompletionActionCondition.OnFailure;
|
||||||
|
public pageLevel: sqlops.JobCompletionActionCondition = sqlops.JobCompletionActionCondition.OnFailure;
|
||||||
|
public eventLogLevel: sqlops.JobCompletionActionCondition = sqlops.JobCompletionActionCondition.OnFailure;
|
||||||
|
public deleteLevel: sqlops.JobCompletionActionCondition = sqlops.JobCompletionActionCondition.OnSuccess;
|
||||||
|
public operatorToEmail: string;
|
||||||
|
public operatorToPage: string;
|
||||||
|
public jobSteps: sqlops.AgentJobStepInfo[];
|
||||||
|
public jobSchedules: sqlops.AgentJobScheduleInfo[];
|
||||||
|
public alerts: sqlops.AgentAlertInfo[];
|
||||||
|
|
||||||
|
constructor(ownerUri: string) {
|
||||||
|
this._ownerUri = ownerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get jobCategories(): string[] {
|
||||||
|
return this._jobCategories;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get operators(): string[] {
|
||||||
|
return this._operators;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get ownerUri(): string {
|
||||||
|
return this._ownerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get defaultOwner(): string {
|
||||||
|
return this._defaultOwner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get JobCompletionActionConditions(): sqlops.CategoryValue[] {
|
||||||
|
return this._jobCompletionActionConditions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async initialize() {
|
||||||
|
this._agentService = await AgentUtils.getAgentService();
|
||||||
|
let jobDefaults = await this._agentService.getJobDefaults(this.ownerUri);
|
||||||
|
if (jobDefaults && jobDefaults.success) {
|
||||||
|
this._jobCategories = jobDefaults.categories.map((cat) => {
|
||||||
|
return cat.name;
|
||||||
|
});
|
||||||
|
|
||||||
|
this._defaultOwner = jobDefaults.owner;
|
||||||
|
|
||||||
|
this._operators = ['', this._defaultOwner];
|
||||||
|
}
|
||||||
|
|
||||||
|
this._jobCompletionActionConditions = [{
|
||||||
|
displayName: this.JobCompletionActionCondition_OnSuccess,
|
||||||
|
name: sqlops.JobCompletionActionCondition.OnSuccess.toString()
|
||||||
|
}, {
|
||||||
|
displayName: this.JobCompletionActionCondition_OnFailure,
|
||||||
|
name: sqlops.JobCompletionActionCondition.OnFailure.toString()
|
||||||
|
}, {
|
||||||
|
displayName: this.JobCompletionActionCondition_Always,
|
||||||
|
name: sqlops.JobCompletionActionCondition.Always.toString()
|
||||||
|
}];
|
||||||
|
|
||||||
|
this.jobSchedules = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public async save() {
|
||||||
|
await this._agentService.createJob(this.ownerUri, {
|
||||||
|
name: this.name,
|
||||||
|
owner: this.owner,
|
||||||
|
description: this.description,
|
||||||
|
EmailLevel: this.emailLevel,
|
||||||
|
PageLevel: this.pageLevel,
|
||||||
|
EventLogLevel: this.eventLogLevel,
|
||||||
|
DeleteLevel: this.deleteLevel,
|
||||||
|
OperatorToEmail: this.operatorToEmail,
|
||||||
|
OperatorToPage: this.operatorToPage,
|
||||||
|
enabled: this.enabled,
|
||||||
|
category: this.category,
|
||||||
|
Alerts: this.alerts,
|
||||||
|
JobSchedules: this.jobSchedules,
|
||||||
|
JobSteps: this.jobSteps,
|
||||||
|
// The properties below are not collected from UI
|
||||||
|
// We could consider using a seperate class for create job request
|
||||||
|
//
|
||||||
|
currentExecutionStatus: 0,
|
||||||
|
lastRunOutcome: 0,
|
||||||
|
currentExecutionStep: '',
|
||||||
|
hasTarget: true,
|
||||||
|
hasSchedule: false,
|
||||||
|
hasStep: false,
|
||||||
|
runnable: true,
|
||||||
|
categoryId: 0,
|
||||||
|
categoryType: 1, // LocalJob, hard-coding the value, corresponds to the target tab in SSMS
|
||||||
|
lastRun: '',
|
||||||
|
nextRun: '',
|
||||||
|
jobId: ''
|
||||||
|
}).then(result => {
|
||||||
|
if (!result.success) {
|
||||||
|
console.info(result.errorMessage);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public validate(): { valid: boolean, errorMessages: string[] } {
|
||||||
|
let validationErrors: string[] = [];
|
||||||
|
|
||||||
|
if (!(this.name && this.name.trim())) {
|
||||||
|
validationErrors.push(this.CreateJobErrorMessage_NameIsEmpty);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
valid: validationErrors.length === 0,
|
||||||
|
errorMessages: validationErrors
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public addJobSchedule(schedule: sqlops.AgentJobScheduleInfo) {
|
||||||
|
let existingSchedule = this.jobSchedules.find(item => item.name === schedule.name);
|
||||||
|
if (!existingSchedule) {
|
||||||
|
this.jobSchedules.push(schedule);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
extensions/agent/client/src/data/createScheduleData.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 CreateScheduleData {
|
||||||
|
public ownerUri: string;
|
||||||
|
public schedules: sqlops.AgentJobScheduleInfo[];
|
||||||
|
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
||||||
|
|
||||||
|
constructor(ownerUri:string) {
|
||||||
|
this.ownerUri = ownerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async initialize() {
|
||||||
|
let agentService = await AgentUtils.getAgentService();
|
||||||
|
let result = await agentService.getJobSchedules(this.ownerUri);
|
||||||
|
if (result && result.success) {
|
||||||
|
this.schedules = result.schedules;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async save() {
|
||||||
|
}
|
||||||
|
}
|
||||||
71
extensions/agent/client/src/data/createStepData.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 { AgentUtils } from '../agentUtils';
|
||||||
|
|
||||||
|
export class CreateStepData {
|
||||||
|
public ownerUri: string;
|
||||||
|
public jobId: string; //
|
||||||
|
public jobName: string;
|
||||||
|
public script: string; //
|
||||||
|
public scriptName: string;
|
||||||
|
public stepName: string; //
|
||||||
|
public subSystem: string; //
|
||||||
|
public id: number;
|
||||||
|
public failureAction: string; //
|
||||||
|
public successAction: string; //
|
||||||
|
public failStepId: number;
|
||||||
|
public successStepId: number;
|
||||||
|
public command: string;
|
||||||
|
public commandExecutionSuccessCode: number;
|
||||||
|
public databaseName: string; //
|
||||||
|
public databaseUserName: string;
|
||||||
|
public server: string;
|
||||||
|
public outputFileName: string; //
|
||||||
|
public appendToLogFile: boolean;
|
||||||
|
public appendToStepHist: boolean;
|
||||||
|
public writeLogToTable: boolean;
|
||||||
|
public appendLogToTable: boolean;
|
||||||
|
public retryAttempts: number; //
|
||||||
|
public retryInterval: number; //
|
||||||
|
public proxyName: string;
|
||||||
|
|
||||||
|
constructor(ownerUri:string) {
|
||||||
|
this.ownerUri = ownerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async save() {
|
||||||
|
let agentService = await AgentUtils.getAgentService();
|
||||||
|
agentService.createJobStep(this.ownerUri, {
|
||||||
|
jobId: this.jobId,
|
||||||
|
jobName: this.jobName,
|
||||||
|
script: this.script,
|
||||||
|
scriptName: this.scriptName,
|
||||||
|
stepName: this.stepName,
|
||||||
|
subSystem: this.subSystem,
|
||||||
|
id: 1,
|
||||||
|
failureAction: this.failureAction,
|
||||||
|
successAction: this.successAction,
|
||||||
|
failStepId: this.failStepId,
|
||||||
|
successStepId: this.successStepId,
|
||||||
|
command: this.command,
|
||||||
|
commandExecutionSuccessCode: this.commandExecutionSuccessCode,
|
||||||
|
databaseName: this.databaseName,
|
||||||
|
databaseUserName: this.databaseUserName,
|
||||||
|
server: this.server,
|
||||||
|
outputFileName: this.outputFileName,
|
||||||
|
appendToLogFile: this.appendToLogFile,
|
||||||
|
appendToStepHist: this.appendToStepHist,
|
||||||
|
writeLogToTable: this.writeLogToTable,
|
||||||
|
appendLogToTable: this.appendLogToTable,
|
||||||
|
retryAttempts: this.retryAttempts,
|
||||||
|
retryInterval: this.retryInterval,
|
||||||
|
proxyName: this.proxyName
|
||||||
|
}).then(result => {
|
||||||
|
console.info(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
29
extensions/agent/client/src/data/pickScheduleData.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 PickScheduleData {
|
||||||
|
public ownerUri: string;
|
||||||
|
public schedules: sqlops.AgentJobScheduleInfo[];
|
||||||
|
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
||||||
|
|
||||||
|
constructor(ownerUri:string) {
|
||||||
|
this.ownerUri = ownerUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async initialize() {
|
||||||
|
let agentService = await AgentUtils.getAgentService();
|
||||||
|
let result = await agentService.getJobSchedules(this.ownerUri);
|
||||||
|
if (result && result.success) {
|
||||||
|
this.schedules = result.schedules;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async save() {
|
||||||
|
}
|
||||||
|
}
|
||||||
149
extensions/agent/client/src/dialogs/createAlertDialog.ts
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 * as vscode from 'vscode';
|
||||||
|
import { CreateAlertData } from '../data/createAlertData';
|
||||||
|
|
||||||
|
export class CreateAlertDialog {
|
||||||
|
|
||||||
|
// Top level
|
||||||
|
private readonly DialogTitle: string = 'Create Alert';
|
||||||
|
private readonly OkButtonText: string = 'OK';
|
||||||
|
private readonly CancelButtonText: string = 'Cancel';
|
||||||
|
private readonly GeneralTabText: string = 'Response';
|
||||||
|
private readonly ResponseTabText: string = 'Steps';
|
||||||
|
private readonly OptionsTabText: string = 'Options';
|
||||||
|
private readonly HistoryTabText: string = 'History';
|
||||||
|
|
||||||
|
// General tab strings
|
||||||
|
private readonly NameTextBoxLabel: string = 'Name';
|
||||||
|
|
||||||
|
// Response tab strings
|
||||||
|
private readonly ExecuteJobTextBoxLabel: string = 'Execute Job';
|
||||||
|
|
||||||
|
// Options tab strings
|
||||||
|
private readonly AdditionalMessageTextBoxLabel: string = 'Additional notification message to send';
|
||||||
|
|
||||||
|
// History tab strings
|
||||||
|
private readonly ResetCountTextBoxLabel: string = 'Reset Count';
|
||||||
|
|
||||||
|
// UI Components
|
||||||
|
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
|
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private responseTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private optionsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private historyTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private schedulesTable: sqlops.TableComponent;
|
||||||
|
|
||||||
|
// General tab controls
|
||||||
|
private nameTextBox: sqlops.InputBoxComponent;
|
||||||
|
|
||||||
|
// Response tab controls
|
||||||
|
private executeJobTextBox: sqlops.InputBoxComponent;
|
||||||
|
|
||||||
|
// Options tab controls
|
||||||
|
private additionalMessageTextBox: sqlops.InputBoxComponent;
|
||||||
|
|
||||||
|
// History tab controls
|
||||||
|
private resetCountTextBox: sqlops.InputBoxComponent;
|
||||||
|
|
||||||
|
private model: CreateAlertData;
|
||||||
|
|
||||||
|
private _onSuccess: vscode.EventEmitter<CreateAlertData> = new vscode.EventEmitter<CreateAlertData>();
|
||||||
|
public readonly onSuccess: vscode.Event<CreateAlertData> = this._onSuccess.event;
|
||||||
|
|
||||||
|
constructor(ownerUri: string) {
|
||||||
|
this.model = new CreateAlertData(ownerUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async showDialog() {
|
||||||
|
await this.model.initialize();
|
||||||
|
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
|
||||||
|
this.generalTab = sqlops.window.modelviewdialog.createTab(this.GeneralTabText);
|
||||||
|
this.responseTab = sqlops.window.modelviewdialog.createTab(this.ResponseTabText);
|
||||||
|
this.optionsTab = sqlops.window.modelviewdialog.createTab(this.OptionsTabText);
|
||||||
|
this.historyTab = sqlops.window.modelviewdialog.createTab(this.HistoryTabText);
|
||||||
|
|
||||||
|
this.initializeGeneralTab();
|
||||||
|
this.initializeResponseTab();
|
||||||
|
this.initializeOptionsTab();
|
||||||
|
this.initializeHistoryTab();
|
||||||
|
|
||||||
|
this.dialog.content = [this.generalTab, this.responseTab, this.optionsTab, this.historyTab];
|
||||||
|
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;
|
||||||
|
|
||||||
|
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeGeneralTab() {
|
||||||
|
this.generalTab.registerContent(async view => {
|
||||||
|
this.nameTextBox = view.modelBuilder.inputBox().component();
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.nameTextBox,
|
||||||
|
title: this.NameTextBoxLabel
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeResponseTab() {
|
||||||
|
this.responseTab.registerContent(async view => {
|
||||||
|
this.executeJobTextBox = view.modelBuilder.inputBox().component();
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.executeJobTextBox,
|
||||||
|
title: this.ExecuteJobTextBoxLabel
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeOptionsTab() {
|
||||||
|
this.optionsTab.registerContent(async view => {
|
||||||
|
this.additionalMessageTextBox = view.modelBuilder.inputBox().component();
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.additionalMessageTextBox,
|
||||||
|
title: this.AdditionalMessageTextBoxLabel
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeHistoryTab() {
|
||||||
|
this.historyTab.registerContent(async view => {
|
||||||
|
this.resetCountTextBox = view.modelBuilder.inputBox().component();
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.resetCountTextBox,
|
||||||
|
title: this.ResetCountTextBoxLabel
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async execute() {
|
||||||
|
this.updateModel();
|
||||||
|
await this.model.save();
|
||||||
|
this._onSuccess.fire(this.model);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async cancel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateModel() {
|
||||||
|
}
|
||||||
|
}
|
||||||
464
extensions/agent/client/src/dialogs/createJobDialog.ts
Normal file
@@ -0,0 +1,464 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 { CreateJobData } from '../data/createJobData';
|
||||||
|
import { CreateStepDialog } from './createStepDialog';
|
||||||
|
import { PickScheduleDialog } from './pickScheduleDialog';
|
||||||
|
import { CreateAlertDialog } from './createAlertDialog';
|
||||||
|
|
||||||
|
export class CreateJobDialog {
|
||||||
|
|
||||||
|
// TODO: localize
|
||||||
|
// Top level
|
||||||
|
private readonly DialogTitle: string = 'New Job';
|
||||||
|
private readonly OkButtonText: string = 'OK';
|
||||||
|
private readonly CancelButtonText: string = 'Cancel';
|
||||||
|
private readonly GeneralTabText: string = 'General';
|
||||||
|
private readonly StepsTabText: string = 'Steps';
|
||||||
|
private readonly SchedulesTabText: string = 'Schedules';
|
||||||
|
private readonly AlertsTabText: string = 'Alerts';
|
||||||
|
private readonly NotificationsTabText: string = 'Notifications';
|
||||||
|
|
||||||
|
// General tab strings
|
||||||
|
private readonly NameTextBoxLabel: string = 'Name';
|
||||||
|
private readonly OwnerTextBoxLabel: string = 'Owner';
|
||||||
|
private readonly CategoryDropdownLabel: string = 'Category';
|
||||||
|
private readonly DescriptionTextBoxLabel: string = 'Description';
|
||||||
|
private readonly EnabledCheckboxLabel: string = 'Enabled';
|
||||||
|
|
||||||
|
// Steps tab strings
|
||||||
|
private readonly JobStepsTopLabelString: string = 'Job step list';
|
||||||
|
private readonly StepsTable_StepColumnString: string = 'Step';
|
||||||
|
private readonly StepsTable_NameColumnString: string = 'Name';
|
||||||
|
private readonly StepsTable_TypeColumnString: string = 'Type';
|
||||||
|
private readonly StepsTable_SuccessColumnString: string = 'On Success';
|
||||||
|
private readonly StepsTable_FailureColumnString: string = 'On Failure';
|
||||||
|
private readonly NewStepButtonString: string = 'New...';
|
||||||
|
private readonly InsertStepButtonString: string = 'Insert...';
|
||||||
|
private readonly EditStepButtonString: string = 'Edit';
|
||||||
|
private readonly DeleteStepButtonString: string = 'Delete';
|
||||||
|
|
||||||
|
// Notifications tab strings
|
||||||
|
private readonly NotificationsTabTopLabelString: string = 'Actions to perform when the job completes';
|
||||||
|
private readonly EmailCheckBoxString: string = 'Email';
|
||||||
|
private readonly PagerCheckBoxString: string = 'Page';
|
||||||
|
private readonly EventLogCheckBoxString: string = 'Write to the Windows Application event log';
|
||||||
|
private readonly DeleteJobCheckBoxString: string = 'Automatically delete job';
|
||||||
|
|
||||||
|
// Schedules tab strings
|
||||||
|
private readonly SchedulesTopLabelString: string = 'Schedules list';
|
||||||
|
private readonly PickScheduleButtonString: string = 'Pick Schedule';
|
||||||
|
|
||||||
|
// Alerts tab strings
|
||||||
|
private readonly AlertsTopLabelString: string = 'Alerts list';
|
||||||
|
private readonly NewAlertButtonString: string = 'New Alert';
|
||||||
|
|
||||||
|
// UI Components
|
||||||
|
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
|
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private stepsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private alertsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private schedulesTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private notificationsTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
|
||||||
|
// General tab controls
|
||||||
|
private nameTextBox: sqlops.InputBoxComponent;
|
||||||
|
private ownerTextBox: sqlops.InputBoxComponent;
|
||||||
|
private categoryDropdown: sqlops.DropDownComponent;
|
||||||
|
private descriptionTextBox: sqlops.InputBoxComponent;
|
||||||
|
private enabledCheckBox: sqlops.CheckBoxComponent;
|
||||||
|
|
||||||
|
// Steps tab controls
|
||||||
|
private stepsTable: sqlops.TableComponent;
|
||||||
|
private newStepButton: sqlops.ButtonComponent;
|
||||||
|
private insertStepButton: sqlops.ButtonComponent;
|
||||||
|
private editStepButton: sqlops.ButtonComponent;
|
||||||
|
private deleteStepButton: sqlops.ButtonComponent;
|
||||||
|
|
||||||
|
// Notifications tab controls
|
||||||
|
private notificationsTabTopLabel: sqlops.TextComponent;
|
||||||
|
private emailCheckBox: sqlops.CheckBoxComponent;
|
||||||
|
private emailOperatorDropdown: sqlops.DropDownComponent;
|
||||||
|
private emailConditionDropdown: sqlops.DropDownComponent;
|
||||||
|
private pagerCheckBox: sqlops.CheckBoxComponent;
|
||||||
|
private pagerOperatorDropdown: sqlops.DropDownComponent;
|
||||||
|
private pagerConditionDropdown: sqlops.DropDownComponent;
|
||||||
|
private eventLogCheckBox: sqlops.CheckBoxComponent;
|
||||||
|
private eventLogConditionDropdown: sqlops.DropDownComponent;
|
||||||
|
private deleteJobCheckBox: sqlops.CheckBoxComponent;
|
||||||
|
private deleteJobConditionDropdown: sqlops.DropDownComponent;
|
||||||
|
|
||||||
|
// Schedule tab controls
|
||||||
|
private schedulesTable: sqlops.TableComponent;
|
||||||
|
private pickScheduleButton: sqlops.ButtonComponent;
|
||||||
|
|
||||||
|
// Alert tab controls
|
||||||
|
private alertsTable: sqlops.TableComponent;
|
||||||
|
private newAlertButton: sqlops.ButtonComponent;
|
||||||
|
|
||||||
|
private model: CreateJobData;
|
||||||
|
|
||||||
|
constructor(ownerUri: string) {
|
||||||
|
this.model = new CreateJobData(ownerUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async showDialog() {
|
||||||
|
await this.model.initialize();
|
||||||
|
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
|
||||||
|
this.generalTab = sqlops.window.modelviewdialog.createTab(this.GeneralTabText);
|
||||||
|
this.stepsTab = sqlops.window.modelviewdialog.createTab(this.StepsTabText);
|
||||||
|
this.alertsTab = sqlops.window.modelviewdialog.createTab(this.AlertsTabText);
|
||||||
|
this.schedulesTab = sqlops.window.modelviewdialog.createTab(this.SchedulesTabText);
|
||||||
|
this.notificationsTab = sqlops.window.modelviewdialog.createTab(this.NotificationsTabText);
|
||||||
|
this.initializeGeneralTab();
|
||||||
|
this.initializeStepsTab();
|
||||||
|
this.initializeAlertsTab();
|
||||||
|
this.initializeSchedulesTab();
|
||||||
|
this.initializeNotificationsTab();
|
||||||
|
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.updateModel();
|
||||||
|
let validationResult = this.model.validate();
|
||||||
|
if (!validationResult.valid) {
|
||||||
|
// TODO: Show Error Messages
|
||||||
|
console.error(validationResult.errorMessages.join(','));
|
||||||
|
}
|
||||||
|
|
||||||
|
return validationResult.valid;
|
||||||
|
});
|
||||||
|
|
||||||
|
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeGeneralTab() {
|
||||||
|
this.generalTab.registerContent(async view => {
|
||||||
|
this.nameTextBox = view.modelBuilder.inputBox().component();
|
||||||
|
this.ownerTextBox = view.modelBuilder.inputBox().component();
|
||||||
|
this.categoryDropdown = view.modelBuilder.dropDown().component();
|
||||||
|
this.descriptionTextBox = view.modelBuilder.inputBox().withProperties({
|
||||||
|
multiline: true,
|
||||||
|
height: 200
|
||||||
|
}).component();
|
||||||
|
this.enabledCheckBox = view.modelBuilder.checkBox()
|
||||||
|
.withProperties({
|
||||||
|
label: this.EnabledCheckboxLabel
|
||||||
|
}).component();
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.nameTextBox,
|
||||||
|
title: this.NameTextBoxLabel
|
||||||
|
}, {
|
||||||
|
component: this.ownerTextBox,
|
||||||
|
title: this.OwnerTextBoxLabel
|
||||||
|
}, {
|
||||||
|
component: this.categoryDropdown,
|
||||||
|
title: this.CategoryDropdownLabel
|
||||||
|
}, {
|
||||||
|
component: this.descriptionTextBox,
|
||||||
|
title: this.DescriptionTextBoxLabel
|
||||||
|
}, {
|
||||||
|
component: this.enabledCheckBox,
|
||||||
|
title: ''
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
|
||||||
|
this.ownerTextBox.value = this.model.defaultOwner;
|
||||||
|
this.categoryDropdown.values = this.model.jobCategories;
|
||||||
|
this.categoryDropdown.value = this.model.jobCategories[0];
|
||||||
|
this.enabledCheckBox.checked = this.model.enabled;
|
||||||
|
this.descriptionTextBox.value = '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeStepsTab() {
|
||||||
|
this.stepsTab.registerContent(async view => {
|
||||||
|
this.stepsTable = view.modelBuilder.table()
|
||||||
|
.withProperties({
|
||||||
|
columns: [
|
||||||
|
this.StepsTable_StepColumnString,
|
||||||
|
this.StepsTable_NameColumnString,
|
||||||
|
this.StepsTable_TypeColumnString,
|
||||||
|
this.StepsTable_SuccessColumnString,
|
||||||
|
this.StepsTable_FailureColumnString
|
||||||
|
],
|
||||||
|
data: [],
|
||||||
|
height: 800
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.newStepButton = view.modelBuilder.button().withProperties({
|
||||||
|
label: this.NewStepButtonString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.newStepButton.onDidClick((e)=>{
|
||||||
|
let stepDialog = new CreateStepDialog(this.model.ownerUri, '', '', 1, this.model);
|
||||||
|
stepDialog.openNewStepDialog();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.insertStepButton = view.modelBuilder.button().withProperties({
|
||||||
|
label: this.InsertStepButtonString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.editStepButton = view.modelBuilder.button().withProperties({
|
||||||
|
label: this.EditStepButtonString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.deleteStepButton = view.modelBuilder.button().withProperties({
|
||||||
|
label: this.DeleteStepButtonString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.stepsTable,
|
||||||
|
title: this.JobStepsTopLabelString,
|
||||||
|
actions: [this.newStepButton, this.insertStepButton, this.editStepButton, this.deleteStepButton]
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeAlertsTab() {
|
||||||
|
this.alertsTab.registerContent(async view => {
|
||||||
|
this.alertsTable = view.modelBuilder.table()
|
||||||
|
.withProperties({
|
||||||
|
columns: [
|
||||||
|
'Alert Name'
|
||||||
|
],
|
||||||
|
data: [],
|
||||||
|
height: 600,
|
||||||
|
width: 400
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.newAlertButton = view.modelBuilder.button().withProperties({
|
||||||
|
label: this.NewAlertButtonString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.newAlertButton.onDidClick((e)=>{
|
||||||
|
let alertDialog = new CreateAlertDialog(this.model.ownerUri);
|
||||||
|
alertDialog.onSuccess((dialogModel) => {
|
||||||
|
});
|
||||||
|
alertDialog.showDialog();
|
||||||
|
});
|
||||||
|
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.alertsTable,
|
||||||
|
title: this.AlertsTopLabelString,
|
||||||
|
actions: [this.newAlertButton]
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeSchedulesTab() {
|
||||||
|
this.schedulesTab.registerContent(async view => {
|
||||||
|
this.schedulesTable = view.modelBuilder.table()
|
||||||
|
.withProperties({
|
||||||
|
columns: [
|
||||||
|
'Schedule Name'
|
||||||
|
],
|
||||||
|
data: [],
|
||||||
|
height: 600,
|
||||||
|
width: 400
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.pickScheduleButton = view.modelBuilder.button().withProperties({
|
||||||
|
label: this.PickScheduleButtonString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.pickScheduleButton.onDidClick((e)=>{
|
||||||
|
let pickScheduleDialog = new PickScheduleDialog(this.model.ownerUri);
|
||||||
|
pickScheduleDialog.onSuccess((dialogModel) => {
|
||||||
|
let selectedSchedule = dialogModel.selectedSchedule;
|
||||||
|
if (selectedSchedule) {
|
||||||
|
this.model.addJobSchedule(selectedSchedule);
|
||||||
|
this.populateScheduleTable();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
pickScheduleDialog.showDialog();
|
||||||
|
});
|
||||||
|
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.schedulesTable,
|
||||||
|
title: this.SchedulesTopLabelString,
|
||||||
|
actions: [this.pickScheduleButton]
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
|
||||||
|
this.populateScheduleTable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private populateScheduleTable() {
|
||||||
|
if (this.model.jobSchedules) {
|
||||||
|
let data: any[][] = [];
|
||||||
|
for (let i = 0; i < this.model.jobSchedules.length; ++i) {
|
||||||
|
let schedule = this.model.jobSchedules[i];
|
||||||
|
data[i] = [ schedule.name ];
|
||||||
|
}
|
||||||
|
this.schedulesTable.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeNotificationsTab() {
|
||||||
|
this.notificationsTab.registerContent(async view => {
|
||||||
|
|
||||||
|
this.notificationsTabTopLabel = view.modelBuilder.text().withProperties({ value: this.NotificationsTabTopLabelString }).component();
|
||||||
|
this.emailCheckBox = view.modelBuilder.checkBox().withProperties({
|
||||||
|
label: this.EmailCheckBoxString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.pagerCheckBox = view.modelBuilder.checkBox().withProperties({
|
||||||
|
label: this.PagerCheckBoxString,
|
||||||
|
width: 80
|
||||||
|
}).component();
|
||||||
|
this.eventLogCheckBox = view.modelBuilder.checkBox().withProperties({
|
||||||
|
label: this.EventLogCheckBoxString,
|
||||||
|
width: 250
|
||||||
|
}).component();
|
||||||
|
this.deleteJobCheckBox = view.modelBuilder.checkBox().withProperties({
|
||||||
|
label: this.DeleteJobCheckBoxString,
|
||||||
|
width: 250
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.emailCheckBox.onChanged(() => {
|
||||||
|
this.emailConditionDropdown.enabled = this.emailCheckBox.checked;
|
||||||
|
this.emailOperatorDropdown.enabled = this.emailCheckBox.checked;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.pagerCheckBox.onChanged(() => {
|
||||||
|
this.pagerConditionDropdown.enabled = this.pagerCheckBox.checked;
|
||||||
|
this.pagerOperatorDropdown.enabled = this.pagerCheckBox.checked;
|
||||||
|
});
|
||||||
|
this.eventLogCheckBox.onChanged(() => {
|
||||||
|
this.eventLogConditionDropdown.enabled = this.eventLogCheckBox.checked;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.deleteJobCheckBox.onChanged(() => {
|
||||||
|
this.deleteJobConditionDropdown.enabled = this.deleteJobCheckBox.checked;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.emailOperatorDropdown = view.modelBuilder.dropDown().withProperties({ width: 150 }).component();
|
||||||
|
this.pagerOperatorDropdown = view.modelBuilder.dropDown().withProperties({ width: 150 }).component();
|
||||||
|
this.emailConditionDropdown = view.modelBuilder.dropDown().withProperties({ width: 150 }).component();
|
||||||
|
this.pagerConditionDropdown = view.modelBuilder.dropDown().withProperties({ width: 150 }).component();
|
||||||
|
this.eventLogConditionDropdown = view.modelBuilder.dropDown().withProperties({ width: 150 }).component();
|
||||||
|
this.deleteJobConditionDropdown = view.modelBuilder.dropDown().withProperties({ width: 150 }).component();
|
||||||
|
|
||||||
|
let emailContainer = this.createRowContainer(view).withItems([this.emailCheckBox, this.emailOperatorDropdown, this.emailConditionDropdown]).component();
|
||||||
|
|
||||||
|
let pagerContainer = this.createRowContainer(view).withItems([this.pagerCheckBox, this.pagerOperatorDropdown, this.pagerConditionDropdown]).component();
|
||||||
|
|
||||||
|
let eventLogContainer = this.createRowContainer(view).withItems([this.eventLogCheckBox, this.eventLogConditionDropdown]).component();
|
||||||
|
|
||||||
|
let deleteJobContainer = this.createRowContainer(view).withItems([this.deleteJobCheckBox, this.deleteJobConditionDropdown]).component();
|
||||||
|
|
||||||
|
let formModel = view.modelBuilder.formContainer().withFormItems([
|
||||||
|
{
|
||||||
|
component: this.notificationsTabTopLabel,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: emailContainer,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: pagerContainer,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: eventLogContainer,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: deleteJobContainer,
|
||||||
|
title: ''
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
this.emailConditionDropdown.values = this.model.JobCompletionActionConditions;
|
||||||
|
this.pagerConditionDropdown.values = this.model.JobCompletionActionConditions;
|
||||||
|
this.eventLogConditionDropdown.values = this.model.JobCompletionActionConditions;
|
||||||
|
this.deleteJobConditionDropdown.values = this.model.JobCompletionActionConditions;
|
||||||
|
this.setConditionDropdownSelectedValue(this.emailConditionDropdown, this.model.emailLevel);
|
||||||
|
this.setConditionDropdownSelectedValue(this.pagerConditionDropdown, this.model.pageLevel);
|
||||||
|
this.setConditionDropdownSelectedValue(this.eventLogConditionDropdown, this.model.eventLogLevel);
|
||||||
|
this.setConditionDropdownSelectedValue(this.deleteJobConditionDropdown, this.model.deleteLevel);
|
||||||
|
this.emailOperatorDropdown.values = this.model.operators;
|
||||||
|
this.pagerOperatorDropdown.values = this.model.operators;
|
||||||
|
this.emailCheckBox.checked = false;
|
||||||
|
this.pagerCheckBox.checked = false;
|
||||||
|
this.eventLogCheckBox.checked = false;
|
||||||
|
this.deleteJobCheckBox.checked = false;
|
||||||
|
this.emailOperatorDropdown.enabled = false;
|
||||||
|
this.pagerOperatorDropdown.enabled = false;
|
||||||
|
this.emailConditionDropdown.enabled = false;
|
||||||
|
this.pagerConditionDropdown.enabled = false;
|
||||||
|
this.eventLogConditionDropdown.enabled = false;
|
||||||
|
this.deleteJobConditionDropdown.enabled = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private createRowContainer(view: sqlops.ModelView): sqlops.FlexBuilder {
|
||||||
|
return view.modelBuilder.flexContainer().withLayout({
|
||||||
|
flexFlow: 'row',
|
||||||
|
alignItems: 'left',
|
||||||
|
justifyContent: 'space-between'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async execute() {
|
||||||
|
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.owner = this.ownerTextBox.value;
|
||||||
|
this.model.enabled = this.enabledCheckBox.checked;
|
||||||
|
this.model.description = this.descriptionTextBox.value;
|
||||||
|
this.model.category = this.getDropdownValue(this.categoryDropdown);
|
||||||
|
this.model.emailLevel = this.getActualConditionValue(this.emailCheckBox, this.emailConditionDropdown);
|
||||||
|
this.model.operatorToEmail = this.getDropdownValue(this.emailOperatorDropdown);
|
||||||
|
this.model.operatorToPage = this.getDropdownValue(this.pagerOperatorDropdown);
|
||||||
|
this.model.pageLevel = this.getActualConditionValue(this.pagerCheckBox, this.pagerConditionDropdown);
|
||||||
|
this.model.eventLogLevel = this.getActualConditionValue(this.eventLogCheckBox, this.eventLogConditionDropdown);
|
||||||
|
this.model.deleteLevel = this.getActualConditionValue(this.deleteJobCheckBox, this.deleteJobConditionDropdown);
|
||||||
|
}
|
||||||
|
}
|
||||||
91
extensions/agent/client/src/dialogs/createScheduleDialog.ts
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 * as vscode from 'vscode';
|
||||||
|
import { CreateScheduleData } from '../data/createScheduleData';
|
||||||
|
|
||||||
|
export class CreateScheduleDialog {
|
||||||
|
|
||||||
|
// Top level
|
||||||
|
private readonly DialogTitle: string = 'New Schedule';
|
||||||
|
private readonly OkButtonText: string = 'OK';
|
||||||
|
private readonly CancelButtonText: string = 'Cancel';
|
||||||
|
|
||||||
|
// UI Components
|
||||||
|
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
|
private schedulesTable: sqlops.TableComponent;
|
||||||
|
|
||||||
|
private model: CreateScheduleData;
|
||||||
|
|
||||||
|
private _onSuccess: vscode.EventEmitter<CreateScheduleData> = new vscode.EventEmitter<CreateScheduleData>();
|
||||||
|
public readonly onSuccess: vscode.Event<CreateScheduleData> = this._onSuccess.event;
|
||||||
|
|
||||||
|
constructor(ownerUri: string) {
|
||||||
|
this.model = new CreateScheduleData(ownerUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async showDialog() {
|
||||||
|
await this.model.initialize();
|
||||||
|
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
|
||||||
|
this.initializeContent();
|
||||||
|
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;
|
||||||
|
|
||||||
|
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeContent() {
|
||||||
|
this.dialog.registerContent(async view => {
|
||||||
|
this.schedulesTable = view.modelBuilder.table()
|
||||||
|
.withProperties({
|
||||||
|
columns: [
|
||||||
|
'Schedule Name'
|
||||||
|
],
|
||||||
|
data: [],
|
||||||
|
height: 600,
|
||||||
|
width: 400
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.schedulesTable,
|
||||||
|
title: 'Schedules'
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
|
||||||
|
if (this.model.schedules) {
|
||||||
|
let data: any[][] = [];
|
||||||
|
for (let i = 0; i < this.model.schedules.length; ++i) {
|
||||||
|
let schedule = this.model.schedules[i];
|
||||||
|
data[i] = [ schedule.name ];
|
||||||
|
}
|
||||||
|
this.schedulesTable.data = data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async execute() {
|
||||||
|
this.updateModel();
|
||||||
|
await this.model.save();
|
||||||
|
this._onSuccess.fire(this.model);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async cancel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateModel() {
|
||||||
|
let selectedRows = this.schedulesTable.selectedRows;
|
||||||
|
if (selectedRows && selectedRows.length > 0) {
|
||||||
|
let selectedRow = selectedRows[0];
|
||||||
|
this.model.selectedSchedule = this.model.schedules[selectedRow];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
421
extensions/agent/client/src/dialogs/createStepDialog.ts
Normal file
@@ -0,0 +1,421 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 * as vscode from 'vscode';
|
||||||
|
import { CreateStepData } from '../data/createStepData';
|
||||||
|
import { AgentUtils } from '../agentUtils';
|
||||||
|
import { CreateJobData } from '../data/createJobData';
|
||||||
|
|
||||||
|
export class CreateStepDialog {
|
||||||
|
|
||||||
|
// TODO: localize
|
||||||
|
// Top level
|
||||||
|
//
|
||||||
|
private static readonly DialogTitle: string = 'New Job Step';
|
||||||
|
private static readonly OkButtonText: string = 'OK';
|
||||||
|
private static readonly CancelButtonText: string = 'Cancel';
|
||||||
|
private static readonly GeneralTabText: string = 'General';
|
||||||
|
private static readonly AdvancedTabText: string = 'Advanced';
|
||||||
|
private static readonly OpenCommandText: string = 'Open...';
|
||||||
|
private static readonly ParseCommandText: string = 'Parse';
|
||||||
|
private static readonly NextButtonText: string = 'Next';
|
||||||
|
private static readonly PreviousButtonText: string = 'Previous';
|
||||||
|
private static readonly SuccessAction: string = 'On success action';
|
||||||
|
private static readonly FailureAction: string = 'On failure action';
|
||||||
|
|
||||||
|
|
||||||
|
// Dropdown options
|
||||||
|
private static readonly TSQLScript: string = 'Transact-SQL script (T-SQL)';
|
||||||
|
private static readonly AgentServiceAccount: string = 'SQL Server Agent Service Account';
|
||||||
|
private static readonly NextStep: string = 'Go to the next step';
|
||||||
|
private static readonly QuitJobReportingSuccess: string = 'Quit the job reporting success';
|
||||||
|
private static readonly QuitJobReportingFailure: string = 'Quit the job reporting failure';
|
||||||
|
|
||||||
|
// UI Components
|
||||||
|
//
|
||||||
|
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
|
private generalTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private advancedTab: sqlops.window.modelviewdialog.DialogTab;
|
||||||
|
private nameTextBox: sqlops.InputBoxComponent;
|
||||||
|
private typeDropdown: sqlops.DropDownComponent;
|
||||||
|
private runAsDropdown: sqlops.DropDownComponent;
|
||||||
|
private databaseDropdown: sqlops.DropDownComponent;
|
||||||
|
private successActionDropdown: sqlops.DropDownComponent;
|
||||||
|
private failureActionDropdown: sqlops.DropDownComponent;
|
||||||
|
private commandTextBox: sqlops.InputBoxComponent;
|
||||||
|
private openButton: sqlops.ButtonComponent;
|
||||||
|
private parseButton: sqlops.ButtonComponent;
|
||||||
|
private nextButton: sqlops.ButtonComponent;
|
||||||
|
private previousButton: sqlops.ButtonComponent;
|
||||||
|
private retryAttemptsBox: sqlops.InputBoxComponent;
|
||||||
|
private retryIntervalBox: sqlops.InputBoxComponent;
|
||||||
|
private appendToExistingFileCheckbox: sqlops.CheckBoxComponent;
|
||||||
|
private logToTableCheckbox: sqlops.CheckBoxComponent;
|
||||||
|
private outputFileNameBox: sqlops.InputBoxComponent;
|
||||||
|
private outputFileBrowserButton: sqlops.ButtonComponent;
|
||||||
|
|
||||||
|
private model: CreateStepData;
|
||||||
|
private ownerUri: string;
|
||||||
|
private jobName: string;
|
||||||
|
private server: string;
|
||||||
|
private stepId: number;
|
||||||
|
|
||||||
|
private jobModel: CreateJobData;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
ownerUri: string,
|
||||||
|
jobName: string,
|
||||||
|
server: string,
|
||||||
|
stepId: number,
|
||||||
|
jobModel?: CreateJobData
|
||||||
|
) {
|
||||||
|
this.model = new CreateStepData(ownerUri);
|
||||||
|
this.stepId = stepId;
|
||||||
|
this.ownerUri = ownerUri;
|
||||||
|
this.jobName = jobName;
|
||||||
|
this.server = server;
|
||||||
|
this.jobModel = jobModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeUIComponents() {
|
||||||
|
this.dialog = sqlops.window.modelviewdialog.createDialog(CreateStepDialog.DialogTitle);
|
||||||
|
this.generalTab = sqlops.window.modelviewdialog.createTab(CreateStepDialog.GeneralTabText);
|
||||||
|
this.advancedTab = sqlops.window.modelviewdialog.createTab(CreateStepDialog.AdvancedTabText);
|
||||||
|
this.dialog.content = [this.generalTab, this.advancedTab];
|
||||||
|
this.dialog.okButton.onClick(async () => await this.execute());
|
||||||
|
this.dialog.okButton.label = CreateStepDialog.OkButtonText;
|
||||||
|
this.dialog.cancelButton.label = CreateStepDialog.CancelButtonText;
|
||||||
|
}
|
||||||
|
|
||||||
|
private createCommands(view, queryProvider: sqlops.QueryProvider) {
|
||||||
|
this.openButton = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
label: CreateStepDialog.OpenCommandText,
|
||||||
|
width: '80px'
|
||||||
|
}).component();
|
||||||
|
this.parseButton = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
label: CreateStepDialog.ParseCommandText,
|
||||||
|
width: '80px'
|
||||||
|
}).component();
|
||||||
|
this.parseButton.onDidClick(e => {
|
||||||
|
if (this.commandTextBox.value) {
|
||||||
|
queryProvider.parseSyntax(this.ownerUri, this.commandTextBox.value).then(result => {
|
||||||
|
if (result && result.parseable) {
|
||||||
|
this.dialog.message = { text: 'The command was successfully parsed.', level: 2};
|
||||||
|
} else if (result && !result.parseable) {
|
||||||
|
this.dialog.message = { text: 'The command failed' };
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.commandTextBox = view.modelBuilder.inputBox()
|
||||||
|
.withProperties({
|
||||||
|
height: 300,
|
||||||
|
width: 400,
|
||||||
|
multiline: true,
|
||||||
|
inputType: 'text'
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
this.nextButton = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
label: CreateStepDialog.NextButtonText,
|
||||||
|
enabled: false,
|
||||||
|
width: '80px'
|
||||||
|
}).component();
|
||||||
|
this.previousButton = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
label: CreateStepDialog.PreviousButtonText,
|
||||||
|
enabled: false,
|
||||||
|
width: '80px'
|
||||||
|
}).component();
|
||||||
|
}
|
||||||
|
|
||||||
|
private createGeneralTab(databases: string[], queryProvider: sqlops.QueryProvider) {
|
||||||
|
this.generalTab.registerContent(async (view) => {
|
||||||
|
this.nameTextBox = view.modelBuilder.inputBox()
|
||||||
|
.withProperties({
|
||||||
|
}).component();
|
||||||
|
this.nameTextBox.required = true;
|
||||||
|
this.typeDropdown = view.modelBuilder.dropDown()
|
||||||
|
.withProperties({
|
||||||
|
value: CreateStepDialog.TSQLScript,
|
||||||
|
values: [CreateStepDialog.TSQLScript]
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
this.runAsDropdown = view.modelBuilder.dropDown()
|
||||||
|
.withProperties({
|
||||||
|
value: '',
|
||||||
|
values: ['']
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
this.runAsDropdown.enabled = false;
|
||||||
|
this.typeDropdown.onValueChanged((type) => {
|
||||||
|
if (type.selected !== CreateStepDialog.TSQLScript) {
|
||||||
|
this.runAsDropdown.value = CreateStepDialog.AgentServiceAccount;
|
||||||
|
this.runAsDropdown.values = [this.runAsDropdown.value];
|
||||||
|
} else {
|
||||||
|
this.runAsDropdown.value = '';
|
||||||
|
this.runAsDropdown.values = [''];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.databaseDropdown = view.modelBuilder.dropDown()
|
||||||
|
.withProperties({
|
||||||
|
value: databases[0],
|
||||||
|
values: databases
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
// create the commands section
|
||||||
|
this.createCommands(view, queryProvider);
|
||||||
|
|
||||||
|
let buttonContainer = view.modelBuilder.flexContainer()
|
||||||
|
.withLayout({
|
||||||
|
flexFlow: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
width: 420
|
||||||
|
}).withItems([this.openButton, this.parseButton, this.previousButton, this.nextButton], {
|
||||||
|
flex: '1 1 50%'
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.nameTextBox,
|
||||||
|
title: 'Step name'
|
||||||
|
}, {
|
||||||
|
component: this.typeDropdown,
|
||||||
|
title: 'Type'
|
||||||
|
}, {
|
||||||
|
component: this.runAsDropdown,
|
||||||
|
title: 'Run as'
|
||||||
|
}, {
|
||||||
|
component: this.databaseDropdown,
|
||||||
|
title: 'Database'
|
||||||
|
}, {
|
||||||
|
component: this.commandTextBox,
|
||||||
|
title: 'Command',
|
||||||
|
actions: [buttonContainer]
|
||||||
|
}], {
|
||||||
|
horizontal: false,
|
||||||
|
componentWidth: 420
|
||||||
|
}).component();
|
||||||
|
let formWrapper = view.modelBuilder.loadingComponent().withItem(formModel).component();
|
||||||
|
formWrapper.loading = false;
|
||||||
|
await view.initializeModel(formWrapper);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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() {
|
||||||
|
this.advancedTab.registerContent(async (view) => {
|
||||||
|
this.successActionDropdown = view.modelBuilder.dropDown()
|
||||||
|
.withProperties({
|
||||||
|
value: CreateStepDialog.NextStep,
|
||||||
|
values: [CreateStepDialog.NextStep, CreateStepDialog.QuitJobReportingSuccess, CreateStepDialog.QuitJobReportingFailure]
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
let retryFlexContainer = this.createRetryCounters(view);
|
||||||
|
this.failureActionDropdown = view.modelBuilder.dropDown()
|
||||||
|
.withProperties({
|
||||||
|
value: CreateStepDialog.QuitJobReportingFailure,
|
||||||
|
values: [CreateStepDialog.QuitJobReportingFailure, CreateStepDialog.NextStep, CreateStepDialog.QuitJobReportingSuccess]
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
let optionsGroup = this.createTSQLOptions(view);
|
||||||
|
let viewButton = view.modelBuilder.button()
|
||||||
|
.withProperties({ label: 'View', width: '50px' }).component();
|
||||||
|
viewButton.enabled = false;
|
||||||
|
this.logToTableCheckbox = view.modelBuilder.checkBox()
|
||||||
|
.withProperties({
|
||||||
|
label: 'Log to table'
|
||||||
|
}).component();
|
||||||
|
let appendToExistingEntryInTableCheckbox = view.modelBuilder.checkBox()
|
||||||
|
.withProperties({ label: 'Append output to existing entry in table' }).component();
|
||||||
|
appendToExistingEntryInTableCheckbox.enabled = false;
|
||||||
|
this.logToTableCheckbox.onChanged(e => {
|
||||||
|
viewButton.enabled = e;
|
||||||
|
appendToExistingEntryInTableCheckbox.enabled = e;
|
||||||
|
});
|
||||||
|
let appendCheckboxContainer = view.modelBuilder.groupContainer()
|
||||||
|
.withItems([appendToExistingEntryInTableCheckbox]).component();
|
||||||
|
let logToTableContainer = view.modelBuilder.flexContainer()
|
||||||
|
.withLayout({ flexFlow: 'row', justifyContent: 'space-between', width: 300 })
|
||||||
|
.withItems([this.logToTableCheckbox, viewButton]).component();
|
||||||
|
let logStepOutputHistoryCheckbox = view.modelBuilder.checkBox()
|
||||||
|
.withProperties({ label: 'Include step output in history' }).component();
|
||||||
|
let runAsUserOptions = this.createRunAsUserOptions(view);
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems(
|
||||||
|
[{
|
||||||
|
component: this.successActionDropdown,
|
||||||
|
title: CreateStepDialog.SuccessAction
|
||||||
|
}, {
|
||||||
|
component: retryFlexContainer,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: this.failureActionDropdown,
|
||||||
|
title: CreateStepDialog.FailureAction
|
||||||
|
}, {
|
||||||
|
component: optionsGroup,
|
||||||
|
title: 'Transact-SQL script (T-SQL)'
|
||||||
|
}, {
|
||||||
|
component: logToTableContainer,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: appendCheckboxContainer,
|
||||||
|
title: ' '
|
||||||
|
}, {
|
||||||
|
component: logStepOutputHistoryCheckbox,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: runAsUserOptions,
|
||||||
|
title: ''
|
||||||
|
}], {
|
||||||
|
componentWidth: 400
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
let formWrapper = view.modelBuilder.loadingComponent().withItem(formModel).component();
|
||||||
|
formWrapper.loading = false;
|
||||||
|
view.initializeModel(formWrapper);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private createRetryCounters(view) {
|
||||||
|
this.retryAttemptsBox = view.modelBuilder.inputBox()
|
||||||
|
.withValidation(component => component.value >= 0)
|
||||||
|
.withProperties({
|
||||||
|
inputType: 'number'
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
this.retryIntervalBox = view.modelBuilder.inputBox()
|
||||||
|
.withValidation(component => component.value >= 0)
|
||||||
|
.withProperties({
|
||||||
|
inputType: 'number'
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
let retryAttemptsContainer = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems(
|
||||||
|
[{
|
||||||
|
component: this.retryAttemptsBox,
|
||||||
|
title: 'Retry Attempts'
|
||||||
|
}], {
|
||||||
|
horizontal: false
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
|
||||||
|
let retryIntervalContainer = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems(
|
||||||
|
[{
|
||||||
|
component: this.retryIntervalBox,
|
||||||
|
title: 'Retry Interval (minutes)'
|
||||||
|
}], {
|
||||||
|
horizontal: false
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
|
||||||
|
let retryFlexContainer = view.modelBuilder.flexContainer()
|
||||||
|
.withLayout({
|
||||||
|
flexFlow: 'row',
|
||||||
|
}).withItems([retryAttemptsContainer, retryIntervalContainer]).component();
|
||||||
|
return retryFlexContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private createTSQLOptions(view) {
|
||||||
|
this.outputFileBrowserButton = view.modelBuilder.button()
|
||||||
|
.withProperties({ width: '20px', label: '...' }).component();
|
||||||
|
this.outputFileNameBox = view.modelBuilder.inputBox()
|
||||||
|
.withProperties({
|
||||||
|
width: '100px',
|
||||||
|
inputType: 'text'
|
||||||
|
}).component();
|
||||||
|
let outputViewButton = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
width: '50px',
|
||||||
|
label: 'View'
|
||||||
|
}).component();
|
||||||
|
outputViewButton.enabled = false;
|
||||||
|
let outputButtonContainer = view.modelBuilder.flexContainer()
|
||||||
|
.withLayout({
|
||||||
|
flexFlow: 'row',
|
||||||
|
textAlign: 'right',
|
||||||
|
width: 120
|
||||||
|
}).withItems([this.outputFileBrowserButton, outputViewButton], { flex: '1 1 50%' }).component();
|
||||||
|
let outputFlexBox = view.modelBuilder.flexContainer()
|
||||||
|
.withLayout({
|
||||||
|
flexFlow: 'row',
|
||||||
|
width: 350
|
||||||
|
}).withItems([this.outputFileNameBox, outputButtonContainer], {
|
||||||
|
flex: '1 1 50%'
|
||||||
|
}).component();
|
||||||
|
this.appendToExistingFileCheckbox = view.modelBuilder.checkBox()
|
||||||
|
.withProperties({
|
||||||
|
label: 'Append output to existing file'
|
||||||
|
}).component();
|
||||||
|
this.appendToExistingFileCheckbox.enabled = false;
|
||||||
|
this.outputFileNameBox.onTextChanged((input) => {
|
||||||
|
if (input !== '') {
|
||||||
|
this.appendToExistingFileCheckbox.enabled = true;
|
||||||
|
} else {
|
||||||
|
this.appendToExistingFileCheckbox.enabled = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let outputFileForm = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: outputFlexBox,
|
||||||
|
title: 'Output file'
|
||||||
|
}, {
|
||||||
|
component: this.appendToExistingFileCheckbox,
|
||||||
|
title: ''
|
||||||
|
}], { horizontal: true, componentWidth: 200 }).component();
|
||||||
|
return outputFileForm;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async execute() {
|
||||||
|
this.model.jobName = this.jobName;
|
||||||
|
this.model.id = this.stepId;
|
||||||
|
this.model.server = this.server;
|
||||||
|
this.model.stepName = this.nameTextBox.value;
|
||||||
|
this.model.subSystem = this.typeDropdown.value as string;
|
||||||
|
this.model.databaseName = this.databaseDropdown.value as string;
|
||||||
|
this.model.script = this.commandTextBox.value;
|
||||||
|
this.model.successAction = this.successActionDropdown.value as string;
|
||||||
|
this.model.retryAttempts = +this.retryAttemptsBox.value;
|
||||||
|
this.model.retryInterval = +this.retryIntervalBox.value;
|
||||||
|
this.model.failureAction = this.failureActionDropdown.value as string;
|
||||||
|
this.model.outputFileName = this.outputFileNameBox.value;
|
||||||
|
await this.model.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async openNewStepDialog() {
|
||||||
|
let databases = await AgentUtils.getDatabases(this.ownerUri);
|
||||||
|
let queryProvider = await AgentUtils.getQueryProvider();
|
||||||
|
this.initializeUIComponents();
|
||||||
|
this.createGeneralTab(databases, queryProvider);
|
||||||
|
this.createAdvancedTab();
|
||||||
|
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||||
|
}
|
||||||
|
}
|
||||||
92
extensions/agent/client/src/dialogs/pickScheduleDialog.ts
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 * as vscode from 'vscode';
|
||||||
|
import { PickScheduleData } from '../data/pickScheduleData';
|
||||||
|
|
||||||
|
export class PickScheduleDialog {
|
||||||
|
|
||||||
|
// TODO: localize
|
||||||
|
// Top level
|
||||||
|
private readonly DialogTitle: string = 'Job Schedules';
|
||||||
|
private readonly OkButtonText: string = 'OK';
|
||||||
|
private readonly CancelButtonText: string = 'Cancel';
|
||||||
|
private readonly SchedulesTabText: string = 'Schedules';
|
||||||
|
|
||||||
|
// UI Components
|
||||||
|
private dialog: sqlops.window.modelviewdialog.Dialog;
|
||||||
|
private schedulesTable: sqlops.TableComponent;
|
||||||
|
|
||||||
|
private model: PickScheduleData;
|
||||||
|
|
||||||
|
private _onSuccess: vscode.EventEmitter<PickScheduleData> = new vscode.EventEmitter<PickScheduleData>();
|
||||||
|
public readonly onSuccess: vscode.Event<PickScheduleData> = this._onSuccess.event;
|
||||||
|
|
||||||
|
constructor(ownerUri: string) {
|
||||||
|
this.model = new PickScheduleData(ownerUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async showDialog() {
|
||||||
|
await this.model.initialize();
|
||||||
|
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
|
||||||
|
this.initializeContent();
|
||||||
|
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;
|
||||||
|
|
||||||
|
sqlops.window.modelviewdialog.openDialog(this.dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
private initializeContent() {
|
||||||
|
this.dialog.registerContent(async view => {
|
||||||
|
this.schedulesTable = view.modelBuilder.table()
|
||||||
|
.withProperties({
|
||||||
|
columns: [
|
||||||
|
'Schedule Name'
|
||||||
|
],
|
||||||
|
data: [],
|
||||||
|
height: 600,
|
||||||
|
width: 400
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: this.schedulesTable,
|
||||||
|
title: 'Schedules'
|
||||||
|
}]).withLayout({ width: '100%' }).component();
|
||||||
|
|
||||||
|
await view.initializeModel(formModel);
|
||||||
|
|
||||||
|
if (this.model.schedules) {
|
||||||
|
let data: any[][] = [];
|
||||||
|
for (let i = 0; i < this.model.schedules.length; ++i) {
|
||||||
|
let schedule = this.model.schedules[i];
|
||||||
|
data[i] = [ schedule.name ];
|
||||||
|
}
|
||||||
|
this.schedulesTable.data = data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async execute() {
|
||||||
|
this.updateModel();
|
||||||
|
await this.model.save();
|
||||||
|
this._onSuccess.fire(this.model);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async cancel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateModel() {
|
||||||
|
let selectedRows = this.schedulesTable.selectedRows;
|
||||||
|
if (selectedRows && selectedRows.length > 0) {
|
||||||
|
let selectedRow = selectedRows[0];
|
||||||
|
this.model.selectedSchedule = this.model.schedules[selectedRow];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,12 +6,10 @@
|
|||||||
|
|
||||||
import vscode = require('vscode');
|
import vscode = require('vscode');
|
||||||
import { MainController } from './mainController';
|
import { MainController } from './mainController';
|
||||||
import { ApiWrapper } from './apiWrapper';
|
|
||||||
export let controller: MainController;
|
export let controller: MainController;
|
||||||
|
|
||||||
export function activate(context: vscode.ExtensionContext) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
let apiWrapper = new ApiWrapper();
|
controller = new MainController(context);
|
||||||
controller = new MainController(context, apiWrapper);
|
|
||||||
controller.activate();
|
controller.activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,24 +3,47 @@
|
|||||||
* 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 vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as data from 'sqlops';
|
import { CreateAlertDialog } from './dialogs/createAlertDialog';
|
||||||
import { ApiWrapper } from './apiWrapper';
|
import { CreateJobDialog } from './dialogs/createJobDialog';
|
||||||
|
import { CreateStepDialog } from './dialogs/createStepDialog';
|
||||||
|
import { PickScheduleDialog } from './dialogs/pickScheduleDialog';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main controller class that initializes the extension
|
* The main controller class that initializes the extension
|
||||||
*/
|
*/
|
||||||
export class MainController {
|
export class MainController {
|
||||||
protected _apiWrapper: ApiWrapper;
|
|
||||||
protected _context: vscode.ExtensionContext;
|
protected _context: vscode.ExtensionContext;
|
||||||
|
|
||||||
// PUBLIC METHODS //////////////////////////////////////////////////////
|
// PUBLIC METHODS //////////////////////////////////////////////////////
|
||||||
public constructor(context: vscode.ExtensionContext, apiWrapper?: ApiWrapper) {
|
public constructor(context: vscode.ExtensionContext) {
|
||||||
this._apiWrapper = apiWrapper || new ApiWrapper();
|
|
||||||
this._context = context;
|
this._context = context;
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Got: ' + apiWrapper);
|
/**
|
||||||
|
* Activates the extension
|
||||||
|
*/
|
||||||
|
public activate(): void {
|
||||||
|
vscode.commands.registerCommand('agent.openCreateJobDialog', (ownerUri: string) => {
|
||||||
|
let dialog = new CreateJobDialog(ownerUri);
|
||||||
|
dialog.showDialog();
|
||||||
|
});
|
||||||
|
vscode.commands.registerCommand('agent.openNewStepDialog', (ownerUri: string, jobId: string, server: string, stepId: number) => {
|
||||||
|
let dialog = new CreateStepDialog(ownerUri, jobId, server, stepId);
|
||||||
|
dialog.openNewStepDialog();
|
||||||
|
});
|
||||||
|
vscode.commands.registerCommand('agent.openPickScheduleDialog', (ownerUri: string) => {
|
||||||
|
let dialog = new PickScheduleDialog(ownerUri);
|
||||||
|
dialog.showDialog();
|
||||||
|
});
|
||||||
|
vscode.commands.registerCommand('agent.openCreateAlertDialog', (ownerUri: string) => {
|
||||||
|
let dialog = new CreateAlertDialog(ownerUri);
|
||||||
|
dialog.showDialog();
|
||||||
|
});
|
||||||
|
vscode.commands.registerCommand('agent.openCreateOperatorDialog', (ownerUri: string) => {
|
||||||
|
});
|
||||||
|
vscode.commands.registerCommand('agent.openCreateProxyDialog', (ownerUri: string) => {
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,11 +51,4 @@ export class MainController {
|
|||||||
*/
|
*/
|
||||||
public deactivate(): void {
|
public deactivate(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
public activate(): void {
|
|
||||||
|
|
||||||
this._apiWrapper.registerWebviewProvider('data-management-agent', webview => {
|
|
||||||
webview.html = '<div><h1>SQL Agent</h1></div>';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
extensions/agent/client/src/typings/ref.d.ts
vendored
@@ -5,4 +5,5 @@
|
|||||||
|
|
||||||
/// <reference path='../../../../../src/vs/vscode.d.ts'/>
|
/// <reference path='../../../../../src/vs/vscode.d.ts'/>
|
||||||
/// <reference path='../../../../../src/sql/sqlops.d.ts'/>
|
/// <reference path='../../../../../src/sql/sqlops.d.ts'/>
|
||||||
|
/// <reference path='../../../../../src/sql/sqlops.proposed.d.ts'/>
|
||||||
/// <reference types='@types/node'/>
|
/// <reference types='@types/node'/>
|
||||||
3234
extensions/agent/package-lock.json
generated
Normal file
@@ -9,15 +9,12 @@
|
|||||||
"icon": "images/sqlserver.png",
|
"icon": "images/sqlserver.png",
|
||||||
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "0.10.x"
|
"vscode": "0.10.x"
|
||||||
},
|
},
|
||||||
"activationEvents": [
|
"activationEvents": [
|
||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
"main": "./client/out/main",
|
"main": "./client/out/main",
|
||||||
"scripts": {
|
|
||||||
"compile": "gulp compile-extension:agent-client"
|
|
||||||
},
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Microsoft/sqlopsstudio.git"
|
"url": "https://github.com/Microsoft/sqlopsstudio.git"
|
||||||
@@ -29,22 +26,25 @@
|
|||||||
"outputChannels": [
|
"outputChannels": [
|
||||||
"sqlagent"
|
"sqlagent"
|
||||||
],
|
],
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"command": "agent.openNewStepDialog",
|
||||||
|
"title": "agent.openNewStepDialog"
|
||||||
|
}
|
||||||
|
],
|
||||||
"dashboard.tabs": [
|
"dashboard.tabs": [
|
||||||
{
|
{
|
||||||
"id": "data-management-agent",
|
"id": "data-management-agent",
|
||||||
"description": "Manage and troubleshoot SQL Agent jobs",
|
"description": "Manage and troubleshoot SQL Agent jobs",
|
||||||
"provider": "MSSQL",
|
"provider": "MSSQL",
|
||||||
"title": "SQL Agent",
|
"title": "SQL Agent",
|
||||||
"when": "connectionProvider == 'MSSQL' && !mssql:iscloud",
|
"when": "connectionProvider == 'MSSQL' && !mssql:iscloud",
|
||||||
"container": {
|
"container": {
|
||||||
"controlhost-container": {
|
"controlhost-container": {
|
||||||
"type": "agent"
|
"type": "agent"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"vscode": "1.0.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
See [documentation](https://code.visualstudio.com/docs/editor/versioncontrol#_merge-conflicts).
|
See [documentation](https://code.visualstudio.com/docs/editor/versioncontrol#_merge-conflicts).
|
||||||
|
|
||||||
**Notice** This is a an extension that is bundled with Visual Studio Code.
|
**Notice** This is a an extension that is bundled with SQL Operations Studio.
|
||||||
|
|||||||
@@ -658,7 +658,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.1.7",
|
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.1.9",
|
||||||
"opener": "^1.4.3",
|
"opener": "^1.4.3",
|
||||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.2",
|
"service-downloader": "github:anthonydresser/service-downloader#0.1.2",
|
||||||
"vscode-extension-telemetry": "^0.0.15"
|
"vscode-extension-telemetry": "^0.0.15"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||||
"version": "1.4.0-alpha.35",
|
"version": "1.5.0-alpha.2",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_86": "win-x86-netcoreapp2.1.zip",
|
"Windows_86": "win-x86-netcoreapp2.1.zip",
|
||||||
"Windows_64": "win-x64-netcoreapp2.1.zip",
|
"Windows_64": "win-x64-netcoreapp2.1.zip",
|
||||||
@@ -16,4 +16,4 @@
|
|||||||
},
|
},
|
||||||
"installDirectory": "../sqltoolsservice/{#platform#}/{#version#}",
|
"installDirectory": "../sqltoolsservice/{#platform#}/{#version#}",
|
||||||
"executableFiles": ["MicrosoftSqlToolsServiceLayer.exe", "MicrosoftSqlToolsServiceLayer"]
|
"executableFiles": ["MicrosoftSqlToolsServiceLayer.exe", "MicrosoftSqlToolsServiceLayer"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default class ContextProvider {
|
|||||||
public onDashboardOpen(e: sqlops.DashboardDocument): void {
|
public onDashboardOpen(e: sqlops.DashboardDocument): void {
|
||||||
let iscloud: boolean;
|
let iscloud: boolean;
|
||||||
let edition: number;
|
let edition: number;
|
||||||
if (e.profile.providerName.toLowerCase() === 'mssql' && !types.isUndefinedOrNull(e.serverInfo.engineEditionId)) {
|
if (e.profile.providerName.toLowerCase() === 'mssql' && !types.isUndefinedOrNull(e.serverInfo) && !types.isUndefinedOrNull(e.serverInfo.engineEditionId)) {
|
||||||
if (isCloudEditions.some(i => i === e.serverInfo.engineEditionId)) {
|
if (isCloudEditions.some(i => i === e.serverInfo.engineEditionId)) {
|
||||||
iscloud = true;
|
iscloud = true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,9 +5,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { NotificationType, RequestType } from 'vscode-languageclient';
|
import { NotificationType, RequestType } from 'vscode-languageclient';
|
||||||
import * as sqlops from 'sqlops';
|
|
||||||
|
|
||||||
import { ITelemetryEventProperties, ITelemetryEventMeasures } from './telemetry';
|
import { ITelemetryEventProperties, ITelemetryEventMeasures } from './telemetry';
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
|
|
||||||
// ------------------------------- < Telemetry Sent Event > ------------------------------------
|
// ------------------------------- < Telemetry Sent Event > ------------------------------------
|
||||||
|
|
||||||
@@ -31,50 +30,253 @@ export class TelemetryParams {
|
|||||||
|
|
||||||
// ------------------------------- </ Telemetry Sent Event > ----------------------------------
|
// ------------------------------- </ Telemetry Sent Event > ----------------------------------
|
||||||
|
|
||||||
|
// ------------------------------- < Agent Management > ------------------------------------
|
||||||
// Job Management types
|
// Job management parameters
|
||||||
export interface AgentJobsParams {
|
export interface AgentJobsParams {
|
||||||
ownerUri: string;
|
ownerUri: string;
|
||||||
jobId: string;
|
jobId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AgentJobsResult {
|
|
||||||
succeeded: boolean;
|
|
||||||
errorMessage: string;
|
|
||||||
jobs: sqlops.AgentJobInfo[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AgentJobHistoryParams {
|
export interface AgentJobHistoryParams {
|
||||||
ownerUri: string;
|
ownerUri: string;
|
||||||
jobId: string;
|
jobId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AgentJobHistoryResult {
|
|
||||||
succeeded: boolean;
|
|
||||||
errorMessage: string;
|
|
||||||
jobs: sqlops.AgentJobHistoryInfo[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AgentJobActionParams {
|
export interface AgentJobActionParams {
|
||||||
ownerUri: string;
|
ownerUri: string;
|
||||||
jobName: string;
|
jobName: string;
|
||||||
action: string;
|
action: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AgentJobActionResult {
|
export interface CreateAgentJobParams {
|
||||||
succeeded: boolean;
|
ownerUri: string;
|
||||||
errorMessage: string;
|
job: sqlops.AgentJobInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UpdateAgentJobParams {
|
||||||
|
ownerUri: string;
|
||||||
|
originalJobName: string;
|
||||||
|
job: sqlops.AgentJobInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteAgentJobParams {
|
||||||
|
ownerUri: string;
|
||||||
|
job: sqlops.AgentJobInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AgentJobDefaultsParams {
|
||||||
|
ownerUri: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Job Step management parameters
|
||||||
|
export interface CreateAgentJobStepParams {
|
||||||
|
ownerUri: string;
|
||||||
|
step: sqlops.AgentJobStepInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateAgentJobStepParams {
|
||||||
|
ownerUri: string;
|
||||||
|
originalJobStepName: string;
|
||||||
|
step: sqlops.AgentJobStepInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteAgentJobStepParams {
|
||||||
|
ownerUri: string;
|
||||||
|
step: sqlops.AgentJobStepInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alert management parameters
|
||||||
|
export interface AgentAlertsParams {
|
||||||
|
ownerUri: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateAgentAlertParams {
|
||||||
|
ownerUri: string;
|
||||||
|
alert: sqlops.AgentAlertInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateAgentAlertParams {
|
||||||
|
ownerUri: string;
|
||||||
|
originalAlertName: string;
|
||||||
|
alert: sqlops.AgentAlertInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteAgentAlertParams {
|
||||||
|
ownerUri: string;
|
||||||
|
alert: sqlops.AgentAlertInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Operator management parameters
|
||||||
|
export interface AgentOperatorsParams {
|
||||||
|
ownerUri: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateAgentOperatorParams {
|
||||||
|
ownerUri: string;
|
||||||
|
operator: sqlops.AgentOperatorInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateAgentOperatorParams {
|
||||||
|
ownerUri: string;
|
||||||
|
originalOperatorName: string;
|
||||||
|
operator: sqlops.AgentOperatorInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteAgentOperatorParams {
|
||||||
|
ownerUri: string;
|
||||||
|
operator: sqlops.AgentOperatorInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Proxy management parameters
|
||||||
|
export interface AgentProxiesParams {
|
||||||
|
ownerUri: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateAgentProxyParams {
|
||||||
|
ownerUri: string;
|
||||||
|
proxy: sqlops.AgentProxyInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateAgentProxyParams {
|
||||||
|
ownerUri: string;
|
||||||
|
originalProxyName: string;
|
||||||
|
proxy: sqlops.AgentProxyInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteAgentProxyParams {
|
||||||
|
ownerUri: string;
|
||||||
|
proxy: sqlops.AgentProxyInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Job Schedule management parameters
|
||||||
|
export interface AgentJobScheduleParams {
|
||||||
|
ownerUri: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateAgentJobScheduleParams {
|
||||||
|
ownerUri: string;
|
||||||
|
schedule: sqlops.AgentJobScheduleInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateAgentJobScheduleParams {
|
||||||
|
ownerUri: string;
|
||||||
|
originalScheduleName: string;
|
||||||
|
schedule: sqlops.AgentJobScheduleInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteAgentJobScheduleParams {
|
||||||
|
ownerUri: string;
|
||||||
|
schedule: sqlops.AgentJobScheduleInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Agent Job management requests
|
||||||
export namespace AgentJobsRequest {
|
export namespace AgentJobsRequest {
|
||||||
export const type = new RequestType<AgentJobsParams, AgentJobsResult, void, void>('agent/jobs');
|
export const type = new RequestType<AgentJobsParams, sqlops.AgentJobsResult, void, void>('agent/jobs');
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace AgentJobHistoryRequest {
|
export namespace AgentJobHistoryRequest {
|
||||||
export const type = new RequestType<AgentJobHistoryParams, AgentJobHistoryResult, void, void>('agent/jobhistory');
|
export const type = new RequestType<AgentJobHistoryParams, sqlops.AgentJobHistoryResult, void, void>('agent/jobhistory');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export namespace AgentJobActionRequest {
|
export namespace AgentJobActionRequest {
|
||||||
export const type = new RequestType<AgentJobActionParams, AgentJobActionResult, void, void>('agent/jobaction');
|
export const type = new RequestType<AgentJobActionParams, sqlops.ResultStatus, void, void>('agent/jobaction');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export namespace CreateAgentJobRequest {
|
||||||
|
export const type = new RequestType<CreateAgentJobParams, sqlops.CreateAgentJobResult, void, void>('agent/createjob');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UpdateAgentJobRequest {
|
||||||
|
export const type = new RequestType<UpdateAgentJobParams, sqlops.UpdateAgentJobResult, void, void>('agent/updatejob');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace DeleteAgentJobRequest {
|
||||||
|
export const type = new RequestType<DeleteAgentJobParams, sqlops.ResultStatus, void, void>('agent/deletejob');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace AgentJobDefaultsRequest {
|
||||||
|
export const type = new RequestType<AgentJobDefaultsParams, sqlops.AgentJobDefaultsResult, void, void>('agent/jobdefaults');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Job Step requests
|
||||||
|
export namespace CreateAgentJobStepRequest {
|
||||||
|
export const type = new RequestType<CreateAgentJobStepParams, sqlops.CreateAgentJobStepResult, void, void>('agent/createjobstep');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UpdateAgentJobStepRequest {
|
||||||
|
export const type = new RequestType<UpdateAgentJobStepParams, sqlops.UpdateAgentJobStepResult, void, void>('agent/updatejobstep');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace DeleteAgentJobStepRequest {
|
||||||
|
export const type = new RequestType<DeleteAgentJobStepParams, sqlops.ResultStatus, void, void>('agent/deletejobstep');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alerts requests
|
||||||
|
export namespace AgentAlertsRequest {
|
||||||
|
export const type = new RequestType<CreateAgentAlertParams, sqlops.AgentAlertsResult, void, void>('agent/alerts');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace CreateAgentAlertRequest {
|
||||||
|
export const type = new RequestType<CreateAgentAlertParams, sqlops.CreateAgentAlertResult, void, void>('agent/createalert');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UpdateAgentAlertRequest {
|
||||||
|
export const type = new RequestType<UpdateAgentAlertParams, sqlops.UpdateAgentAlertResult, void, void>('agent/updatealert');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace DeleteAgentAlertRequest {
|
||||||
|
export const type = new RequestType<DeleteAgentAlertParams, sqlops.ResultStatus, void, void>('agent/deletealert');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Operators requests
|
||||||
|
export namespace AgentOperatorsRequest {
|
||||||
|
export const type = new RequestType<CreateAgentOperatorParams, sqlops.AgentOperatorsResult, void, void>('agent/operators');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace CreateAgentOperatorRequest {
|
||||||
|
export const type = new RequestType<CreateAgentOperatorParams, sqlops.CreateAgentOperatorResult, void, void>('agent/createoperator');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UpdateAgentOperatorRequest {
|
||||||
|
export const type = new RequestType<UpdateAgentOperatorParams, sqlops.UpdateAgentOperatorResult, void, void>('agent/updateoperator');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace DeleteAgentOperatorRequest {
|
||||||
|
export const type = new RequestType<DeleteAgentOperatorParams, sqlops.ResultStatus, void, void>('agent/deleteoperator');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Proxies requests
|
||||||
|
export namespace AgentProxiesRequest {
|
||||||
|
export const type = new RequestType<CreateAgentProxyParams, sqlops.AgentProxiesResult, void, void>('agent/proxies');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace CreateAgentProxyRequest {
|
||||||
|
export const type = new RequestType<CreateAgentProxyParams, sqlops.CreateAgentProxyResult, void, void>('agent/createproxy');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UpdateAgentProxyRequest {
|
||||||
|
export const type = new RequestType<UpdateAgentProxyParams, sqlops.UpdateAgentProxyResult, void, void>('agent/updateproxy');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace DeleteAgentProxyRequest {
|
||||||
|
export const type = new RequestType<DeleteAgentProxyParams, sqlops.ResultStatus, void, void>('agent/deleteproxy');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Job Schedules requests
|
||||||
|
export namespace AgentJobSchedulesRequest {
|
||||||
|
export const type = new RequestType<AgentJobScheduleParams, sqlops.AgentJobSchedulesResult, void, void>('agent/schedules');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace CreateAgentJobScheduleRequest {
|
||||||
|
export const type = new RequestType<CreateAgentJobScheduleParams, sqlops.CreateAgentJobScheduleResult, void, void>('agent/createschedule');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UpdateAgentJobScheduleRequest {
|
||||||
|
export const type = new RequestType<UpdateAgentJobScheduleParams, sqlops.UpdateAgentJobScheduleResult, void, void>('agent/updateschedule');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace DeleteAgentJobScheduleRequest {
|
||||||
|
export const type = new RequestType<DeleteAgentJobScheduleParams, sqlops.ResultStatus, void, void>('agent/deleteschedule');
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------- < Agent Management > ------------------------------------
|
||||||
|
|||||||
@@ -6,13 +6,12 @@
|
|||||||
|
|
||||||
import { SqlOpsDataClient, SqlOpsFeature } from 'dataprotocol-client';
|
import { SqlOpsDataClient, SqlOpsFeature } from 'dataprotocol-client';
|
||||||
import { ClientCapabilities, StaticFeature, RPCMessageType, ServerCapabilities } from 'vscode-languageclient';
|
import { ClientCapabilities, StaticFeature, RPCMessageType, ServerCapabilities } from 'vscode-languageclient';
|
||||||
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
|
|
||||||
import { Disposable } from 'vscode';
|
import { Disposable } from 'vscode';
|
||||||
import * as sqlops from 'sqlops';
|
|
||||||
|
|
||||||
import { Telemetry } from './telemetry';
|
import { Telemetry } from './telemetry';
|
||||||
|
import * as contracts from './contracts';
|
||||||
|
import * as sqlops from 'sqlops';
|
||||||
import * as Utils from './utils';
|
import * as Utils from './utils';
|
||||||
import { TelemetryNotification, AgentJobsRequest, AgentJobActionRequest, AgentJobHistoryRequest, AgentJobsParams, AgentJobHistoryParams, AgentJobActionParams } from './contracts';
|
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
|
||||||
|
|
||||||
export class TelemetryFeature implements StaticFeature {
|
export class TelemetryFeature implements StaticFeature {
|
||||||
|
|
||||||
@@ -23,7 +22,7 @@ export class TelemetryFeature implements StaticFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initialize(): void {
|
initialize(): void {
|
||||||
this._client.onNotification(TelemetryNotification.type, e => {
|
this._client.onNotification(contracts.TelemetryNotification.type, e => {
|
||||||
Telemetry.sendTelemetryEvent(e.params.eventName, e.params.properties, e.params.measures);
|
Telemetry.sendTelemetryEvent(e.params.eventName, e.params.properties, e.params.measures);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -31,9 +30,9 @@ export class TelemetryFeature implements StaticFeature {
|
|||||||
|
|
||||||
export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||||
private static readonly messagesTypes: RPCMessageType[] = [
|
private static readonly messagesTypes: RPCMessageType[] = [
|
||||||
AgentJobsRequest.type,
|
contracts.AgentJobsRequest.type,
|
||||||
AgentJobHistoryRequest.type,
|
contracts.AgentJobHistoryRequest.type,
|
||||||
AgentJobActionRequest.type
|
contracts.AgentJobActionRequest.type
|
||||||
];
|
];
|
||||||
|
|
||||||
constructor(client: SqlOpsDataClient) {
|
constructor(client: SqlOpsDataClient) {
|
||||||
@@ -55,35 +54,387 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
|||||||
protected registerProvider(options: undefined): Disposable {
|
protected registerProvider(options: undefined): Disposable {
|
||||||
const client = this._client;
|
const client = this._client;
|
||||||
|
|
||||||
|
// Job management methods
|
||||||
let getJobs = (ownerUri: string): Thenable<sqlops.AgentJobsResult> => {
|
let getJobs = (ownerUri: string): Thenable<sqlops.AgentJobsResult> => {
|
||||||
let params: AgentJobsParams = { ownerUri: ownerUri, jobId: null };
|
let params: contracts.AgentJobsParams = { ownerUri: ownerUri, jobId: null };
|
||||||
return client.sendRequest(AgentJobsRequest.type, params).then(
|
return client.sendRequest(contracts.AgentJobsRequest.type, params).then(
|
||||||
r => r,
|
r => r,
|
||||||
e => {
|
e => {
|
||||||
client.logFailedRequest(AgentJobsRequest.type, e);
|
client.logFailedRequest(contracts.AgentJobsRequest.type, e);
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
let getJobHistory = (connectionUri: string, jobID: string): Thenable<sqlops.AgentJobHistoryResult> => {
|
let getJobHistory = (ownerUri: string, jobID: string): Thenable<sqlops.AgentJobHistoryResult> => {
|
||||||
let params: AgentJobHistoryParams = { ownerUri: connectionUri, jobId: jobID };
|
let params: contracts.AgentJobHistoryParams = { ownerUri: ownerUri, jobId: jobID };
|
||||||
|
|
||||||
return client.sendRequest(AgentJobHistoryRequest.type, params).then(
|
return client.sendRequest(contracts.AgentJobHistoryRequest.type, params).then(
|
||||||
r => r,
|
r => r,
|
||||||
e => {
|
e => {
|
||||||
client.logFailedRequest(AgentJobHistoryRequest.type, e);
|
client.logFailedRequest(contracts.AgentJobHistoryRequest.type, e);
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
let jobAction = (connectionUri: string, jobName: string, action: string): Thenable<sqlops.AgentJobActionResult> => {
|
let jobAction = (ownerUri: string, jobName: string, action: string): Thenable<sqlops.ResultStatus> => {
|
||||||
let params: AgentJobActionParams = { ownerUri: connectionUri, jobName: jobName, action: action };
|
let params: contracts.AgentJobActionParams = { ownerUri: ownerUri, jobName: jobName, action: action };
|
||||||
return client.sendRequest(AgentJobActionRequest.type, params).then(
|
return client.sendRequest(contracts.AgentJobActionRequest.type, params).then(
|
||||||
r => r,
|
r => r,
|
||||||
e => {
|
e => {
|
||||||
client.logFailedRequest(AgentJobActionRequest.type, e);
|
client.logFailedRequest(contracts.AgentJobActionRequest.type, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let createJob = (ownerUri: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.CreateAgentJobResult> => {
|
||||||
|
let params: contracts.CreateAgentJobParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
job: jobInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.CreateAgentJobRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let updateJob = (ownerUri: string, originalJobName: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.UpdateAgentJobResult> => {
|
||||||
|
let params: contracts.UpdateAgentJobParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
originalJobName: originalJobName,
|
||||||
|
job: jobInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.UpdateAgentJobRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let deleteJob = (ownerUri: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.ResultStatus> => {
|
||||||
|
let params: contracts.DeleteAgentJobParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
job: jobInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.DeleteAgentJobRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let getJobDefaults = (ownerUri: string): Thenable<sqlops.AgentJobDefaultsResult> => {
|
||||||
|
let params: contracts.AgentJobDefaultsParams = {
|
||||||
|
ownerUri: ownerUri
|
||||||
|
};
|
||||||
|
let requestType = contracts.AgentJobDefaultsRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Job Step management methods
|
||||||
|
let createJobStep = (ownerUri: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.CreateAgentJobStepResult> => {
|
||||||
|
let params: contracts.CreateAgentJobStepParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
step: stepInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.CreateAgentJobStepRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let updateJobStep = (ownerUri: string, originalJobStepName: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.UpdateAgentJobStepResult> => {
|
||||||
|
let params: contracts.UpdateAgentJobStepParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
originalJobStepName: originalJobStepName,
|
||||||
|
step: stepInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.UpdateAgentJobStepRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let deleteJobStep = (ownerUri: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.ResultStatus> => {
|
||||||
|
let params: contracts.DeleteAgentJobStepParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
step: stepInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.DeleteAgentJobStepRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Alert management methods
|
||||||
|
let getAlerts = (ownerUri: string): Thenable<sqlops.AgentAlertsResult> => {
|
||||||
|
let params: contracts.AgentAlertsParams = {
|
||||||
|
ownerUri: ownerUri
|
||||||
|
};
|
||||||
|
let requestType = contracts.AgentAlertsRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let createAlert = (ownerUri: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.CreateAgentAlertResult> => {
|
||||||
|
let params: contracts.CreateAgentAlertParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
alert: alertInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.CreateAgentAlertRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let updateAlert = (ownerUri: string, originalAlertName: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.UpdateAgentAlertResult> => {
|
||||||
|
let params: contracts.UpdateAgentAlertParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
originalAlertName: originalAlertName,
|
||||||
|
alert: alertInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.UpdateAgentAlertRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let deleteAlert = (ownerUri: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.ResultStatus> => {
|
||||||
|
let params: contracts.DeleteAgentAlertParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
alert: alertInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.DeleteAgentAlertRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Operator management methods
|
||||||
|
let getOperators = (ownerUri: string): Thenable<sqlops.AgentOperatorsResult> => {
|
||||||
|
let params: contracts.AgentOperatorsParams = {
|
||||||
|
ownerUri: ownerUri
|
||||||
|
};
|
||||||
|
let requestType = contracts.AgentOperatorsRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let createOperator = (ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.CreateAgentOperatorResult> => {
|
||||||
|
let params: contracts.CreateAgentOperatorParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
operator: operatorInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.CreateAgentOperatorRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let updateOperator = (ownerUri: string, originalOperatorName: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.UpdateAgentOperatorResult> => {
|
||||||
|
let params: contracts.UpdateAgentOperatorParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
originalOperatorName: originalOperatorName,
|
||||||
|
operator: operatorInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.UpdateAgentOperatorRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let deleteOperator = (ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.ResultStatus> => {
|
||||||
|
let params: contracts.DeleteAgentOperatorParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
operator: operatorInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.DeleteAgentOperatorRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Proxy management methods
|
||||||
|
let getProxies = (ownerUri: string): Thenable<sqlops.AgentProxiesResult> => {
|
||||||
|
let params: contracts.AgentProxiesParams = {
|
||||||
|
ownerUri: ownerUri
|
||||||
|
};
|
||||||
|
let requestType = contracts.AgentProxiesRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let createProxy = (ownerUri: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.CreateAgentOperatorResult> => {
|
||||||
|
let params: contracts.CreateAgentProxyParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
proxy: proxyInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.CreateAgentProxyRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let updateProxy = (ownerUri: string, originalProxyName: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.UpdateAgentOperatorResult> => {
|
||||||
|
let params: contracts.UpdateAgentProxyParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
originalProxyName: originalProxyName,
|
||||||
|
proxy: proxyInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.UpdateAgentProxyRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let deleteProxy = (ownerUri: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.ResultStatus> => {
|
||||||
|
let params: contracts.DeleteAgentProxyParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
proxy: proxyInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.DeleteAgentProxyRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Job Schedule management methods
|
||||||
|
let getJobSchedules = (ownerUri: string): Thenable<sqlops.AgentJobSchedulesResult> => {
|
||||||
|
let params: contracts.AgentJobScheduleParams = {
|
||||||
|
ownerUri: ownerUri
|
||||||
|
};
|
||||||
|
let requestType = contracts.AgentJobSchedulesRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let createJobSchedule = (ownerUri: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.CreateAgentJobScheduleResult> => {
|
||||||
|
let params: contracts.CreateAgentJobScheduleParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
schedule: scheduleInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.CreateAgentJobScheduleRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let updateJobSchedule = (ownerUri: string, originalScheduleName: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.UpdateAgentJobScheduleResult> => {
|
||||||
|
let params: contracts.UpdateAgentJobScheduleParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
originalScheduleName: originalScheduleName,
|
||||||
|
schedule: scheduleInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.UpdateAgentJobScheduleRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
let deleteJobSchedule = (ownerUri: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.ResultStatus> => {
|
||||||
|
let params: contracts.DeleteAgentJobScheduleParams = {
|
||||||
|
ownerUri: ownerUri,
|
||||||
|
schedule: scheduleInfo
|
||||||
|
};
|
||||||
|
let requestType = contracts.DeleteAgentJobScheduleRequest.type;
|
||||||
|
return client.sendRequest(requestType, params).then(
|
||||||
|
r => r,
|
||||||
|
e => {
|
||||||
|
client.logFailedRequest(requestType, e);
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -93,7 +444,30 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
|||||||
providerId: client.providerId,
|
providerId: client.providerId,
|
||||||
getJobs,
|
getJobs,
|
||||||
getJobHistory,
|
getJobHistory,
|
||||||
jobAction
|
jobAction,
|
||||||
|
createJob,
|
||||||
|
updateJob,
|
||||||
|
deleteJob,
|
||||||
|
getJobDefaults,
|
||||||
|
createJobStep,
|
||||||
|
updateJobStep,
|
||||||
|
deleteJobStep,
|
||||||
|
getAlerts,
|
||||||
|
createAlert,
|
||||||
|
updateAlert,
|
||||||
|
deleteAlert,
|
||||||
|
getOperators,
|
||||||
|
createOperator,
|
||||||
|
updateOperator,
|
||||||
|
deleteOperator,
|
||||||
|
getProxies,
|
||||||
|
createProxy,
|
||||||
|
updateProxy,
|
||||||
|
deleteProxy,
|
||||||
|
getJobSchedules,
|
||||||
|
createJobSchedule,
|
||||||
|
updateJobSchedule,
|
||||||
|
deleteJobSchedule
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,396 +1,396 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
agent-base@4, agent-base@^4.1.0:
|
agent-base@4, agent-base@^4.1.0:
|
||||||
version "4.2.0"
|
version "4.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce"
|
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce"
|
||||||
dependencies:
|
dependencies:
|
||||||
es6-promisify "^5.0.0"
|
es6-promisify "^5.0.0"
|
||||||
|
|
||||||
applicationinsights@1.0.1:
|
applicationinsights@1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
||||||
dependencies:
|
dependencies:
|
||||||
diagnostic-channel "0.2.0"
|
diagnostic-channel "0.2.0"
|
||||||
diagnostic-channel-publishers "0.2.1"
|
diagnostic-channel-publishers "0.2.1"
|
||||||
zone.js "0.7.6"
|
zone.js "0.7.6"
|
||||||
|
|
||||||
base64-js@0.0.8:
|
base64-js@0.0.8:
|
||||||
version "0.0.8"
|
version "0.0.8"
|
||||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978"
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978"
|
||||||
|
|
||||||
bl@^1.0.0:
|
bl@^1.0.0:
|
||||||
version "1.2.2"
|
version "1.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c"
|
resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c"
|
||||||
dependencies:
|
dependencies:
|
||||||
readable-stream "^2.3.5"
|
readable-stream "^2.3.5"
|
||||||
safe-buffer "^5.1.1"
|
safe-buffer "^5.1.1"
|
||||||
|
|
||||||
buffer-crc32@~0.2.3:
|
buffer-crc32@~0.2.3:
|
||||||
version "0.2.13"
|
version "0.2.13"
|
||||||
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
|
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
|
||||||
|
|
||||||
buffer@^3.0.1:
|
buffer@^3.0.1:
|
||||||
version "3.6.0"
|
version "3.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb"
|
resolved "https://registry.yarnpkg.com/buffer/-/buffer-3.6.0.tgz#a72c936f77b96bf52f5f7e7b467180628551defb"
|
||||||
dependencies:
|
dependencies:
|
||||||
base64-js "0.0.8"
|
base64-js "0.0.8"
|
||||||
ieee754 "^1.1.4"
|
ieee754 "^1.1.4"
|
||||||
isarray "^1.0.0"
|
isarray "^1.0.0"
|
||||||
|
|
||||||
commander@~2.8.1:
|
commander@~2.8.1:
|
||||||
version "2.8.1"
|
version "2.8.1"
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4"
|
||||||
dependencies:
|
dependencies:
|
||||||
graceful-readlink ">= 1.0.0"
|
graceful-readlink ">= 1.0.0"
|
||||||
|
|
||||||
core-util-is@~1.0.0:
|
core-util-is@~1.0.0:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||||
|
|
||||||
"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#0.1.7":
|
"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#0.1.9":
|
||||||
version "0.1.7"
|
version "0.1.9"
|
||||||
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/d50285b03d0d5073c086362c5c96afb279320607"
|
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/a1a79895cb79658b75d78aa5cfd745855019148d"
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-languageclient "3.5.0"
|
vscode-languageclient "3.5.0"
|
||||||
|
|
||||||
debug@3.1.0, debug@^3.1.0:
|
debug@3.1.0, debug@^3.1.0:
|
||||||
version "3.1.0"
|
version "3.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||||
dependencies:
|
dependencies:
|
||||||
ms "2.0.0"
|
ms "2.0.0"
|
||||||
|
|
||||||
decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1:
|
decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1:
|
||||||
version "4.1.1"
|
version "4.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1"
|
resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1"
|
||||||
dependencies:
|
dependencies:
|
||||||
file-type "^5.2.0"
|
file-type "^5.2.0"
|
||||||
is-stream "^1.1.0"
|
is-stream "^1.1.0"
|
||||||
tar-stream "^1.5.2"
|
tar-stream "^1.5.2"
|
||||||
|
|
||||||
decompress-tarbz2@^4.0.0:
|
decompress-tarbz2@^4.0.0:
|
||||||
version "4.1.1"
|
version "4.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b"
|
resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b"
|
||||||
dependencies:
|
dependencies:
|
||||||
decompress-tar "^4.1.0"
|
decompress-tar "^4.1.0"
|
||||||
file-type "^6.1.0"
|
file-type "^6.1.0"
|
||||||
is-stream "^1.1.0"
|
is-stream "^1.1.0"
|
||||||
seek-bzip "^1.0.5"
|
seek-bzip "^1.0.5"
|
||||||
unbzip2-stream "^1.0.9"
|
unbzip2-stream "^1.0.9"
|
||||||
|
|
||||||
decompress-targz@^4.0.0:
|
decompress-targz@^4.0.0:
|
||||||
version "4.1.1"
|
version "4.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee"
|
resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee"
|
||||||
dependencies:
|
dependencies:
|
||||||
decompress-tar "^4.1.1"
|
decompress-tar "^4.1.1"
|
||||||
file-type "^5.2.0"
|
file-type "^5.2.0"
|
||||||
is-stream "^1.1.0"
|
is-stream "^1.1.0"
|
||||||
|
|
||||||
decompress-unzip@^4.0.1:
|
decompress-unzip@^4.0.1:
|
||||||
version "4.0.1"
|
version "4.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69"
|
resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69"
|
||||||
dependencies:
|
dependencies:
|
||||||
file-type "^3.8.0"
|
file-type "^3.8.0"
|
||||||
get-stream "^2.2.0"
|
get-stream "^2.2.0"
|
||||||
pify "^2.3.0"
|
pify "^2.3.0"
|
||||||
yauzl "^2.4.2"
|
yauzl "^2.4.2"
|
||||||
|
|
||||||
decompress@^4.2.0:
|
decompress@^4.2.0:
|
||||||
version "4.2.0"
|
version "4.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d"
|
resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d"
|
||||||
dependencies:
|
dependencies:
|
||||||
decompress-tar "^4.0.0"
|
decompress-tar "^4.0.0"
|
||||||
decompress-tarbz2 "^4.0.0"
|
decompress-tarbz2 "^4.0.0"
|
||||||
decompress-targz "^4.0.0"
|
decompress-targz "^4.0.0"
|
||||||
decompress-unzip "^4.0.1"
|
decompress-unzip "^4.0.1"
|
||||||
graceful-fs "^4.1.10"
|
graceful-fs "^4.1.10"
|
||||||
make-dir "^1.0.0"
|
make-dir "^1.0.0"
|
||||||
pify "^2.3.0"
|
pify "^2.3.0"
|
||||||
strip-dirs "^2.0.0"
|
strip-dirs "^2.0.0"
|
||||||
|
|
||||||
diagnostic-channel-publishers@0.2.1:
|
diagnostic-channel-publishers@0.2.1:
|
||||||
version "0.2.1"
|
version "0.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||||
|
|
||||||
diagnostic-channel@0.2.0:
|
diagnostic-channel@0.2.0:
|
||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz#cc99af9612c23fb1fff13612c72f2cbfaa8d5a17"
|
resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz#cc99af9612c23fb1fff13612c72f2cbfaa8d5a17"
|
||||||
dependencies:
|
dependencies:
|
||||||
semver "^5.3.0"
|
semver "^5.3.0"
|
||||||
|
|
||||||
end-of-stream@^1.0.0:
|
end-of-stream@^1.0.0:
|
||||||
version "1.4.1"
|
version "1.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
|
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
|
||||||
dependencies:
|
dependencies:
|
||||||
once "^1.4.0"
|
once "^1.4.0"
|
||||||
|
|
||||||
es6-promise@^4.0.3:
|
es6-promise@^4.0.3:
|
||||||
version "4.2.4"
|
version "4.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
|
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
|
||||||
|
|
||||||
es6-promisify@^5.0.0:
|
es6-promisify@^5.0.0:
|
||||||
version "5.0.0"
|
version "5.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
|
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
|
||||||
dependencies:
|
dependencies:
|
||||||
es6-promise "^4.0.3"
|
es6-promise "^4.0.3"
|
||||||
|
|
||||||
eventemitter2@^5.0.1:
|
eventemitter2@^5.0.1:
|
||||||
version "5.0.1"
|
version "5.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-5.0.1.tgz#6197a095d5fb6b57e8942f6fd7eaad63a09c9452"
|
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-5.0.1.tgz#6197a095d5fb6b57e8942f6fd7eaad63a09c9452"
|
||||||
|
|
||||||
fd-slicer@~1.0.1:
|
fd-slicer@~1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
|
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
|
||||||
dependencies:
|
dependencies:
|
||||||
pend "~1.2.0"
|
pend "~1.2.0"
|
||||||
|
|
||||||
file-type@^3.8.0:
|
file-type@^3.8.0:
|
||||||
version "3.9.0"
|
version "3.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9"
|
resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9"
|
||||||
|
|
||||||
file-type@^5.2.0:
|
file-type@^5.2.0:
|
||||||
version "5.2.0"
|
version "5.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6"
|
resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6"
|
||||||
|
|
||||||
file-type@^6.1.0:
|
file-type@^6.1.0:
|
||||||
version "6.2.0"
|
version "6.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919"
|
resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919"
|
||||||
|
|
||||||
get-stream@^2.2.0:
|
get-stream@^2.2.0:
|
||||||
version "2.3.1"
|
version "2.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de"
|
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de"
|
||||||
dependencies:
|
dependencies:
|
||||||
object-assign "^4.0.1"
|
object-assign "^4.0.1"
|
||||||
pinkie-promise "^2.0.0"
|
pinkie-promise "^2.0.0"
|
||||||
|
|
||||||
graceful-fs@^4.1.10:
|
graceful-fs@^4.1.10:
|
||||||
version "4.1.11"
|
version "4.1.11"
|
||||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
||||||
|
|
||||||
"graceful-readlink@>= 1.0.0":
|
"graceful-readlink@>= 1.0.0":
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
|
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
|
||||||
|
|
||||||
http-proxy-agent@^2.0.0:
|
http-proxy-agent@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405"
|
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405"
|
||||||
dependencies:
|
dependencies:
|
||||||
agent-base "4"
|
agent-base "4"
|
||||||
debug "3.1.0"
|
debug "3.1.0"
|
||||||
|
|
||||||
https-proxy-agent@^2.1.1:
|
https-proxy-agent@^2.1.1:
|
||||||
version "2.2.0"
|
version "2.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.0.tgz#7fbba856be8cd677986f42ebd3664f6317257887"
|
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.0.tgz#7fbba856be8cd677986f42ebd3664f6317257887"
|
||||||
dependencies:
|
dependencies:
|
||||||
agent-base "^4.1.0"
|
agent-base "^4.1.0"
|
||||||
debug "^3.1.0"
|
debug "^3.1.0"
|
||||||
|
|
||||||
ieee754@^1.1.4:
|
ieee754@^1.1.4:
|
||||||
version "1.1.11"
|
version "1.1.11"
|
||||||
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.11.tgz#c16384ffe00f5b7835824e67b6f2bd44a5229455"
|
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.11.tgz#c16384ffe00f5b7835824e67b6f2bd44a5229455"
|
||||||
|
|
||||||
inherits@~2.0.3:
|
inherits@~2.0.3:
|
||||||
version "2.0.3"
|
version "2.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||||
|
|
||||||
is-natural-number@^4.0.1:
|
is-natural-number@^4.0.1:
|
||||||
version "4.0.1"
|
version "4.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8"
|
resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8"
|
||||||
|
|
||||||
is-stream@^1.1.0:
|
is-stream@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
||||||
|
|
||||||
isarray@^1.0.0, isarray@~1.0.0:
|
isarray@^1.0.0, isarray@~1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||||
|
|
||||||
make-dir@^1.0.0:
|
make-dir@^1.0.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b"
|
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b"
|
||||||
dependencies:
|
dependencies:
|
||||||
pify "^3.0.0"
|
pify "^3.0.0"
|
||||||
|
|
||||||
minimist@0.0.8:
|
minimist@0.0.8:
|
||||||
version "0.0.8"
|
version "0.0.8"
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||||
|
|
||||||
mkdirp@^0.5.1:
|
mkdirp@^0.5.1:
|
||||||
version "0.5.1"
|
version "0.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||||
dependencies:
|
dependencies:
|
||||||
minimist "0.0.8"
|
minimist "0.0.8"
|
||||||
|
|
||||||
ms@2.0.0:
|
ms@2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||||
|
|
||||||
object-assign@^4.0.1:
|
object-assign@^4.0.1:
|
||||||
version "4.1.1"
|
version "4.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||||
|
|
||||||
once@^1.4.0:
|
once@^1.4.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||||
dependencies:
|
dependencies:
|
||||||
wrappy "1"
|
wrappy "1"
|
||||||
|
|
||||||
opener@^1.4.3:
|
opener@^1.4.3:
|
||||||
version "1.4.3"
|
version "1.4.3"
|
||||||
resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8"
|
resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8"
|
||||||
|
|
||||||
os-tmpdir@~1.0.2:
|
os-tmpdir@~1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
|
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
|
||||||
|
|
||||||
pend@~1.2.0:
|
pend@~1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
|
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
|
||||||
|
|
||||||
pify@^2.3.0:
|
pify@^2.3.0:
|
||||||
version "2.3.0"
|
version "2.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||||
|
|
||||||
pify@^3.0.0:
|
pify@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
|
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
|
||||||
|
|
||||||
pinkie-promise@^2.0.0:
|
pinkie-promise@^2.0.0:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
|
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
|
||||||
dependencies:
|
dependencies:
|
||||||
pinkie "^2.0.0"
|
pinkie "^2.0.0"
|
||||||
|
|
||||||
pinkie@^2.0.0:
|
pinkie@^2.0.0:
|
||||||
version "2.0.4"
|
version "2.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
||||||
|
|
||||||
process-nextick-args@~2.0.0:
|
process-nextick-args@~2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
|
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
|
||||||
|
|
||||||
readable-stream@^2.0.0, readable-stream@^2.3.5:
|
readable-stream@^2.0.0, readable-stream@^2.3.5:
|
||||||
version "2.3.5"
|
version "2.3.5"
|
||||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d"
|
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d"
|
||||||
dependencies:
|
dependencies:
|
||||||
core-util-is "~1.0.0"
|
core-util-is "~1.0.0"
|
||||||
inherits "~2.0.3"
|
inherits "~2.0.3"
|
||||||
isarray "~1.0.0"
|
isarray "~1.0.0"
|
||||||
process-nextick-args "~2.0.0"
|
process-nextick-args "~2.0.0"
|
||||||
safe-buffer "~5.1.1"
|
safe-buffer "~5.1.1"
|
||||||
string_decoder "~1.0.3"
|
string_decoder "~1.0.3"
|
||||||
util-deprecate "~1.0.1"
|
util-deprecate "~1.0.1"
|
||||||
|
|
||||||
safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||||
version "5.1.1"
|
version "5.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
|
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
|
||||||
|
|
||||||
seek-bzip@^1.0.5:
|
seek-bzip@^1.0.5:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc"
|
resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc"
|
||||||
dependencies:
|
dependencies:
|
||||||
commander "~2.8.1"
|
commander "~2.8.1"
|
||||||
|
|
||||||
semver@^5.3.0:
|
semver@^5.3.0:
|
||||||
version "5.5.0"
|
version "5.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||||
|
|
||||||
"service-downloader@github:anthonydresser/service-downloader#0.1.2":
|
"service-downloader@github:anthonydresser/service-downloader#0.1.2":
|
||||||
version "0.1.2"
|
version "0.1.2"
|
||||||
resolved "https://codeload.github.com/anthonydresser/service-downloader/tar.gz/2aa9b336b6442e17e24693ddc907030575539798"
|
resolved "https://codeload.github.com/anthonydresser/service-downloader/tar.gz/2aa9b336b6442e17e24693ddc907030575539798"
|
||||||
dependencies:
|
dependencies:
|
||||||
decompress "^4.2.0"
|
decompress "^4.2.0"
|
||||||
eventemitter2 "^5.0.1"
|
eventemitter2 "^5.0.1"
|
||||||
http-proxy-agent "^2.0.0"
|
http-proxy-agent "^2.0.0"
|
||||||
https-proxy-agent "^2.1.1"
|
https-proxy-agent "^2.1.1"
|
||||||
mkdirp "^0.5.1"
|
mkdirp "^0.5.1"
|
||||||
tmp "^0.0.33"
|
tmp "^0.0.33"
|
||||||
|
|
||||||
string_decoder@~1.0.3:
|
string_decoder@~1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
|
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
|
||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer "~5.1.0"
|
safe-buffer "~5.1.0"
|
||||||
|
|
||||||
strip-dirs@^2.0.0:
|
strip-dirs@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5"
|
resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5"
|
||||||
dependencies:
|
dependencies:
|
||||||
is-natural-number "^4.0.1"
|
is-natural-number "^4.0.1"
|
||||||
|
|
||||||
tar-stream@^1.5.2:
|
tar-stream@^1.5.2:
|
||||||
version "1.5.5"
|
version "1.5.5"
|
||||||
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.5.5.tgz#5cad84779f45c83b1f2508d96b09d88c7218af55"
|
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.5.5.tgz#5cad84779f45c83b1f2508d96b09d88c7218af55"
|
||||||
dependencies:
|
dependencies:
|
||||||
bl "^1.0.0"
|
bl "^1.0.0"
|
||||||
end-of-stream "^1.0.0"
|
end-of-stream "^1.0.0"
|
||||||
readable-stream "^2.0.0"
|
readable-stream "^2.0.0"
|
||||||
xtend "^4.0.0"
|
xtend "^4.0.0"
|
||||||
|
|
||||||
through@^2.3.6:
|
through@^2.3.6:
|
||||||
version "2.3.8"
|
version "2.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||||
|
|
||||||
tmp@^0.0.33:
|
tmp@^0.0.33:
|
||||||
version "0.0.33"
|
version "0.0.33"
|
||||||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
|
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
|
||||||
dependencies:
|
dependencies:
|
||||||
os-tmpdir "~1.0.2"
|
os-tmpdir "~1.0.2"
|
||||||
|
|
||||||
unbzip2-stream@^1.0.9:
|
unbzip2-stream@^1.0.9:
|
||||||
version "1.2.5"
|
version "1.2.5"
|
||||||
resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz#73a033a567bbbde59654b193c44d48a7e4f43c47"
|
resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz#73a033a567bbbde59654b193c44d48a7e4f43c47"
|
||||||
dependencies:
|
dependencies:
|
||||||
buffer "^3.0.1"
|
buffer "^3.0.1"
|
||||||
through "^2.3.6"
|
through "^2.3.6"
|
||||||
|
|
||||||
util-deprecate@~1.0.1:
|
util-deprecate@~1.0.1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||||
|
|
||||||
vscode-extension-telemetry@^0.0.15:
|
vscode-extension-telemetry@^0.0.15:
|
||||||
version "0.0.15"
|
version "0.0.15"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.15.tgz#685c32f3b67e8fb85ba689c1d7f88ff90ff87856"
|
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.15.tgz#685c32f3b67e8fb85ba689c1d7f88ff90ff87856"
|
||||||
dependencies:
|
dependencies:
|
||||||
applicationinsights "1.0.1"
|
applicationinsights "1.0.1"
|
||||||
|
|
||||||
vscode-jsonrpc@3.5.0, vscode-jsonrpc@^3.5.0:
|
vscode-jsonrpc@3.5.0, vscode-jsonrpc@^3.5.0:
|
||||||
version "3.5.0"
|
version "3.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz#87239d9e166b2d7352245b8a813597804c1d63aa"
|
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz#87239d9e166b2d7352245b8a813597804c1d63aa"
|
||||||
|
|
||||||
vscode-languageclient@3.5.0:
|
vscode-languageclient@3.5.0:
|
||||||
version "3.5.0"
|
version "3.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-3.5.0.tgz#36d02cc186a8365a4467719a290fb200a9ae490a"
|
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-3.5.0.tgz#36d02cc186a8365a4467719a290fb200a9ae490a"
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-languageserver-protocol "^3.5.0"
|
vscode-languageserver-protocol "^3.5.0"
|
||||||
|
|
||||||
vscode-languageserver-protocol@3.5.0, vscode-languageserver-protocol@^3.5.0:
|
vscode-languageserver-protocol@3.5.0, vscode-languageserver-protocol@^3.5.0:
|
||||||
version "3.5.0"
|
version "3.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.0.tgz#067c5cbe27709795398d119692c97ebba1452209"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.0.tgz#067c5cbe27709795398d119692c97ebba1452209"
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-jsonrpc "^3.5.0"
|
vscode-jsonrpc "^3.5.0"
|
||||||
vscode-languageserver-types "^3.5.0"
|
vscode-languageserver-types "^3.5.0"
|
||||||
|
|
||||||
vscode-languageserver-types@3.5.0, vscode-languageserver-types@^3.5.0:
|
vscode-languageserver-types@3.5.0, vscode-languageserver-types@^3.5.0:
|
||||||
version "3.5.0"
|
version "3.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374"
|
||||||
|
|
||||||
wrappy@1:
|
wrappy@1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||||
|
|
||||||
xtend@^4.0.0:
|
xtend@^4.0.0:
|
||||||
version "4.0.1"
|
version "4.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
||||||
|
|
||||||
yauzl@^2.4.2:
|
yauzl@^2.4.2:
|
||||||
version "2.9.1"
|
version "2.9.1"
|
||||||
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.9.1.tgz#a81981ea70a57946133883f029c5821a89359a7f"
|
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.9.1.tgz#a81981ea70a57946133883f029c5821a89359a7f"
|
||||||
dependencies:
|
dependencies:
|
||||||
buffer-crc32 "~0.2.3"
|
buffer-crc32 "~0.2.3"
|
||||||
fd-slicer "~1.0.1"
|
fd-slicer "~1.0.1"
|
||||||
|
|
||||||
zone.js@0.7.6:
|
zone.js@0.7.6:
|
||||||
version "0.7.6"
|
version "0.7.6"
|
||||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ Common SQL Profiler use-cases taken from https://docs.microsoft.com/en-us/sql/to
|
|||||||
- Monitoring the performance of SQL Server to tune workloads.
|
- Monitoring the performance of SQL Server to tune workloads.
|
||||||
- Correlating performance counters to diagnose problems.
|
- Correlating performance counters to diagnose problems.
|
||||||
|
|
||||||
|
## SQL Server Profiler 0.1.1 Release
|
||||||
|
The SQL Server Profiler for SQL Operations Studio *Preview* extension is now available. This is the initial preview release for a new lightweight XEvent-based profiler. The SQL Server Profiler extension tries to make it simple to quickly trace server activity for troubleshooting and monitoring.
|
||||||
|
|
||||||
|
We'll continue to enhance this extension over the next couple releases. Take a look at the below screenshot to see what's currently available.
|
||||||
|
|
||||||
|
<img width="850" src="https://user-images.githubusercontent.com/599935/41578613-fa10e8bc-7347-11e8-8b97-9fb7d186c9f6.png">
|
||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "profiler",
|
"name": "profiler",
|
||||||
"displayName": "SQL Server Profiler",
|
"displayName": "SQL Server Profiler",
|
||||||
"description": "SQL Server Profiler for SQL Operations Studio",
|
"description": "SQL Server Profiler for SQL Operations Studio",
|
||||||
"version": "0.30.0",
|
"version": "0.1.1",
|
||||||
"publisher": "Microsoft",
|
"publisher": "Microsoft",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"license": "https://raw.githubusercontent.com/Microsoft/sqlopsstudio/master/LICENSE.txt",
|
"license": "https://raw.githubusercontent.com/Microsoft/sqlopsstudio/master/LICENSE.txt",
|
||||||
@@ -32,6 +32,16 @@
|
|||||||
"command": "profiler.newProfiler",
|
"command": "profiler.newProfiler",
|
||||||
"title": "New Profiler",
|
"title": "New Profiler",
|
||||||
"category": "Profiler"
|
"category": "Profiler"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "profiler.start",
|
||||||
|
"title": "Start",
|
||||||
|
"category": "Profiler"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "profiler.stop",
|
||||||
|
"title": "Stop",
|
||||||
|
"category": "Profiler"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputChannels": [
|
"outputChannels": [
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sqlops",
|
"name": "sqlops",
|
||||||
"version": "0.30.4",
|
"version": "0.31.1",
|
||||||
"distro": "8c3e97e3425cc9814496472ab73e076de2ba99ee",
|
"distro": "8c3e97e3425cc9814496472ab73e076de2ba99ee",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Microsoft Corporation"
|
"name": "Microsoft Corporation"
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
"reflect-metadata": "^0.1.8",
|
"reflect-metadata": "^0.1.8",
|
||||||
"rxjs": "5.4.0",
|
"rxjs": "5.4.0",
|
||||||
"semver": "4.3.6",
|
"semver": "4.3.6",
|
||||||
"slickgrid": "github:anthonydresser/SlickGrid#2.3.17",
|
"slickgrid": "github:anthonydresser/SlickGrid#2.3.22",
|
||||||
"spdlog": "0.6.0",
|
"spdlog": "0.6.0",
|
||||||
"sudo-prompt": "^8.0.0",
|
"sudo-prompt": "^8.0.0",
|
||||||
"svg.js": "^2.2.5",
|
"svg.js": "^2.2.5",
|
||||||
|
|||||||
@@ -27,14 +27,16 @@
|
|||||||
"reportIssueUrl": "https://github.com/Microsoft/sqlopsstudio/issues/new?labels=customer%20reported%20issue",
|
"reportIssueUrl": "https://github.com/Microsoft/sqlopsstudio/issues/new?labels=customer%20reported%20issue",
|
||||||
"requestFeatureUrl": "https://github.com/Microsoft/sqlopsstudio/issues/new?labels=feature-request"
|
"requestFeatureUrl": "https://github.com/Microsoft/sqlopsstudio/issues/new?labels=feature-request"
|
||||||
},
|
},
|
||||||
"releaseNotesUrl": "https://go.microsoft.com/fwlink/?linkid=862039",
|
"gettingStartedUrl": "https://go.microsoft.com/fwlink/?linkid=862039",
|
||||||
|
"releaseNotesUrl": "https://go.microsoft.com/fwlink/?linkid=875578",
|
||||||
"documentationUrl": "https://go.microsoft.com/fwlink/?linkid=862277",
|
"documentationUrl": "https://go.microsoft.com/fwlink/?linkid=862277",
|
||||||
"commit": "9ca6200018fc206d67a47229f991901a8a453781",
|
"commit": "9ca6200018fc206d67a47229f991901a8a453781",
|
||||||
"date": "2017-12-15T12:00:00.000Z",
|
"date": "2017-12-15T12:00:00.000Z",
|
||||||
"recommendedExtensions": [
|
"recommendedExtensions": [
|
||||||
"Microsoft.agent",
|
"Microsoft.agent",
|
||||||
"Microsoft.whoisactive",
|
"Microsoft.profiler",
|
||||||
"Microsoft.server-report",
|
"Microsoft.server-report",
|
||||||
|
"Microsoft.whoisactive",
|
||||||
"Redgate.sql-search"
|
"Redgate.sql-search"
|
||||||
],
|
],
|
||||||
"extensionsGallery": {
|
"extensionsGallery": {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ declare @dbsize table
|
|||||||
Free_Space_MB decimal(20,2) default (0))
|
Free_Space_MB decimal(20,2) default (0))
|
||||||
insert into @dbsize
|
insert into @dbsize
|
||||||
(Dbname,file_Size_MB,Space_Used_MB,Free_Space_MB)
|
(Dbname,file_Size_MB,Space_Used_MB,Free_Space_MB)
|
||||||
exec sp_msforeachdb
|
exec sp_MSforeachdb
|
||||||
'use [?];
|
'use [?];
|
||||||
select DB_NAME() AS DbName,
|
select DB_NAME() AS DbName,
|
||||||
sum(size)/128.0 AS File_Size_MB,
|
sum(size)/128.0 AS File_Size_MB,
|
||||||
@@ -24,7 +24,7 @@ declare @logsize table
|
|||||||
log_Free_Space_MB decimal(20,2)default (0))
|
log_Free_Space_MB decimal(20,2)default (0))
|
||||||
insert into @logsize
|
insert into @logsize
|
||||||
(Dbname,Log_File_Size_MB,log_Space_Used_MB,log_Free_Space_MB)
|
(Dbname,Log_File_Size_MB,log_Space_Used_MB,log_Free_Space_MB)
|
||||||
exec sp_msforeachdb
|
exec sp_MSforeachdb
|
||||||
'use [?];
|
'use [?];
|
||||||
select DB_NAME() AS DbName,
|
select DB_NAME() AS DbName,
|
||||||
sum(size)/128.0 AS Log_File_Size_MB,
|
sum(size)/128.0 AS Log_File_Size_MB,
|
||||||
@@ -38,7 +38,7 @@ declare @dbfreesize table
|
|||||||
Freespace varchar(50)default (0.00))
|
Freespace varchar(50)default (0.00))
|
||||||
insert into @dbfreesize
|
insert into @dbfreesize
|
||||||
(name,database_size,Freespace)
|
(name,database_size,Freespace)
|
||||||
exec sp_msforeachdb
|
exec sp_MSforeachdb
|
||||||
'use [?];SELECT database_name = db_name()
|
'use [?];SELECT database_name = db_name()
|
||||||
,database_size = ltrim(str((convert(DECIMAL(15, 2), dbsize) + convert(DECIMAL(15, 2), logsize)) * 8192 / 1048576, 15, 2) + ''MB'')
|
,database_size = ltrim(str((convert(DECIMAL(15, 2), dbsize) + convert(DECIMAL(15, 2), logsize)) * 8192 / 1048576, 15, 2) + ''MB'')
|
||||||
,''unallocated space'' = ltrim(str((
|
,''unallocated space'' = ltrim(str((
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"command": "sqlservices.openDialog",
|
"command": "sqlservices.openDialog",
|
||||||
"title": "openDialog"
|
"title": "sqlservices.openDialog"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "sqlservices.openEditor",
|
"command": "sqlservices.openEditor",
|
||||||
@@ -32,6 +32,10 @@
|
|||||||
{
|
{
|
||||||
"command": "sqlservices.openEditorWithWebView2",
|
"command": "sqlservices.openEditorWithWebView2",
|
||||||
"title": "sqlservices.openEditorWithWebView2"
|
"title": "sqlservices.openEditorWithWebView2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "sqlservices.openWizard",
|
||||||
|
"title": "sqlservices.openWizard"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dashboard.tabs": [
|
"dashboard.tabs": [
|
||||||
|
|||||||
@@ -60,9 +60,212 @@ export default class MainController implements vscode.Disposable {
|
|||||||
this.openEditorWithWebview2();
|
this.openEditorWithWebview2();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
vscode.commands.registerCommand('sqlservices.openWizard', () => {
|
||||||
|
this.openWizard();
|
||||||
|
});
|
||||||
|
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async getTabContent(view: sqlops.ModelView, customButton1: sqlops.window.modelviewdialog.Button, customButton2: sqlops.window.modelviewdialog.Button, componentWidth: number | string): Promise<void> {
|
||||||
|
let inputBox = view.modelBuilder.inputBox()
|
||||||
|
.withProperties({
|
||||||
|
multiline: true,
|
||||||
|
height: 100
|
||||||
|
}).component();
|
||||||
|
let inputBoxWrapper = view.modelBuilder.loadingComponent().withItem(inputBox).component();
|
||||||
|
inputBoxWrapper.loading = false;
|
||||||
|
customButton1.onClick(() => {
|
||||||
|
inputBoxWrapper.loading = true;
|
||||||
|
setTimeout(() => inputBoxWrapper.loading = false, 5000);
|
||||||
|
});
|
||||||
|
let inputBox2 = view.modelBuilder.inputBox().component();
|
||||||
|
let backupFilesInputBox = view.modelBuilder.inputBox().component();
|
||||||
|
|
||||||
|
let checkbox = view.modelBuilder.checkBox()
|
||||||
|
.withProperties({
|
||||||
|
label: 'Copy-only backup'
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
checkbox.onChanged(e => {
|
||||||
|
console.info("inputBox.enabled " + inputBox.enabled);
|
||||||
|
inputBox.enabled = !inputBox.enabled;
|
||||||
|
});
|
||||||
|
let button = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
label: '+'
|
||||||
|
}).component();
|
||||||
|
let button3 = view.modelBuilder.button()
|
||||||
|
.withProperties({
|
||||||
|
label: '-'
|
||||||
|
|
||||||
|
}).component();
|
||||||
|
let button2 = view.modelBuilder.button()
|
||||||
|
.component();
|
||||||
|
button.onDidClick(e => {
|
||||||
|
backupFilesInputBox.value = 'Button clicked';
|
||||||
|
});
|
||||||
|
let dropdown = view.modelBuilder.dropDown()
|
||||||
|
.withProperties({
|
||||||
|
value: 'Full',
|
||||||
|
values: ['Full', 'Differential', 'Transaction Log']
|
||||||
|
})
|
||||||
|
.component();
|
||||||
|
let f = 0;
|
||||||
|
inputBox.onTextChanged((params) => {
|
||||||
|
vscode.window.showInformationMessage(inputBox.value);
|
||||||
|
f = f + 1;
|
||||||
|
inputBox2.value = f.toString();
|
||||||
|
});
|
||||||
|
dropdown.onValueChanged((params) => {
|
||||||
|
vscode.window.showInformationMessage(inputBox2.value);
|
||||||
|
inputBox.value = dropdown.value.toString();
|
||||||
|
});
|
||||||
|
let radioButton = view.modelBuilder.radioButton()
|
||||||
|
.withProperties({
|
||||||
|
value: 'option1',
|
||||||
|
name: 'radioButtonOptions',
|
||||||
|
label: 'Option 1',
|
||||||
|
checked: true
|
||||||
|
//width: 300
|
||||||
|
}).component();
|
||||||
|
let radioButton2 = view.modelBuilder.radioButton()
|
||||||
|
.withProperties({
|
||||||
|
value: 'option2',
|
||||||
|
name: 'radioButtonOptions',
|
||||||
|
label: 'Option 2'
|
||||||
|
}).component();
|
||||||
|
let inputBox3 = view.modelBuilder.inputBox().component();
|
||||||
|
let inputBox4 = view.modelBuilder.inputBox().component();
|
||||||
|
let form2Model = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: inputBox3,
|
||||||
|
title: 'inputBox3'
|
||||||
|
}, {
|
||||||
|
component: inputBox4,
|
||||||
|
title: 'inputBox4'
|
||||||
|
}], {
|
||||||
|
horizontal: true
|
||||||
|
}).component();
|
||||||
|
let groupModel1 = view.modelBuilder.groupContainer()
|
||||||
|
.withLayout({
|
||||||
|
}).withItems([
|
||||||
|
form2Model
|
||||||
|
]).component();
|
||||||
|
radioButton.onDidClick(() => {
|
||||||
|
inputBox.value = radioButton.value;
|
||||||
|
groupModel1.enabled = true;
|
||||||
|
});
|
||||||
|
radioButton2.onDidClick(() => {
|
||||||
|
inputBox.value = radioButton.value;
|
||||||
|
groupModel1.enabled = false;
|
||||||
|
});
|
||||||
|
let table = view.modelBuilder.table().withProperties({
|
||||||
|
data: [
|
||||||
|
['1', '2', '2'],
|
||||||
|
['4', '5', '6'],
|
||||||
|
['7', '8', '9']
|
||||||
|
], columns: ['c1', 'c2', 'c3'],
|
||||||
|
height: 250,
|
||||||
|
selectedRows: [0]
|
||||||
|
}).component();
|
||||||
|
table.onRowSelected(e => {
|
||||||
|
// TODO:
|
||||||
|
});
|
||||||
|
let listBox = view.modelBuilder.listBox().withProperties({
|
||||||
|
values: ['1', '2', '3'],
|
||||||
|
selectedRow: 2
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
let declarativeTable = view.modelBuilder.declarativeTable()
|
||||||
|
.withProperties({
|
||||||
|
columns: [{
|
||||||
|
displayName: 'Column 1',
|
||||||
|
valueType: sqlops.DeclarativeDataType.string,
|
||||||
|
width: '20px',
|
||||||
|
isReadOnly: true
|
||||||
|
}, {
|
||||||
|
displayName: 'Column 2',
|
||||||
|
valueType: sqlops.DeclarativeDataType.string,
|
||||||
|
width: '100px',
|
||||||
|
isReadOnly: false
|
||||||
|
}, {
|
||||||
|
displayName: 'Column 3',
|
||||||
|
valueType: sqlops.DeclarativeDataType.boolean,
|
||||||
|
width: '20px',
|
||||||
|
isReadOnly: false
|
||||||
|
}, {
|
||||||
|
displayName: 'Column 4',
|
||||||
|
valueType: sqlops.DeclarativeDataType.category,
|
||||||
|
isReadOnly: false,
|
||||||
|
width: '120px',
|
||||||
|
categoryValues: [
|
||||||
|
{ name: 'options1', displayName: 'option 1' },
|
||||||
|
{ name: 'options2', displayName: 'option 2' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
data: [
|
||||||
|
['Data00', 'Data01', false, 'options2'],
|
||||||
|
['Data10', 'Data11', true, 'options1']
|
||||||
|
]
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
declarativeTable.onDataChanged(e => {
|
||||||
|
inputBox2.value = e.row.toString() + ' ' + e.column.toString() + ' ' + e.value.toString();
|
||||||
|
inputBox3.value = declarativeTable.data[e.row][e.column];
|
||||||
|
});
|
||||||
|
|
||||||
|
let flexRadioButtonsModel = view.modelBuilder.flexContainer()
|
||||||
|
.withLayout({
|
||||||
|
flexFlow: 'column',
|
||||||
|
alignItems: 'left',
|
||||||
|
height: 150
|
||||||
|
}).withItems([
|
||||||
|
radioButton, groupModel1, radioButton2]
|
||||||
|
, { flex: '1 1 50%' }).component();
|
||||||
|
let formModel = view.modelBuilder.formContainer()
|
||||||
|
.withFormItems([{
|
||||||
|
component: inputBoxWrapper,
|
||||||
|
title: 'Backup name'
|
||||||
|
}, {
|
||||||
|
component: inputBox2,
|
||||||
|
title: 'Recovery model'
|
||||||
|
}, {
|
||||||
|
component: dropdown,
|
||||||
|
title: 'Backup type'
|
||||||
|
}, {
|
||||||
|
component: checkbox,
|
||||||
|
title: ''
|
||||||
|
}, {
|
||||||
|
component: backupFilesInputBox,
|
||||||
|
title: 'Backup files',
|
||||||
|
actions: [button, button3]
|
||||||
|
}, {
|
||||||
|
component: flexRadioButtonsModel,
|
||||||
|
title: 'Options'
|
||||||
|
}, {
|
||||||
|
component: declarativeTable,
|
||||||
|
title: 'Declarative Table'
|
||||||
|
}, {
|
||||||
|
component: table,
|
||||||
|
title: 'Table'
|
||||||
|
}, {
|
||||||
|
component: listBox,
|
||||||
|
title: 'List Box'
|
||||||
|
}], {
|
||||||
|
horizontal: false,
|
||||||
|
componentWidth: componentWidth
|
||||||
|
}).component();
|
||||||
|
let formWrapper = view.modelBuilder.loadingComponent().withItem(formModel).component();
|
||||||
|
formWrapper.loading = false;
|
||||||
|
customButton2.onClick(() => {
|
||||||
|
formWrapper.loading = true;
|
||||||
|
setTimeout(() => formWrapper.loading = false, 5000);
|
||||||
|
});
|
||||||
|
await view.initializeModel(formWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
private openDialog(): void {
|
private openDialog(): void {
|
||||||
let dialog = sqlops.window.modelviewdialog.createDialog('Test dialog');
|
let dialog = sqlops.window.modelviewdialog.createDialog('Test dialog');
|
||||||
let tab1 = sqlops.window.modelviewdialog.createTab('Test tab 1');
|
let tab1 = sqlops.window.modelviewdialog.createTab('Test tab 1');
|
||||||
@@ -80,142 +283,29 @@ export default class MainController implements vscode.Disposable {
|
|||||||
customButton2.onClick(() => console.log('button 2 clicked!'));
|
customButton2.onClick(() => console.log('button 2 clicked!'));
|
||||||
dialog.customButtons = [customButton1, customButton2];
|
dialog.customButtons = [customButton1, customButton2];
|
||||||
tab1.registerContent(async (view) => {
|
tab1.registerContent(async (view) => {
|
||||||
let inputBox = view.modelBuilder.inputBox()
|
await this.getTabContent(view, customButton1, customButton2, 400);
|
||||||
.withProperties({
|
|
||||||
//width: 300
|
|
||||||
}).component();
|
|
||||||
let inputBoxWrapper = view.modelBuilder.loadingComponent().withItem(inputBox).component();
|
|
||||||
inputBoxWrapper.loading = false;
|
|
||||||
customButton1.onClick(() => {
|
|
||||||
inputBoxWrapper.loading = true;
|
|
||||||
setTimeout(() => inputBoxWrapper.loading = false, 5000);
|
|
||||||
});
|
|
||||||
let inputBox2 = view.modelBuilder.inputBox().component();
|
|
||||||
let backupFilesInputBox = view.modelBuilder.inputBox().component();
|
|
||||||
|
|
||||||
let checkbox = view.modelBuilder.checkBox()
|
|
||||||
.withProperties({
|
|
||||||
label: 'Copy-only backup'
|
|
||||||
})
|
|
||||||
.component();
|
|
||||||
checkbox.onChanged(e => {
|
|
||||||
console.info("inputBox.enabled " + inputBox.enabled);
|
|
||||||
inputBox.enabled = !inputBox.enabled;
|
|
||||||
});
|
|
||||||
let button = view.modelBuilder.button()
|
|
||||||
.withProperties({
|
|
||||||
label: '+'
|
|
||||||
}).component();
|
|
||||||
let button3 = view.modelBuilder.button()
|
|
||||||
.withProperties({
|
|
||||||
label: '-'
|
|
||||||
|
|
||||||
}).component();
|
|
||||||
let button2 = view.modelBuilder.button()
|
|
||||||
.component();
|
|
||||||
button.onDidClick(e => {
|
|
||||||
backupFilesInputBox.value = 'Button clicked';
|
|
||||||
});
|
|
||||||
let dropdown = view.modelBuilder.dropDown()
|
|
||||||
.withProperties({
|
|
||||||
value: 'Full',
|
|
||||||
values: ['Full', 'Differential', 'Transaction Log']
|
|
||||||
})
|
|
||||||
.component();
|
|
||||||
let f = 0;
|
|
||||||
inputBox.onTextChanged((params) => {
|
|
||||||
vscode.window.showInformationMessage(inputBox.value);
|
|
||||||
f = f + 1;
|
|
||||||
inputBox2.value = f.toString();
|
|
||||||
});
|
|
||||||
dropdown.onValueChanged((params) => {
|
|
||||||
vscode.window.showInformationMessage(inputBox2.value);
|
|
||||||
inputBox.value = dropdown.value;
|
|
||||||
});
|
|
||||||
let radioButton = view.modelBuilder.radioButton()
|
|
||||||
.withProperties({
|
|
||||||
value: 'option1',
|
|
||||||
name: 'radioButtonOptions',
|
|
||||||
label: 'Option 1',
|
|
||||||
checked: true
|
|
||||||
//width: 300
|
|
||||||
}).component();
|
|
||||||
let radioButton2 = view.modelBuilder.radioButton()
|
|
||||||
.withProperties({
|
|
||||||
value: 'option2',
|
|
||||||
name: 'radioButtonOptions',
|
|
||||||
label: 'Option 2'
|
|
||||||
}).component();
|
|
||||||
let inputBox3 = view.modelBuilder.inputBox().component();
|
|
||||||
let inputBox4 = view.modelBuilder.inputBox().component();
|
|
||||||
let form2Model = view.modelBuilder.formContainer()
|
|
||||||
.withFormItems([{
|
|
||||||
component: inputBox3,
|
|
||||||
title: 'inputBox3'
|
|
||||||
}, {
|
|
||||||
component: inputBox4,
|
|
||||||
title: 'inputBox4'
|
|
||||||
}], {
|
|
||||||
horizontal: true
|
|
||||||
}).component();
|
|
||||||
let groupModel1 = view.modelBuilder.groupContainer()
|
|
||||||
.withLayout({
|
|
||||||
}).withItems([
|
|
||||||
form2Model
|
|
||||||
]).component();
|
|
||||||
radioButton.onDidClick(() => {
|
|
||||||
inputBox.value = radioButton.value;
|
|
||||||
groupModel1.enabled = true;
|
|
||||||
});
|
|
||||||
radioButton2.onDidClick(() => {
|
|
||||||
inputBox.value = radioButton.value;
|
|
||||||
groupModel1.enabled = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
let flexRadioButtonsModel = view.modelBuilder.flexContainer()
|
|
||||||
.withLayout({
|
|
||||||
flexFlow: 'column',
|
|
||||||
alignItems: 'left',
|
|
||||||
height: 50
|
|
||||||
}).withItems([
|
|
||||||
radioButton, groupModel1, radioButton2]
|
|
||||||
, { flex: '1 1 50%' }).component();
|
|
||||||
let formModel = view.modelBuilder.formContainer()
|
|
||||||
.withFormItems([{
|
|
||||||
component: inputBoxWrapper,
|
|
||||||
title: 'Backup name'
|
|
||||||
}, {
|
|
||||||
component: inputBox2,
|
|
||||||
title: 'Recovery model'
|
|
||||||
}, {
|
|
||||||
component: dropdown,
|
|
||||||
title: 'Backup type'
|
|
||||||
}, {
|
|
||||||
component: checkbox,
|
|
||||||
title: ''
|
|
||||||
}, {
|
|
||||||
component: backupFilesInputBox,
|
|
||||||
title: 'Backup files',
|
|
||||||
actions: [button, button3]
|
|
||||||
}, {
|
|
||||||
component: flexRadioButtonsModel,
|
|
||||||
title: 'Options'
|
|
||||||
}], {
|
|
||||||
horizontal: false,
|
|
||||||
componentWidth: 400
|
|
||||||
}).component();
|
|
||||||
let formWrapper = view.modelBuilder.loadingComponent().withItem(formModel).component();
|
|
||||||
formWrapper.loading = false;
|
|
||||||
customButton2.onClick(() => {
|
|
||||||
formWrapper.loading = true;
|
|
||||||
setTimeout(() => formWrapper.loading = false, 5000);
|
|
||||||
});
|
|
||||||
await view.initializeModel(formWrapper);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
sqlops.window.modelviewdialog.openDialog(dialog);
|
sqlops.window.modelviewdialog.openDialog(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private openWizard(): void {
|
||||||
|
let wizard = sqlops.window.modelviewdialog.createWizard('Test wizard');
|
||||||
|
let page1 = sqlops.window.modelviewdialog.createWizardPage('First wizard page');
|
||||||
|
let page2 = sqlops.window.modelviewdialog.createWizardPage('Second wizard page');
|
||||||
|
page2.content = 'sqlservices';
|
||||||
|
let customButton1 = sqlops.window.modelviewdialog.createButton('Load name');
|
||||||
|
customButton1.onClick(() => console.log('button 1 clicked!'));
|
||||||
|
let customButton2 = sqlops.window.modelviewdialog.createButton('Load all');
|
||||||
|
customButton2.onClick(() => console.log('button 2 clicked!'));
|
||||||
|
wizard.customButtons = [customButton1, customButton2];
|
||||||
|
page1.registerContent(async (view) => {
|
||||||
|
await this.getTabContent(view, customButton1, customButton2, 800);
|
||||||
|
});
|
||||||
|
wizard.pages = [page1, page2];
|
||||||
|
wizard.open();
|
||||||
|
}
|
||||||
|
|
||||||
private openEditor(): void {
|
private openEditor(): void {
|
||||||
let editor = sqlops.workspace.createModelViewEditor('Test Model View');
|
let editor = sqlops.workspace.createModelViewEditor('Test Model View');
|
||||||
editor.registerContent(async view => {
|
editor.registerContent(async view => {
|
||||||
@@ -322,7 +412,7 @@ export default class MainController implements vscode.Disposable {
|
|||||||
height: '100%'
|
height: '100%'
|
||||||
});
|
});
|
||||||
|
|
||||||
let templateValues = {url: 'http://whoisactive.com/docs/'};
|
let templateValues = { url: 'http://whoisactive.com/docs/' };
|
||||||
Utils.renderTemplateHtml(path.join(__dirname, '..'), 'templateTab.html', templateValues)
|
Utils.renderTemplateHtml(path.join(__dirname, '..'), 'templateTab.html', templateValues)
|
||||||
.then(html => {
|
.then(html => {
|
||||||
webview.html = html;
|
webview.html = html;
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import { IDisposable } from 'vs/base/common/lifecycle';
|
|||||||
<ng-template ngFor let-item let-first="first" let-last="last" [ngForOf]="menuItems">
|
<ng-template ngFor let-item let-first="first" let-last="last" [ngForOf]="menuItems">
|
||||||
<span style="padding: 5px; display: flex; align-items: center">
|
<span style="padding: 5px; display: flex; align-items: center">
|
||||||
<span *ngIf="item.icon" class="icon" style="display: inline-block; margin-right: 5px" [ngClass]="item.icon"></span>
|
<span *ngIf="item.icon" class="icon" style="display: inline-block; margin-right: 5px" [ngClass]="item.icon"></span>
|
||||||
<span *ngIf="first" style="font-weight: 200">{{item.label}}</span>
|
<span *ngIf="first">{{item.label}}</span>
|
||||||
<span *ngIf="last" style="">{{item.label}}</span>
|
<span *ngIf="last" style="">{{item.label}}</span>
|
||||||
<a class="router-link" *ngIf="!last && !first" (click)="route(item.routerLink)" style=" font-weight: 200" >{{item.label}}</a>
|
<a class="router-link" *ngIf="!last && !first" (click)="route(item.routerLink)" >{{item.label}}</a>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="!last" class="icon chevron-right"></span>
|
<span *ngIf="!last" class="icon chevron-right"></span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -33,4 +33,12 @@ export class Button extends vsButton {
|
|||||||
public set title(value: string) {
|
public set title(value: string) {
|
||||||
this.$el.title(value);
|
this.$el.title(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setHeight(value: string) {
|
||||||
|
this.$el.style('height', value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public setWidth(value: string) {
|
||||||
|
this.$el.style('width', value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ export class ToggleDropdownAction extends Action {
|
|||||||
private static readonly ID = 'dropdownAction.toggle';
|
private static readonly ID = 'dropdownAction.toggle';
|
||||||
private static readonly ICON = 'dropdown-arrow';
|
private static readonly ICON = 'dropdown-arrow';
|
||||||
|
|
||||||
constructor(label, private _fn: () => any) {
|
constructor(private _fn: () => any, label: string) {
|
||||||
super(ToggleDropdownAction.ID, label, ToggleDropdownAction.ICON);
|
super(ToggleDropdownAction.ID, label, ToggleDropdownAction.ICON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ export interface IDropdownOptions extends IDropdownStyles {
|
|||||||
* Value to use as aria-label for the input box
|
* Value to use as aria-label for the input box
|
||||||
*/
|
*/
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
|
/**
|
||||||
|
* Label for the dropdown action
|
||||||
|
*/
|
||||||
|
actionLabel: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDropdownStyles {
|
export interface IDropdownStyles {
|
||||||
@@ -66,7 +70,8 @@ const defaults: IDropdownOptions = {
|
|||||||
strictSelection: true,
|
strictSelection: true,
|
||||||
maxHeight: 300,
|
maxHeight: 300,
|
||||||
errorMessage: errorMessage,
|
errorMessage: errorMessage,
|
||||||
contextBorder: Color.fromHex('#696969')
|
contextBorder: Color.fromHex('#696969'),
|
||||||
|
actionLabel: nls.localize('dropdownAction.toggle', "Toggle dropdown")
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ListResource {
|
interface ListResource {
|
||||||
@@ -115,11 +120,11 @@ export class Dropdown extends Disposable {
|
|||||||
this.$input = $('.dropdown-input').style('width', '100%').appendTo(this.$el);
|
this.$input = $('.dropdown-input').style('width', '100%').appendTo(this.$el);
|
||||||
this.$treeContainer = $('.dropdown-tree');
|
this.$treeContainer = $('.dropdown-tree');
|
||||||
|
|
||||||
this._toggleAction = new ToggleDropdownAction(nls.localize('dropdown.toggle', '{0} Toggle Dropdown', this._options.ariaLabel), () => {
|
this._toggleAction = new ToggleDropdownAction(() => {
|
||||||
this._showList();
|
this._showList();
|
||||||
this._tree.domFocus();
|
this._tree.domFocus();
|
||||||
this._tree.focusFirst();
|
this._tree.focusFirst();
|
||||||
});
|
}, opt.actionLabel);
|
||||||
|
|
||||||
this._input = new InputBox(this.$input.getHTMLElement(), contextViewService, {
|
this._input = new InputBox(this.$input.getHTMLElement(), contextViewService, {
|
||||||
validationOptions: {
|
validationOptions: {
|
||||||
@@ -132,7 +137,7 @@ export class Dropdown extends Disposable {
|
|||||||
ariaLabel: this._options.ariaLabel
|
ariaLabel: this._options.ariaLabel
|
||||||
});
|
});
|
||||||
|
|
||||||
this._register(DOM.addDisposableListener(this._input.inputElement, DOM.EventType.FOCUS, () => {
|
this._register(DOM.addDisposableListener(this._input.inputElement, DOM.EventType.CLICK, () => {
|
||||||
this._showList();
|
this._showList();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -145,8 +150,12 @@ export class Dropdown extends Disposable {
|
|||||||
this._register(DOM.addStandardDisposableListener(this._input.inputElement, DOM.EventType.KEY_DOWN, (e: StandardKeyboardEvent) => {
|
this._register(DOM.addStandardDisposableListener(this._input.inputElement, DOM.EventType.KEY_DOWN, (e: StandardKeyboardEvent) => {
|
||||||
switch (e.keyCode) {
|
switch (e.keyCode) {
|
||||||
case KeyCode.Enter:
|
case KeyCode.Enter:
|
||||||
if (this._input.validate()) {
|
if (this._contextView.isVisible()) {
|
||||||
this._onValueChange.fire(this._input.value);
|
if (this._input.validate()) {
|
||||||
|
this._onValueChange.fire(this._input.value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this._showList();
|
||||||
}
|
}
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
break;
|
break;
|
||||||
@@ -192,6 +201,11 @@ export class Dropdown extends Disposable {
|
|||||||
this._contextView.hide();
|
this._contextView.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._controller.onDropdownEscape(() => {
|
||||||
|
this._input.focus();
|
||||||
|
this._contextView.hide();
|
||||||
|
});
|
||||||
|
|
||||||
this._input.onDidChange(e => {
|
this._input.onDidChange(e => {
|
||||||
if (this._dataSource.options) {
|
if (this._dataSource.options) {
|
||||||
this._filter.filterString = e;
|
this._filter.filterString = e;
|
||||||
@@ -231,17 +245,19 @@ export class Dropdown extends Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _layoutTree(): void {
|
private _layoutTree(): void {
|
||||||
let filteredLength = this._dataSource.options.reduce((p, i) => {
|
if (this._dataSource && this._dataSource.options && this._dataSource.options.length > 0) {
|
||||||
if (this._filter.isVisible(undefined, i)) {
|
let filteredLength = this._dataSource.options.reduce((p, i) => {
|
||||||
return p + 1;
|
if (this._filter.isVisible(undefined, i)) {
|
||||||
} else {
|
return p + 1;
|
||||||
return p;
|
} else {
|
||||||
}
|
return p;
|
||||||
}, 0);
|
}
|
||||||
let height = filteredLength * this._renderer.getHeight(undefined, undefined) > this._options.maxHeight ? this._options.maxHeight : filteredLength * this._renderer.getHeight(undefined, undefined);
|
}, 0);
|
||||||
this.$treeContainer.style('height', height + 'px').style('width', DOM.getContentWidth(this.$input.getHTMLElement()) - 2 + 'px');
|
let height = filteredLength * this._renderer.getHeight(undefined, undefined) > this._options.maxHeight ? this._options.maxHeight : filteredLength * this._renderer.getHeight(undefined, undefined);
|
||||||
this._tree.layout(parseInt(this.$treeContainer.style('height')));
|
this.$treeContainer.style('height', height + 'px').style('width', DOM.getContentWidth(this.$input.getHTMLElement()) - 2 + 'px');
|
||||||
this._tree.refresh();
|
this._tree.layout(parseInt(this.$treeContainer.style('height')));
|
||||||
|
this._tree.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public set values(vals: string[]) {
|
public set values(vals: string[]) {
|
||||||
|
|||||||
@@ -101,10 +101,19 @@ export class DropdownController extends TreeDefaults.DefaultController {
|
|||||||
private _onSelectionChange = new Emitter<Resource>();
|
private _onSelectionChange = new Emitter<Resource>();
|
||||||
public readonly onSelectionChange: Event<Resource> = this._onSelectionChange.event;
|
public readonly onSelectionChange: Event<Resource> = this._onSelectionChange.event;
|
||||||
|
|
||||||
|
private _onDropdownEscape = new Emitter<void>();
|
||||||
|
public readonly onDropdownEscape: Event<void> = this._onDropdownEscape.event;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected onEscape(tree: tree.ITree, event: IKeyboardEvent): boolean {
|
||||||
|
let response = super.onEscape(tree, event);
|
||||||
|
this._onDropdownEscape.fire();
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
protected onLeftClick(tree: tree.ITree, element: any, eventish: TreeDefaults.ICancelableEvent, origin: string): boolean {
|
protected onLeftClick(tree: tree.ITree, element: any, eventish: TreeDefaults.ICancelableEvent, origin: string): boolean {
|
||||||
let response = super.onLeftClick(tree, element, eventish, origin);
|
let response = super.onLeftClick(tree, element, eventish, origin);
|
||||||
if (response) {
|
if (response) {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export class InputBox extends AngularDisposable implements OnInit, OnChanges {
|
|||||||
@Input() type: string;
|
@Input() type: string;
|
||||||
@Input() placeholder: string;
|
@Input() placeholder: string;
|
||||||
@Input() ariaLabel: string;
|
@Input() ariaLabel: string;
|
||||||
|
@Input() value: string;
|
||||||
|
|
||||||
@Output() onDidChange = new EventEmitter<string | number>();
|
@Output() onDidChange = new EventEmitter<string | number>();
|
||||||
|
|
||||||
@@ -49,6 +50,9 @@ export class InputBox extends AngularDisposable implements OnInit, OnChanges {
|
|||||||
placeholder: this.placeholder,
|
placeholder: this.placeholder,
|
||||||
ariaLabel: this.ariaLabel
|
ariaLabel: this.ariaLabel
|
||||||
});
|
});
|
||||||
|
if (this.value) {
|
||||||
|
this._inputbox.value = this.value;
|
||||||
|
}
|
||||||
this._inputbox.onDidChange(e => {
|
this._inputbox.onDidChange(e => {
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case 'number':
|
case 'number':
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
import { InputBox as vsInputBox, IInputOptions, IInputBoxStyles as vsIInputBoxStyles } from 'vs/base/browser/ui/inputbox/inputBox';
|
import { InputBox as vsInputBox, IInputOptions, IInputBoxStyles as vsIInputBoxStyles, IMessage } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||||
import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
|
import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
|
||||||
import { Color } from 'vs/base/common/color';
|
import { Color } from 'vs/base/common/color';
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
import { Event, Emitter } from 'vs/base/common/event';
|
||||||
@@ -32,6 +32,8 @@ export class InputBox extends vsInputBox {
|
|||||||
private _onLoseFocus = this._register(new Emitter<OnLoseFocusParams>());
|
private _onLoseFocus = this._register(new Emitter<OnLoseFocusParams>());
|
||||||
public onLoseFocus: Event<OnLoseFocusParams> = this._onLoseFocus.event;
|
public onLoseFocus: Event<OnLoseFocusParams> = this._onLoseFocus.event;
|
||||||
|
|
||||||
|
private _isTextAreaInput: boolean;
|
||||||
|
private _hideErrors = false;
|
||||||
|
|
||||||
constructor(container: HTMLElement, contextViewProvider: IContextViewProvider, options?: IInputOptions) {
|
constructor(container: HTMLElement, contextViewProvider: IContextViewProvider, options?: IInputOptions) {
|
||||||
super(container, contextViewProvider, options);
|
super(container, contextViewProvider, options);
|
||||||
@@ -48,6 +50,10 @@ export class InputBox extends vsInputBox {
|
|||||||
self._onLoseFocus.fire({ value: self.value, hasChanged: self._lastLoseFocusValue !== self.value });
|
self._onLoseFocus.fire({ value: self.value, hasChanged: self._lastLoseFocusValue !== self.value });
|
||||||
self._lastLoseFocusValue = self.value;
|
self._lastLoseFocusValue = self.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (options && options.type === 'textarea') {
|
||||||
|
this._isTextAreaInput = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public style(styles: IInputBoxStyles): void {
|
public style(styles: IInputBoxStyles): void {
|
||||||
@@ -67,6 +73,20 @@ export class InputBox extends vsInputBox {
|
|||||||
this.applyStyles();
|
this.applyStyles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public set rows(value: number) {
|
||||||
|
this.inputElement.setAttribute('rows', value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public set columns(value: number) {
|
||||||
|
this.inputElement.setAttribute('cols', value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public layout(): void {
|
||||||
|
if (!this._isTextAreaInput) {
|
||||||
|
super.layout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public disable(): void {
|
public disable(): void {
|
||||||
super.disable();
|
super.disable();
|
||||||
this.inputBackground = this.disabledInputBackground;
|
this.inputBackground = this.disabledInputBackground;
|
||||||
@@ -75,7 +95,30 @@ export class InputBox extends vsInputBox {
|
|||||||
this.applyStyles();
|
this.applyStyles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setHeight(value: string) {
|
||||||
|
if (this._isTextAreaInput) {
|
||||||
|
this.inputElement.style.height = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public isEnabled(): boolean {
|
public isEnabled(): boolean {
|
||||||
return !this.inputElement.hasAttribute('disabled');
|
return !this.inputElement.hasAttribute('disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get hideErrors(): boolean {
|
||||||
|
return this._hideErrors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set hideErrors(hideErrors: boolean) {
|
||||||
|
this._hideErrors = hideErrors;
|
||||||
|
if (hideErrors) {
|
||||||
|
this.hideMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public showMessage(message: IMessage, force?: boolean): void {
|
||||||
|
if (!this.hideErrors) {
|
||||||
|
super.showMessage(message, force);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -172,4 +172,22 @@
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal .modal-footer .dialogErrorMessage {
|
||||||
|
align-items: center;
|
||||||
|
max-height: 30px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal .dialogErrorMessage .icon {
|
||||||
|
float: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
width: auto;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal .modal-footer .dialogErrorMessage .errorMessage {
|
||||||
|
max-height: 100%;
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,13 @@ import { Button } from 'sql/base/browser/ui/button/button';
|
|||||||
import * as TelemetryUtils from 'sql/common/telemetryUtilities';
|
import * as TelemetryUtils from 'sql/common/telemetryUtilities';
|
||||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
|
import { MessageLevel } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||||
|
|
||||||
export const MODAL_SHOWING_KEY = 'modalShowing';
|
export const MODAL_SHOWING_KEY = 'modalShowing';
|
||||||
export const MODAL_SHOWING_CONTEXT = new RawContextKey<Array<string>>(MODAL_SHOWING_KEY, []);
|
export const MODAL_SHOWING_CONTEXT = new RawContextKey<Array<string>>(MODAL_SHOWING_KEY, []);
|
||||||
|
const INFO_ALT_TEXT = localize('infoAltText', 'Info');
|
||||||
|
const WARNING_ALT_TEXT = localize('warningAltText', 'Warning');
|
||||||
|
const ERROR_ALT_TEXT = localize('errorAltText', 'Error');
|
||||||
|
|
||||||
export interface IModalDialogStyles {
|
export interface IModalDialogStyles {
|
||||||
dialogForeground?: Color;
|
dialogForeground?: Color;
|
||||||
@@ -145,7 +149,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
/**
|
/**
|
||||||
* Build and render the modal, will call {@link Modal#renderBody}
|
* Build and render the modal, will call {@link Modal#renderBody}
|
||||||
*/
|
*/
|
||||||
public render() {
|
public render(errorMessagesInFooter: boolean = false) {
|
||||||
let modalBodyClass = (this._modalOptions.isAngular === false ? 'modal-body' : 'modal-body-and-footer');
|
let modalBodyClass = (this._modalOptions.isAngular === false ? 'modal-body' : 'modal-body-and-footer');
|
||||||
let parts: Array<HTMLElement> = [];
|
let parts: Array<HTMLElement> = [];
|
||||||
// This modal header section refers to the header of of the dialog
|
// This modal header section refers to the header of of the dialog
|
||||||
@@ -182,17 +186,6 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
|
|
||||||
this.renderBody(body.getHTMLElement());
|
this.renderBody(body.getHTMLElement());
|
||||||
|
|
||||||
if (this._modalOptions.isAngular === false && this._modalOptions.hasErrors) {
|
|
||||||
body.div({ class: 'dialogErrorMessage', id: 'dialogErrorMessage' }, (errorMessageContainer) => {
|
|
||||||
errorMessageContainer.div({ class: 'icon error' }, (iconContainer) => {
|
|
||||||
this._errorIconElement = iconContainer.getHTMLElement();
|
|
||||||
this._errorIconElement.style.visibility = 'hidden';
|
|
||||||
});
|
|
||||||
errorMessageContainer.div({ class: 'errorMessage' }, (messageContainer) => {
|
|
||||||
this._errorMessage = messageContainer;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// This modal footer section refers to the footer of of the dialog
|
// This modal footer section refers to the footer of of the dialog
|
||||||
if (this._modalOptions.isAngular === false) {
|
if (this._modalOptions.isAngular === false) {
|
||||||
this._modalFooterSection = $().div({ class: 'modal-footer' }, (modelFooter) => {
|
this._modalFooterSection = $().div({ class: 'modal-footer' }, (modelFooter) => {
|
||||||
@@ -221,6 +214,19 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
builderClass += ' wide';
|
builderClass += ' wide';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._modalOptions.isAngular === false && this._modalOptions.hasErrors) {
|
||||||
|
let builder = errorMessagesInFooter ? this._leftFooter : body;
|
||||||
|
builder.div({ class: 'dialogErrorMessage', id: 'dialogErrorMessage' }, (errorMessageContainer) => {
|
||||||
|
errorMessageContainer.div({ class: 'icon error' }, (iconContainer) => {
|
||||||
|
this._errorIconElement = iconContainer.getHTMLElement();
|
||||||
|
this._errorIconElement.style.visibility = 'hidden';
|
||||||
|
});
|
||||||
|
errorMessageContainer.div({ class: 'errorMessage' }, (messageContainer) => {
|
||||||
|
this._errorMessage = messageContainer;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// The builder builds the dialog. It append header, body and footer sections.
|
// The builder builds the dialog. It append header, body and footer sections.
|
||||||
this._builder = $().div({ class: builderClass, 'role': 'dialog' }, (dialogContainer) => {
|
this._builder = $().div({ class: builderClass, 'role': 'dialog' }, (dialogContainer) => {
|
||||||
this._modalDialog = dialogContainer.div({ class: 'modal-dialog ', role: 'document' }, (modalDialog) => {
|
this._modalDialog = dialogContainer.div({ class: 'modal-dialog ', role: 'document' }, (modalDialog) => {
|
||||||
@@ -355,14 +361,33 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
* Show an error in the error message element
|
* Show an error in the error message element
|
||||||
* @param err Text to show in the error message
|
* @param err Text to show in the error message
|
||||||
*/
|
*/
|
||||||
protected setError(err: string) {
|
protected setError(err: string, level: MessageLevel = MessageLevel.Error) {
|
||||||
if (this._modalOptions.hasErrors) {
|
if (this._modalOptions.hasErrors) {
|
||||||
if (err === '') {
|
if (err === '') {
|
||||||
this._errorIconElement.style.visibility = 'hidden';
|
this._errorIconElement.style.visibility = 'hidden';
|
||||||
} else {
|
} else {
|
||||||
|
const levelClasses = ['info', 'warning', 'error'];
|
||||||
|
let selectedLevel = levelClasses[2];
|
||||||
|
let altText = ERROR_ALT_TEXT;
|
||||||
|
if (level === MessageLevel.Information) {
|
||||||
|
selectedLevel = levelClasses[0];
|
||||||
|
altText = INFO_ALT_TEXT;
|
||||||
|
} else if (level === MessageLevel.Warning) {
|
||||||
|
selectedLevel = levelClasses[1];
|
||||||
|
altText = WARNING_ALT_TEXT;
|
||||||
|
}
|
||||||
|
levelClasses.forEach(level => {
|
||||||
|
if (selectedLevel === level) {
|
||||||
|
this._errorIconElement.classList.add(level);
|
||||||
|
} else {
|
||||||
|
this._errorIconElement.classList.remove(level);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this._errorIconElement.title = altText;
|
||||||
this._errorIconElement.style.visibility = 'visible';
|
this._errorIconElement.style.visibility = 'visible';
|
||||||
}
|
}
|
||||||
this._errorMessage.innerHtml(err);
|
this._errorMessage.text(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,8 +115,7 @@ export class SelectBox extends vsSelectBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enable(): void {
|
public enable(): void {
|
||||||
//@SQLTODO
|
this.selectElement.disabled = false;
|
||||||
//this.selectElement.disabled = false;
|
|
||||||
this.selectBackground = this.enabledSelectBackground;
|
this.selectBackground = this.enabledSelectBackground;
|
||||||
this.selectForeground = this.enabledSelectForeground;
|
this.selectForeground = this.enabledSelectForeground;
|
||||||
this.selectBorder = this.enabledSelectBorder;
|
this.selectBorder = this.enabledSelectBorder;
|
||||||
@@ -124,8 +123,7 @@ export class SelectBox extends vsSelectBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public disable(): void {
|
public disable(): void {
|
||||||
//@SQLTODO
|
this.selectElement.disabled = true;
|
||||||
//this.selectElement.disabled = true;
|
|
||||||
this.selectBackground = this.disabledSelectBackground;
|
this.selectBackground = this.disabledSelectBackground;
|
||||||
this.selectForeground = this.disabledSelectForeground;
|
this.selectForeground = this.disabledSelectForeground;
|
||||||
this.selectBorder = this.disabledSelectBorder;
|
this.selectBorder = this.disabledSelectBorder;
|
||||||
|
|||||||
1
src/sql/base/browser/ui/table/media/down-inverse.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#2d2d30;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>CollapseChevronDown_md_16x</title><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/><path class="icon-vs-out" d="M15.444,6.061,8,13.5.556,6.061,3.03,3.586,8,8.556l4.97-4.97Z" style="display: none;"/><path class="icon-vs-bg" d="M14.03,6.061,8,12.091,1.97,6.061,3.03,5,8,9.97,12.97,5Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 507 B |
1
src/sql/base/browser/ui/table/media/down.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}</style></defs><title>CollapseChevronDown_md_16x</title><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/><path class="icon-vs-out" d="M15.444,6.061,8,13.5.556,6.061,3.03,3.586,8,8.556l4.97-4.97Z" style="display: none;"/><path class="icon-vs-bg" d="M14.03,6.061,8,12.091,1.97,6.061,3.03,5,8,9.97,12.97,5Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 507 B |
1
src/sql/base/browser/ui/table/media/filter.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{font-size:12px;font-family:FullMDL2Assets, Full MDL2 Assets;}</style></defs><title>filter_16x16</title><text class="cls-1" transform="translate(0 12)"> </text><path d="M0,1.53H16V3.24l-6,6v6.27H6V9.22l-6-6ZM15,2.82V2.53H1v.29l6,6v5.69H9V8.8Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 363 B |
1
src/sql/base/browser/ui/table/media/filter_inverse.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{font-size:12px;font-family:FullMDL2Assets, Full MDL2 Assets;}.cls-1,.cls-2{fill:#fff;}</style></defs><title>filter_inverse_16x16</title><text class="cls-1" transform="translate(0.03 12.1)"> </text><path class="cls-2" d="M.05,1.63H16V3.33l-6,6v6.27H6V9.31l-6-6ZM15,2.91V2.62H1v.29l6,6v5.69H9V8.89Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 418 B |
@@ -31,4 +31,117 @@
|
|||||||
height: 5px;
|
height: 5px;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menubutton {
|
||||||
|
background-position: center center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
bottom: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 0;
|
||||||
|
width: 18px;
|
||||||
|
background-image: url('down.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark .slick-header-menubutton {
|
||||||
|
background-image: url('down-inverse.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menubutton.filtered {
|
||||||
|
background-image: url('filter.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark .slick-header-menubutton.filtered {
|
||||||
|
background-image: url('filter_inverse.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menu {
|
||||||
|
background: none repeat scroll 0 0 white;
|
||||||
|
border: 1px solid #BFBDBD;
|
||||||
|
min-width: 175px;
|
||||||
|
padding: 4px;
|
||||||
|
z-index: 100000;
|
||||||
|
cursor: default;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark .slick-header-menu {
|
||||||
|
background: none repeat scroll 0 0 #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menu a.monaco-button.monaco-text-button {
|
||||||
|
width: 60px;
|
||||||
|
margin: 6px 6px 6px 6px;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menu .filter
|
||||||
|
{
|
||||||
|
border: 1px solid #BFBDBD;
|
||||||
|
font-size: 8pt;
|
||||||
|
height: 400px;
|
||||||
|
margin-top: 6px;
|
||||||
|
overflow: scroll;
|
||||||
|
padding: 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menuitem
|
||||||
|
{
|
||||||
|
border: 1px solid transparent;
|
||||||
|
padding: 2px 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
list-style: none outside none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menuicon
|
||||||
|
{
|
||||||
|
display: inline-block;
|
||||||
|
height: 16px;
|
||||||
|
margin-right: 4px;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menuicon.ascending {
|
||||||
|
background: url('sort-asc.gif');
|
||||||
|
background-position: center center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menuicon.descending {
|
||||||
|
background: url('sort-desc.gif');
|
||||||
|
background-position: center center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menucontent {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-header-menuitem:hover {
|
||||||
|
border-color: #BFBDBD;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-overlay, .cell-overlay, .selection-cell-overlay {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark .slick-header-menu > input.input {
|
||||||
|
color: #4a4a4a;
|
||||||
}
|
}
|
||||||
353
src/sql/base/browser/ui/table/plugins/headerFilter.plugin.ts
Normal file
@@ -0,0 +1,353 @@
|
|||||||
|
// Adopted and converted to typescript from https://github.com/danny-sg/slickgrid-spreadsheet-plugins/blob/master/ext.headerfilter.js
|
||||||
|
// heavily modified
|
||||||
|
import 'vs/css!sql/base/browser/ui/table/media/table';
|
||||||
|
|
||||||
|
import { mixin } from 'vs/base/common/objects';
|
||||||
|
import { SlickGrid } from 'angular2-slickgrid';
|
||||||
|
import { Button } from '../../button/button';
|
||||||
|
import { attachButtonStyler } from 'sql/common/theme/styler';
|
||||||
|
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||||
|
|
||||||
|
export class HeaderFilter {
|
||||||
|
|
||||||
|
public onFilterApplied = new Slick.Event();
|
||||||
|
public onCommand = new Slick.Event();
|
||||||
|
|
||||||
|
private grid;
|
||||||
|
private handler = new Slick.EventHandler();
|
||||||
|
private defaults = {
|
||||||
|
filterImage: 'src/sql/media/icons/filter.svg',
|
||||||
|
sortAscImage: 'sort-asc.gif',
|
||||||
|
sortDescImage: 'sort-desc.gif'
|
||||||
|
};
|
||||||
|
|
||||||
|
private $menu;
|
||||||
|
private options: any;
|
||||||
|
private okButton: Button;
|
||||||
|
private clearButton: Button;
|
||||||
|
private cancelButton: Button;
|
||||||
|
private workingFilters: any;
|
||||||
|
private columnDef: any;
|
||||||
|
|
||||||
|
constructor(options: any, private _themeService: IThemeService) {
|
||||||
|
this.options = mixin(options, this.defaults, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(grid: Slick.Grid<any>): void {
|
||||||
|
this.grid = grid;
|
||||||
|
this.handler.subscribe(this.grid.onHeaderCellRendered, (e, args) => this.handleHeaderCellRendered(e , args))
|
||||||
|
.subscribe(this.grid.onBeforeHeaderCellDestroy, (e, args) => this.handleBeforeHeaderCellDestroy(e, args))
|
||||||
|
.subscribe(this.grid.onClick, (e) => this.handleBodyMouseDown)
|
||||||
|
.subscribe(this.grid.onColumnsResized, () => this.columnsResized());
|
||||||
|
|
||||||
|
this.grid.setColumns(this.grid.getColumns());
|
||||||
|
|
||||||
|
$(document.body).bind('mousedown', this.handleBodyMouseDown);
|
||||||
|
}
|
||||||
|
|
||||||
|
public destroy() {
|
||||||
|
this.handler.unsubscribeAll();
|
||||||
|
$(document.body).unbind('mousedown', this.handleBodyMouseDown);
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleBodyMouseDown = (e) => {
|
||||||
|
if (this.$menu && this.$menu[0] !== e.target && !$.contains(this.$menu[0], e.target)) {
|
||||||
|
this.hideMenu();
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private hideMenu() {
|
||||||
|
if (this.$menu) {
|
||||||
|
this.$menu.remove();
|
||||||
|
this.$menu = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleHeaderCellRendered(e, args) {
|
||||||
|
let column = args.column;
|
||||||
|
if (column.id === '_detail_selector') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let $el = $('<div></div>')
|
||||||
|
.addClass('slick-header-menubutton')
|
||||||
|
.data('column', column);
|
||||||
|
|
||||||
|
$el.bind('click', (e) => this.showFilter(e)).appendTo(args.node);
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleBeforeHeaderCellDestroy(e, args) {
|
||||||
|
$(args.node)
|
||||||
|
.find('.slick-header-menubutton')
|
||||||
|
.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
private addMenuItem(menu, columnDef, title, command, image) {
|
||||||
|
let $item = $('<div class="slick-header-menuitem">')
|
||||||
|
.data('command', command)
|
||||||
|
.data('column', columnDef)
|
||||||
|
.bind('click', (e) => this.handleMenuItemClick(e, command, columnDef))
|
||||||
|
.appendTo(menu);
|
||||||
|
|
||||||
|
let $icon = $('<div class="slick-header-menuicon">')
|
||||||
|
.appendTo($item);
|
||||||
|
|
||||||
|
if (title === 'Sort Ascending') {
|
||||||
|
$icon.get(0).className += ' ascending';
|
||||||
|
} else if (title === 'Sort Descending') {
|
||||||
|
$icon.get(0).className += ' descending';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('<span class="slick-header-menucontent">')
|
||||||
|
.text(title)
|
||||||
|
.appendTo($item);
|
||||||
|
}
|
||||||
|
|
||||||
|
private addMenuInput(menu, columnDef) {
|
||||||
|
const self = this;
|
||||||
|
$('<input class="input" placeholder="Search" style="margin-top: 5px; width: 206px">')
|
||||||
|
.data('column', columnDef)
|
||||||
|
.bind('keyup', (e) => {
|
||||||
|
let filterVals = this.getFilterValuesByInput($(e.target));
|
||||||
|
self.updateFilterInputs(menu, columnDef, filterVals);
|
||||||
|
})
|
||||||
|
.appendTo(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateFilterInputs(menu, columnDef, filterItems) {
|
||||||
|
let filterOptions = '<label><input type="checkbox" value="-1" />(Select All)</label>';
|
||||||
|
columnDef.filterValues = columnDef.filterValues || [];
|
||||||
|
|
||||||
|
// WorkingFilters is a copy of the filters to enable apply/cancel behaviour
|
||||||
|
this.workingFilters = columnDef.filterValues.slice(0);
|
||||||
|
|
||||||
|
for (let i = 0; i < filterItems.length; i++) {
|
||||||
|
let filtered = _.contains(this.workingFilters, filterItems[i]);
|
||||||
|
|
||||||
|
filterOptions += '<label><input type="checkbox" value="' + i + '"'
|
||||||
|
+ (filtered ? ' checked="checked"' : '')
|
||||||
|
+ '/>' + filterItems[i] + '</label>';
|
||||||
|
}
|
||||||
|
let $filter = menu.find('.filter');
|
||||||
|
$filter.empty().append($(filterOptions));
|
||||||
|
|
||||||
|
$(':checkbox', $filter).bind('click', (e) => {
|
||||||
|
this.workingFilters = this.changeWorkingFilter(filterItems, this.workingFilters, $(e.target));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private showFilter(e) {
|
||||||
|
let $menuButton = $(e.target);
|
||||||
|
this.columnDef = $menuButton.data('column');
|
||||||
|
|
||||||
|
this.columnDef.filterValues = this.columnDef.filterValues || [];
|
||||||
|
|
||||||
|
// WorkingFilters is a copy of the filters to enable apply/cancel behaviour
|
||||||
|
this.workingFilters = this.columnDef.filterValues.slice(0);
|
||||||
|
|
||||||
|
let filterItems;
|
||||||
|
|
||||||
|
if (this.workingFilters.length === 0) {
|
||||||
|
// Filter based all available values
|
||||||
|
filterItems = this.getFilterValues(this.grid.getData(), this.columnDef);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Filter based on current dataView subset
|
||||||
|
filterItems = this.getAllFilterValues(this.grid.getData().getItems(), this.columnDef);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.$menu) {
|
||||||
|
this.$menu = $('<div class="slick-header-menu">').appendTo(document.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$menu.empty();
|
||||||
|
|
||||||
|
this.addMenuItem(this.$menu, this.columnDef, 'Sort Ascending', 'sort-asc', this.options.sortAscImage);
|
||||||
|
this.addMenuItem(this.$menu, this.columnDef, 'Sort Descending', 'sort-desc', this.options.sortDescImage);
|
||||||
|
this.addMenuInput(this.$menu, this.columnDef);
|
||||||
|
|
||||||
|
let filterOptions = '<label><input type="checkbox" value="-1" />(Select All)</label>';
|
||||||
|
|
||||||
|
for (let i = 0; i < filterItems.length; i++) {
|
||||||
|
let filtered = _.contains(this.workingFilters, filterItems[i]);
|
||||||
|
if (filterItems[i] && filterItems[i].indexOf('Error:') < 0) {
|
||||||
|
filterOptions += '<label><input type="checkbox" value="' + i + '"'
|
||||||
|
+ (filtered ? ' checked="checked"' : '')
|
||||||
|
+ '/>' + filterItems[i] + '</label>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let $filter = $('<div class="filter">')
|
||||||
|
.append($(filterOptions))
|
||||||
|
.appendTo(this.$menu);
|
||||||
|
|
||||||
|
this.okButton = new Button(this.$menu.get(0));
|
||||||
|
this.okButton.label = 'OK';
|
||||||
|
this.okButton.title = 'OK';
|
||||||
|
this.okButton.element.id = 'filter-ok-button';
|
||||||
|
let okElement = $('#filter-ok-button');
|
||||||
|
okElement.bind('click', (ev) => {
|
||||||
|
this.columnDef.filterValues = this.workingFilters.splice(0);
|
||||||
|
this.setButtonImage($menuButton, this.columnDef.filterValues.length > 0);
|
||||||
|
this.handleApply(ev, this.columnDef);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.clearButton = new Button(this.$menu.get(0));
|
||||||
|
this.clearButton.label = 'Clear';
|
||||||
|
this.clearButton.title = 'Clear';
|
||||||
|
this.clearButton.element.id = 'filter-clear-button';
|
||||||
|
let clearElement = $('#filter-clear-button');
|
||||||
|
clearElement.bind('click', (ev) => {
|
||||||
|
this.columnDef.filterValues.length = 0;
|
||||||
|
this.setButtonImage($menuButton, false);
|
||||||
|
this.handleApply(ev, this.columnDef);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.cancelButton = new Button(this.$menu.get(0));
|
||||||
|
this.cancelButton.label = 'Cancel';
|
||||||
|
this.cancelButton.title = 'Cancel';
|
||||||
|
this.cancelButton.element.id = 'filter-cancel-button';
|
||||||
|
let cancelElement = $('#filter-cancel-button');
|
||||||
|
cancelElement.bind('click', () => this.hideMenu());
|
||||||
|
attachButtonStyler(this.okButton, this._themeService);
|
||||||
|
attachButtonStyler(this.clearButton, this._themeService);
|
||||||
|
attachButtonStyler(this.cancelButton, this._themeService);
|
||||||
|
|
||||||
|
$(':checkbox', $filter).bind('click', (e) => {
|
||||||
|
this.workingFilters = this.changeWorkingFilter(filterItems, this.workingFilters, $(e.target));
|
||||||
|
});
|
||||||
|
|
||||||
|
let offset = $(e.target).offset();
|
||||||
|
let left = offset.left - this.$menu.width() + $(e.target).width() - 8;
|
||||||
|
|
||||||
|
let menutop = offset.top + $(e.target).height();
|
||||||
|
|
||||||
|
if (menutop + offset.top > $(window).height()) {
|
||||||
|
menutop -= (this.$menu.height() + $(e.target).height() + 8);
|
||||||
|
}
|
||||||
|
this.$menu.css('top', menutop)
|
||||||
|
.css('left', (left > 0 ? left : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private columnsResized() {
|
||||||
|
this.hideMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
private changeWorkingFilter(filterItems, workingFilters, $checkbox) {
|
||||||
|
let value = $checkbox.val();
|
||||||
|
let $filter = $checkbox.parent().parent();
|
||||||
|
|
||||||
|
if ($checkbox.val() < 0) {
|
||||||
|
// Select All
|
||||||
|
if ($checkbox.prop('checked')) {
|
||||||
|
$(':checkbox', $filter).prop('checked', true);
|
||||||
|
workingFilters = filterItems.slice(0);
|
||||||
|
} else {
|
||||||
|
$(':checkbox', $filter).prop('checked', false);
|
||||||
|
workingFilters.length = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let index = _.indexOf(workingFilters, filterItems[value]);
|
||||||
|
|
||||||
|
if ($checkbox.prop('checked') && index < 0) {
|
||||||
|
workingFilters.push(filterItems[value]);
|
||||||
|
let nextRow = filterItems[(parseInt(value)+1).toString()];
|
||||||
|
if (nextRow && nextRow.indexOf('Error:') >= 0) {
|
||||||
|
workingFilters.push(nextRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (index > -1) {
|
||||||
|
workingFilters.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return workingFilters;
|
||||||
|
}
|
||||||
|
|
||||||
|
private setButtonImage($el, filtered) {
|
||||||
|
let element: HTMLElement = $el.get(0);
|
||||||
|
if (filtered) {
|
||||||
|
element.className += ' filtered';
|
||||||
|
} else {
|
||||||
|
let classList = element.classList;
|
||||||
|
if (classList.contains('filtered')) {
|
||||||
|
classList.remove('filtered');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleApply(e, columnDef) {
|
||||||
|
this.hideMenu();
|
||||||
|
|
||||||
|
this.onFilterApplied.notify({ 'grid': this.grid, 'column': columnDef }, e, self);
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private getFilterValues(dataView, column) {
|
||||||
|
let seen = [];
|
||||||
|
for (let i = 0; i < dataView.getLength() ; i++) {
|
||||||
|
let value = dataView.getItem(i)[column.field];
|
||||||
|
|
||||||
|
if (!_.contains(seen, value)) {
|
||||||
|
seen.push(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return seen;
|
||||||
|
}
|
||||||
|
|
||||||
|
private getFilterValuesByInput($input) {
|
||||||
|
let column = $input.data('column'),
|
||||||
|
filter = $input.val(),
|
||||||
|
dataView = this.grid.getData(),
|
||||||
|
seen = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < dataView.getLength() ; i++) {
|
||||||
|
let value = dataView.getItem(i)[column.field];
|
||||||
|
|
||||||
|
if (filter.length > 0) {
|
||||||
|
let itemValue = !value ? '' : value;
|
||||||
|
let lowercaseFilter = filter.toString().toLowerCase();
|
||||||
|
let lowercaseVal = itemValue.toString().toLowerCase();
|
||||||
|
if (!_.contains(seen, value) && lowercaseVal.indexOf(lowercaseFilter) > -1) {
|
||||||
|
seen.push(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!_.contains(seen, value)) {
|
||||||
|
seen.push(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _.sortBy(seen, (v) => { return v; });
|
||||||
|
}
|
||||||
|
|
||||||
|
private getAllFilterValues(data, column) {
|
||||||
|
let seen = [];
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
let value = data[i][column.field];
|
||||||
|
|
||||||
|
if (!_.contains(seen, value)) {
|
||||||
|
seen.push(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _.sortBy(seen, (v) => { return v; });
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleMenuItemClick(e, command, columnDef) {
|
||||||
|
this.hideMenu();
|
||||||
|
|
||||||
|
this.onCommand.notify({
|
||||||
|
'grid': this.grid,
|
||||||
|
'column': columnDef,
|
||||||
|
'command': command
|
||||||
|
}, e, self);
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -277,8 +277,8 @@ export class RowDetailView {
|
|||||||
item._isPadding = false;
|
item._isPadding = false;
|
||||||
item._parent = parent;
|
item._parent = parent;
|
||||||
item._offset = offset;
|
item._offset = offset;
|
||||||
item.jobId = parent.jobId;
|
|
||||||
item.name = parent.message ? parent.message : nls.localize('rowDetailView.loadError','Loading Error...');
|
item.name = parent.message ? parent.message : nls.localize('rowDetailView.loadError','Loading Error...');
|
||||||
|
parent._child = item;
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export interface IFindPosition {
|
|||||||
row: number;
|
row: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
function defaultSort<T>(args: Slick.OnSortEventArgs<T>, data: Array<T>): Array<T> {
|
export function defaultSort<T>(args: Slick.OnSortEventArgs<T>, data: Array<T>): Array<T> {
|
||||||
let field = args.sortCol.field;
|
let field = args.sortCol.field;
|
||||||
let sign = args.sortAsc ? 1 : -1;
|
let sign = args.sortAsc ? 1 : -1;
|
||||||
return data.sort((a, b) => (a[field] === b[field] ? 0 : (a[field] > b[field] ? 1 : -1)) * sign);
|
return data.sort((a, b) => (a[field] === b[field] ? 0 : (a[field] > b[field] ? 1 : -1)) * sign);
|
||||||
|
|||||||
10
src/sql/base/browser/ui/table/utils.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
export function defaultFormatter<T>(valueProperty: keyof T): Slick.Formatter<T> {
|
||||||
|
return (row: number, cell: number, value: any, columnDef: Slick.Column<T>, dataContext: Slick.SlickData): string => {
|
||||||
|
return value[valueProperty];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -72,6 +72,7 @@ export function attachInputBoxStyler(widget: IThemable, themeService: IThemeServ
|
|||||||
export function attachSelectBoxStyler(widget: IThemable, themeService: IThemeService, style?:
|
export function attachSelectBoxStyler(widget: IThemable, themeService: IThemeService, style?:
|
||||||
{
|
{
|
||||||
selectBackground?: cr.ColorIdentifier,
|
selectBackground?: cr.ColorIdentifier,
|
||||||
|
selectListBackground?: cr.ColorIdentifier,
|
||||||
selectForeground?: cr.ColorIdentifier,
|
selectForeground?: cr.ColorIdentifier,
|
||||||
selectBorder?: cr.ColorIdentifier,
|
selectBorder?: cr.ColorIdentifier,
|
||||||
disabledSelectBackground?: cr.ColorIdentifier,
|
disabledSelectBackground?: cr.ColorIdentifier,
|
||||||
@@ -81,10 +82,17 @@ export function attachSelectBoxStyler(widget: IThemable, themeService: IThemeSer
|
|||||||
inputValidationWarningBorder?: cr.ColorIdentifier,
|
inputValidationWarningBorder?: cr.ColorIdentifier,
|
||||||
inputValidationWarningBackground?: cr.ColorIdentifier,
|
inputValidationWarningBackground?: cr.ColorIdentifier,
|
||||||
inputValidationErrorBorder?: cr.ColorIdentifier,
|
inputValidationErrorBorder?: cr.ColorIdentifier,
|
||||||
inputValidationErrorBackground?: cr.ColorIdentifier
|
inputValidationErrorBackground?: cr.ColorIdentifier,
|
||||||
|
focusBorder?: cr.ColorIdentifier,
|
||||||
|
listFocusBackground?: cr.ColorIdentifier,
|
||||||
|
listFocusForeground?: cr.ColorIdentifier,
|
||||||
|
listFocusOutline?: cr.ColorIdentifier,
|
||||||
|
listHoverBackground?: cr.ColorIdentifier,
|
||||||
|
listHoverForeground?: cr.ColorIdentifier
|
||||||
}): IDisposable {
|
}): IDisposable {
|
||||||
return attachStyler(themeService, {
|
return attachStyler(themeService, {
|
||||||
selectBackground: (style && style.selectBackground) || cr.selectBackground,
|
selectBackground: (style && style.selectBackground) || cr.selectBackground,
|
||||||
|
selectListBackground: (style && style.selectListBackground) || cr.selectListBackground,
|
||||||
selectForeground: (style && style.selectForeground) || cr.selectForeground,
|
selectForeground: (style && style.selectForeground) || cr.selectForeground,
|
||||||
selectBorder: (style && style.selectBorder) || cr.selectBorder,
|
selectBorder: (style && style.selectBorder) || cr.selectBorder,
|
||||||
disabledSelectBackground: (style && style.disabledSelectBackground) || sqlcolors.disabledInputBackground,
|
disabledSelectBackground: (style && style.disabledSelectBackground) || sqlcolors.disabledInputBackground,
|
||||||
@@ -94,7 +102,14 @@ export function attachSelectBoxStyler(widget: IThemable, themeService: IThemeSer
|
|||||||
inputValidationWarningBorder: (style && style.inputValidationWarningBorder) || cr.inputValidationWarningBorder,
|
inputValidationWarningBorder: (style && style.inputValidationWarningBorder) || cr.inputValidationWarningBorder,
|
||||||
inputValidationWarningBackground: (style && style.inputValidationWarningBackground) || cr.inputValidationWarningBackground,
|
inputValidationWarningBackground: (style && style.inputValidationWarningBackground) || cr.inputValidationWarningBackground,
|
||||||
inputValidationErrorBorder: (style && style.inputValidationErrorBorder) || cr.inputValidationErrorBorder,
|
inputValidationErrorBorder: (style && style.inputValidationErrorBorder) || cr.inputValidationErrorBorder,
|
||||||
inputValidationErrorBackground: (style && style.inputValidationErrorBackground) || cr.inputValidationErrorBackground
|
inputValidationErrorBackground: (style && style.inputValidationErrorBackground) || cr.inputValidationErrorBackground,
|
||||||
|
focusBorder: (style && style.focusBorder) || cr.focusBorder,
|
||||||
|
listFocusBackground: (style && style.listFocusBackground) || cr.listFocusBackground,
|
||||||
|
listFocusForeground: (style && style.listFocusForeground) || cr.listFocusForeground,
|
||||||
|
listFocusOutline: (style && style.listFocusOutline) || cr.activeContrastBorder,
|
||||||
|
listHoverBackground: (style && style.listHoverBackground) || cr.listHoverBackground,
|
||||||
|
listHoverForeground: (style && style.listHoverForeground) || cr.listHoverForeground,
|
||||||
|
listHoverOutline: (style && style.listFocusOutline) || cr.activeContrastBorder
|
||||||
}, widget);
|
}, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,4 +216,19 @@
|
|||||||
|
|
||||||
.vs .icon.unpin {
|
.vs .icon.unpin {
|
||||||
background: url('unpin.svg') center center no-repeat;
|
background: url('unpin.svg') center center no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.medium {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.large {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#F6F6F6;} .icon-vs-blue{fill:#1BA1E2;} .icon-white{fill:#FFFFFF;}</style><path class="icon-canvas-transparent" d="M16 16h-16v-16h16v16z" id="canvas"/><path class="icon-vs-out" d="M0 8c0-4.418 3.582-8 8-8s8 3.582 8 8-3.582 8-8 8-8-3.582-8-8z" id="outline"/><path class="icon-vs-blue" d="M8 1c-3.865 0-7 3.135-7 7s3.135 7 7 7 7-3.135 7-7-3.135-7-7-7zm1 12h-2v-7h2v7zm0-8h-2v-2h2v2z" id="iconBg"/><path class="icon-white" d="M7 6h2v7h-2v-7zm0-1h2v-2h-2v2z" id="iconFg"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#F6F6F6;} .icon-vs-blue{fill:#1BA1E2;} .icon-white{fill:#FFFFFF;}</style><path class="icon-canvas-transparent" d="M16 16h-16v-16h16v16z" id="canvas"/><path class="icon-vs-out" d="M0 8c0-4.418 3.582-8 8-8s8 3.582 8 8-3.582 8-8 8-8-3.582-8-8z" id="outline"/><path class="icon-vs-blue" d="M8 1c-3.865 0-7 3.135-7 7s3.135 7 7 7 7-3.135 7-7-3.135-7-7-7zm1 12h-2v-7h2v7zm0-8h-2v-2h2v2z" id="iconBg"/><path class="icon-white" d="M7 6h2v7h-2v-7zm0-1h2v-2h-2v2z" id="iconFg"/></svg>
|
||||||
|
Before Width: | Height: | Size: 627 B After Width: | Height: | Size: 624 B |
@@ -6,12 +6,14 @@
|
|||||||
import { NgModule, Inject, forwardRef, ApplicationRef, ComponentFactoryResolver, Type } from '@angular/core';
|
import { NgModule, Inject, forwardRef, ApplicationRef, ComponentFactoryResolver, Type } from '@angular/core';
|
||||||
import { APP_BASE_HREF, CommonModule } from '@angular/common';
|
import { APP_BASE_HREF, CommonModule } from '@angular/common';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
|
||||||
|
|
||||||
import { CreateLoginComponent, CREATELOGIN_SELECTOR } from 'sql/parts/admin/security/createLogin.component';
|
import { IBootstrapParams, providerIterator } from 'sql/services/bootstrap/bootstrapService';
|
||||||
|
import { CreateLoginComponent } from 'sql/parts/admin/security/createLogin.component';
|
||||||
|
|
||||||
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
|
|
||||||
// Connection Dashboard main angular module
|
// Connection Dashboard main angular module
|
||||||
export const CreateLoginModule = (params: IBootstrapParams, selector: string): Type<any> => {
|
export const CreateLoginModule = (params: IBootstrapParams, selector: string, instantiationService: IInstantiationService): Type<any> => {
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@@ -24,7 +26,8 @@ export const CreateLoginModule = (params: IBootstrapParams, selector: string): T
|
|||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: APP_BASE_HREF, useValue: '/' },
|
{ provide: APP_BASE_HREF, useValue: '/' },
|
||||||
{ provide: IBootstrapParams, useValue: params }
|
{ provide: IBootstrapParams, useValue: params },
|
||||||
|
...providerIterator(instantiationService)
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
class ModuleClass {
|
class ModuleClass {
|
||||||
|
|||||||
@@ -38,13 +38,13 @@ export function convertEditorInput(input: EditorInput, options: IQueryEditorOpti
|
|||||||
let uri: URI = getQueryEditorFileUri(input);
|
let uri: URI = getQueryEditorFileUri(input);
|
||||||
if (uri) {
|
if (uri) {
|
||||||
const queryResultsInput: QueryResultsInput = instantiationService.createInstance(QueryResultsInput, uri.toString());
|
const queryResultsInput: QueryResultsInput = instantiationService.createInstance(QueryResultsInput, uri.toString());
|
||||||
let queryInput: QueryInput = instantiationService.createInstance(QueryInput, input.getName(), '', input, queryResultsInput, undefined);
|
let queryInput: QueryInput = instantiationService.createInstance(QueryInput, '', input, queryResultsInput, undefined);
|
||||||
return queryInput;
|
return queryInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
//QueryPlanInput
|
//QueryPlanInput
|
||||||
uri = getQueryPlanEditorUri(input);
|
uri = getQueryPlanEditorUri(input);
|
||||||
if(uri) {
|
if (uri) {
|
||||||
let queryPlanXml: string = fs.readFileSync(uri.fsPath);
|
let queryPlanXml: string = fs.readFileSync(uri.fsPath);
|
||||||
let queryPlanInput: QueryPlanInput = instantiationService.createInstance(QueryPlanInput, queryPlanXml, 'aaa', undefined);
|
let queryPlanInput: QueryPlanInput = instantiationService.createInstance(QueryPlanInput, queryPlanXml, 'aaa', undefined);
|
||||||
return queryPlanInput;
|
return queryPlanInput;
|
||||||
@@ -60,14 +60,14 @@ export function convertEditorInput(input: EditorInput, options: IQueryEditorOpti
|
|||||||
*/
|
*/
|
||||||
export function getSupportedInputResource(input: IEditorInput): URI {
|
export function getSupportedInputResource(input: IEditorInput): URI {
|
||||||
if (input instanceof UntitledEditorInput) {
|
if (input instanceof UntitledEditorInput) {
|
||||||
let untitledCast: UntitledEditorInput = <UntitledEditorInput> input;
|
let untitledCast: UntitledEditorInput = <UntitledEditorInput>input;
|
||||||
if (untitledCast) {
|
if (untitledCast) {
|
||||||
return untitledCast.getResource();
|
return untitledCast.getResource();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input instanceof FileEditorInput) {
|
if (input instanceof FileEditorInput) {
|
||||||
let fileCast: FileEditorInput = <FileEditorInput> input;
|
let fileCast: FileEditorInput = <FileEditorInput>input;
|
||||||
if (fileCast) {
|
if (fileCast) {
|
||||||
return fileCast.getResource();
|
return fileCast.getResource();
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ function getQueryEditorFileUri(input: EditorInput): URI {
|
|||||||
if (uri) {
|
if (uri) {
|
||||||
let isValidUri: boolean = !!uri && !!uri.toString;
|
let isValidUri: boolean = !!uri && !!uri.toString;
|
||||||
|
|
||||||
if (isValidUri && (hasFileExtension(sqlFileTypes, input, true) || hasSqlFileMode(input)) ) {
|
if (isValidUri && (hasFileExtension(sqlFileTypes, input, true) || hasSqlFileMode(input))) {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ function getQueryPlanEditorUri(input: EditorInput): URI {
|
|||||||
// If this editor is not already of type queryinput
|
// If this editor is not already of type queryinput
|
||||||
if (!(input instanceof QueryPlanInput)) {
|
if (!(input instanceof QueryPlanInput)) {
|
||||||
let uri: URI = getSupportedInputResource(input);
|
let uri: URI = getSupportedInputResource(input);
|
||||||
if(uri) {
|
if (uri) {
|
||||||
if (hasFileExtension(sqlPlanFileTypes, input, false)) {
|
if (hasFileExtension(sqlPlanFileTypes, input, false)) {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ function getQueryPlanEditorUri(input: EditorInput): URI {
|
|||||||
*/
|
*/
|
||||||
function hasSqlFileMode(input: EditorInput): boolean {
|
function hasSqlFileMode(input: EditorInput): boolean {
|
||||||
if (input instanceof UntitledEditorInput) {
|
if (input instanceof UntitledEditorInput) {
|
||||||
let untitledCast: UntitledEditorInput = <UntitledEditorInput> input;
|
let untitledCast: UntitledEditorInput = <UntitledEditorInput>input;
|
||||||
return untitledCast && (untitledCast.getModeId() === undefined || untitledCast.getModeId() === sqlModeId);
|
return untitledCast && (untitledCast.getModeId() === undefined || untitledCast.getModeId() === sqlModeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ export const capabilitiesOptions = 'OPTIONS_METADATA';
|
|||||||
export const configMaxRecentConnections = 'maxRecentConnections';
|
export const configMaxRecentConnections = 'maxRecentConnections';
|
||||||
|
|
||||||
export const mssqlProviderName = 'MSSQL';
|
export const mssqlProviderName = 'MSSQL';
|
||||||
|
export const anyProviderName = '*';
|
||||||
|
export const connectionProviderContextKey = 'connectionProvider';
|
||||||
|
|
||||||
export const applicationName = 'sqlops';
|
export const applicationName = 'sqlops';
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ export class ConnectionWidget {
|
|||||||
strictSelection: false,
|
strictSelection: false,
|
||||||
placeholder: this._defaultDatabaseName,
|
placeholder: this._defaultDatabaseName,
|
||||||
maxHeight: 125,
|
maxHeight: 125,
|
||||||
ariaLabel: databaseOption.displayName
|
ariaLabel: databaseOption.displayName,
|
||||||
|
actionLabel: localize('toggleDatabaseNameDropdown', 'Select Database Toggle Dropdown')
|
||||||
});
|
});
|
||||||
|
|
||||||
let serverGroupLabel = localize('serverGroup', 'Server group');
|
let serverGroupLabel = localize('serverGroup', 'Server group');
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import { WEBVIEW_CONTAINER } from 'sql/parts/dashboard/containers/dashboardWebvi
|
|||||||
import { MODELVIEW_CONTAINER } from 'sql/parts/dashboard/containers/dashboardModelViewContainer.contribution';
|
import { MODELVIEW_CONTAINER } from 'sql/parts/dashboard/containers/dashboardModelViewContainer.contribution';
|
||||||
import { CONTROLHOST_CONTAINER } from 'sql/parts/dashboard/containers/dashboardControlHostContainer.contribution';
|
import { CONTROLHOST_CONTAINER } from 'sql/parts/dashboard/containers/dashboardControlHostContainer.contribution';
|
||||||
import { NAV_SECTION } from 'sql/parts/dashboard/containers/dashboardNavSection.contribution';
|
import { NAV_SECTION } from 'sql/parts/dashboard/containers/dashboardNavSection.contribution';
|
||||||
import { IDashboardContainerRegistry, Extensions as DashboardContainerExtensions, IDashboardContainer, registerContainerType } from 'sql/platform/dashboard/common/dashboardContainerRegistry';
|
import { IDashboardContainerRegistry, Extensions as DashboardContainerExtensions } from 'sql/platform/dashboard/common/dashboardContainerRegistry';
|
||||||
import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
|
||||||
import { SingleConnectionManagementService } from 'sql/services/common/commonServiceInterface.service';
|
import { SingleConnectionManagementService } from 'sql/services/common/commonServiceInterface.service';
|
||||||
|
import * as Constants from 'sql/parts/connection/common/constants';
|
||||||
|
|
||||||
const dashboardcontainerRegistry = Registry.as<IDashboardContainerRegistry>(DashboardContainerExtensions.dashboardContainerContributions);
|
const dashboardcontainerRegistry = Registry.as<IDashboardContainerRegistry>(DashboardContainerExtensions.dashboardContainerContributions);
|
||||||
const containerTypes = [
|
const containerTypes = [
|
||||||
@@ -136,13 +136,17 @@ export function addProvider<T extends { connectionManagementService: SingleConne
|
|||||||
*/
|
*/
|
||||||
export function addEdition<T extends { connectionManagementService: SingleConnectionManagementService }>(config: WidgetConfig[], collection: DashboardServiceInterface): Array<WidgetConfig> {
|
export function addEdition<T extends { connectionManagementService: SingleConnectionManagementService }>(config: WidgetConfig[], collection: DashboardServiceInterface): Array<WidgetConfig> {
|
||||||
let connectionInfo: ConnectionManagementInfo = collection.connectionManagementService.connectionInfo;
|
let connectionInfo: ConnectionManagementInfo = collection.connectionManagementService.connectionInfo;
|
||||||
let edition = connectionInfo.serverInfo.engineEditionId;
|
if (connectionInfo.serverInfo) {
|
||||||
return config.map((item) => {
|
let edition = connectionInfo.serverInfo.engineEditionId;
|
||||||
if (item.edition === undefined) {
|
return config.map((item) => {
|
||||||
item.edition = edition;
|
if (item.edition === undefined) {
|
||||||
}
|
item.edition = edition;
|
||||||
return item;
|
}
|
||||||
});
|
return item;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return config;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,9 +166,11 @@ export function addContext(config: WidgetConfig[], collection: any, context: str
|
|||||||
* Returns a filtered version of the widgets passed based on edition and provider
|
* Returns a filtered version of the widgets passed based on edition and provider
|
||||||
* @param config widgets to filter
|
* @param config widgets to filter
|
||||||
*/
|
*/
|
||||||
export function filterConfigs<T extends { when?: string }, K extends { contextKeyService: IContextKeyService }>(config: T[], collection: K): Array<T> {
|
export function filterConfigs<T extends { provider?: string | string[], when?: string }, K extends { contextKeyService: IContextKeyService }>(config: T[], collection: K): Array<T> {
|
||||||
return config.filter((item) => {
|
return config.filter((item) => {
|
||||||
if (!item.when) {
|
if (!hasCompatibleProvider(item.provider, collection.contextKeyService)) {
|
||||||
|
return false;
|
||||||
|
} else if (!item.when) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return collection.contextKeyService.contextMatchesRules(ContextKeyExpr.deserialize(item.when));
|
return collection.contextKeyService.contextMatchesRules(ContextKeyExpr.deserialize(item.when));
|
||||||
@@ -172,6 +178,21 @@ export function filterConfigs<T extends { when?: string }, K extends { contextKe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether the listed providers contain '*' indicating any provider will do, or that they are a match
|
||||||
|
* for the currently scoped 'connectionProvider' context key.
|
||||||
|
*/
|
||||||
|
function hasCompatibleProvider(provider: string | string[], contextKeyService: IContextKeyService): boolean {
|
||||||
|
let isCompatible = true;
|
||||||
|
let connectionProvider = contextKeyService.getContextKeyValue<string>(Constants.connectionProviderContextKey);
|
||||||
|
if (connectionProvider) {
|
||||||
|
let providers = (provider instanceof Array) ? provider : [provider];
|
||||||
|
let matchingProvider = providers.find((p) => p === connectionProvider || p === Constants.anyProviderName);
|
||||||
|
isCompatible = (matchingProvider !== undefined);
|
||||||
|
} // Else there's no connection context so skip the check
|
||||||
|
return isCompatible;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get registered container if it is specified as the key
|
* Get registered container if it is specified as the key
|
||||||
* @param container dashboard container
|
* @param container dashboard container
|
||||||
|
|||||||
@@ -11,29 +11,23 @@ import { Component, Inject, forwardRef, ViewChild, ElementRef, ViewChildren, Que
|
|||||||
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
|
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
|
||||||
import { CommonServiceInterface, SingleConnectionManagementService } from 'sql/services/common/commonServiceInterface.service';
|
import { CommonServiceInterface, SingleConnectionManagementService } from 'sql/services/common/commonServiceInterface.service';
|
||||||
import { WidgetConfig, TabConfig, TabSettingConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
import { WidgetConfig, TabConfig, TabSettingConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
||||||
import { Extensions, IInsightRegistry } from 'sql/platform/dashboard/common/insightRegistry';
|
|
||||||
import { DashboardWidgetWrapper } from 'sql/parts/dashboard/contents/dashboardWidgetWrapper.component';
|
|
||||||
import { IPropertiesConfig } from 'sql/parts/dashboard/pages/serverDashboardPage.contribution';
|
import { IPropertiesConfig } from 'sql/parts/dashboard/pages/serverDashboardPage.contribution';
|
||||||
import { PanelComponent } from 'sql/base/browser/ui/panel/panel.component';
|
import { PanelComponent } from 'sql/base/browser/ui/panel/panel.component';
|
||||||
import { IDashboardRegistry, Extensions as DashboardExtensions, IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
import { IDashboardRegistry, Extensions as DashboardExtensions, IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
||||||
import { PinUnpinTabAction, AddFeatureTabAction } from './actions';
|
import { PinUnpinTabAction, AddFeatureTabAction } from './actions';
|
||||||
import { TabComponent, TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
import { TabComponent, TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||||
import { AngularEventType, IAngularEventingService } from 'sql/services/angularEventing/angularEventingService';
|
import { AngularEventType, IAngularEventingService } from 'sql/services/angularEventing/angularEventingService';
|
||||||
import { DashboardTab } from 'sql/parts/dashboard/common/interfaces';
|
import { DashboardTab, IConfigModifierCollection } from 'sql/parts/dashboard/common/interfaces';
|
||||||
import * as dashboardHelper from 'sql/parts/dashboard/common/dashboardHelper';
|
import * as dashboardHelper from 'sql/parts/dashboard/common/dashboardHelper';
|
||||||
import { WIDGETS_CONTAINER } from 'sql/parts/dashboard/containers/dashboardWidgetContainer.contribution';
|
import { WIDGETS_CONTAINER } from 'sql/parts/dashboard/containers/dashboardWidgetContainer.contribution';
|
||||||
import { GRID_CONTAINER } from 'sql/parts/dashboard/containers/dashboardGridContainer.contribution';
|
import { GRID_CONTAINER } from 'sql/parts/dashboard/containers/dashboardGridContainer.contribution';
|
||||||
import { AngularDisposable } from 'sql/base/common/lifecycle';
|
import { AngularDisposable } from 'sql/base/common/lifecycle';
|
||||||
|
import * as Constants from 'sql/parts/connection/common/constants';
|
||||||
|
|
||||||
import { Registry } from 'vs/platform/registry/common/platform';
|
import { Registry } from 'vs/platform/registry/common/platform';
|
||||||
import * as types from 'vs/base/common/types';
|
import * as types from 'vs/base/common/types';
|
||||||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||||
import * as nls from 'vs/nls';
|
import * as nls from 'vs/nls';
|
||||||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
|
||||||
import { addDisposableListener, getContentHeight, EventType } from 'vs/base/browser/dom';
|
|
||||||
import { IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
|
||||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
|
||||||
import * as themeColors from 'vs/workbench/common/theme';
|
|
||||||
import * as objects from 'vs/base/common/objects';
|
import * as objects from 'vs/base/common/objects';
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
import { Event, Emitter } from 'vs/base/common/event';
|
||||||
import { Action } from 'vs/base/common/actions';
|
import { Action } from 'vs/base/common/actions';
|
||||||
@@ -45,16 +39,11 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
|||||||
|
|
||||||
const dashboardRegistry = Registry.as<IDashboardRegistry>(DashboardExtensions.DashboardContributions);
|
const dashboardRegistry = Registry.as<IDashboardRegistry>(DashboardExtensions.DashboardContributions);
|
||||||
|
|
||||||
interface IConfigModifierCollection {
|
|
||||||
connectionManagementService: SingleConnectionManagementService;
|
|
||||||
contextKeyService: IContextKeyService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dashboard-page',
|
selector: 'dashboard-page',
|
||||||
templateUrl: decodeURI(require.toUrl('sql/parts/dashboard/common/dashboardPage.component.html'))
|
templateUrl: decodeURI(require.toUrl('sql/parts/dashboard/common/dashboardPage.component.html'))
|
||||||
})
|
})
|
||||||
export abstract class DashboardPage extends AngularDisposable {
|
export abstract class DashboardPage extends AngularDisposable implements IConfigModifierCollection {
|
||||||
|
|
||||||
protected tabs: Array<TabConfig> = [];
|
protected tabs: Array<TabConfig> = [];
|
||||||
|
|
||||||
@@ -144,22 +133,11 @@ export abstract class DashboardPage extends AngularDisposable {
|
|||||||
this._tabsDispose.forEach(i => i.dispose());
|
this._tabsDispose.forEach(i => i.dispose());
|
||||||
this._tabsDispose = [];
|
this._tabsDispose = [];
|
||||||
|
|
||||||
// Create home tab
|
|
||||||
let homeTab: TabConfig = {
|
|
||||||
id: 'homeTab',
|
|
||||||
publisher: undefined,
|
|
||||||
title: this.homeTabTitle,
|
|
||||||
container: { 'widgets-container': homeWidgets },
|
|
||||||
context: this.context,
|
|
||||||
originalConfig: this._originalConfig,
|
|
||||||
editable: true,
|
|
||||||
canClose: false,
|
|
||||||
actions: []
|
|
||||||
};
|
|
||||||
this.addNewTab(homeTab);
|
|
||||||
|
|
||||||
let allTabs = dashboardHelper.filterConfigs(dashboardRegistry.tabs, this);
|
let allTabs = dashboardHelper.filterConfigs(dashboardRegistry.tabs, this);
|
||||||
|
|
||||||
|
// Before separating tabs into pinned / shown, ensure that the home tab is always set up as expected
|
||||||
|
allTabs = this.setAndRemoveHomeTab(allTabs, homeWidgets);
|
||||||
|
|
||||||
// Load tab setting configs
|
// Load tab setting configs
|
||||||
this._tabSettingConfigs = this.dashboardService.getSettings<Array<TabSettingConfig>>([this.context, 'tabs'].join('.'));
|
this._tabSettingConfigs = this.dashboardService.getSettings<Array<TabSettingConfig>>([this.context, 'tabs'].join('.'));
|
||||||
|
|
||||||
@@ -206,6 +184,32 @@ export abstract class DashboardPage extends AngularDisposable {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private setAndRemoveHomeTab(allTabs: IDashboardTab[], homeWidgets: WidgetConfig[]): IDashboardTab[] {
|
||||||
|
let homeTabConfig: TabConfig = {
|
||||||
|
id: 'homeTab',
|
||||||
|
provider: Constants.anyProviderName,
|
||||||
|
publisher: undefined,
|
||||||
|
title: this.homeTabTitle,
|
||||||
|
container: { 'widgets-container': homeWidgets },
|
||||||
|
context: this.context,
|
||||||
|
originalConfig: this._originalConfig,
|
||||||
|
editable: true,
|
||||||
|
canClose: false,
|
||||||
|
actions: []
|
||||||
|
};
|
||||||
|
|
||||||
|
let homeTabIndex = allTabs.findIndex((tab) => tab.isHomeTab === true);
|
||||||
|
if (homeTabIndex !== undefined && homeTabIndex > -1) {
|
||||||
|
// Have a tab: get its information and copy over to the home tab definition
|
||||||
|
let homeTab = allTabs.splice(homeTabIndex, 1)[0];
|
||||||
|
let tabConfig = this.initTabComponents(homeTab);
|
||||||
|
homeTabConfig.id = tabConfig.id;
|
||||||
|
homeTabConfig.container = tabConfig.container;
|
||||||
|
}
|
||||||
|
this.addNewTab(homeTabConfig);
|
||||||
|
return allTabs;
|
||||||
|
}
|
||||||
|
|
||||||
private rewriteConfig(): void {
|
private rewriteConfig(): void {
|
||||||
let writeableConfig = objects.deepClone(this._tabSettingConfigs);
|
let writeableConfig = objects.deepClone(this._tabSettingConfigs);
|
||||||
|
|
||||||
@@ -215,35 +219,12 @@ export abstract class DashboardPage extends AngularDisposable {
|
|||||||
|
|
||||||
private loadNewTabs(dashboardTabs: IDashboardTab[], openLastTab: boolean = false) {
|
private loadNewTabs(dashboardTabs: IDashboardTab[], openLastTab: boolean = false) {
|
||||||
if (dashboardTabs && dashboardTabs.length > 0) {
|
if (dashboardTabs && dashboardTabs.length > 0) {
|
||||||
let selectedTabs = dashboardTabs.map(v => {
|
let selectedTabs = dashboardTabs.map(v => this.initTabComponents(v)).map(v => {
|
||||||
let containerResult = dashboardHelper.getDashboardContainer(v.container);
|
|
||||||
if (!containerResult.result) {
|
|
||||||
return { id: v.id, title: v.title, container: { 'error-container': undefined }, alwaysShow: v.alwaysShow };
|
|
||||||
}
|
|
||||||
|
|
||||||
let key = Object.keys(containerResult.container)[0];
|
|
||||||
if (key === WIDGETS_CONTAINER || key === GRID_CONTAINER) {
|
|
||||||
let configs = <WidgetConfig[]>Object.values(containerResult.container)[0];
|
|
||||||
this._configModifiers.forEach(cb => {
|
|
||||||
configs = cb.apply(this, [configs, this.dashboardService, this.context]);
|
|
||||||
});
|
|
||||||
this._gridModifiers.forEach(cb => {
|
|
||||||
configs = cb.apply(this, [configs]);
|
|
||||||
});
|
|
||||||
if (key === WIDGETS_CONTAINER) {
|
|
||||||
return { id: v.id, title: v.title, container: { 'widgets-container': configs }, alwaysShow: v.alwaysShow };
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return { id: v.id, title: v.title, container: { 'grid-container': configs }, alwaysShow: v.alwaysShow };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { id: v.id, title: v.title, container: containerResult.container, alwaysShow: v.alwaysShow };
|
|
||||||
}).map(v => {
|
|
||||||
let actions = [];
|
let actions = [];
|
||||||
let tabConfig = this._tabSettingConfigs.find(i => i.tabId === v.id);
|
let tabSettingConfig = this._tabSettingConfigs.find(i => i.tabId === v.id);
|
||||||
let isPinned = false;
|
let isPinned = false;
|
||||||
if (tabConfig) {
|
if (tabSettingConfig) {
|
||||||
isPinned = tabConfig.isPinned;
|
isPinned = tabSettingConfig.isPinned;
|
||||||
} else if (v.alwaysShow) {
|
} else if (v.alwaysShow) {
|
||||||
isPinned = true;
|
isPinned = true;
|
||||||
}
|
}
|
||||||
@@ -268,6 +249,30 @@ export abstract class DashboardPage extends AngularDisposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private initTabComponents(value: IDashboardTab): { id: string; title: string; container: object; alwaysShow: boolean; } {
|
||||||
|
let containerResult = dashboardHelper.getDashboardContainer(value.container);
|
||||||
|
if (!containerResult.result) {
|
||||||
|
return { id: value.id, title: value.title, container: { 'error-container': undefined }, alwaysShow: value.alwaysShow };
|
||||||
|
}
|
||||||
|
let key = Object.keys(containerResult.container)[0];
|
||||||
|
if (key === WIDGETS_CONTAINER || key === GRID_CONTAINER) {
|
||||||
|
let configs = <WidgetConfig[]>Object.values(containerResult.container)[0];
|
||||||
|
this._configModifiers.forEach(cb => {
|
||||||
|
configs = cb.apply(this, [configs, this, this.context]);
|
||||||
|
});
|
||||||
|
this._gridModifiers.forEach(cb => {
|
||||||
|
configs = cb.apply(this, [configs]);
|
||||||
|
});
|
||||||
|
if (key === WIDGETS_CONTAINER) {
|
||||||
|
return { id: value.id, title: value.title, container: { 'widgets-container': configs }, alwaysShow: value.alwaysShow };
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return { id: value.id, title: value.title, container: { 'grid-container': configs }, alwaysShow: value.alwaysShow };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return { id: value.id, title: value.title, container: containerResult.container, alwaysShow: value.alwaysShow };
|
||||||
|
}
|
||||||
|
|
||||||
private getContentType(tab: TabConfig): string {
|
private getContentType(tab: TabConfig): string {
|
||||||
return tab.container ? Object.keys(tab.container)[0] : '';
|
return tab.container ? Object.keys(tab.container)[0] : '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,11 @@
|
|||||||
import 'vs/css!./dashboardPanel';
|
import 'vs/css!./dashboardPanel';
|
||||||
|
|
||||||
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||||
import { TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_ACTIVE_BORDER, TAB_INACTIVE_BACKGROUND, TAB_INACTIVE_FOREGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND, TAB_BORDER } from 'vs/workbench/common/theme';
|
import {
|
||||||
import { activeContrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry';
|
TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_ACTIVE_BORDER, TAB_INACTIVE_BACKGROUND,
|
||||||
|
TAB_INACTIVE_FOREGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND, TAB_BORDER, EDITOR_GROUP_BORDER
|
||||||
|
} from 'vs/workbench/common/theme';
|
||||||
|
import { activeContrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||||
|
|
||||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||||
|
|
||||||
@@ -98,4 +101,14 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
|||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const divider = theme.getColor(EDITOR_GROUP_BORDER);
|
||||||
|
if (divider) {
|
||||||
|
collector.addRule(`
|
||||||
|
panel.dashboard-panel > .tabbedPanel > .title .tabList .tab-header {
|
||||||
|
border-right-width: 1px;
|
||||||
|
border-right-style: solid;
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
@@ -7,6 +7,7 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
|||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
import * as types from 'vs/base/common/types';
|
import * as types from 'vs/base/common/types';
|
||||||
|
|
||||||
|
import * as Constants from 'sql/parts/connection/common/constants';
|
||||||
import { registerTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
import { registerTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
||||||
import { generateContainerTypeSchemaProperties } from 'sql/platform/dashboard/common/dashboardContainerRegistry';
|
import { generateContainerTypeSchemaProperties } from 'sql/platform/dashboard/common/dashboardContainerRegistry';
|
||||||
import { NAV_SECTION, validateNavSectionContributionAndRegisterIcon } from 'sql/parts/dashboard/containers/dashboardNavSection.contribution';
|
import { NAV_SECTION, validateNavSectionContributionAndRegisterIcon } from 'sql/parts/dashboard/containers/dashboardNavSection.contribution';
|
||||||
@@ -17,9 +18,11 @@ export interface IDashboardTabContrib {
|
|||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
container: object;
|
container: object;
|
||||||
|
provider: string | string[];
|
||||||
when?: string;
|
when?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
alwaysShow?: boolean;
|
alwaysShow?: boolean;
|
||||||
|
isHomeTab?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tabSchema: IJSONSchema = {
|
const tabSchema: IJSONSchema = {
|
||||||
@@ -41,6 +44,11 @@ const tabSchema: IJSONSchema = {
|
|||||||
description: localize('sqlops.extension.contributes.tab.when', 'Condition which must be true to show this item'),
|
description: localize('sqlops.extension.contributes.tab.when', 'Condition which must be true to show this item'),
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
|
provider: {
|
||||||
|
description: localize('sqlops.extension.contributes.tab.provider', 'Defines the connection types this tab is compatible with. Defaults to "MSSQL" if not set'),
|
||||||
|
type: ['string', 'array']
|
||||||
|
|
||||||
|
},
|
||||||
container: {
|
container: {
|
||||||
description: localize('sqlops.extension.contributes.dashboard.tab.container', "The container that will be displayed in this tab."),
|
description: localize('sqlops.extension.contributes.dashboard.tab.container', "The container that will be displayed in this tab."),
|
||||||
type: 'object',
|
type: 'object',
|
||||||
@@ -49,6 +57,10 @@ const tabSchema: IJSONSchema = {
|
|||||||
alwaysShow: {
|
alwaysShow: {
|
||||||
description: localize('sqlops.extension.contributes.dashboard.tab.alwaysShow', "Whether or not this tab should always be shown or only when the user adds it."),
|
description: localize('sqlops.extension.contributes.dashboard.tab.alwaysShow', "Whether or not this tab should always be shown or only when the user adds it."),
|
||||||
type: 'boolean'
|
type: 'boolean'
|
||||||
|
},
|
||||||
|
isHomeTab: {
|
||||||
|
description: localize('sqlops.extension.contributes.dashboard.tab.isHomeTab', "Whether or not this tab should be used as the Home tab for a connection type."),
|
||||||
|
type: 'boolean'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -67,7 +79,7 @@ const tabContributionSchema: IJSONSchema = {
|
|||||||
ExtensionsRegistry.registerExtensionPoint<IDashboardTabContrib | IDashboardTabContrib[]>('dashboard.tabs', [], tabContributionSchema).setHandler(extensions => {
|
ExtensionsRegistry.registerExtensionPoint<IDashboardTabContrib | IDashboardTabContrib[]>('dashboard.tabs', [], tabContributionSchema).setHandler(extensions => {
|
||||||
|
|
||||||
function handleCommand(tab: IDashboardTabContrib, extension: IExtensionPointUser<any>) {
|
function handleCommand(tab: IDashboardTabContrib, extension: IExtensionPointUser<any>) {
|
||||||
let { description, container, title, when, id, alwaysShow } = tab;
|
let { description, container, provider, title, when, id, alwaysShow, isHomeTab } = tab;
|
||||||
|
|
||||||
// If always show is not specified, set it to true by default.
|
// If always show is not specified, set it to true by default.
|
||||||
if (!types.isBoolean(alwaysShow)) {
|
if (!types.isBoolean(alwaysShow)) {
|
||||||
@@ -88,6 +100,13 @@ ExtensionsRegistry.registerExtensionPoint<IDashboardTabContrib | IDashboardTabCo
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!provider) {
|
||||||
|
// Use a default. Consider warning extension developers about this in the future if in development mode
|
||||||
|
provider = Constants.mssqlProviderName;
|
||||||
|
// Cannot be a home tab if it did not specify a provider
|
||||||
|
isHomeTab = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (Object.keys(container).length !== 1) {
|
if (Object.keys(container).length !== 1) {
|
||||||
extension.collector.error(localize('dashboardTab.contribution.moreThanOneDashboardContainersError', 'Exactly 1 dashboard container must be defined per space'));
|
extension.collector.error(localize('dashboardTab.contribution.moreThanOneDashboardContainersError', 'Exactly 1 dashboard container must be defined per space'));
|
||||||
return;
|
return;
|
||||||
@@ -110,7 +129,7 @@ ExtensionsRegistry.registerExtensionPoint<IDashboardTabContrib | IDashboardTabCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
registerTab({ description, title, container, when, id, alwaysShow, publisher });
|
registerTab({ description, title, container, provider, when, id, alwaysShow, publisher, isHomeTab });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ import { OnDestroy } from '@angular/core';
|
|||||||
|
|
||||||
import { Event } from 'vs/base/common/event';
|
import { Event } from 'vs/base/common/event';
|
||||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||||
|
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||||
|
|
||||||
import { AngularDisposable } from 'sql/base/common/lifecycle';
|
import { AngularDisposable } from 'sql/base/common/lifecycle';
|
||||||
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||||
|
import { SingleConnectionManagementService } from 'sql/services/common/commonServiceInterface.service';
|
||||||
|
|
||||||
export enum Conditional {
|
export enum Conditional {
|
||||||
'equals',
|
'equals',
|
||||||
@@ -50,3 +52,8 @@ export abstract class DashboardTab extends TabChild implements OnDestroy {
|
|||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IConfigModifierCollection {
|
||||||
|
connectionManagementService: SingleConnectionManagementService;
|
||||||
|
contextKeyService: IContextKeyService;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,28 +5,27 @@
|
|||||||
|
|
||||||
import 'vs/css!./dashboardNavSection';
|
import 'vs/css!./dashboardNavSection';
|
||||||
|
|
||||||
import { Component, Inject, Input, forwardRef, ViewChild, ElementRef, ViewChildren, QueryList, OnDestroy, ChangeDetectorRef, EventEmitter, OnChanges, AfterContentInit } from '@angular/core';
|
import { Component, Inject, Input, forwardRef, ViewChild, ElementRef, ViewChildren, QueryList, OnDestroy, ChangeDetectorRef, OnChanges, AfterContentInit } from '@angular/core';
|
||||||
|
|
||||||
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
|
import { CommonServiceInterface, SingleConnectionManagementService } from 'sql/services/common/commonServiceInterface.service';
|
||||||
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
|
|
||||||
import { WidgetConfig, TabConfig, NavSectionConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
import { WidgetConfig, TabConfig, NavSectionConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
||||||
import { PanelComponent, IPanelOptions, NavigationBarLayout } from 'sql/base/browser/ui/panel/panel.component';
|
import { PanelComponent, IPanelOptions, NavigationBarLayout } from 'sql/base/browser/ui/panel/panel.component';
|
||||||
import { TabComponent, TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||||
import { DashboardTab } from 'sql/parts/dashboard/common/interfaces';
|
import { DashboardTab, IConfigModifierCollection } from 'sql/parts/dashboard/common/interfaces';
|
||||||
import { WIDGETS_CONTAINER } from 'sql/parts/dashboard/containers/dashboardWidgetContainer.contribution';
|
import { WIDGETS_CONTAINER } from 'sql/parts/dashboard/containers/dashboardWidgetContainer.contribution';
|
||||||
import { GRID_CONTAINER } from 'sql/parts/dashboard/containers/dashboardGridContainer.contribution';
|
import { GRID_CONTAINER } from 'sql/parts/dashboard/containers/dashboardGridContainer.contribution';
|
||||||
import * as dashboardHelper from 'sql/parts/dashboard/common/dashboardHelper';
|
import * as dashboardHelper from 'sql/parts/dashboard/common/dashboardHelper';
|
||||||
|
|
||||||
import { Registry } from 'vs/platform/registry/common/platform';
|
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
import { Event, Emitter } from 'vs/base/common/event';
|
||||||
import * as nls from 'vs/nls';
|
import * as nls from 'vs/nls';
|
||||||
|
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dashboard-nav-section',
|
selector: 'dashboard-nav-section',
|
||||||
providers: [{ provide: TabChild, useExisting: forwardRef(() => DashboardNavSection) }],
|
providers: [{ provide: TabChild, useExisting: forwardRef(() => DashboardNavSection) }],
|
||||||
templateUrl: decodeURI(require.toUrl('sql/parts/dashboard/containers/dashboardNavSection.component.html'))
|
templateUrl: decodeURI(require.toUrl('sql/parts/dashboard/containers/dashboardNavSection.component.html'))
|
||||||
})
|
})
|
||||||
export class DashboardNavSection extends DashboardTab implements OnDestroy, OnChanges, AfterContentInit {
|
export class DashboardNavSection extends DashboardTab implements OnDestroy, OnChanges, AfterContentInit, IConfigModifierCollection {
|
||||||
@Input() private tab: TabConfig;
|
@Input() private tab: TabConfig;
|
||||||
protected tabs: Array<TabConfig> = [];
|
protected tabs: Array<TabConfig> = [];
|
||||||
private _onResize = new Emitter<void>();
|
private _onResize = new Emitter<void>();
|
||||||
@@ -38,7 +37,7 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
|||||||
};
|
};
|
||||||
|
|
||||||
// a set of config modifiers
|
// a set of config modifiers
|
||||||
private readonly _configModifiers: Array<(item: Array<WidgetConfig>, dashboardServer: DashboardServiceInterface, context: string) => Array<WidgetConfig>> = [
|
private readonly _configModifiers: Array<(item: Array<WidgetConfig>, collection: IConfigModifierCollection, context: string) => Array<WidgetConfig>> = [
|
||||||
dashboardHelper.removeEmpty,
|
dashboardHelper.removeEmpty,
|
||||||
dashboardHelper.initExtensionConfigs,
|
dashboardHelper.initExtensionConfigs,
|
||||||
dashboardHelper.addProvider,
|
dashboardHelper.addProvider,
|
||||||
@@ -103,7 +102,7 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
|||||||
if (key === WIDGETS_CONTAINER || key === GRID_CONTAINER) {
|
if (key === WIDGETS_CONTAINER || key === GRID_CONTAINER) {
|
||||||
let configs = <WidgetConfig[]>Object.values(containerResult.container)[0];
|
let configs = <WidgetConfig[]>Object.values(containerResult.container)[0];
|
||||||
this._configModifiers.forEach(cb => {
|
this._configModifiers.forEach(cb => {
|
||||||
configs = cb.apply(this, [configs, this.dashboardService, this.tab.context]);
|
configs = cb.apply(this, [configs, this, this.tab.context]);
|
||||||
});
|
});
|
||||||
this._gridModifiers.forEach(cb => {
|
this._gridModifiers.forEach(cb => {
|
||||||
configs = cb.apply(this, [configs]);
|
configs = cb.apply(this, [configs]);
|
||||||
@@ -169,4 +168,12 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get connectionManagementService(): SingleConnectionManagementService {
|
||||||
|
return this.dashboardService.connectionManagementService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get contextKeyService(): IContextKeyService {
|
||||||
|
return this.dashboardService.scopedContextKeyService;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,7 @@ import 'vs/css!./controlHostContent';
|
|||||||
import { Component, forwardRef, Input, OnInit, Inject, ChangeDetectorRef, ElementRef, ViewChild } from '@angular/core';
|
import { Component, forwardRef, Input, OnInit, Inject, ChangeDetectorRef, ElementRef, ViewChild } from '@angular/core';
|
||||||
|
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
import { Event, Emitter } from 'vs/base/common/event';
|
||||||
import { Parts } from 'vs/workbench/services/part/common/partService';
|
|
||||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||||
|
|
||||||
import { TabConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
|
||||||
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
|
|
||||||
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
|
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
|
|||||||
@@ -3,7 +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.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { Inject, NgModule, forwardRef, ApplicationRef, ComponentFactoryResolver, NgModuleRef, NgModuleFactory } from '@angular/core';
|
import { Inject, NgModule, forwardRef, ApplicationRef, ComponentFactoryResolver } from '@angular/core';
|
||||||
import { CommonModule, APP_BASE_HREF } from '@angular/common';
|
import { CommonModule, APP_BASE_HREF } from '@angular/common';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { RouterModule, Routes, UrlSerializer, Router, NavigationEnd } from '@angular/router';
|
import { RouterModule, Routes, UrlSerializer, Router, NavigationEnd } from '@angular/router';
|
||||||
@@ -14,7 +14,7 @@ import { ChartsModule } from 'ng2-charts/ng2-charts';
|
|||||||
import CustomUrlSerializer from 'sql/common/urlSerializer';
|
import CustomUrlSerializer from 'sql/common/urlSerializer';
|
||||||
import { Extensions, IInsightRegistry } from 'sql/platform/dashboard/common/insightRegistry';
|
import { Extensions, IInsightRegistry } from 'sql/platform/dashboard/common/insightRegistry';
|
||||||
import { Extensions as ComponentExtensions, IComponentRegistry } from 'sql/platform/dashboard/common/modelComponentRegistry';
|
import { Extensions as ComponentExtensions, IComponentRegistry } from 'sql/platform/dashboard/common/modelComponentRegistry';
|
||||||
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
import { IBootstrapParams, ISelector, providerIterator } from 'sql/services/bootstrap/bootstrapService';
|
||||||
|
|
||||||
import { Registry } from 'vs/platform/registry/common/platform';
|
import { Registry } from 'vs/platform/registry/common/platform';
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ import { CommonServiceInterface } from 'sql/services/common/commonServiceInterfa
|
|||||||
import { ComponentHostDirective } from 'sql/parts/dashboard/common/componentHost.directive';
|
import { ComponentHostDirective } from 'sql/parts/dashboard/common/componentHost.directive';
|
||||||
|
|
||||||
/* Base Components */
|
/* Base Components */
|
||||||
import { DashboardComponent, DASHBOARD_SELECTOR } from 'sql/parts/dashboard/dashboard.component';
|
import { DashboardComponent } from 'sql/parts/dashboard/dashboard.component';
|
||||||
import { DashboardWidgetWrapper } from 'sql/parts/dashboard/contents/dashboardWidgetWrapper.component';
|
import { DashboardWidgetWrapper } from 'sql/parts/dashboard/contents/dashboardWidgetWrapper.component';
|
||||||
import { DashboardWidgetContainer } from 'sql/parts/dashboard/containers/dashboardWidgetContainer.component';
|
import { DashboardWidgetContainer } from 'sql/parts/dashboard/containers/dashboardWidgetContainer.component';
|
||||||
import { DashboardGridContainer } from 'sql/parts/dashboard/containers/dashboardGridContainer.component';
|
import { DashboardGridContainer } from 'sql/parts/dashboard/containers/dashboardGridContainer.component';
|
||||||
@@ -51,12 +51,19 @@ import { ControlHostContent } from 'sql/parts/dashboard/contents/controlHostCont
|
|||||||
import { DashboardControlHostContainer } from 'sql/parts/dashboard/containers/dashboardControlHostContainer.component';
|
import { DashboardControlHostContainer } from 'sql/parts/dashboard/containers/dashboardControlHostContainer.component';
|
||||||
import { JobsViewComponent } from 'sql/parts/jobManagement/views/jobsView.component';
|
import { JobsViewComponent } from 'sql/parts/jobManagement/views/jobsView.component';
|
||||||
import { AgentViewComponent } from 'sql/parts/jobManagement/agent/agentView.component';
|
import { AgentViewComponent } from 'sql/parts/jobManagement/agent/agentView.component';
|
||||||
|
import { AlertsViewComponent } from 'sql/parts/jobManagement/views/alertsView.component';
|
||||||
import { JobHistoryComponent } from 'sql/parts/jobManagement/views/jobHistory.component';
|
import { JobHistoryComponent } from 'sql/parts/jobManagement/views/jobHistory.component';
|
||||||
|
import { OperatorsViewComponent } from 'sql/parts/jobManagement/views/operatorsView.component';
|
||||||
|
import { ProxiesViewComponent } from 'sql/parts/jobManagement/views/proxiesView.component';
|
||||||
|
import { Checkbox } from 'sql/base/browser/ui/checkbox/checkbox.component';
|
||||||
|
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox.component';
|
||||||
|
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox.component';
|
||||||
|
|
||||||
let baseComponents = [DashboardHomeContainer, DashboardComponent, DashboardWidgetWrapper, DashboardWebviewContainer,
|
let baseComponents = [DashboardHomeContainer, DashboardComponent, DashboardWidgetWrapper, DashboardWebviewContainer,
|
||||||
DashboardWidgetContainer, DashboardGridContainer, DashboardErrorContainer, DashboardNavSection, ModelViewContent, WebviewContent, WidgetContent,
|
DashboardWidgetContainer, DashboardGridContainer, DashboardErrorContainer, DashboardNavSection, ModelViewContent, WebviewContent, WidgetContent,
|
||||||
ComponentHostDirective, BreadcrumbComponent, ControlHostContent, DashboardControlHostContainer,
|
ComponentHostDirective, BreadcrumbComponent, ControlHostContent, DashboardControlHostContainer,
|
||||||
JobsViewComponent, AgentViewComponent, JobHistoryComponent, JobStepsViewComponent, DashboardModelViewContainer, ModelComponentWrapper];
|
JobsViewComponent, AgentViewComponent, JobHistoryComponent, JobStepsViewComponent, AlertsViewComponent, ProxiesViewComponent, OperatorsViewComponent,
|
||||||
|
DashboardModelViewContainer, ModelComponentWrapper, Checkbox, SelectBox, InputBox,];
|
||||||
|
|
||||||
/* Panel */
|
/* Panel */
|
||||||
import { PanelModule } from 'sql/base/browser/ui/panel/panel.module';
|
import { PanelModule } from 'sql/base/browser/ui/panel/panel.module';
|
||||||
@@ -75,7 +82,8 @@ import { ExplorerWidget } from 'sql/parts/dashboard/widgets/explorer/explorerWid
|
|||||||
import { TasksWidget } from 'sql/parts/dashboard/widgets/tasks/tasksWidget.component';
|
import { TasksWidget } from 'sql/parts/dashboard/widgets/tasks/tasksWidget.component';
|
||||||
import { InsightsWidget } from 'sql/parts/dashboard/widgets/insights/insightsWidget.component';
|
import { InsightsWidget } from 'sql/parts/dashboard/widgets/insights/insightsWidget.component';
|
||||||
import { WebviewWidget } from 'sql/parts/dashboard/widgets/webview/webviewWidget.component';
|
import { WebviewWidget } from 'sql/parts/dashboard/widgets/webview/webviewWidget.component';
|
||||||
import { JobStepsViewComponent } from '../jobManagement/views/jobStepsView.component';
|
import { JobStepsViewComponent } from 'sql/parts/jobManagement/views/jobStepsView.component';
|
||||||
|
import { IInstantiationService, _util } from 'vs/platform/instantiation/common/instantiation';
|
||||||
|
|
||||||
let widgetComponents = [
|
let widgetComponents = [
|
||||||
PropertiesWidgetComponent,
|
PropertiesWidgetComponent,
|
||||||
@@ -104,7 +112,7 @@ const appRoutes: Routes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Connection Dashboard main angular module
|
// Connection Dashboard main angular module
|
||||||
export const DashboardModule = (params, selector: string): any => {
|
export const DashboardModule = (params, selector: string, instantiationService: IInstantiationService): any => {
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
...baseComponents,
|
...baseComponents,
|
||||||
@@ -135,31 +143,31 @@ export const DashboardModule = (params, selector: string): any => {
|
|||||||
{ provide: IBreadcrumbService, useClass: BreadcrumbService },
|
{ provide: IBreadcrumbService, useClass: BreadcrumbService },
|
||||||
{ provide: CommonServiceInterface, useClass: DashboardServiceInterface },
|
{ provide: CommonServiceInterface, useClass: DashboardServiceInterface },
|
||||||
{ provide: UrlSerializer, useClass: CustomUrlSerializer },
|
{ provide: UrlSerializer, useClass: CustomUrlSerializer },
|
||||||
{ provide: IBootstrapParams, useValue: params }
|
{ provide: IBootstrapParams, useValue: params },
|
||||||
|
{ provide: ISelector, useValue: selector },
|
||||||
|
...providerIterator(instantiationService)
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
class ModuleClass {
|
class ModuleClass {
|
||||||
private _bootstrap: DashboardServiceInterface;
|
private navigations = 0;
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(forwardRef(() => ComponentFactoryResolver)) private _resolver: ComponentFactoryResolver,
|
@Inject(forwardRef(() => ComponentFactoryResolver)) private _resolver: ComponentFactoryResolver,
|
||||||
@Inject(forwardRef(() => CommonServiceInterface)) bootstrap: CommonServiceInterface,
|
|
||||||
@Inject(forwardRef(() => Router)) private _router: Router,
|
@Inject(forwardRef(() => Router)) private _router: Router,
|
||||||
@Inject(ITelemetryService) private telemetryService: ITelemetryService
|
@Inject(ITelemetryService) private telemetryService: ITelemetryService,
|
||||||
|
@Inject(ISelector) private selector: string
|
||||||
) {
|
) {
|
||||||
this._bootstrap = bootstrap as DashboardServiceInterface;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngDoBootstrap(appRef: ApplicationRef) {
|
ngDoBootstrap(appRef: ApplicationRef) {
|
||||||
const factory = this._resolver.resolveComponentFactory(DashboardComponent);
|
const factory = this._resolver.resolveComponentFactory(DashboardComponent);
|
||||||
this._bootstrap.selector = selector;
|
(<any>factory).factory.selector = this.selector;
|
||||||
(<any>factory).factory.selector = selector;
|
|
||||||
appRef.bootstrap(factory);
|
appRef.bootstrap(factory);
|
||||||
|
|
||||||
this._router.events.subscribe(e => {
|
this._router.events.subscribe(e => {
|
||||||
if (e instanceof NavigationEnd) {
|
if (e instanceof NavigationEnd) {
|
||||||
this._bootstrap.handlePageNavigation();
|
this.navigations++;
|
||||||
TelemetryUtils.addTelemetry(this.telemetryService, TelemetryKeys.DashboardNavigated, {
|
TelemetryUtils.addTelemetry(this.telemetryService, TelemetryKeys.DashboardNavigated, {
|
||||||
numberOfNavigations: this._bootstrap.getNumberOfPageNavigations(),
|
numberOfNavigations: this.navigations,
|
||||||
routeUrl: e.url
|
routeUrl: e.url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export class DatabaseDashboardPage extends DashboardPage implements OnInit {
|
|||||||
background_color: colors.editorBackground,
|
background_color: colors.editorBackground,
|
||||||
border: 'none',
|
border: 'none',
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
fontWeight: '200',
|
|
||||||
padding: '5px 0 0 0',
|
padding: '5px 0 0 0',
|
||||||
provider: undefined,
|
provider: undefined,
|
||||||
edition: undefined
|
edition: undefined
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export class ServerDashboardPage extends DashboardPage implements OnInit {
|
|||||||
background_color: colors.editorBackground,
|
background_color: colors.editorBackground,
|
||||||
border: 'none',
|
border: 'none',
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
fontWeight: '200',
|
|
||||||
padding: '5px 0 0 0',
|
padding: '5px 0 0 0',
|
||||||
provider: undefined,
|
provider: undefined,
|
||||||
edition: undefined
|
edition: undefined
|
||||||
|
|||||||
@@ -96,16 +96,12 @@ let defaultVal = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
widget: {
|
widget: {
|
||||||
'backup-history-server-insight': {
|
'backup-history-server-insight': null
|
||||||
cacheId: '0c7cba8b-c87a-4bcc-ae54-2f40a5503a90'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
widget: {
|
widget: {
|
||||||
'all-database-size-server-insight': {
|
'all-database-size-server-insight': null
|
||||||
cacheId: '1d7cba8b-c87a-4bcc-ae54-2f40a5503a90'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -121,8 +117,7 @@ export const serverDashboardTabsSchema: IJSONSchema = {
|
|||||||
type: ['array'],
|
type: ['array'],
|
||||||
description: nls.localize('dashboardServerTabs', 'Customizes the Server dashboard tabs'),
|
description: nls.localize('dashboardServerTabs', 'Customizes the Server dashboard tabs'),
|
||||||
items: generateDashboardTabSchema('server'),
|
items: generateDashboardTabSchema('server'),
|
||||||
default: [
|
default: []
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SERVER_DASHBOARD_SETTING = 'dashboard.server.widgets';
|
export const SERVER_DASHBOARD_SETTING = 'dashboard.server.widgets';
|
||||||
|
|||||||
@@ -4,50 +4,29 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/* Node Modules */
|
/* Node Modules */
|
||||||
import { Injectable, Inject, forwardRef, OnDestroy } from '@angular/core';
|
import { Injectable, Inject, forwardRef } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
|
|
||||||
/* SQL imports */
|
/* SQL imports */
|
||||||
import { IDashboardComponentParams } from 'sql/services/bootstrap/bootstrapParams';
|
import { IDashboardComponentParams } from 'sql/services/bootstrap/bootstrapParams';
|
||||||
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
||||||
import { IMetadataService } from 'sql/services/metadata/metadataService';
|
import { IMetadataService } from 'sql/services/metadata/metadataService';
|
||||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||||
import { ConnectionManagementInfo } from 'sql/parts/connection/common/connectionManagementInfo';
|
|
||||||
import { IAdminService } from 'sql/parts/admin/common/adminService';
|
import { IAdminService } from 'sql/parts/admin/common/adminService';
|
||||||
import { IQueryManagementService } from 'sql/parts/query/common/queryManagement';
|
import { IQueryManagementService } from 'sql/parts/query/common/queryManagement';
|
||||||
import { toDisposableSubscription } from 'sql/parts/common/rxjsUtils';
|
import { toDisposableSubscription } from 'sql/parts/common/rxjsUtils';
|
||||||
import { IInsightsDialogService } from 'sql/parts/insights/common/interfaces';
|
|
||||||
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
|
||||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
|
||||||
import { AngularEventType, IAngularEvent, IAngularEventingService } from 'sql/services/angularEventing/angularEventingService';
|
import { AngularEventType, IAngularEvent, IAngularEventingService } from 'sql/services/angularEventing/angularEventingService';
|
||||||
import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
||||||
import { TabSettingConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
import { TabSettingConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
||||||
import { IDashboardViewService } from 'sql/services/dashboard/common/dashboardViewService';
|
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
|
||||||
import { AngularDisposable } from 'sql/base/common/lifecycle';
|
|
||||||
import { ConnectionContextkey } from 'sql/parts/connection/common/connectionContextKey';
|
|
||||||
import { SingleConnectionMetadataService, SingleConnectionManagementService, SingleAdminService, SingleQueryManagementService, CommonServiceInterface }
|
|
||||||
from 'sql/services/common/commonServiceInterface.service';
|
|
||||||
|
|
||||||
import { ProviderMetadata, DatabaseInfo, SimpleExecuteResult } from 'sqlops';
|
|
||||||
|
|
||||||
/* VS imports */
|
/* VS imports */
|
||||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
|
||||||
import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
|
||||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
|
||||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||||
import { ConfigurationEditingService, IConfigurationValue } from 'vs/workbench/services/configuration/node/configurationEditingService';
|
|
||||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
|
||||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
import { Event, Emitter } from 'vs/base/common/event';
|
||||||
import Severity from 'vs/base/common/severity';
|
import Severity from 'vs/base/common/severity';
|
||||||
import * as nls from 'vs/nls';
|
import * as nls from 'vs/nls';
|
||||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
|
||||||
import { deepClone } from 'vs/base/common/objects';
|
import { deepClone } from 'vs/base/common/objects';
|
||||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
import { RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
|
||||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
|
||||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||||
|
|
||||||
const DASHBOARD_SETTINGS = 'dashboard';
|
const DASHBOARD_SETTINGS = 'dashboard';
|
||||||
@@ -85,45 +64,22 @@ export class DashboardServiceInterface extends CommonServiceInterface {
|
|||||||
private _numberOfPageNavigations = 0;
|
private _numberOfPageNavigations = 0;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(forwardRef(() => Router)) private _router: Router,
|
|
||||||
@Inject(INotificationService) private _notificationService: INotificationService,
|
|
||||||
@Inject(IMetadataService) metadataService: IMetadataService,
|
@Inject(IMetadataService) metadataService: IMetadataService,
|
||||||
@Inject(IConnectionManagementService) connectionManagementService: IConnectionManagementService,
|
@Inject(IConnectionManagementService) connectionManagementService: IConnectionManagementService,
|
||||||
@Inject(IAdminService) adminService: IAdminService,
|
@Inject(IAdminService) adminService: IAdminService,
|
||||||
@Inject(IQueryManagementService) queryManagementService: IQueryManagementService,
|
@Inject(IQueryManagementService) queryManagementService: IQueryManagementService,
|
||||||
|
@Inject(IBootstrapParams) params: IDashboardComponentParams,
|
||||||
|
@Inject(forwardRef(() => Router)) private _router: Router,
|
||||||
|
@Inject(INotificationService) private _notificationService: INotificationService,
|
||||||
@Inject(IAngularEventingService) private angularEventingService: IAngularEventingService,
|
@Inject(IAngularEventingService) private angularEventingService: IAngularEventingService,
|
||||||
@Inject(IConfigurationService) private _configService: IConfigurationService,
|
@Inject(IConfigurationService) private _configService: IConfigurationService
|
||||||
@Inject(IBootstrapParams) _params: IDashboardComponentParams
|
|
||||||
) {
|
) {
|
||||||
super(_params, metadataService, connectionManagementService, adminService, queryManagementService);
|
super(params, metadataService, connectionManagementService, adminService, queryManagementService);
|
||||||
}
|
// during testing there may not be params
|
||||||
|
if (this._params) {
|
||||||
private get params(): IDashboardComponentParams {
|
this.dashboardContextKey = this._dashboardContextKey.bindTo(this.scopedContextKeyService);
|
||||||
return this._params;
|
this._register(toDisposableSubscription(this.angularEventingService.onAngularEvent(this._uri, (event) => this.handleDashboardEvent(event))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the selector for this dashboard instance, should only be set once
|
|
||||||
*/
|
|
||||||
public set selector(selector: string) {
|
|
||||||
this._uniqueSelector = selector;
|
|
||||||
this._getbootstrapParams();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected _getbootstrapParams(): void {
|
|
||||||
this.scopedContextKeyService = this.params.scopedContextService;
|
|
||||||
this._connectionContextKey = this.params.connectionContextKey;
|
|
||||||
this.dashboardContextKey = this._dashboardContextKey.bindTo(this.scopedContextKeyService);
|
|
||||||
this.uri = this.params.ownerUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the uri for this dashboard instance, should only be set once
|
|
||||||
* Inits all the services that depend on knowing a uri
|
|
||||||
*/
|
|
||||||
protected set uri(uri: string) {
|
|
||||||
super.setUri(uri);
|
|
||||||
this._register(toDisposableSubscription(this.angularEventingService.onAngularEvent(this._uri, (event) => this.handleDashboardEvent(event))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import { IContextViewService, IContextMenuService } from 'vs/platform/contextvie
|
|||||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||||
|
import * as types from 'vs/base/common/types';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'explorer-widget',
|
selector: 'explorer-widget',
|
||||||
@@ -120,6 +121,8 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
|||||||
let currentProfile = this._bootstrap.connectionManagementService.connectionInfo.connectionProfile;
|
let currentProfile = this._bootstrap.connectionManagementService.connectionInfo.connectionProfile;
|
||||||
this._register(toDisposableSubscription(this._bootstrap.metadataService.databaseNames.subscribe(
|
this._register(toDisposableSubscription(this._bootstrap.metadataService.databaseNames.subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
// Handle the case where there is no metadata service
|
||||||
|
data = data || [];
|
||||||
let profileData = data.map(d => {
|
let profileData = data.map(d => {
|
||||||
let profile = new ConnectionProfile(this.capabilitiesService, currentProfile);
|
let profile = new ConnectionProfile(this.capabilitiesService, currentProfile);
|
||||||
profile.databaseName = d;
|
profile.databaseName = d;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<span #child style="white-space : nowrap; width: fit-content">
|
<span #child style="white-space : nowrap; width: fit-content">
|
||||||
<ng-template ngFor let-item [ngForOf]="properties">
|
<ng-template ngFor let-item [ngForOf]="properties">
|
||||||
<span style="margin-left: 10px; display: inline-block;">
|
<span style="margin-left: 10px; display: inline-block;">
|
||||||
<div style="font-size: 11px; font-weight: lighter">{{item.displayName}}</div>
|
<div style="font-size: 11px;">{{item.displayName}}</div>
|
||||||
<div>{{item.value}}</div>
|
<div>{{item.value}}</div>
|
||||||
</span>
|
</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export class TasksWidget extends DashboardWidget implements IDashboardWidget, On
|
|||||||
}).filter(i => !!i);
|
}).filter(i => !!i);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._tasks = tasks.map(i => MenuRegistry.getCommand(i));
|
this._tasks = tasks.map(i => MenuRegistry.getCommand(i)).filter(v => !!v);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -166,7 +166,6 @@ export class TasksWidget extends DashboardWidget implements IDashboardWidget, On
|
|||||||
}
|
}
|
||||||
|
|
||||||
public runTask(task: ICommandAction) {
|
public runTask(task: ICommandAction) {
|
||||||
let serverInfo = this._bootstrap.connectionManagementService.connectionInfo.serverInfo;
|
|
||||||
this.commandService.executeCommand(task.id, this._profile);
|
this.commandService.executeCommand(task.id, this._profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,20 +4,23 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApplicationRef, ComponentFactoryResolver, ModuleWithProviders, NgModule,
|
ApplicationRef, ComponentFactoryResolver, NgModule,
|
||||||
Inject, forwardRef, Type
|
Inject, forwardRef, Type
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { APP_BASE_HREF, CommonModule } from '@angular/common';
|
import { APP_BASE_HREF, CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
|
||||||
import { BackupComponent, BACKUP_SELECTOR } from 'sql/parts/disasterRecovery/backup/backup.component';
|
import { IBootstrapParams, ISelector, providerIterator } from 'sql/services/bootstrap/bootstrapService';
|
||||||
|
import { BackupComponent } from 'sql/parts/disasterRecovery/backup/backup.component';
|
||||||
|
|
||||||
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
|
|
||||||
// work around
|
// work around
|
||||||
const BrowserAnimationsModule = (<any>require.__$__nodeRequire('@angular/platform-browser/animations')).BrowserAnimationsModule;
|
const BrowserAnimationsModule = (<any>require.__$__nodeRequire('@angular/platform-browser/animations')).BrowserAnimationsModule;
|
||||||
|
|
||||||
// Backup wizard main angular module
|
// Backup wizard main angular module
|
||||||
export const BackupModule = (params: IBootstrapParams, selector: string): Type<any> => {
|
export const BackupModule = (params: IBootstrapParams, selector: string, instantiationService: IInstantiationService): Type<any> => {
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
BackupComponent
|
BackupComponent
|
||||||
@@ -31,19 +34,22 @@ export const BackupModule = (params: IBootstrapParams, selector: string): Type<a
|
|||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: APP_BASE_HREF, useValue: '/' },
|
{ provide: APP_BASE_HREF, useValue: '/' },
|
||||||
{ provide: IBootstrapParams, useValue: params }
|
{ provide: IBootstrapParams, useValue: params },
|
||||||
|
{ provide: ISelector, useValue: selector },
|
||||||
|
...providerIterator(instantiationService)
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
class ModuleClass {
|
class ModuleClass {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(forwardRef(() => ComponentFactoryResolver)) private _resolver: ComponentFactoryResolver
|
@Inject(forwardRef(() => ComponentFactoryResolver)) private _resolver: ComponentFactoryResolver,
|
||||||
|
@Inject(ISelector) private selector: string
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngDoBootstrap(appRef: ApplicationRef) {
|
ngDoBootstrap(appRef: ApplicationRef) {
|
||||||
const factory = this._resolver.resolveComponentFactory(BackupComponent);
|
const factory = this._resolver.resolveComponentFactory(BackupComponent);
|
||||||
(<any>factory).factory.selector = selector;
|
(<any>factory).factory.selector = this.selector;
|
||||||
appRef.bootstrap(factory);
|
appRef.bootstrap(factory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,7 +235,8 @@ export class RestoreDialog extends Modal {
|
|||||||
this._databaseDropdown = new Dropdown(inputCellContainer.getHTMLElement(), this._contextViewService, this._themeService,
|
this._databaseDropdown = new Dropdown(inputCellContainer.getHTMLElement(), this._contextViewService, this._themeService,
|
||||||
{
|
{
|
||||||
strictSelection: false,
|
strictSelection: false,
|
||||||
ariaLabel: LocalizedStrings.TARGETDATABASE
|
ariaLabel: LocalizedStrings.TARGETDATABASE,
|
||||||
|
actionLabel: localize('toggleDatabaseNameDropdown', 'Select Database Toggle Dropdown')
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this._databaseDropdown.onValueChange(s => {
|
this._databaseDropdown.onValueChange(s => {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { IEditDataComponentParams } from 'sql/services/bootstrap/bootstrapParams
|
|||||||
import { GridParentComponent } from 'sql/parts/grid/views/gridParentComponent';
|
import { GridParentComponent } from 'sql/parts/grid/views/gridParentComponent';
|
||||||
import { EditDataGridActionProvider } from 'sql/parts/grid/views/editData/editDataGridActions';
|
import { EditDataGridActionProvider } from 'sql/parts/grid/views/editData/editDataGridActions';
|
||||||
import { error } from 'sql/base/common/log';
|
import { error } from 'sql/base/common/log';
|
||||||
import { clone } from 'sql/base/common/objects';
|
import { clone, mixin } from 'sql/base/common/objects';
|
||||||
import { IQueryEditorService } from 'sql/parts/query/common/queryEditorService';
|
import { IQueryEditorService } from 'sql/parts/query/common/queryEditorService';
|
||||||
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
||||||
|
|
||||||
@@ -195,7 +195,11 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
|||||||
let gridData: IGridDataRow[] = result.subset.map(row => {
|
let gridData: IGridDataRow[] = result.subset.map(row => {
|
||||||
self.idMapping[rowIndex] = row.id;
|
self.idMapping[rowIndex] = row.id;
|
||||||
rowIndex++;
|
rowIndex++;
|
||||||
return { values: row.cells, row: row.id };
|
return {
|
||||||
|
values: row.cells.map(c => {
|
||||||
|
return mixin({ ariaLabel: c.displayValue }, c);
|
||||||
|
}), row: row.id
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// Append a NULL row to the end of gridData
|
// Append a NULL row to the end of gridData
|
||||||
@@ -210,23 +214,21 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
|||||||
onDeleteRow(): (index: number) => void {
|
onDeleteRow(): (index: number) => void {
|
||||||
const self = this;
|
const self = this;
|
||||||
return (index: number): void => {
|
return (index: number): void => {
|
||||||
self.dataService.deleteRow(index)
|
// If the user is deleting a new row that hasn't been committed yet then use the revert code
|
||||||
.then(() => self.dataService.commitEdit())
|
if (self.newRowVisible && index === self.dataSet.dataRows.getLength() - 2) {
|
||||||
.then(() => self.removeRow(index));
|
self.revertCurrentRow();
|
||||||
|
} else {
|
||||||
|
self.dataService.deleteRow(index)
|
||||||
|
.then(() => self.dataService.commitEdit())
|
||||||
|
.then(() => self.removeRow(index));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
onRevertRow(): (index: number) => void {
|
onRevertRow(): () => void {
|
||||||
const self = this;
|
const self = this;
|
||||||
return (index: number): void => {
|
return (): void => {
|
||||||
// Force focus to the first cell (completing any active edit operation)
|
self.revertCurrentRow();
|
||||||
self.focusCell(index, 0, false);
|
|
||||||
this.currentEditCellValue = null;
|
|
||||||
// Perform a revert row operation
|
|
||||||
self.dataService.revertRow(index)
|
|
||||||
.then(() => {
|
|
||||||
self.refreshResultsets();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,24 +277,27 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.currentCell.row !== row) {
|
if (this.currentCell.row !== row) {
|
||||||
// We're changing row, commit the changes
|
// If we're currently adding a new row, only commit it if it has changes or the user is trying to add another new row
|
||||||
cellSelectTasks = cellSelectTasks.then(() => {
|
if (this.newRowVisible && this.currentCell.row === this.dataSet.dataRows.getLength() - 2 && !this.isNullRow(row) && this.currentEditCellValue === null) {
|
||||||
return self.dataService.commitEdit()
|
cellSelectTasks = cellSelectTasks.then(() => {
|
||||||
.then(
|
return this.revertCurrentRow().then(() => this.focusCell(row, column));
|
||||||
result => {
|
});
|
||||||
|
} else {
|
||||||
|
// We're changing row, commit the changes
|
||||||
|
cellSelectTasks = cellSelectTasks.then(() => {
|
||||||
|
return self.dataService.commitEdit().then(result => {
|
||||||
// Committing was successful, clean the grid
|
// Committing was successful, clean the grid
|
||||||
self.setGridClean();
|
self.setGridClean();
|
||||||
self.rowIdMappings = {};
|
self.rowIdMappings = {};
|
||||||
self.newRowVisible = false;
|
self.newRowVisible = false;
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
},
|
}, error => {
|
||||||
error => {
|
|
||||||
// Committing failed, jump back to the last selected cell
|
// Committing failed, jump back to the last selected cell
|
||||||
self.focusCell(self.currentCell.row, self.currentCell.column);
|
self.focusCell(self.currentCell.row, self.currentCell.column);
|
||||||
return Promise.reject(null);
|
return Promise.reject(null);
|
||||||
}
|
});
|
||||||
);
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isNullRow(row) && !this.removingNewRow) {
|
if (this.isNullRow(row) && !this.removingNewRow) {
|
||||||
@@ -428,7 +433,18 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
|||||||
// If the esc key was pressed while in a create session
|
// If the esc key was pressed while in a create session
|
||||||
let currentNewRowIndex = this.dataSet.totalRows - 2;
|
let currentNewRowIndex = this.dataSet.totalRows - 2;
|
||||||
|
|
||||||
if (e.keyCode === KeyCode.Escape && this.newRowVisible && this.currentCell.row === currentNewRowIndex) {
|
if (e.keyCode === KeyCode.Escape) {
|
||||||
|
this.revertCurrentRow();
|
||||||
|
handled = true;
|
||||||
|
}
|
||||||
|
return handled;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private Helper Functions ////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private async revertCurrentRow(): Promise<void> {
|
||||||
|
let currentNewRowIndex = this.dataSet.totalRows - 2;
|
||||||
|
if (this.newRowVisible && this.currentCell.row === currentNewRowIndex) {
|
||||||
// revert our last new row
|
// revert our last new row
|
||||||
this.removingNewRow = true;
|
this.removingNewRow = true;
|
||||||
|
|
||||||
@@ -437,17 +453,21 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
|||||||
this.removeRow(currentNewRowIndex);
|
this.removeRow(currentNewRowIndex);
|
||||||
this.newRowVisible = false;
|
this.newRowVisible = false;
|
||||||
});
|
});
|
||||||
handled = true;
|
} else {
|
||||||
} else if (e.keyCode === KeyCode.Escape) {
|
try {
|
||||||
this.currentEditCellValue = null;
|
// Perform a revert row operation
|
||||||
this.onRevertRow()(this.currentCell.row);
|
if (this.currentCell) {
|
||||||
handled = true;
|
await this.dataService.revertRow(this.currentCell.row);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
// The operation may fail if there were no changes sent to the service to revert,
|
||||||
|
// so clear any existing client-side edit and refresh the table regardless
|
||||||
|
this.currentEditCellValue = null;
|
||||||
|
this.refreshResultsets();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return handled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private Helper Functions ////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Checks if input row is our NULL new row
|
// Checks if input row is our NULL new row
|
||||||
private isNullRow(row: number): boolean {
|
private isNullRow(row: number): boolean {
|
||||||
// Null row is always at index (totalRows - 1)
|
// Null row is always at index (totalRows - 1)
|
||||||
@@ -535,9 +555,11 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
|||||||
// refresh results view
|
// refresh results view
|
||||||
this.onScroll(0);
|
this.onScroll(0);
|
||||||
|
|
||||||
// Set focus to the row index column of the removed row
|
// Set focus to the row index column of the removed row if the current selection is in the removed row
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.focusCell(row, 0);
|
if (this.currentCell.row === row) {
|
||||||
|
this.focusCell(row, 0);
|
||||||
|
}
|
||||||
this.removingNewRow = false;
|
this.removingNewRow = false;
|
||||||
}, this.scrollTimeOutTime);
|
}, this.scrollTimeOutTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,14 @@
|
|||||||
import { ApplicationRef, ComponentFactoryResolver, NgModule, Inject, forwardRef, Type } from '@angular/core';
|
import { ApplicationRef, ComponentFactoryResolver, NgModule, Inject, forwardRef, Type } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
|
||||||
import { EditDataComponent, EDITDATA_SELECTOR } from 'sql/parts/grid/views/editData/editData.component';
|
|
||||||
import { SlickGrid } from 'angular2-slickgrid';
|
import { SlickGrid } from 'angular2-slickgrid';
|
||||||
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
|
||||||
|
|
||||||
export const EditDataModule = (params: IBootstrapParams, selector: string): Type<any> => {
|
import { EditDataComponent } from 'sql/parts/grid/views/editData/editData.component';
|
||||||
|
import { IBootstrapParams, ISelector, providerIterator } from 'sql/services/bootstrap/bootstrapService';
|
||||||
|
|
||||||
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
|
|
||||||
|
export const EditDataModule = (params: IBootstrapParams, selector: string, instantiationService: IInstantiationService): Type<any> => {
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
||||||
@@ -30,19 +32,22 @@ export const EditDataModule = (params: IBootstrapParams, selector: string): Type
|
|||||||
EditDataComponent
|
EditDataComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: IBootstrapParams, useValue: params }
|
{ provide: IBootstrapParams, useValue: params },
|
||||||
|
{ provide: ISelector, useValue: selector },
|
||||||
|
...providerIterator(instantiationService)
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
class ModuleClass {
|
class ModuleClass {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(forwardRef(() => ComponentFactoryResolver)) private _resolver: ComponentFactoryResolver
|
@Inject(forwardRef(() => ComponentFactoryResolver)) private _resolver: ComponentFactoryResolver,
|
||||||
|
@Inject(ISelector) private selector: string
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngDoBootstrap(appRef: ApplicationRef) {
|
ngDoBootstrap(appRef: ApplicationRef) {
|
||||||
const factory = this._resolver.resolveComponentFactory(EditDataComponent);
|
const factory = this._resolver.resolveComponentFactory(EditDataComponent);
|
||||||
(<any>factory).factory.selector = selector;
|
(<any>factory).factory.selector = this.selector;
|
||||||
appRef.bootstrap(factory);
|
appRef.bootstrap(factory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export class EditDataGridActionProvider extends GridActionProvider {
|
|||||||
dataService: DataService,
|
dataService: DataService,
|
||||||
selectAllCallback: (index: number) => void,
|
selectAllCallback: (index: number) => void,
|
||||||
private _deleteRowCallback: (index: number) => void,
|
private _deleteRowCallback: (index: number) => void,
|
||||||
private _revertRowCallback: (index: number) => void,
|
private _revertRowCallback: () => void,
|
||||||
@IInstantiationService instantiationService: IInstantiationService
|
@IInstantiationService instantiationService: IInstantiationService
|
||||||
) {
|
) {
|
||||||
super(dataService, selectAllCallback, instantiationService);
|
super(dataService, selectAllCallback, instantiationService);
|
||||||
@@ -56,18 +56,18 @@ export class DeleteRowAction extends Action {
|
|||||||
|
|
||||||
export class RevertRowAction extends Action {
|
export class RevertRowAction extends Action {
|
||||||
public static ID = 'grid.revertRow';
|
public static ID = 'grid.revertRow';
|
||||||
public static LABEL = localize('revertRow', 'Revert Row');
|
public static LABEL = localize('revertRow', 'Revert Current Row');
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
id: string,
|
id: string,
|
||||||
label: string,
|
label: string,
|
||||||
private callback: (index: number) => void
|
private callback: () => void
|
||||||
) {
|
) {
|
||||||
super(id, label);
|
super(id, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
public run(gridInfo: IGridInfo): TPromise<boolean> {
|
public run(gridInfo: IGridInfo): TPromise<boolean> {
|
||||||
this.callback(gridInfo.rowIndex);
|
this.callback();
|
||||||
return TPromise.as(true);
|
return TPromise.as(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,4 +5,9 @@
|
|||||||
|
|
||||||
.editdata-component * {
|
.editdata-component * {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workbench\.editor\.editDataEditor .monaco-toolbar .monaco-select-box {
|
||||||
|
margin-top: 4px;
|
||||||
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ import { GridActionProvider } from 'sql/parts/grid/views/gridActions';
|
|||||||
import { IQueryComponentParams } from 'sql/services/bootstrap/bootstrapParams';
|
import { IQueryComponentParams } from 'sql/services/bootstrap/bootstrapParams';
|
||||||
import { error } from 'sql/base/common/log';
|
import { error } from 'sql/base/common/log';
|
||||||
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||||
import { clone } from 'sql/base/common/objects';
|
import { clone, mixin } from 'sql/base/common/objects';
|
||||||
import { IQueryEditorService } from 'sql/parts/query/common/queryEditorService';
|
import { IQueryEditorService } from 'sql/parts/query/common/queryEditorService';
|
||||||
|
|
||||||
import * as strings from 'vs/base/common/strings';
|
import * as strings from 'vs/base/common/strings';
|
||||||
@@ -301,7 +301,9 @@ export class QueryComponent extends GridParentComponent implements OnInit, OnDes
|
|||||||
for (let row = 0; row < rows.rows.length; row++) {
|
for (let row = 0; row < rows.rows.length; row++) {
|
||||||
// Push row values onto end of gridData for slickgrid
|
// Push row values onto end of gridData for slickgrid
|
||||||
gridData.push({
|
gridData.push({
|
||||||
values: rows.rows[row]
|
values: rows.rows[row].map(c => {
|
||||||
|
return mixin({ ariaLabel: c.displayValue }, c);
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,13 +168,16 @@ export class InsightsDialogView extends Modal {
|
|||||||
|
|
||||||
this._splitView = new SplitView(container);
|
this._splitView = new SplitView(container);
|
||||||
|
|
||||||
|
const itemsHeaderTitle = nls.localize("insights.dialog.items", "Items");
|
||||||
|
const itemsDetailHeaderTitle = nls.localize("insights.dialog.itemDetails", "Item Details");
|
||||||
|
|
||||||
this._topTableData = new TableDataView();
|
this._topTableData = new TableDataView();
|
||||||
this._bottomTableData = new TableDataView();
|
this._bottomTableData = new TableDataView();
|
||||||
let topTableView = new TableCollapsibleView(nls.localize("insights.dialog.items", "Items"), { sizing: ViewSizing.Flexible, ariaHeaderLabel: 'title' }, this._topTableData, this._topColumns, { forceFitColumns: true });
|
let topTableView = new TableCollapsibleView(itemsHeaderTitle, { sizing: ViewSizing.Flexible, ariaHeaderLabel: itemsHeaderTitle }, this._topTableData, this._topColumns, { forceFitColumns: true });
|
||||||
this._topTable = topTableView.table;
|
this._topTable = topTableView.table;
|
||||||
topTableView.addContainerClass('insights');
|
topTableView.addContainerClass('insights');
|
||||||
this._topTable.setSelectionModel(new RowSelectionModel<ListResource>());
|
this._topTable.setSelectionModel(new RowSelectionModel<ListResource>());
|
||||||
let bottomTableView = new TableCollapsibleView(nls.localize("insights.dialog.itemDetails", "Item Details"), { sizing: ViewSizing.Flexible, ariaHeaderLabel: 'title' }, this._bottomTableData, this._bottomColumns, { forceFitColumns: true });
|
let bottomTableView = new TableCollapsibleView(itemsDetailHeaderTitle, { sizing: ViewSizing.Flexible, ariaHeaderLabel: itemsDetailHeaderTitle }, this._bottomTableData, this._bottomColumns, { forceFitColumns: true });
|
||||||
this._bottomTable = bottomTableView.table;
|
this._bottomTable = bottomTableView.table;
|
||||||
this._bottomTable.setSelectionModel(new RowSelectionModel<ListResource>());
|
this._bottomTable.setSelectionModel(new RowSelectionModel<ListResource>());
|
||||||
|
|
||||||
|
|||||||
@@ -4,17 +4,42 @@
|
|||||||
* 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.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
-->
|
-->
|
||||||
|
<div id="agentViewDiv" class="fullsize">
|
||||||
<panel class="dashboard-panel" [options]="panelOpt">
|
<panel class="dashboard-panel" [options]="panelOpt">
|
||||||
<tab [title]="jobsComponentTitle" class="fullsize" [identifier]="jobsTabIdentifier"
|
<tab [title]="jobsComponentTitle" class="fullsize" [identifier]="jobsTabIdentifier"
|
||||||
[iconClass]="jobsIconClass">
|
[iconClass]="jobsIconClass">
|
||||||
<ng-template>
|
<ng-template>
|
||||||
<div id="jobsDiv" class="fullsize" *ngIf="showHistory === false">
|
<div id="jobsDiv" class="fullsize" *ngIf="showHistory === false">
|
||||||
<jobsview-component></jobsview-component>
|
<jobsview-component></jobsview-component>
|
||||||
</div>
|
</div>
|
||||||
<div id="historyDiv" class="fullsize" *ngIf="showHistory === true">
|
<div id="historyDiv" class="fullsize" *ngIf="showHistory === true">
|
||||||
<jobhistory-component></jobhistory-component>
|
<jobhistory-component></jobhistory-component>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</tab>
|
</tab>
|
||||||
</panel>
|
<tab [title]="alertsComponentTitle" class="fullsize" [identifier]="alertsTabIdentifier"
|
||||||
|
[iconClass]="alertsIconClass">
|
||||||
|
<ng-template>
|
||||||
|
<div id="alertsDiv" class="fullsize">
|
||||||
|
<jobalertsview-component></jobalertsview-component>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
</tab>
|
||||||
|
<tab [title]="operatorsComponentTitle" class="fullsize" [identifier]="operatorsTabIdentifier"
|
||||||
|
[iconClass]="operatorsIconClass">
|
||||||
|
<ng-template>
|
||||||
|
<div id="operatorsDiv" class="fullsize">
|
||||||
|
<joboperatorsview-component></joboperatorsview-component>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
</tab>
|
||||||
|
<tab [title]="proxiesComponentTitle" class="fullsize" [identifier]="proxiesTabIdentifier"
|
||||||
|
[iconClass]="proxiesIconClass">
|
||||||
|
<ng-template>
|
||||||
|
<div id="proxiesDiv" class="fullsize">
|
||||||
|
<jobproxiesview-component></jobproxiesview-component>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
</tab>
|
||||||
|
</panel>
|
||||||
|
</div>
|
||||||
@@ -33,6 +33,10 @@ export class AgentViewComponent {
|
|||||||
|
|
||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
private readonly jobsComponentTitle: string = nls.localize('jobview.Jobs', "Jobs");
|
private readonly jobsComponentTitle: string = nls.localize('jobview.Jobs', "Jobs");
|
||||||
|
private readonly alertsComponentTitle: string = nls.localize('jobview.Alerts', "Alerts");
|
||||||
|
private readonly proxiesComponentTitle: string = nls.localize('jobview.Proxies', "Proxies");
|
||||||
|
private readonly operatorsComponentTitle: string = nls.localize('jobview.Operators', "Operators");
|
||||||
|
|
||||||
private _showHistory: boolean = false;
|
private _showHistory: boolean = false;
|
||||||
private _jobId: string = null;
|
private _jobId: string = null;
|
||||||
private _agentJobInfo: AgentJobInfo = null;
|
private _agentJobInfo: AgentJobInfo = null;
|
||||||
@@ -40,6 +44,9 @@ export class AgentViewComponent {
|
|||||||
private _expanded: Map<string, string>;
|
private _expanded: Map<string, string>;
|
||||||
|
|
||||||
public jobsIconClass: string = 'jobsview-icon';
|
public jobsIconClass: string = 'jobsview-icon';
|
||||||
|
public alertsIconClass: string = 'alertsview-icon';
|
||||||
|
public proxiesIconClass: string = 'proxiesview-icon';
|
||||||
|
public operatorsIconClass: string = 'operatorsview-icon';
|
||||||
|
|
||||||
// tslint:disable-next-line:no-unused-variable
|
// tslint:disable-next-line:no-unused-variable
|
||||||
private readonly panelOpt: IPanelOptions = {
|
private readonly panelOpt: IPanelOptions = {
|
||||||
@@ -82,7 +89,6 @@ export class AgentViewComponent {
|
|||||||
|
|
||||||
public set jobId(value: string) {
|
public set jobId(value: string) {
|
||||||
this._jobId = value;
|
this._jobId = value;
|
||||||
this._cd.detectChanges();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public set showHistory(value: boolean) {
|
public set showHistory(value: boolean) {
|
||||||
@@ -92,7 +98,6 @@ export class AgentViewComponent {
|
|||||||
|
|
||||||
public set agentJobInfo(value: AgentJobInfo) {
|
public set agentJobInfo(value: AgentJobInfo) {
|
||||||
this._agentJobInfo = value;
|
this._agentJobInfo = value;
|
||||||
this._cd.detectChanges();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public set refresh(value: boolean) {
|
public set refresh(value: boolean) {
|
||||||
@@ -104,6 +109,10 @@ export class AgentViewComponent {
|
|||||||
this._expanded.set(jobId, errorMessage);
|
this._expanded.set(jobId, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public set expanded(value: Map<string, string>) {
|
||||||
|
this._expanded = value;
|
||||||
|
}
|
||||||
|
|
||||||
public layout() {
|
public layout() {
|
||||||
this._panel.layout();
|
this._panel.layout();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,4 +92,58 @@ export class AgentJobUtilities {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static convertDurationToSeconds(duration: string): number {
|
||||||
|
let split = duration.split(':');
|
||||||
|
let seconds = (+split[0]) * 60 * 60 + (+split[1]) * 60 + (+split[2]);
|
||||||
|
return seconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static convertColFieldToName(colField: string) {
|
||||||
|
switch(colField) {
|
||||||
|
case('name'):
|
||||||
|
return 'Name';
|
||||||
|
case('lastRun'):
|
||||||
|
return 'Last Run';
|
||||||
|
case('nextRun'):
|
||||||
|
return 'Next Run';
|
||||||
|
case('enabled'):
|
||||||
|
return 'Enabled';
|
||||||
|
case('status'):
|
||||||
|
return 'Status';
|
||||||
|
case('category'):
|
||||||
|
return 'Category';
|
||||||
|
case('runnable'):
|
||||||
|
return 'Runnable';
|
||||||
|
case('schedule'):
|
||||||
|
return 'Schedule';
|
||||||
|
case('lastRunOutcome'):
|
||||||
|
return 'Last Run Outcome';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static convertColNameToField(columnName: string) {
|
||||||
|
switch(columnName) {
|
||||||
|
case('Name'):
|
||||||
|
return 'name';
|
||||||
|
case('Last Run'):
|
||||||
|
return 'lastRun';
|
||||||
|
case('Next Run'):
|
||||||
|
return 'nextRun';
|
||||||
|
case('Enabled'):
|
||||||
|
return 'enabled';
|
||||||
|
case('Status'):
|
||||||
|
return 'status';
|
||||||
|
case('Category'):
|
||||||
|
return 'category';
|
||||||
|
case('Runnable'):
|
||||||
|
return 'runnable';
|
||||||
|
case('Schedule'):
|
||||||
|
return 'schedule';
|
||||||
|
case('Last Run Outcome'):
|
||||||
|
return 'lastRunOutcome';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { Table } from 'sql/base/browser/ui/table/table';
|
|
||||||
import { JobCacheObject } from './jobManagementService';
|
import { JobCacheObject } from './jobManagementService';
|
||||||
|
|
||||||
export const SERVICE_ID = 'jobManagementService';
|
export const SERVICE_ID = 'jobManagementService';
|
||||||
@@ -21,9 +20,15 @@ export interface IJobManagementService {
|
|||||||
|
|
||||||
getJobs(connectionUri: string): Thenable<sqlops.AgentJobsResult>;
|
getJobs(connectionUri: string): Thenable<sqlops.AgentJobsResult>;
|
||||||
|
|
||||||
|
getAlerts(connectionUri: string): Thenable<sqlops.AgentAlertsResult>;
|
||||||
|
|
||||||
|
getOperators(connectionUri: string): Thenable<sqlops.AgentOperatorsResult>;
|
||||||
|
|
||||||
|
getProxies(connectionUri: string): Thenable<sqlops.AgentProxiesResult>;
|
||||||
|
|
||||||
getJobHistory(connectionUri: string, jobID: string): Thenable<sqlops.AgentJobHistoryResult>;
|
getJobHistory(connectionUri: string, jobID: string): Thenable<sqlops.AgentJobHistoryResult>;
|
||||||
|
|
||||||
jobAction(connectionUri: string, jobName: string, action: string): Thenable<sqlops.AgentJobActionResult>;
|
jobAction(connectionUri: string, jobName: string, action: string): Thenable<sqlops.ResultStatus>;
|
||||||
|
|
||||||
addToCache(server: string, cache: JobCacheObject);
|
addToCache(server: string, cache: JobCacheObject);
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,8 @@
|
|||||||
|
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import * as vscode from 'vscode';
|
|
||||||
import { TPromise } from 'vs/base/common/winjs.base';
|
import { TPromise } from 'vs/base/common/winjs.base';
|
||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { IJobManagementService } from 'sql/parts/jobManagement/common/interfaces';
|
import { IJobManagementService } from 'sql/parts/jobManagement/common/interfaces';
|
||||||
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
|
||||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||||
|
|
||||||
|
|
||||||
@@ -22,8 +19,7 @@ export class JobManagementService implements IJobManagementService {
|
|||||||
private _jobCacheObject : {[server: string]: JobCacheObject; } = {};
|
private _jobCacheObject : {[server: string]: JobCacheObject; } = {};
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IConnectionManagementService private _connectionService: IConnectionManagementService,
|
@IConnectionManagementService private _connectionService: IConnectionManagementService
|
||||||
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService
|
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,13 +29,32 @@ export class JobManagementService implements IJobManagementService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getAlerts(connectionUri: string): Thenable<sqlops.AgentAlertsResult> {
|
||||||
|
return this._runAction(connectionUri, (runner) => {
|
||||||
|
return runner.getAlerts(connectionUri);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public getOperators(connectionUri: string): Thenable<sqlops.AgentOperatorsResult> {
|
||||||
|
return this._runAction(connectionUri, (runner) => {
|
||||||
|
return runner.getOperators(connectionUri);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public getProxies(connectionUri: string): Thenable<sqlops.AgentProxiesResult> {
|
||||||
|
return this._runAction(connectionUri, (runner) => {
|
||||||
|
return runner.getProxies(connectionUri);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public getJobHistory(connectionUri: string, jobID: string): Thenable<sqlops.AgentJobHistoryResult> {
|
public getJobHistory(connectionUri: string, jobID: string): Thenable<sqlops.AgentJobHistoryResult> {
|
||||||
return this._runAction(connectionUri, (runner) => {
|
return this._runAction(connectionUri, (runner) => {
|
||||||
return runner.getJobHistory(connectionUri, jobID);
|
return runner.getJobHistory(connectionUri, jobID);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public jobAction(connectionUri: string, jobName: string, action: string): Thenable<sqlops.AgentJobActionResult> {
|
public jobAction(connectionUri: string, jobName: string, action: string): Thenable<sqlops.ResultStatus> {
|
||||||
return this._runAction(connectionUri, (runner) => {
|
return this._runAction(connectionUri, (runner) => {
|
||||||
return runner.jobAction(connectionUri, jobName, action);
|
return runner.jobAction(connectionUri, jobName, action);
|
||||||
});
|
});
|
||||||
@@ -79,16 +94,18 @@ export class JobManagementService implements IJobManagementService {
|
|||||||
export class JobCacheObject {
|
export class JobCacheObject {
|
||||||
_serviceBrand: any;
|
_serviceBrand: any;
|
||||||
private _jobs: sqlops.AgentJobInfo[] = [];
|
private _jobs: sqlops.AgentJobInfo[] = [];
|
||||||
private _jobHistories: { [jobId: string]: sqlops.AgentJobHistoryInfo[]; } = {};
|
private _jobHistories: { [jobID: string]: sqlops.AgentJobHistoryInfo[]; } = {};
|
||||||
|
private _runCharts: { [jobID: string]: string[]; } = {};
|
||||||
private _prevJobID: string;
|
private _prevJobID: string;
|
||||||
private _serverName: string;
|
private _serverName: string;
|
||||||
|
private _dataView: Slick.Data.DataView<any>;
|
||||||
|
|
||||||
/* Getters */
|
/* Getters */
|
||||||
public get jobs(): sqlops.AgentJobInfo[] {
|
public get jobs(): sqlops.AgentJobInfo[] {
|
||||||
return this._jobs;
|
return this._jobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get jobHistories(): { [jobId: string]: sqlops.AgentJobHistoryInfo[] } {
|
public get jobHistories(): { [jobID: string]: sqlops.AgentJobHistoryInfo[] } {
|
||||||
return this._jobHistories;
|
return this._jobHistories;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,12 +121,20 @@ export class JobCacheObject {
|
|||||||
return this._serverName;
|
return this._serverName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get dataView(): Slick.Data.DataView<any> {
|
||||||
|
return this._dataView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public getRunChart(jobID: string): string[] {
|
||||||
|
return this._runCharts[jobID];
|
||||||
|
}
|
||||||
|
|
||||||
/* Setters */
|
/* Setters */
|
||||||
public set jobs(value: sqlops.AgentJobInfo[]) {
|
public set jobs(value: sqlops.AgentJobInfo[]) {
|
||||||
this._jobs = value;
|
this._jobs = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public set jobHistories(value: { [jobId: string]: sqlops.AgentJobHistoryInfo[]; }) {
|
public set jobHistories(value: { [jobID: string]: sqlops.AgentJobHistoryInfo[]; }) {
|
||||||
this._jobHistories = value;
|
this._jobHistories = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,8 +146,15 @@ export class JobCacheObject {
|
|||||||
this._jobHistories[jobID] = value;
|
this._jobHistories[jobID] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setRunChart(jobID: string, value: string[]) {
|
||||||
|
this._runCharts[jobID] = value;
|
||||||
|
}
|
||||||
|
|
||||||
public set serverName(value: string) {
|
public set serverName(value: string) {
|
||||||
this._serverName = value;
|
this._serverName = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public set dataView(value: Slick.Data.DataView<any>) {
|
||||||
|
this._dataView = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
1
src/sql/parts/jobManagement/common/media/alert.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#212121;}</style></defs><title>blocker</title><polygon class="cls-1" points="0.99 3.99 -0.01 3.99 -0.01 0.03 3.98 0.03 3.98 1.03 0.99 1.03 0.99 3.99"/><polygon class="cls-1" points="16.01 3.99 15.01 3.99 15.01 1.03 12.02 1.03 12.02 0.03 16.01 0.03 16.01 3.99"/><polygon class="cls-1" points="16.01 15.97 12.02 15.97 12.02 14.97 15.01 14.97 15.01 12.01 16.01 12.01 16.01 15.97"/><polygon class="cls-1" points="4 15.97 0.01 15.97 0.01 12.01 1.01 12.01 1.01 14.97 4 14.97 4 15.97"/><path class="cls-1" d="M8.41,3.18A4.82,4.82,0,1,0,13.23,8,4.83,4.83,0,0,0,8.41,3.18Zm0,.74A4.08,4.08,0,0,1,12.49,8a4,4,0,0,1-.85,2.47L5.69,5A4,4,0,0,1,8.41,3.93Zm0,8.15A4.08,4.08,0,0,1,4.34,8a4,4,0,0,1,.85-2.47L11.14,11A4,4,0,0,1,8.41,12.07Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 847 B |
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}</style></defs><title>blocker_inverse</title><polygon class="cls-1" points="0.99 3.99 -0.01 3.99 -0.01 0.03 3.98 0.03 3.98 1.03 0.99 1.03 0.99 3.99"/><polygon class="cls-1" points="16.01 3.99 15.01 3.99 15.01 1.03 12.02 1.03 12.02 0.03 16.01 0.03 16.01 3.99"/><polygon class="cls-1" points="16.01 15.97 12.02 15.97 12.02 14.97 15.01 14.97 15.01 12.01 16.01 12.01 16.01 15.97"/><polygon class="cls-1" points="4 15.97 0.01 15.97 0.01 12.01 1.01 12.01 1.01 14.97 4 14.97 4 15.97"/><path class="cls-1" d="M8.41,3.18A4.82,4.82,0,1,0,13.23,8,4.83,4.83,0,0,0,8.41,3.18Zm0,.74A4.08,4.08,0,0,1,12.49,8a4,4,0,0,1-.85,2.47L5.69,5A4,4,0,0,1,8.41,3.93Zm0,8.15A4.08,4.08,0,0,1,4.34,8a4,4,0,0,1,.85-2.47L11.14,11A4,4,0,0,1,8.41,12.07Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 852 B |
@@ -31,7 +31,7 @@ jobhistory-component {
|
|||||||
border-bottom: 3px solid #444444;
|
border-bottom: 3px solid #444444;
|
||||||
}
|
}
|
||||||
|
|
||||||
#jobsDiv .jobview-grid {
|
.jobview-grid {
|
||||||
height: 94.7%;
|
height: 94.7%;
|
||||||
width : 100%;
|
width : 100%;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -49,12 +49,24 @@ jobhistory-component {
|
|||||||
font-size: larger;
|
font-size: larger;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vs-dark #jobsDiv .slick-cell {
|
.vs-dark #agentViewDiv .slick-header-column {
|
||||||
background:#333333 !important;
|
background: #333333 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#jobsDiv .slick-cell {
|
#agentViewDiv .slick-header-column {
|
||||||
background: white !important;
|
background-color: transparent !important;
|
||||||
|
background: white !important;
|
||||||
|
border: 0px !important;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: larger;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark #jobsDiv jobsview-component .jobview-grid .grid-canvas .ui-widget-content.slick-row .slick-cell {
|
||||||
|
background:#333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jobsDiv jobsview-component .jobview-grid .grid-canvas .ui-widget-content.slick-row .slick-cell {
|
||||||
|
background: white;
|
||||||
border-right: transparent !important;
|
border-right: transparent !important;
|
||||||
border-left: transparent !important;
|
border-left: transparent !important;
|
||||||
line-height: 33px !important;
|
line-height: 33px !important;
|
||||||
@@ -97,7 +109,7 @@ jobhistory-component {
|
|||||||
|
|
||||||
#jobsDiv .jobview-grid .slick-cell.l1.r1 .jobview-jobnametext {
|
#jobsDiv .jobview-grid .slick-cell.l1.r1 .jobview-jobnametext {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
width: 200px;
|
width: 250px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -107,18 +119,14 @@ jobhistory-component {
|
|||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row .slick-cell.l1.r1.error-row {
|
.jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row .slick-cell.l1.r1.error-row {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: orangered;
|
color: orangered;
|
||||||
}
|
}
|
||||||
|
|
||||||
#jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row .slick-cell.error-row {
|
.jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row .slick-cell._detail_selector.error-row {
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row .slick-cell._detail_selector.error-row {
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,6 +190,30 @@ jobhistory-component {
|
|||||||
background-image: url('./job_inverse.svg');
|
background-image: url('./job_inverse.svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alertsview-icon {
|
||||||
|
background-image: url('./alert.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark .alertsview-icon {
|
||||||
|
background-image: url('./alert_inverse.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.proxiesview-icon {
|
||||||
|
background-image: url('./proxy.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark .proxiesview-icon {
|
||||||
|
background-image: url('./proxy_inverse.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.operatorsview-icon {
|
||||||
|
background-image: url('./operator.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark .operatorsview-icon {
|
||||||
|
background-image: url('./operator_inverse.svg');
|
||||||
|
}
|
||||||
|
|
||||||
agentview-component .jobview-grid .grid-canvas > .ui-widget-content.slick-row.even > .slick-cell,
|
agentview-component .jobview-grid .grid-canvas > .ui-widget-content.slick-row.even > .slick-cell,
|
||||||
agentview-component .jobview-grid .grid-canvas > .ui-widget-content.slick-row.odd > .slick-cell {
|
agentview-component .jobview-grid .grid-canvas > .ui-widget-content.slick-row.odd > .slick-cell {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -205,4 +237,81 @@ agentview-component .jobview-grid .grid-canvas > .ui-widget-content.slick-row.od
|
|||||||
#jobsDiv jobsview-component .jobview-grid .slick-cell.l1.r1.error-row td.jobview-jobnameindicatorfailure {
|
#jobsDiv jobsview-component .jobview-grid .slick-cell.l1.r1.error-row td.jobview-jobnameindicatorfailure {
|
||||||
width: 0;
|
width: 0;
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell,
|
||||||
|
#jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell,
|
||||||
|
#jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row> .slick-cell.hovered {
|
||||||
|
background: #dcdcdc !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vs-dark #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell,
|
||||||
|
.vs-dark #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row > .slick-cell.hovered,
|
||||||
|
.vs-dark #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell {
|
||||||
|
background: #444444 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.jobprevruns div.bar0, table.jobprevruns div.bar1, table.jobprevruns div.bar2,
|
||||||
|
table.jobprevruns div.bar3, table.jobprevruns div.bar4, table.jobprevruns div.bar5 {
|
||||||
|
padding-top: 3px;
|
||||||
|
padding-left: 5px;
|
||||||
|
width: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jobview-grid .slick-cell.l10.r10 {
|
||||||
|
text-align: center;
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.jobprevruns {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.jobprevruns > tbody {
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jobs-view-toolbar{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 15px 10px 15px 30px;
|
||||||
|
font-size: 16px;
|
||||||
|
border-bottom: 3px solid #f4f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jobs-view-toolbar .vs-dark {
|
||||||
|
border-bottom: 3px solid #444444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jobs-view-toolbar > div{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-right: 25px;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jobs-view-toolbar span{
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#alertsDiv .jobalertsview-grid {
|
||||||
|
height: 94.7%;
|
||||||
|
width : 100%;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#operatorsDiv .joboperatorsview-grid {
|
||||||
|
height: 94.7%;
|
||||||
|
width : 100%;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#proxiesDiv .jobproxiesview-grid {
|
||||||
|
height: 94.7%;
|
||||||
|
width : 100%;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|||||||
1
src/sql/parts/jobManagement/common/media/new.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#231f20;}.cls-2{fill:#212121;}</style></defs><title>new_16x16</title><polygon class="cls-1" points="13.59 2.21 13.58 2.22 13.58 2.2 13.59 2.21"/><path class="cls-2" d="M16,7.5v1H8.5V16h-1V8.5H0v-1H7.5V0h1V7.5Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 336 B |
1
src/sql/parts/jobManagement/common/media/new_inverse.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}</style></defs><title>new_inverse_16x16</title><polygon class="cls-1" points="13.59 2.21 13.58 2.22 13.58 2.2 13.59 2.21"/><path class="cls-1" d="M16,7.5v1H8.5V16h-1V8.5H0v-1H7.5V0h1V7.5Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 320 B |
1
src/sql/parts/jobManagement/common/media/operator.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>security</title><path d="M6,8a4.88,4.88,0,0,0-1.33.18,5.11,5.11,0,0,0-1.2.5,5,5,0,0,0-1.79,1.79,5.11,5.11,0,0,0-.5,1.2A4.88,4.88,0,0,0,1,13H0a5.9,5.9,0,0,1,.28-1.79,6.12,6.12,0,0,1,2-2.94,5.33,5.33,0,0,1,1.58-.88,4.18,4.18,0,0,1-.79-.65,4,4,0,0,1-.59-.8A4.05,4.05,0,0,1,2.13,5a4,4,0,0,1,.18-2.57A4,4,0,0,1,4.44.31a4,4,0,0,1,3.12,0A4,4,0,0,1,9.69,2.44,4,4,0,0,1,9.87,5a4.05,4.05,0,0,1-.37.93,4,4,0,0,1-.59.8,4.18,4.18,0,0,1-.79.65,6.14,6.14,0,0,1,1,.5,5.73,5.73,0,0,1,.91.69l-.68.74a5,5,0,0,0-1.57-1A4.93,4.93,0,0,0,6,8ZM3,4a2.92,2.92,0,0,0,.23,1.17,3,3,0,0,0,1.6,1.6,3,3,0,0,0,2.33,0,3,3,0,0,0,1.6-1.6,3,3,0,0,0,0-2.33,3,3,0,0,0-1.6-1.6,3,3,0,0,0-2.33,0,3,3,0,0,0-1.6,1.6A2.92,2.92,0,0,0,3,4Zm12,8a2.45,2.45,0,0,1,0,1l1,.4-.38.93-1-.41a2.59,2.59,0,0,1-.67.67l.41,1-.93.38L13,15a2.45,2.45,0,0,1-1,0l-.4,1-.93-.38.41-1a2.59,2.59,0,0,1-.67-.67l-1,.41-.38-.93,1-.4a2.45,2.45,0,0,1,0-1l-1-.4.38-.93,1,.41a2.59,2.59,0,0,1,.67-.67l-.41-1,.93-.38.4,1a2.45,2.45,0,0,1,1,0l.4-1,.93.38-.41,1a2.59,2.59,0,0,1,.67.67l1-.41.38.93ZM12.5,14a1.47,1.47,0,0,0,.59-.12,1.49,1.49,0,0,0,.8-.8,1.52,1.52,0,0,0,0-1.17,1.49,1.49,0,0,0-.8-.8,1.52,1.52,0,0,0-1.17,0,1.49,1.49,0,0,0-.8.8,1.52,1.52,0,0,0,0,1.17,1.49,1.49,0,0,0,.8.8A1.47,1.47,0,0,0,12.5,14Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}</style></defs><title>security_inverse</title><path class="cls-1" d="M6,8a4.88,4.88,0,0,0-1.33.18,5.11,5.11,0,0,0-1.2.5,5,5,0,0,0-1.79,1.79,5.11,5.11,0,0,0-.5,1.2A4.88,4.88,0,0,0,1,13H0a5.9,5.9,0,0,1,.28-1.79,6.12,6.12,0,0,1,2-2.94,5.33,5.33,0,0,1,1.58-.88,4.18,4.18,0,0,1-.79-.65,4,4,0,0,1-.59-.8A4.05,4.05,0,0,1,2.13,5a4,4,0,0,1,.18-2.57A4,4,0,0,1,4.44.31a4,4,0,0,1,3.12,0A4,4,0,0,1,9.69,2.44,4,4,0,0,1,9.87,5a4.05,4.05,0,0,1-.37.93,4,4,0,0,1-.59.8,4.18,4.18,0,0,1-.79.65,6.14,6.14,0,0,1,1,.5,5.73,5.73,0,0,1,.91.69l-.68.74a5,5,0,0,0-1.57-1A4.93,4.93,0,0,0,6,8ZM3,4a2.92,2.92,0,0,0,.23,1.17,3,3,0,0,0,1.6,1.6,3,3,0,0,0,2.33,0,3,3,0,0,0,1.6-1.6,3,3,0,0,0,0-2.33,3,3,0,0,0-1.6-1.6,3,3,0,0,0-2.33,0,3,3,0,0,0-1.6,1.6A2.92,2.92,0,0,0,3,4Zm12,8a2.45,2.45,0,0,1,0,1l1,.4-.38.93-1-.41a2.59,2.59,0,0,1-.67.67l.41,1-.93.38L13,15a2.45,2.45,0,0,1-1,0l-.4,1-.93-.38.41-1a2.59,2.59,0,0,1-.67-.67l-1,.41-.38-.93,1-.4a2.45,2.45,0,0,1,0-1l-1-.4.38-.93,1,.41a2.59,2.59,0,0,1,.67-.67l-.41-1,.93-.38.4,1a2.45,2.45,0,0,1,1,0l.4-1,.93.38-.41,1a2.59,2.59,0,0,1,.67.67l1-.41.38.93ZM12.5,14a1.47,1.47,0,0,0,.59-.12,1.49,1.49,0,0,0,.8-.8,1.52,1.52,0,0,0,0-1.17,1.49,1.49,0,0,0-.8-.8,1.52,1.52,0,0,0-1.17,0,1.49,1.49,0,0,0-.8.8,1.52,1.52,0,0,0,0,1.17,1.49,1.49,0,0,0,.8.8A1.47,1.47,0,0,0,12.5,14Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
1
src/sql/parts/jobManagement/common/media/proxy.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#101e23;}.cls-2{fill:#4bb8d1;}.cls-3{fill:#0c1011;}</style></defs><title>health</title><path class="cls-1" d="M12.58,1.51A6.36,6.36,0,0,0,8,3.9,6.32,6.32,0,0,0,3.41,1.51,3.81,3.81,0,0,0,0,5.35,5.7,5.7,0,0,0,.64,7.88h.72l0-.08A5.18,5.18,0,0,1,.64,5.39c.07-1.25.87-3.14,2.8-3.23h.12A5.81,5.81,0,0,1,7.73,4.63L8,5.06l.27-.43a5.72,5.72,0,0,1,4.28-2.47c1.93.09,2.73,2,2.8,3.23a5.15,5.15,0,0,1-.64,2.34l0,0a2.38,2.38,0,0,1-.34.68,19.45,19.45,0,0,1-6.57,6.06,11.11,11.11,0,0,1-1.25-.81c-.34-.25-.66-.52-1-.8h0a22.83,22.83,0,0,1-2.76-3H2a18.68,18.68,0,0,0,5.76,5.29h0l0,0h0c3.49-1.63,7-5.73,7.49-7.18V8A5.85,5.85,0,0,0,16,5.35,3.81,3.81,0,0,0,12.58,1.51Z"/><path class="cls-1" d="M1.41,8l-.1-.15h0Z"/><path class="cls-1" d="M7.79,15.22v0h0Z"/><path class="cls-1" d="M7.76,15.23h0v0Z"/><path class="cls-1" d="M14.72,7.73l0,0a.13.13,0,0,0,0,0Z"/><path class="cls-2" d="M12.62,8.7v.12a.48.48,0,0,1-.48.48H8.66l0,.07L7.38,12.65h0A.72.72,0,0,1,6,12.53V9.44H6V6.6L5,9.05H5a.56.56,0,0,1-.52.37H.92V8.36H4.13l0-.07L5.41,5h0a.72.72,0,0,1,1.42.12V8.22h0v2.84L7.77,8.6h0a.56.56,0,0,1,.52-.37h3.84A.48.48,0,0,1,12.62,8.7Z"/><path class="cls-3" d="M12.62,8.7v.12a.48.48,0,0,1-.48.48H8.66l0,.07L7.38,12.65h0A.72.72,0,0,1,6,12.53V9.44H6V6.6L5,9.05H5a.56.56,0,0,1-.52.37H.92V8.36H4.13l0-.07L5.41,5h0a.72.72,0,0,1,1.42.12V8.22h0v2.84L7.77,8.6h0a.56.56,0,0,1,.52-.37h3.84A.48.48,0,0,1,12.62,8.7Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}.cls-2{fill:#101e23;}.cls-3{fill:#4bb8d1;}</style></defs><title>health_inverse</title><path class="cls-1" d="M12.58,1.51A6.36,6.36,0,0,0,8,3.9,6.32,6.32,0,0,0,3.41,1.51,3.81,3.81,0,0,0,0,5.35,5.7,5.7,0,0,0,.64,7.88h.72l0-.08A5.18,5.18,0,0,1,.64,5.39c.07-1.25.87-3.14,2.8-3.23h.12A5.81,5.81,0,0,1,7.73,4.63L8,5.06l.27-.43a5.72,5.72,0,0,1,4.28-2.47c1.93.09,2.73,2,2.8,3.23a5.15,5.15,0,0,1-.64,2.34l0,0a2.38,2.38,0,0,1-.34.68,19.45,19.45,0,0,1-6.57,6.06,11.11,11.11,0,0,1-1.25-.81c-.34-.25-.66-.52-1-.8h0a22.83,22.83,0,0,1-2.76-3H2a18.68,18.68,0,0,0,5.76,5.29h0l0,0h0c3.49-1.63,7-5.73,7.49-7.18V8A5.85,5.85,0,0,0,16,5.35,3.81,3.81,0,0,0,12.58,1.51Z"/><path class="cls-2" d="M1.41,8l-.1-.15h0Z"/><path class="cls-2" d="M7.79,15.22v0h0Z"/><path class="cls-2" d="M7.76,15.23h0v0Z"/><path class="cls-2" d="M14.72,7.73l0,0a.13.13,0,0,0,0,0Z"/><path class="cls-3" d="M12.62,8.7v.12a.48.48,0,0,1-.48.48H8.66l0,.07L7.38,12.65h0A.72.72,0,0,1,6,12.53V9.44H6V6.6L5,9.05H5a.56.56,0,0,1-.52.37H.92V8.36H4.13l0-.07L5.41,5h0a.72.72,0,0,1,1.42.12V8.22h0v2.84L7.77,8.6h0a.56.56,0,0,1,.52-.37h3.84A.48.48,0,0,1,12.62,8.7Z"/><path class="cls-1" d="M12.62,8.7v.12a.48.48,0,0,1-.48.48H8.66l0,.07L7.38,12.65h0A.72.72,0,0,1,6,12.53V9.44H6V6.6L5,9.05H5a.56.56,0,0,1-.52.37H.92V8.36H4.13l0-.07L5.41,5h0a.72.72,0,0,1,1.42.12V8.22h0v2.84L7.77,8.6h0a.56.56,0,0,1,.52-.37h3.84A.48.48,0,0,1,12.62,8.7Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |