Compare commits

..

8 Commits

Author SHA1 Message Date
Karl Burtram
5fdb967ffc Enable visualizer recommendaton prompt in stable build (#6737) 2019-08-13 18:03:59 -07:00
Charles Gagnon
4a911b60f7 Bump required azdata engine version for schema compare (#6717) 2019-08-13 15:42:51 -07:00
Cory Rivera
3cc849a999 Correctly set focus on new Notebook cells after clicking on inline buttons. (#6708) 2019-08-13 15:41:41 -07:00
Alan Ren
1a5469b7a1 revert the icon (#6733) 2019-08-13 15:41:15 -07:00
Anthony Dresser
c042aacd17 add sanity check when adding tables to the results (#6714) 2019-08-13 15:40:53 -07:00
Charles Gagnon
9bd007a555 Fix resultSerializer to correctly check returned file picker path (#6713) 2019-08-13 15:40:20 -07:00
Kim Santiago
75b9ab643d fix default connection not always being correct (#6711) 2019-08-13 15:35:28 -07:00
Lucy Zhang
c4d3a90266 Fix Books Unit Tests (#6702)
* wait for all toc.yml to be found

* add event to signal all toc.yml files read

* add workspae folder parameter back

* remove toc filter
2019-08-13 15:34:48 -07:00
1526 changed files with 29911 additions and 59137 deletions

View File

@@ -1,61 +1,23 @@
{
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"name",
"prependLicenseText"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the dependency"
},
"fullLicenseText": {
"type": "array",
"description": "The complete license text of the dependency",
"items": {
"type": "string"
}
},
"prependLicenseText": {
"type": "array",
"description": "A piece of text to prepend to the auto-detected license text of the dependency",
"items": {
"type": "string"
}
}
}
"type": "object",
"required": [
"name",
"licenseDetail"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the dependency"
},
{
"type": "object",
"required": [
"name",
"fullLicenseText"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the dependency"
},
"fullLicenseText": {
"type": "array",
"description": "The complete license text of the dependency",
"items": {
"type": "string"
}
},
"prependLicenseText": {
"type": "array",
"description": "A piece of text to prepend to the auto-detected license text of the dependency",
"items": {
"type": "string"
}
}
"licenseDetail": {
"type": "array",
"description": "The complete license text of the dependency",
"items": {
"type": "string"
}
}
]
}
}
}
}

19
.vscode/tasks.json vendored
View File

@@ -42,20 +42,6 @@
"applyTo": "allDocuments"
}
},
{
"type": "npm",
"script": "strict-null-check-watch",
"label": "TS - Strict Null Cheks",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"problemMatcher": {
"base": "$tsc-watch",
"owner": "typescript-strict-null-checks",
"applyTo": "allDocuments"
}
},
{
"type": "gulp",
"task": "tslint",
@@ -95,7 +81,6 @@
"type": "gulp",
"task": "hygiene",
"problemMatcher": []
},
}
]
}
}

View File

@@ -1,3 +1,3 @@
disturl "https://atom.io/download/electron"
target "4.2.9"
target "4.2.7"
runtime "electron"

View File

@@ -1,21 +1,5 @@
# Change Log
## Version 1.10.0
* Release date: August 14, 2019
* Release status: General Availability
## What's new in this version
* [SandDance](https://github.com/microsoft/SandDance) integration — A new way to interact with data. Download the extension [here](https://docs.microsoft.com/sql/azure-data-studio/sanddance-extension)
* Notebook improvements
* Better loading performance
* Ability to right click SQL results grid to save your results as CSV, JSON, etc.
* Buttons to add code or text cells in-line
* [Other fixes and improvements](https://github.com/microsoft/azuredatastudio/issues?q=is%3Aissue+label%3A%22Area%3A+Notebooks%22+milestone%3A%22August+2019+Release%22+is%3Aclosed)
* SQL Server Dacpac extension can support Azure Active Directory authentication
* Updated SQL Server 2019 extension
* Visual Studio Code May Release Merge 1.37 - this includes changes from [1.36](https://code.visualstudio.com/updates/v1_37) and [1.37](https://code.visualstudio.com/updates/v1_37)
* Resolved [bugs and issues](https://github.com/microsoft/azuredatastudio/milestone/39?closed=1).
## Version 1.9.0
* Release date: July 11, 2019
* Release status: General Availability

View File

@@ -1,7 +1,7 @@
# Azure Data Studio
[![Join the chat at https://gitter.im/Microsoft/sqlopsstudio](https://badges.gitter.im/Microsoft/sqlopsstudio.svg)](https://gitter.im/Microsoft/sqlopsstudio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://dev.azure.com/azuredatastudio/azuredatastudio/_apis/build/status/Azure%20Data%20Studio%20CI?branchName=master)](https://dev.azure.com/azuredatastudio/azuredatastudio/_build/latest?definitionId=4&branchName=master)
[![Build Status](https://dev.azure.com/ms/azuredatastudio/_apis/build/status/Microsoft.azuredatastudio)](https://dev.azure.com/ms/azuredatastudio/_build/latest?definitionId=4)
Azure Data 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.
@@ -9,13 +9,13 @@ Azure Data Studio is a data management tool that enables you to work with SQL Se
Platform | Link
-- | --
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2100710
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2100711
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2100712
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2100809
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2100714
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2100810
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2100672
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2098449
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2098450
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2098500
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2098501
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2098197
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2098280
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2098279
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.

View File

@@ -1,84 +1,66 @@
steps:
- script: |
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:10
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults
sudo service xvfb start
sudo apt-get install -y libkrb5-dev
# sh -e /etc/init.d/xvfb start
# sleep 3
displayName: "Linux preinstall"
condition: eq(variables['Agent.OS'], 'Linux')
- task: NodeTool@0
inputs:
versionSpec: '10.15.1'
displayName: 'Install Node.js'
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- script: |
npm i -g yarn
displayName: 'preinstall'
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: ".yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
vstsFeed: "$(build-cache)"
- script: |
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:10
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults
sudo service xvfb start
# sh -e /etc/init.d/xvfb start
# sleep 3
displayName: 'Linux preinstall'
condition: eq(variables['Agent.OS'], 'Linux')
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
inputs:
versionSpec: "1.10.1"
- script: |
yarn
displayName: 'Install'
- script: |
yarn --frozen-lockfile
displayName: Install Dependencies
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
- script: |
yarn gulp electron-x64
displayName: Download Electron
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: ".yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
vstsFeed: "$(build-cache)"
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn gulp hygiene
displayName: Run Hygiene Checks
- script: |
yarn gulp electron-x64
displayName: Download Electron
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
- script: |
yarn tslint
displayName: 'Run TSLint'
- script: |
yarn gulp hygiene
displayName: Run Hygiene Checks
# - script: |
# yarn strict-null-check
# displayName: 'Run Strict Null Check'
- script: |
yarn tslint
displayName: "Run TSLint"
- script: |
yarn compile
displayName: 'Compile'
- script: |
yarn strict-null-check
displayName: "Run Strict Null Check"
- script: |
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
displayName: 'Tests'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- script: |
yarn compile
displayName: "Compile"
- script: |
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter --coverage
displayName: 'Tests'
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
- script: |
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
displayName: "Tests"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
condition: succeededOrFailed()
- script: |
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter --coverage
displayName: "Tests"
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/test-results.xml"
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: "cobertura"
summaryFileLocation: $(System.DefaultWorkingDirectory)/.build/coverage/cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)/.build/coverage/lcov-reports
condition: ne(variables['Agent.OS'], 'Linux')
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: $(System.DefaultWorkingDirectory)/.build/coverage/cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)/.build/coverage/lcov-reports
condition: ne(variables['Agent.OS'], 'Linux')

View File

@@ -1,65 +1,44 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: NodeTool@0
inputs:
versionSpec: '10.15.1'
displayName: 'Install Node.js'
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: ".yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
vstsFeed: "$(build-cache)"
- script: |
yarn
displayName: 'Yarn Install'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
inputs:
versionSpec: "1.10.1"
- script: |
yarn gulp electron-x64
displayName: 'Electron'
- script: |
yarn --frozen-lockfile
displayName: Install Dependencies
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
- script: |
yarn gulp hygiene
displayName: Run Hygiene Checks
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: ".yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
vstsFeed: "$(build-cache)"
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn tslint
displayName: 'Run TSLint'
- script: |
yarn gulp electron-x64
displayName: "Electron"
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
# - script: |
# yarn strict-null-check
# displayName: 'Run Strict Null Check'
- script: |
yarn gulp hygiene
displayName: Run Hygiene Checks
- script: |
yarn compile
displayName: 'Compile'
- script: |
yarn tslint
displayName: "Run TSLint"
- script: |
.\scripts\test.bat --reporter mocha-junit-reporter --coverage
displayName: 'Test'
- script: |
yarn strict-null-check
displayName: "Run Strict Null Check"
- task: PublishTestResults@2
inputs:
testResultsFiles: 'test-results.xml'
condition: succeededOrFailed()
- script: |
yarn compile
displayName: "Compile"
- script: |
.\scripts\test.bat --reporter mocha-junit-reporter --coverage
displayName: "Test"
- task: PublishTestResults@2
inputs:
testResultsFiles: "test-results.xml"
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: "cobertura"
summaryFileLocation: $(System.DefaultWorkingDirectory)\.build\coverage\cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)\.build\coverage\lcov-report
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: $(System.DefaultWorkingDirectory)\.build\coverage\cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)\.build\coverage\lcov-report

View File

@@ -1,22 +1,29 @@
trigger:
- master
- release/*
- master
- releases/*
jobs:
- job: Windows
pool:
vmImage: VS2017-Win2016
steps:
- template: azure-pipelines-windows.yml
- job: Linux
pool:
vmImage: "Ubuntu-16.04"
steps:
- template: azure-pipelines-linux-mac.yml
# All tasks on Windows
- job: build_all_windows
displayName: Build all tasks (Windows)
pool:
vmImage: vs2017-win2016
steps:
- template: azure-pipelines-windows.yml
- job: macOS
pool:
vmImage: macOS 10.13
steps:
- template: azure-pipelines-linux-mac.yml
# All tasks on Linux
- job: build_all_linux
displayName: Build all tasks (Linux)
pool:
vmImage: 'Ubuntu 16.04'
steps:
- template: azure-pipelines-linux-mac.yml
# All tasks on macOS
- job: build_all_darwin
displayName: Build all tasks (macOS)
pool:
vmImage: macos-10.13
steps:
- template: azure-pipelines-linux-mac.yml

View File

@@ -2,12 +2,11 @@ steps:
- script: |
mkdir -p .build
echo -n $BUILD_SOURCEVERSION > .build/commit
echo -n $VSCODE_QUALITY > .build/quality
displayName: Prepare cache flag
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: 'build/.cachesalt, .build/commit, .build/quality'
keyfile: 'build/.cachesalt, .build/commit'
targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
vstsFeed: 'npm-vscode'
platformIndependent: true
@@ -107,26 +106,6 @@ steps:
displayName: Run integration tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
cd test/smoke
yarn compile
cd -
yarn smoketest --web --headless
continueOnError: true
displayName: Run web smoke tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
cd test/smoke
yarn compile
cd -
yarn smoketest --web --headless
continueOnError: true
displayName: Run smoke tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd

View File

@@ -1,43 +0,0 @@
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'vscode-builds-subscription'
KeyVaultName: vscode
- script: |
set -e
cat << EOF > ~/.netrc
machine github.com
login vscode
password $(github-distro-mixin-password)
EOF
git config user.email "vscode@microsoft.com"
git config user.name "VSCode"
git checkout origin/electron-6.0.x
git merge origin/master
# Push master branch into exploration branch
git push origin HEAD:electron-6.0.x
displayName: Sync & Merge Exploration
trigger: none
pr: none
schedules:
- cron: "0 5 * * Mon-Fri"
displayName: Mon-Fri at 7:00
branches:
include:
- master

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
set -e
echo 'noop'

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
set -e
echo 'noop'

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
set -e
echo 'noop'

View File

@@ -2,12 +2,11 @@ steps:
- script: |
mkdir -p .build
echo -n $BUILD_SOURCEVERSION > .build/commit
echo -n $VSCODE_QUALITY > .build/quality
displayName: Prepare cache flag
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: 'build/.cachesalt, .build/commit, .build/quality'
keyfile: 'build/.cachesalt, .build/commit'
targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
vstsFeed: 'npm-vscode'
platformIndependent: true
@@ -113,4 +112,4 @@ steps:
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
continueOnError: true
continueOnError: true

View File

@@ -2,12 +2,11 @@ steps:
- script: |
mkdir -p .build
echo -n $BUILD_SOURCEVERSION > .build/commit
echo -n $VSCODE_QUALITY > .build/quality
displayName: Prepare cache flag
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: 'build/.cachesalt, .build/commit, .build/quality'
keyfile: 'build/.cachesalt, .build/commit'
targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
vstsFeed: 'npm-vscode'
platformIndependent: true

View File

@@ -66,17 +66,6 @@ jobs:
steps:
- template: linux/product-build-linux-multiarch.yml
- job: LinuxArm64
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ARM64'], 'true'), ne(variables['VSCODE_QUALITY'], 'stable'))
pool:
vmImage: 'Ubuntu-16.04'
variables:
VSCODE_ARCH: arm64
dependsOn:
- Compile
steps:
- template: linux/product-build-linux-multiarch.yml
- job: LinuxAlpine
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ALPINE'], 'true'), ne(variables['VSCODE_QUALITY'], 'stable'))
pool:
@@ -139,9 +128,6 @@ jobs:
steps:
- template: sync-mooncake.yml
trigger: none
pr: none
schedules:
- cron: "0 5 * * Mon-Fri"
displayName: Mon-Fri at 7:00

View File

@@ -2,12 +2,11 @@ steps:
- script: |
mkdir -p .build
echo -n $BUILD_SOURCEVERSION > .build/commit
echo -n $VSCODE_QUALITY > .build/quality
displayName: Prepare cache flag
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: 'build/.cachesalt, .build/commit, .build/quality'
keyfile: 'build/.cachesalt, .build/commit'
targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
vstsFeed: 'npm-vscode'
platformIndependent: true
@@ -117,9 +116,9 @@ steps:
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
inputs:
keyfile: 'build/.cachesalt, .build/commit, .build/quality'
keyfile: 'build/.cachesalt, .build/commit'
targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
vstsFeed: 'npm-vscode'
platformIndependent: true
alias: 'Compilation'
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))

View File

@@ -13,37 +13,19 @@ const util = require('../lib/util');
const root = path.dirname(path.dirname(__dirname));
const commit = util.getVersion(root);
// optionally allow to pass in explicit base/maps to upload
const [, , base, maps] = process.argv;
const fetch = function (base, maps = `${base}/**/*.map`) {
return vfs.src(maps, { base })
function main() {
const vs = vfs.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' }) // client source-maps only
.pipe(es.mapSync(f => {
f.path = `${f.base}/core/${f.relative}`;
return f;
}));
};
function main() {
const sources = [];
const extensionsOut = vfs.src(['.build/extensions/**/*.js.map', '!**/node_modules/**'], { base: '.build' });
// vscode client maps (default)
if (!base) {
const vs = fetch('out-vscode-min'); // client source-maps only
sources.push(vs);
const extensionsOut = vfs.src(['.build/extensions/**/*.js.map', '!**/node_modules/**'], { base: '.build' });
sources.push(extensionsOut);
}
// specific client base/maps
else {
sources.push(fetch(base, maps));
}
return es.merge(...sources)
return es.merge(vs, extensionsOut)
.pipe(es.through(function (data) {
console.log('Uploading Sourcemap', data.relative); // debug
// debug
console.log('Uploading Sourcemap', data.relative);
this.emit('data', data);
}))
.pipe(azure.upload({
@@ -54,4 +36,4 @@ function main() {
}));
}
main();
main();

View File

@@ -2,12 +2,11 @@ steps:
- script: |
mkdir -p .build
echo -n $BUILD_SOURCEVERSION > .build/commit
echo -n $VSCODE_QUALITY > .build/quality
displayName: Prepare cache flag
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: 'build/.cachesalt, .build/commit, .build/quality'
keyfile: 'build/.cachesalt, .build/commit'
targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
vstsFeed: 'npm-vscode'
platformIndependent: true
@@ -88,15 +87,6 @@ steps:
yarn gulp vscode-web-min-ci
displayName: Build
# upload only the workbench.web.api.js source maps because
# we just compiled these bits in the previous step and the
# general task to upload source maps has already been run
- script: |
set -e
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
node build/azure-pipelines/upload-sourcemaps out-vscode-web-min out-vscode-web-min/vs/workbench/workbench.web.api.js.map
displayName: Upload sourcemaps (Web)
- script: |
set -e
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \

View File

@@ -2,12 +2,11 @@ steps:
- powershell: |
mkdir .build -ea 0
"$env:BUILD_SOURCEVERSION" | Out-File -Encoding ascii -NoNewLine .build\commit
"$env:VSCODE_QUALITY" | Out-File -Encoding ascii -NoNewLine .build\quality
displayName: Prepare cache flag
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
inputs:
keyfile: 'build/.cachesalt, .build/commit, .build/quality'
keyfile: 'build/.cachesalt, .build/commit'
targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
vstsFeed: 'npm-vscode'
platformIndependent: true

View File

@@ -1,7 +1,7 @@
[
{
"name": "Microsoft.sqlservernotebook",
"version": "0.2.1",
"version": "0.1.2",
"repo": "https://github.com/Microsoft/azuredatastudio"
}
]

View File

@@ -50,7 +50,6 @@ const indentationFilter = [
'!src/vs/css.js',
'!src/vs/css.build.js',
'!src/vs/loader.js',
'!src/vs/base/common/insane/insane.js',
'!src/vs/base/common/marked/marked.js',
'!src/vs/base/node/terminateProcess.sh',
'!src/vs/base/node/cpuUsage.sh',
@@ -65,7 +64,6 @@ const indentationFilter = [
// except multiple specific files
'!**/package.json',
'!**/package-lock.json', // {{SQL CARBON EDIT}}
'!**/yarn.lock',
'!**/yarn-error.log',
@@ -136,9 +134,9 @@ const copyrightFilter = [
'!extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts',
'!src/sql/workbench/parts/notebook/browser/outputs/tableRenderers.ts',
'!src/sql/workbench/parts/notebook/common/models/url.ts',
'!src/sql/workbench/parts/notebook/browser/models/renderMimeInterfaces.ts',
'!src/sql/workbench/parts/notebook/browser/models/outputProcessor.ts',
'!src/sql/workbench/parts/notebook/browser/models/mimemodel.ts',
'!src/sql/workbench/parts/notebook/common/models/renderMimeInterfaces.ts',
'!src/sql/workbench/parts/notebook/common/models/outputProcessor.ts',
'!src/sql/workbench/parts/notebook/common/models/mimemodel.ts',
'!src/sql/workbench/parts/notebook/browser/cellViews/media/*.css',
'!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/rowDetailView.ts',
@@ -159,7 +157,6 @@ const copyrightFilter = [
'!extensions/notebook/src/prompts/**',
'!extensions/mssql/src/prompts/**',
'!extensions/notebook/resources/jupyter_config/**',
'!extensions/query-history/images/**',
'!**/*.gif',
'!**/*.xlf',
'!**/*.dacpac',
@@ -174,16 +171,18 @@ const eslintFilter = [
'!src/vs/nls.js',
'!src/vs/css.build.js',
'!src/vs/nls.build.js',
'!src/**/insane.js',
'!src/**/marked.js',
'!**/test/**'
];
const tslintBaseFilter = [
const tslintFilter = [
'src/**/*.ts',
'test/**/*.ts',
'extensions/**/*.ts',
'!**/fixtures/**',
'!**/typings/**',
'!**/node_modules/**',
'!extensions/typescript-basics/test/colorize-fixtures/**',
'!extensions/typescript/test/colorize-fixtures/**',
'!extensions/vscode-api-tests/testWorkspace/**',
'!extensions/vscode-api-tests/testWorkspace2/**',
'!extensions/**/*.test.ts',
@@ -202,29 +201,6 @@ const sqlFilter = [
];
// {{SQL CARBON EDIT}}
const tslintCoreFilter = [
'src/**/*.ts',
'test/**/*.ts',
'!extensions/**/*.ts',
'!test/smoke/**',
...tslintBaseFilter
];
const tslintExtensionsFilter = [
'extensions/**/*.ts',
'!src/**/*.ts',
'!test/**/*.ts',
...tslintBaseFilter
];
const tslintHygieneFilter = [
'src/**/*.ts',
'test/**/*.ts',
'extensions/**/*.ts',
...tslintBaseFilter
];
const copyrightHeaderLines = [
'/*---------------------------------------------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.',
@@ -241,20 +217,12 @@ gulp.task('eslint', () => {
});
gulp.task('tslint', () => {
return es.merge([
const options = { emitError: true };
// Core: include type information (required by certain rules like no-nodejs-globals)
vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintCoreFilter))
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint', program: tslint.Linter.createProgram('src/tsconfig.json') }))
.pipe(gulptslint.default.report({ emitError: true })),
// Exenstions: do not include type information
vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintExtensionsFilter))
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
.pipe(gulptslint.default.report({ emitError: true }))
]).pipe(es.through());
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintFilter))
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
.pipe(gulptslint.default.report(options));
});
function hygiene(some) {
@@ -395,7 +363,7 @@ function hygiene(some) {
.pipe(copyrights);
const typescript = result
.pipe(filter(tslintHygieneFilter))
.pipe(filter(tslintFilter))
.pipe(formatting)
.pipe(tsl)
// {{SQL CARBON EDIT}}

View File

@@ -31,7 +31,6 @@ const BUILD_TARGETS = [
{ platform: 'linux', arch: 'ia32', pkgTarget: 'node8-linux-x86' },
{ platform: 'linux', arch: 'x64', pkgTarget: 'node8-linux-x64' },
{ platform: 'linux', arch: 'armhf', pkgTarget: 'node8-linux-armv7' },
{ platform: 'linux', arch: 'arm64', pkgTarget: 'node8-linux-arm64' },
{ platform: 'linux', arch: 'alpine', pkgTarget: 'node8-linux-alpine' },
];
@@ -42,7 +41,6 @@ gulp.task('vscode-reh-win32-x64-min', noop);
gulp.task('vscode-reh-darwin-min', noop);
gulp.task('vscode-reh-linux-x64-min', noop);
gulp.task('vscode-reh-linux-armhf-min', noop);
gulp.task('vscode-reh-linux-arm64-min', noop);
gulp.task('vscode-reh-linux-alpine-min', noop);
gulp.task('vscode-reh-web-win32-ia32-min', noop);

View File

@@ -58,7 +58,7 @@ const nodeModules = [
// Build
const vscodeEntryPoints = _.flatten([
buildfile.entrypoint('vs/workbench/workbench.desktop.main'),
buildfile.entrypoint('vs/workbench/workbench.main'),
buildfile.base,
buildfile.serviceWorker,
buildfile.workbench,
@@ -255,8 +255,8 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
const out = sourceFolderName;
const checksums = computeChecksums(out, [
'vs/workbench/workbench.desktop.main.js',
'vs/workbench/workbench.desktop.main.css',
'vs/workbench/workbench.main.js',
'vs/workbench/workbench.main.css',
'vs/code/electron-browser/workbench/workbench.html',
'vs/code/electron-browser/workbench/workbench.js'
]);
@@ -353,15 +353,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
if (platform === 'linux') {
result = es.merge(result, gulp.src('resources/completions/bash/code', { base: '.' })
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(function (f) { f.basename = product.applicationName; })));
result = es.merge(result, gulp.src('resources/completions/zsh/_code', { base: '.' })
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(function (f) { f.basename = '_' + product.applicationName; })));
}
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
if (platform === 'win32') {
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));

View File

@@ -55,13 +55,11 @@ function prepareDebPackage(arch) {
const icon = gulp.src('resources/linux/code.png', { base: '.' })
.pipe(rename('usr/share/pixmaps/' + product.linuxIconName + '.png'));
const bash_completion = gulp.src('resources/completions/bash/code')
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename('usr/share/bash-completion/completions/' + product.applicationName));
// const bash_completion = gulp.src('resources/completions/bash/code')
// .pipe(rename('usr/share/bash-completion/completions/code'));
const zsh_completion = gulp.src('resources/completions/zsh/_code')
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename('usr/share/zsh/vendor-completions/_' + product.applicationName));
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
// .pipe(rename('usr/share/zsh/vendor-completions/_code'));
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
.pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
@@ -97,7 +95,7 @@ function prepareDebPackage(arch) {
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
.pipe(rename('DEBIAN/postinst'));
const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, bash_completion, zsh_completion, code);
const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, /* bash_completion, zsh_completion, */ code);
return all.pipe(vfs.dest(destination));
};
@@ -148,13 +146,11 @@ function prepareRpmPackage(arch) {
const icon = gulp.src('resources/linux/code.png', { base: '.' })
.pipe(rename('BUILD/usr/share/pixmaps/' + product.linuxIconName + '.png'));
const bash_completion = gulp.src('resources/completions/bash/code')
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename('BUILD/usr/share/bash-completion/completions/' + product.applicationName));
// const bash_completion = gulp.src('resources/completions/bash/code')
// .pipe(rename('BUILD/usr/share/bash-completion/completions/code'));
const zsh_completion = gulp.src('resources/completions/zsh/_code')
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename('BUILD/usr/share/zsh/site-functions/_' + product.applicationName));
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
// .pipe(rename('BUILD/usr/share/zsh/site-functions/_code'));
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
.pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; }));
@@ -177,7 +173,7 @@ function prepareRpmPackage(arch) {
const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' })
.pipe(rename('SOURCES/' + product.applicationName + '.xpm'));
const all = es.merge(code, desktops, appdata, icon, bash_completion, zsh_completion, spec, specIcon);
const all = es.merge(code, desktops, appdata, icon, /* bash_completion, zsh_completion, */ spec, specIcon);
return all.pipe(vfs.dest(getRpmBuildPath(rpmArch)));
};

View File

@@ -41,9 +41,6 @@ const vscodeWebResources = [
// Webview
'out-build/vs/workbench/contrib/webview/browser/pre/*.js',
// Extension Worker
'out-build/vs/workbench/services/extensions/worker/extensionHostWorkerMain.js',
// Excludes
'!out-build/vs/**/{node,electron-browser,electron-main}/**',
'!out-build/vs/editor/standalone/**',
@@ -56,7 +53,6 @@ const buildfile = require('../src/buildfile');
const vscodeWebEntryPoints = [
buildfile.workbenchWeb,
buildfile.serviceWorker,
buildfile.workerExtensionHost,
buildfile.keyboardMaps,
buildfile.base
];
@@ -152,4 +148,4 @@ const dashed = (str) => (str ? `-${str}` : ``);
vscodeWebTaskCI
));
gulp.task(vscodeWebTask);
});
});

View File

@@ -29,18 +29,12 @@ const commit = util.getVersion(root);
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
function fromLocal(extensionPath) {
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
const input = fs.existsSync(webpackFilename)
? fromLocalWebpack(extensionPath)
: fromLocalNormal(extensionPath);
const tmLanguageJsonFilter = filter('**/*.tmLanguage.json', { restore: true });
return input
.pipe(tmLanguageJsonFilter)
.pipe(buffer())
.pipe(es.mapSync((f) => {
f.contents = Buffer.from(JSON.stringify(JSON.parse(f.contents.toString('utf8'))));
return f;
}))
.pipe(tmLanguageJsonFilter.restore);
if (fs.existsSync(webpackFilename)) {
return fromLocalWebpack(extensionPath);
}
else {
return fromLocalNormal(extensionPath);
}
}
function fromLocalWebpack(extensionPath) {
const result = es.through();
@@ -199,8 +193,7 @@ const sqlBuiltInExtensions = [
'admin-pack',
'dacpac',
'schema-compare',
'cms',
'query-history'
'cms'
];
// make resource deployment and BDC extension only available in insiders
if (process.env['VSCODE_QUALITY'] === 'stable') {

View File

@@ -30,20 +30,11 @@ const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${
function fromLocal(extensionPath: string): Stream {
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
const input = fs.existsSync(webpackFilename)
? fromLocalWebpack(extensionPath)
: fromLocalNormal(extensionPath);
const tmLanguageJsonFilter = filter('**/*.tmLanguage.json', { restore: true });
return input
.pipe(tmLanguageJsonFilter)
.pipe(buffer())
.pipe(es.mapSync((f: File) => {
f.contents = Buffer.from(JSON.stringify(JSON.parse(f.contents.toString('utf8'))));
return f;
}))
.pipe(tmLanguageJsonFilter.restore);
if (fs.existsSync(webpackFilename)) {
return fromLocalWebpack(extensionPath);
} else {
return fromLocalNormal(extensionPath);
}
}
function fromLocalWebpack(extensionPath: string): Stream {
@@ -235,8 +226,7 @@ const sqlBuiltInExtensions = [
'admin-pack',
'dacpac',
'schema-compare',
'cms',
'query-history'
'cms'
];
// make resource deployment and BDC extension only available in insiders

View File

@@ -269,10 +269,6 @@
{
"name": "vs/workbench/services/preferences",
"project": "vscode-preferences"
},
{
"name": "vs/workbench/services/notification",
"project": "vscode-workbench"
}
]
}

View File

@@ -1,45 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const Lint = require("tslint");
class AbstractGlobalsRuleWalker extends Lint.RuleWalker {
constructor(file, program, opts, _config) {
super(file, opts);
this.program = program;
this._config = _config;
}
visitIdentifier(node) {
if (this.getDisallowedGlobals().some(disallowedGlobal => disallowedGlobal === node.text)) {
if (this._config.allowed && this._config.allowed.some(allowed => allowed === node.text)) {
return; // override
}
const checker = this.program.getTypeChecker();
const symbol = checker.getSymbolAtLocation(node);
if (symbol) {
const declarations = symbol.declarations;
if (Array.isArray(declarations) && symbol.declarations.some(declaration => {
if (declaration) {
const parent = declaration.parent;
if (parent) {
const sourceFile = parent.getSourceFile();
if (sourceFile) {
const fileName = sourceFile.fileName;
if (fileName && fileName.indexOf(this.getDefinitionPattern()) >= 0) {
return true;
}
}
}
}
return false;
})) {
this.addFailureAtNode(node, `Cannot use global '${node.text}' in '${this._config.target}'`);
}
}
}
super.visitIdentifier(node);
}
}
exports.AbstractGlobalsRuleWalker = AbstractGlobalsRuleWalker;

View File

@@ -1,57 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import * as Lint from 'tslint';
interface AbstractGlobalsRuleConfig {
target: string;
allowed: string[];
}
export abstract class AbstractGlobalsRuleWalker extends Lint.RuleWalker {
constructor(file: ts.SourceFile, private program: ts.Program, opts: Lint.IOptions, private _config: AbstractGlobalsRuleConfig) {
super(file, opts);
}
protected abstract getDisallowedGlobals(): string[];
protected abstract getDefinitionPattern(): string;
visitIdentifier(node: ts.Identifier) {
if (this.getDisallowedGlobals().some(disallowedGlobal => disallowedGlobal === node.text)) {
if (this._config.allowed && this._config.allowed.some(allowed => allowed === node.text)) {
return; // override
}
const checker = this.program.getTypeChecker();
const symbol = checker.getSymbolAtLocation(node);
if (symbol) {
const declarations = symbol.declarations;
if (Array.isArray(declarations) && symbol.declarations.some(declaration => {
if (declaration) {
const parent = declaration.parent;
if (parent) {
const sourceFile = parent.getSourceFile();
if (sourceFile) {
const fileName = sourceFile.fileName;
if (fileName && fileName.indexOf(this.getDefinitionPattern()) >= 0) {
return true;
}
}
}
}
return false;
})) {
this.addFailureAtNode(node, `Cannot use global '${node.text}' in '${this._config.target}'`);
}
}
}
super.visitIdentifier(node);
}
}

View File

@@ -1,34 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const Lint = require("tslint");
const minimatch = require("minimatch");
const abstractGlobalsRule_1 = require("./abstractGlobalsRule");
class Rule extends Lint.Rules.TypedRule {
applyWithProgram(sourceFile, program) {
const configs = this.getOptions().ruleArguments;
for (const config of configs) {
if (minimatch(sourceFile.fileName, config.target)) {
return this.applyWithWalker(new NoDOMGlobalsRuleWalker(sourceFile, program, this.getOptions(), config));
}
}
return [];
}
}
exports.Rule = Rule;
class NoDOMGlobalsRuleWalker extends abstractGlobalsRule_1.AbstractGlobalsRuleWalker {
getDefinitionPattern() {
return 'lib.dom.d.ts';
}
getDisallowedGlobals() {
// intentionally not complete
return [
"window",
"document",
"HTMLElement"
];
}
}

View File

@@ -1,45 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import * as Lint from 'tslint';
import * as minimatch from 'minimatch';
import { AbstractGlobalsRuleWalker } from './abstractGlobalsRule';
interface NoDOMGlobalsRuleConfig {
target: string;
allowed: string[];
}
export class Rule extends Lint.Rules.TypedRule {
applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program): Lint.RuleFailure[] {
const configs = <NoDOMGlobalsRuleConfig[]>this.getOptions().ruleArguments;
for (const config of configs) {
if (minimatch(sourceFile.fileName, config.target)) {
return this.applyWithWalker(new NoDOMGlobalsRuleWalker(sourceFile, program, this.getOptions(), config));
}
}
return [];
}
}
class NoDOMGlobalsRuleWalker extends AbstractGlobalsRuleWalker {
getDefinitionPattern(): string {
return 'lib.dom.d.ts';
}
getDisallowedGlobals(): string[] {
// intentionally not complete
return [
"window",
"document",
"HTMLElement"
];
}
}

View File

@@ -1,41 +0,0 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const Lint = require("tslint");
const minimatch = require("minimatch");
const abstractGlobalsRule_1 = require("./abstractGlobalsRule");
class Rule extends Lint.Rules.TypedRule {
applyWithProgram(sourceFile, program) {
const configs = this.getOptions().ruleArguments;
for (const config of configs) {
if (minimatch(sourceFile.fileName, config.target)) {
return this.applyWithWalker(new NoNodejsGlobalsRuleWalker(sourceFile, program, this.getOptions(), config));
}
}
return [];
}
}
exports.Rule = Rule;
class NoNodejsGlobalsRuleWalker extends abstractGlobalsRule_1.AbstractGlobalsRuleWalker {
getDefinitionPattern() {
return '@types/node';
}
getDisallowedGlobals() {
// https://nodejs.org/api/globals.html#globals_global_objects
return [
"NodeJS",
"Buffer",
"__dirname",
"__filename",
"clearImmediate",
"exports",
"global",
"module",
"process",
"setImmediate"
];
}
}

View File

@@ -1,52 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import * as Lint from 'tslint';
import * as minimatch from 'minimatch';
import { AbstractGlobalsRuleWalker } from './abstractGlobalsRule';
interface NoNodejsGlobalsConfig {
target: string;
allowed: string[];
}
export class Rule extends Lint.Rules.TypedRule {
applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program): Lint.RuleFailure[] {
const configs = <NoNodejsGlobalsConfig[]>this.getOptions().ruleArguments;
for (const config of configs) {
if (minimatch(sourceFile.fileName, config.target)) {
return this.applyWithWalker(new NoNodejsGlobalsRuleWalker(sourceFile, program, this.getOptions(), config));
}
}
return [];
}
}
class NoNodejsGlobalsRuleWalker extends AbstractGlobalsRuleWalker {
getDefinitionPattern(): string {
return '@types/node';
}
getDisallowedGlobals(): string[] {
// https://nodejs.org/api/globals.html#globals_global_objects
return [
"NodeJS",
"Buffer",
"__dirname",
"__filename",
"clearImmediate",
"exports",
"global",
"module",
"process",
"setImmediate"
];
}
}

View File

@@ -78,42 +78,4 @@ const processTreeDts = path.join('node_modules', 'windows-process-tree', 'typing
if (fs.existsSync(processTreeDts)) {
console.log('Removing windows-process-tree.d.ts');
fs.unlinkSync(processTreeDts);
}
function getInstalledVersion(packageName, cwd) {
const opts = {};
if (cwd) {
opts.cwd = cwd;
}
const result = cp.spawnSync(yarn, ['list', '--pattern', packageName], opts);
const stdout = result.stdout.toString();
const match = stdout.match(new RegExp(packageName + '@(\\S+)'));
if (!match || !match[1]) {
throw new Error('Unexpected output from yarn list: ' + stdout);
}
return match[1];
}
function assertSameVersionsBetweenFolders(packageName, otherFolder) {
const baseVersion = getInstalledVersion(packageName);
const otherVersion = getInstalledVersion(packageName, otherFolder);
if (baseVersion !== otherVersion) {
throw new Error(`Mismatched versions installed for ${packageName}: root has ${baseVersion}, ./${otherFolder} has ${otherVersion}. These should be the same!`);
}
}
// Check that modules in both the base package.json and remote/ have the same version installed
const requireSameVersionsInRemote = [
'xterm',
'xterm-addon-search',
'xterm-addon-web-links',
'node-pty',
'vscode-ripgrep'
];
requireSameVersionsInRemote.forEach(packageName => {
assertSameVersionsBetweenFolders(packageName, 'remote');
});
}

View File

@@ -132,7 +132,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas
if (packageJsonPathOverride) {
packageJsonPath += packageJsonPathOverride;
}
packageJsonPath += 'package.json';
packageJsonPath += '/package.json';
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;

View File

@@ -41,10 +41,10 @@
"minimist": "^1.2.0",
"request": "^2.85.0",
"tslint": "^5.9.1",
"service-downloader": "github:anthonydresser/service-downloader#0.1.7",
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
"typescript": "3.5.2",
"vsce": "1.48.0",
"vscode-telemetry-extractor": "^1.5.4",
"vscode-telemetry-extractor": "1.5.3",
"xml2js": "^0.4.17"
},
"scripts": {

View File

@@ -20,8 +20,8 @@ Compression=lzma
SolidCompression=yes
AppMutex={code:GetAppMutex}
SetupMutex={#AppMutex}setup
WizardImageFile="{#RepoDir}\resources\win32\sql-big.bmp"
WizardSmallImageFile="{#RepoDir}\resources\win32\sql-small.bmp"
WizardImageFile={#RepoDir}\resources\win32\inno-big.bmp
WizardSmallImageFile={#RepoDir}\resources\win32\inno-small.bmp
SetupIconFile={#RepoDir}\resources\win32\code.ico
UninstallDisplayIcon={app}\{#ExeBasename}.exe
ChangesEnvironment=true
@@ -100,22 +100,12 @@ Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}Source
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}SourceFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Tasks: addtopath; Check: NeedsAddPath(ExpandConstant('{app}\bin'))
; .sql
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\.sql\OpenWithProgids"; ValueType: none; ValueName: "{#RegValueName}"; Flags: deletevalue uninsdeletevalue; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\.sql\OpenWithProgids"; ValueType: string; ValueName: "{#RegValueName}.sql"; ValueData: ""; Flags: uninsdeletevalue; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.sql"; ValueType: string; ValueName: ""; ValueData: "{cm:SourceFile,SQL}"; Flags: uninsdeletekey; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.sql"; ValueType: string; ValueName: "AppUserModelID"; ValueData: "{#AppUserId}"; Flags: uninsdeletekey; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.sql\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\sql.ico"; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.sql\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""; Tasks: associatewithfiles
; .ipynb
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\.ipynb\OpenWithProgids"; ValueType: none; ValueName: "{#RegValueName}"; Flags: deletevalue uninsdeletevalue; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\.ipynb\OpenWithProgids"; ValueType: string; ValueName: "{#RegValueName}.ipynb"; ValueData: ""; Flags: uninsdeletevalue; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.ipynb"; ValueType: string; ValueName: ""; ValueData: "{cm:SourceFile,IPYNB}"; Flags: uninsdeletekey; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.ipynb"; ValueType: string; ValueName: "AppUserModelID"; ValueData: "{#AppUserId}"; Flags: uninsdeletekey; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.ipynb\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\ipynb.ico"; Tasks: associatewithfiles
Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\{#RegValueName}.ipynb\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""; Tasks: associatewithfiles
; Environment
#if "user" == InstallTarget
#define EnvironmentRootKey "HKCU"

View File

@@ -485,13 +485,6 @@ async-each@^1.0.1:
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.2.tgz#8b8a7ca2a658f927e9f307d6d1a42f4199f0f735"
integrity sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==
async-retry@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.2.3.tgz#a6521f338358d322b1a0012b79030c6f411d1ce0"
integrity sha512-tfDb02Th6CE6pJUF2gjW5ZVjsgwlucVXOEQMvEX9JgSJMs9gAX+Nz3xRuJBKuUYjTSYORqvDBORdAQ3LU59g7Q==
dependencies:
retry "0.12.0"
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@@ -2990,11 +2983,6 @@ ret@~0.1.10:
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
retry@0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b"
integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=
reusify@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
@@ -3061,11 +3049,10 @@ semver@^5.1.0, semver@^5.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==
"service-downloader@github:anthonydresser/service-downloader#0.1.7":
version "0.1.7"
resolved "https://codeload.github.com/anthonydresser/service-downloader/tar.gz/c08de456c9f1af6258061fdc524275b21c6db667"
"service-downloader@github:anthonydresser/service-downloader#0.1.5":
version "0.1.5"
resolved "https://codeload.github.com/anthonydresser/service-downloader/tar.gz/6ebb0465573cc140e461a22f334260f55ef45546"
dependencies:
async-retry "^1.2.3"
decompress "^4.2.0"
eventemitter2 "^5.0.1"
http-proxy-agent "^2.1.0"
@@ -3631,19 +3618,19 @@ vsce@1.48.0:
yauzl "^2.3.1"
yazl "^2.2.2"
vscode-ripgrep@^1.5.6:
version "1.5.6"
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.6.tgz#93bf5c99ca5f8248950a305e224f6ca153c30af4"
integrity sha512-WRIM9XpUj6dsfdAmuI3ANbmT1ysPUVsYy/2uCLDHJa9kbiB4T7uGvFnnc0Rgx2qQnyRAwL7PeWaFgUljPPxf2g==
vscode-ripgrep@^1.5.5:
version "1.5.5"
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.5.tgz#24c0e9cb356cf889c98e15ecb58f9cf654a1d961"
integrity sha512-OrPrAmcun4+uZAuNcQvE6CCPskh+5AsjANod/Q3zRcJcGNxgoOSGlQN9RPtatkUNmkN8Nn8mZBnS1jMylu/dKg==
vscode-telemetry-extractor@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/vscode-telemetry-extractor/-/vscode-telemetry-extractor-1.5.4.tgz#bcb0d17667fa1b77715e3a3bf372ade18f846782"
integrity sha512-MN9LNPo0Rc6cy3sIWTAG97PTWkEKdRnP0VeYoS8vjKSNtG9CAsrUxHgFfYoHm2vNK/ijd0a4NzETyVGO2kT6hw==
vscode-telemetry-extractor@1.5.3:
version "1.5.3"
resolved "https://registry.yarnpkg.com/vscode-telemetry-extractor/-/vscode-telemetry-extractor-1.5.3.tgz#c17f9065a47425edafd23ea161e80c23274e009d"
integrity sha512-feioJ1e1KyMa9rzblnLbSOduo+Ny0l62H3/bSDgfgCSnU/km+tTSYxPBvZHVr7iQfQGC95J61yC/ObqS9EbaQg==
dependencies:
command-line-args "^5.1.1"
ts-morph "^3.1.3"
vscode-ripgrep "^1.5.6"
vscode-ripgrep "^1.5.5"
vso-node-api@6.1.2-preview:
version "6.1.2-preview"

View File

@@ -10,32 +10,682 @@
// Reason: The license at https://github.com/aadsm/jschardet/blob/master/LICENSE
// does not include a clear Copyright statement and does not credit authors.
"name": "jschardet",
"prependLicenseText": [
"licenseDetail": [
"Chardet was originally ported from C++ by Mark Pilgrim. It is now maintained",
" by Dan Blanchard and Ian Cordasco, and was formerly maintained by Erik Rose.",
" JSChardet was ported from python to JavaScript by António Afonso ",
" (https://github.com/aadsm/jschardet) and transformed into an npm package by ",
"Markus Ast (https://github.com/brainafk)"
"Markus Ast (https://github.com/brainafk)",
"",
"GNU LESSER GENERAL PUBLIC LICENSE",
"\t\t Version 2.1, February 1999",
"",
" Copyright (C) 1991,",
"1999 Free Software Foundation, Inc.",
" 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA",
" Everyone is permitted to copy and distribute verbatim copies",
" of this license document, but changing it is not allowed.",
"",
"[This is the first released version of the Lesser GPL. It also counts",
" as the successor of the GNU Library Public License, version 2, hence",
" the version number 2.1.",
"]",
"",
"\t\t\t Preamble",
"",
" The licenses for most software are designed to take away your",
"freedom to share and change it. By contrast, the GNU General Public",
"Licenses are intended to guarantee your freedom to share and change",
"free software--to make sure the software is free for all its users.",
"",
" This license, the Lesser General Public License, applies to some",
"specially designated software packages--typically libraries--of the",
"Free Software Foundation and other authors who decide to use it. You",
"can use it too, but we suggest you first think carefully about whether",
"this license or the ordinary General Public License is the better",
"strategy to use in any particular case, based on the explanations below.",
"",
" When we speak of free software, we are referring to freedom of use,",
"not price. Our General Public Licenses are designed to make sure that",
"you have the freedom to distribute copies of free software (and charge",
"for this service if you wish); that you receive source code or can get",
"it if you want it; that you can change the software and use pieces of",
"it in new free programs; and that you are informed that you can do",
"these things.",
"",
" To protect your rights, we need to make restrictions that forbid",
"distributors to deny you these rights or to ask you to surrender these",
"rights. These restrictions translate to certain responsibilities for",
"you if you distribute copies of the library or if you modify it.",
"",
" For example, if you distribute copies of the library, whether gratis",
"or for a fee, you must give the recipients all the rights that we gave",
"you. You must make sure that they, too, receive or can get the source",
"code. If you link other code with the library, you must provide",
"complete object files to the recipients, so that they can relink them",
"with the library after making changes to the library and recompiling",
"it. And you must show them these terms so they know their rights.",
"",
" We protect your rights with a two-step method: (1) we copyright the",
"library, and (2) we offer you this license, which gives you legal",
"permission to copy, distribute and/or modify the library.",
"",
" To protect each distributor, we want to make it very clear that",
"there is no warranty for the free library. Also, if the library is",
"modified by someone else and passed on, the recipients should know",
"that what they have is not the original version, so that the original",
"author's reputation will not be affected by problems that might be",
"introduced by others.",
"",
" Finally, software patents pose a constant threat to the existence of",
"any free program. We wish to make sure that a company cannot",
"effectively restrict the users of a free program by obtaining a",
"restrictive license from a patent holder. Therefore, we insist that",
"any patent license obtained for a version of the library must be",
"consistent with the full freedom of use specified in this license.",
"",
" Most GNU software, including some libraries, is covered by the",
"ordinary GNU General Public License. This license, the GNU Lesser",
"General Public License, applies to certain designated libraries, and",
"is quite different from the ordinary General Public License. We use",
"this license for certain libraries in order to permit linking those",
"libraries into non-free programs.",
"",
" When a program is linked with a library, whether statically or using",
"a shared library, the combination of the two is legally speaking a",
"combined work, a derivative of the original library. The ordinary",
"General Public License therefore permits such linking only if the",
"entire combination fits its criteria of freedom. The Lesser General",
"Public License permits more lax criteria for linking other code with",
"the library.",
"",
" We call this license the \"Lesser\" General Public License because it",
"does Less to protect the user's freedom than the ordinary General",
"Public License. It also provides other free software developers Less",
"of an advantage over competing non-free programs. These disadvantages",
"are the reason we use the ordinary General Public License for many",
"libraries. However, the Lesser license provides advantages in certain",
"special circumstances.",
"",
" For example, on rare occasions, there may be a special need to",
"encourage the widest possible use of a certain library, so that it becomes",
"a de-facto standard. To achieve this, non-free programs must be",
"allowed to use the library. A more frequent case is that a free",
"library does the same job as widely used non-free libraries. In this",
"case, there is little to gain by limiting the free library to free",
"software only, so we use the Lesser General Public License.",
"",
" In other cases, permission to use a particular library in non-free",
"programs enables a greater number of people to use a large body of",
"free software. For example, permission to use the GNU C Library in",
"non-free programs enables many more people to use the whole GNU",
"operating system, as well as its variant, the GNU/Linux operating",
"system.",
"",
" Although the Lesser General Public License is Less protective of the",
"users' freedom, it does ensure that the user of a program that is",
"linked with the Library has the freedom and the wherewithal to run",
"that program using a modified version of the Library.",
"",
" The precise terms and conditions for copying, distribution and",
"modification follow. Pay close attention to the difference between a",
"\"work based on the library\" and a \"work that uses the library\". The",
"former contains code derived from the library, whereas the latter must",
"be combined with the library in order to run.",
"",
"\t\t GNU LESSER GENERAL PUBLIC LICENSE",
" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION",
"",
" 0. This License Agreement applies to any software library or other",
"program which contains a notice placed by the copyright holder or",
"other authorized party saying it may be distributed under the terms of",
"this Lesser General Public License (also called \"this License\").",
"Each licensee is addressed as \"you\".",
"",
" A \"library\" means a collection of software functions and/or data",
"prepared so as to be conveniently linked with application programs",
"(which use some of those functions and data) to form executables.",
"",
" The \"Library\", below, refers to any such software library or work",
"which has been distributed under these terms. A \"work based on the",
"Library\" means either the Library or any derivative work under",
"copyright law: that is to say, a work containing the Library or a",
"portion of it, either verbatim or with modifications and/or translated",
"straightforwardly into another language. (Hereinafter, translation is",
"included without limitation in the term \"modification\".)",
"",
" \"Source code\" for a work means the preferred form of the work for",
"making modifications to it. For a library, complete source code means",
"all the source code for all modules it contains, plus any associated",
"interface definition files, plus the scripts used to control compilation",
"and installation of the library.",
"",
" Activities other than copying, distribution and modification are not",
"covered by this License; they are outside its scope. The act of",
"running a program using the Library is not restricted, and output from",
"such a program is covered only if its contents constitute a work based",
"on the Library (independent of the use of the Library in a tool for",
"writing it). Whether that is true depends on what the Library does",
"and what the program that uses the Library does.",
"",
" 1. You may copy and distribute verbatim copies of the Library's",
"complete source code as you receive it, in any medium, provided that",
"you conspicuously and appropriately publish on each copy an",
"appropriate copyright notice and disclaimer of warranty; keep intact",
"all the notices that refer to this License and to the absence of any",
"warranty; and distribute a copy of this License along with the",
"Library.",
"",
" You may charge a fee for the physical act of transferring a copy,",
"and you may at your option offer warranty protection in exchange for a",
"fee.",
"",
" 2. You may modify your copy or copies of the Library or any portion",
"of it, thus forming a work based on the Library, and copy and",
"distribute such modifications or work under the terms of Section 1",
"above, provided that you also meet all of these conditions:",
"",
" a) The modified work must itself be a software library.",
"",
" b) You must cause the files modified to carry prominent notices",
" stating that you changed the files and the date of any change.",
"",
" c) You must cause the whole of the work to be licensed at no",
" charge to all third parties under the terms of this License.",
"",
" d) If a facility in the modified Library refers to a function or a",
" table of data to be supplied by an application program that uses",
" the facility, other than as an argument passed when the facility",
" is invoked, then you must make a good faith effort to ensure that,",
" in the event an application does not supply such function or",
" table, the facility still operates, and performs whatever part of",
" its purpose remains meaningful.",
"",
" (For example, a function in a library to compute square roots has",
" a purpose that is entirely well-defined independent of the",
" application. Therefore, Subsection 2d requires that any",
" application-supplied function or table used by this function must",
" be optional: if the application does not supply it, the square",
" root function must still compute square roots.)",
"",
"These requirements apply to the modified work as a whole. If",
"identifiable sections of that work are not derived from the Library,",
"and can be reasonably considered independent and separate works in",
"themselves, then this License, and its terms, do not apply to those",
"sections when you distribute them as separate works. But when you",
"distribute the same sections as part of a whole which is a work based",
"on the Library, the distribution of the whole must be on the terms of",
"this License, whose permissions for other licensees extend to the",
"entire whole, and thus to each and every part regardless of who wrote",
"it.",
"",
"Thus, it is not the intent of this section to claim rights or contest",
"your rights to work written entirely by you; rather, the intent is to",
"exercise the right to control the distribution of derivative or",
"collective works based on the Library.",
"",
"In addition, mere aggregation of another work not based on the Library",
"with the Library (or with a work based on the Library) on a volume of",
"a storage or distribution medium does not bring the other work under",
"the scope of this License.",
"",
" 3. You may opt to apply the terms of the ordinary GNU General Public",
"License instead of this License to a given copy of the Library. To do",
"this, you must alter all the notices that refer to this License, so",
"that they refer to the ordinary GNU General Public License, version 2,",
"instead of to this License. (If a newer version than version 2 of the",
"ordinary GNU General Public License has appeared, then you can specify",
"that version instead if you wish.) Do not make any other change in",
"these notices.",
"",
" Once this change is made in a given copy, it is irreversible for",
"that copy, so the ordinary GNU General Public License applies to all",
"subsequent copies and derivative works made from that copy.",
"",
" This option is useful when you wish to copy part of the code of",
"the Library into a program that is not a library.",
"",
" 4. You may copy and distribute the Library (or a portion or",
"derivative of it, under Section 2) in object code or executable form",
"under the terms of Sections 1 and 2 above provided that you accompany",
"it with the complete corresponding machine-readable source code, which",
"must be distributed under the terms of Sections 1 and 2 above on a",
"medium customarily used for software interchange.",
"",
" If distribution of object code is made by offering access to copy",
"from a designated place, then offering equivalent access to copy the",
"source code from the same place satisfies the requirement to",
"distribute the source code, even though third parties are not",
"compelled to copy the source along with the object code.",
"",
" 5. A program that contains no derivative of any portion of the",
"Library, but is designed to work with the Library by being compiled or",
"linked with it, is called a \"work that uses the Library\". Such a",
"work, in isolation, is not a derivative work of the Library, and",
"therefore falls outside the scope of this License.",
"",
" However, linking a \"work that uses the Library\" with the Library",
"creates an executable that is a derivative of the Library (because it",
"contains portions of the Library), rather than a \"work that uses the",
"library\". The executable is therefore covered by this License.",
"Section 6 states terms for distribution of such executables.",
"",
" When a \"work that uses the Library\" uses material from a header file",
"that is part of the Library, the object code for the work may be a",
"derivative work of the Library even though the source code is not.",
"Whether this is true is especially significant if the work can be",
"linked without the Library, or if the work is itself a library. The",
"threshold for this to be true is not precisely defined by law.",
"",
" If such an object file uses only numerical parameters, data",
"structure layouts and accessors, and small macros and small inline",
"functions (ten lines or less in length), then the use of the object",
"file is unrestricted, regardless of whether it is legally a derivative",
"work. (Executables containing this object code plus portions of the",
"Library will still fall under Section 6.)",
"",
" Otherwise, if the work is a derivative of the Library, you may",
"distribute the object code for the work under the terms of Section 6.",
"Any executables containing that work also fall under Section 6,",
"whether or not they are linked directly with the Library itself.",
"",
" 6. As an exception to the Sections above, you may also combine or",
"link a \"work that uses the Library\" with the Library to produce a",
"work containing portions of the Library, and distribute that work",
"under terms of your choice, provided that the terms permit",
"modification of the work for the customer's own use and reverse",
"engineering for debugging such modifications.",
"",
" You must give prominent notice with each copy of the work that the",
"Library is used in it and that the Library and its use are covered by",
"this License. You must supply a copy of this License. If the work",
"during execution displays copyright notices, you must include the",
"copyright notice for the Library among them, as well as a reference",
"directing the user to the copy of this License. Also, you must do one",
"of these things:",
"",
" a) Accompany the work with the complete corresponding",
" machine-readable source code for the Library including whatever",
" changes were used in the work (which must be distributed under",
" Sections 1 and 2 above); and, if the work is an executable linked",
" with the Library, with the complete machine-readable \"work that",
" uses the Library\", as object code and/or source code, so that the",
" user can modify the Library and then relink to produce a modified",
" executable containing the modified Library. (It is understood",
" that the user who changes the contents of definitions files in the",
" Library will not necessarily be able to recompile the application",
" to use the modified definitions.)",
"",
" b) Use a suitable shared library mechanism for linking with the",
" Library. A suitable mechanism is one that (1) uses at run time a",
" copy of the library already present on the user's computer system,",
" rather than copying library functions into the executable, and (2)",
" will operate properly with a modified version of the library, if",
" the user installs one, as long as the modified version is",
" interface-compatible with the version that the work was made with.",
"",
" c) Accompany the work with a written offer, valid for at",
" least three years, to give the same user the materials",
" specified in Subsection 6a, above, for a charge no more",
" than the cost of performing this distribution.",
"",
" d) If distribution of the work is made by offering access to copy",
" from a designated place, offer equivalent access to copy the above",
" specified materials from the same place.",
"",
" e) Verify that the user has already received a copy of these",
" materials or that you have already sent this user a copy.",
"",
" For an executable, the required form of the \"work that uses the",
"Library\" must include any data and utility programs needed for",
"reproducing the executable from it. However, as a special exception,",
"the materials to be distributed need not include anything that is",
"normally distributed (in either source or binary form) with the major",
"components (compiler, kernel, and so on) of the operating system on",
"which the executable runs, unless that component itself accompanies",
"the executable.",
"",
" It may happen that this requirement contradicts the license",
"restrictions of other proprietary libraries that do not normally",
"accompany the operating system. Such a contradiction means you cannot",
"use both them and the Library together in an executable that you",
"distribute.",
"",
" 7. You may place library facilities that are a work based on the",
"Library side-by-side in a single library together with other library",
"facilities not covered by this License, and distribute such a combined",
"library, provided that the separate distribution of the work based on",
"the Library and of the other library facilities is otherwise",
"permitted, and provided that you do these two things:",
"",
" a) Accompany the combined library with a copy of the same work",
" based on the Library, uncombined with any other library",
" facilities. This must be distributed under the terms of the",
" Sections above.",
"",
" b) Give prominent notice with the combined library of the fact",
" that part of it is a work based on the Library, and explaining",
" where to find the accompanying uncombined form of the same work.",
"",
" 8. You may not copy, modify, sublicense, link with, or distribute",
"the Library except as expressly provided under this License. Any",
"attempt otherwise to copy, modify, sublicense, link with, or",
"distribute the Library is void, and will automatically terminate your",
"rights under this License. However, parties who have received copies,",
"or rights, from you under this License will not have their licenses",
"terminated so long as such parties remain in full compliance.",
"",
" 9. You are not required to accept this License, since you have not",
"signed it. However, nothing else grants you permission to modify or",
"distribute the Library or its derivative works. These actions are",
"prohibited by law if you do not accept this License. Therefore, by",
"modifying or distributing the Library (or any work based on the",
"Library), you indicate your acceptance of this License to do so, and",
"all its terms and conditions for copying, distributing or modifying",
"the Library or works based on it.",
"",
" 10. Each time you redistribute the Library (or any work based on the",
"Library), the recipient automatically receives a license from the",
"original licensor to copy, distribute, link with or modify the Library",
"subject to these terms and conditions. You may not impose any further",
"restrictions on the recipients' exercise of the rights granted herein.",
"You are not responsible for enforcing compliance by third parties with",
"this License.",
"",
" 11. If, as a consequence of a court judgment or allegation of patent",
"infringement or for any other reason (not limited to patent issues),",
"conditions are imposed on you (whether by court order, agreement or",
"otherwise) that contradict the conditions of this License, they do not",
"excuse you from the conditions of this License. If you cannot",
"distribute so as to satisfy simultaneously your obligations under this",
"License and any other pertinent obligations, then as a consequence you",
"may not distribute the Library at all. For example, if a patent",
"license would not permit royalty-free redistribution of the Library by",
"all those who receive copies directly or indirectly through you, then",
"the only way you could satisfy both it and this License would be to",
"refrain entirely from distribution of the Library.",
"",
"If any portion of this section is held invalid or unenforceable under any",
"particular circumstance, the balance of the section is intended to apply,",
"and the section as a whole is intended to apply in other circumstances.",
"",
"It is not the purpose of this section to induce you to infringe any",
"patents or other property right claims or to contest validity of any",
"such claims; this section has the sole purpose of protecting the",
"integrity of the free software distribution system which is",
"implemented by public license practices. Many people have made",
"generous contributions to the wide range of software distributed",
"through that system in reliance on consistent application of that",
"system; it is up to the author/donor to decide if he or she is willing",
"to distribute software through any other system and a licensee cannot",
"impose that choice.",
"",
"This section is intended to make thoroughly clear what is believed to",
"be a consequence of the rest of this License.",
"",
" 12. If the distribution and/or use of the Library is restricted in",
"certain countries either by patents or by copyrighted interfaces, the",
"original copyright holder who places the Library under this License may add",
"an explicit geographical distribution limitation excluding those countries,",
"so that distribution is permitted only in or among countries not thus",
"excluded. In such case, this License incorporates the limitation as if",
"written in the body of this License.",
"",
" 13. The Free Software Foundation may publish revised and/or new",
"versions of the Lesser General Public License from time to time.",
"Such new versions will be similar in spirit to the present version,",
"but may differ in detail to address new problems or concerns.",
"",
"Each version is given a distinguishing version number. If the Library",
"specifies a version number of this License which applies to it and",
"\"any later version\", you have the option of following the terms and",
"conditions either of that version or of any later version published by",
"the Free Software Foundation. If the Library does not specify a",
"license version number, you may choose any version ever published by",
"the Free Software Foundation.",
"",
" 14. If you wish to incorporate parts of the Library into other free",
"programs whose distribution conditions are incompatible with these,",
"write to the author to ask for permission. For software which is",
"copyrighted by the Free Software Foundation, write to the Free",
"Software Foundation; we sometimes make exceptions for this. Our",
"decision will be guided by the two goals of preserving the free status",
"of all derivatives of our free software and of promoting the sharing",
"and reuse of software generally.",
"",
"\t\t\t NO WARRANTY",
"",
" 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO",
"WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.",
"EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR",
"OTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY",
"KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE",
"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR",
"PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE",
"LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME",
"THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.",
"",
" 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN",
"WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY",
"AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU",
"FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR",
"CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE",
"LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING",
"RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A",
"FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF",
"SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH",
"DAMAGES.",
"",
"\t\t END OF TERMS AND CONDITIONS",
"",
" How to Apply These Terms to Your New Libraries",
"",
" If you develop a new library, and you want it to be of the greatest",
"possible use to the public, we recommend making it free software that",
"everyone can redistribute and change. You can do so by permitting",
"redistribution under these terms (or, alternatively, under the terms of the",
"ordinary General Public License).",
"",
" To apply these terms, attach the following notices to the library. It is",
"safest to attach them to the start of each source file to most effectively",
"convey the exclusion of warranty; and each file should have at least the",
"\"copyright\" line and a pointer to where the full notice is found.",
"",
" <one line to give the library's name and a brief idea of what it does.>",
" Copyright (C) <year> <name of author>",
"",
" This library is free software; you can redistribute it and/or",
" modify it under the terms of the GNU Lesser General Public",
" License as published by the Free Software Foundation; either",
" version 2.1 of the License, or (at your option) any later version.",
"",
" This library is distributed in the hope that it will be useful,",
" but WITHOUT ANY WARRANTY; without even the implied warranty of",
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU",
" Lesser General Public License for more details.",
"",
" You should have received a copy of the GNU Lesser General Public",
" License along with this library; if not, write to the Free Software",
" Foundation, Inc.,",
"51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA",
"",
"Also add information on how to contact you by electronic and paper mail.",
"",
"You should also get your employer (if you work as a programmer) or your",
"school, if any, to sign a \"copyright disclaimer\" for the library, if",
"necessary. Here is a sample; alter the names:",
"",
" Yoyodyne, Inc., hereby disclaims all copyright interest in the",
" library `Frob' (a library for tweaking knobs) written by James Random Hacker.",
"",
" <signature of Ty Coon>,",
"1 April 1990",
" Ty Coon, President of Vice",
"",
"That's all there is to it!"
]
},
{
// Reason: The license at https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt
// does not include a clear Copyright statement.
"name": "typescript",
"prependLicenseText": [
"Copyright (c) Microsoft Corporation. All rights reserved."
]
},
{
"name": "tunnel-agent",
"prependLicenseText": [
"Copyright (c) tunnel-agent authors"
]
},
{
// Reason: Waiting for https://github.com/segmentio/noop-logger/issues/2
"name": "noop-logger",
"fullLicenseText": [
// Added here because the module `parse5` has a dependency to it.
// The module `parse5` is shipped via the `extension-editing` built-in extension.
// The module `parse5` does not want to remove it https://github.com/inikulin/parse5/issues/225
"name": "@types/node",
"licenseDetail": [
"This project is licensed under the MIT license.",
"Copyrights are respective of each contributor listed at the beginning of each definition file.",
"",
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"",
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"",
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
]
},
{
// We override the license that gets discovered at
// https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt
// because it does not contain a Copyright statement
"name": "typescript",
"licenseDetail": [
"Copyright (c) Microsoft Corporation. All rights reserved.",
"",
"Apache License",
"",
"Version 2.0, January 2004",
"",
"http://www.apache.org/licenses/",
"",
"TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION",
"",
"1. Definitions.",
"",
"\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.",
"",
"\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.",
"",
"\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.",
"",
"\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.",
"",
"\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.",
"",
"\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.",
"",
"\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).",
"",
"\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.",
"",
"\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"",
"",
"\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.",
"",
"2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.",
"",
"3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.",
"",
"4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:",
"",
"You must give any other recipients of the Work or Derivative Works a copy of this License; and",
"",
"You must cause any modified files to carry prominent notices stating that You changed the files; and",
"",
"You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and",
"",
"If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.",
"",
"5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.",
"",
"6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.",
"",
"7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.",
"",
"8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.",
"",
"9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.",
"",
"END OF TERMS AND CONDITIONS"
]
},
{
// This module comes in from https://github.com/Microsoft/vscode-node-debug2/blob/master/package-lock.json
"name": "@types/source-map",
"licenseDetail": [
"This project is licensed under the MIT license.",
"Copyrights are respective of each contributor listed at the beginning of each definition file.",
"",
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"",
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"",
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
]
},
{
"name": "tunnel-agent",
"licenseDetail": [
"Copyright (c) tunnel-agent authors",
"",
"Apache License",
"",
"Version 2.0, January 2004",
"",
"http://www.apache.org/licenses/",
"",
"TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION",
"",
"1. Definitions.",
"",
"\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.",
"",
"\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.",
"",
"\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.",
"",
"\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.",
"",
"\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.",
"",
"\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.",
"",
"\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).",
"",
"\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.",
"",
"\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"",
"",
"\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.",
"",
"2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.",
"",
"3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.",
"",
"4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:",
"",
"You must give any other recipients of the Work or Derivative Works a copy of this License; and",
"",
"You must cause any modified files to carry prominent notices stating that You changed the files; and",
"",
"You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and",
"",
"If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.",
"",
"5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.",
"",
"6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.",
"",
"7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.",
"",
"8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.",
"",
"9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.",
"",
"END OF TERMS AND CONDITIONS"
]
},
{
// Waiting for https://github.com/segmentio/noop-logger/issues/2
"name": "noop-logger",
"licenseDetail": [
"This project is licensed under the MIT license.",
"Copyrights are respective of each contributor listed at the beginning of each definition file.",
"",
@@ -47,9 +697,8 @@
]
},
{
// Reason: The npm module does not contain a repository field.
"name": "xterm-addon-search",
"fullLicenseText": [
"licenseDetail": [
"Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)",
"",
"Permission is hereby granted, free of charge, to any person obtaining a copy",
@@ -72,9 +721,8 @@
]
},
{
// Reason: The npm module does not contain a repository field.
"name": "xterm-addon-web-links",
"fullLicenseText": [
"licenseDetail": [
"Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)",
"",
"Permission is hereby granted, free of charge, to any person obtaining a copy",
@@ -97,10 +745,8 @@
]
},
{
// Reason: The license at https://git.coolaj86.com/coolaj86/atob.js/src/branch/master/LICENSE
// cannot be found by the OSS tool automatically.
"name": "atob",
"fullLicenseText": [
"licenseDetail": [
"The MIT License (MIT)",
"",
"Copyright (c) 2015 AJ ONeal",
@@ -123,13 +769,5 @@
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
"SOFTWARE."
]
},
{
// Reason: The license at https://github.com/microsoft/tslib/blob/master/LICENSE.txt
// does not include a clear Copyright statement.
"name": "tslib",
"prependLicenseText": [
"Copyright (c) Microsoft Corporation. All rights reserved."
]
}
]

View File

@@ -60,12 +60,12 @@
"git": {
"name": "electron",
"repositoryUrl": "https://github.com/electron/electron",
"commitHash": "3d4d6454007f14fa9a5f0e1fa49206fb91b676cc"
"commitHash": "36ea114ac0616e469e75ae94e6d53af48925e036"
}
},
"isOnlyProductionDependency": true,
"license": "MIT",
"version": "4.2.9"
"version": "4.2.7"
},
{
"component": {

View File

@@ -8,12 +8,5 @@
"installDirectory": "ssmsmin/{#platform#}/{#version#}",
"executableFiles": [
"SsmsMin.exe"
],
"retry": {
"retries": 15,
"factor": 2,
"minTimeout": 1000,
"maxTimeout": 300000,
"randomize": false
}
}
]
}

View File

@@ -2,7 +2,7 @@
"name": "agent",
"displayName": "SQL Server Agent",
"description": "Manage and troubleshoot SQL Server Agent jobs",
"version": "0.43.0",
"version": "0.41.0",
"publisher": "Microsoft",
"preview": true,
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
@@ -39,43 +39,7 @@
}
}
}
],
"commands": [
{
"command": "agent.openNotebookDialog",
"title": "Schedule Notebook",
"icon": {
"dark": "resources/dark/open_notebook_inverse.svg",
"light": "resources/light/open_notebook.svg"
}
},
{
"command": "agent.reuploadTemplate",
"title": "Update Template",
"icon": {
"dark": "resources/dark/open_notebook_inverse.svg",
"light": "resources/light/open_notebook.svg"
}
}
],
"menus": {
"notebook/toolbar": [
{
"command": "agent.openNotebookDialog",
"when": "providerId == sql && !agent:trackedTemplate"
},
{
"command": "agent.reuploadTemplate",
"when": "agent:trackedTemplate"
}
],
"explorer/context": [
{
"command": "agent.openNotebookDialog",
"when": "resourceExtname == .ipynb"
}
]
}
]
},
"dependencies": {
"vscode-nls": "^3.2.1"
@@ -88,6 +52,11 @@
"mocha": "^5.2.0",
"should": "^13.2.1",
"typemoq": "^2.1.0",
"vscode": "1.1.5"
}
"vscode": "1.1.5"
},
"__metadata": {
"id": "10",
"publisherDisplayName": "Microsoft",
"publisherId": "Microsoft"
}
}

View File

@@ -1 +0,0 @@
<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>notebook_inverse</title><path class="cls-1" d="M15.46,2V15H.46V2h2V1h3a4.19,4.19,0,0,1,1.32.21A3.87,3.87,0,0,1,8,1.84a3.87,3.87,0,0,1,1.18-.63A4.19,4.19,0,0,1,10.46,1h3V2Zm-14,12h6.3a4.43,4.43,0,0,0-.51-.43,3.41,3.41,0,0,0-.54-.31,2.74,2.74,0,0,0-.59-.2A3.2,3.2,0,0,0,5.46,13h-3V3h-1Zm2-2h2a4.18,4.18,0,0,1,1,.13,4,4,0,0,1,1,.39V2.72a3,3,0,0,0-.94-.54A3.15,3.15,0,0,0,5.46,2h-2Zm11-9h-1V13h-3a3.2,3.2,0,0,0-.67.07,2.74,2.74,0,0,0-.59.2,3.41,3.41,0,0,0-.54.31,4.43,4.43,0,0,0-.51.43h6.3Zm-4-1a3.15,3.15,0,0,0-1.06.18,3,3,0,0,0-.94.54v9.8a4,4,0,0,1,1-.39,4.18,4.18,0,0,1,1-.13h2V2Z"/></svg>

Before

Width:  |  Height:  |  Size: 734 B

View File

@@ -1 +0,0 @@
<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:#0095d7;}</style></defs><title>open_notebook_inverse</title><path class="cls-1" d="M12.55,4.21l-.08-.11h-.56l-.69.06a1.54,1.54,0,0,0-.23.29v8.69H9.18a3.32,3.32,0,0,0-.93.13,3.34,3.34,0,0,0-.87.34V4.76a2.88,2.88,0,0,1,.43-.31A5.58,5.58,0,0,1,8.29,3.3a2.63,2.63,0,0,0-.3.09A3.62,3.62,0,0,0,6.93,4a3.68,3.68,0,0,0-1.07-.57A3.58,3.58,0,0,0,4.67,3.2H2v.9H.15V15.85H13.72V5.48ZM2.86,4.1H4.67a2.61,2.61,0,0,1,1,.17,2.32,2.32,0,0,1,.86.49v8.85a3.27,3.27,0,0,0-.88-.34,3.22,3.22,0,0,0-.93-.13H2.86ZM1,15V5H2v9H4.67a3.94,3.94,0,0,1,.61.06,3.2,3.2,0,0,1,.52.18,4.19,4.19,0,0,1,.49.29,2.28,2.28,0,0,1,.45.39ZM12.8,15H7.11a2.7,2.7,0,0,1,.47-.39A2.83,2.83,0,0,1,8,14.28a3.42,3.42,0,0,1,.54-.18A3.81,3.81,0,0,1,9.18,14h2.73V5h.89Z"/><polygon class="cls-2" points="13.2 3.56 13.2 3.58 13.19 3.57 13.2 3.56"/><path class="cls-2" d="M13.19,3.57h0v0Z"/><polygon class="cls-2" points="13.2 3.56 13.2 3.58 13.19 3.57 13.2 3.56"/><polygon class="cls-2" points="14.21 1.65 14.19 1.65 14.19 1.63 14.21 1.65"/><path class="cls-2" d="M15.91,2.1,14.2,3.81l-.38.38-.62-.61v0l1-1H12.79a3.35,3.35,0,0,0-1.09.26h0a3.94,3.94,0,0,0-.86.52l-.24.21s0,0,0,0a3.3,3.3,0,0,0-.51.67,3.1,3.1,0,0,0-.26.47A3.41,3.41,0,0,0,9.5,6.11H8.6a4.68,4.68,0,0,1,.16-1.19A4.74,4.74,0,0,1,9,4.26a2.21,2.21,0,0,1,.2-.41,4.66,4.66,0,0,1,.36-.51c.1-.13.22-.26.34-.39a4.14,4.14,0,0,1,.66-.53,1.19,1.19,0,0,1,.23-.16,2.79,2.79,0,0,1,.34-.18l.31-.13.42-.14a4.32,4.32,0,0,1,1.19-.16h1.15l-1-1L13.82,0Z"/></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>notebook</title><path d="M15.5,2V15H.5V2h2V1h3a4.19,4.19,0,0,1,1.32.21A3.87,3.87,0,0,1,8,1.84a3.87,3.87,0,0,1,1.18-.63A4.19,4.19,0,0,1,10.5,1h3V2ZM1.5,14H7.8a4.43,4.43,0,0,0-.51-.43,3.41,3.41,0,0,0-.54-.31,2.74,2.74,0,0,0-.59-.2A3.2,3.2,0,0,0,5.5,13h-3V3h-1Zm2-2h2a4.18,4.18,0,0,1,1,.13,4,4,0,0,1,1,.39V2.72a3,3,0,0,0-.94-.54A3.15,3.15,0,0,0,5.5,2h-2Zm11-9h-1V13h-3a3.2,3.2,0,0,0-.67.07,2.74,2.74,0,0,0-.59.2,3.41,3.41,0,0,0-.54.31A4.43,4.43,0,0,0,8.2,14h6.3Zm-4-1a3.15,3.15,0,0,0-1.06.18,3,3,0,0,0-.94.54v9.8a4,4,0,0,1,1-.39,4.18,4.18,0,0,1,1-.13h2V2Z"/></svg>

Before

Width:  |  Height:  |  Size: 661 B

View File

@@ -1 +0,0 @@
<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:#00539c;}</style></defs><title>open_notebook</title><path d="M12.4,4.21l-.08-.11h-.56l-.69.06a1.54,1.54,0,0,0-.23.29v8.69H9a3.32,3.32,0,0,0-.93.13,3.34,3.34,0,0,0-.87.34V4.76a2.88,2.88,0,0,1,.43-.31A5.58,5.58,0,0,1,8.14,3.3a2.63,2.63,0,0,0-.3.09A3.62,3.62,0,0,0,6.78,4a3.68,3.68,0,0,0-1.07-.57A3.58,3.58,0,0,0,4.52,3.2H1.81v.9H0V15.85H13.57V5.48ZM2.71,4.1H4.52a2.61,2.61,0,0,1,1,.17,2.32,2.32,0,0,1,.86.49v8.85a3.27,3.27,0,0,0-.88-.34,3.22,3.22,0,0,0-.93-.13H2.71ZM.9,15V5h.91v9H4.52a3.94,3.94,0,0,1,.61.06,3.2,3.2,0,0,1,.52.18,4.19,4.19,0,0,1,.49.29,2.28,2.28,0,0,1,.45.39Zm11.75,0H7a2.7,2.7,0,0,1,.47-.39,2.83,2.83,0,0,1,.47-.29,3.42,3.42,0,0,1,.54-.18A3.81,3.81,0,0,1,9,14h2.73V5h.89Z"/><polygon class="cls-1" points="13.05 3.56 13.05 3.58 13.04 3.57 13.05 3.56"/><path class="cls-1" d="M13,3.57h0v0Z"/><polygon class="cls-1" points="13.05 3.56 13.05 3.58 13.04 3.57 13.05 3.56"/><polygon class="cls-1" points="14.06 1.65 14.04 1.65 14.04 1.63 14.06 1.65"/><path class="cls-1" d="M15.76,2.1,14,3.81l-.38.38L13,3.58v0l1-1H12.64a3.35,3.35,0,0,0-1.09.26h0a3.94,3.94,0,0,0-.86.52l-.24.21s0,0,0,0a3.3,3.3,0,0,0-.51.67,3.1,3.1,0,0,0-.26.47,3.41,3.41,0,0,0-.27,1.39h-.9a4.68,4.68,0,0,1,.16-1.19,4.74,4.74,0,0,1,.25-.66,2.21,2.21,0,0,1,.2-.41,4.66,4.66,0,0,1,.36-.51c.1-.13.22-.26.34-.39a4.14,4.14,0,0,1,.66-.53,1.19,1.19,0,0,1,.23-.16A2.79,2.79,0,0,1,11,2.08l.31-.13.42-.14a4.32,4.32,0,0,1,1.19-.16h1.15l-1-1L13.67,0Z"/></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -6,9 +6,6 @@
'use strict';
import * as azdata from 'azdata';
import * as fs from 'fs';
import { promisify } from 'util';
export class AgentUtils {
@@ -16,12 +13,6 @@ export class AgentUtils {
private static _connectionService: azdata.ConnectionProvider;
private static _queryProvider: azdata.QueryProvider;
public static async setupProvidersFromConnection(connection?: azdata.connection.Connection) {
this._agentService = azdata.dataprotocol.getProvider<azdata.AgentServicesProvider>(connection.providerName, azdata.DataProviderType.AgentServicesProvider);
this._connectionService = azdata.dataprotocol.getProvider<azdata.ConnectionProvider>(connection.providerName, azdata.DataProviderType.ConnectionProvider);
this._queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>(connection.providerName, azdata.DataProviderType.QueryProvider);
}
public static async getAgentService(): Promise<azdata.AgentServicesProvider> {
if (!AgentUtils._agentService) {
let currentConnection = await azdata.connection.getCurrentConnection();
@@ -50,20 +41,4 @@ export class AgentUtils {
return this._queryProvider;
}
}
export function exists(path: string): Promise<boolean> {
return promisify(fs.exists)(path);
}
export function mkdir(path: string): Promise<void> {
return promisify(fs.mkdir)(path);
}
export function unlink(path: string): Promise<void> {
return promisify(fs.unlink)(path);
}
export function writeFile(path: string, data: string): Promise<void> {
return promisify(fs.writeFile)(path, data);
}
}

View File

@@ -1,260 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
import { AgentUtils } from '../agentUtils';
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
import { NotebookDialogOptions } from '../dialogs/notebookDialog';
import { createConnection } from 'net';
const localize = nls.loadMessageBundle();
const NotebookCompletionActionCondition_Always: string = localize('notebookData.whenJobCompletes', 'When the notebook completes');
const NotebookCompletionActionCondition_OnFailure: string = localize('notebookData.whenJobFails', 'When the notebook fails');
const NotebookCompletionActionCondition_OnSuccess: string = localize('notebookData.whenJobSucceeds', 'When the notebook succeeds');
// Error Messages
const CreateNotebookErrorMessage_NameIsEmpty = localize('notebookData.jobNameRequired', 'Notebook name must be provided');
const TemplatePathEmptyErrorMessage = localize('notebookData.templatePathRequired', 'Template path must be provided');
const InvalidNotebookPathErrorMessage = localize('notebookData.invalidNotebookPath', 'Invalid notebook path');
const SelectStorageDatabaseErrorMessage = localize('notebookData.selectStorageDatabase', 'Select storage database');
const SelectExecutionDatabaseErrorMessage = localize('notebookData.selectExecutionDatabase', 'Select execution database');
const JobWithSameNameExistsErrorMessage = localize('notebookData.jobExists', 'Job with similar name already exists');
export class NotebookData implements IAgentDialogData {
private _ownerUri: string;
private _jobCategories: string[];
private _operators: string[];
private _defaultOwner: string;
private _jobCompletionActionConditions: azdata.CategoryValue[];
private _jobCategoryIdsMap: azdata.AgentJobCategory[];
public dialogMode: AgentDialogMode = AgentDialogMode.CREATE;
public name: string;
public originalName: string;
public enabled: boolean = true;
public description: string;
public category: string;
public categoryId: number;
public owner: string;
public emailLevel: azdata.JobCompletionActionCondition = azdata.JobCompletionActionCondition.OnFailure;
public pageLevel: azdata.JobCompletionActionCondition = azdata.JobCompletionActionCondition.OnFailure;
public eventLogLevel: azdata.JobCompletionActionCondition = azdata.JobCompletionActionCondition.OnFailure;
public deleteLevel: azdata.JobCompletionActionCondition = azdata.JobCompletionActionCondition.OnSuccess;
public operatorToEmail: string;
public operatorToPage: string;
public jobSteps: azdata.AgentJobStepInfo[];
public jobSchedules: azdata.AgentJobScheduleInfo[];
public alerts: azdata.AgentAlertInfo[];
public jobId: string;
public startStepId: number;
public categoryType: number;
public targetDatabase: string;
public executeDatabase: string;
public templateId: number;
public templatePath: string;
public static jobLists: azdata.AgentJobInfo[];
public connection: azdata.connection.Connection;
constructor(
ownerUri: string,
options: NotebookDialogOptions = undefined,
private _agentService: azdata.AgentServicesProvider = undefined) {
this._ownerUri = ownerUri;
this.enabled = true;
if (options.notebookInfo) {
let notebookInfo = options.notebookInfo;
this.dialogMode = AgentDialogMode.EDIT;
this.name = notebookInfo.name;
this.originalName = notebookInfo.name;
this.owner = notebookInfo.owner;
this.category = notebookInfo.category;
this.description = notebookInfo.description;
this.enabled = notebookInfo.enabled;
this.jobSteps = notebookInfo.jobSteps;
this.jobSchedules = notebookInfo.jobSchedules;
this.alerts = notebookInfo.alerts;
this.jobId = notebookInfo.jobId;
this.startStepId = notebookInfo.startStepId;
this.categoryId = notebookInfo.categoryId;
this.categoryType = notebookInfo.categoryType;
this.targetDatabase = notebookInfo.targetDatabase;
this.executeDatabase = notebookInfo.executeDatabase;
}
if (options.filePath) {
this.name = path.basename(options.filePath).split('.').slice(0, -1).join('.');
this.templatePath = options.filePath;
}
if (options.connection) {
this.connection = options.connection;
}
}
public get jobCategories(): string[] {
return this._jobCategories;
}
public get jobCategoryIdsMap(): azdata.AgentJobCategory[] {
return this._jobCategoryIdsMap;
}
public get operators(): string[] {
return this._operators;
}
public get ownerUri(): string {
return this._ownerUri;
}
public get defaultOwner(): string {
return this._defaultOwner;
}
public get JobCompletionActionConditions(): azdata.CategoryValue[] {
return this._jobCompletionActionConditions;
}
public async initialize() {
if (this.connection) {
await AgentUtils.setupProvidersFromConnection(this.connection);
}
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._jobCategoryIdsMap = jobDefaults.categories;
this._defaultOwner = jobDefaults.owner;
this._operators = ['', this._defaultOwner];
this.owner = this.owner ? this.owner : this._defaultOwner;
}
this._jobCompletionActionConditions = [{
displayName: NotebookCompletionActionCondition_OnSuccess,
name: azdata.JobCompletionActionCondition.OnSuccess.toString()
}, {
displayName: NotebookCompletionActionCondition_OnFailure,
name: azdata.JobCompletionActionCondition.OnFailure.toString()
}, {
displayName: NotebookCompletionActionCondition_Always,
name: azdata.JobCompletionActionCondition.Always.toString()
}];
this._agentService.getJobs(this.ownerUri).then((value) => {
NotebookData.jobLists = value.jobs;
});
}
public async save() {
let notebookInfo: azdata.AgentNotebookInfo = this.toAgentJobInfo();
let result = this.dialogMode === AgentDialogMode.CREATE
? await this._agentService.createNotebook(this.ownerUri, notebookInfo, this.templatePath)
: await this._agentService.updateNotebook(this.ownerUri, this.originalName, notebookInfo, this.templatePath);
if (!result || !result.success) {
if (this.dialogMode === AgentDialogMode.EDIT) {
vscode.window.showErrorMessage(
localize('notebookData.saveErrorMessage', "Notebook update failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
} else {
vscode.window.showErrorMessage(
localize('notebookData.newJobErrorMessage', "Notebook creation failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
}
} else {
if (this.dialogMode === AgentDialogMode.EDIT) {
vscode.window.showInformationMessage(
localize('notebookData.saveSucessMessage', "Notebook '{0}' updated successfully", notebookInfo.name));
} else {
vscode.window.showInformationMessage(
localize('notebookData.newJobSuccessMessage', "Notebook '{0}' created successfully", notebookInfo.name));
}
}
}
public validate(): { valid: boolean, errorMessages: string[] } {
let validationErrors: string[] = [];
if (this.dialogMode !== AgentDialogMode.EDIT) {
if (!(this.name && this.name.trim())) {
validationErrors.push(CreateNotebookErrorMessage_NameIsEmpty);
}
if (!(this.templatePath && this.name.trim())) {
validationErrors.push(TemplatePathEmptyErrorMessage);
}
if (!fs.existsSync(this.templatePath)) {
validationErrors.push(InvalidNotebookPathErrorMessage);
}
if (NotebookData.jobLists) {
for (let i = 0; i < NotebookData.jobLists.length; i++) {
if (this.name === NotebookData.jobLists[i].name) {
validationErrors.push(JobWithSameNameExistsErrorMessage);
break;
}
}
}
}
else {
if (this.templatePath && this.templatePath !== '' && !fs.existsSync(this.templatePath)) {
validationErrors.push(InvalidNotebookPathErrorMessage);
}
}
if (this.targetDatabase === 'Select Database') {
validationErrors.push(SelectStorageDatabaseErrorMessage);
}
if (this.executeDatabase === 'Select Database') {
validationErrors.push(SelectExecutionDatabaseErrorMessage);
}
return {
valid: validationErrors.length === 0,
errorMessages: validationErrors
};
}
public toAgentJobInfo(): azdata.AgentNotebookInfo {
return {
name: this.name,
owner: this.owner ? this.owner : this.defaultOwner,
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,
targetDatabase: this.targetDatabase,
executeDatabase: this.executeDatabase,
// The properties below are not collected from UI
// We could consider using a seperate class for create job request
//
templateId: this.templateId,
currentExecutionStatus: 0,
lastRunOutcome: 0,
currentExecutionStep: '',
hasTarget: true,
hasSchedule: false,
hasStep: false,
runnable: true,
categoryId: this.categoryId,
categoryType: this.categoryType,
lastRun: '',
nextRun: '',
jobId: this.jobId,
startStepId: this.startStepId,
lastRunNotebookError: '',
};
}
}

View File

@@ -14,7 +14,6 @@ export class PickScheduleData implements IAgentDialogData {
public schedules: azdata.AgentJobScheduleInfo[];
public selectedSchedule: azdata.AgentJobScheduleInfo;
private jobName: string;
private initialized: boolean;
constructor(ownerUri: string, jobName: string) {
this.ownerUri = ownerUri;
@@ -25,7 +24,6 @@ export class PickScheduleData implements IAgentDialogData {
let agentService = await AgentUtils.getAgentService();
try {
let result = await agentService.getJobSchedules(this.ownerUri);
this.initialized = true;
if (result && result.success) {
this.schedules = result.schedules;
return this.schedules;
@@ -38,8 +36,4 @@ export class PickScheduleData implements IAgentDialogData {
public async save() {
this.selectedSchedule.jobName = this.jobName;
}
public isInitialized() {
return this.initialized;
}
}

View File

@@ -723,4 +723,4 @@ export class JobDialog extends AgentDialog<JobData> {
this.model.alerts = this.alerts;
this.model.categoryId = +this.model.jobCategoryIdsMap.find(cat => cat.name === this.model.category).id;
}
}
}

View File

@@ -169,7 +169,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
isFile: false
}).component();
this.openButton.onDidClick(e => {
let queryContent = e.fileContent;
let queryContent = e;
this.commandTextBox.value = queryContent;
});
this.parseButton.onDidClick(e => {

View File

@@ -1,338 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as path from 'path';
import * as azdata from 'azdata';
import { PickScheduleDialog } from './pickScheduleDialog';
import { AgentDialog } from './agentDialog';
import { AgentUtils } from '../agentUtils';
import { NotebookData } from '../data/notebookData';
const localize = nls.loadMessageBundle();
// TODO: localize
// Top level
const CreateDialogTitle: string = localize('notebookDialog.newJob', "New Notebook Job");
const EditDialogTitle: string = localize('notebookDialog.editJob', "Edit Notebook Job");
const GeneralTabText: string = localize('notebookDialog.general', "General");
const BlankJobNameErrorText: string = localize('notebookDialog.blankJobNameError', "The name of the job cannot be blank.");
// Notebook details strings
const NotebookDetailsSeparatorTitle: string = localize('notebookDialog.notebookSection', "Notebook Details");
const TemplateNotebookTextBoxLabel: string = localize('notebookDialog.templateNotebook', "Notebook Path");
const TargetDatabaseDropdownLabel: string = localize('notebookDialog.targetDatabase', "Storage Database");
const ExecuteDatabaseDropdownLabel: string = localize('notebookDialog.executeDatabase', "Execution Database");
const DefaultDropdownString: string = localize('notebookDialog.defaultDropdownString', "Select Database");
// Job details string
const JobDetailsSeparatorTitle: string = localize('notebookDialog.jobSection', "Job Details");
const NameTextBoxLabel: string = localize('notebookDialog.name', "Name");
const OwnerTextBoxLabel: string = localize('notebookDialog.owner', "Owner");
const SchedulesTopLabelString: string = localize('notebookDialog.schedulesaLabel', "Schedules list");
const PickScheduleButtonString: string = localize('notebookDialog.pickSchedule', "Pick Schedule");
const RemoveScheduleButtonString: string = localize('notebookDialog.removeSchedule', "Remove Schedule");
const ScheduleNameLabelString: string = localize('notebookDialog.scheduleNameLabel', "Schedule Name");
const DescriptionTextBoxLabel: string = localize('notebookDialog.description', "Description");
// Event Name strings
const NewJobDialogEvent: string = 'NewNotebookJobDialogOpened';
const EditJobDialogEvent: string = 'EditNotebookJobDialogOpened';
export class NotebookDialogOptions {
notebookInfo?: azdata.AgentNotebookInfo;
filePath?: string;
connection?: azdata.connection.Connection;
}
export class NotebookDialog extends AgentDialog<NotebookData> {
// UI Components
private generalTab: azdata.window.DialogTab;
// Notebook Details controls
private templateFilePathBox: azdata.InputBoxComponent;
private openTemplateFileButton: azdata.ButtonComponent;
private targetDatabaseDropDown: azdata.DropDownComponent;
private executeDatabaseDropDown: azdata.DropDownComponent;
// Job Details controls
private nameTextBox: azdata.InputBoxComponent;
private ownerTextBox: azdata.InputBoxComponent;
private schedulesTable: azdata.TableComponent;
private pickScheduleButton: azdata.ButtonComponent;
private removeScheduleButton: azdata.ButtonComponent;
private descriptionTextBox: azdata.InputBoxComponent;
private isEdit: boolean = false;
// Job objects
private steps: azdata.AgentJobStepInfo[];
private schedules: azdata.AgentJobScheduleInfo[];
constructor(ownerUri: string, options: NotebookDialogOptions = undefined) {
super(
ownerUri,
new NotebookData(ownerUri, options),
options.notebookInfo ? EditDialogTitle : CreateDialogTitle);
this.steps = this.model.jobSteps ? this.model.jobSteps : [];
this.schedules = this.model.jobSchedules ? this.model.jobSchedules : [];
this.isEdit = options.notebookInfo ? true : false;
this.dialogName = this.isEdit ? EditJobDialogEvent : NewJobDialogEvent;
}
protected async initializeDialog() {
this.generalTab = azdata.window.createTab(GeneralTabText);
this.initializeGeneralTab();
this.dialog.content = [this.generalTab];
this.dialog.registerCloseValidator(() => {
this.updateModel();
let validationResult = this.model.validate();
if (!validationResult.valid) {
// TODO: Show Error Messages
this.dialog.message = { text: validationResult.errorMessages[0] };
console.error(validationResult.errorMessages.join(','));
}
return validationResult.valid;
});
}
private initializeGeneralTab() {
this.generalTab.registerContent(async view => {
this.templateFilePathBox = view.modelBuilder.inputBox()
.withProperties({
width: 400,
inputType: 'text'
}).component();
this.openTemplateFileButton = view.modelBuilder.button()
.withProperties({
label: '...',
title: '...',
width: '20px',
isFile: true,
fileType: '.ipynb'
}).component();
this.openTemplateFileButton.onDidClick(e => {
if (e) {
this.templateFilePathBox.value = e.filePath;
if (!this.isEdit) {
let fileName = path.basename(e.filePath).split('.').slice(0, -1).join('.');
this.nameTextBox.value = fileName;
}
}
});
let outputButtonContainer = view.modelBuilder.flexContainer()
.withLayout({
flexFlow: 'row',
textAlign: 'right',
width: 20
}).withItems([this.openTemplateFileButton], { flex: '1 1 80%' }).component();
let notebookPathFlexBox = view.modelBuilder.flexContainer()
.withLayout({
flexFlow: 'row',
width: '100%',
}).withItems([this.templateFilePathBox, outputButtonContainer], {
flex: '1 1 50%'
}).component();
this.targetDatabaseDropDown = view.modelBuilder.dropDown().component();
this.executeDatabaseDropDown = view.modelBuilder.dropDown().component();
let databases = await AgentUtils.getDatabases(this.ownerUri);
databases.unshift(DefaultDropdownString);
this.targetDatabaseDropDown = view.modelBuilder.dropDown()
.withProperties({
value: databases[0],
values: databases
}).component();
this.descriptionTextBox = view.modelBuilder.inputBox().withProperties({
multiline: true,
height: 50
}).component();
this.executeDatabaseDropDown = view.modelBuilder.dropDown()
.withProperties({
value: databases[0],
values: databases
}).component();
this.targetDatabaseDropDown.required = true;
this.executeDatabaseDropDown.required = true;
this.descriptionTextBox = view.modelBuilder.inputBox().withProperties({
multiline: true,
height: 50
}).component();
this.nameTextBox = view.modelBuilder.inputBox().component();
this.nameTextBox.required = true;
this.nameTextBox.onTextChanged(() => {
if (this.nameTextBox.value && this.nameTextBox.value.length > 0) {
this.dialog.message = null;
// Change the job name immediately since steps
// depends on the job name
this.model.name = this.nameTextBox.value;
}
});
this.ownerTextBox = view.modelBuilder.inputBox().component();
this.schedulesTable = view.modelBuilder.table()
.withProperties({
columns: [
PickScheduleDialog.SchedulesIDText,
PickScheduleDialog.ScheduleNameLabelText,
PickScheduleDialog.ScheduleDescription
],
data: [],
height: 50,
width: 420
}).component();
this.pickScheduleButton = view.modelBuilder.button().withProperties({
label: PickScheduleButtonString,
width: 100
}).component();
this.removeScheduleButton = view.modelBuilder.button().withProperties({
label: RemoveScheduleButtonString,
width: 100
}).component();
this.pickScheduleButton.onDidClick(() => {
let pickScheduleDialog = new PickScheduleDialog(this.model.ownerUri, this.model.name);
pickScheduleDialog.onSuccess((dialogModel) => {
let selectedSchedule = dialogModel.selectedSchedule;
if (selectedSchedule) {
let existingSchedule = this.schedules.find(item => item.name === selectedSchedule.name);
if (!existingSchedule) {
selectedSchedule.jobName = this.model.name ? this.model.name : this.nameTextBox.value;
this.schedules.push(selectedSchedule);
}
this.populateScheduleTable();
}
});
pickScheduleDialog.showDialog();
});
this.removeScheduleButton.onDidClick(() => {
if (this.schedulesTable.selectedRows.length === 1) {
let selectedRow = this.schedulesTable.selectedRows[0];
let selectedScheduleName = this.schedulesTable.data[selectedRow][1];
for (let i = 0; i < this.schedules.length; i++) {
if (this.schedules[i].name === selectedScheduleName) {
this.schedules.splice(i, 1);
}
}
this.populateScheduleTable();
}
});
let formModel = view.modelBuilder.formContainer()
.withFormItems([
{
components: [{
component: notebookPathFlexBox,
title: TemplateNotebookTextBoxLabel,
layout: {
info: localize('notebookDialog.templatePath', 'Select a notebook to schedule from PC')
}
},
{
component: this.targetDatabaseDropDown,
title: TargetDatabaseDropdownLabel,
layout: {
info: localize('notebookDialog.targetDatabaseInfo', 'Select a database to store all notebook job metadata and results')
}
}, {
component: this.executeDatabaseDropDown,
title: ExecuteDatabaseDropdownLabel,
layout: {
info: localize('notebookDialog.executionDatabaseInfo', 'Select a database against which notebook queries will run')
}
}],
title: NotebookDetailsSeparatorTitle
}, {
components: [{
component: this.nameTextBox,
title: NameTextBoxLabel
}, {
component: this.ownerTextBox,
title: OwnerTextBoxLabel
}, {
component: this.schedulesTable,
title: SchedulesTopLabelString,
actions: [this.pickScheduleButton, this.removeScheduleButton]
}, {
component: this.descriptionTextBox,
title: DescriptionTextBoxLabel
}],
title: JobDetailsSeparatorTitle
}]).withLayout({ width: '100%' }).component();
await view.initializeModel(formModel);
this.nameTextBox.value = this.model.name;
this.ownerTextBox.value = this.model.owner;
this.templateFilePathBox.value = this.model.templatePath;
if (this.isEdit) {
this.templateFilePathBox.placeHolder = this.model.targetDatabase + '\\' + this.model.name;
this.targetDatabaseDropDown.value = this.model.targetDatabase;
this.executeDatabaseDropDown.value = this.model.executeDatabase;
this.targetDatabaseDropDown.enabled = false;
this.schedules = this.model.jobSchedules;
}
else {
this.templateFilePathBox.required = true;
}
let idx: number = undefined;
if (this.model.category && this.model.category !== '') {
idx = this.model.jobCategories.indexOf(this.model.category);
}
this.descriptionTextBox.value = this.model.description;
this.openTemplateFileButton.onDidClick(e => {
});
this.populateScheduleTable();
});
}
private populateScheduleTable() {
let data = this.convertSchedulesToData(this.schedules);
this.schedulesTable.data = data;
this.schedulesTable.height = 100;
}
private createRowContainer(view: azdata.ModelView): azdata.FlexBuilder {
return view.modelBuilder.flexContainer().withLayout({
flexFlow: 'row',
alignItems: 'left',
justifyContent: 'space-between'
});
}
private convertSchedulesToData(jobSchedules: azdata.AgentJobScheduleInfo[]): any[][] {
let result = [];
jobSchedules.forEach(schedule => {
let cols = [];
cols.push(schedule.id);
cols.push(schedule.name);
cols.push(schedule.description);
result.push(cols);
});
return result;
}
protected updateModel() {
this.model.name = this.nameTextBox.value;
this.model.owner = this.ownerTextBox.value;
this.model.description = this.descriptionTextBox.value;
this.model.templatePath = this.templateFilePathBox.value;
this.model.targetDatabase = this.targetDatabaseDropDown.value as string;
this.model.executeDatabase = this.executeDatabaseDropDown.value as string;
if (!this.model.jobSchedules) {
this.model.jobSchedules = [];
}
this.model.alerts = [];
this.model.jobSteps = [];
this.model.jobSchedules = this.schedules;
this.model.category = '[Uncategorized (Local)]';
this.model.categoryId = 0;
this.model.eventLogLevel = 0;
}
}

View File

@@ -40,9 +40,7 @@ export class PickScheduleDialog {
public async showDialog() {
this.model.initialize().then((result) => {
if (this.loadingComponent) {
this.loadingComponent.loading = false;
}
this.loadingComponent.loading = false;
if (this.model.schedules) {
let data: any[][] = [];
for (let i = 0; i < this.model.schedules.length; ++i) {
@@ -83,21 +81,8 @@ export class PickScheduleDialog {
this.loadingComponent = view.modelBuilder.loadingComponent().withItem(formModel).component();
this.loadingComponent.loading = true;
this.model.initialize().then((result) => {
this.loadingComponent.loading = false;
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.id, schedule.name, schedule.description];
}
this.schedulesTable.data = data;
}
});
this.loadingComponent.loading = !this.model.isInitialized();
await view.initializeModel(this.loadingComponent);
});
}
private async execute() {
@@ -116,4 +101,4 @@ export class PickScheduleDialog {
this.model.selectedSchedule = this.model.schedules[selectedRow];
}
}
}
}

View File

@@ -7,9 +7,6 @@
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import { AlertDialog } from './dialogs/alertDialog';
import { JobDialog } from './dialogs/jobDialog';
import { OperatorDialog } from './dialogs/operatorDialog';
@@ -17,22 +14,13 @@ import { ProxyDialog } from './dialogs/proxyDialog';
import { JobStepDialog } from './dialogs/jobStepDialog';
import { PickScheduleDialog } from './dialogs/pickScheduleDialog';
import { JobData } from './data/jobData';
import { AgentUtils, exists, mkdir, unlink, writeFile } from './agentUtils';
import { NotebookDialog, NotebookDialogOptions } from './dialogs/notebookDialog';
import { promisify } from 'util';
import { AgentUtils } from './agentUtils';
const localize = nls.loadMessageBundle();
/**
* The main controller class that initializes the extension
*/
export class TemplateMapObject {
notebookInfo: azdata.AgentNotebookInfo;
fileUri: vscode.Uri;
tempPath: string;
ownerUri: string;
}
export class MainController {
protected _context: vscode.ExtensionContext;
@@ -41,8 +29,7 @@ export class MainController {
private alertDialog: AlertDialog;
private operatorDialog: OperatorDialog;
private proxyDialog: ProxyDialog;
private notebookDialog: NotebookDialog;
private notebookTemplateMap = new Map<string, TemplateMapObject>();
// PUBLIC METHODS //////////////////////////////////////////////////////
public constructor(context: vscode.ExtensionContext) {
this._context = context;
@@ -95,26 +82,6 @@ export class MainController {
this.operatorDialog.dialogName ? await this.operatorDialog.openDialog(this.operatorDialog.dialogName) : await this.operatorDialog.openDialog();
}
});
vscode.commands.registerCommand('agent.reuploadTemplate', async (ownerUri: string, operatorInfo: azdata.AgentOperatorInfo) => {
let nbEditor = azdata.nb.activeNotebookEditor;
// await nbEditor.document.save();
let templateMap = this.notebookTemplateMap.get(nbEditor.document.uri.toString());
let vsEditor = await vscode.workspace.openTextDocument(templateMap.fileUri);
let content = vsEditor.getText();
promisify(fs.writeFile)(templateMap.tempPath, content);
AgentUtils.getAgentService().then(async (agentService) => {
let result = await agentService.updateNotebook(templateMap.ownerUri, templateMap.notebookInfo.name, templateMap.notebookInfo, templateMap.tempPath);
if (result.success) {
vscode.window.showInformationMessage(localize('agent.templateUploadSuccessful', 'Template updated successfully'));
}
else {
vscode.window.showInformationMessage(localize('agent.templateUploadError', 'Template update failure'));
}
});
});
vscode.commands.registerCommand('agent.openProxyDialog', async (ownerUri: string, proxyInfo: azdata.AgentProxyInfo, credentials: azdata.CredentialInfo[]) => {
if (!this.proxyDialog || (this.proxyDialog && !this.proxyDialog.isOpen)) {
this.proxyDialog = new ProxyDialog(ownerUri, proxyInfo, credentials);
@@ -124,117 +91,6 @@ export class MainController {
}
this.proxyDialog.dialogName ? await this.proxyDialog.openDialog(this.proxyDialog.dialogName) : await this.proxyDialog.openDialog();
});
vscode.commands.registerCommand('agent.openNotebookEditorFromJsonString', async (filename: string, jsonNotebook: string, notebookInfo?: azdata.AgentNotebookInfo, ownerUri?: string) => {
const tempfilePath = path.join(os.tmpdir(), 'mssql_notebooks', filename + '.ipynb');
if (!await exists(path.join(os.tmpdir(), 'mssql_notebooks'))) {
await mkdir(path.join(os.tmpdir(), 'mssql_notebooks'));
}
let editors = azdata.nb.visibleNotebookEditors;
if (await exists(tempfilePath)) {
await unlink(tempfilePath);
}
try {
await writeFile(tempfilePath, jsonNotebook);
let uri = vscode.Uri.parse(`untitled:${path.basename(tempfilePath)}`);
if (notebookInfo) {
this.notebookTemplateMap.set(uri.toString(), { notebookInfo: notebookInfo, fileUri: uri, ownerUri: ownerUri, tempPath: tempfilePath });
vscode.commands.executeCommand('setContext', 'agent:trackedTemplate', true);
}
await azdata.nb.showNotebookDocument(uri, {
initialContent: jsonNotebook,
initialDirtyState: false
});
vscode.commands.executeCommand('setContext', 'agent:trackedTemplate', false);
}
catch (e) {
vscode.window.showErrorMessage(e);
}
});
vscode.commands.registerCommand('agent.openNotebookDialog', async (ownerUri: any, notebookInfo: azdata.AgentNotebookInfo) => {
/*
There are four entry points to this commands:
1. Explorer context menu:
The first arg becomes a vscode URI
the second argument is undefined
2. Notebook toolbar:
both the args are undefined
3. Agent New Notebook Action
the first arg is database OwnerUri
the second arg is undefined
4. Agent Edit Notebook Action
the first arg is database OwnerUri
the second arg is notebookInfo from database
*/
if (!ownerUri || ownerUri instanceof vscode.Uri) {
let path: string;
if (!ownerUri) {
if (azdata.nb.activeNotebookEditor.document.isDirty) {
vscode.window.showErrorMessage(localize('agent.unsavedFileSchedulingError', 'Save file before scheduling'), { modal: true });
return;
}
path = azdata.nb.activeNotebookEditor.document.fileName;
} else {
path = ownerUri.fsPath;
}
let connection = await this.getConnectionFromUser();
ownerUri = await azdata.connection.getUriForConnection(connection.connectionId);
this.notebookDialog = new NotebookDialog(ownerUri, <NotebookDialogOptions>{ filePath: path, connection: connection });
if (!this.notebookDialog.isOpen) {
this.notebookDialog.dialogName ? await this.notebookDialog.openDialog(this.notebookDialog.dialogName) : await this.notebookDialog.openDialog();
}
}
else {
if (!this.notebookDialog || (this.notebookDialog && !this.notebookDialog.isOpen)) {
this.notebookDialog = new NotebookDialog(ownerUri, <NotebookDialogOptions>{ notebookInfo: notebookInfo });
}
if (!this.notebookDialog.isOpen) {
this.notebookDialog.dialogName ? await this.notebookDialog.openDialog(this.notebookDialog.dialogName) : await this.notebookDialog.openDialog();
}
}
});
}
public async getConnectionFromUser(): Promise<azdata.connection.Connection> {
let connection: azdata.connection.Connection = null;
let connections = await azdata.connection.getActiveConnections();
if (!connections || connections.length === 0) {
connection = await azdata.connection.openConnectionDialog();
}
else {
let sqlConnectionsPresent: boolean;
for (let i = 0; i < connections.length; i++) {
if (connections[i].providerName === 'MSSQL') {
sqlConnectionsPresent = true;
break;
}
}
let connectionNames: azdata.connection.Connection[] = [];
let connectionDisplayString: string[] = [];
for (let i = 0; i < connections.length; i++) {
let currentConnectionString = connections[i].options.server + ' (' + connections[i].options.user + ')';
connectionNames.push(connections[i]);
connectionDisplayString.push(currentConnectionString);
}
connectionDisplayString.push(localize('agent.AddNewConnection', 'Add new connection'));
let connectionName = await vscode.window.showQuickPick(connectionDisplayString, { placeHolder: localize('agent.selectConnection', 'Select a connection') });
if (connectionDisplayString.indexOf(connectionName) !== -1) {
if (connectionName === localize('agent.AddNewConnection', 'Add new connection')) {
connection = await azdata.connection.openConnectionDialog();
}
else {
connection = connections[connectionDisplayString.indexOf(connectionName)];
}
}
else {
vscode.window.showErrorMessage(localize('agent.selectValidConnection', 'Please select a valid connection'), { modal: true });
}
}
return connection;
}
/**

View File

@@ -24,7 +24,8 @@
"sqlBigDataCluster": [
{
"id": "sqlBigDataCluster",
"name": "%text.sqlServerBigDataClusters%"
"name": "%text.sqlServerBigDataClusters%",
"when": "config.bigDataClusters.enabled"
}
]
},
@@ -41,10 +42,6 @@
{
"command": "bigDataClusters.command.refreshController",
"when": "false"
},
{
"command": "bigDataClusters.command.manageController",
"when": "false"
}
],
"view/title": [
@@ -56,22 +53,28 @@
],
"view/item/context": [
{
"command": "bigDataClusters.command.manageController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"command": "bigDataClusters.command.deleteController",
"when": "viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@1"
},
{
"command": "bigDataClusters.command.refreshController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@2"
},
{
"command": "bigDataClusters.command.deleteController",
"when": "view == sqlBigDataCluster && viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@3"
"when": "viewItem == bigDataClusters.itemType.controllerNode",
"group": "navigation@1"
}
]
},
"configuration": {
"type": "object",
"title": "%text.sqlServerBigDataClusters%",
"properties": {
"bigDataClusters.enabled": {
"type": "boolean",
"default": false,
"description": "%text.sqlServerBigDataClustersEnabledConfig.description%"
}
}
},
"commands": [
{
"command": "bigDataClusters.command.addController",
@@ -93,10 +96,6 @@
"light": "resources/light/refresh.svg",
"dark": "resources/dark/refresh_inverse.svg"
}
},
{
"command": "bigDataClusters.command.manageController",
"title": "%command.manageController.title%"
}
]
},

View File

@@ -1,8 +1,8 @@
{
"description": "Support for managing SQL Server big data clusters",
"text.sqlServerBigDataClusters": "SQL Server big data clusters",
"text.sqlServerBigDataClustersEnabledConfig.description":"Whether the SQL Server big data clusters data explorer view is enabled",
"command.addController.title": "Connect to Controller",
"command.deleteController.title" : "Delete",
"command.refreshController.title" : "Refresh",
"command.manageController.title" : "Manage"
"command.refreshController.title" : "Refresh"
}

View File

@@ -1 +0,0 @@
<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>copy_inverse</title><path class="cls-1" d="M3,0V3.36H0V16.1H13V12.73h3V0Zm9,15.19H1.08V4.27H12Zm3-3.36H13V3.36H4V.9H15Z"/></svg>

Before

Width:  |  Height:  |  Size: 274 B

View File

@@ -1,4 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 6H11V3H5V6ZM6 4H10V5H6V4Z" fill="white"/>
<path d="M1 0H14V16H1V13H0V12H1V10.023H0V9.023H1V7.039H0V6.039H1V4H0V3H1V0ZM13 15V1H2V3H3V4H2V6.039H3V7.039H2V9.023H3V10.023H2V12H3V13H2V15H13Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 317 B

View File

@@ -1 +0,0 @@
<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:#3bb44a;}</style></defs><title>success_16x16</title><path class="cls-1" d="M16,3.16,5.48,13.69,0,8.2l.89-.89,4.6,4.59,9.63-9.62Z"/></svg>

Before

Width:  |  Height:  |  Size: 255 B

View File

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.12 13.9725L15 12.5L9.37927 2H7.61924L1.9985 12.5L2.87852 13.9725H14.12ZM2.87852 12.9725L8.49925 2.47249L14.12 12.9725H2.87852ZM7.98952 6H8.98802V10H7.98952V6ZM7.98952 11H8.98802V12H7.98952V11Z" fill="#FFCC00"/>
</svg>

Before

Width:  |  Height:  |  Size: 367 B

View File

@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>copy</title><path d="M3-.15V3.21H0V15.95H13V12.58h3V-.15ZM12,15H1.08V4.12H12Zm3-3.36H13V3.21h-9V.75H15Z"/></svg>

Before

Width:  |  Height:  |  Size: 212 B

View File

@@ -1,7 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>Artboard 20</title>
<g>
<path d="M5,6h6V3H5ZM6,4h4V5H6Z"/>
<path d="M1,0H14V16H1V13H0V12H1V10.023H0v-1H1V7.039H0v-1H1V4H0V3H1ZM13,15V1H2V3H3V4H2V6.039H3v1H2V9.023H3v1H2V12H3v1H2v2Z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 301 B

View File

@@ -1 +0,0 @@
<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:#3bb44a;}</style></defs><title>success_16x16</title><path class="cls-1" d="M16,3.16,5.48,13.69,0,8.2l.89-.89,4.6,4.59,9.63-9.62Z"/></svg>

Before

Width:  |  Height:  |  Size: 255 B

View File

@@ -1,4 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.12 13.9725L15 12.5L9.37927 2H7.61924L1.9985 12.5L2.87852 13.9725H14.12ZM2.87852 12.9725L8.49925 2.47249L14.12 12.9725H2.87852ZM7.98952 6H8.98802V10H7.98952V6ZM7.98952 11H8.98802V12H7.98952V11Z" fill="#FFCC00"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.12 13.9725L15 12.5L9.37927 2H7.61924L1.9985 12.5L2.87852 13.9725H14.12ZM2.87852 12.9725L8.49925 2.47249L14.12 12.9725H2.87852ZM7.98952 6H8.98802V10H7.98952V6ZM7.98952 11H8.98802V12H7.98952V11Z" fill="#DDB100"/>
</svg>

Before

Width:  |  Height:  |  Size: 631 B

View File

@@ -17,61 +17,26 @@ export enum BdcItemType {
loadingController = 'bigDataClusters.itemType.loadingControllerNode'
}
export interface IconPath {
dark: string;
light: string;
}
export class IconPathHelper {
export class IconPath {
private static extensionContext: vscode.ExtensionContext;
public static controllerNode: IconPath;
public static folderNode: IconPath;
public static sqlMasterNode: IconPath;
public static copy: IconPath;
public static refresh: IconPath;
public static status_ok: IconPath;
public static status_warning: IconPath;
public static notebook: IconPath;
public static controllerNode: { dark: string, light: string };
public static folderNode: { dark: string, light: string };
public static sqlMasterNode: { dark: string, light: string };
public static setExtensionContext(extensionContext: vscode.ExtensionContext) {
IconPathHelper.extensionContext = extensionContext;
IconPathHelper.controllerNode = {
dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/bigDataCluster_controller.svg'),
light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/bigDataCluster_controller.svg')
IconPath.extensionContext = extensionContext;
IconPath.controllerNode = {
dark: IconPath.extensionContext.asAbsolutePath('resources/dark/bigDataCluster_controller.svg'),
light: IconPath.extensionContext.asAbsolutePath('resources/light/bigDataCluster_controller.svg')
};
IconPathHelper.folderNode = {
dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/folder_inverse.svg'),
light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/folder.svg')
IconPath.folderNode = {
dark: IconPath.extensionContext.asAbsolutePath('resources/dark/folder_inverse.svg'),
light: IconPath.extensionContext.asAbsolutePath('resources/light/folder.svg')
};
IconPathHelper.sqlMasterNode = {
dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/sql_bigdata_cluster_inverse.svg'),
light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/sql_bigdata_cluster.svg')
};
IconPathHelper.copy = {
light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/copy.svg'),
dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/copy_inverse.svg')
};
IconPathHelper.refresh = {
light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/refresh.svg'),
dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/refresh_inverse.svg')
};
IconPathHelper.status_ok = {
light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/status_ok_light.svg'),
dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/status_ok_dark.svg')
};
IconPathHelper.status_warning = {
light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/status_warning_light.svg'),
dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/status_warning_dark.svg')
};
IconPathHelper.notebook = {
light: IconPathHelper.extensionContext.asAbsolutePath('resources/light/notebook.svg'),
dark: IconPathHelper.extensionContext.asAbsolutePath('resources/dark/notebook_inverse.svg')
IconPath.sqlMasterNode = {
dark: IconPath.extensionContext.asAbsolutePath('resources/dark/sql_bigdata_cluster_inverse.svg'),
light: IconPath.extensionContext.asAbsolutePath('resources/light/sql_bigdata_cluster.svg')
};
}
}
export namespace cssStyles {
export const hyperlink = { 'user-select': 'text', 'color': '#0078d4', 'text-decoration': 'underline', 'cursor': 'pointer' };
export const text = { 'margin-block-start': '0px', 'margin-block-end': '0px' };
}
}

View File

@@ -4,10 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import * as request from 'request';
import { BdcRouterApi, Authentication, DefaultApi, EndpointModel, BdcStatusModel } from './apiGenerated';
import * as nls from 'vscode-nls';
import { ClusterRouterApi, Authentication } from './apiGenerated';
const localize = nls.loadMessageBundle();
class AuthConfiguration implements Authentication {
public username: string = '';
@@ -23,16 +21,15 @@ class AuthConfiguration implements Authentication {
}
}
class BdcApiWrapper extends BdcRouterApi {
class ClusterApiWrapper extends ClusterRouterApi {
constructor(basePathOrUsername: string, password?: string, basePath?: string, ignoreSslVerification?: boolean) {
super(basePathOrUsername, password, basePath);
this.authentications.default = new AuthConfiguration(!!ignoreSslVerification);
this.password = password;
this.username = basePathOrUsername;
}
}
export async function getEndPoints(
clusterName: string,
url: string,
username: string,
password: string,
@@ -44,41 +41,42 @@ export async function getEndPoints(
}
url = adjustUrl(url);
let endPointApi = new BdcApiWrapper(username, password, url, !!ignoreSslVerification);
let endPointApi = new ClusterApiWrapper(username, password, url, !!ignoreSslVerification);
let controllerResponse: IEndPointsResponse = undefined;
let controllerError: IControllerError = undefined;
let request = <IEndPointsRequest>{
url: url,
username: username,
password: password,
method: 'endPointsGet'
};
try {
let result = await endPointApi.endpointsGet();
return {
let result = await endPointApi.endpointsGet(clusterName);
controllerResponse = <IEndPointsResponse>{
response: result.response as IHttpResponse,
endPoints: result.body as EndpointModel[]
endPoints: result.body as IEndPoint[],
request
};
return controllerResponse;
} catch (error) {
throw new ControllerError(error, localize('bdc.error.getEndPoints', "Error retrieving endpoints from {0}", url));
}
}
export async function getBdcStatus(
url: string,
username: string,
password: string,
ignoreSslVerification?: boolean
): Promise<IBdcStatusResponse> {
if (!url) {
return undefined;
}
url = adjustUrl(url);
const bdcApi = new BdcApiWrapper(username, password, url, ignoreSslVerification);
try {
const bdcStatus = await bdcApi.getBdcStatus('', '', /*all*/ true);
return {
response: bdcStatus.response,
bdcStatus: bdcStatus.body
};
} catch (error) {
throw new ControllerError(error, localize('bdc.error.getBdcStatus', "Error retrieving BDC status from {0}", url));
if ('response' in error) {
let err: IEndPointsResponse = error as IEndPointsResponse;
let errCode = `${err.response.statusCode || ''}`;
let errMessage = err.response.statusMessage;
let errUrl = err.response.url;
controllerError = <IControllerError>{
address: errUrl,
code: errCode,
errno: errCode,
message: errMessage,
name: undefined
};
} else {
controllerError = error as IControllerError;
}
throw Object.assign(controllerError, { request }) as IControllerError;
}
}
@@ -97,7 +95,7 @@ function adjustUrl(url: string): string {
return url;
}
export interface IClusterRequest {
export interface IEndPointsRequest {
url: string;
username: string;
password?: string;
@@ -106,12 +104,7 @@ export interface IClusterRequest {
export interface IEndPointsResponse {
response: IHttpResponse;
endPoints: EndpointModel[];
}
export interface IBdcStatusResponse {
response: IHttpResponse;
bdcStatus: BdcStatusModel;
endPoints: IEndPoint[];
}
export interface IHttpResponse {
@@ -121,32 +114,17 @@ export interface IHttpResponse {
statusMessage?: string;
}
export class ControllerError extends Error {
public code?: string;
public errno?: string;
public reason?: string;
public address?: string;
/**
*
* @param error The original error to wrap
* @param messagePrefix Optional text to prefix the error message with
*/
constructor(error: any, messagePrefix?: string) {
super(messagePrefix);
// Pull out the response information containing details about the failure
if (error.response) {
this.code = error.response.statusCode || '';
this.message += `${error.response.statusMessage ? ` - ${error.response.statusMessage}` : ''}` || '';
this.address = error.response.url || '';
}
else if (error.message) {
this.message += ` - ${error.message}`;
}
// The body message contains more specific information about the failure
if (error.body && error.body.reason) {
this.message += ` - ${error.body.reason}`;
}
}
export interface IEndPoint {
name?: string;
description?: string;
endpoint?: string;
ip?: string;
port?: number;
}
export interface IControllerError extends Error {
code?: string;
errno?: string;
message: string;
request?: any;
}

View File

@@ -7,11 +7,10 @@
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import { getEndPoints, ControllerError } from '../controller/clusterControllerApi';
import { IEndPoint, IControllerError, getEndPoints } from '../controller/clusterControllerApi';
import { ControllerTreeDataProvider } from '../tree/controllerTreeDataProvider';
import { TreeNode } from '../tree/treeNode';
import { showErrorMessage } from '../utils';
import { EndpointModel } from '../controller/apiGenerated';
const localize = nls.loadMessageBundle();
@@ -38,9 +37,9 @@ export class AddControllerDialogModel {
public async onComplete(clusterName: string, url: string, username: string, password: string, rememberPassword: boolean): Promise<void> {
try {
// We pre-fetch the endpoints here to verify that the information entered is correct (the user is able to connect)
let response = await getEndPoints(url, username, password, true);
let response = await getEndPoints(clusterName, url, username, password, true);
if (response && response.endPoints) {
let masterInstance: EndpointModel = undefined;
let masterInstance: IEndPoint = undefined;
if (response.endPoints) {
masterInstance = response.endPoints.find(e => e.name && e.name === 'sql-server-master');
}
@@ -59,7 +58,7 @@ export class AddControllerDialogModel {
}
public async onError(error: ControllerError): Promise<void> {
public async onError(error: IControllerError): Promise<void> {
// implement
}
@@ -172,7 +171,7 @@ export class AddControllerDialog {
} catch (error) {
showErrorMessage(error);
if (this.model && this.model.onError) {
await this.model.onError(error as ControllerError);
await this.model.onError(error as IControllerError);
}
return false;
}

View File

@@ -1,218 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { BdcDashboardModel } from './bdcDashboardModel';
import { IconPathHelper } from '../constants';
import { BdcServiceStatusPage } from './bdcServiceStatusPage';
import { BdcDashboardOverviewPage } from './bdcDashboardOverviewPage';
import { BdcStatusModel, ServiceStatusModel } from '../controller/apiGenerated';
import { getHealthStatusDot, getServiceNameDisplayText } from '../utils';
const localize = nls.loadMessageBundle();
const navWidth = '200px';
const selectedTabCss = { 'font-weight': 'bold' };
const unselectedTabCss = { 'font-weight': '' };
type NavTab = { div: azdata.DivContainer, dot: azdata.TextComponent, text: azdata.TextComponent };
export class BdcDashboard {
private dashboard: azdata.workspace.ModelViewEditor;
private initialized: boolean = false;
private serviceTabsCreated: boolean = false;
private modelView: azdata.ModelView;
private mainAreaContainer: azdata.FlexContainer;
private navContainer: azdata.FlexContainer;
private currentTab: NavTab;
private currentPage: azdata.FlexContainer;
private serviceTabPageMapping: { [key: string]: { navTab: NavTab, servicePage: azdata.FlexContainer } } = {};
constructor(private title: string, private model: BdcDashboardModel) {
this.model.onDidUpdateBdcStatus(bdcStatus => this.handleBdcStatusUpdate(bdcStatus));
}
public showDashboard(): void {
this.createDashboard();
this.dashboard.openEditor();
}
private createDashboard(): void {
this.dashboard = azdata.workspace.createModelViewEditor(this.title, { retainContextWhenHidden: true, supportsSave: false });
this.dashboard.registerContent(async (modelView: azdata.ModelView) => {
this.modelView = modelView;
const rootContainer = modelView.modelBuilder.flexContainer().withLayout(
{
flexFlow: 'column',
width: '100%',
height: '100%',
alignItems: 'left'
}).component();
// ###########
// # TOOLBAR #
// ###########
// Refresh button
const refreshButton = modelView.modelBuilder.button()
.withProperties({
label: localize('bdc.dashboard.refreshButton', "Refresh"),
iconPath: IconPathHelper.refresh,
height: '50px'
}).component();
refreshButton.onDidClick(() => this.model.refresh());
const openTroubleshootNotebookButton = modelView.modelBuilder.button()
.withProperties({
label: localize('bdc.dashboard.troubleshootButton', "Troubleshoot"),
iconPath: IconPathHelper.notebook,
height: '50px'
}).component();
openTroubleshootNotebookButton.onDidClick(() => {
vscode.commands.executeCommand('books.sqlserver2019');
});
const toolbarContainer = modelView.modelBuilder.toolbarContainer()
.withToolbarItems(
[
{ component: refreshButton },
{ component: openTroubleshootNotebookButton }
]
).component();
rootContainer.addItem(toolbarContainer, { flex: '0 0 auto' });
// #############
// # MAIN AREA #
// #############
this.mainAreaContainer = modelView.modelBuilder.flexContainer().withLayout(
{
flexFlow: 'row',
width: '100%',
height: '100%',
alignItems: 'left'
}).component();
rootContainer.addItem(this.mainAreaContainer, { flex: '0 0 100%' });
// #################
// # NAV CONTAINER #
// #################
this.navContainer = modelView.modelBuilder.flexContainer().withLayout(
{
flexFlow: 'column',
width: navWidth,
height: '100%',
alignItems: 'left'
}
).component();
this.mainAreaContainer.addItem(this.navContainer, { flex: `0 0 ${navWidth}`, CSSStyles: { 'padding-left': '10px', 'border-right': 'solid 1px #ccc' } });
// Overview nav item - this will be the initial page
const overviewNavItemDiv = modelView.modelBuilder.divContainer().withLayout({ width: navWidth, height: '30px' }).withProperties({ CSSStyles: { 'cursor': 'pointer' } }).component();
const overviewNavItemText = modelView.modelBuilder.text().withProperties({ value: localize('bdc.dashboard.overviewNavTitle', 'Big data cluster overview') }).component();
overviewNavItemText.updateCssStyles(selectedTabCss);
overviewNavItemDiv.addItem(overviewNavItemText, { CSSStyles: { 'user-select': 'text' } });
const overviewPage = new BdcDashboardOverviewPage(this, this.model).create(modelView);
this.currentPage = overviewPage;
this.currentTab = { div: overviewNavItemDiv, dot: undefined, text: overviewNavItemText };
this.mainAreaContainer.addItem(overviewPage, { flex: '0 0 100%' });
overviewNavItemDiv.onDidClick(() => {
if (this.currentTab) {
this.currentTab.text.updateCssStyles(unselectedTabCss);
}
this.mainAreaContainer.removeItem(this.currentPage);
this.mainAreaContainer.addItem(overviewPage, { flex: '0 0 100%' });
this.currentPage = overviewPage;
this.currentTab = { div: overviewNavItemDiv, dot: undefined, text: overviewNavItemText };
this.currentTab.text.updateCssStyles(selectedTabCss);
});
this.navContainer.addItem(overviewNavItemDiv, { flex: '0 0 auto' });
const clusterDetailsHeader = modelView.modelBuilder.text().withProperties({ value: localize('bdc.dashboard.clusterDetails', 'Cluster Details'), CSSStyles: { 'margin-block-end': '0px' } }).component();
this.navContainer.addItem(clusterDetailsHeader, { CSSStyles: { 'user-select': 'none', 'font-weight': 'bold', 'border-bottom': 'solid 1px #ccc', 'margin-bottom': '10px' } });
await modelView.initializeModel(rootContainer);
this.initialized = true;
// Now that we've created the UI load data from the model in case it already had data
this.handleBdcStatusUpdate(this.model.bdcStatus);
});
}
private handleBdcStatusUpdate(bdcStatus: BdcStatusModel): void {
if (!this.initialized || !bdcStatus) {
return;
}
this.createServiceNavTabs(bdcStatus.services);
}
/**
* Switches the current navigation tab to the one corresponding to the specified service
* @param serviceName The name of the service to switch to the tab of
*/
public switchToServiceTab(serviceName: string): void {
const tabPageMapping = this.serviceTabPageMapping[serviceName];
if (!tabPageMapping) {
return;
}
if (this.currentTab) {
this.currentTab.text.updateCssStyles(unselectedTabCss);
}
this.mainAreaContainer.removeItem(this.currentPage);
this.mainAreaContainer.addItem(tabPageMapping.servicePage);
this.currentPage = tabPageMapping.servicePage;
this.currentTab = tabPageMapping.navTab;
this.currentTab.text.updateCssStyles(selectedTabCss);
}
/**
* Helper to create the navigation tabs for the services once the status has been loaded
*/
private createServiceNavTabs(services: ServiceStatusModel[]): void {
if (this.initialized && !this.serviceTabsCreated && services) {
// Add a nav item for each service
services.forEach(s => {
const navItem = createServiceNavTab(this.modelView.modelBuilder, s);
const serviceStatusPage = new BdcServiceStatusPage(s.serviceName, this.model, this.modelView).container;
this.serviceTabPageMapping[s.serviceName] = { navTab: navItem, servicePage: serviceStatusPage };
navItem.div.onDidClick(() => {
this.switchToServiceTab(s.serviceName);
});
this.navContainer.addItem(navItem.div, { flex: '0 0 auto' });
});
this.serviceTabsCreated = true;
}
}
}
function createServiceNavTab(modelBuilder: azdata.ModelBuilder, serviceStatus: ServiceStatusModel): NavTab {
const div = modelBuilder.divContainer().withLayout({ width: navWidth, height: '30px' }).withProperties({ CSSStyles: { 'cursor': 'pointer' } }).component();
const innerContainer = modelBuilder.flexContainer().withLayout({ width: navWidth, height: '30px', flexFlow: 'row' }).component();
const dot = modelBuilder.text().withProperties({ value: getHealthStatusDot(serviceStatus.healthStatus), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'none', 'color': 'red', 'font-size': '40px', 'width': '20px' } }).component();
innerContainer.addItem(dot, { flex: '0 0 auto' });
const text = modelBuilder.text().withProperties({ value: getServiceNameDisplayText(serviceStatus.serviceName), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'none' } }).component();
innerContainer.addItem(text, { flex: '0 0 auto' });
div.addItem(innerContainer);
return { div: div, dot: dot, text: text };
}

View File

@@ -1,107 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { getBdcStatus, getEndPoints } from '../controller/clusterControllerApi';
import { EndpointModel, BdcStatusModel } from '../controller/apiGenerated';
import { showErrorMessage, Endpoint } from '../utils';
export class BdcDashboardModel {
private _bdcStatus: BdcStatusModel;
private _endpoints: EndpointModel[] = [];
private _bdcStatusLastUpdated: Date;
private _endpointsLastUpdated: Date;
private readonly _onDidUpdateEndpoints = new vscode.EventEmitter<EndpointModel[]>();
private readonly _onDidUpdateBdcStatus = new vscode.EventEmitter<BdcStatusModel>();
public onDidUpdateEndpoints = this._onDidUpdateEndpoints.event;
public onDidUpdateBdcStatus = this._onDidUpdateBdcStatus.event;
constructor(public clusterName: string, private url: string, private username: string, private password: string) {
this.refresh();
}
public get bdcStatus(): BdcStatusModel | undefined {
return this._bdcStatus;
}
public get serviceEndpoints(): EndpointModel[] {
return this._endpoints || [];
}
public get bdcStatusLastUpdated(): Date {
return this._bdcStatusLastUpdated;
}
public get endpointsLastUpdated(): Date {
return this._endpointsLastUpdated;
}
public async refresh(): Promise<void> {
await Promise.all([
getBdcStatus(this.url, this.username, this.password, true).then(response => {
this._bdcStatus = response.bdcStatus;
this._bdcStatusLastUpdated = new Date();
this._onDidUpdateBdcStatus.fire(this.bdcStatus);
}),
getEndPoints(this.url, this.username, this.password, true).then(response => {
this._endpoints = response.endPoints || [];
fixEndpoints(this._endpoints);
this._endpointsLastUpdated = new Date();
this._onDidUpdateEndpoints.fire(this.serviceEndpoints);
})
]).catch(error => showErrorMessage(error));
}
/**
* Gets a partially filled connection profile for the SQL Server Master Instance endpoint
* associated with this cluster.
* @returns The IConnectionProfile - or undefined if the endpoints haven't been loaded yet
*/
public getSqlServerMasterConnectionProfile(): azdata.IConnectionProfile | undefined {
const sqlServerMasterEndpoint = this.serviceEndpoints.find(e => e.name === Endpoint.sqlServerMaster);
if (!sqlServerMasterEndpoint) {
return undefined;
}
// We default to sa - if that doesn't work then callers of this should open up a connection
// dialog so the user can enter in the correct connection information
return {
connectionName: '',
serverName: sqlServerMasterEndpoint.endpoint,
databaseName: undefined,
userName: 'sa',
password: this.password,
authenticationType: '',
savePassword: true,
groupFullName: undefined,
groupId: undefined,
providerName: 'MSSQL',
saveProfile: true,
id: undefined,
options: {}
};
}
}
/**
* Applies fixes to the endpoints received so they are displayed correctly
* @param endpoints The endpoints received to modify
*/
function fixEndpoints(endpoints: EndpointModel[]) {
endpoints.forEach(e => {
if (e.name === Endpoint.metricsui && e.endpoint && e.endpoint.indexOf('/d/wZx3OUdmz') === -1) {
// Update to have correct URL
e.endpoint += '/d/wZx3OUdmz';
}
if (e.name === Endpoint.logsui && e.endpoint && e.endpoint.indexOf('/app/kibana#/discover') === -1) {
// Update to have correct URL
e.endpoint += '/app/kibana#/discover';
}
});
}

View File

@@ -1,305 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { BdcDashboardModel } from './bdcDashboardModel';
import { IconPathHelper, cssStyles } from '../constants';
import { getStateDisplayText, getHealthStatusDisplayText, getEndpointDisplayText, getHealthStatusIcon, getServiceNameDisplayText, Endpoint } from '../utils';
import { EndpointModel, ServiceStatusModel, BdcStatusModel } from '../controller/apiGenerated';
import { BdcDashboard } from './bdcDashboard';
const localize = nls.loadMessageBundle();
const overviewIconColumnWidth = '50px';
const overviewServiceNameCellWidth = '100px';
const overviewStateCellWidth = '75px';
const overviewHealthStatusCellWidth = '100px';
const serviceEndpointRowServiceNameCellWidth = '175px';
const serviceEndpointRowEndpointCellWidth = '350px';
const hyperlinkedEndpoints = [Endpoint.metricsui, Endpoint.logsui, Endpoint.sparkHistory, Endpoint.yarnUi];
export class BdcDashboardOverviewPage {
private initialized: boolean = false;
private modelBuilder: azdata.ModelBuilder;
private lastUpdatedLabel: azdata.TextComponent;
private clusterStateLoadingComponent: azdata.LoadingComponent;
private clusterHealthStatusLoadingComponent: azdata.LoadingComponent;
private serviceStatusRowContainer: azdata.FlexContainer;
private endpointsRowContainer: azdata.FlexContainer;
constructor(private dashboard: BdcDashboard, private model: BdcDashboardModel) {
this.model.onDidUpdateEndpoints(endpoints => this.handleEndpointsUpdate(endpoints));
this.model.onDidUpdateBdcStatus(bdcStatus => this.handleBdcStatusUpdate(bdcStatus));
}
public create(view: azdata.ModelView): azdata.FlexContainer {
this.modelBuilder = view.modelBuilder;
const rootContainer = view.modelBuilder.flexContainer().withLayout(
{
flexFlow: 'column',
width: '100%',
height: '100%',
alignItems: 'left'
}).component();
// ##############
// # PROPERTIES #
// ##############
const propertiesLabel = view.modelBuilder.text()
.withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.propertiesHeader', "Cluster Properties"), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '10px' } })
.component();
rootContainer.addItem(propertiesLabel, { CSSStyles: { 'margin-top': '15px', 'font-size': '20px', 'font-weight': 'bold', 'padding-left': '10px' } });
// Row 1
const row1 = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row', height: '30px', alignItems: 'center' }).component();
// Cluster Name
const clusterNameLabel = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.clusterName', "Cluster Name :") }).component();
const clusterNameValue = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: this.model.clusterName }).component();
row1.addItem(clusterNameLabel, { CSSStyles: { 'width': '100px', 'min-width': '100px', 'user-select': 'none', 'font-weight': 'bold' } });
row1.addItem(clusterNameValue, { CSSStyles: { 'user-select': 'text' } });
rootContainer.addItem(row1, { CSSStyles: { 'padding-left': '10px', 'border-top': 'solid 1px #ccc', 'box-sizing': 'border-box', 'user-select': 'text' } });
// Row 2
const row2 = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row', height: '30px', alignItems: 'center' }).component();
// Cluster State
const clusterStateLabel = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.clusterState', "Cluster State :") }).component();
const clusterStateValue = view.modelBuilder.text().withProperties({ CSSStyles: { 'user-select': 'text' } }).component();
this.clusterStateLoadingComponent = view.modelBuilder.loadingComponent().withItem(clusterStateValue).component();
row2.addItem(clusterStateLabel, { CSSStyles: { 'width': '125px', 'min-width': '125px', 'user-select': 'none', 'font-weight': 'bold' } });
row2.addItem(this.clusterStateLoadingComponent, { CSSStyles: { 'width': '125px', 'min-width': '125px', 'user-select': 'none' } });
// Health Status
const healthStatusLabel = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.healthStatus', "Health Status :") }).component();
const healthStatusValue = view.modelBuilder.text().withProperties({ CSSStyles: { 'user-select': 'text' } }).component();
this.clusterHealthStatusLoadingComponent = view.modelBuilder.loadingComponent().withItem(healthStatusValue).component();
row2.addItem(healthStatusLabel, { CSSStyles: { 'width': '125px', 'min-width': '125px', 'user-select': 'none', 'font-weight': 'bold' } });
row2.addItem(this.clusterHealthStatusLoadingComponent, { CSSStyles: { 'width': '125px', 'min-width': '125px', 'user-select': 'none' } });
rootContainer.addItem(row2, { CSSStyles: { 'padding-left': '10px', 'border-bottom': 'solid 1px #ccc', 'box-sizing': 'border-box', 'user-select': 'text' } });
// ############
// # OVERVIEW #
// ############
const overviewHeaderContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row', height: '20px' }).component();
rootContainer.addItem(overviewHeaderContainer, { CSSStyles: { 'padding-left': '10px', 'padding-top': '15px' } });
const overviewLabel = view.modelBuilder.text()
.withProperties<azdata.TextComponentProperties>({
value: localize('bdc.dashboard.overviewHeader', "Cluster Overview"),
CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px' }
})
.component();
overviewHeaderContainer.addItem(overviewLabel, { CSSStyles: { 'font-size': '20px', 'font-weight': 'bold' } });
this.lastUpdatedLabel = view.modelBuilder.text()
.withProperties({
value: localize('bdc.dashboard.lastUpdated', "Last Updated : {0}", '-'),
CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'color': 'lightgray' }
}).component();
overviewHeaderContainer.addItem(this.lastUpdatedLabel, { CSSStyles: { 'margin-left': '45px' } });
const overviewContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%', alignItems: 'left' }).component();
// Service Status header row
const serviceStatusHeaderRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
const serviceStatusIconHeader = view.modelBuilder.text().component();
serviceStatusHeaderRow.addItem(serviceStatusIconHeader, { CSSStyles: { 'width': overviewIconColumnWidth, 'min-width': overviewIconColumnWidth } });
const nameCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.serviceNameHeader', "Service Name") }).component();
serviceStatusHeaderRow.addItem(nameCell, { CSSStyles: { 'width': overviewServiceNameCellWidth, 'min-width': overviewServiceNameCellWidth, 'font-weight': 'bold', 'user-select': 'text' } });
const stateCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.stateHeader', "State"), CSSStyles: { 'text-align': 'center', 'font-weight': 'bold' } }).component();
serviceStatusHeaderRow.addItem(stateCell, { CSSStyles: { 'width': overviewStateCellWidth, 'min-width': overviewStateCellWidth, 'user-select': 'text' } });
const healthStatusCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.healthStatusHeader', "Health Status"), CSSStyles: { 'text-align': 'center', 'font-weight': 'bold' } }).component();
serviceStatusHeaderRow.addItem(healthStatusCell, { CSSStyles: { 'width': overviewHealthStatusCellWidth, 'min-width': overviewHealthStatusCellWidth, 'user-select': 'text' } });
overviewContainer.addItem(serviceStatusHeaderRow, { CSSStyles: { 'padding-left': '10px', 'box-sizing': 'border-box', 'user-select': 'text' } });
// Service Status row container
this.serviceStatusRowContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
// Note we don't give the rows container as a child of the loading component since in order to align the loading component correctly
// messes up the layout for the row container that we display after loading is finished. Instead we just remove the loading component
// and replace it with the rows directly
const serviceStatusRowContainerLoadingComponent = view.modelBuilder.loadingComponent()
.withProperties({ CSSStyles: { 'padding-top': '0px', 'padding-bottom': '0px' } })
.component();
this.serviceStatusRowContainer.addItem(serviceStatusRowContainerLoadingComponent, { flex: '0 0 auto', CSSStyles: { 'padding-left': '150px', width: '30px' } });
overviewContainer.addItem(this.serviceStatusRowContainer);
rootContainer.addItem(overviewContainer, { flex: '0 0 auto' });
// #####################
// # SERVICE ENDPOINTS #
// #####################
const endpointsLabel = view.modelBuilder.text()
.withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.endpointsLabel', "Service Endpoints"), CSSStyles: { 'margin-block-start': '20px', 'margin-block-end': '0px' } })
.component();
rootContainer.addItem(endpointsLabel, { CSSStyles: { 'font-size': '20px', 'font-weight': 'bold', 'padding-left': '10px' } });
const endpointsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%', alignItems: 'left' }).component();
// Service endpoints header row
const endpointsHeaderRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
const endpointsServiceNameHeaderCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.serviceHeader', "Service") }).component();
endpointsHeaderRow.addItem(endpointsServiceNameHeaderCell, { CSSStyles: { 'width': serviceEndpointRowServiceNameCellWidth, 'min-width': serviceEndpointRowServiceNameCellWidth, 'font-weight': 'bold', 'user-select': 'text' } });
const endpointsEndpointHeaderCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.endpointHeader', "Endpoint") }).component();
endpointsHeaderRow.addItem(endpointsEndpointHeaderCell, { CSSStyles: { 'width': serviceEndpointRowEndpointCellWidth, 'min-width': serviceEndpointRowEndpointCellWidth, 'font-weight': 'bold', 'user-select': 'text' } });
endpointsContainer.addItem(endpointsHeaderRow, { CSSStyles: { 'padding-left': '10px', 'box-sizing': 'border-box', 'user-select': 'text' } });
this.endpointsRowContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
// Note we don't give the rows container as a child of the loading component since in order to align the loading component correctly
// messes up the layout for the row container that we display after loading is finished. Instead we just remove the loading component
// and replace it with the rows directly
const endpointRowContainerLoadingComponent = view.modelBuilder.loadingComponent()
.withProperties({ CSSStyles: { 'padding-top': '0px', 'padding-bottom': '0px' } })
.component();
this.endpointsRowContainer.addItem(endpointRowContainerLoadingComponent, { flex: '0 0 auto', CSSStyles: { 'padding-left': '150px', width: '30px' } });
endpointsContainer.addItem(this.endpointsRowContainer);
rootContainer.addItem(endpointsContainer, { flex: '0 0 auto' });
this.initialized = true;
// Now that we've created the UI load data from the model in case it already had data
this.handleEndpointsUpdate(this.model.serviceEndpoints);
this.handleBdcStatusUpdate(this.model.bdcStatus);
return rootContainer;
}
private handleBdcStatusUpdate(bdcStatus: BdcStatusModel): void {
if (!this.initialized || !bdcStatus) {
return;
}
this.lastUpdatedLabel.value =
localize('bdc.dashboard.lastUpdated', "Last Updated : {0}",
this.model.bdcStatusLastUpdated ?
`${this.model.bdcStatusLastUpdated.toLocaleDateString()} ${this.model.bdcStatusLastUpdated.toLocaleTimeString()}`
: '-');
this.clusterStateLoadingComponent.loading = false;
this.clusterHealthStatusLoadingComponent.loading = false;
(<azdata.TextComponent>this.clusterStateLoadingComponent.component).value = getStateDisplayText(bdcStatus.state);
(<azdata.TextComponent>this.clusterHealthStatusLoadingComponent.component).value = getHealthStatusDisplayText(bdcStatus.healthStatus);
if (bdcStatus.services) {
this.serviceStatusRowContainer.clearItems();
bdcStatus.services.forEach((s, i) => {
this.createServiceStatusRow(this.serviceStatusRowContainer, s, i === bdcStatus.services.length - 1);
});
}
}
private handleEndpointsUpdate(endpoints: EndpointModel[]): void {
if (!this.initialized || !endpoints) {
return;
}
this.endpointsRowContainer.clearItems();
endpoints.forEach((e, i) => {
createServiceEndpointRow(this.modelBuilder, this.endpointsRowContainer, e, this.model, hyperlinkedEndpoints.some(he => he === e.name), i === endpoints.length - 1);
});
}
private createServiceStatusRow(container: azdata.FlexContainer, serviceStatus: ServiceStatusModel, isLastRow: boolean): void {
const serviceStatusRow = this.modelBuilder.flexContainer().withLayout({ flexFlow: 'row', alignItems: 'center', height: '30px' }).component();
const statusIconCell = this.modelBuilder.text().withProperties({ value: getHealthStatusIcon(serviceStatus.healthStatus), CSSStyles: { 'user-select': 'none' } }).component();
serviceStatusRow.addItem(statusIconCell, { CSSStyles: { 'width': overviewIconColumnWidth, 'min-width': overviewIconColumnWidth } });
const nameCell = this.modelBuilder.text().withProperties({ value: getServiceNameDisplayText(serviceStatus.serviceName), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'color': '#0078d4', 'text-decoration': 'underline', 'cursor': 'pointer' } }).component();
nameCell.onDidClick(() => {
this.dashboard.switchToServiceTab(serviceStatus.serviceName);
});
serviceStatusRow.addItem(nameCell, { CSSStyles: { 'width': overviewServiceNameCellWidth, 'min-width': overviewServiceNameCellWidth, 'user-select': 'text', 'margin-block-start': '0px', 'margin-block-end': '0px' } });
const stateCell = this.modelBuilder.text().withProperties({ value: getStateDisplayText(serviceStatus.state), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'text', 'text-align': 'center' } }).component();
serviceStatusRow.addItem(stateCell, { CSSStyles: { 'width': overviewStateCellWidth, 'min-width': overviewStateCellWidth } });
const healthStatusCell = this.modelBuilder.text().withProperties({ value: getHealthStatusDisplayText(serviceStatus.healthStatus), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'text', 'text-align': 'center' } }).component();
serviceStatusRow.addItem(healthStatusCell, { CSSStyles: { 'width': overviewHealthStatusCellWidth, 'min-width': overviewHealthStatusCellWidth } });
if (serviceStatus.healthStatus !== 'healthy' && serviceStatus.details && serviceStatus.details.length > 0) {
const viewDetailsButton = this.modelBuilder.button().withProperties<azdata.ButtonProperties>({ label: localize('bdc.dashboard.viewDetails', "View Details") }).component();
viewDetailsButton.onDidClick(() => {
vscode.window.showErrorMessage(serviceStatus.details);
});
serviceStatusRow.addItem(viewDetailsButton, { flex: '0 0 auto' });
}
container.addItem(serviceStatusRow, { CSSStyles: { 'padding-left': '10px', 'border-top': 'solid 1px #ccc', 'border-bottom': isLastRow ? 'solid 1px #ccc' : '', 'box-sizing': 'border-box', 'user-select': 'text' } });
}
}
function createServiceEndpointRow(modelBuilder: azdata.ModelBuilder, container: azdata.FlexContainer, endpoint: EndpointModel, bdcModel: BdcDashboardModel, isHyperlink: boolean, isLastRow: boolean): void {
const endPointRow = modelBuilder.flexContainer().withLayout({ flexFlow: 'row', alignItems: 'center', height: '40px' }).component();
const nameCell = modelBuilder.text().withProperties({ value: getEndpointDisplayText(endpoint.name, endpoint.description), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px' } }).component();
endPointRow.addItem(nameCell, { CSSStyles: { 'width': serviceEndpointRowServiceNameCellWidth, 'min-width': serviceEndpointRowServiceNameCellWidth, 'user-select': 'text', 'text-align': 'center' } });
if (isHyperlink) {
const endpointCell = modelBuilder.hyperlink()
.withProperties<azdata.HyperlinkComponentProperties>({
label: endpoint.endpoint,
title: endpoint.endpoint,
url: endpoint.endpoint, CSSStyles: { 'height': '15px' }
})
.component();
endPointRow.addItem(endpointCell, { CSSStyles: { 'width': serviceEndpointRowEndpointCellWidth, 'min-width': serviceEndpointRowEndpointCellWidth, 'overflow': 'hidden', 'text-overflow': 'ellipsis', ...cssStyles.hyperlink } });
}
else if (endpoint.name === Endpoint.sqlServerMaster) {
const endpointCell = modelBuilder.text()
.withProperties<azdata.TextComponentProperties>({
value: endpoint.endpoint,
title: endpoint.endpoint,
CSSStyles: { 'overflow': 'hidden', 'text-overflow': 'ellipsis', ...cssStyles.text, ...cssStyles.hyperlink }
})
.component();
endpointCell.onDidClick(async () => {
const connProfile = bdcModel.getSqlServerMasterConnectionProfile();
const result = await azdata.connection.connect(connProfile, true, true);
if (!result.connected) {
if (result.errorMessage && result.errorMessage.length > 0) {
vscode.window.showErrorMessage(result.errorMessage);
}
// Clear out the password and username before connecting since those being wrong are likely the issue
connProfile.userName = undefined;
connProfile.password = undefined;
azdata.connection.openConnectionDialog(undefined, connProfile);
}
});
endPointRow.addItem(endpointCell, { CSSStyles: { 'width': serviceEndpointRowEndpointCellWidth, 'min-width': serviceEndpointRowEndpointCellWidth } });
}
else {
const endpointCell = modelBuilder.text()
.withProperties<azdata.TextComponentProperties>({
value: endpoint.endpoint,
title: endpoint.endpoint,
CSSStyles: { 'overflow': 'hidden', 'text-overflow': 'ellipsis', ...cssStyles.text }
})
.component();
endPointRow.addItem(endpointCell, { CSSStyles: { 'width': serviceEndpointRowEndpointCellWidth, 'min-width': serviceEndpointRowEndpointCellWidth } });
}
const copyValueCell = modelBuilder.button().component();
copyValueCell.iconPath = IconPathHelper.copy;
copyValueCell.onDidClick(() => {
vscode.env.clipboard.writeText(endpoint.endpoint);
});
copyValueCell.title = localize('bdc.dashboard.copyTitle', "Copy");
copyValueCell.iconHeight = '14px';
copyValueCell.iconWidth = '14px';
endPointRow.addItem(copyValueCell, { CSSStyles: { 'width': '14px', 'min-width': '14px', 'padding-left': '10px', 'margin-block-start': '0px', 'margin-block-end': '0px' } });
container.addItem(endPointRow, { CSSStyles: { 'padding-left': '10px', 'border-top': 'solid 1px #ccc', 'border-bottom': isLastRow ? 'solid 1px #ccc' : '', 'box-sizing': 'border-box', 'user-select': 'text' } });
}

View File

@@ -1,210 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { BdcDashboardModel } from './bdcDashboardModel';
import { BdcStatusModel, InstanceStatusModel } from '../controller/apiGenerated';
import { getHealthStatusDisplayText, getHealthStatusIcon, getStateDisplayText } from '../utils';
const localize = nls.loadMessageBundle();
export interface IGroup {
groupName: string;
instances: IInstanceStatus[];
}
export interface IInstanceStatus {
instanceName: string;
state: string;
healthStatus: string;
}
const healthAndStatusIconColumnWidth = '50px';
const healthAndStatusInstanceNameColumnWidth = '100px';
const healthAndStatusStateColumnWidth = '75px';
const healthAndStatusHealthColumnWidth = '75px';
const metricsAndLogsInstanceNameColumnWidth = '100px';
const metricsAndLogsMetricsColumnWidth = '75px';
const metricsAndLogsLogsColumnWidth = '75px';
export class BdcDashboardResourceStatusPage {
private rootContainer: azdata.FlexContainer;
private instanceHealthStatusRowsContainer: azdata.FlexContainer;
private metricsAndLogsRowsContainer: azdata.FlexContainer;
private lastUpdatedLabel: azdata.TextComponent;
private initialized: boolean = false;
constructor(private model: BdcDashboardModel, private modelView: azdata.ModelView, private serviceName: string, private resourceName: string) {
this.model.onDidUpdateBdcStatus(bdcStatus => this.handleBdcStatusUpdate(bdcStatus));
this.rootContainer = this.createContainer(modelView);
}
public get container(): azdata.FlexContainer {
return this.rootContainer;
}
private createContainer(view: azdata.ModelView): azdata.FlexContainer {
const rootContainer = view.modelBuilder.flexContainer().withLayout(
{
flexFlow: 'column',
width: '100%',
height: '100%',
alignItems: 'left'
}).component();
// ##############################
// # INSTANCE HEALTH AND STATUS #
// ##############################
const healthStatusHeaderContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row', height: '20px' }).component();
rootContainer.addItem(healthStatusHeaderContainer, { CSSStyles: { 'padding-left': '10px', 'padding-top': '15px' } });
// Header label
const healthStatusHeaderLabel = view.modelBuilder.text()
.withProperties<azdata.TextComponentProperties>({
value: localize('bdc.dashboard.healthStatusDetailsHeader', "Health Status Details"),
CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '10px' }
})
.component();
healthStatusHeaderContainer.addItem(healthStatusHeaderLabel, { CSSStyles: { 'font-size': '20px', 'font-weight': 'bold' } });
// Last updated label
this.lastUpdatedLabel = view.modelBuilder.text()
.withProperties({
value: localize('bdc.dashboard.lastUpdated', "Last Updated : {0}", '-'),
CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'color': 'lightgray' }
}).component();
healthStatusHeaderContainer.addItem(this.lastUpdatedLabel, { CSSStyles: { 'margin-left': '45px' } });
healthStatusHeaderContainer.addItem(healthStatusHeaderLabel, { CSSStyles: { 'font-size': '20px', 'font-weight': 'bold' } });
// Header row
const instanceHealthStatusHeaderRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
const instanceHealthAndStatusIconHeader = view.modelBuilder.text().component();
instanceHealthStatusHeaderRow.addItem(instanceHealthAndStatusIconHeader, { CSSStyles: { 'width': healthAndStatusIconColumnWidth, 'min-width': healthAndStatusIconColumnWidth, 'font-weight': 'bold', 'user-select': 'text' } });
const instanceHealthAndStatusNameHeader = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.instanceHeader', "Instance") }).component();
instanceHealthStatusHeaderRow.addItem(instanceHealthAndStatusNameHeader, { CSSStyles: { 'width': healthAndStatusInstanceNameColumnWidth, 'min-width': healthAndStatusInstanceNameColumnWidth, 'font-weight': 'bold', 'user-select': 'text' } });
const instanceHealthAndStatusState = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.stateHeader', "State") }).component();
instanceHealthStatusHeaderRow.addItem(instanceHealthAndStatusState, { CSSStyles: { 'width': healthAndStatusStateColumnWidth, 'min-width': healthAndStatusStateColumnWidth, 'font-weight': 'bold', 'user-select': 'text' } });
const instanceHealthAndStatusHealthStatus = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.healthStatusHeader', "Health Status") }).component();
instanceHealthStatusHeaderRow.addItem(instanceHealthAndStatusHealthStatus, { CSSStyles: { 'width': healthAndStatusHealthColumnWidth, 'min-width': healthAndStatusHealthColumnWidth, 'font-weight': 'bold', 'user-select': 'text' } });
rootContainer.addItem(instanceHealthStatusHeaderRow, { flex: '0 0 auto', CSSStyles: { 'padding-left': '10px', 'box-sizing': 'border-box', 'user-select': 'text' } });
this.instanceHealthStatusRowsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
rootContainer.addItem(this.instanceHealthStatusRowsContainer, { flex: '0 0 auto' });
// ####################
// # METRICS AND LOGS #
// ####################
// Title label
const endpointsLabel = view.modelBuilder.text()
.withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.metricsAndLogsLabel', "Metrics and Logs"), CSSStyles: { 'margin-block-start': '20px', 'margin-block-end': '0px' } })
.component();
rootContainer.addItem(endpointsLabel, { CSSStyles: { 'font-size': '20px', 'font-weight': 'bold', 'padding-left': '10px' } });
// Header row
const metricsAndLogsHeaderRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
const nameCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.instanceHeader', "Instance") }).component();
metricsAndLogsHeaderRow.addItem(nameCell, { CSSStyles: { 'width': metricsAndLogsInstanceNameColumnWidth, 'min-width': metricsAndLogsInstanceNameColumnWidth, 'font-weight': 'bold', 'user-select': 'text' } });
const metricsCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.metricsHeader', "Metrics") }).component();
metricsAndLogsHeaderRow.addItem(metricsCell, { CSSStyles: { 'width': metricsAndLogsMetricsColumnWidth, 'min-width': metricsAndLogsMetricsColumnWidth, 'font-weight': 'bold', 'user-select': 'text' } });
const healthStatusCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: localize('bdc.dashboard.logsHeader', "Logs") }).component();
metricsAndLogsHeaderRow.addItem(healthStatusCell, { CSSStyles: { 'width': metricsAndLogsLogsColumnWidth, 'min-width': metricsAndLogsLogsColumnWidth, 'font-weight': 'bold', 'user-select': 'text' } });
rootContainer.addItem(metricsAndLogsHeaderRow, { flex: '0 0 auto', CSSStyles: { 'padding-left': '10px', 'box-sizing': 'border-box', 'user-select': 'text' } });
this.metricsAndLogsRowsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
rootContainer.addItem(this.metricsAndLogsRowsContainer, { flex: '0 0 auto' });
this.initialized = true;
this.handleBdcStatusUpdate(this.model.bdcStatus);
return rootContainer;
}
private handleBdcStatusUpdate(bdcStatus: BdcStatusModel): void {
const service = bdcStatus.services ? bdcStatus.services.find(s => s.serviceName === this.serviceName) : undefined;
const resource = service ? service.resources.find(r => r.resourceName === this.resourceName) : undefined;
if (!this.initialized || !resource) {
return;
}
this.lastUpdatedLabel.value =
localize('bdc.dashboard.lastUpdated', "Last Updated : {0}",
this.model.bdcStatusLastUpdated ?
`${this.model.bdcStatusLastUpdated.toLocaleDateString()} ${this.model.bdcStatusLastUpdated.toLocaleTimeString()}`
: '-');
this.instanceHealthStatusRowsContainer.clearItems();
this.metricsAndLogsRowsContainer.clearItems();
resource.instances.forEach(i => {
const instanceHealthStatusRow = createInstanceHealthStatusRow(this.modelView.modelBuilder, i);
this.instanceHealthStatusRowsContainer.addItem(instanceHealthStatusRow, { CSSStyles: { 'padding-left': '10px', 'border-top': 'solid 1px #ccc', 'box-sizing': 'border-box', 'user-select': 'text' } });
let metricsAndLogsRow = createMetricsAndLogsRow(this.modelView.modelBuilder, i);
this.metricsAndLogsRowsContainer.addItem(metricsAndLogsRow, { CSSStyles: { 'padding-left': '10px', 'border-top': 'solid 1px #ccc', 'box-sizing': 'border-box', 'user-select': 'text' } });
});
}
}
/**
* Creates a row with the name, state and health status for a particular instance on this resource
*
* @param modelBuilder The builder used to create the component
* @param instanceStatus The status object for the instance this row is for
*/
function createInstanceHealthStatusRow(modelBuilder: azdata.ModelBuilder, instanceStatus: InstanceStatusModel): azdata.FlexContainer {
const instanceHealthStatusRow = modelBuilder.flexContainer().withLayout({ flexFlow: 'row', alignItems: 'center', height: '30px' }).component();
const statusIconCell = modelBuilder.text()
.withProperties<azdata.TextComponentProperties>({
value: getHealthStatusIcon(instanceStatus.healthStatus),
CSSStyles: { 'user-select': 'none' }
}).component();
instanceHealthStatusRow.addItem(statusIconCell, { CSSStyles: { 'width': healthAndStatusIconColumnWidth, 'min-width': healthAndStatusIconColumnWidth } });
const nameCell = modelBuilder.text().withProperties({ value: instanceStatus.instanceName, CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px' } }).component();
instanceHealthStatusRow.addItem(nameCell, { CSSStyles: { 'width': healthAndStatusInstanceNameColumnWidth, 'min-width': healthAndStatusInstanceNameColumnWidth, 'user-select': 'text', 'margin-block-start': '0px', 'margin-block-end': '0px' } });
const stateCell = modelBuilder.text().withProperties({ value: getStateDisplayText(instanceStatus.state), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'text' } }).component();
instanceHealthStatusRow.addItem(stateCell, { CSSStyles: { 'width': healthAndStatusStateColumnWidth, 'min-width': healthAndStatusStateColumnWidth } });
const healthStatusCell = modelBuilder.text().withProperties({ value: getHealthStatusDisplayText(instanceStatus.healthStatus), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'text' } }).component();
instanceHealthStatusRow.addItem(healthStatusCell, { CSSStyles: { 'width': healthAndStatusHealthColumnWidth, 'min-width': healthAndStatusHealthColumnWidth } });
if (instanceStatus.healthStatus !== 'healthy' && instanceStatus.details && instanceStatus.details.length > 0) {
const viewDetailsButton = modelBuilder.button().withProperties<azdata.ButtonProperties>({ label: localize('bdc.dashboard.viewDetails', "View Details") }).component();
viewDetailsButton.onDidClick(() => {
vscode.window.showErrorMessage(instanceStatus.details);
});
instanceHealthStatusRow.addItem(viewDetailsButton, { flex: '0 0 auto' });
}
return instanceHealthStatusRow;
}
/**
* Creates a row with the name, link to the metrics and a link to the logs for a particular instance on this resource
* @param modelBuilder The builder used to create the component
* @param instanceStatus The status object for the instance this row is for
*/
function createMetricsAndLogsRow(modelBuilder: azdata.ModelBuilder, instanceStatus: InstanceStatusModel): azdata.FlexContainer {
const metricsAndLogsRow = modelBuilder.flexContainer().withLayout({ flexFlow: 'row', alignItems: 'center', height: '30px' }).component();
const nameCell = modelBuilder.text().withProperties({ value: instanceStatus.instanceName, CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px' } }).component();
metricsAndLogsRow.addItem(nameCell, { CSSStyles: { 'width': '100px', 'min-width': '100px', 'user-select': 'text', 'margin-block-start': '0px', 'margin-block-end': '0px' } });
const metricsCell = modelBuilder.hyperlink().withProperties({ label: localize('bdc.dashboard.viewHyperlink', "View"), url: instanceStatus.dashboards.nodeMetricsUrl, CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'text', 'color': '#0078d4', 'text-decoration': 'underline' } }).component();
metricsAndLogsRow.addItem(metricsCell, { CSSStyles: { 'width': '75px', 'min-width': '75px' } });
const logsCell = modelBuilder.hyperlink().withProperties({ label: localize('bdc.dashboard.viewHyperlink', "View"), url: instanceStatus.dashboards.logsUrl, CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'text', 'color': '#0078d4', 'text-decoration': 'underline' } }).component();
metricsAndLogsRow.addItem(logsCell, { CSSStyles: { 'width': '75px', 'min-width': '75px' } });
return metricsAndLogsRow;
}

View File

@@ -1,118 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { BdcStatusModel, ResourceStatusModel } from '../controller/apiGenerated';
import { BdcDashboardResourceStatusPage } from './bdcDashboardResourceStatusPage';
import { BdcDashboardModel } from './bdcDashboardModel';
import { getHealthStatusDot } from '../utils';
const selectedTabCss = { 'font-weight': 'bold' };
const unselectedTabCss = { 'font-weight': '' };
export class BdcServiceStatusPage {
private initialized: boolean = false;
private resourceTabsCreated: boolean = false;
private currentTabText: azdata.TextComponent;
private currentTabPage: azdata.FlexContainer;
private rootContainer: azdata.FlexContainer;
private resourceHeader: azdata.FlexContainer;
constructor(private serviceName: string, private model: BdcDashboardModel, private modelView: azdata.ModelView) {
this.model.onDidUpdateBdcStatus(bdcStatus => this.handleBdcStatusUpdate(bdcStatus));
this.createPage();
}
public get container(): azdata.FlexContainer {
return this.rootContainer;
}
private createPage(): void {
this.rootContainer = this.modelView.modelBuilder.flexContainer().withLayout(
{
flexFlow: 'column',
width: '100%',
height: '100%',
alignItems: 'left'
}).component();
this.resourceHeader = this.modelView.modelBuilder.flexContainer().withLayout(
{
flexFlow: 'row',
width: '100%',
height: '25px',
alignItems: 'left'
}
).component();
this.rootContainer.addItem(this.resourceHeader, { CSSStyles: { 'padding-top': '15px' } });
this.initialized = true;
this.handleBdcStatusUpdate(this.model.bdcStatus);
}
private handleBdcStatusUpdate(bdcStatus: BdcStatusModel): void {
if (!this.initialized || !bdcStatus) {
return;
}
const service = bdcStatus.services.find(s => s.serviceName === this.serviceName);
this.createResourceNavTabs(service.resources);
}
private changeSelectedTabPage(newPage: azdata.FlexContainer): void {
if (this.currentTabPage) {
this.rootContainer.removeItem(this.currentTabPage);
}
this.rootContainer.addItem(newPage);
this.currentTabPage = newPage;
}
/**
* Helper to create the navigation tabs for the resources
*/
private createResourceNavTabs(resources: ResourceStatusModel[]) {
if (this.initialized && !this.resourceTabsCreated) {
resources.forEach(resource => {
const resourceHeaderTab = createResourceHeaderTab(this.modelView.modelBuilder, resource);
const resourceStatusPage: azdata.FlexContainer = new BdcDashboardResourceStatusPage(this.model, this.modelView, this.serviceName, resource.resourceName).container;
resourceHeaderTab.div.onDidClick(() => {
if (this.currentTabText) {
this.currentTabText.updateCssStyles(unselectedTabCss);
}
this.changeSelectedTabPage(resourceStatusPage);
this.currentTabText = resourceHeaderTab.text;
this.currentTabText.updateCssStyles(selectedTabCss);
});
if (!this.currentTabPage) {
this.changeSelectedTabPage(resourceStatusPage);
this.currentTabText = resourceHeaderTab.text;
this.currentTabText.updateCssStyles(selectedTabCss);
}
this.resourceHeader.addItem(resourceHeaderTab.div, { flex: '0 0 auto', CSSStyles: { 'border-bottom': 'solid #ccc' } });
});
this.resourceTabsCreated = true;
}
}
}
/**
* Creates a single resource header tab
* @param modelBuilder The ModelBuilder used to construct the object
* @param title The text to display in the tab
*/
function createResourceHeaderTab(modelBuilder: azdata.ModelBuilder, resourceStatus: ResourceStatusModel): { div: azdata.DivContainer, text: azdata.TextComponent } {
const resourceHeaderTab = modelBuilder.divContainer().withLayout({ width: '100px', height: '25px' }).withProperties({ CSSStyles: { 'cursor': 'pointer' } }).component();
const innerContainer = modelBuilder.flexContainer().withLayout({ width: '100px', height: '25px', flexFlow: 'row' }).component();
innerContainer.addItem(modelBuilder.text().withProperties({ value: getHealthStatusDot(resourceStatus.healthStatus), CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'user-select': 'none', 'color': 'red', 'font-size': '40px', 'width': '20px', 'text-align': 'right' } }).component(), { flex: '0 0 auto' });
const resourceHeaderLabel = modelBuilder.text().withProperties({ value: resourceStatus.resourceName, CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px', 'text-align': 'left' } }).component();
innerContainer.addItem(resourceHeaderLabel);
resourceHeaderTab.addItem(innerContainer);
return { div: resourceHeaderTab, text: resourceHeaderLabel };
}

View File

@@ -11,9 +11,9 @@ import { TreeNode } from './treeNode';
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
import { AddControllerNode } from './addControllerNode';
import { ControllerRootNode, ControllerNode } from './controllerTreeNode';
import { IEndPoint } from '../controller/clusterControllerApi';
import { showErrorMessage } from '../utils';
import { LoadingControllerNode } from './loadingControllerNode';
import { EndpointModel } from '../controller/apiGenerated';
const CredentialNamespace = 'clusterControllerCredentials';
@@ -63,7 +63,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
username: string,
password: string,
rememberPassword: boolean,
masterInstance?: EndpointModel
masterInstance?: IEndPoint
): void {
this.removeNonControllerNodes();
this.root.addControllerNode(clusterName, url, username, password, rememberPassword, masterInstance);

View File

@@ -10,10 +10,9 @@ import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
import { TreeNode } from './treeNode';
import { IconPathHelper, BdcItemType, IconPath } from '../constants';
import { getEndPoints } from '../controller/clusterControllerApi';
import { IconPath, BdcItemType } from '../constants';
import { IEndPoint, IControllerError, getEndPoints } from '../controller/clusterControllerApi';
import { showErrorMessage } from '../utils';
import { EndpointModel } from '../controller/apiGenerated';
const localize = nls.loadMessageBundle();
@@ -25,7 +24,7 @@ export abstract class ControllerTreeNode extends TreeNode {
private _treeChangeHandler: IControllerTreeChangeHandler,
private _description?: string,
private _nodeType?: string,
private _iconPath?: IconPath
private _iconPath?: { dark: string, light: string }
) {
super(label, parent);
this._description = this._description || this.label;
@@ -84,11 +83,11 @@ export abstract class ControllerTreeNode extends TreeNode {
this._nodeType = nodeType;
}
public set iconPath(iconPath: IconPath) {
public set iconPath(iconPath: { dark: string, light: string }) {
this._iconPath = iconPath;
}
public get iconPath(): IconPath {
public get iconPath(): { dark: string, light: string } {
return this._iconPath;
}
@@ -119,7 +118,7 @@ export class ControllerRootNode extends ControllerTreeNode {
username: string,
password: string,
rememberPassword: boolean,
masterInstance?: EndpointModel
masterInstance?: IEndPoint
): void {
let controllerNode = this.getExistingControllerNode(url, username);
if (controllerNode) {
@@ -175,7 +174,7 @@ export class ControllerNode extends ControllerTreeNode {
treeChangeHandler: IControllerTreeChangeHandler,
description?: string,
) {
super(label, parent, treeChangeHandler, description, BdcItemType.controller, IconPathHelper.controllerNode);
super(label, parent, treeChangeHandler, description, BdcItemType.controller, IconPath.controllerNode);
this.label = label;
this.description = description;
@@ -192,7 +191,7 @@ export class ControllerNode extends ControllerTreeNode {
}
try {
let response = await getEndPoints(this._url, this._username, this._password, true);
let response = await getEndPoints(this._clusterName, this._url, this._username, this._password, true);
if (response && response.endPoints) {
let master = response.endPoints.find(e => e.name && e.name === 'sql-server-master');
this.addSqlMasterNode(master.endpoint, master.description);
@@ -204,7 +203,7 @@ export class ControllerNode extends ControllerTreeNode {
}
}
public static toIpAndPort(url: string): string {
private static toIpAndPort(url: string): string {
if (!url) {
return;
}
@@ -297,7 +296,7 @@ export class FolderNode extends ControllerTreeNode {
parent: ControllerTreeNode,
treeChangeHandler: IControllerTreeChangeHandler
) {
super(label, parent, treeChangeHandler, label, BdcItemType.folder, IconPathHelper.folderNode);
super(label, parent, treeChangeHandler, label, BdcItemType.folder, IconPath.folderNode);
}
}
@@ -313,7 +312,7 @@ export class SqlMasterNode extends ControllerTreeNode {
treeChangeHandler: IControllerTreeChangeHandler,
description?: string,
) {
super(label, parent, treeChangeHandler, description, BdcItemType.sqlMaster, IconPathHelper.sqlMasterNode);
super(label, parent, treeChangeHandler, description, BdcItemType.sqlMaster, IconPath.sqlMasterNode);
this._username = 'sa';
this.label = label;
this.description = description;

View File

@@ -6,33 +6,6 @@
'use strict';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
export enum Endpoint {
gateway = 'gateway',
sparkHistory = 'spark-history',
yarnUi = 'yarn-ui',
appProxy = 'app-proxy',
mgmtproxy = 'mgmtproxy',
managementProxy = 'management-proxy',
logsui = 'logsui',
metricsui = 'metricsui',
controller = 'controller',
sqlServerMaster = 'sql-server-master',
webhdfs = 'webhdfs',
livy = 'livy'
}
export enum Service {
sql = 'sql',
hdfs = 'hdfs',
spark = 'spark',
control = 'control',
gateway = 'gateway',
app = 'app'
}
export function generateGuid(): string {
let hexValues: string[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
@@ -53,159 +26,18 @@ export function generateGuid(): string {
return oct.substr(0, 8) + '-' + oct.substr(9, 4) + '-4' + oct.substr(13, 3) + '-' + clockSequenceHi + oct.substr(16, 3) + '-' + oct.substr(19, 12);
}
export function showErrorMessage(error: any, prefixText?: string): void {
export function showErrorMessage(error: any): void {
if (error) {
let text: string = prefixText || '';
let text: string = undefined;
if (typeof error === 'string') {
text += error as string;
text = error as string;
} else if (typeof error === 'object' && error !== null) {
let message = error.message;
let code = error.code || error.errno;
text += `${message}${code ? ` (${code})` : ''}`;
text = (code ? `${code} ` : '') + message;
} else {
text += `${error}`;
text = `${error}`;
}
vscode.window.showErrorMessage(text);
}
}
/**
* Gets the localized text to display for a corresponding state
* @param state The state to get the display text for
*/
export function getStateDisplayText(state?: string): string {
state = state || '';
switch (state.toLowerCase()) {
case 'creating':
return localize('state.creating', "Creating");
case 'waiting':
return localize('state.waiting', "Waiting");
case 'ready':
return localize('state.ready', "Ready");
case 'deleting':
return localize('state.deleting', "Deleting");
case 'waitingfordeletion':
return localize('state.waitingForDeletion', "Waiting For Deletion");
case 'deleted':
return localize('state.deleted', "Deleted");
case 'upgrading':
return localize('state.upgrading', "Upgrading");
case 'waitingforupgrade':
return localize('state.waitingForUpgrade', "Waiting For Upgrade");
case 'error':
return localize('state.error', "Error");
case 'running':
return localize('state.running', "Running");
default:
return state;
}
}
/**
* Gets the localized text to display for a corresponding endpoint
* @param serviceName The endpoint name to get the display text for
* @param description The backup description to use if we don't have our own
*/
export function getEndpointDisplayText(endpointName?: string, description?: string): string {
endpointName = endpointName || '';
switch (endpointName.toLowerCase()) {
case Endpoint.appProxy:
return localize('endpoint.appproxy', "Application Proxy");
case Endpoint.controller:
return localize('endpoint.controller', "Cluster Management Service");
case Endpoint.gateway:
return localize('endpoint.gateway', "Gateway to access HDFS files, Spark");
case Endpoint.managementProxy:
return localize('endpoint.managementproxy', "Management Proxy");
case Endpoint.mgmtproxy:
return localize('endpoint.mgmtproxy', "Management Proxy");
case Endpoint.sqlServerMaster:
return localize('endpoint.sqlServerEndpoint', "SQL Server Master Instance Front-End");
case Endpoint.metricsui:
return localize('endpoint.grafana', "Metrics Dashboard");
case Endpoint.logsui:
return localize('endpoint.kibana', "Log Search Dashboard");
case Endpoint.yarnUi:
return localize('endpoint.yarnHistory', "Spark Diagnostics and Monitoring Dashboard");
case Endpoint.sparkHistory:
return localize('endpoint.sparkHistory', "Spark Jobs Management and Monitoring Dashboard");
case Endpoint.webhdfs:
return localize('endpoint.webhdfs', "HDFS File System Proxy");
case Endpoint.livy:
return localize('endpoint.livy', "Proxy for running Spark statements, jobs, applications");
default:
// Default is to use the description if one was given, otherwise worst case just fall back to using the
// original endpoint name
return description && description.length > 0 ? description : endpointName;
}
}
/**
* Gets the localized text to display for a corresponding service
* @param serviceName The service name to get the display text for
*/
export function getServiceNameDisplayText(serviceName?: string): string {
serviceName = serviceName || '';
switch (serviceName.toLowerCase()) {
case Service.sql:
return localize('service.sql', "SQL Server");
case Service.hdfs:
return localize('service.hdfs', "HDFS");
case Service.spark:
return localize('service.spark', "Spark");
case Service.control:
return localize('service.control', "Control");
case Service.gateway:
return localize('service.gateway', "Gateway");
case Service.app:
return localize('service.app', "App");
default:
return serviceName;
}
}
/**
* Gets the localized text to display for a corresponding health status
* @param healthStatus The health status to get the display text for
*/
export function getHealthStatusDisplayText(healthStatus?: string) {
healthStatus = healthStatus || '';
switch (healthStatus.toLowerCase()) {
case 'healthy':
return localize('bdc.healthy', "Healthy");
case 'unhealthy':
return localize('bdc.unhealthy', "Unhealthy");
default:
return healthStatus;
}
}
/**
* Returns the status icon for the corresponding health status
* @param healthStatus The status to check
*/
export function getHealthStatusIcon(healthStatus?: string): string {
healthStatus = healthStatus || '';
switch (healthStatus.toLowerCase()) {
case 'healthy':
return '✔️';
default:
// Consider all non-healthy status' as errors
return '⚠️';
}
}
/**
* Returns the status dot string which will be a • for all non-healthy states
* @param healthStatus The status to check
*/
export function getHealthStatusDot(healthStatus?: string): string {
healthStatus = healthStatus || '';
switch (healthStatus.toLowerCase()) {
case 'healthy':
return '';
default:
// Display status dot for all non-healthy status'
return '•';
}
}

View File

@@ -8,27 +8,25 @@
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { ControllerTreeDataProvider } from './bigDataCluster/tree/controllerTreeDataProvider';
import { IconPathHelper } from './bigDataCluster/constants';
import { IconPath } from './bigDataCluster/constants';
import { TreeNode } from './bigDataCluster/tree/treeNode';
import { AddControllerDialogModel, AddControllerDialog } from './bigDataCluster/dialog/addControllerDialog';
import { ControllerNode } from './bigDataCluster/tree/controllerTreeNode';
import { BdcDashboard } from './bigDataCluster/dialog/bdcDashboard';
import { BdcDashboardModel } from './bigDataCluster/dialog/bdcDashboardModel';
const localize = nls.loadMessageBundle();
const AddControllerCommand = 'bigDataClusters.command.addController';
const DeleteControllerCommand = 'bigDataClusters.command.deleteController';
const RefreshControllerCommand = 'bigDataClusters.command.refreshController';
const ManageControllerCommand = 'bigDataClusters.command.manageController';
let throttleTimers: { [key: string]: any } = {};
export function activate(extensionContext: vscode.ExtensionContext) {
IconPathHelper.setExtensionContext(extensionContext);
IconPath.setExtensionContext(extensionContext);
let treeDataProvider = new ControllerTreeDataProvider(extensionContext.globalState);
registerTreeDataProvider(treeDataProvider);
registerCommands(extensionContext, treeDataProvider);
registerCommands(treeDataProvider);
}
export function deactivate() {
@@ -38,7 +36,7 @@ function registerTreeDataProvider(treeDataProvider: ControllerTreeDataProvider):
vscode.window.registerTreeDataProvider('sqlBigDataCluster', treeDataProvider);
}
function registerCommands(context: vscode.ExtensionContext, treeDataProvider: ControllerTreeDataProvider): void {
function registerCommands(treeDataProvider: ControllerTreeDataProvider): void {
vscode.commands.registerCommand(AddControllerCommand, (node?: TreeNode) => {
runThrottledAction(AddControllerCommand, () => addBdcController(treeDataProvider, node));
});
@@ -53,12 +51,6 @@ function registerCommands(context: vscode.ExtensionContext, treeDataProvider: Co
}
treeDataProvider.notifyNodeChanged(node);
});
vscode.commands.registerCommand(ManageControllerCommand, async (node: ControllerNode) => {
const title: string = `${localize('bdc.dashboard.title', "Big Data Cluster Dashboard -")} ${ControllerNode.toIpAndPort(node.url)} ${localize('bdc.dash', "-")} ${node.clusterName}`;
const dashboard: BdcDashboard = new BdcDashboard(title, new BdcDashboardModel(node.clusterName, node.url, node.username, node.password));
dashboard.showDashboard();
});
}
function addBdcController(treeDataProvider: ControllerTreeDataProvider, node?: TreeNode): void {
@@ -98,6 +90,8 @@ function deleteControllerInternal(treeDataProvider: ControllerTreeDataProvider,
}
}
/**
* Throttles actions to avoid bug where on clicking in tree, action gets called twice
* instead of once. Any right-click action is safe, just the default on-click action in a tree
@@ -112,4 +106,4 @@ function runThrottledAction(id: string, action: () => void) {
}, 150);
}
// else ignore this as we got an identical action in the last 150ms
}
}

View File

@@ -2,7 +2,7 @@
"name": "cms",
"displayName": "%cms.displayName%",
"description": "%cms.description%",
"version": "0.5.0",
"version": "0.4.0",
"publisher": "Microsoft",
"preview": true,
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",

View File

@@ -43,12 +43,13 @@ export class CmsResourceTreeNode extends CmsResourceTreeNodeBase {
this.connection.options.password = await this.appContext.cmsUtils.getPassword(this.connection.options.user);
}
}
return this.appContext.cmsUtils.createCmsServer(this.connection, this.name, this.description).then(async (result) => {
// update the owner uri and the connection
this._ownerUri = result.ownerUri;
this._connection = result.connection;
await this.appContext.cmsUtils.cacheRegisteredCmsServer(this.name, this.description, this.ownerUri, this.connection);
return this.appContext.cmsUtils.createCmsServer(this.connection, this.name, this.description).then((result) => {
// cache new connection is different from old one
if (this.appContext.cmsUtils.didConnectionChange(this._connection, result.connection)) {
this._connection = result.connection;
this._ownerUri = result.ownerUri;
this.appContext.cmsUtils.cacheRegisteredCmsServer(this.name, this.description, this.ownerUri, this.connection);
}
if (result.listRegisteredServersResult.registeredServersList) {
result.listRegisteredServersResult.registeredServersList.forEach((registeredServer) => {
nodes.push(new RegisteredServerTreeNode(

View File

@@ -46,7 +46,7 @@ export class CmsResourceTreeProvider implements TreeDataProvider<TreeNode>, ICms
server.ownerUri,
server.connection,
this._appContext, this, null));
await this.appContext.cmsUtils.cacheRegisteredCmsServer(server.name, server.description,
this.appContext.cmsUtils.cacheRegisteredCmsServer(server.name, server.description,
server.ownerUri, server.connection);
});
return servers;

View File

@@ -7,7 +7,7 @@
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import * as mssql from '../../mssql';
import * as mssql from '../../mssql/src/api/mssqlapis';
import * as Utils from './cmsResource/utils';
import { ICmsResourceNodeInfo } from './cmsResource/tree/baseTreeNodes';
@@ -37,7 +37,7 @@ export class CmsUtils {
}
private _credentialProvider: azdata.CredentialProvider;
private _cmsService: mssql.ICmsService;
private _cmsService: mssql.CmsService;
private _registeredCmsServers: ICmsResourceNodeInfo[] = [];
public async savePassword(username: string, password: string): Promise<boolean> {
@@ -82,9 +82,10 @@ export class CmsUtils {
}
// CMS APIs
public async getCmsService(): Promise<mssql.ICmsService> {
public async getCmsService(): Promise<mssql.CmsService> {
if (!this._cmsService) {
this._cmsService = (vscode.extensions.getExtension(mssql.extension.name).exports as mssql.IExtension).cmsService;
let extensionApi: mssql.MssqlExtensionApi = vscode.extensions.getExtension('Microsoft.mssql').exports;
this._cmsService = await extensionApi.getCmsServiceProvider();
}
return this._cmsService;
}
@@ -126,7 +127,7 @@ export class CmsUtils {
}
public async deleteCmsServer(cmsServerName: string, connection: azdata.connection.Connection): Promise<void> {
const servers: ICmsResourceNodeInfo[] = this._memento.get('centralManagementServers');
const servers: ICmsResourceNodeInfo[] = this._memento.get('servers');
if (servers) {
const newServers: ICmsResourceNodeInfo[] = servers.filter((cachedServer) => {
return cachedServer.name !== cmsServerName;

View File

@@ -18,7 +18,7 @@
"watch": "gulp watch-extension:configuration-editing"
},
"dependencies": {
"jsonc-parser": "^2.1.1",
"jsonc-parser": "2.0.2",
"vscode-nls": "^4.0.0"
},
"contributes": {

View File

@@ -129,13 +129,6 @@
"type": "string",
"description": "The service you want to work on."
},
"runServices": {
"type": "array",
"description": "An array of services that should be started and stopped.",
"items": {
"type": "string"
}
},
"workspaceFolder": {
"type": "string",
"description": "The path of the workspace folder inside the container."
@@ -185,4 +178,4 @@
"$ref": "#/definitions/devContainerCommon"
}
]
}
}

View File

@@ -7,10 +7,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9"
integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw==
jsonc-parser@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.1.1.tgz#83dc3d7a6e7186346b889b1280eefa04446c6d3e"
integrity sha512-VC0CjnWJylKB1iov4u76/W/5Ef0ydDkjtYWxoZ9t3HdWlSnZQwZL5MgFikaB/EtQ4RmMEw3tmQzuYnZA2/Ja1g==
jsonc-parser@2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.2.tgz#42fcf56d70852a043fadafde51ddb4a85649978d"
integrity sha512-TSU435K5tEKh3g7bam1AFf+uZrISheoDsLlpmAo6wWZYqjsnd09lHYK1Qo+moK4Ikifev1Gdpa69g4NELKnCrQ==
vscode-nls@^4.0.0:
version "4.0.0"

View File

@@ -2,7 +2,7 @@
"name": "dacpac",
"displayName": "SQL Server Dacpac",
"description": "SQL Server Dacpac for Azure Data Studio.",
"version": "0.6.0",
"version": "0.5.0",
"publisher": "Microsoft",
"preview": true,
"engines": {
@@ -66,4 +66,4 @@
"publisherDisplayName": "Microsoft",
"publisherId": "Microsoft"
}
}
}

View File

@@ -9,7 +9,7 @@ import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as os from 'os';
import * as path from 'path';
import { DataTierApplicationWizard, Operation } from '../dataTierApplicationWizard';
import { DataTierApplicationWizard } from '../dataTierApplicationWizard';
import { DacFxDataModel } from './models';
import { BasePage } from './basePage';
import { sanitizeStringForFilename, isValidBasename } from './utils';
@@ -45,10 +45,8 @@ export abstract class DacFxConfigPage extends BasePage {
}
protected async createServerDropdown(isTargetServer: boolean): Promise<azdata.FormComponent> {
const serverDropDownTitle = isTargetServer ? localize('dacFx.targetServerDropdownTitle', "Target Server") : localize('dacFx.sourceServerDropdownTitle', "Source Server");
this.serverDropdown = this.view.modelBuilder.dropDown().withProperties({
required: true,
ariaLabel: serverDropDownTitle
required: true
}).component();
// Handle server changes
@@ -58,9 +56,12 @@ export abstract class DacFxConfigPage extends BasePage {
await this.populateDatabaseDropdown();
});
let targetServerTitle = localize('dacFx.targetServerDropdownTitle', 'Target Server');
let sourceServerTitle = localize('dacFx.sourceServerDropdownTitle', 'Source Server');
return {
component: this.serverDropdown,
title: serverDropDownTitle
title: isTargetServer ? targetServerTitle : sourceServerTitle
};
}
@@ -84,7 +85,6 @@ export abstract class DacFxConfigPage extends BasePage {
required: true
}).component();
this.databaseTextBox.ariaLabel = localize('dacfx.databaseAriaLabel', "Database");
this.databaseTextBox.onTextChanged(async () => {
this.model.database = this.databaseTextBox.value;
});
@@ -96,10 +96,7 @@ export abstract class DacFxConfigPage extends BasePage {
}
protected async createDatabaseDropdown(): Promise<azdata.FormComponent> {
const databaseDropdownTitle = localize('dacFx.sourceDatabaseDropdownTitle', "Source Database");
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
ariaLabel: databaseDropdownTitle
}).component();
this.databaseDropdown = this.view.modelBuilder.dropDown().component();
// Handle database changes
this.databaseDropdown.onValueChanged(async () => {
@@ -112,10 +109,9 @@ export abstract class DacFxConfigPage extends BasePage {
required: true
}).component();
return {
component: this.databaseLoader,
title: databaseDropdownTitle
title: localize('dacFx.sourceDatabaseDropdownTitle', 'Source Database')
};
}
@@ -132,15 +128,9 @@ export abstract class DacFxConfigPage extends BasePage {
// only update values and regenerate filepath if this is the first time and database isn't set yet
if (this.model.database !== values[0].name) {
// db should only get set to the dropdown value if it isn't deploy with create database
if (!(this.instance.selectedOperation === Operation.deploy && !this.model.upgradeExisting)) {
this.model.database = values[0].name;
}
// filename shouldn't change for deploy because the file exists and isn't being generated as for extract and export
if (this.instance.selectedOperation !== Operation.deploy) {
this.model.filePath = this.generateFilePathFromDatabaseAndTimestamp();
this.fileTextBox.value = this.model.filePath;
}
this.model.database = values[0].name;
this.model.filePath = this.generateFilePathFromDatabaseAndTimestamp();
this.fileTextBox.value = this.model.filePath;
}
this.databaseDropdown.updateProperties({
@@ -156,15 +146,11 @@ export abstract class DacFxConfigPage extends BasePage {
component => isValidBasename(component.value)
)
.withProperties({
required: true,
ariaLive: 'polite'
required: true
}).component();
this.fileTextBox.ariaLabel = localize('dacfx.fileLocationAriaLabel', "File Location");
this.fileButton = this.view.modelBuilder.button().withProperties({
label: '•••',
title: localize('dacfx.selectFile', "Select file"),
ariaLabel: localize('dacfx.selectFile', "Select file")
}).component();
}

View File

@@ -15,7 +15,6 @@ import { ExtractConfigPage } from './pages/extractConfigPage';
import { ImportConfigPage } from './pages/importConfigPage';
import { DacFxDataModel } from './api/models';
import { BasePage } from './api/basePage';
import * as mssql from '../../../mssql';
const localize = nls.loadMessageBundle();
const msSqlProvider = 'MSSQL';
@@ -67,16 +66,6 @@ export enum ExportOperationPath {
summary
}
export enum PageName {
selectOperation = 'selectOperation',
deployConfig = 'deployConfig',
deployPlan = 'deployPlan',
extractConfig = 'extractConfig',
importConfig = 'importConfig',
exportConfig = 'exportConfig',
summary = 'summary'
}
export class DataTierApplicationWizard {
public wizard: azdata.window.Wizard;
private connection: azdata.connection.ConnectionProfile;
@@ -118,13 +107,13 @@ export class DataTierApplicationWizard {
let importConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.importConfigPageName', 'Select Import Bacpac Settings'));
let exportConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.exportConfigPageName', 'Select Export Bacpac Settings'));
this.pages.set(PageName.selectOperation, new Page(selectOperationWizardPage));
this.pages.set(PageName.deployConfig, new Page(deployConfigWizardPage));
this.pages.set(PageName.deployPlan, new Page(deployPlanWizardPage));
this.pages.set(PageName.extractConfig, new Page(extractConfigWizardPage));
this.pages.set(PageName.importConfig, new Page(importConfigWizardPage));
this.pages.set(PageName.exportConfig, new Page(exportConfigWizardPage));
this.pages.set(PageName.summary, new Page(summaryWizardPage));
this.pages.set('selectOperation', new Page(selectOperationWizardPage));
this.pages.set('deployConfig', new Page(deployConfigWizardPage));
this.pages.set('deployPlan', new Page(deployPlanWizardPage));
this.pages.set('extractConfig', new Page(extractConfigWizardPage));
this.pages.set('importConfig', new Page(importConfigWizardPage));
this.pages.set('exportConfig', new Page(exportConfigWizardPage));
this.pages.set('summary', new Page(summaryWizardPage));
selectOperationWizardPage.registerContent(async (view) => {
let selectOperationDacFxPage = new SelectOperationPage(this, selectOperationWizardPage, this.model, view);
@@ -137,37 +126,37 @@ export class DataTierApplicationWizard {
deployConfigWizardPage.registerContent(async (view) => {
let deployConfigDacFxPage = new DeployConfigPage(this, deployConfigWizardPage, this.model, view);
this.pages.get(PageName.deployConfig).dacFxPage = deployConfigDacFxPage;
this.pages.get('deployConfig').dacFxPage = deployConfigDacFxPage;
await deployConfigDacFxPage.start();
});
deployPlanWizardPage.registerContent(async (view) => {
let deployPlanDacFxPage = new DeployPlanPage(this, deployPlanWizardPage, this.model, view);
this.pages.get(PageName.deployPlan).dacFxPage = deployPlanDacFxPage;
this.pages.get('deployPlan').dacFxPage = deployPlanDacFxPage;
await deployPlanDacFxPage.start();
});
extractConfigWizardPage.registerContent(async (view) => {
let extractConfigDacFxPage = new ExtractConfigPage(this, extractConfigWizardPage, this.model, view);
this.pages.get(PageName.extractConfig).dacFxPage = extractConfigDacFxPage;
this.pages.get('extractConfig').dacFxPage = extractConfigDacFxPage;
await extractConfigDacFxPage.start();
});
importConfigWizardPage.registerContent(async (view) => {
let importConfigDacFxPage = new ImportConfigPage(this, importConfigWizardPage, this.model, view);
this.pages.get(PageName.importConfig).dacFxPage = importConfigDacFxPage;
this.pages.get('importConfig').dacFxPage = importConfigDacFxPage;
await importConfigDacFxPage.start();
});
exportConfigWizardPage.registerContent(async (view) => {
let exportConfigDacFxPage = new ExportConfigPage(this, exportConfigWizardPage, this.model, view);
this.pages.get(PageName.exportConfig).dacFxPage = exportConfigDacFxPage;
this.pages.get('exportConfig').dacFxPage = exportConfigDacFxPage;
await exportConfigDacFxPage.start();
});
summaryWizardPage.registerContent(async (view) => {
let summaryDacFxPage = new DacFxSummaryPage(this, summaryWizardPage, this.model, view);
this.pages.get(PageName.summary).dacFxPage = summaryDacFxPage;
this.pages.get('summary').dacFxPage = summaryDacFxPage;
await summaryDacFxPage.start();
});
@@ -323,26 +312,26 @@ export class DataTierApplicationWizard {
if (idx === 1) {
switch (this.selectedOperation) {
case Operation.deploy: {
page = this.pages.get(PageName.deployConfig);
page = this.pages.get('deployConfig');
break;
}
case Operation.extract: {
page = this.pages.get(PageName.extractConfig);
page = this.pages.get('extractConfig');
break;
}
case Operation.import: {
page = this.pages.get(PageName.importConfig);
page = this.pages.get('importConfig');
break;
}
case Operation.export: {
page = this.pages.get(PageName.exportConfig);
page = this.pages.get('exportConfig');
break;
}
}
} else if (this.isSummaryPage(idx)) {
page = this.pages.get(PageName.summary);
page = this.pages.get('summary');
} else if ((this.selectedOperation === Operation.deploy || this.selectedOperation === Operation.generateDeployScript) && idx === DeployOperationPath.deployPlan) {
page = this.pages.get(PageName.deployPlan);
page = this.pages.get('deployPlan');
}
return page;
@@ -370,8 +359,8 @@ export class DataTierApplicationWizard {
return result.report;
}
private static async getService(providerName: string): Promise<mssql.IDacFxService> {
const service = (vscode.extensions.getExtension(mssql.extension.name).exports as mssql.IExtension).dacFx;
private static async getService(providerName: string): Promise<azdata.DacFxServicesProvider> {
const service = azdata.dataprotocol.getProvider<azdata.DacFxServicesProvider>(providerName, azdata.DataProviderType.DacFxServicesProvider);
return service;
}
}

View File

@@ -32,9 +32,7 @@ export class DacFxSummaryPage extends BasePage {
}
async start(): Promise<boolean> {
this.table = this.view.modelBuilder.table().withProperties({
title: localize('dacfx.summaryTableTitle', 'Summary of settings')
}).component();
this.table = this.view.modelBuilder.table().component();
this.loader = this.view.modelBuilder.loadingComponent().withItem(this.table).component();
this.form = this.view.modelBuilder.formContainer().withFormItems(
[
@@ -130,8 +128,8 @@ export class DacFxSummaryPage extends BasePage {
cssClass: 'align-with-header'
}],
width: 700,
height: 200,
moveFocusOutWithTab: true
height: 200
});
}
}

View File

@@ -10,9 +10,8 @@ import * as vscode from 'vscode';
import * as path from 'path';
import * as os from 'os';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard, DeployOperationPath, Operation, DeployNewOperationPath, PageName } from '../dataTierApplicationWizard';
import { DataTierApplicationWizard, DeployOperationPath, Operation } from '../dataTierApplicationWizard';
import { DacFxConfigPage } from '../api/dacFxConfigPage';
import { DacFxSummaryPage } from './dacFxSummaryPage';
const localize = nls.loadMessageBundle();
@@ -29,7 +28,7 @@ export class DeployConfigPage extends DacFxConfigPage {
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
super(instance, wizardPage, model, view);
this.fileExtension = '.dacpac';
this.fileExtension = '.bacpac';
}
async start(): Promise<boolean> {
@@ -124,12 +123,9 @@ export class DeployConfigPage extends DacFxConfigPage {
this.formBuilder.addFormItem(this.databaseDropdownComponent, { horizontal: true, componentWidth: 400 });
this.model.database = (<azdata.CategoryValue>this.databaseDropdown.value).name;
// add deploy plan page and remove and re-add summary page so that it has the correct page number
this.instance.wizard.removePage(DeployNewOperationPath.summary);
let deployPlanPage = this.instance.pages.get(PageName.deployPlan);
let summaryPage = this.instance.pages.get(PageName.summary);
// add deploy plan page
let deployPlanPage = this.instance.pages.get('deployPlan');
this.instance.wizard.addPage(deployPlanPage.wizardPage, DeployOperationPath.deployPlan);
this.instance.wizard.addPage(summaryPage.wizardPage, DeployOperationPath.summary);
});
newRadioButton.onDidClick(() => {
@@ -139,11 +135,8 @@ export class DeployConfigPage extends DacFxConfigPage {
this.model.database = this.databaseTextBox.value;
this.instance.setDoneButton(Operation.deploy);
// remove deploy plan page and readd summary page so that it has the correct page number
this.instance.wizard.removePage(DeployOperationPath.summary);
// remove deploy plan page
this.instance.wizard.removePage(DeployOperationPath.deployPlan);
let summaryPage = this.instance.pages.get(PageName.summary);
this.instance.wizard.addPage(summaryPage.wizardPage, DeployNewOperationPath.summary);
});
//Initialize with upgrade existing true
@@ -164,10 +157,7 @@ export class DeployConfigPage extends DacFxConfigPage {
}
protected async createDeployDatabaseDropdown(): Promise<azdata.FormComponent> {
const targetDatabaseTitle = localize('dacFx.targetDatabaseDropdownTitle', "Database Name");
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
ariaLabel: targetDatabaseTitle
}).component();
this.databaseDropdown = this.view.modelBuilder.dropDown().component();
//Handle database changes
this.databaseDropdown.onValueChanged(async () => {
@@ -180,7 +170,7 @@ export class DeployConfigPage extends DacFxConfigPage {
return {
component: this.databaseLoader,
title: targetDatabaseTitle
title: localize('dacFx.targetDatabaseDropdownTitle', 'Database Name')
};
}

View File

@@ -99,8 +99,7 @@ export class DeployPlanPage extends DacFxConfigPage {
data: this.getColumnData(result),
columns: this.getTableColumns(result.dataLossAlerts.size > 0),
width: 875,
height: 300,
ariaRole: 'alert'
height: 300
});
if (result.dataLossAlerts.size > 0) {

View File

@@ -111,9 +111,8 @@ export class ExtractConfigPage extends DacFxConfigPage {
required: true
}).component();
// default version
// default filepath
this.versionTextBox.value = '1.0.0.0';
this.versionTextBox.ariaLabel = localize('dacfx.versionAriaLabel', "Version");
this.model.version = this.versionTextBox.value;
this.versionTextBox.onTextChanged(async () => {

View File

@@ -7,7 +7,7 @@
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard, Operation, DeployOperationPath, ExtractOperationPath, ImportOperationPath, ExportOperationPath, PageName } from '../dataTierApplicationWizard';
import { DataTierApplicationWizard, Operation, DeployOperationPath, ExtractOperationPath, ImportOperationPath, ExportOperationPath } from '../dataTierApplicationWizard';
import { BasePage } from '../api/basePage';
const localize = nls.loadMessageBundle();
@@ -39,10 +39,6 @@ export class SelectOperationPage extends BasePage {
let importComponent = await this.createImportRadioButton();
let exportComponent = await this.createExportRadioButton();
// default have the first radio button checked
this.deployRadioButton.checked = true;
this.deployRadioButton.focused = true;
this.form = this.view.modelBuilder.formContainer()
.withFormItems(
[
@@ -55,6 +51,8 @@ export class SelectOperationPage extends BasePage {
}).component();
await this.view.initializeModel(this.form);
// default have the first radio button checked
this.deployRadioButton.checked = true;
this.instance.setDoneButton(Operation.deploy);
return true;
}
@@ -74,9 +72,9 @@ export class SelectOperationPage extends BasePage {
this.removePages();
//add deploy pages
let configPage = this.instance.pages.get(PageName.deployConfig);
let configPage = this.instance.pages.get('deployConfig');
this.instance.wizard.addPage(configPage.wizardPage, DeployOperationPath.deployOptions);
let deployPlanPage = this.instance.pages.get(PageName.deployPlan);
let deployPlanPage = this.instance.pages.get('deployPlan');
this.instance.wizard.addPage(deployPlanPage.wizardPage, DeployOperationPath.deployPlan);
this.addSummaryPage(DeployOperationPath.summary);
@@ -101,7 +99,7 @@ export class SelectOperationPage extends BasePage {
this.removePages();
// add the extract page
let page = this.instance.pages.get(PageName.extractConfig);
let page = this.instance.pages.get('extractConfig');
this.instance.wizard.addPage(page.wizardPage, ExtractOperationPath.options);
this.addSummaryPage(ExtractOperationPath.summary);
@@ -126,7 +124,7 @@ export class SelectOperationPage extends BasePage {
this.removePages();
// add the import page
let page = this.instance.pages.get(PageName.importConfig);
let page = this.instance.pages.get('importConfig');
this.instance.wizard.addPage(page.wizardPage, ImportOperationPath.options);
this.addSummaryPage(ImportOperationPath.summary);
@@ -151,7 +149,7 @@ export class SelectOperationPage extends BasePage {
this.removePages();
// add the export pages
let page = this.instance.pages.get(PageName.exportConfig);
let page = this.instance.pages.get('exportConfig');
this.instance.wizard.addPage(page.wizardPage, ExportOperationPath.options);
this.addSummaryPage(ExportOperationPath.summary);
@@ -173,7 +171,7 @@ export class SelectOperationPage extends BasePage {
}
private addSummaryPage(index: number) {
let summaryPage = this.instance.pages.get(PageName.summary);
let summaryPage = this.instance.pages.get('summary');
this.instance.wizard.addPage(summaryPage.wizardPage, index);
}

View File

@@ -19,7 +19,7 @@
"watch": "gulp watch-extension:extension-editing"
},
"dependencies": {
"jsonc-parser": "^2.1.1",
"jsonc-parser": "^2.0.2",
"markdown-it": "^8.3.1",
"parse5": "^3.0.2",
"vscode-nls": "^4.0.0"

View File

@@ -29,10 +29,10 @@ entities@~1.1.1:
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
integrity sha1-blwtClYhtdra7O+AuQ7ftc13cvA=
jsonc-parser@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.1.1.tgz#83dc3d7a6e7186346b889b1280eefa04446c6d3e"
integrity sha512-VC0CjnWJylKB1iov4u76/W/5Ef0ydDkjtYWxoZ9t3HdWlSnZQwZL5MgFikaB/EtQ4RmMEw3tmQzuYnZA2/Ja1g==
jsonc-parser@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.2.tgz#42fcf56d70852a043fadafde51ddb4a85649978d"
integrity sha512-TSU435K5tEKh3g7bam1AFf+uZrISheoDsLlpmAo6wWZYqjsnd09lHYK1Qo+moK4Ikifev1Gdpa69g4NELKnCrQ==
linkify-it@^2.0.0:
version "2.0.3"

View File

@@ -1148,26 +1148,6 @@
"description": "%config.enableSmartCommit%",
"default": false
},
"git.smartCommitChanges": {
"type": "string",
"enum": [
"all",
"tracked"
],
"enumDescriptions": [
"%config.smartCommitChanges.all%",
"%config.smartCommitChanges.tracked%"
],
"scope": "resource",
"description": "%config.smartCommitChanges%",
"default": "all"
},
"git.suggestSmartCommit": {
"type": "boolean",
"scope": "resource",
"description": "%config.suggestSmartCommit%",
"default": true
},
"git.enableCommitSigning": {
"type": "boolean",
"scope": "resource",
@@ -1185,26 +1165,10 @@
"default": true,
"description": "%config.decorations.enabled%"
},
"git.enableStatusBarSync": {
"type": "boolean",
"default": true,
"description": "%config.enableStatusBarSync%",
"scope": "resource"
},
"git.promptToSaveFilesBeforeCommit": {
"type": "string",
"enum": [
"always",
"staged",
"never"
],
"enumDescriptions": [
"%config.promptToSaveFilesBeforeCommit.always%",
"%config.promptToSaveFilesBeforeCommit.staged%",
"%config.promptToSaveFilesBeforeCommit.never%"
],
"type": "boolean",
"scope": "resource",
"default": "always",
"default": true,
"description": "%config.promptToSaveFilesBeforeCommit%"
},
"git.postCommitCommand": {
@@ -1348,21 +1312,6 @@
"scope": "resource",
"default": true,
"description": "%config.openDiffOnClick%"
},
"git.supportCancellation": {
"type": "boolean",
"scope": "resource",
"default": false,
"description": "%config.supportCancellation%"
},
"git.branchSortOrder": {
"type": "string",
"enum": [
"committerdate",
"alphabetically"
],
"default": "committerdate",
"description": "%config.branchSortOrder%"
}
}
},
@@ -1528,4 +1477,4 @@
"@types/which": "^1.0.28",
"mocha": "^3.2.0"
}
}
}

View File

@@ -89,18 +89,10 @@
"config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository.",
"config.defaultCloneDirectory": "The default location to clone a git repository.",
"config.enableSmartCommit": "Commit all changes when there are no staged changes.",
"config.smartCommitChanges": "Control which changes are automatically staged by Smart Commit.",
"config.smartCommitChanges.all": "Automatically stage all changes.",
"config.smartCommitChanges.tracked": "Automatically staged tracked changes only.",
"config.suggestSmartCommit": "Suggests to enable smart commit (commit all changes when there are no staged changes).",
"config.enableCommitSigning": "Enables commit signing with GPG.",
"config.discardAllScope": "Controls what changes are discarded by the `Discard all changes` command. `all` discards all changes. `tracked` discards only tracked files. `prompt` shows a prompt dialog every time the action is run.",
"config.decorations.enabled": "Controls whether Git contributes colors and badges to the explorer and the open editors view.",
"config.enableStatusBarSync": "Controls whether the Git Sync command appears in the status bar.",
"config.promptToSaveFilesBeforeCommit": "Controls whether Git should check for unsaved files before committing.",
"config.promptToSaveFilesBeforeCommit.always": "Check for any unsaved files.",
"config.promptToSaveFilesBeforeCommit.staged": "Check only for unsaved staged files.",
"config.promptToSaveFilesBeforeCommit.never": "Disable this check.",
"config.postCommitCommand": "Runs a git command after a successful commit.",
"config.postCommitCommand.none": "Don't run any command after a commit.",
"config.postCommitCommand.push": "Run 'Git Push' after a successful commit.",
@@ -126,8 +118,6 @@
"config.useForcePushWithLease": "Controls whether force pushing uses the safer force-with-lease variant.",
"config.confirmForcePush": "Controls whether to ask for confirmation before force-pushing.",
"config.openDiffOnClick": "Controls whether the diff editor should be opened when clicking a change. Otherwise the regular editor will be opened.",
"config.supportCancellation": "Controls whether a notification comes up when running the Sync action, which allows the user to cancel the operation.",
"config.branchSortOrder": "Controls the sort order for branches.",
"colors.added": "Color for added resources.",
"colors.modified": "Color for modified resources.",
"colors.deleted": "Color for deleted resources.",
@@ -135,4 +125,4 @@
"colors.ignored": "Color for ignored resources.",
"colors.conflict": "Color for resources with conflicts.",
"colors.submodule": "Color for submodule resources."
}
}

View File

@@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4315 3.32315L5.96154 13.3232L5.17083 13.2874L1.82083 8.51736L2.63918 7.94263L5.617 12.1827L13.6685 2.67683L14.4315 3.32315Z" fill="#C5C5C5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 3.76345L5.80687 11.9351L5.08584 11.8927L1 7.29614L1.76345 6.61752L5.50997 10.8324L14.3214 3L15 3.76345Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 278 B

View File

@@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4315 3.32317L5.96154 13.3232L5.17083 13.2874L1.82083 8.51737L2.63918 7.94264L5.617 12.1827L13.6685 2.67685L14.4315 3.32317Z" fill="#424242"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 3.76345L5.80687 11.9351L5.08584 11.8927L1 7.29614L1.76345 6.61752L5.50997 10.8324L14.3214 3L15 3.76345Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 278 B

Some files were not shown because too many files have changed in this diff Show More