Replace hardcoded strings (#1682)
* Add NLS dep and create common localize method * Replace strings in package.json * Replace strings in TS source
This commit is contained in:
Родитель
82a1fda571
Коммит
b242065707
|
@ -4132,6 +4132,21 @@
|
|||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
||||
"dev": true
|
||||
},
|
||||
"event-stream": {
|
||||
"version": "3.3.5",
|
||||
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.5.tgz",
|
||||
"integrity": "sha512-vyibDcu5JL20Me1fP734QBH/kenBGLZap2n0+XXM7mvuUPzJ20Ydqj1aKcIeMdri1p+PU+4yAKugjN8KCVst+g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"duplexer": "^0.1.1",
|
||||
"from": "^0.1.7",
|
||||
"map-stream": "0.0.7",
|
||||
"pause-stream": "^0.0.11",
|
||||
"split": "^1.0.1",
|
||||
"stream-combiner": "^0.2.2",
|
||||
"through": "^2.3.8"
|
||||
}
|
||||
},
|
||||
"events": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz",
|
||||
|
@ -4721,6 +4736,12 @@
|
|||
"map-cache": "^0.2.2"
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
|
||||
"integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=",
|
||||
"dev": true
|
||||
},
|
||||
"from2": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
|
||||
|
@ -6172,6 +6193,12 @@
|
|||
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
|
||||
"dev": true
|
||||
},
|
||||
"is": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz",
|
||||
"integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==",
|
||||
"dev": true
|
||||
},
|
||||
"is-absolute": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
|
||||
|
@ -6875,6 +6902,12 @@
|
|||
"integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
|
||||
"dev": true
|
||||
},
|
||||
"map-stream": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz",
|
||||
"integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=",
|
||||
"dev": true
|
||||
},
|
||||
"map-visit": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
|
||||
|
@ -8165,6 +8198,15 @@
|
|||
"pify": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"pause-stream": {
|
||||
"version": "0.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",
|
||||
"integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"through": "~2.3"
|
||||
}
|
||||
},
|
||||
"pbkdf2": {
|
||||
"version": "3.0.17",
|
||||
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz",
|
||||
|
@ -9337,6 +9379,15 @@
|
|||
"integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"split": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
|
||||
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"through": "2"
|
||||
}
|
||||
},
|
||||
"split-ca": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/split-ca/-/split-ca-1.0.1.tgz",
|
||||
|
@ -9447,6 +9498,16 @@
|
|||
"readable-stream": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"stream-combiner": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz",
|
||||
"integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"duplexer": "~0.1.1",
|
||||
"through": "~2.3.4"
|
||||
}
|
||||
},
|
||||
"stream-each": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz",
|
||||
|
@ -11115,6 +11176,152 @@
|
|||
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-4.1.1.tgz",
|
||||
"integrity": "sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A=="
|
||||
},
|
||||
"vscode-nls-dev": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-nls-dev/-/vscode-nls-dev-3.3.1.tgz",
|
||||
"integrity": "sha512-fug18D7CXb8pv8JoQ0D0JmZaIYDQoKLiyZxkAy5P8Cln/FwlNsdzwQILDph62EdGY5pvsJ2Jd1T5qgHAExe/tg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-colors": "^3.2.3",
|
||||
"clone": "^2.1.1",
|
||||
"event-stream": "^3.3.4",
|
||||
"fancy-log": "^1.3.3",
|
||||
"glob": "^7.1.2",
|
||||
"iconv-lite": "^0.4.19",
|
||||
"is": "^3.2.1",
|
||||
"source-map": "^0.6.1",
|
||||
"typescript": "^2.6.2",
|
||||
"vinyl": "^2.1.0",
|
||||
"xml2js": "^0.4.19",
|
||||
"yargs": "^13.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-colors": {
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz",
|
||||
"integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||
"dev": true
|
||||
},
|
||||
"camelcase": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||
"dev": true
|
||||
},
|
||||
"cliui": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
|
||||
"integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"string-width": "^3.1.0",
|
||||
"strip-ansi": "^5.2.0",
|
||||
"wrap-ansi": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
|
||||
"dev": true
|
||||
},
|
||||
"require-main-filename": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"string-width": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
|
||||
"integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"emoji-regex": "^7.0.1",
|
||||
"is-fullwidth-code-point": "^2.0.0",
|
||||
"strip-ansi": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
|
||||
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "2.9.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
|
||||
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==",
|
||||
"dev": true
|
||||
},
|
||||
"which-module": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
|
||||
"dev": true
|
||||
},
|
||||
"wrap-ansi": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
|
||||
"integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.0",
|
||||
"string-width": "^3.0.0",
|
||||
"strip-ansi": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"yargs": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
|
||||
"integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cliui": "^5.0.0",
|
||||
"find-up": "^3.0.0",
|
||||
"get-caller-file": "^2.0.1",
|
||||
"require-directory": "^2.1.1",
|
||||
"require-main-filename": "^2.0.0",
|
||||
"set-blocking": "^2.0.0",
|
||||
"string-width": "^3.0.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^4.0.0",
|
||||
"yargs-parser": "^13.1.1"
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "13.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
|
||||
"integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"camelcase": "^5.0.0",
|
||||
"decamelize": "^1.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"vscode-test": {
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.3.tgz",
|
||||
|
|
608
package.json
608
package.json
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,247 @@
|
|||
{
|
||||
"vscode-docker.description": "Makes it easy to create, manage, and debug containerized applications.",
|
||||
"vscode-docker.debug.containerName": "Name of the container used for debugging.",
|
||||
"vscode-docker.debug.dockerServerReadyAction.description": "Options for launching a browser to the Docker container. Similar to serverReadyAction, but replaces container ports with host ports.",
|
||||
"vscode-docker.debug.dockerServerReadyAction.action": "The action to take when the pattern is found.",
|
||||
"vscode-docker.debug.dockerServerReadyAction.containerName": "The container name to match the host port.",
|
||||
"vscode-docker.debug.dockerServerReadyAction.pattern": "The regex pattern to look for in Debug console output.",
|
||||
"vscode-docker.debug.dockerServerReadyAction.uriFormat": "The URI format to launch.",
|
||||
"vscode-docker.debug.dockerServerReadyAction.webRoot": "The root folder from which web pages are served.",
|
||||
"vscode-docker.debug.removeContainerAfterDebug": "Whether to remove the debug container after debugging.",
|
||||
"vscode-docker.debug.platform": "The target plaform for the application.",
|
||||
"vscode-docker.debug.netCore.description": "Options for debugging .NET Core projects in Docker.",
|
||||
"vscode-docker.debug.netCore.appProject": "The .NET Core project (.csproj, .fsproj, etc.) to debug.",
|
||||
"vscode-docker.debug.node.description": "Options for debugging Node.js projects in Docker.",
|
||||
"vscode-docker.debug.node.port": "The debug port to use.",
|
||||
"vscode-docker.debug.node.address": "TCP/IP address of the debug port.",
|
||||
"vscode-docker.debug.node.sourceMaps": "Enable source maps by setting this to `true`.",
|
||||
"vscode-docker.debug.node.outFiles": "Array of glob patterns for locating generated JavaScript files.",
|
||||
"vscode-docker.debug.node.autoAttachChildProcesses": "Track all subprocesses of debuggee and automatically attach to those that are launched in debug mode.",
|
||||
"vscode-docker.debug.node.timeout": "When restarting a session, give up after this number of milliseconds.",
|
||||
"vscode-docker.debug.node.stopOnEntry": "Break immediately when the program launches.",
|
||||
"vscode-docker.debug.node.localRoot": "VS Code's root directory.",
|
||||
"vscode-docker.debug.node.remoteRoot": "Node's root directory within the Docker container.",
|
||||
"vscode-docker.debug.node.smartStep": "Try to automatically step over code that doesn't map to source files.",
|
||||
"vscode-docker.debug.node.skipFiles": "Automatically skip files covered by these glob patterns.",
|
||||
"vscode-docker.debug.node.trace": "Enable diagnostic output.",
|
||||
"vscode-docker.debug.python.description": "Options for debugging Python applications in Docker.",
|
||||
"vscode-docker.debug.python.host": "The host for remote debugging.",
|
||||
"vscode-docker.debug.python.port": "The port for remote debugging.",
|
||||
"vscode-docker.debug.python.pathMappings.localRoot": "The host path.",
|
||||
"vscode-docker.debug.python.pathMappings.remoteRoot": "The container path.",
|
||||
"vscode-docker.debug.python.justMyCode": "Debug only user-written code.",
|
||||
"vscode-docker.debug.python.django": "Django debugging.",
|
||||
"vscode-docker.debug.python.jinja": "Jinja template debugging (e.g. Flask).",
|
||||
"vscode-docker.debug.python.projectType": "Type of the Python app.",
|
||||
"vscode-docker.debug.attach.containerName": "The container name to attach to. If not specified, then user will be prompted to pick a container.",
|
||||
"vscode-docker.debug.attach.processName": "The process name to attach to. If this is used, 'processId' should not be used.",
|
||||
"vscode-docker.debug.attach.processIdString": "The process id to attach to. Use \"${command:pickProcess}\" to get a list of running processes to attach to. If 'processId' used, 'processName' should not be used.",
|
||||
"vscode-docker.debug.attach.processIdInteger": "The process id to attach to. Use \"${command:pickProcess}\" to get a list of running processes to attach to. If 'processId' used, 'processName' should not be used.",
|
||||
"vscode-docker.debug.attach.platform": "The target plaform for the application.",
|
||||
"vscode-docker.debug.attach.sourceFileMap": "Optional source file mappings passed to the debug engine. Example: '{ \"/src\":\"${workspaceFolder}\" }'",
|
||||
"vscode-docker.debug.attach.netCore.description": "Options for debugging .NET Core projects in Docker.",
|
||||
"vscode-docker.debug.attach.netCore.debuggerPath": "enter the path for the debugger on the target machine, for example /remote_debugger/vsdbg.",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.description": "Options for building the Docker image used for debugging.",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.buildArgs": "Build arguments applied to the Docker image used for debugging.",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.context": "Path to the Docker build context.",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.dockerfile": "Path to the Dockerfile used for the build.",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.labels.description": "Labels applied to the Docker image used for debugging.",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.labels.includeDefaults": "Whether to include the default set of labels defined by the Docker extension",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.tag": "Tag applied to the Docker image used for debugging.",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.target": "Docker build target (stage) used for debugging.",
|
||||
"vscode-docker.tasks.docker-build.dockerBuild.pull": "Whether or not to pull new base images before building.",
|
||||
"vscode-docker.tasks.docker-build.platform": "The target plaform for the application.",
|
||||
"vscode-docker.tasks.docker-build.netCore.description": "Options for building .NET Core projects in Docker.",
|
||||
"vscode-docker.tasks.docker-build.netCore.appProject": "The .NET Core project (.csproj, .fsproj, etc.) to build.",
|
||||
"vscode-docker.tasks.docker-build.node.description": "Options for building Node.js applications in Docker.",
|
||||
"vscode-docker.tasks.docker-build.node.package": "The path to the package.json for the application.",
|
||||
"vscode-docker.tasks.docker-build.python.description": "Options for building Python applications in Docker.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.description": "Options for running the Docker container used for debugging.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.command": "The command to run upon starting the container.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.containerName": "Name of the container used for debugging.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.env": "Environment variables applied to the Docker container used for debugging.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.envFiles": "Files of environment variables read in and applied to the Docker container used for debugging.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.image": "The image to run.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.labels.description": "Labels applied to the Docker container used for debugging.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.labels.includeDefaults": "Whether to include the default set of labels defined by the Docker extension",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.network": "The network to which the container will be connected.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.networkAlias": "The network-scoped alias to assign to the container.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.os": "The container operating system.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.ports.description": "Ports that are going to be mapped on the host.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.ports.hostPort": "Port number to be bound on the host.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.ports.containerPort": "Port number of the container to be bound.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.ports.protocol": "Specific protocol for the binding (`tcp | udp`).",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.portsPublishAll": "Whether to publish all exposed container ports to random ports on the host.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.extraHosts.description": "Hosts to be added to the container's `hosts` file for DNS resolution.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.extraHosts.hostname": "Hostname for dns resolution.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.extraHosts.ip": "IP associated to the hostname.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.volumes.description": "Volumes that are going to be mapped to the container.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.volumes.localPath": "Path on local machine that will be mapped. The folder will be created if it does not exist.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.volumes.containerPath": "Path where the volume will be mapped within the container. The folder will be created if it does not exist.",
|
||||
"vscode-docker.tasks.docker-run.dockerRun.volumes.permissions": "Permissions for the container for the mapped volume, `rw` for read-write or `ro` for read-only.",
|
||||
"vscode-docker.tasks.docker-run.platform": "The target plaform for the application.",
|
||||
"vscode-docker.tasks.docker-run.netCore.description": "Options for running .NET Core projects in Docker.",
|
||||
"vscode-docker.tasks.docker-run.netCore.appProject": "The .NET Core project (.csproj, .fsproj, etc.) to build.",
|
||||
"vscode-docker.tasks.docker-run.netCore.enableDebugging": "Whether to enable debugging within the container.",
|
||||
"vscode-docker.tasks.docker-run.netCore.configureSsl": "Whether to configure certificate and other settings to enable SSL on ASP.NET Core web services.",
|
||||
"vscode-docker.tasks.docker-run.node.description": "Options for running Node.js applications in Docker.",
|
||||
"vscode-docker.tasks.docker-run.node.enableDebugging": "Whether to enable debugging within the container.",
|
||||
"vscode-docker.tasks.docker-run.node.inspectMode": "Whether debugging should break immediately upon application start.",
|
||||
"vscode-docker.tasks.docker-run.node.inspectPort": "The port on which debugging should occur.",
|
||||
"vscode-docker.tasks.docker-run.node.package": "The path to the package.json for the application.",
|
||||
"vscode-docker.tasks.docker-run.python.description": "Options for running Python applications in Docker.",
|
||||
"vscode-docker.tasks.docker-run.python.file": "The Python file to run.",
|
||||
"vscode-docker.tasks.docker-run.python.module": "The Python module to run.",
|
||||
"vscode-docker.tasks.docker-run.python.args": "Arguments passed to the Python app.",
|
||||
"vscode-docker.tasks.docker-run.python.wait": "Whether to wait for debugger to attach.",
|
||||
"vscode-docker.tasks.docker-run.python.debugPort": "The port that the debugger will listen on.",
|
||||
"vscode-docker.config.template.build.template": "The command template.",
|
||||
"vscode-docker.config.template.build.label": "The label displayed to the user.",
|
||||
"vscode-docker.config.template.build.match": "The regular expression for choosing the right template. Checked against container name, container's image name, etc.",
|
||||
"vscode-docker.config.template.build.description": "Command template(s) for `docker build` commands.",
|
||||
"vscode-docker.config.template.run.template": "The command template.",
|
||||
"vscode-docker.config.template.run.label": "The label displayed to the user.",
|
||||
"vscode-docker.config.template.run.match": "The regular expression for choosing the right template. Checked against image name, etc.",
|
||||
"vscode-docker.config.template.run.description": "Command templates for `docker run` commands.",
|
||||
"vscode-docker.config.template.runInteractive.template": "The command template.",
|
||||
"vscode-docker.config.template.runInteractive.label": "The label displayed to the user.",
|
||||
"vscode-docker.config.template.runInteractive.match": "The regular expression for choosing the right template. Checked against image name, etc.",
|
||||
"vscode-docker.config.template.runInteractive.description": "Command templates for `docker run -it` (interactive) commands.",
|
||||
"vscode-docker.config.template.attach.template": "The command template.",
|
||||
"vscode-docker.config.template.attach.label": "The label displayed to the user.",
|
||||
"vscode-docker.config.template.attach.match": "The regular expression for choosing the right template. Checked against container name, container's image name, etc.",
|
||||
"vscode-docker.config.template.attach.description": "Command templates for `docker attach` / `docker exec -it` commands.",
|
||||
"vscode-docker.config.template.logs.template": "The command template.",
|
||||
"vscode-docker.config.template.logs.label": "The label displayed to the user.",
|
||||
"vscode-docker.config.template.logs.match": "The regular expression for choosing the right template. Checked against container name, container's image name, etc.",
|
||||
"vscode-docker.config.template.logs.description": "Command templates for `docker logs` commands.",
|
||||
"vscode-docker.config.template.composeUp.template": "The command template.",
|
||||
"vscode-docker.config.template.composeUp.label": "The label displayed to the user.",
|
||||
"vscode-docker.config.template.composeUp.match": "The regular expression for choosing the right template. Checked against docker-compose YAML files, folder name, etc.",
|
||||
"vscode-docker.config.template.composeUp.description": "Command templates for `docker-compose up` commands.",
|
||||
"vscode-docker.config.template.composeDown.template": "The command template.",
|
||||
"vscode-docker.config.template.composeDown.label": "The label displayed to the user.",
|
||||
"vscode-docker.config.template.composeDown.match": "The regular expression for choosing the right template. Checked against docker-compose YAML files, folder name, etc.",
|
||||
"vscode-docker.config.template.composeDown.description": "Command templates for `docker-compose down` commands.",
|
||||
"vscode-docker.config.docker.defaultRegistryPath": "Default registry and path when tagging an image",
|
||||
"vscode-docker.config.docker.explorerRefreshInterval": "Docker view refresh interval (milliseconds)",
|
||||
"vscode-docker.config.docker.containers.groupBy": "The property to use to group containers in Docker view: ContainerId, ContainerName, CreatedTime, FullTag, ImageId, Networks, Ports, Registry, Repository, RepositoryName, RepositoryNameAndTag, State, Status, Tag, or None",
|
||||
"vscode-docker.config.docker.containers.description": "Any secondary properties to display for a container (an array). Possible elements include: ContainerId, ContainerName, CreatedTime, FullTag, ImageId, Networks, Ports, Registry, Repository, RepositoryName, RepositoryNameAndTag, State, Status, and Tag",
|
||||
"vscode-docker.config.docker.containers.label": "The primary property to display for a container: ContainerId, ContainerName, CreatedTime, FullTag, ImageId, Networks, Ports, Registry, Repository, RepositoryName, RepositoryNameAndTag, State, Status, or Tag",
|
||||
"vscode-docker.config.docker.containers.sortBy": "The property to use to sort containers in Docker view: CreatedTime or Label",
|
||||
"vscode-docker.config.docker.images.groupBy": "The property to use to group images in Docker view: CreatedTime, FullTag, ImageId, None, Registry, Repository, RepositoryName, RepositoryNameAndTag, or Tag",
|
||||
"vscode-docker.config.docker.images.description": "Any secondary properties to display for a image (an array). Possible elements include: CreatedTime, FullTag, ImageId, Registry, Repository, RepositoryName, RepositoryNameAndTag, and Tag",
|
||||
"vscode-docker.config.docker.images.label": "The primary property to display for a image: CreatedTime, FullTag, ImageId, Registry, Repository, RepositoryName, RepositoryNameAndTag, or Tag",
|
||||
"vscode-docker.config.docker.images.sortBy": "The property to use to sort images in Docker view: CreatedTime or Label",
|
||||
"vscode-docker.config.docker.networks.groupBy": "The property to use to group networks in Docker view: CreatedTime, NetworkDriver, NetworkId, NetworkName, or None",
|
||||
"vscode-docker.config.docker.networks.description": "Any secondary properties to display for a Docker network (an array). Possible elements include CreatedTime, NetworkDriver, NetworkId, and NetworkName",
|
||||
"vscode-docker.config.docker.networks.label": "The primary property to display for a Docker network: CreatedTime, NetworkDriver, NetworkId, or NetworkName",
|
||||
"vscode-docker.config.docker.networks.sortBy": "The property to use to sort networks in Docker view: CreatedTime or Label",
|
||||
"vscode-docker.config.docker.networks.showBuiltIn": "Show the built-in networks in the explorer.",
|
||||
"vscode-docker.config.docker.volumes.groupBy": "The property to use to group volumes in Docker view: CreatedTime, VolumeName, or None",
|
||||
"vscode-docker.config.docker.volumes.description": "Any secondary properties to display for a Docker volume (an array). Possible values include CreatedTime and VolumeName",
|
||||
"vscode-docker.config.docker.volumes.label": "The primary property to display for a Docker volume: CreatedTime or VolumeName",
|
||||
"vscode-docker.config.docker.volumes.sortBy": "The property to use to sort volumes in Docker view: CreatedTime or Label",
|
||||
"vscode-docker.config.docker.imageBuildContextPath": "Build context PATH to pass to Docker build command.",
|
||||
"vscode-docker.config.docker.truncateLongRegistryPaths": "Set to true to truncate long image and container registry paths in Docker view",
|
||||
"vscode-docker.config.docker.truncateMaxLength": "Maximum length of a registry paths displayed in Docker view, including elipsis. The truncateLongRegistryPaths setting must be set to true for truncateMaxLength setting to be effective.",
|
||||
"vscode-docker.config.docker.host": "Equivalent to setting the DOCKER_HOST environment variable.",
|
||||
"vscode-docker.config.docker.certPath": "Equivalent to setting the DOCKER_CERT_PATH environment variable.",
|
||||
"vscode-docker.config.docker.tlsVerify": "Equivalent to setting the DOCKER_TLS_VERIFY environment variable.",
|
||||
"vscode-docker.config.docker.machineName": "Equivalent to setting the DOCKER_MACHINE_NAME environment variable.",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.deprecatedMaintainer": "Controls the diagnostic severity for the deprecated MAINTAINER instruction",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.emptyContinuationLine": "Controls the diagnostic severity for flagging empty continuation lines found in instructions that span multiple lines",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.directiveCasing": "Controls the diagnostic severity for parser directives that are not written in lowercase",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.instructionCasing": "Controls the diagnostic severity for instructions that are not written in uppercase",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.instructionCmdMultiple": "Controls the diagnostic severity for flagging a Dockerfile with multiple CMD instructions",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.instructionEntrypointMultiple": "Controls the diagnostic severity for flagging a Dockerfile with multiple ENTRYPOINT instructions",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.instructionHealthcheckMultiple": "Controls the diagnostic severity for flagging a Dockerfile with multiple HEALTHCHECK instructions",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.instructionJsonInSingleQuotes": "Controls the diagnostic severity for JSON instructions that are written incorrectly with single quotes",
|
||||
"vscode-docker.config.docker.languageserver.diagnostics.instructionWorkdirRelative": "Controls the diagnostic severity for WORKDIR instructions that do not point to an absolute path",
|
||||
"vscode-docker.config.docker.attachShellCommand.linuxContainer": "Attach command to use for Linux containers",
|
||||
"vscode-docker.config.docker.attachShellCommand.windowsContainer": "Attach command to use for Windows containers",
|
||||
"vscode-docker.config.docker.dockerComposeBuild": "Set to true to include --build option when docker-compose command is invoked",
|
||||
"vscode-docker.config.docker.dockerComposeDetached": "Set to true to include --d (detached) option when docker-compose command is invoked",
|
||||
"vscode-docker.config.docker.showRemoteWorkspaceWarning": "Set to true to prompt to switch from \"UI\" extension mode to \"Workspace\" extension mode if an operation is not supported in UI mode.",
|
||||
"vscode-docker.commands.api.configure": "Add Docker Files to Workspace (API)...",
|
||||
"vscode-docker.commands.compose.down": "Compose Down",
|
||||
"vscode-docker.commands.compose.restart": "Compose Restart",
|
||||
"vscode-docker.commands.compose.up": "Compose Up",
|
||||
"vscode-docker.commands.configure": "Add Docker Files to Workspace...",
|
||||
"vscode-docker.commands.containers.attachShell": "Attach Shell",
|
||||
"vscode-docker.commands.containers.browse": "Open in Browser",
|
||||
"vscode-docker.commands.containers.configureExplorer": "Configure Explorer...",
|
||||
"vscode-docker.commands.containers.inspect": "Inspect",
|
||||
"vscode-docker.commands.containers.prune": "Prune...",
|
||||
"vscode-docker.commands.containers.refresh": "Refresh",
|
||||
"vscode-docker.commands.containers.remove": "Remove...",
|
||||
"vscode-docker.commands.containers.restart": "Restart",
|
||||
"vscode-docker.commands.containers.select": "Select container",
|
||||
"vscode-docker.commands.containers.start": "Start",
|
||||
"vscode-docker.commands.containers.stop": "Stop",
|
||||
"vscode-docker.commands.containers.viewLogs": "View Logs",
|
||||
"vscode-docker.commands.debugging.initializeForDebugging": "Initialize for Docker debugging",
|
||||
"vscode-docker.commands.images.build": "Build Image...",
|
||||
"vscode-docker.commands.images.configureExplorer": "Configure Explorer...",
|
||||
"vscode-docker.commands.images.inspect": "Inspect",
|
||||
"vscode-docker.commands.images.prune": "Prune...",
|
||||
"vscode-docker.commands.images.push": "Push",
|
||||
"vscode-docker.commands.images.refresh": "Refresh",
|
||||
"vscode-docker.commands.images.remove": "Remove...",
|
||||
"vscode-docker.commands.images.run": "Run",
|
||||
"vscode-docker.commands.images.runAzureCli": "Run Azure CLI",
|
||||
"vscode-docker.commands.images.runInteractive": "Run Interactive",
|
||||
"vscode-docker.commands.images.tag": "Tag...",
|
||||
"vscode-docker.commands.images.copyFullTag": "Copy Full Tag",
|
||||
"vscode-docker.commands.networks.configureExplorer": "Configure Explorer...",
|
||||
"vscode-docker.commands.networks.create": "Create...",
|
||||
"vscode-docker.commands.networks.inspect": "Inspect",
|
||||
"vscode-docker.commands.networks.prune": "Prune...",
|
||||
"vscode-docker.commands.networks.refresh": "Refresh",
|
||||
"vscode-docker.commands.networks.remove": "Remove...",
|
||||
"vscode-docker.commands.pruneSystem": "Prune System...",
|
||||
"vscode-docker.commands.registries.azure.buildImage": "Build Image in Azure...",
|
||||
"vscode-docker.commands.registries.azure.createRegistry": "Create Registry...",
|
||||
"vscode-docker.commands.registries.azure.deleteRegistry": "Delete Registry...",
|
||||
"vscode-docker.commands.registries.azure.deleteRepository": "Delete Repository...",
|
||||
"vscode-docker.commands.registries.azure.openInPortal": "Open in Portal",
|
||||
"vscode-docker.commands.registries.azure.runFileAsTask": "Run as Task in Azure...",
|
||||
"vscode-docker.commands.registries.azure.runTask": "Run Task",
|
||||
"vscode-docker.commands.registries.azure.selectSubscriptions": "Select Subscriptions...",
|
||||
"vscode-docker.commands.registries.azure.untagImage": "Untag Image...",
|
||||
"vscode-docker.commands.registries.azure.viewProperties": "View Properties",
|
||||
"vscode-docker.commands.registries.azure.viewLogs": "View Logs",
|
||||
"vscode-docker.commands.registries.connect": "Connect Registry...",
|
||||
"vscode-docker.commands.registries.reconnectRegistry": "Re-enter credentials",
|
||||
"vscode-docker.commands.registries.copyImageDigest": "Copy Image Digest",
|
||||
"vscode-docker.commands.registries.deleteImage": "Delete Image...",
|
||||
"vscode-docker.commands.registries.deployImageToAzure": "Deploy Image to Azure App Service...",
|
||||
"vscode-docker.commands.registries.disconnectRegistry": "Disconnect",
|
||||
"vscode-docker.commands.registries.dockerHub.openInBrowser": "Open in Browser",
|
||||
"vscode-docker.commands.registries.logInToDockerCli": "Log In to Docker CLI",
|
||||
"vscode-docker.commands.registries.logOutOfDockerCli": "Log Out of Docker CLI",
|
||||
"vscode-docker.commands.registries.pullImage": "Pull Image",
|
||||
"vscode-docker.commands.registries.pullRepository": "Pull Repository",
|
||||
"vscode-docker.commands.registries.refresh": "Refresh",
|
||||
"vscode-docker.commands.registries.setAsDefault": "Set as Default",
|
||||
"vscode-docker.commands.volumes.configureExplorer": "Configure Explorer...",
|
||||
"vscode-docker.commands.volumes.inspect": "Inspect",
|
||||
"vscode-docker.commands.volumes.prune": "Prune...",
|
||||
"vscode-docker.commands.volumes.refresh": "Refresh",
|
||||
"vscode-docker.commands.volumes.remove": "Remove...",
|
||||
"vscode-docker.commands.help": "Docker help...",
|
||||
"vscode-docker.commands.category.docker": "Docker",
|
||||
"vscode-docker.commands.category.dockerContainers": "Docker Containers",
|
||||
"vscode-docker.commands.category.dockerImages": "Docker Images",
|
||||
"vscode-docker.commands.category.dockerNetworks": "Docker Networks",
|
||||
"vscode-docker.commands.category.azureContainerRegistry": "Azure Container Registry",
|
||||
"vscode-docker.commands.category.dockerRegistries": "Docker Registries",
|
||||
"vscode-docker.commands.category.dockerHub": "Docker Hub",
|
||||
"vscode-docker.commands.category.dockerVolumes": "Docker Volumes",
|
||||
"vscode-docker.views.dockerContainers": "Containers",
|
||||
"vscode-docker.views.dockerImages": "Images",
|
||||
"vscode-docker.views.dockerRegistries": "Registries",
|
||||
"vscode-docker.views.dockerNetworks": "Networks",
|
||||
"vscode-docker.views.dockerVolumes": "Volumes",
|
||||
"vscode-docker.views.activityBar": "Docker"
|
||||
}
|
|
@ -8,6 +8,7 @@ import * as vscode from 'vscode';
|
|||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { COMPOSE_FILE_GLOB_PATTERN } from '../constants';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from "../localize";
|
||||
import { quickPickWorkspaceFolder } from '../utils/quickPickWorkspaceFolder';
|
||||
import { selectComposeCommand } from './selectCommandTemplate';
|
||||
|
||||
|
@ -41,7 +42,7 @@ function computeItems(folder: vscode.WorkspaceFolder, uris: vscode.Uri[]): vscod
|
|||
}
|
||||
|
||||
async function compose(context: IActionContext, commands: ('up' | 'down')[], message: string, dockerComposeFileUri?: vscode.Uri, selectedComposeFileUris?: vscode.Uri[]): Promise<void> {
|
||||
const folder: vscode.WorkspaceFolder = await quickPickWorkspaceFolder('To run Docker compose you must first open a folder or workspace in VS Code.');
|
||||
const folder: vscode.WorkspaceFolder = await quickPickWorkspaceFolder(localize('vscode-docker.commands.compose.workspaceFolder', 'To run Docker compose you must first open a folder or workspace in VS Code.'));
|
||||
|
||||
let commandParameterFileUris: vscode.Uri[];
|
||||
if (selectedComposeFileUris && selectedComposeFileUris.length) {
|
||||
|
@ -57,7 +58,7 @@ async function compose(context: IActionContext, commands: ('up' | 'down')[], mes
|
|||
const uris: vscode.Uri[] = await getDockerComposeFileUris(folder);
|
||||
if (!uris || uris.length === 0) {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showWarningMessage('Couldn\'t find any docker-compose files in your workspace.');
|
||||
vscode.window.showWarningMessage(localize('vscode-docker.commands.compose.noComposeFiles', 'Couldn\'t find any docker-compose files in your workspace.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -68,7 +69,7 @@ async function compose(context: IActionContext, commands: ('up' | 'down')[], mes
|
|||
// if the current set of docker files contain only docker-compose.yml or docker-compose.yml with override file,
|
||||
// don't ask user for a docker file and let docker-compose automatically pick these files.
|
||||
} else {
|
||||
selectedItems = [<Item>await ext.ui.showQuickPick(items, { placeHolder: `Choose Docker Compose file ${message}` })];
|
||||
selectedItems = [<Item>await ext.ui.showQuickPick(items, { placeHolder: message })];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,13 +126,13 @@ function isDefaultDockerComposeOverrideFile(fileName: string): boolean {
|
|||
}
|
||||
|
||||
export async function composeUp(context: IActionContext, dockerComposeFileUri?: vscode.Uri, selectedComposeFileUris?: vscode.Uri[]): Promise<void> {
|
||||
return await compose(context, ['up'], 'to bring up', dockerComposeFileUri, selectedComposeFileUris);
|
||||
return await compose(context, ['up'], localize('vscode-docker.commands.compose.chooseUp', 'Choose Docker Compose file to bring up'), dockerComposeFileUri, selectedComposeFileUris);
|
||||
}
|
||||
|
||||
export async function composeDown(context: IActionContext, dockerComposeFileUri?: vscode.Uri, selectedComposeFileUris?: vscode.Uri[]): Promise<void> {
|
||||
return await compose(context, ['down'], 'to take down', dockerComposeFileUri, selectedComposeFileUris);
|
||||
return await compose(context, ['down'], localize('vscode-docker.commands.compose.chooseDown', 'Choose Docker Compose file to take down'), dockerComposeFileUri, selectedComposeFileUris);
|
||||
}
|
||||
|
||||
export async function composeRestart(context: IActionContext, dockerComposeFileUri?: vscode.Uri, selectedComposeFileUris?: vscode.Uri[]): Promise<void> {
|
||||
return await compose(context, ['down', 'up'], 'to restart', dockerComposeFileUri, selectedComposeFileUris);
|
||||
return await compose(context, ['down', 'up'], localize('vscode-docker.commands.compose.chooseRestart', 'Choose Docker Compose file to restart'), dockerComposeFileUri, selectedComposeFileUris);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import * as vscode from 'vscode';
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
|
||||
import { getDockerOSType } from '../../utils/osUtils';
|
||||
import { selectAttachCommand } from '../selectCommandTemplate';
|
||||
|
@ -14,7 +15,7 @@ export async function attachShellContainer(context: IActionContext, node?: Conta
|
|||
if (!node) {
|
||||
node = await ext.containersTree.showTreeItemPicker<ContainerTreeItem>(ContainerTreeItem.runningContainerRegExp, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No running containers are available to attach'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.containers.attachShellContainer.noContainers', 'No running containers are available to attach')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { ContainerInspectInfo } from 'dockerode';
|
|||
import * as vscode from 'vscode';
|
||||
import { IActionContext, TelemetryProperties } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from "../../tree/containers/ContainerTreeItem";
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { captureCancelStep } from '../../utils/captureCancelStep';
|
||||
|
@ -62,7 +63,7 @@ export async function browseContainer(context: IActionContext, node?: ContainerT
|
|||
node = await captureBrowseCancelStep('node', telemetryProperties, () =>
|
||||
ext.containersTree.showTreeItemPicker<ContainerTreeItem>(ContainerTreeItem.runningContainerRegExp, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No running containers are available to open in a browser'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.containers.browseContainer.noContainers', 'No running containers are available to open in a browser')
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -85,7 +86,7 @@ export async function browseContainer(context: IActionContext, node?: ContainerT
|
|||
|
||||
if (possiblePorts.length === 0) {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
ext.ui.showWarningMessage('No valid ports were mapped from the container to the host.');
|
||||
ext.ui.showWarningMessage(localize('vscode-docker.commands.containers.browseContainer.noPorts', 'No valid ports were mapped from the container to the host.'));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -107,7 +108,7 @@ export async function browseContainer(context: IActionContext, node?: ContainerT
|
|||
items.sort((a, b) => a.port.containerPort.port - b.port.containerPort.port);
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/promise-function-async */
|
||||
const item = await captureBrowseCancelStep('port', telemetryProperties, () => ext.ui.showQuickPick(items, { placeHolder: 'Select the container port to browse to.' }));
|
||||
const item = await captureBrowseCancelStep('port', telemetryProperties, () => ext.ui.showQuickPick(items, { placeHolder: localize('vscode-docker.commands.containers.browseContainer.selectContainerPort', 'Select the container port to browse to.') }));
|
||||
|
||||
// NOTE: If the user cancels the prompt, then a UserCancelledError exception would be thrown.
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { ContainerInspectInfo } from "dockerode";
|
||||
import { IActionContext, openReadOnlyJson } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from "../../tree/containers/ContainerTreeItem";
|
||||
import { callDockerodeWithErrorHandling } from "../../utils/callDockerodeWithErrorHandling";
|
||||
|
||||
|
@ -13,7 +14,7 @@ export async function inspectContainer(context: IActionContext, node?: Container
|
|||
if (!node) {
|
||||
node = await ext.containersTree.showTreeItemPicker<ContainerTreeItem>(ContainerTreeItem.allContextRegExp, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No containers are available to inspect'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.containers.inspect.noContainers', 'No containers are available to inspect')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -6,20 +6,21 @@
|
|||
import { window } from 'vscode';
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { convertToMB } from '../../utils/convertToMB';
|
||||
|
||||
export async function pruneContainers(context: IActionContext): Promise<void> {
|
||||
const confirmPrune: string = "Are you sure you want to remove all stopped containers?";
|
||||
const confirmPrune: string = localize('vscode-docker.commands.containers.prune.confirm', 'Are you sure you want to remove all stopped containers?');
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: 'Remove' });
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.containers.prune.remove', 'Remove') });
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/promise-function-async */
|
||||
const result = await callDockerodeWithErrorHandling(() => ext.dockerode.pruneContainers(), context);
|
||||
|
||||
const numDeleted = (result.ContainersDeleted || []).length;
|
||||
const mbReclaimed = convertToMB(result.SpaceReclaimed);
|
||||
let message = `Removed ${numDeleted} container(s) and reclaimed ${mbReclaimed}MB of space.`;
|
||||
let message = localize('vscode-docker.commands.containers.prune.removed', 'Removed {0} container(s) and reclaimed {1}MB of space.', numDeleted, mbReclaimed);
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(message);
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
import vscode = require('vscode');
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
|
||||
import { multiSelectNodes } from '../../utils/multiSelectNodes';
|
||||
|
||||
export async function removeContainer(context: IActionContext, node?: ContainerTreeItem, nodes?: ContainerTreeItem[]): Promise<void> {
|
||||
nodes = await multiSelectNodes(
|
||||
{ ...context, noItemFoundErrorMessage: 'No containers are available to remove' },
|
||||
{ ...context, noItemFoundErrorMessage: localize('vscode-docker.commands.containers.remove.noContainers', 'No containers are available to remove') },
|
||||
ext.containersTree,
|
||||
ContainerTreeItem.allContextRegExp,
|
||||
node,
|
||||
|
@ -20,15 +21,15 @@ export async function removeContainer(context: IActionContext, node?: ContainerT
|
|||
|
||||
let confirmRemove: string;
|
||||
if (nodes.length === 1) {
|
||||
confirmRemove = `Are you sure you want to remove container "${nodes[0].label}"?`;
|
||||
confirmRemove = localize('vscode-docker.commands.containers.remove.confirmSingle', 'Are you sure you want to remove container "{0}"?', nodes[0].label);
|
||||
} else {
|
||||
confirmRemove = "Are you sure you want to remove selected containers?";
|
||||
confirmRemove = localize('vscode-docker.commands.containers.remove.confirmMulti', 'Are you sure you want to remove selected containers?');
|
||||
}
|
||||
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: 'Remove' });
|
||||
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: localize('vscode-docker.commands.containers.remove.remove', 'Remove') });
|
||||
|
||||
let removing: string = "Removing container(s)...";
|
||||
let removing: string = localize('vscode-docker.commands.containers.remove.removing', 'Removing container(s)...');
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: removing }, async () => {
|
||||
await Promise.all(nodes.map(async n => await n.deleteTreeItem(context)));
|
||||
});
|
||||
|
|
|
@ -7,20 +7,21 @@ import { Container } from 'dockerode';
|
|||
import vscode = require('vscode');
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { multiSelectNodes } from '../../utils/multiSelectNodes';
|
||||
|
||||
export async function restartContainer(context: IActionContext, node?: ContainerTreeItem, nodes?: ContainerTreeItem[]): Promise<void> {
|
||||
nodes = await multiSelectNodes(
|
||||
{ ...context, noItemFoundErrorMessage: 'No containers are available to restart' },
|
||||
{ ...context, noItemFoundErrorMessage: localize('vscode-docker.commands.containers.restart.noContainers', 'No containers are available to restart') },
|
||||
ext.containersTree,
|
||||
/^(created|dead|exited|paused|running)Container$/i,
|
||||
node,
|
||||
nodes
|
||||
);
|
||||
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: "Restarting Container(s)..." }, async () => {
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.containers.restart.restarting', 'Restarting Container(s)...') }, async () => {
|
||||
await Promise.all(nodes.map(async n => {
|
||||
const container: Container = n.getContainer();
|
||||
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
|
||||
|
||||
export async function selectContainer(context: IActionContext): Promise<string> {
|
||||
|
@ -16,7 +17,7 @@ export async function selectContainer(context: IActionContext): Promise<string>
|
|||
|
||||
node = await ext.containersTree.showTreeItemPicker(ContainerTreeItem.runningContainerRegExp, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No running containers are available'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.containers.select.noContainers', 'No running containers are available')
|
||||
});
|
||||
|
||||
return node.containerId;
|
||||
|
|
|
@ -7,20 +7,21 @@ import { Container } from 'dockerode';
|
|||
import vscode = require('vscode');
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { multiSelectNodes } from '../../utils/multiSelectNodes';
|
||||
|
||||
export async function startContainer(context: IActionContext, node?: ContainerTreeItem, nodes?: ContainerTreeItem[]): Promise<void> {
|
||||
nodes = await multiSelectNodes(
|
||||
{ ...context, noItemFoundErrorMessage: 'No containers are available to start' },
|
||||
{ ...context, noItemFoundErrorMessage: localize('vscode-docker.commands.containers.start.noContainers', 'No containers are available to start') },
|
||||
ext.containersTree,
|
||||
/^(created|dead|exited|paused)Container$/i,
|
||||
node,
|
||||
nodes
|
||||
);
|
||||
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: "Starting Container(s)..." }, async () => {
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.containers.start.starting', 'Starting Container(s)...') }, async () => {
|
||||
await Promise.all(nodes.map(async n => {
|
||||
const container: Container = n.getContainer();
|
||||
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
||||
|
|
|
@ -7,20 +7,21 @@ import { Container } from 'dockerode';
|
|||
import vscode = require('vscode');
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { multiSelectNodes } from '../../utils/multiSelectNodes';
|
||||
|
||||
export async function stopContainer(context: IActionContext, node?: ContainerTreeItem, nodes?: ContainerTreeItem[]): Promise<void> {
|
||||
nodes = await multiSelectNodes(
|
||||
{ ...context, noItemFoundErrorMessage: 'No containers are availble to stop' },
|
||||
{ ...context, noItemFoundErrorMessage: localize('vscode-docker.commands.containers.stop.noContainers', 'No containers are availble to stop') },
|
||||
ext.containersTree,
|
||||
/^(paused|restarting|running)Container$/i,
|
||||
node,
|
||||
nodes
|
||||
);
|
||||
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: "Stopping Container(s)..." }, async () => {
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.containers.stop.stopping', 'Stopping Container(s)...') }, async () => {
|
||||
await Promise.all(nodes.map(async n => {
|
||||
const container: Container = n.getContainer();
|
||||
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
|
||||
import { selectLogsCommand } from '../selectCommandTemplate';
|
||||
|
||||
|
@ -12,7 +13,7 @@ export async function viewContainerLogs(context: IActionContext, node?: Containe
|
|||
if (!node) {
|
||||
node = await ext.containersTree.showTreeItemPicker<ContainerTreeItem>(ContainerTreeItem.allContextRegExp, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No continers are available to view logs'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.containers.viewLogs.noContainers', 'No continers are available to view logs')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -10,12 +10,13 @@ import { quickPickOS, quickPickPlatform } from '../../configureWorkspace/configU
|
|||
import { DockerDebugScaffoldContext } from '../../debugging/DebugHelper';
|
||||
import { dockerDebugScaffoldingProvider, NetCoreScaffoldingOptions, PythonScaffoldingOptions } from '../../debugging/DockerDebugScaffoldingProvider';
|
||||
import { DockerPlatform } from '../../debugging/DockerPlatformHelper';
|
||||
import { localize } from '../../localize';
|
||||
import { getPythonProjectType } from '../../utils/pythonUtils';
|
||||
import { quickPickDockerFileItem, quickPickProjectFileItem } from '../../utils/quickPickFile';
|
||||
import { quickPickWorkspaceFolder } from '../../utils/quickPickWorkspaceFolder';
|
||||
|
||||
export async function initializeForDebugging(actionContext: IActionContext): Promise<void> {
|
||||
const folder = await quickPickWorkspaceFolder('To configure Docker debugging you must first open a folder or workspace in VS Code.');
|
||||
const folder = await quickPickWorkspaceFolder(localize('vscode-docker.commands.debugging.initialize.workspaceFolder', 'To configure Docker debugging you must first open a folder or workspace in VS Code.'));
|
||||
const platform = await quickPickPlatform(['Node.js', '.NET: ASP.NET Core', '.NET: Core Console', 'Python: Django', 'Python: Flask', 'Python: General']);
|
||||
|
||||
let debugPlatform: DockerPlatform;
|
||||
|
@ -33,7 +34,7 @@ export async function initializeForDebugging(actionContext: IActionContext): Pro
|
|||
debugPlatform = 'python';
|
||||
break;
|
||||
default:
|
||||
throw new Error('The selected platform is not yet supported for debugging.');
|
||||
throw new Error(localize('vscode-docker.commands.debugging.initialize.platformNotSupported', 'The selected platform is not yet supported for debugging.'));
|
||||
}
|
||||
|
||||
actionContext.telemetry.properties.platform = debugPlatform;
|
||||
|
@ -48,7 +49,7 @@ export async function initializeForDebugging(actionContext: IActionContext): Pro
|
|||
switch (context.platform) {
|
||||
case 'netCore':
|
||||
const options: NetCoreScaffoldingOptions = {
|
||||
appProject: (await quickPickProjectFileItem(undefined, context.folder, 'No .NET Core project file (.csproj or .fsproj) could be found.')).absoluteFilePath,
|
||||
appProject: (await quickPickProjectFileItem(undefined, context.folder, localize('vscode-docker.commands.debugging.initialize.noCsproj', 'No .NET Core project file (.csproj or .fsproj) could be found.'))).absoluteFilePath,
|
||||
platformOS: os.platform() === 'win32' ? await quickPickOS() : 'Linux',
|
||||
}
|
||||
await dockerDebugScaffoldingProvider.initializeNetCoreForDebugging(context, options);
|
||||
|
|
|
@ -8,6 +8,7 @@ import { IActionContext, IAzureQuickPickOptions } from 'vscode-azureextensionui'
|
|||
|
||||
import { extensionId } from '../constants';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from '../localize';
|
||||
import { openExternal } from '../utils/openExternal';
|
||||
|
||||
interface HelpMenuItem extends vscode.QuickPickItem {
|
||||
|
@ -17,10 +18,10 @@ interface HelpMenuItem extends vscode.QuickPickItem {
|
|||
|
||||
export async function help(context: IActionContext): Promise<void> {
|
||||
let items: HelpMenuItem[] = [
|
||||
{ label: 'Get started with Docker...', handler: getStarted, telemetryID: 'getStarted' },
|
||||
{ label: 'Review Docker extension issues...', handler: reviewIssues, telemetryID: 'reviewIssues' },
|
||||
{ label: 'Report Docker extension issue...', handler: reportIssue, telemetryID: 'reportIssue' },
|
||||
{ label: 'Edit settings...', handler: editSettings, telemetryID: 'editSettings' }
|
||||
{ label: localize('vscode-docker.commands.help.getStarted', 'Get started with Docker...'), handler: getStarted, telemetryID: 'getStarted' },
|
||||
{ label: localize('vscode-docker.commands.help.review', 'Review Docker extension issues...'), handler: reviewIssues, telemetryID: 'reviewIssues' },
|
||||
{ label: localize('vscode-docker.commands.help.report', 'Report Docker extension issue...'), handler: reportIssue, telemetryID: 'reportIssue' },
|
||||
{ label: localize('vscode-docker.commands.help.editSettings', 'Edit settings...'), handler: editSettings, telemetryID: 'editSettings' }
|
||||
];
|
||||
|
||||
const options: IAzureQuickPickOptions = { canPickMany: false, suppressPersistence: true }
|
||||
|
|
|
@ -7,6 +7,7 @@ import * as path from "path";
|
|||
import * as vscode from "vscode";
|
||||
import { IActionContext } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { getOfficialBuildTaskForDockerfile } from "../../tasks/TaskHelper";
|
||||
import { delay } from "../../utils/delay";
|
||||
import { getValidImageName } from "../../utils/getValidImageName";
|
||||
|
@ -20,7 +21,7 @@ const tagRegex: RegExp = /\$\{tag\}/i;
|
|||
export async function buildImage(context: IActionContext, dockerFileUri: vscode.Uri | undefined): Promise<void> {
|
||||
const configOptions: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration('docker');
|
||||
const defaultContextPath = configOptions.get('imageBuildContextPath', '');
|
||||
const rootFolder: vscode.WorkspaceFolder = await quickPickWorkspaceFolder('To build Docker files you must first open a folder or workspace in VS Code.');
|
||||
const rootFolder: vscode.WorkspaceFolder = await quickPickWorkspaceFolder(localize('vscode-docker.commands.images.build.workspaceFolder', 'To build Docker files you must first open a folder or workspace in VS Code.'));
|
||||
const dockerFileItem = await quickPickDockerFileItem(context, dockerFileUri, rootFolder);
|
||||
const task = await getOfficialBuildTaskForDockerfile(dockerFileItem.absoluteFilePath, rootFolder);
|
||||
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
import * as vscode from 'vscode';
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ImageTreeItem } from '../../tree/images/ImageTreeItem';
|
||||
|
||||
export async function copyFullTag(context: IActionContext, node: ImageTreeItem | undefined): Promise<string> {
|
||||
if (!node) {
|
||||
node = await ext.imagesTree.showTreeItemPicker<ImageTreeItem>(ImageTreeItem.contextValue, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No images are availalbe to copy tag'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.images.copyFullTag.noImages', 'No images are available to copy tag')
|
||||
});
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { Image, ImageInspectInfo } from "dockerode";
|
||||
import { IActionContext, openReadOnlyJson } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { ImageTreeItem } from "../../tree/images/ImageTreeItem";
|
||||
import { callDockerodeWithErrorHandling } from "../../utils/callDockerodeWithErrorHandling";
|
||||
|
||||
|
@ -13,7 +14,7 @@ export async function inspectImage(context: IActionContext, node?: ImageTreeItem
|
|||
if (!node) {
|
||||
node = await ext.imagesTree.showTreeItemPicker<ImageTreeItem>(ImageTreeItem.contextValue, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No images are availalbe to inspect'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.images.inspect.noImages', 'No images are available to inspect')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -6,20 +6,21 @@
|
|||
import { window } from 'vscode';
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { convertToMB } from '../../utils/convertToMB';
|
||||
|
||||
export async function pruneImages(context: IActionContext): Promise<void> {
|
||||
const confirmPrune: string = "Are you sure you want to remove all dangling images?";
|
||||
const confirmPrune: string = localize('vscode-docker.commands.images.prune.confirm', 'Are you sure you want to remove all dangling images?');
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: 'Remove' });
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.images.prune.remove', 'Remove') });
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/promise-function-async */
|
||||
const result = await callDockerodeWithErrorHandling(() => ext.dockerode.pruneImages(), context);
|
||||
|
||||
const numDeleted = (result.ImagesDeleted || []).length;
|
||||
const mbReclaimed = convertToMB(result.SpaceReclaimed);
|
||||
let message = `Removed ${numDeleted} images(s) and reclaimed ${mbReclaimed}MB of space.`;
|
||||
let message = localize('vscode-docker.commands.images.prune.removed', 'Removed {0} images(s) and reclaimed {1}MB of space.', numDeleted, mbReclaimed);
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(message);
|
||||
|
|
|
@ -7,6 +7,7 @@ import vscode = require('vscode');
|
|||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { configurationKeys } from '../../constants';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ImageTreeItem } from '../../tree/images/ImageTreeItem';
|
||||
import { askToSaveRegistryPath } from '../registries/registrySettings';
|
||||
import { addImageTaggingTelemetry, tagImage } from './tagImage';
|
||||
|
@ -15,7 +16,7 @@ export async function pushImage(context: IActionContext, node: ImageTreeItem | u
|
|||
if (!node) {
|
||||
node = await ext.imagesTree.showTreeItemPicker<ImageTreeItem>(ImageTreeItem.contextValue, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No images are availalbe to push'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.images.push.noImages', 'No images are available to push')
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -31,10 +32,10 @@ export async function pushImage(context: IActionContext, node: ImageTreeItem | u
|
|||
if (askToPushPrefix && defaultRegistryPath) {
|
||||
context.telemetry.properties.pushWithoutRepositoryAnswer = 'Cancel';
|
||||
|
||||
let tagFirst: vscode.MessageItem = { title: "Tag first" };
|
||||
let pushAnyway: vscode.MessageItem = { title: "Push anyway" }
|
||||
let tagFirst: vscode.MessageItem = { title: localize('vscode-docker.commands.images.push.tagFirst', 'Tag first') };
|
||||
let pushAnyway: vscode.MessageItem = { title: localize('vscode-docker.commands.images.push.pushAnyway', 'Push anyway') }
|
||||
let options: vscode.MessageItem[] = [tagFirst, pushAnyway];
|
||||
let response: vscode.MessageItem = await ext.ui.showWarningMessage(`This will attempt to push to the official public Docker Hub library (docker.io/library), which you may not have permissions for. To push to your own repository, you must tag the image like <docker-id-or-registry-server>/<imagename>`, ...options);
|
||||
let response: vscode.MessageItem = await ext.ui.showWarningMessage(localize('vscode-docker.commands.images.push.pushDockerHub', 'This will attempt to push to the official public Docker Hub library (docker.io/library), which you may not have permissions for. To push to your own repository, you must tag the image like <docker-id-or-registry-server>/<imagename>'), ...options);
|
||||
context.telemetry.properties.pushWithoutRepositoryAnswer = response.title;
|
||||
|
||||
if (response === tagFirst) {
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
import vscode = require('vscode');
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ImageTreeItem } from '../../tree/images/ImageTreeItem';
|
||||
import { multiSelectNodes } from '../../utils/multiSelectNodes';
|
||||
|
||||
export async function removeImage(context: IActionContext, node?: ImageTreeItem, nodes?: ImageTreeItem[]): Promise<void> {
|
||||
nodes = await multiSelectNodes(
|
||||
{ ...context, suppressCreatePick: true, noItemFoundErrorMessage: 'No images are available to remove' },
|
||||
{ ...context, suppressCreatePick: true, noItemFoundErrorMessage: localize('vscode-docker.commands.images.remove.noImages', 'No images are available to remove') },
|
||||
ext.imagesTree,
|
||||
ImageTreeItem.contextValue,
|
||||
node,
|
||||
|
@ -20,15 +21,15 @@ export async function removeImage(context: IActionContext, node?: ImageTreeItem,
|
|||
|
||||
let confirmRemove: string;
|
||||
if (nodes.length === 1) {
|
||||
confirmRemove = `Are you sure you want to remove image "${nodes[0].label}"? This will remove all matching and child images.`;
|
||||
confirmRemove = localize('vscode-docker.commands.images.remove.confirmSingle', 'Are you sure you want to remove image "{0}"? This will remove all matching and child images.', nodes[0].label);
|
||||
} else {
|
||||
confirmRemove = "Are you sure you want to remove selected images? This will remove all matching and child images.";
|
||||
confirmRemove = localize('vscode-docker.commands.images.remove.confirmMulti', 'Are you sure you want to remove selected images? This will remove all matching and child images.');
|
||||
}
|
||||
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: 'Remove' });
|
||||
|
||||
let removing: string = "Removing image(s)...";
|
||||
let removing: string = localize('vscode-docker.commands.images.remove.removing', 'Removing image(s)...');
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: removing }, async () => {
|
||||
await Promise.all(nodes.map(async n => await n.deleteTreeItem(context)));
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@ import * as os from 'os';
|
|||
import * as vscode from 'vscode';
|
||||
import { DialogResponses, IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { openExternal } from '../../utils/openExternal';
|
||||
import { getDockerOSType } from '../../utils/osUtils';
|
||||
|
||||
|
@ -16,7 +17,7 @@ export async function runAzureCliImage(context: IActionContext): Promise<void> {
|
|||
context.telemetry.properties.dockerOSType = osType;
|
||||
|
||||
if (osType === "windows") {
|
||||
const message = 'Currently, you can only run the Azure CLI when running Linux based containers.';
|
||||
const message = localize('vscode-docker.commands.images.runAzureCli.linuxOnly', 'Currently, you can only run the Azure CLI when running Linux based containers.');
|
||||
if (await vscode.window.showErrorMessage(message, DialogResponses.learnMore) === DialogResponses.learnMore) {
|
||||
await openExternal('https://docs.docker.com/docker-for-windows/#/switch-between-windows-and-linux-containers');
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ImageTreeItem } from '../../tree/images/ImageTreeItem';
|
||||
import { selectRunCommand } from '../selectCommandTemplate';
|
||||
|
||||
|
@ -20,7 +21,7 @@ async function runImageCore(context: IActionContext, node: ImageTreeItem | undef
|
|||
if (!node) {
|
||||
node = await ext.imagesTree.showTreeItemPicker<ImageTreeItem>(ImageTreeItem.contextValue, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No images are available to run'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.images.run.noImages', 'No images are available to run')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import * as vscode from 'vscode';
|
|||
import { IActionContext, TelemetryProperties } from 'vscode-azureextensionui';
|
||||
import { configurationKeys } from '../../constants';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ImageTreeItem } from '../../tree/images/ImageTreeItem';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { extractRegExGroups } from '../../utils/extractRegExGroups';
|
||||
|
@ -16,7 +17,7 @@ export async function tagImage(context: IActionContext, node: ImageTreeItem | un
|
|||
if (!node) {
|
||||
node = await ext.imagesTree.showTreeItemPicker<ImageTreeItem>(ImageTreeItem.contextValue, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No images are availalbe to tag'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.images.tag.noImages', 'No images are available to tag')
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -44,7 +45,7 @@ export async function getTagFromUserInput(fullTag: string, addDefaultRegistry: b
|
|||
|
||||
let opt: vscode.InputBoxOptions = {
|
||||
ignoreFocusOut: true,
|
||||
prompt: 'Tag image as...',
|
||||
prompt: localize('vscode-docker.commands.images.tag.tagAs', 'Tag image as...'),
|
||||
};
|
||||
if (addDefaultRegistry) {
|
||||
let registryLength: number = fullTag.indexOf('/');
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
import { window } from 'vscode';
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
|
||||
export async function createNetwork(context: IActionContext): Promise<void> {
|
||||
|
||||
const name = await ext.ui.showInputBox({
|
||||
value: '',
|
||||
prompt: 'Name of the network'
|
||||
prompt: localize('vscode-docker.commands.networks.create.promptName', 'Name of the network')
|
||||
});
|
||||
|
||||
const engineVersion = await ext.dockerode.version();
|
||||
|
@ -31,7 +32,7 @@ export async function createNetwork(context: IActionContext): Promise<void> {
|
|||
drivers,
|
||||
{
|
||||
canPickMany: false,
|
||||
placeHolder: 'Select the network driver to use (default is "bridge").'
|
||||
placeHolder: localize('vscode-docker.commands.networks.create.promptDriver', 'Select the network driver to use (default is "bridge").')
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -39,5 +40,5 @@ export async function createNetwork(context: IActionContext): Promise<void> {
|
|||
const result = <{ id: string }>await callDockerodeWithErrorHandling(() => ext.dockerode.createNetwork({ Name: name, Driver: driverSelection.label }), context);
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(`Network Created with ID ${result.id.substr(0, 12)}`);
|
||||
window.showInformationMessage(localize('vscode-docker.commands.networks.create.created', 'Network Created with ID {0}', result.id.substr(0, 12)));
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { Network } from "dockerode";
|
||||
import { IActionContext, openReadOnlyJson } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { NetworkTreeItem } from "../../tree/networks/NetworkTreeItem";
|
||||
import { callDockerodeWithErrorHandling } from "../../utils/callDockerodeWithErrorHandling";
|
||||
|
||||
|
@ -13,7 +14,7 @@ export async function inspectNetwork(context: IActionContext, node?: NetworkTree
|
|||
if (!node) {
|
||||
node = await ext.networksTree.showTreeItemPicker<NetworkTreeItem>(NetworkTreeItem.allContextRegExp, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No networks are available to inspect'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.networks.inspect.noNetworks', 'No networks are available to inspect')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -6,18 +6,19 @@
|
|||
import { window } from 'vscode';
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
|
||||
export async function pruneNetworks(context: IActionContext): Promise<void> {
|
||||
const confirmPrune: string = "Are you sure you want to remove all unused networks?";
|
||||
const confirmPrune: string = localize('vscode-docker.commands.networks.prune.confirm', 'Are you sure you want to remove all unused networks?');
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: 'Remove' });
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.networks.prune.remove', 'Remove') });
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/promise-function-async */
|
||||
const result = await callDockerodeWithErrorHandling(() => ext.dockerode.pruneNetworks(), context);
|
||||
|
||||
const numDeleted = (result.NetworksDeleted || []).length;
|
||||
let message = `Removed ${numDeleted} networks(s).`;
|
||||
let message = localize('vscode-docker.commands.networks.prune.removed', 'Removed {0} networks(s).', numDeleted);
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(message);
|
||||
|
|
|
@ -7,12 +7,13 @@ import vscode = require('vscode');
|
|||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { builtInNetworks } from '../../constants';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { NetworkTreeItem } from '../../tree/networks/NetworkTreeItem';
|
||||
import { multiSelectNodes } from '../../utils/multiSelectNodes';
|
||||
|
||||
export async function removeNetwork(context: IActionContext, node?: NetworkTreeItem, nodes?: NetworkTreeItem[]): Promise<void> {
|
||||
nodes = await multiSelectNodes(
|
||||
{ ...context, suppressCreatePick: true, noItemFoundErrorMessage: 'No networks are available to remove' },
|
||||
{ ...context, suppressCreatePick: true, noItemFoundErrorMessage: localize('vscode-docker.commands.networks.remove.noNetworks', 'No networks are available to remove') },
|
||||
ext.networksTree,
|
||||
NetworkTreeItem.customNetworkRegExp,
|
||||
node,
|
||||
|
@ -20,20 +21,20 @@ export async function removeNetwork(context: IActionContext, node?: NetworkTreeI
|
|||
);
|
||||
if (nodes.some(n => builtInNetworks.includes(n.networkName))) {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
ext.ui.showWarningMessage('The built-in networks \'bridge\', \'host\', and \'none\' cannot be removed.');
|
||||
ext.ui.showWarningMessage(localize('vscode-docker.commands.networks.remove.noBuiltIn', 'The built-in networks \'bridge\', \'host\', and \'none\' cannot be removed.'));
|
||||
nodes = nodes.filter(n => !builtInNetworks.includes(n.networkName));
|
||||
}
|
||||
let confirmRemove: string;
|
||||
if (nodes.length === 1) {
|
||||
confirmRemove = `Are you sure you want to remove network "${nodes[0].label}"?`;
|
||||
confirmRemove = localize('vscode-docker.commands.networks.remove.confirmSingle', 'Are you sure you want to remove network "{0}"?', nodes[0].label);
|
||||
} else {
|
||||
confirmRemove = "Are you sure you want to remove selected networks?";
|
||||
confirmRemove = localize('vscode-docker.commands.networks.remove.confirmMulti', 'Are you sure you want to remove selected networks?');
|
||||
}
|
||||
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: 'Remove' });
|
||||
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: localize('vscode-docker.commands.networks.remove.remove', 'Remove') });
|
||||
|
||||
let removing: string = "Removing network(s)...";
|
||||
let removing: string = localize('vscode-docker.commands.networks.remove.removing', 'Removing network(s)...');
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: removing }, async () => {
|
||||
await Promise.all(nodes.map(async n => await n.deleteTreeItem(context)));
|
||||
});
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
import { window } from 'vscode';
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from '../localize';
|
||||
import { callDockerodeWithErrorHandling } from '../utils/callDockerodeWithErrorHandling';
|
||||
import { convertToMB } from '../utils/convertToMB';
|
||||
|
||||
export async function pruneSystem(context: IActionContext): Promise<void> {
|
||||
const confirmPrune: string = "Are you sure you want to remove all stopped containers, dangling images, unused networks, and unused volumes?";
|
||||
const confirmPrune: string = localize('vscode-docker.commands.pruneSystem.confirm', 'Are you sure you want to remove all stopped containers, dangling images, unused networks, and unused volumes?');
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: 'Remove' });
|
||||
|
||||
|
@ -27,7 +28,7 @@ export async function pruneSystem(context: IActionContext): Promise<void> {
|
|||
const numVolumes = (volumesResult.VolumesDeleted || []).length;
|
||||
|
||||
const mbReclaimed = convertToMB(containersResult.SpaceReclaimed + imagesResult.SpaceReclaimed + volumesResult.SpaceReclaimed);
|
||||
let message = `Removed ${numContainers} container(s), ${numImages} image(s), ${numNetworks} network(s), ${numVolumes} volume(s) and reclaimed ${mbReclaimed}MB of space.`;
|
||||
let message = localize('vscode-docker.commands.pruneSystem.removed', 'Removed {0} container(s), {1} image(s), {2} network(s), {3} volume(s) and reclaimed {4}MB of space.', numContainers, numImages, numNetworks, numVolumes, mbReclaimed);
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(message);
|
||||
|
|
|
@ -7,6 +7,7 @@ import { commands, ConfigurationTarget, MessageItem, workspace, WorkspaceConfigu
|
|||
import { callWithTelemetryAndErrorHandling, IActionContext, registerCommand, UserCancelledError } from 'vscode-azureextensionui';
|
||||
import { extensionId } from '../constants';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from '../localize';
|
||||
import { DockerExtensionKind, getVSCodeRemoteInfo, IVSCodeRemoteInfo, RemoteKind } from '../utils/getVSCodeRemoteInfo';
|
||||
|
||||
/**
|
||||
|
@ -36,18 +37,18 @@ async function verifyIsRunningInWorkspace(context: IActionContext): Promise<void
|
|||
let learnMoreLink: string;
|
||||
switch (remoteInfo.remoteKind) {
|
||||
case RemoteKind.ssh:
|
||||
message = 'This operation is not supported because the Docker extension is currently running on your local machine.';
|
||||
switchTitle = 'Switch to Remote SSH';
|
||||
message = localize('vscode-docker.commands.registerWorkspaceCommands.local', 'This operation is not supported because the Docker extension is currently running on your local machine.');
|
||||
switchTitle = localize('vscode-docker.commands.registerWorkspaceCommands.switchSsh', 'Switch to Remote SSH');
|
||||
learnMoreLink = 'https://aka.ms/AA5y2rd';
|
||||
break;
|
||||
case RemoteKind.wsl:
|
||||
message = 'This operation is not supported because the Docker extension is currently running outside of WSL.';
|
||||
switchTitle = 'Switch to WSL';
|
||||
message = localize('vscode-docker.commands.registerWorkspaceCommands.outsideWsl', 'This operation is not supported because the Docker extension is currently running outside of WSL.');
|
||||
switchTitle = localize('vscode-docker.commands.registerWorkspaceCommands.switchWsl', 'Switch to WSL');
|
||||
learnMoreLink = 'https://aka.ms/AA5xvjn';
|
||||
break;
|
||||
case RemoteKind.devContainer:
|
||||
message = 'This operation is not supported because the Docker extension is currently running outside of your container.';
|
||||
switchTitle = 'Switch to Container';
|
||||
message = localize('vscode-docker.commands.registerWorkspaceCommands.outsideContainer', 'This operation is not supported because the Docker extension is currently running outside of your container.');
|
||||
switchTitle = localize('vscode-docker.commands.registerWorkspaceCommands.switchContainer', 'Switch to Container');
|
||||
learnMoreLink = 'https://aka.ms/AA5xva6';
|
||||
break;
|
||||
default:
|
||||
|
@ -61,8 +62,8 @@ async function verifyIsRunningInWorkspace(context: IActionContext): Promise<void
|
|||
updateExtensionKind('workspace');
|
||||
|
||||
context.telemetry.properties.cancelStep = 'requiresReload';
|
||||
let reloadMessage: string = 'This change to the Docker extension requires reloading VS Code to take effect.';
|
||||
let reload: MessageItem = { title: 'Reload Now' };
|
||||
let reloadMessage: string = localize('vscode-docker.commands.registerWorkspaceCommands.reloadRequired', 'This change to the Docker extension requires reloading VS Code to take effect.');
|
||||
let reload: MessageItem = { title: localize('vscode-docker.commands.registerWorkspaceCommands.reload', 'Reload Now') };
|
||||
await ext.ui.showWarningMessage(reloadMessage, reload);
|
||||
|
||||
// Add a one-off event here before reloading the window otherwise we'll lose telemetry for this code path
|
||||
|
|
|
@ -11,6 +11,7 @@ import * as vscode from "vscode";
|
|||
import { IAppServiceWizardContext, SiteClient } from "vscode-azureappservice";
|
||||
import { AzureWizardExecuteStep, createAzureClient } from "vscode-azureextensionui";
|
||||
import { ext } from "../../../extensionVariables";
|
||||
import { localize } from "../../../localize";
|
||||
import { AzureRegistryTreeItem } from '../../../tree/registries/azure/AzureRegistryTreeItem';
|
||||
import { AzureRepositoryTreeItem } from '../../../tree/registries/azure/AzureRepositoryTreeItem';
|
||||
import { DockerHubRepositoryTreeItem } from '../../../tree/registries/dockerHub/DockerHubRepositoryTreeItem';
|
||||
|
@ -35,15 +36,15 @@ export class DockerWebhookCreateStep extends AzureWizardExecuteStep<IAppServiceW
|
|||
let siteClient = new SiteClient(site, context);
|
||||
let appUri: string = (await siteClient.getWebAppPublishCredential()).scmUri;
|
||||
if (this._treeItem.parent instanceof AzureRepositoryTreeItem) {
|
||||
const creatingNewWebhook: string = `Creating webhook for web app "${context.newSiteName}"...`;
|
||||
const creatingNewWebhook: string = localize('vscode-docker.commands.registries.azure.dockerWebhook.creatingWebhook', 'Creating webhook for web app "{0}"...', context.newSiteName);
|
||||
ext.outputChannel.appendLine(creatingNewWebhook);
|
||||
progress.report({ message: creatingNewWebhook });
|
||||
const webhook = await this.createWebhookForApp(this._treeItem, context.site, appUri);
|
||||
ext.outputChannel.appendLine(`Created webhook "${webhook.name}" with scope "${webhook.scope}", id: "${webhook.id}" and location: "${webhook.location}"`);
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.dockerWebhook.createdWebhook', 'Created webhook "{0}" with scope "{1}", id: "{2}" and location: "{3}"', webhook.name, webhook.scope, webhook.id, webhook.location));
|
||||
} else if (this._treeItem.parent instanceof DockerHubRepositoryTreeItem) {
|
||||
// point to dockerhub to create a webhook
|
||||
// http://cloud.docker.com/repository/docker/<registryName>/<repoName>/webHooks
|
||||
const dockerhubPrompt: string = "Copy & Open";
|
||||
const dockerhubPrompt: string = localize('vscode-docker.commands.registries.azure.dockerWebhook.copyAndOpen', 'Copy & Open');
|
||||
const dockerhubUri: string = `https://cloud.docker.com/repository/docker/${this._treeItem.parent.parent.namespace}/${this._treeItem.parent.repoName}/webHooks`;
|
||||
|
||||
// NOTE: The response to the information message is not awaited but handled independently of the wizard steps.
|
||||
|
@ -53,7 +54,7 @@ export class DockerWebhookCreateStep extends AzureWizardExecuteStep<IAppServiceW
|
|||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window
|
||||
.showInformationMessage(`To set up a CI/CD webhook, open the page "${dockerhubUri}" and enter the URI to the created web app in your dockerhub account`, dockerhubPrompt)
|
||||
.showInformationMessage(localize('vscode-docker.commands.registries.azure.dockerWebhook.cicd', 'To set up a CI/CD webhook, open the page "{0}" and enter the URI to the created web app in your dockerhub account', dockerhubUri), dockerhubPrompt)
|
||||
.then(response => {
|
||||
if (response) {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { ProgressLocation, window } from 'vscode';
|
||||
import { DialogResponses, IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../extensionVariables';
|
||||
import { localize } from "../../../localize";
|
||||
import { AzureRegistryTreeItem } from '../../../tree/registries/azure/AzureRegistryTreeItem';
|
||||
import { registryExpectedContextValues } from '../../../tree/registries/registryContextValues';
|
||||
|
||||
|
@ -14,16 +15,16 @@ export async function deleteAzureRegistry(context: IActionContext, node?: AzureR
|
|||
node = await ext.registriesTree.showTreeItemPicker<AzureRegistryTreeItem>(registryExpectedContextValues.azure.registry, { ...context, suppressCreatePick: true });
|
||||
}
|
||||
|
||||
const confirmDelete: string = `Are you sure you want to delete registry "${node.registryName}" and its associated images?`;
|
||||
const confirmDelete: string = localize('vscode-docker.commands.registries.azure.deleteRegistry.confirm', 'Are you sure you want to delete registry "{0}" and its associated images?', node.registryName);
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmDelete, { modal: true }, DialogResponses.deleteResponse);
|
||||
|
||||
const deleting = `Deleting registry "${node.registryName}"...`;
|
||||
const deleting = localize('vscode-docker.commands.registries.azure.deleteRegistry.deleting', 'Deleting registry "{0}"...', node.registryName);
|
||||
await window.withProgress({ location: ProgressLocation.Notification, title: deleting }, async () => {
|
||||
await node.deleteTreeItem(context);
|
||||
});
|
||||
|
||||
const message = `Successfully deleted registry "${node.registryName}".`;
|
||||
const message = localize('vscode-docker.commands.registries.azure.deleteRegistry.deleted', 'Successfully deleted registry "{0}".', node.registryName);
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(message);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { ProgressLocation, window } from 'vscode';
|
||||
import { DialogResponses, IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../extensionVariables';
|
||||
import { localize } from "../../../localize";
|
||||
import { AzureRepositoryTreeItem } from '../../../tree/registries/azure/AzureRepositoryTreeItem';
|
||||
import { registryExpectedContextValues } from '../../../tree/registries/registryContextValues';
|
||||
|
||||
|
@ -14,16 +15,16 @@ export async function deleteAzureRepository(context: IActionContext, node?: Azur
|
|||
node = await ext.registriesTree.showTreeItemPicker<AzureRepositoryTreeItem>(registryExpectedContextValues.azure.repository, { ...context, suppressCreatePick: true });
|
||||
}
|
||||
|
||||
const confirmDelete = `Are you sure you want to delete repository "${node.repoName}" and its associated images?`;
|
||||
const confirmDelete = localize('vscode-docker.commands.registries.azure.deleteRepository.confirm', 'Are you sure you want to delete repository "{0}" and its associated images?', node.repoName);
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmDelete, { modal: true }, DialogResponses.deleteResponse);
|
||||
|
||||
const deleting = `Deleting repository "${node.repoName}"...`;
|
||||
const deleting = localize('vscode-docker.commands.registries.azure.deleteRepository.deleting', 'Deleting repository "{0}"...', node.repoName);
|
||||
await window.withProgress({ location: ProgressLocation.Notification, title: deleting }, async () => {
|
||||
await node.deleteTreeItem(context);
|
||||
});
|
||||
|
||||
const deleteSucceeded = `Successfully deleted repository "${node.repoName}".`;
|
||||
const deleteSucceeded = localize('vscode-docker.commands.registries.azure.deleteRepository.deleted', 'Successfully deleted repository "{0}".', node.repoName);
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(deleteSucceeded);
|
||||
|
|
|
@ -10,6 +10,7 @@ import { env, Progress, Uri, window } from "vscode";
|
|||
import { AppKind, AppServicePlanListStep, IAppServiceWizardContext, SiteNameStep, WebsiteOS } from "vscode-azureappservice";
|
||||
import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, createAzureClient, IActionContext, LocationListStep, ResourceGroupListStep } from "vscode-azureextensionui";
|
||||
import { ext } from "../../../extensionVariables";
|
||||
import { localize } from "../../../localize";
|
||||
import { RegistryApi } from '../../../tree/registries/all/RegistryApi';
|
||||
import { AzureAccountTreeItem } from '../../../tree/registries/azure/AzureAccountTreeItem';
|
||||
import { azureRegistryProviderId } from '../../../tree/registries/azure/azureRegistryProvider';
|
||||
|
@ -63,7 +64,7 @@ export async function deployImageToAzure(context: IActionContext, node?: RemoteT
|
|||
|
||||
const site: Site = nonNullProp(wizardContext, 'site');
|
||||
const siteUri: string = `https://${site.defaultHostName}`;
|
||||
const createdNewWebApp: string = `Successfully created web app "${site.name}": ${siteUri}`;
|
||||
const createdNewWebApp: string = localize('vscode-docker.commands.registries.azure.deployImage.created', 'Successfully created web app "{0}": {1}', site.name, siteUri);
|
||||
ext.outputChannel.appendLine(createdNewWebApp);
|
||||
|
||||
const openSite: string = 'Open Site';
|
||||
|
@ -92,7 +93,7 @@ async function getNewSiteConfig(node: RemoteTagTreeItem): Promise<SiteConfig> {
|
|||
if (registryTI instanceof AzureRegistryTreeItem) {
|
||||
const cred = await registryTI.tryGetAdminCredentials();
|
||||
if (!cred) {
|
||||
throw new Error('Azure App service currently only supports running images from Azure Container Registries with admin enabled');
|
||||
throw new Error(localize('vscode-docker.commands.registries.azure.deployImage.notAdminEnabled', 'Azure App service currently only supports running images from Azure Container Registries with admin enabled'));
|
||||
} else {
|
||||
username = cred.username;
|
||||
password = nonNullProp(cred, 'passwords')[0].value;
|
||||
|
@ -102,10 +103,10 @@ async function getNewSiteConfig(node: RemoteTagTreeItem): Promise<SiteConfig> {
|
|||
username = registryTI.cachedProvider.username;
|
||||
password = await getRegistryPassword(registryTI.cachedProvider);
|
||||
} else {
|
||||
throw new RangeError(`Unrecognized node type "${registryTI.constructor.name}"`);
|
||||
throw new RangeError(localize('vscode-docker.commands.registries.azure.deployImage.unrecognizedNodeTypeA', 'Unrecognized node type "{0}"', registryTI.constructor.name));
|
||||
}
|
||||
} else {
|
||||
throw new RangeError(`Unrecognized node type "${registryTI.constructor.name}"`);
|
||||
throw new RangeError(localize('vscode-docker.commands.registries.azure.deployImage.unrecognizedNodeTypeB', 'Unrecognized node type "{0}"', registryTI.constructor.name));
|
||||
}
|
||||
|
||||
if (username && password) {
|
||||
|
@ -132,7 +133,7 @@ class DockerSiteCreateStep extends AzureWizardExecuteStep<IAppServiceWizardConte
|
|||
}
|
||||
|
||||
public async execute(context: IAppServiceWizardContext, progress: Progress<{ message?: string; increment?: number }>): Promise<void> {
|
||||
const creatingNewApp: string = `Creating web app "${context.newSiteName}"...`;
|
||||
const creatingNewApp: string = localize('vscode-docker.commands.registries.azure.deployImage.creatingWebApp', 'Creating web app "{0}"...', context.newSiteName);
|
||||
ext.outputChannel.appendLine(creatingNewApp);
|
||||
progress.report({ message: creatingNewApp });
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { ContainerRegistryManagementModels as AcrModels } from "azure-arm-contai
|
|||
import { window } from "vscode";
|
||||
import { IActionContext } from "vscode-azureextensionui";
|
||||
import { ext } from "../../../../extensionVariables";
|
||||
import { localize } from "../../../../localize";
|
||||
import { AzureTaskTreeItem } from "../../../../tree/registries/azure/AzureTaskTreeItem";
|
||||
|
||||
export async function runAzureTask(context: IActionContext, node?: AzureTaskTreeItem): Promise<void> {
|
||||
|
@ -20,5 +21,5 @@ export async function runAzureTask(context: IActionContext, node?: AzureTaskTree
|
|||
await node.parent.refresh();
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(`Successfully scheduled run "${run.runId}" for task "${node.taskName}".`);
|
||||
window.showInformationMessage(localize('vscode-docker.commands.registries.azure.tasks.runTaskScheduled', 'Successfully scheduled run "{0}" for task "{1}".', run.runId, node.taskName));
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import * as tar from 'tar';
|
|||
import * as vscode from 'vscode';
|
||||
import { IActionContext, IAzureQuickPickItem } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../../extensionVariables';
|
||||
import { localize } from "../../../../localize";
|
||||
import { AzureRegistryTreeItem } from '../../../../tree/registries/azure/AzureRegistryTreeItem';
|
||||
import { registryExpectedContextValues } from "../../../../tree/registries/registryContextValues";
|
||||
import { getBlobInfo, streamLogs } from "../../../../utils/azureUtils";
|
||||
|
@ -29,20 +30,20 @@ export async function scheduleRunRequest(context: IActionContext, requestType: '
|
|||
let fileItem: Item;
|
||||
let imageName: string;
|
||||
if (requestType === 'DockerBuildRequest') {
|
||||
rootFolder = await quickPickWorkspaceFolder("To quick build Docker files you must first open a folder or workspace in VS Code.");
|
||||
rootFolder = await quickPickWorkspaceFolder(localize('vscode-docker.commands.registries.azure.tasks.buildFolder', 'To quick build Docker files you must first open a folder or workspace in VS Code.'));
|
||||
fileItem = await quickPickDockerFileItem(context, uri, rootFolder);
|
||||
imageName = await quickPickImageName(context, rootFolder, fileItem);
|
||||
} else if (requestType === 'FileTaskRunRequest') {
|
||||
rootFolder = await quickPickWorkspaceFolder("To run a task from a .yaml file you must first open a folder or workspace in VS Code.");
|
||||
fileItem = await quickPickYamlFileItem(uri, rootFolder, "To run a task from a .yaml file you must have yaml file in your VS Code workspace.");
|
||||
rootFolder = await quickPickWorkspaceFolder(localize('vscode-docker.commands.registries.azure.tasks.yamlFolder', 'To run a task from a .yaml file you must first open a folder or workspace in VS Code.'));
|
||||
fileItem = await quickPickYamlFileItem(uri, rootFolder, localize('vscode-docker.commands.registries.azure.tasks.yamlYaml', 'To run a task from a .yaml file you must have yaml file in your VS Code workspace.'));
|
||||
} else {
|
||||
throw new Error("Run Request Type Currently not supported.");
|
||||
throw new Error(localize('vscode-docker.commands.registries.azure.tasks.runTypeUnsupported', 'Run Request Type Currently not supported.'));
|
||||
}
|
||||
|
||||
const node = await ext.registriesTree.showTreeItemPicker<AzureRegistryTreeItem>(registryExpectedContextValues.azure.registry, context);
|
||||
|
||||
const osPick = ['Linux', 'Windows'].map(item => <IAzureQuickPickItem<string>>{ label: item, data: item });
|
||||
const osType: string = (await ext.ui.showQuickPick(osPick, { 'placeHolder': 'Select image base OS' })).data;
|
||||
const osType: string = (await ext.ui.showQuickPick(osPick, { placeHolder: localize('vscode-docker.commands.registries.azure.tasks.selectOs', 'Select image base OS') })).data;
|
||||
|
||||
const tarFilePath: string = getTempSourceArchivePath();
|
||||
|
||||
|
@ -50,7 +51,7 @@ export async function scheduleRunRequest(context: IActionContext, requestType: '
|
|||
ext.outputChannel.show();
|
||||
|
||||
const uploadedSourceLocation: string = await uploadSourceCode(node.client, node.registryName, node.resourceGroup, rootFolder, tarFilePath);
|
||||
ext.outputChannel.appendLine("Uploaded source code to " + tarFilePath);
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.uploaded', 'Uploaded source code to {0}', tarFilePath));
|
||||
|
||||
let runRequest: AcrModels.DockerBuildRequest | AcrModels.FileTaskRunRequest;
|
||||
if (requestType === 'DockerBuildRequest') {
|
||||
|
@ -72,10 +73,10 @@ export async function scheduleRunRequest(context: IActionContext, requestType: '
|
|||
}
|
||||
|
||||
// Schedule the run and Clean up.
|
||||
ext.outputChannel.appendLine("Set up run request");
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.setUp', 'Set up run request'));
|
||||
|
||||
const run = await node.client.registries.scheduleRun(node.resourceGroup, node.registryName, runRequest);
|
||||
ext.outputChannel.appendLine("Scheduled run " + run.runId);
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.scheduledRun', 'Scheduled run {0}', run.runId));
|
||||
|
||||
await streamLogs(node, run);
|
||||
await fse.unlink(tarFilePath);
|
||||
|
@ -111,24 +112,24 @@ async function quickPickImageName(context: IActionContext, rootFolder: vscode.Wo
|
|||
}
|
||||
|
||||
async function uploadSourceCode(client: ContainerRegistryManagementClient, registryName: string, resourceGroupName: string, rootFolder: vscode.WorkspaceFolder, tarFilePath: string): Promise<string> {
|
||||
ext.outputChannel.appendLine(" Sending source code to temp file");
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.sendingSource', ' Sending source code to temp file'));
|
||||
let source: string = rootFolder.uri.fsPath;
|
||||
let items = await fse.readdir(source);
|
||||
items = items.filter(i => !(i in vcsIgnoreList));
|
||||
// tslint:disable-next-line:no-unsafe-any
|
||||
tar.c({ cwd: source }, items).pipe(fse.createWriteStream(tarFilePath));
|
||||
|
||||
ext.outputChannel.appendLine(" Getting build source upload URL ");
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.gettingBuildSourceUploadUrl', ' Getting build source upload URL'));
|
||||
let sourceUploadLocation = await client.registries.getBuildSourceUploadUrl(resourceGroupName, registryName);
|
||||
let uploadUrl: string = sourceUploadLocation.uploadUrl;
|
||||
let relativePath: string = sourceUploadLocation.relativePath;
|
||||
|
||||
ext.outputChannel.appendLine(" Getting blob info from upload URL ");
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.gettingBlobInfo', ' Getting blob info from upload URL'));
|
||||
// Right now, accountName and endpointSuffix are unused, but will be used for streaming logs later.
|
||||
let blobInfo = getBlobInfo(uploadUrl);
|
||||
ext.outputChannel.appendLine(" Creating blob service ");
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.creatingBlobService', ' Creating blob service'));
|
||||
let blob: BlobService = createBlobServiceWithSas(blobInfo.host, blobInfo.sasToken);
|
||||
ext.outputChannel.appendLine(" Creating block blob ");
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.creatingBlockBlob', ' Creating block blob'));
|
||||
await new Promise((resolve, reject) => {
|
||||
blob.createBlockBlobFromLocalFile(blobInfo.containerName, blobInfo.blobName, tarFilePath, (error, result, response): void => {
|
||||
if (error) {
|
||||
|
@ -145,7 +146,7 @@ function getTempSourceArchivePath(): string {
|
|||
/* tslint:disable-next-line:insecure-random */
|
||||
const id: number = Math.floor(Math.random() * Math.pow(10, idPrecision));
|
||||
const archive = `sourceArchive${id}.tar.gz`;
|
||||
ext.outputChannel.appendLine(`Setting up temp file with '${archive}'`);
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.azure.tasks.settingUpTempFile', 'Setting up temp file with \'{0}\'', archive));
|
||||
const tarFilePath: string = path.join(os.tmpdir(), archive);
|
||||
return tarFilePath;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { BlobService, createBlobServiceWithSas } from "azure-storage";
|
||||
import { IActionContext, openReadOnlyContent } from "vscode-azureextensionui";
|
||||
import { ext } from "../../../../extensionVariables";
|
||||
import { localize } from "../../../../localize";
|
||||
import { AzureTaskRunTreeItem } from "../../../../tree/registries/azure/AzureTaskRunTreeItem";
|
||||
import { getBlobInfo, getBlobToText, IBlobInfo } from "../../../../utils/azureUtils";
|
||||
import { nonNullProp } from "../../../../utils/nonNull";
|
||||
|
@ -16,7 +17,7 @@ export async function viewAzureTaskLogs(context: IActionContext, node?: AzureTas
|
|||
}
|
||||
|
||||
const registryTI = node.parent.parent.parent;
|
||||
await node.runWithTemporaryDescription('Retrieving logs...', async () => {
|
||||
await node.runWithTemporaryDescription(localize('vscode-docker.commands.registries.azure.tasks.retrievingLogs', 'Retrieving logs...'), async () => {
|
||||
const result = await registryTI.client.runs.getLogSasUrl(registryTI.resourceGroup, registryTI.registryName, node.runId);
|
||||
let blobInfo: IBlobInfo = getBlobInfo(nonNullProp(result, 'logLink'));
|
||||
let blob: BlobService = createBlobServiceWithSas(blobInfo.host, blobInfo.sasToken);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { ProgressLocation, window } from "vscode";
|
||||
import { IActionContext } from "vscode-azureextensionui";
|
||||
import { ext } from "../../../extensionVariables";
|
||||
import { localize } from "../../../localize";
|
||||
import { registryExpectedContextValues } from "../../../tree/registries/registryContextValues";
|
||||
import { RemoteTagTreeItem } from "../../../tree/registries/RemoteTagTreeItem";
|
||||
import { registryRequest } from "../../../utils/registryRequestUtils";
|
||||
|
@ -15,15 +16,15 @@ export async function untagAzureImage(context: IActionContext, node?: RemoteTagT
|
|||
node = await ext.registriesTree.showTreeItemPicker<RemoteTagTreeItem>(registryExpectedContextValues.azure.tag, {
|
||||
...context,
|
||||
suppressCreatePick: true,
|
||||
noItemFoundErrorMessage: 'No images are available to untag'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.registries.azure.untag.noImages', 'No images are available to untag')
|
||||
});
|
||||
}
|
||||
|
||||
const confirmUntag: string = `Are you sure you want to untag "${node.repoNameAndTag}"? This does not delete the manifest referenced by the tag.`;
|
||||
const confirmUntag: string = localize('vscode-docker.commands.registries.azure.untag.confirm', 'Are you sure you want to untag "{0}"? This does not delete the manifest referenced by the tag.', node.repoNameAndTag);
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmUntag, { modal: true }, { title: "Untag" });
|
||||
|
||||
const untagging = `Untagging "${node.repoNameAndTag}"...`;
|
||||
const untagging = localize('vscode-docker.commands.registries.azure.untag.untagging', 'Untagging "{0}"...', node.repoNameAndTag);
|
||||
const repoTI = node.parent;
|
||||
await window.withProgress({ location: ProgressLocation.Notification, title: untagging }, async () => {
|
||||
await registryRequest(repoTI, 'DELETE', `v2/_acr/${repoTI.repoName}/tags/${node.tag}`);
|
||||
|
@ -32,5 +33,5 @@ export async function untagAzureImage(context: IActionContext, node?: RemoteTagT
|
|||
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(`Successfully untagged "${node.repoNameAndTag}".`);
|
||||
window.showInformationMessage(localize('vscode-docker.commands.registries.azure.untag.untagged', 'Successfully untagged "{0}".', node.repoNameAndTag));
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import * as vscode from "vscode";
|
||||
import { IActionContext } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from "../../localize";
|
||||
import { AzureTaskRunTreeItem } from "../../tree/registries/azure/AzureTaskRunTreeItem";
|
||||
import { DockerV2TagTreeItem } from "../../tree/registries/dockerV2/DockerV2TagTreeItem";
|
||||
import { registryExpectedContextValues } from "../../tree/registries/registryContextValues";
|
||||
|
@ -15,7 +16,7 @@ export async function copyRemoteImageDigest(context: IActionContext, node?: Dock
|
|||
if (!node) {
|
||||
node = await ext.registriesTree.showTreeItemPicker<DockerV2TagTreeItem>(registryExpectedContextValues.dockerV2.tag, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No remote images are available to copy the digest'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.registries.copyRemote.noImages', 'No remote images are available to copy the digest')
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -24,10 +25,10 @@ export async function copyRemoteImageDigest(context: IActionContext, node?: Dock
|
|||
if (node.outputImage) {
|
||||
digest = nonNullProp(node.outputImage, 'digest');
|
||||
} else {
|
||||
throw new Error('Failed to find output image for this task run.');
|
||||
throw new Error(localize('vscode-docker.commands.registries.copyRemote.noOutputImage', 'Failed to find output image for this task run.'));
|
||||
}
|
||||
} else {
|
||||
await node.runWithTemporaryDescription('Getting digest...', async () => {
|
||||
await node.runWithTemporaryDescription(localize('vscode-docker.commands.registries.copyRemote.gettingDigest', 'Getting digest...'), async () => {
|
||||
digest = await (<DockerV2TagTreeItem>node).getDigest();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { ProgressLocation, window } from 'vscode';
|
||||
import { DialogResponses, IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from "../../localize";
|
||||
import { DockerV2TagTreeItem } from '../../tree/registries/dockerV2/DockerV2TagTreeItem';
|
||||
import { registryExpectedContextValues } from '../../tree/registries/registryContextValues';
|
||||
|
||||
|
@ -14,23 +15,23 @@ export async function deleteRemoteImage(context: IActionContext, node?: DockerV2
|
|||
node = await ext.registriesTree.showTreeItemPicker<DockerV2TagTreeItem>(registryExpectedContextValues.dockerV2.tag, {
|
||||
...context,
|
||||
suppressCreatePick: true,
|
||||
noItemFoundErrorMessage: 'No remote images are available to delete'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.registries.deleteRemote.noImages', 'No remote images are available to delete')
|
||||
});
|
||||
}
|
||||
|
||||
const confirmDelete = `Are you sure you want to delete image "${node.repoNameAndTag}"? This will delete all images that have the same digest.`;
|
||||
const confirmDelete = localize('vscode-docker.commands.registries.deleteRemote.confirm', 'Are you sure you want to delete image "{0}"? This will delete all images that have the same digest.', node.repoNameAndTag);
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmDelete, { modal: true }, DialogResponses.deleteResponse);
|
||||
|
||||
const repoTI = node.parent;
|
||||
const deleting = `Deleting image "${node.repoNameAndTag}"...`;
|
||||
const deleting = localize('vscode-docker.commands.registries.deleteRemote.deleting', 'Deleting image "{0}"...', node.repoNameAndTag);
|
||||
await window.withProgress({ location: ProgressLocation.Notification, title: deleting }, async () => {
|
||||
await node.deleteTreeItem(context);
|
||||
});
|
||||
|
||||
// Other tags that also matched the image may have been deleted, so refresh the whole repository
|
||||
await repoTI.refresh();
|
||||
const message = `Successfully deleted image "${node.repoNameAndTag}".`;
|
||||
const message = localize('vscode-docker.commands.registries.deleteRemote.deleted', 'Successfully deleted image "{0}".', node.repoNameAndTag);
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(message);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { IActionContext } from "vscode-azureextensionui";
|
||||
import { dockerHubUrl } from "../../../constants";
|
||||
import { ext } from "../../../extensionVariables";
|
||||
import { localize } from "../../../localize";
|
||||
import { DockerHubNamespaceTreeItem } from "../../../tree/registries/dockerHub/DockerHubNamespaceTreeItem";
|
||||
import { DockerHubRepositoryTreeItem } from "../../../tree/registries/dockerHub/DockerHubRepositoryTreeItem";
|
||||
import { registryExpectedContextValues } from "../../../tree/registries/registryContextValues";
|
||||
|
@ -16,7 +17,7 @@ export async function openDockerHubInBrowser(context: IActionContext, node?: Doc
|
|||
if (!node) {
|
||||
node = await ext.registriesTree.showTreeItemPicker<DockerHubNamespaceTreeItem>(registryExpectedContextValues.dockerHub.registry, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No Docker Hub registries available to browse'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.commands.registries.dockerHub.noRegistries', 'No Docker Hub registries available to browse')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { exec } from 'child_process';
|
|||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { NULL_GUID } from '../../constants';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from "../../localize";
|
||||
import { registryExpectedContextValues } from '../../tree/registries/registryContextValues';
|
||||
import { RegistryTreeItemBase } from '../../tree/registries/RegistryTreeItemBase';
|
||||
|
||||
|
@ -28,7 +29,7 @@ export async function logInToDockerCli(context: IActionContext, node?: RegistryT
|
|||
}
|
||||
|
||||
if (!username || !password) {
|
||||
ext.outputChannel.appendLine(`WARNING: Skipping login for "${creds.registryPath}" because it does not require authentication.`)
|
||||
ext.outputChannel.appendLine(localize('vscode-docker.commands.registries.logIn.skipping', 'WARNING: Skipping login for "{0}" because it does not require authentication.', creds.registryPath))
|
||||
} else {
|
||||
await new Promise((resolve, reject) => {
|
||||
const dockerLoginCmd = `docker login ${creds.registryPath} --username ${username} --password-stdin`;
|
||||
|
@ -39,7 +40,7 @@ export async function logInToDockerCli(context: IActionContext, node?: RegistryT
|
|||
if (err && err.message.match(/error storing credentials.*The stub received bad data/)) {
|
||||
// Temporary work-around for this error- same as Azure CLI
|
||||
// See https://github.com/Azure/azure-cli/issues/4843
|
||||
reject(new Error(`In order to log in to the Docker CLI using tokens, you currently need to go to \nOpen your Docker config file and remove "credsStore": "wincred" from the config.json file, then try again. \nDoing this will disable wincred and cause Docker to store credentials directly in the .docker/config.json file. All registries that are currently logged in will be effectly logged out.`));
|
||||
reject(new Error(localize('vscode-docker.commands.registries.logIn.dockerCliTokens', 'In order to log in to the Docker CLI using tokens, you currently need to go to \nOpen your Docker config file and remove "credsStore": "wincred" from the config.json file, then try again. \nDoing this will disable wincred and cause Docker to store credentials directly in the .docker/config.json file. All registries that are currently logged in will be effectly logged out.')));
|
||||
} else if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
|
|
|
@ -5,12 +5,13 @@
|
|||
|
||||
import { IActionContext } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { RegistryConnectErrorTreeItem } from "../../tree/registries/RegistryConnectErrorTreeItem";
|
||||
|
||||
export async function reconnectRegistry(context: IActionContext, node?: RegistryConnectErrorTreeItem): Promise<void> {
|
||||
if (!node?.cachedProvider || !node?.provider) {
|
||||
// This is not expected ever, so we'll throw an error which can be bubbled up to a Report Issue if it does
|
||||
throw new Error('Unable to determine provider to re-enter credentials. Please disconnect and connect again.');
|
||||
throw new Error(localize('vscode-docker.commands.registries.reconnectError', 'Unable to determine provider to re-enter credentials. Please disconnect and connect again.'));
|
||||
}
|
||||
|
||||
await ext.registriesRoot.disconnectRegistry(context, node.cachedProvider);
|
||||
|
|
|
@ -7,6 +7,7 @@ import * as vscode from 'vscode';
|
|||
import { DialogResponses, IActionContext } from 'vscode-azureextensionui';
|
||||
import { configurationKeys } from '../../constants';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from "../../localize";
|
||||
import { registryExpectedContextValues } from '../../tree/registries/registryContextValues';
|
||||
import { RegistryTreeItemBase } from '../../tree/registries/RegistryTreeItemBase';
|
||||
|
||||
|
@ -21,7 +22,7 @@ export async function setRegistryAsDefault(context: IActionContext, node?: Regis
|
|||
const configOptions: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration('docker');
|
||||
await configOptions.update(configurationKeys.defaultRegistryPath, node.baseImagePath, vscode.ConfigurationTarget.Global);
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showInformationMessage(`Updated setting "docker.defaultRegistryPath" to "${node.baseImagePath}".`);
|
||||
vscode.window.showInformationMessage(localize('vscode-docker.commands.registries.settings.updated', 'Updated setting "docker.defaultRegistryPath" to "{0}".', node.baseImagePath));
|
||||
}
|
||||
|
||||
export async function consolidateDefaultRegistrySettings(): Promise<void> {
|
||||
|
@ -35,7 +36,7 @@ export async function consolidateDefaultRegistrySettings(): Promise<void> {
|
|||
await ext.context.workspaceState.update(hasCheckedRegistryPaths, true);
|
||||
await configOptions.update(configurationKeys.defaultRegistryPath, updatedPath, vscode.ConfigurationTarget.Global);
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showInformationMessage(`The 'docker.defaultRegistry' setting is now obsolete, please use the 'docker.${configurationKeys.defaultRegistryPath}' setting by itself. Your settings have been updated to reflect this change.`)
|
||||
vscode.window.showInformationMessage(localize('vscode-docker.commands.registries.settings.defaultRegistryObsolete', 'The \'docker.defaultRegistry\' setting is now obsolete, please use the \'docker.{0}\' setting by itself. Your settings have been updated to reflect this change.', configurationKeys.defaultRegistryPath))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,14 +55,14 @@ export async function askToSaveRegistryPath(imagePath: string, promptForSave?: b
|
|||
prefix = imagePath.substring(0, imagePath.lastIndexOf('/'));
|
||||
}
|
||||
if (prefix && askToSavePath) {
|
||||
let userPrefixPreference: vscode.MessageItem = await ext.ui.showWarningMessage(`Would you like to save '${prefix}' as your default registry path?`, DialogResponses.yes, DialogResponses.no, DialogResponses.skipForNow);
|
||||
let userPrefixPreference: vscode.MessageItem = await ext.ui.showWarningMessage(localize('vscode-docker.commands.registries.settings.confirm', 'Would you like to save \'{0}\' as your default registry path?', prefix), DialogResponses.yes, DialogResponses.no, DialogResponses.skipForNow);
|
||||
if (userPrefixPreference === DialogResponses.yes || userPrefixPreference === DialogResponses.no) {
|
||||
await ext.context.globalState.update(askToSaveKey, false);
|
||||
}
|
||||
if (userPrefixPreference === DialogResponses.yes) {
|
||||
await configOptions.update(configurationKeys.defaultRegistryPath, prefix, vscode.ConfigurationTarget.Workspace);
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showInformationMessage(`Default registry path saved to the 'docker.${configurationKeys.defaultRegistryPath}' setting.`);
|
||||
vscode.window.showInformationMessage(localize('vscode-docker.commands.registries.settings.defaultRegistrySaved', 'Default registry path saved to the \'docker.{0}\' setting.', configurationKeys.defaultRegistryPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
import * as vscode from 'vscode';
|
||||
import { IActionContext, IAzureQuickPickItem } from 'vscode-azureextensionui';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from '../localize';
|
||||
import { resolveVariables } from '../utils/resolveVariables';
|
||||
|
||||
export type TemplateCommand = 'build' | 'run' | 'runInteractive' | 'attach' | 'logs' | 'composeUp' | 'composeDown';
|
||||
|
@ -109,7 +110,7 @@ async function selectCommandTemplate(context: IActionContext, command: TemplateC
|
|||
} catch {
|
||||
// Don't wait
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
ext.ui.showWarningMessage(`Invalid match expression for template '${template.label}'. This template will be skipped.`);
|
||||
ext.ui.showWarningMessage(localize('vscode-docker.commands.selectCommandTemplate.invalidMatch', 'Invalid match expression for template \'{0}\'. This template will be skipped.', template.label));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +151,7 @@ async function quickPickTemplate(context: IActionContext, templates: CommandTemp
|
|||
});
|
||||
|
||||
const selection = await ext.ui.showQuickPick(items, {
|
||||
placeHolder: 'Choose a command template to execute'
|
||||
placeHolder: localize('vscode-docker.commands.selectCommandTemplate.chooseTemplate', 'Choose a command template to execute')
|
||||
});
|
||||
|
||||
return selection.data;
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
import { Volume } from "dockerode";
|
||||
import { IActionContext, openReadOnlyJson } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from "../../localize";
|
||||
import { VolumeTreeItem } from "../../tree/volumes/VolumeTreeItem";
|
||||
import { callDockerodeWithErrorHandling } from "../../utils/callDockerodeWithErrorHandling";
|
||||
|
||||
export async function inspectVolume(context: IActionContext, node?: VolumeTreeItem): Promise<void> {
|
||||
if (!node) {
|
||||
node = await ext.volumesTree.showTreeItemPicker<VolumeTreeItem>(VolumeTreeItem.contextValue, { ...context, noItemFoundErrorMessage: 'No volumes are available to inspect' });
|
||||
node = await ext.volumesTree.showTreeItemPicker<VolumeTreeItem>(VolumeTreeItem.contextValue, { ...context, noItemFoundErrorMessage: localize('vscode-docker.commands.volumes.inspect.noVolumes', 'No volumes are available to inspect') });
|
||||
}
|
||||
|
||||
const volume: Volume = node.getVolume();
|
||||
|
|
|
@ -6,20 +6,21 @@
|
|||
import { window } from 'vscode';
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from "../../localize";
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { convertToMB } from '../../utils/convertToMB';
|
||||
|
||||
export async function pruneVolumes(context: IActionContext): Promise<void> {
|
||||
const confirmPrune: string = "Are you sure you want to remove all unused volumes?";
|
||||
const confirmPrune: string = localize('vscode-docker.commands.volumes.prune.confirm', 'Are you sure you want to remove all unused volumes?');
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: 'Remove' });
|
||||
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.volumes.prune.remove', 'Remove') });
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/promise-function-async */
|
||||
const result = await callDockerodeWithErrorHandling(() => ext.dockerode.pruneVolumes(), context);
|
||||
|
||||
const numDeleted = (result.VolumesDeleted || []).length;
|
||||
const mbReclaimed = convertToMB(result.SpaceReclaimed);
|
||||
let message = `Removed ${numDeleted} volumes(s) and reclaimed ${mbReclaimed}MB of space.`;
|
||||
let message = localize('vscode-docker.commands.volumes.prune.removed', 'Removed {0} volumes(s) and reclaimed {1}MB of space.', numDeleted, mbReclaimed);
|
||||
// don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showInformationMessage(message);
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
import vscode = require('vscode');
|
||||
import { IActionContext } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from "../../localize";
|
||||
import { VolumeTreeItem } from '../../tree/volumes/VolumeTreeItem';
|
||||
import { multiSelectNodes } from '../../utils/multiSelectNodes';
|
||||
|
||||
export async function removeVolume(context: IActionContext, node?: VolumeTreeItem, nodes?: VolumeTreeItem[]): Promise<void> {
|
||||
nodes = await multiSelectNodes(
|
||||
{ ...context, suppressCreatePick: true, noItemFoundErrorMessage: 'No volumes are available to remove' },
|
||||
{ ...context, suppressCreatePick: true, noItemFoundErrorMessage: localize('vscode-docker.commands.volumes.remove.noVolumes', 'No volumes are available to remove') },
|
||||
ext.volumesTree,
|
||||
VolumeTreeItem.contextValue,
|
||||
node,
|
||||
|
@ -20,15 +21,15 @@ export async function removeVolume(context: IActionContext, node?: VolumeTreeIte
|
|||
|
||||
let confirmRemove: string;
|
||||
if (nodes.length === 1) {
|
||||
confirmRemove = `Are you sure you want to remove volume "${nodes[0].label}"?`;
|
||||
confirmRemove = localize('vscode-docker.commands.volumes.remove.confirmSingle', 'Are you sure you want to remove volume "{0}"?', nodes[0].label);
|
||||
} else {
|
||||
confirmRemove = "Are you sure you want to remove selected volumes?";
|
||||
confirmRemove = localize('vscode-docker.commands.volumes.remove.confirmMulti', 'Are you sure you want to remove selected volumes?');
|
||||
}
|
||||
|
||||
// no need to check result - cancel will throw a UserCancelledError
|
||||
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: 'Remove' });
|
||||
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: localize('vscode-docker.commands.volumes.remove.remove', 'Remove') });
|
||||
|
||||
let removing: string = "Removing volume(s)...";
|
||||
let removing: string = localize('vscode-docker.commands.volumes.remove.removing', 'Removing volume(s)...');
|
||||
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: removing }, async () => {
|
||||
await Promise.all(nodes.map(async n => await n.deleteTreeItem(context)));
|
||||
});
|
||||
|
|
|
@ -7,11 +7,12 @@
|
|||
|
||||
import * as vscode from 'vscode';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from '../localize';
|
||||
|
||||
export class LegacyDockerDebugConfigProvider implements vscode.DebugConfigurationProvider {
|
||||
|
||||
public async provideDebugConfigurations(folder: vscode.WorkspaceFolder | undefined, token?: vscode.CancellationToken): Promise<vscode.DebugConfiguration[]> {
|
||||
const remoteRoot = await ext.ui.showInputBox({ value: '/usr/src/app', prompt: 'Please enter your Docker remote root' });
|
||||
const remoteRoot = await ext.ui.showInputBox({ value: '/usr/src/app', prompt: localize('vscode-docker.legacyDebug.remoteRoot', 'Please enter your Docker remote root') });
|
||||
return [{
|
||||
name: 'Docker: Attach to Node',
|
||||
type: 'node',
|
||||
|
|
|
@ -8,6 +8,7 @@ import vscode = require('vscode');
|
|||
import { IAzureQuickPickItem, TelemetryProperties } from 'vscode-azureextensionui';
|
||||
import { DockerOrchestration } from '../constants';
|
||||
import { ext } from "../extensionVariables";
|
||||
import { localize } from '../localize';
|
||||
import { captureCancelStep } from '../utils/captureCancelStep';
|
||||
import { Platform, PlatformOS } from '../utils/platform';
|
||||
|
||||
|
@ -32,12 +33,12 @@ export async function captureConfigureCancelStep<TReturn, TPrompt extends (...ar
|
|||
export async function promptForPorts(ports: number[]): Promise<number[]> {
|
||||
let opt: vscode.InputBoxOptions = {
|
||||
placeHolder: ports.join(', '),
|
||||
prompt: 'What port(s) does your app listen on? Enter a comma-separated list, or empty for no exposed port.',
|
||||
prompt: localize('vscode-docker.configUtils.whatPort', 'What port(s) does your app listen on? Enter a comma-separated list, or empty for no exposed port.'),
|
||||
value: ports.join(', '),
|
||||
validateInput: (value: string): string | undefined => {
|
||||
let result = splitPorts(value);
|
||||
if (!result) {
|
||||
return 'Ports must be a comma-separated list of positive integers (1 to 65535), or empty for no exposed port.';
|
||||
return localize('vscode-docker.configUtils.portsFormat', 'Ports must be a comma-separated list of positive integers (1 to 65535), or empty for no exposed port.');
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
@ -80,7 +81,7 @@ export async function quickPickPlatform(platforms?: Platform[]): Promise<Platfor
|
|||
let opt: vscode.QuickPickOptions = {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: 'Select Application Platform'
|
||||
placeHolder: localize('vscode-docker.configUtils.selectPlatform', 'Select Application Platform')
|
||||
}
|
||||
|
||||
platforms = platforms || [
|
||||
|
@ -110,7 +111,7 @@ export async function quickPickOS(): Promise<PlatformOS> {
|
|||
let opt: vscode.QuickPickOptions = {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: 'Select Operating System'
|
||||
placeHolder: localize('vscode-docker.configUtils.selectOS', 'Select Operating System')
|
||||
}
|
||||
|
||||
const OSes: PlatformOS[] = ['Windows', 'Linux'];
|
||||
|
@ -122,7 +123,7 @@ export async function quickPickOS(): Promise<PlatformOS> {
|
|||
|
||||
export async function quickPickGenerateComposeFiles(): Promise<boolean> {
|
||||
let opt: vscode.QuickPickOptions = {
|
||||
placeHolder: 'Include optional Docker Compose files?'
|
||||
placeHolder: localize('vscode-docker.configUtils.includeCompose', 'Include optional Docker Compose files?')
|
||||
}
|
||||
|
||||
let response = await ext.ui.showQuickPick(
|
||||
|
|
|
@ -8,8 +8,9 @@ import * as fse from 'fs-extra';
|
|||
import * as gradleParser from "gradle-to-js/lib/parser";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { IActionContext, TelemetryProperties } from 'vscode-azureextensionui';
|
||||
import { IActionContext, parseError, TelemetryProperties } from 'vscode-azureextensionui';
|
||||
import * as xml2js from 'xml2js';
|
||||
import { localize } from '../localize';
|
||||
import { Platform, PlatformOS } from '../utils/platform';
|
||||
import { configureCpp } from './configureCpp';
|
||||
import { scaffoldNetCore } from './configureDotNetCore';
|
||||
|
@ -220,7 +221,7 @@ async function readPomOrGradle(folderPath: string): Promise<{ foundPath?: string
|
|||
// tslint:disable-next-line:no-unsafe-any
|
||||
xml2js.parseString(pomString, options, (error, result: PomXmlContents): void => {
|
||||
if (error) {
|
||||
reject(`Failed to parse pom.xml: ${error}`);
|
||||
reject(localize('vscode-docker.configure.pomError', 'Failed to parse pom.xml: {0}', parseError(error).message));
|
||||
return;
|
||||
}
|
||||
resolve(result);
|
||||
|
|
|
@ -13,6 +13,7 @@ import { IActionContext } from 'vscode-azureextensionui';
|
|||
import { DockerDebugScaffoldContext } from '../debugging/DebugHelper';
|
||||
import { dockerDebugScaffoldingProvider, NetCoreScaffoldingOptions } from '../debugging/DockerDebugScaffoldingProvider';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from '../localize';
|
||||
import { extractRegExGroups } from '../utils/extractRegExGroups';
|
||||
import { globAsync } from '../utils/globAsync';
|
||||
import { isWindows, isWindows1019H1OrNewer, isWindows10RS3OrNewer, isWindows10RS4OrNewer, isWindows10RS5OrNewer } from '../utils/osUtils';
|
||||
|
@ -179,7 +180,7 @@ function genDockerFile(serviceNameAndRelativePath: string, platform: Platform, o
|
|||
// VS version of this function is in ResolveImageNames (src/Docker/Microsoft.VisualStudio.Docker.DotNetCore/DockerDotNetCoreScaffoldingProvider.cs)
|
||||
|
||||
if (os !== 'Windows' && os !== 'Linux') {
|
||||
throw new Error(`Unexpected OS "${os}"`);
|
||||
throw new Error(localize('vscode-docker.configureDotNetCore.unexpectedOs', 'Unexpected OS "{0}"', os));
|
||||
}
|
||||
|
||||
let serviceName = path.basename(serviceNameAndRelativePath);
|
||||
|
@ -251,7 +252,7 @@ function genDockerFile(serviceNameAndRelativePath: string, platform: Platform, o
|
|||
template = os === "Linux" ? aspNetCoreLinuxTemplate : aspNetCoreWindowsTemplate;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unexpected platform "${platform}"`);
|
||||
throw new Error(localize('vscode-docker.configureDotNetCore.unexpectedPlatform', 'Unexpected platform "{0}"', platform));
|
||||
}
|
||||
|
||||
let contents = template.replace('$base_image_name$', baseImageName)
|
||||
|
@ -349,7 +350,7 @@ async function findCSProjOrFSProjFile(folderPath?: string): Promise<string> {
|
|||
const projectFiles: string[] = await globAsync('**/*.@(c|f)sproj', { cwd: folderPath });
|
||||
|
||||
if (!projectFiles || !projectFiles.length) {
|
||||
throw new Error("No .csproj or .fsproj file could be found. You need a C# or F# project file in the workspace to generate Docker files for the selected platform.");
|
||||
throw new Error(localize('vscode-docker.configureDotNetCore.noCsproj', 'No .csproj or .fsproj file could be found. You need a C# or F# project file in the workspace to generate Docker files for the selected platform.'));
|
||||
}
|
||||
|
||||
if (projectFiles.length > 1) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import { TelemetryProperties } from 'vscode-azureextensionui';
|
|||
import { DockerDebugScaffoldContext } from '../debugging/DebugHelper';
|
||||
import { dockerDebugScaffoldingProvider, PythonScaffoldingOptions } from '../debugging/DockerDebugScaffoldingProvider';
|
||||
import { ext } from "../extensionVariables";
|
||||
import { localize } from '../localize';
|
||||
import { getPythonProjectType, PythonDefaultPorts, PythonFileExtension, PythonFileTarget, PythonModuleTarget, PythonProjectType, PythonTarget } from "../utils/pythonUtils";
|
||||
import { getComposePorts, getExposeStatements } from './configure';
|
||||
import { ConfigureTelemetryProperties, genCommonDockerIgnoreFile, quickPickGenerateComposeFiles } from './configUtils';
|
||||
|
@ -21,9 +22,9 @@ interface LaunchFilePrompt {
|
|||
}
|
||||
|
||||
const defaultLaunchFile: Map<PythonProjectType, LaunchFilePrompt> = new Map<PythonProjectType, LaunchFilePrompt>([
|
||||
['django', { prompt: 'Enter the relative path to the app’s entry point (e.g. manage.py or subfolder_name/manage.py)', defaultFile: 'manage.py' }],
|
||||
['flask', { prompt: 'Enter the relative path to the app’s entry point (e.g. app.py or subfolder_name/app.py)', defaultFile: 'app.py' }],
|
||||
['general', { prompt: 'Enter the relative path to the app’s entry point (e.g. app.py or subfolder_name/app.py)', defaultFile: 'app.py' }],
|
||||
['django', { prompt: localize('vscode-docker.configurePython.djangoPrompt', 'Enter the relative path to the app’s entry point (e.g. manage.py or subfolder_name/manage.py)'), defaultFile: 'manage.py' }],
|
||||
['flask', { prompt: localize('vscode-docker.configurePython.flaskPrompt', 'Enter the relative path to the app’s entry point (e.g. app.py or subfolder_name/app.py)'), defaultFile: 'app.py' }],
|
||||
['general', { prompt: localize('vscode-docker.configurePython.generalPrompt', 'Enter the relative path to the app’s entry point (e.g. app.py or subfolder_name/app.py)'), defaultFile: 'app.py' }],
|
||||
]);
|
||||
|
||||
const pythonDockerfile = `# For more information, please refer to https://aka.ms/vscode-docker-python
|
||||
|
@ -80,7 +81,7 @@ async function genDockerFile(serviceName: string, target: PythonTarget, projectT
|
|||
command = `CMD ["gunicorn", "--bind", "0.0.0.0:${ports ? ports[0] : PythonDefaultPorts[projectType]}", "${inferPythonWsgiModule(target)}:app"]`;
|
||||
} else {
|
||||
// Unlikely
|
||||
throw new Error(`Unknown project type: ${projectType}`);
|
||||
throw new Error(localize('vscode-docker.configurePython.unknownProjectType', 'Unknown project type: {0}', projectType));
|
||||
}
|
||||
|
||||
return pythonDockerfile
|
||||
|
@ -110,8 +111,7 @@ function genRequirementsFile(projectType: PythonProjectType): string {
|
|||
return contents;
|
||||
}
|
||||
|
||||
async function initializeForDebugging(context: ScaffolderContext, dockerfile: string, ports: number[],
|
||||
target: PythonTarget, projectType: PythonProjectType): Promise<void> {
|
||||
async function initializeForDebugging(context: ScaffolderContext, dockerfile: string, ports: number[], target: PythonTarget, projectType: PythonProjectType): Promise<void> {
|
||||
const scaffoldContext: DockerDebugScaffoldContext = {
|
||||
folder: context.folder,
|
||||
platform: 'python',
|
||||
|
@ -142,7 +142,7 @@ function inferPythonWsgiModule(target: PythonTarget): string {
|
|||
return wsgiModule.replace(/\//g, '.');
|
||||
}
|
||||
|
||||
async function inferDjangoCommand(ports: number[], serviceName: string, outputFolder: string) : Promise<string> {
|
||||
async function inferDjangoCommand(ports: number[], serviceName: string, outputFolder: string): Promise<string> {
|
||||
// For Django apps, there **usually** exists a "wsgi" module in a sub-folder named the same as the project folder.
|
||||
// So we check if that path exists, then use it. Else, we output the comment below instructing the user to enter
|
||||
// the correct python path to the wsgi module.
|
||||
|
@ -158,14 +158,14 @@ async function inferDjangoCommand(ports: number[], serviceName: string, outputFo
|
|||
}
|
||||
}
|
||||
|
||||
export async function promptForLaunchFile(projectType?: PythonProjectType) : Promise<PythonTarget> {
|
||||
export async function promptForLaunchFile(projectType?: PythonProjectType): Promise<PythonTarget> {
|
||||
const launchFilePrompt = defaultLaunchFile.get(projectType);
|
||||
|
||||
const opt: vscode.InputBoxOptions = {
|
||||
placeHolder: launchFilePrompt.defaultFile,
|
||||
prompt: launchFilePrompt.prompt,
|
||||
value: launchFilePrompt.defaultFile,
|
||||
validateInput: (value: string): string | undefined => { return value && value.trim().length > 0 ? undefined : 'Enter a valid Python file path/module.' }
|
||||
validateInput: (value: string): string | undefined => { return value && value.trim().length > 0 ? undefined : localize('vscode-docker.configurePython.enterValidPythonFile', 'Enter a valid Python file path/module.') }
|
||||
};
|
||||
|
||||
// Ensure to change any \ to /.
|
||||
|
@ -176,7 +176,7 @@ export async function promptForLaunchFile(projectType?: PythonProjectType) : Pro
|
|||
file.indexOf('/') > 0) {
|
||||
return { file: file };
|
||||
} else {
|
||||
return { module: file};
|
||||
return { module: file };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ export async function scaffoldPython(context: ScaffolderContext): Promise<Scaffo
|
|||
let ports = [];
|
||||
|
||||
if (defaultPort) {
|
||||
ports = await context.promptForPorts([ defaultPort ]);
|
||||
ports = await context.promptForPorts([defaultPort]);
|
||||
}
|
||||
|
||||
const dockerFileContents = await genDockerFile(serviceName, launchFile, projectType, ports, outputFolder);
|
||||
|
@ -220,8 +220,8 @@ export async function scaffoldPython(context: ScaffolderContext): Promise<Scaffo
|
|||
}
|
||||
|
||||
files.forEach(file => {
|
||||
// Remove multiple empty lines with single empty lines, as might be produced
|
||||
// if $expose_statements$ or another template variable is an empty string.
|
||||
// Remove multiple empty lines with single empty lines, as might be produced
|
||||
// if $expose_statements$ or another template variable is an empty string.
|
||||
file.contents = file.contents
|
||||
.replace(/(\r\n){3,4}/g, '\r\n\r\n')
|
||||
.replace(/(\n){3,4}/g, '\n\n');
|
||||
|
|
|
@ -8,6 +8,7 @@ import * as path from 'path';
|
|||
import * as vscode from 'vscode';
|
||||
import { IActionContext, IAzureQuickPickItem, } from "vscode-azureextensionui";
|
||||
import { ext } from "../extensionVariables";
|
||||
import { localize } from '../localize';
|
||||
import { captureCancelStep } from '../utils/captureCancelStep';
|
||||
import { Platform, PlatformOS } from "../utils/platform";
|
||||
import { quickPickWorkspaceFolder } from '../utils/quickPickWorkspaceFolder';
|
||||
|
@ -55,7 +56,7 @@ export type ScaffoldFile = {
|
|||
export type Scaffolder = (context: ScaffolderContext) => Promise<ScaffoldFile[]>;
|
||||
|
||||
async function promptForFolder(): Promise<vscode.WorkspaceFolder> {
|
||||
return await quickPickWorkspaceFolder('To generate Docker files you must first open a folder or workspace in VS Code.');
|
||||
return await quickPickWorkspaceFolder(localize('vscode-docker.scaffolding.workspaceFolder', 'To generate Docker files you must first open a folder or workspace in VS Code.'));
|
||||
}
|
||||
|
||||
async function promptForOS(): Promise<PlatformOS> {
|
||||
|
@ -75,7 +76,7 @@ async function promptForOverwrite(fileName: string): Promise<boolean> {
|
|||
}
|
||||
];
|
||||
|
||||
const response = await vscode.window.showErrorMessage(`"${fileName}" already exists. Would you like to overwrite it?`, ...YES_OR_NO_PROMPTS);
|
||||
const response = await vscode.window.showErrorMessage(localize('vscode-docker.scaffolding.fileExists', '"{0}" already exists. Would you like to overwrite it?', fileName), ...YES_OR_NO_PROMPTS);
|
||||
|
||||
return response === YES_PROMPT;
|
||||
}
|
||||
|
@ -90,7 +91,7 @@ async function promptForPlatform(): Promise<Platform> {
|
|||
let opt: vscode.QuickPickOptions = {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: 'Select Application Platform'
|
||||
placeHolder: localize('vscode-docker.scaffolding.selectPlatform', 'Select Application Platform')
|
||||
}
|
||||
|
||||
const items = Array.from(scaffolders.keys()).map(p => <IAzureQuickPickItem<Platform>>{ label: p, data: p });
|
||||
|
@ -127,7 +128,7 @@ export async function scaffold(context: ScaffoldContext): Promise<ScaffoldedFile
|
|||
const scaffolder = scaffolders.get(platform);
|
||||
|
||||
if (!scaffolder) {
|
||||
throw new Error(`No scaffolder is registered for platform '${context.platform}'.`);
|
||||
throw new Error(localize('vscode-docker.scaffolding.noScaffolder', 'No scaffolder is registered for platform \'{0}\'.', context.platform));
|
||||
}
|
||||
|
||||
telemetryProperties.orchestration = 'single';
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { CancellationToken, debug, DebugConfiguration, ExtensionContext, workspace, WorkspaceFolder } from 'vscode';
|
||||
import { IActionContext, registerCommand } from 'vscode-azureextensionui';
|
||||
import { initializeForDebugging } from '../commands/debugging/initializeForDebugging';
|
||||
import { localize } from '../localize';
|
||||
import { DockerRunTaskDefinition } from '../tasks/DockerRunTaskProvider';
|
||||
import { DockerTaskScaffoldContext, getDefaultContainerName } from '../tasks/TaskHelper';
|
||||
import ChildProcessProvider from './coreclr/ChildProcessProvider';
|
||||
|
@ -100,7 +101,7 @@ export function resolveDockerServerReadyAction(debugConfiguration: DockerDebugCo
|
|||
|
||||
if (numBrowserOptions > 1) {
|
||||
// Multiple user-provided options is not valid
|
||||
throw new Error(`Only at most one of the 'launchBrowser', 'serverReadyAction', and 'dockerServerReadyAction' properties may be set at a time.`);
|
||||
throw new Error(localize('vscode-docker.debug.helper.oneBrowserAction', 'Only at most one of the \'launchBrowser\', \'serverReadyAction\', and \'dockerServerReadyAction\' properties may be set at a time.'));
|
||||
} else if (numBrowserOptions === 1 && !debugConfiguration.dockerServerReadyAction) {
|
||||
// One user-provided option that is not DockerServerReadyAction--return nothing
|
||||
return undefined;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { CancellationToken, commands, debug, DebugConfiguration, DebugConfigurationProvider, MessageItem, ProviderResult, window, workspace, WorkspaceFolder } from 'vscode';
|
||||
import { callWithTelemetryAndErrorHandling, IActionContext } from 'vscode-azureextensionui';
|
||||
import { DockerOrchestration } from '../constants';
|
||||
import { localize } from '../localize';
|
||||
import { getAssociatedDockerRunTask } from '../tasks/TaskHelper';
|
||||
import { DockerClient } from './coreclr/CliDockerClient';
|
||||
import { DebugHelper, DockerDebugContext, ResolvedDebugConfiguration } from './DebugHelper';
|
||||
|
@ -29,18 +30,19 @@ export class DockerDebugConfigurationProvider implements DebugConfigurationProvi
|
|||
) { }
|
||||
|
||||
public provideDebugConfigurations(folder: WorkspaceFolder | undefined, token?: CancellationToken): ProviderResult<DebugConfiguration[]> {
|
||||
const add: MessageItem = { title: 'Add Docker Files' };
|
||||
const add: MessageItem = { title: localize('vscode-docker.debug.configProvider.addDockerFiles', 'Add Docker Files') };
|
||||
|
||||
// Prompt them to add Docker files since they probably haven't
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showErrorMessage(
|
||||
'To debug in a Docker container on supported platforms, use the command \"Docker: Add Docker Files to Workspace\", or click \"Add Docker Files\".',
|
||||
...[add]).then((result) => {
|
||||
if (result === add) {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
commands.executeCommand('vscode-docker.configure');
|
||||
}
|
||||
});
|
||||
localize('vscode-docker.debug.configProvider.toDebugAddDockerFiles', 'To debug in a Docker container on supported platforms, use the command "Docker: Add Docker Files to Workspace", or click "Add Docker Files".'),
|
||||
...[add])
|
||||
.then((result) => {
|
||||
if (result === add) {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
commands.executeCommand('vscode-docker.configure');
|
||||
}
|
||||
});
|
||||
|
||||
return [];
|
||||
}
|
||||
|
@ -53,7 +55,7 @@ export class DockerDebugConfigurationProvider implements DebugConfigurationProvi
|
|||
folder = workspace.workspaceFolders[0];
|
||||
|
||||
if (!folder) {
|
||||
throw new Error('To debug with Docker you must first open a folder or workspace in VS Code.');
|
||||
throw new Error(localize('vscode-docker.debug.configProvider.workspaceFolder', 'To debug with Docker you must first open a folder or workspace in VS Code.'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +66,7 @@ export class DockerDebugConfigurationProvider implements DebugConfigurationProvi
|
|||
}
|
||||
|
||||
if (!debugConfiguration.request) {
|
||||
throw new Error('The property "request" must be specified in the debug config.')
|
||||
throw new Error(localize('vscode-docker.debug.configProvider.requestRequired', 'The property "request" must be specified in the debug config.'));
|
||||
}
|
||||
|
||||
const debugPlatform = getPlatform(debugConfiguration);
|
||||
|
@ -100,9 +102,9 @@ export class DockerDebugConfigurationProvider implements DebugConfigurationProvi
|
|||
|
||||
private async validateResolvedConfiguration(resolvedConfiguration: ResolvedDebugConfiguration): Promise<void> {
|
||||
if (!resolvedConfiguration.type) {
|
||||
throw new Error('No debug type was resolved.');
|
||||
throw new Error(localize('vscode-docker.debug.configProvider.noDebugType', 'No debug type was resolved.'));
|
||||
} else if (!resolvedConfiguration.request) {
|
||||
throw new Error('No debug request was resolved.');
|
||||
throw new Error(localize('vscode-docker.debug.configProvider.noDebugRequest', 'No debug request was resolved.'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +146,7 @@ export class DockerDebugConfigurationProvider implements DebugConfigurationProvi
|
|||
const helper = this.helpers[platform];
|
||||
|
||||
if (!helper) {
|
||||
throw new Error(`The platform '${platform}' is not currently supported for Docker debugging.`);
|
||||
throw new Error(localize('vscode-docker.debug.configProvider.unsupportedPlatform', 'The platform \'{0}\' is not currently supported for Docker debugging.', platform));
|
||||
}
|
||||
|
||||
return helper;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { MessageItem, window } from 'vscode';
|
||||
import { DialogResponses } from 'vscode-azureextensionui';
|
||||
import { localize } from '../localize';
|
||||
import { DockerBuildTaskDefinition } from '../tasks/DockerBuildTaskProvider';
|
||||
import { DockerRunTaskDefinition } from '../tasks/DockerRunTaskProvider';
|
||||
import { netCoreTaskHelper, NetCoreTaskScaffoldingOptions } from '../tasks/netcore/NetCoreTaskHelper';
|
||||
|
@ -55,7 +56,7 @@ export class DockerDebugScaffoldingProvider implements IDockerDebugScaffoldingPr
|
|||
() => pythonDebugHelper.provideDebugConfigurations(context, options),
|
||||
() => pythonTaskHelper.provideDockerBuildTasks(context),
|
||||
() => pythonTaskHelper.provideDockerRunTasks(context, options)
|
||||
/* eslint-enable @typescript-eslint/promise-function-async */
|
||||
/* eslint-enable @typescript-eslint/promise-function-async */
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -94,7 +95,7 @@ export class DockerDebugScaffoldingProvider implements IDockerDebugScaffoldingPr
|
|||
title: 'Overwrite'
|
||||
};
|
||||
|
||||
overwrite = (overwriteMessageItem === await window.showErrorMessage("Docker launch configurations and/or tasks already exist. Do you want to overwrite them?", ...[overwriteMessageItem, DialogResponses.no]));
|
||||
overwrite = (overwriteMessageItem === await window.showErrorMessage(localize('vscode-docker.debug.scaffoldProvider.confirm', 'Docker launch configurations and/or tasks already exist. Do you want to overwrite them?'), ...[overwriteMessageItem, DialogResponses.no]));
|
||||
|
||||
if (overwrite) {
|
||||
// Try again if needed
|
||||
|
|
|
@ -10,16 +10,11 @@
|
|||
import * as util from 'util';
|
||||
import * as vscode from 'vscode';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from '../localize';
|
||||
import ChildProcessProvider from './coreclr/ChildProcessProvider';
|
||||
import CliDockerClient from './coreclr/CliDockerClient';
|
||||
import { ResolvedDebugConfiguration } from './DebugHelper';
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||
const localize = (message: string, formatString: string, ...param: any[]): string => {
|
||||
// NOTE: This is a mock of the VS Code localize() method so its implementation may be subtly different.
|
||||
return util.format(formatString.replace(/\{[0-9]+\}/g, '%s'), ...param);
|
||||
}
|
||||
|
||||
const PATTERN = 'listening on.* (https?://\\S+|[0-9]+)'; // matches "listening on port 3000" or "Now listening on: https://localhost:5001"
|
||||
const URI_FORMAT = 'http://localhost:%s';
|
||||
/* eslint-disable-next-line no-template-curly-in-string */
|
||||
|
@ -57,14 +52,14 @@ export class ServerReadyDetector implements DockerServerReadyDetector {
|
|||
const format = args.uriFormat || URI_FORMAT;
|
||||
|
||||
if (!args || !args.containerName) {
|
||||
throw new Error('No container name was resolved or provided to DockerServerReadyAction.');
|
||||
throw new Error(localize('vscode-docker.debug.serverReady.noContainer', 'No container name was resolved or provided to DockerServerReadyAction.'));
|
||||
}
|
||||
|
||||
if (captureString === '') {
|
||||
// nothing captured by reg exp -> use the uriFormat as the target url without substitution
|
||||
// verify that format does not contain '%s'
|
||||
if (format.indexOf('%s') >= 0) {
|
||||
const errMsg = localize('server.ready.nocapture.error', "Format uri ('{0}') uses a substitution placeholder but pattern did not capture anything.", format);
|
||||
const errMsg = localize('vscode-docker.debug.serverReady.noCapture', 'Format uri (\'{0}\') uses a substitution placeholder but pattern did not capture anything.', format);
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showErrorMessage(errMsg, { modal: true }).then(_ => undefined);
|
||||
return;
|
||||
|
@ -75,7 +70,7 @@ export class ServerReadyDetector implements DockerServerReadyDetector {
|
|||
// verify that format only contains a single '%s'
|
||||
const s = format.split('%s');
|
||||
if (s.length !== 2) {
|
||||
const errMsg = localize('server.ready.placeholder.error', "Format uri ('{0}') must contain exactly one substitution placeholder.", format);
|
||||
const errMsg = localize('vscode-docker.debug.serverReady.oneSubstitution', 'Format uri (\'{0}\') must contain exactly one substitution placeholder.', format);
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showErrorMessage(errMsg, { modal: true }).then(_ => undefined);
|
||||
return;
|
||||
|
@ -86,7 +81,7 @@ export class ServerReadyDetector implements DockerServerReadyDetector {
|
|||
const hostPort = await dockerClient.getHostPort(args.containerName, containerPort);
|
||||
|
||||
if (!hostPort) {
|
||||
throw new Error(`Could not determine host port mapped to container port ${containerPort} in container \'${args.containerName}\'.`);
|
||||
throw new Error(localize('vscode-docker.debug.serverReady.noHostPortA', 'Could not determine host port mapped to container port {0} in container \'{1}\'.', containerPort, args.containerName));
|
||||
}
|
||||
|
||||
captureString = util.format(format, hostPort);
|
||||
|
@ -94,7 +89,7 @@ export class ServerReadyDetector implements DockerServerReadyDetector {
|
|||
const containerPort = this.getContainerPort(captureString);
|
||||
|
||||
if (containerPort === undefined) {
|
||||
const errMsg = localize('server.ready.port.error', "Captured string ('{0}') must contain a port number.", captureString);
|
||||
const errMsg = localize('vscode-docker.debug.serverReady.noCapturedPort', 'Captured string (\'{0}\') must contain a port number.', captureString);
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showErrorMessage(errMsg, { modal: true }).then(_ => undefined);
|
||||
return;
|
||||
|
@ -105,7 +100,7 @@ export class ServerReadyDetector implements DockerServerReadyDetector {
|
|||
const hostPort = await dockerClient.getHostPort(args.containerName, containerPort);
|
||||
|
||||
if (!hostPort) {
|
||||
throw new Error(`Could not determine host port mapped to container port ${containerPort} in container \'${args.containerName}\'.`);
|
||||
throw new Error(localize('vscode-docker.debug.serverReady.noHostPortB', 'Could not determine host port mapped to container port {0} in container \'{1}\'.', containerPort, args.containerName));
|
||||
}
|
||||
|
||||
const s = format.split('%s');
|
||||
|
@ -117,7 +112,7 @@ export class ServerReadyDetector implements DockerServerReadyDetector {
|
|||
// There are exactly two substitutions (which is expected)...
|
||||
captureString = util.format(format, containerProtocol, hostPort);
|
||||
} else {
|
||||
const errMsg = localize('server.ready.placeholder.error', "Format uri ('{0}') must contain exactly two substitution placeholders.", format);
|
||||
const errMsg = localize('vscode-docker.debug.serverReady.twoSubstitutions', 'Format uri (\'{0}\') must contain exactly two substitution placeholders.', format);
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showErrorMessage(errMsg, { modal: true }).then(_ => undefined);
|
||||
return;
|
||||
|
@ -167,7 +162,7 @@ export class ServerReadyDetector implements DockerServerReadyDetector {
|
|||
webRoot: args.webRoot || WEB_ROOT
|
||||
});
|
||||
} else {
|
||||
const errMsg = localize('server.ready.chrome.not.installed', "The action '{0}' requires the '{1}' extension.", 'debugWithChrome', 'Debugger for Chrome');
|
||||
const errMsg = localize('vscode-docker.debug.serverReady.noChrome', 'The action \'debugWithChrome\' requires the \'Debugger for Chrome\' extension.');
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
vscode.window.showErrorMessage(errMsg, { modal: true }).then(_ => undefined);
|
||||
}
|
||||
|
@ -240,7 +235,7 @@ class DockerDebugAdapterTracker extends vscode.Disposable implements vscode.Debu
|
|||
});
|
||||
}
|
||||
|
||||
public onDidSendMessage (m: DebugAdapterMessage) : void {
|
||||
public onDidSendMessage(m: DebugAdapterMessage): void {
|
||||
if (m.type === 'event'
|
||||
&& m.event === 'output'
|
||||
&& m.body?.category
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*--------------------------------------------------------*/
|
||||
|
||||
import { localize } from "../../localize";
|
||||
import { CommandLineBuilder } from "../../utils/commandLineBuilder";
|
||||
import { spawnAsync } from "../../utils/spawnAsync";
|
||||
import { ProcessProvider } from "./ChildProcessProvider";
|
||||
|
@ -66,7 +67,7 @@ export type DockerVersionOptions = {
|
|||
export type DockerExecOptions = {
|
||||
interactive?: boolean;
|
||||
tty?: boolean;
|
||||
progress?(content: string) : void;
|
||||
progress?(content: string): void;
|
||||
}
|
||||
|
||||
export interface IHostPort {
|
||||
|
@ -140,7 +141,7 @@ export class CliDockerClient implements DockerClient {
|
|||
lineSplitter.close();
|
||||
|
||||
if (!imageId) {
|
||||
throw new Error('The Docker image was built successfully but the image ID could not be retrieved.');
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.noImageId', 'The Docker image was built successfully but the image ID could not be retrieved.'));
|
||||
}
|
||||
|
||||
return imageId;
|
||||
|
@ -195,7 +196,7 @@ export class CliDockerClient implements DockerClient {
|
|||
const validateArgument =
|
||||
id => {
|
||||
if (id === undefined || id1.length < 12) {
|
||||
throw new Error(`'${id}' must be defined and at least 12 characters.`)
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.idNotMatched', '\'{0}\' must be defined and at least 12 characters.', id as string))
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -245,7 +246,7 @@ export class CliDockerClient implements DockerClient {
|
|||
const containerId = result.stdout.trim();
|
||||
|
||||
if (!containerId) {
|
||||
throw new Error('The Docker container was run successfully but the container ID could not be retrieved.')
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.noContainerId', 'The Docker container was run successfully but the container ID could not be retrieved.'))
|
||||
}
|
||||
|
||||
return containerId;
|
||||
|
@ -253,13 +254,13 @@ export class CliDockerClient implements DockerClient {
|
|||
|
||||
public trimId(id: string): string {
|
||||
if (!id) {
|
||||
throw new Error('The ID to be trimmed must be non-empty.');
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.idEmpty', 'The ID to be trimmed must be non-empty.'));
|
||||
}
|
||||
|
||||
const trimmedId = id.trim();
|
||||
|
||||
if (trimmedId.length < 12) {
|
||||
throw new Error('The ID to be trimmed must be at least 12 characters.');
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.idShort', 'The ID to be trimmed must be at least 12 characters.'));
|
||||
}
|
||||
|
||||
return id.substring(0, 12);
|
||||
|
@ -276,7 +277,7 @@ export class CliDockerClient implements DockerClient {
|
|||
.withArg(args)
|
||||
.build();
|
||||
|
||||
const result = await this.processProvider.exec(command, {progress: options.progress});
|
||||
const result = await this.processProvider.exec(command, { progress: options.progress });
|
||||
|
||||
return result.stdout;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import * as path from 'path';
|
|||
import * as process from 'process';
|
||||
import { MessageItem } from 'vscode';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { PlatformOS } from '../../utils/platform';
|
||||
import { quickPickProjectFileItem } from '../../utils/quickPickFile';
|
||||
import { quickPickWorkspaceFolder } from '../../utils/quickPickWorkspaceFolder';
|
||||
|
@ -50,8 +51,8 @@ export class LocalAspNetCoreSslManager implements AspNetCoreSslManager {
|
|||
}
|
||||
|
||||
if (this.osProvider.os === 'Windows') {
|
||||
const trust: MessageItem = { title: 'Trust' };
|
||||
const message = 'The ASP.NET Core HTTPS development certificate is not trusted. To trust the certificate, run \`dotnet dev-certs https --trust\`, or click "Trust" below.';
|
||||
const trust: MessageItem = { title: localize('vscode-docker.debug.coreclr.sslManager.trust', 'Trust') };
|
||||
const message = localize('vscode-docker.debug.coreclr.sslManager.notTrusted', 'The ASP.NET Core HTTPS development certificate is not trusted. To trust the certificate, run \`dotnet dev-certs https --trust\`, or click "Trust" below.');
|
||||
|
||||
// Don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
|
@ -65,7 +66,7 @@ export class LocalAspNetCoreSslManager implements AspNetCoreSslManager {
|
|||
LocalAspNetCoreSslManager._KnownConfiguredProjects.clear(); // Clear the cache so future F5's will not use an untrusted cert
|
||||
}});
|
||||
} else if (this.osProvider.isMac) {
|
||||
const message = 'The ASP.NET Core HTTPS development certificate is not trusted. To trust the certificate, run \`dotnet dev-certs https --trust\`.';
|
||||
const message = localize('vscode-docker.debug.coreclr.sslManager.notTrustedRunManual', 'The ASP.NET Core HTTPS development certificate is not trusted. To trust the certificate, run \`dotnet dev-certs https --trust\`.');
|
||||
|
||||
// Don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
|
@ -97,7 +98,7 @@ export class LocalAspNetCoreSslManager implements AspNetCoreSslManager {
|
|||
appDataEnvironmentVariable = process.env.AppData;
|
||||
|
||||
if (appDataEnvironmentVariable === undefined) {
|
||||
throw new Error(`The environment variable \'AppData\' is not defined. This variable is used to locate the HTTPS certificate and user secrets folders.`);
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.sslManager.appDataUndefined', 'The environment variable \'AppData\' is not defined. This variable is used to locate the HTTPS certificate and user secrets folders.'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,8 +124,8 @@ export class LocalAspNetCoreSslManager implements AspNetCoreSslManager {
|
|||
}
|
||||
|
||||
private async pickProjectFile(): Promise<string> {
|
||||
const workspaceFolder = await quickPickWorkspaceFolder("To configure SSL for an ASP.NET Core project you must first open a folder or workspace in VSCode.");
|
||||
const projectItem = await quickPickProjectFileItem(undefined, workspaceFolder, "No .NET Core project file (.csproj or .fsproj) could be found.");
|
||||
const workspaceFolder = await quickPickWorkspaceFolder(localize('vscode-docker.debug.coreclr.sslManager.workspaceFolder', 'To configure SSL for an ASP.NET Core project you must first open a folder or workspace in VSCode.'));
|
||||
const projectItem = await quickPickProjectFileItem(undefined, workspaceFolder, localize('vscode-docker.debug.coreclr.sslManager.noCsproj', 'No .NET Core project file (.csproj or .fsproj) could be found.'));
|
||||
|
||||
return projectItem.absoluteFilePath;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*--------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { localize } from '../../localize';
|
||||
import { DockerManager } from './dockerManager';
|
||||
|
||||
export interface DebugSessionManager {
|
||||
|
@ -28,7 +29,8 @@ export class DockerDebugSessionManager implements DebugSessionManager, vscode.Di
|
|||
() => {
|
||||
this.dockerManager
|
||||
.cleanupAfterLaunch()
|
||||
.catch(reason => console.log(`Unable to clean up Docker images after launch: ${reason}`));
|
||||
// eslint-disable-next-line @typescript-eslint/tslint/config
|
||||
.catch(reason => console.log(localize('vscode-docker.debug.coreclr.cleanupFailed', 'Unable to clean up Docker images after launch: {0}', reason?.toString())));
|
||||
|
||||
this.stopListening();
|
||||
});
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
import deepEqual = require('deep-equal');
|
||||
import * as path from 'path';
|
||||
import { Memento } from 'vscode';
|
||||
import { parseError } from 'vscode-azureextensionui';
|
||||
import { localize } from '../../localize';
|
||||
import { Lazy } from '../../utils/lazy';
|
||||
import { PlatformOS } from '../../utils/platform';
|
||||
import { AppStorageProvider } from './appStorage';
|
||||
|
@ -162,10 +164,10 @@ export class DefaultDockerManager implements DockerManager {
|
|||
}
|
||||
|
||||
const imageId = await this.dockerOutputManager.performOperation(
|
||||
'Building Docker image...',
|
||||
localize('vscode-docker.debug.coreclr.buildingImage', 'Building Docker image...'),
|
||||
async outputManager => await this.dockerClient.buildImage(options, content => outputManager.append(content)),
|
||||
id => `Docker image ${this.dockerClient.trimId(id)} built.`,
|
||||
err => `Failed to build Docker image: ${err}`);
|
||||
id => localize('vscode-docker.debug.coreclr.imageBuilt', 'Docker image {0} built.', this.dockerClient.trimId(id)),
|
||||
err => localize('vscode-docker.debug.coreclr.buildError', 'Failed to build Docker image: {0}', parseError(err).message));
|
||||
|
||||
const dockerfileHash = await dockerfileHasher.value;
|
||||
const dockerIgnoreHash = await dockerIgnoreHasher.value;
|
||||
|
@ -184,7 +186,7 @@ export class DefaultDockerManager implements DockerManager {
|
|||
|
||||
public async runContainer(imageTagOrId: string, options: DockerManagerRunContainerOptions): Promise<string> {
|
||||
if (options.containerName === undefined) {
|
||||
throw new Error('No container name was provided.');
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.noContainer', 'No container name was provided.'));
|
||||
}
|
||||
|
||||
const containerName = options.containerName;
|
||||
|
@ -202,7 +204,7 @@ export class DefaultDockerManager implements DockerManager {
|
|||
const additionalVolumes = this.getVolumes(debuggerFolder, options);
|
||||
|
||||
const containerId = await this.dockerOutputManager.performOperation(
|
||||
'Starting container...',
|
||||
localize('vscode-docker.debug.coreclr.startingContainer', 'Starting container...'),
|
||||
async () => {
|
||||
const containers = (await this.dockerClient.listContainers({ format: '{{.Names}}' })).split('\n');
|
||||
|
||||
|
@ -226,8 +228,8 @@ export class DefaultDockerManager implements DockerManager {
|
|||
volumes: [...(additionalVolumes || []), ...(options.volumes || [])]
|
||||
});
|
||||
},
|
||||
id => `Container ${this.dockerClient.trimId(id)} started.`,
|
||||
err => `Unable to start container: ${err}`);
|
||||
id => localize('vscode-docker.debug.coreclr.containerStarted', 'Container {0} started.', this.dockerClient.trimId(id)),
|
||||
err => localize('vscode-docker.debug.coreclr.unableToStart', 'Unable to start container: {0}', parseError(err).message));
|
||||
|
||||
return containerId;
|
||||
}
|
||||
|
@ -349,7 +351,7 @@ export class DefaultDockerManager implements DockerManager {
|
|||
programFilesEnvironmentVariable = this.processProvider.env[DefaultDockerManager.ProgramFilesEnvironmentVariable];
|
||||
|
||||
if (programFilesEnvironmentVariable === undefined) {
|
||||
throw new Error(`The environment variable '${DefaultDockerManager.ProgramFilesEnvironmentVariable}' is not defined. This variable is used to locate the NuGet fallback folder.`);
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.programFilesUndefined', 'The environment variable \'{0}\' is not defined. This variable is used to locate the NuGet fallback folder.', DefaultDockerManager.ProgramFilesEnvironmentVariable));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import * as fse from 'fs-extra';
|
|||
import * as path from 'path';
|
||||
import { CancellationToken, commands, DebugConfiguration, DebugConfigurationProvider, MessageItem, ProviderResult, window, WorkspaceFolder } from 'vscode';
|
||||
import { callWithTelemetryAndErrorHandling } from 'vscode-azureextensionui';
|
||||
import { localize } from '../../localize';
|
||||
import { PlatformOS } from '../../utils/platform';
|
||||
import { resolveVariables } from '../../utils/resolveVariables';
|
||||
import { DockerContainerExtraHost, DockerContainerPort, DockerContainerVolume } from './CliDockerClient';
|
||||
|
@ -78,12 +79,14 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
|
|||
// Prompt them to add Docker files since they probably haven't
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
window.showErrorMessage(
|
||||
'To debug in a Docker container on supported platforms, use the command \"Docker: Add Docker Files to Workspace\", or click \"Add Docker Files\".',
|
||||
...[add]).then((result) => {
|
||||
if (result === add) {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
commands.executeCommand('vscode-docker.configure');
|
||||
}});
|
||||
localize('vscode-docker.debug.coreclr.addDockerFiles', 'To debug in a Docker container on supported platforms, use the command \'Docker: Add Docker Files to Workspace\', or click \'Add Docker Files\'.'),
|
||||
...[add])
|
||||
.then((result) => {
|
||||
if (result === add) {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
commands.executeCommand('vscode-docker.configure');
|
||||
}
|
||||
});
|
||||
|
||||
return [];
|
||||
}
|
||||
|
@ -96,7 +99,7 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
|
|||
|
||||
private async resolveDockerDebugConfiguration(folder: WorkspaceFolder | undefined, debugConfiguration: DockerDebugConfiguration): Promise<DebugConfiguration | undefined> {
|
||||
if (!folder) {
|
||||
throw new Error('No workspace folder is associated with debugging.');
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.noWorkspaceFolder', 'No workspace folder is associated with debugging.'));
|
||||
}
|
||||
|
||||
if (debugConfiguration.type === undefined) {
|
||||
|
@ -233,7 +236,7 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
|
|||
};
|
||||
|
||||
if (!await this.fsProvider.dirExists(folders.resolvedAppFolder)) {
|
||||
throw new Error(`The application folder '${folders.resolvedAppFolder}' does not exist. Ensure that the 'appFolder' or 'appProject' property is set correctly in the Docker debug configuration.`);
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.noAppFolder', 'The application folder \'{0}\' does not exist. Ensure that the \'appFolder\' or \'appProject\' property is set correctly in the Docker debug configuration.', folders.resolvedAppFolder));
|
||||
}
|
||||
|
||||
return folders;
|
||||
|
@ -268,7 +271,7 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
|
|||
}
|
||||
|
||||
if (appProject === undefined) {
|
||||
throw new Error('Unable to infer the application project file. Set either the \'appFolder\' or \'appProject\' property in the Docker debug configuration.');
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.noProjectFile', 'Unable to infer the application project file. Set either the \'appFolder\' or \'appProject\' property in the Docker debug configuration.'));
|
||||
}
|
||||
|
||||
const projects = {
|
||||
|
@ -277,7 +280,7 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
|
|||
};
|
||||
|
||||
if (!await this.fsProvider.fileExists(projects.resolvedAppProject)) {
|
||||
throw new Error(`The application project file '${projects.resolvedAppProject}' does not exist. Ensure that the 'appFolder' or 'appProject' property is set correctly in the Docker debug configuration.`);
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.projectFileNotExist', 'The application project file \'{0}\' does not exist. Ensure that the \'appFolder\' or \'appProject\' property is set correctly in the Docker debug configuration.', projects.resolvedAppProject));
|
||||
}
|
||||
|
||||
return projects;
|
||||
|
@ -293,7 +296,7 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
|
|||
const resolvedContext = resolveVariables(context, folder);
|
||||
|
||||
if (!await this.fsProvider.dirExists(resolvedContext)) {
|
||||
throw new Error(`The context folder '${resolvedContext}' does not exist. Ensure that the 'context' property is set correctly in the Docker debug configuration.`);
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.contextFolderNotExist', 'The context folder \'{0}\' does not exist. Ensure that the \'context\' property is set correctly in the Docker debug configuration.', resolvedContext));
|
||||
}
|
||||
|
||||
return resolvedContext;
|
||||
|
@ -307,7 +310,7 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
|
|||
dockerfile = resolveVariables(dockerfile, folder);
|
||||
|
||||
if (!await this.fsProvider.fileExists(dockerfile)) {
|
||||
throw new Error(`The Dockerfile '${dockerfile}' does not exist. Ensure that the 'dockerfile' property is set correctly in the Docker debug configuration.`);
|
||||
throw new Error(localize('vscode-docker.debug.coreclr.dockerfileNotExist', 'The Dockerfile \'{0}\' does not exist. Ensure that the \'dockerfile\' property is set correctly in the Docker debug configuration.', dockerfile));
|
||||
}
|
||||
|
||||
return dockerfile;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
import * as path from 'path';
|
||||
import * as vscode from 'vscode';
|
||||
import { localize } from '../../localize';
|
||||
import { ProcessProvider } from './ChildProcessProvider';
|
||||
import { DockerClient } from './CliDockerClient';
|
||||
import { DotNetClient } from './CommandLineDotNetClient';
|
||||
|
@ -33,7 +34,7 @@ export class DockerDaemonIsLinuxPrerequisite implements Prerequisite {
|
|||
}
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
this.showErrorMessage('The Docker daemon is not configured to run Linux containers. Only Linux containers can be used for .NET Core debugging.')
|
||||
this.showErrorMessage(localize('vscode-docker.debug.coreclr.onlyLinux', 'The Docker daemon is not configured to run Linux containers. Only Linux containers can be used for .NET Core debugging.'))
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -61,7 +62,7 @@ export class DotNetExtensionInstalledPrerequisite implements Prerequisite {
|
|||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
this
|
||||
.showErrorMessage(
|
||||
'To debug .NET Core in Docker containers, install the C# extension for VS Code.',
|
||||
localize('vscode-docker.debug.coreclr.installCSharp', 'To debug .NET Core in Docker containers, install the C# extension for VS Code.'),
|
||||
openExtensionInGallery)
|
||||
.then(result => {
|
||||
if (result === openExtensionInGallery) {
|
||||
|
@ -88,7 +89,7 @@ export class DotNetSdkInstalledPrerequisite implements Prerequisite {
|
|||
}
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
this.showErrorMessage('The .NET Core SDK must be installed to debug .NET Core applications running within Docker containers.');
|
||||
this.showErrorMessage(localize('vscode-docker.debug.coreclr.netCoreSdk', 'The .NET Core SDK must be installed to debug .NET Core applications running within Docker containers.'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -119,7 +120,7 @@ export class LinuxUserInDockerGroupPrerequisite implements Prerequisite {
|
|||
}
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
this.showErrorMessage('The current user is not a member of the "docker" group. Add it using the command "sudo usermod -a -G docker $USER".')
|
||||
this.showErrorMessage(localize('vscode-docker.debug.coreclr.dockerGroup', 'The current user is not a member of the "docker" group. Add it using the command "sudo usermod -a -G docker $USER".'))
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -158,7 +159,7 @@ export class MacNuGetFallbackFolderSharedPrerequisite implements Prerequisite {
|
|||
}
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
this.showErrorMessage(`To debug .NET Core in Docker containers, add "${MacNuGetPackageFallbackFolderPath}" as a shared folder in your Docker preferences.`);
|
||||
this.showErrorMessage(localize('vscode-docker.debug.coreclr.shareNugetFolder', 'To debug .NET Core in Docker containers, add "{0}" as a shared folder in your Docker preferences.', MacNuGetPackageFallbackFolderPath));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -177,13 +178,13 @@ export class DockerfileExistsPrerequisite implements Prerequisite {
|
|||
}
|
||||
|
||||
const addDockerFiles: vscode.MessageItem = {
|
||||
title: 'Add Docker files'
|
||||
title: localize('vscode-docker.debug.coreclr.addDockerFilesButton', 'Add Docker files')
|
||||
};
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
this
|
||||
.showErrorMessage(
|
||||
'Couldn\'t find a Dockerfile in your workspace. Would you like to add Docker files to the workspace?',
|
||||
localize('vscode-docker.debug.coreclr.noDockerfile', 'Couldn\'t find a Dockerfile in your workspace.Would you like to add Docker files to the workspace ? '),
|
||||
addDockerFiles)
|
||||
.then(result => {
|
||||
if (result === addDockerFiles) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import * as path from 'path';
|
|||
import * as process from 'process';
|
||||
import * as request from 'request-promise-native';
|
||||
import { Memento } from 'vscode';
|
||||
import { localize } from '../../localize';
|
||||
import { NetCoreDebugHelper } from '../netcore/NetCoreDebugHelper';
|
||||
import { ProcessProvider } from './ChildProcessProvider';
|
||||
import { FileSystemProvider } from './fsProvider';
|
||||
|
@ -79,7 +80,7 @@ export class RemoteVsDbgClient implements VsDbgClient {
|
|||
}
|
||||
|
||||
return await this.dockerOutputManager.performOperation(
|
||||
'Acquiring the latest .NET Core debugger...',
|
||||
localize('vscode-docker.debug.coreclr.debugger.acquiring', 'Acquiring the latest .NET Core debugger...'),
|
||||
async () => {
|
||||
|
||||
await this.getVsDbgAcquisitionScript();
|
||||
|
@ -94,8 +95,8 @@ export class RemoteVsDbgClient implements VsDbgClient {
|
|||
|
||||
return vsdbgRelativeVersionPath;
|
||||
},
|
||||
'Debugger acquired.',
|
||||
'Unable to acquire the .NET Core debugger.');
|
||||
localize('vscode-docker.debug.coreclr.debugger.acquired', 'Debugger acquired.'),
|
||||
localize('vscode-docker.debug.coreclr.debugger.unableToAcquire', 'Unable to acquire the .NET Core debugger.'));
|
||||
}
|
||||
|
||||
private async ensureVsDbgFolderExists(): Promise<void> {
|
||||
|
|
|
@ -9,6 +9,7 @@ import * as path from 'path';
|
|||
import { DebugConfiguration, MessageItem, window } from 'vscode';
|
||||
import { DialogResponses, IActionContext, UserCancelledError } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { NetCoreTaskHelper, NetCoreTaskOptions } from '../../tasks/netcore/NetCoreTaskHelper';
|
||||
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
|
||||
import { pathNormalize } from '../../utils/pathNormalize';
|
||||
|
@ -111,7 +112,7 @@ export class NetCoreDebugHelper implements DebugHelper {
|
|||
return this.resolveAttachDebugConfiguration(context, debugConfiguration);
|
||||
break;
|
||||
default:
|
||||
throw Error(`Unknown request ${debugConfiguration.request} specified in the debug config.`);
|
||||
throw Error(localize('vscode-docker.debug.netcore.unknownDebugRequest', 'Unknown request {0} specified in the debug config.', debugConfiguration.request));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,9 +280,9 @@ export class NetCoreDebugHelper implements DebugHelper {
|
|||
|
||||
private async installDebuggerInContainer(containerName: string): Promise<string> {
|
||||
const yesItem: MessageItem = DialogResponses.yes;
|
||||
const install = (yesItem === await window.showInformationMessage('Attaching to container requires .NET Core debugger in the container. Do you want to install debugger in the container?', ...[DialogResponses.yes, DialogResponses.no]));
|
||||
const install = (yesItem === await window.showInformationMessage(localize('vscode-docker.debug.netcore.attachingRequiresDebugger', 'Attaching to container requires .NET Core debugger in the container. Do you want to install debugger in the container?'), ...[DialogResponses.yes, DialogResponses.no]));
|
||||
if (!install) {
|
||||
throw new UserCancelledError("User didn't grand permission to install .NET Core debugger.");
|
||||
throw new UserCancelledError();
|
||||
}
|
||||
|
||||
const debuggerPath: string = '/remote_debugger';
|
||||
|
@ -295,17 +296,17 @@ export class NetCoreDebugHelper implements DebugHelper {
|
|||
const dockerClient = new CliDockerClient(new ChildProcessProvider());
|
||||
|
||||
await outputManager.performOperation(
|
||||
'Installing the latest .NET Core debugger...',
|
||||
localize('vscode-docker.debug.netcore.installingDebugger', 'Installing the latest .NET Core debugger...'),
|
||||
async (output) => {
|
||||
const installProgress = (content: string) => {
|
||||
output.appendLine(content);
|
||||
};
|
||||
const dockerExecOptions : DockerExecOptions = { interactive: true, progress: installProgress };
|
||||
const dockerExecOptions: DockerExecOptions = { interactive: true, progress: installProgress };
|
||||
|
||||
await dockerClient.exec(containerName, installDebugger, dockerExecOptions);
|
||||
},
|
||||
'Debugger installed',
|
||||
'Unable to install the .NET Core debugger.'
|
||||
localize('vscode-docker.debug.netcore.debuggerInstalled', 'Debugger installed'),
|
||||
localize('vscode-docker.debug.netcore.unableToInstallDebugger', 'Unable to install the .NET Core debugger.')
|
||||
);
|
||||
|
||||
return `${debuggerPath}/vsdbg`;
|
||||
|
@ -315,7 +316,7 @@ export class NetCoreDebugHelper implements DebugHelper {
|
|||
const context: IActionContext = { telemetry: { properties: {}, measurements: {} }, errorHandling: { issueProperties: {} } };
|
||||
const containerItem: ContainerTreeItem = await ext.containersTree.showTreeItemPicker(ContainerTreeItem.runningContainerRegExp, {
|
||||
...context,
|
||||
noItemFoundErrorMessage: 'No running containers are available to attach'
|
||||
noItemFoundErrorMessage: localize('vscode-docker.debug.netcore.noContainers', 'No running containers are available to attach.')
|
||||
});
|
||||
return containerItem.containerName;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import * as fse from 'fs-extra';
|
||||
import * as os from 'os';
|
||||
import * as vscode from 'vscode';
|
||||
import { localize } from '../../localize';
|
||||
import { PythonExtensionHelper } from '../../tasks/python/PythonExtensionHelper';
|
||||
import { PythonDefaultDebugPort, PythonProjectType } from '../../utils/pythonUtils';
|
||||
import ChildProcessProvider from '../coreclr/ChildProcessProvider';
|
||||
|
@ -68,7 +69,7 @@ export class PythonDebugHelper implements DebugHelper {
|
|||
// the debug configuration.
|
||||
try {
|
||||
await this.cliDockerClient.removeContainer(containerName, { force: true });
|
||||
} catch {}
|
||||
} catch { }
|
||||
|
||||
const debuggerLogFilePath = PythonExtensionHelper.getDebuggerLogFilePath(context.folder.name);
|
||||
await fse.remove(debuggerLogFilePath);
|
||||
|
@ -83,7 +84,7 @@ export class PythonDebugHelper implements DebugHelper {
|
|||
const task = await this.tryGetPreLaunchTask(debugConfiguration.preLaunchTask);
|
||||
|
||||
if (!task) {
|
||||
throw new Error(`Unable to find the prelaunch task with the name: ${debugConfiguration.preLaunchTask}`);
|
||||
throw new Error(localize('vscode-docker.debug.python.noPreLaunch', 'Unable to find the prelaunch task with the name: {0}', debugConfiguration.preLaunchTask));
|
||||
}
|
||||
|
||||
debugConfiguration.preLaunchTask = undefined;
|
||||
|
@ -102,14 +103,14 @@ export class PythonDebugHelper implements DebugHelper {
|
|||
const projectType = debugConfiguration.python.projectType;
|
||||
|
||||
const dockerServerReadyAction =
|
||||
resolveDockerServerReadyAction(
|
||||
debugConfiguration,
|
||||
{
|
||||
containerName: containerName,
|
||||
pattern: this.getServerReadyPattern(projectType),
|
||||
uriFormat: '%s://localhost:%s'
|
||||
},
|
||||
true);
|
||||
resolveDockerServerReadyAction(
|
||||
debugConfiguration,
|
||||
{
|
||||
containerName: containerName,
|
||||
pattern: this.getServerReadyPattern(projectType),
|
||||
uriFormat: '%s://localhost:%s'
|
||||
},
|
||||
true);
|
||||
|
||||
// These properties are required by the old debugger, should be changed to normal properties in the configuration
|
||||
// as soon as the new debugger is released to 100% of the users.
|
||||
|
@ -139,7 +140,7 @@ export class PythonDebugHelper implements DebugHelper {
|
|||
};
|
||||
}
|
||||
|
||||
private async tryGetPreLaunchTask(prelaunchTaskName: string) : Promise<vscode.Task> | undefined {
|
||||
private async tryGetPreLaunchTask(prelaunchTaskName: string): Promise<vscode.Task> | undefined {
|
||||
if (!prelaunchTaskName) {
|
||||
return undefined;
|
||||
}
|
||||
|
@ -157,7 +158,7 @@ export class PythonDebugHelper implements DebugHelper {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
private getServerReadyPattern(projectType: PythonProjectType) : string | undefined {
|
||||
private getServerReadyPattern(projectType: PythonProjectType): string | undefined {
|
||||
switch (projectType) {
|
||||
case 'django':
|
||||
return 'Starting development server at (https?://\\S+|[0-9]+)';
|
||||
|
|
|
@ -4,167 +4,152 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ComposeVersionKeys, KeyInfo } from "../extension";
|
||||
import { localize } from "../localize";
|
||||
|
||||
// Define the keys that are shared between all compose file versions,
|
||||
// regardless of the major/minor version (e.g. v1-v2.1+).
|
||||
// https://docs.docker.com/compose/yml/
|
||||
const DOCKER_COMPOSE_SHARED_KEY_INFO: KeyInfo = {
|
||||
'build': (
|
||||
"Path to a directory containing a Dockerfile. When the value supplied is a relative path, it is interpreted as relative to the " +
|
||||
"location of the yml file itself. This directory is also the build context that is sent to the Docker daemon.\n\n" +
|
||||
"Compose will build and tag it with a generated name, and use that image thereafter."
|
||||
localize('vscode-docker.dockerComposeKey.build', 'Path to a directory containing a Dockerfile. When the value supplied is a relative path, it is interpreted as relative to the location of the yml file itself. This directory is also the build context that is sent to the Docker daemon.\n\nCompose will build and tag it with a generated name, and use that image thereafter.')
|
||||
),
|
||||
'cap_add': (
|
||||
"Add or drop container capabilities. See `man 7 capabilities` for a full list."
|
||||
localize('vscode-docker.dockerComposeKey.cap_add', 'Add or drop container capabilities. See \`man 7 capabilities\` for a full list.')
|
||||
),
|
||||
'cap_drop': (
|
||||
"Add or drop container capabilities. See `man 7 capabilities` for a full list."
|
||||
localize('vscode-docker.dockerComposeKey.cap_drop', 'Add or drop container capabilities. See \`man 7 capabilities\` for a full list.')
|
||||
),
|
||||
'cgroup_parent': (
|
||||
"Specify an optional parent cgroup for the container."
|
||||
localize('vscode-docker.dockerComposeKey.cgroup_parent', 'Specify an optional parent cgroup for the container.')
|
||||
),
|
||||
'command': (
|
||||
"Override the default command."
|
||||
localize('vscode-docker.dockerComposeKey.command', 'Override the default command.')
|
||||
),
|
||||
'container_name': (
|
||||
"Specify custom container name, rather than a generated default name."
|
||||
localize('vscode-docker.dockerComposeKey.container_name', 'Specify custom container name, rather than a generated default name.')
|
||||
),
|
||||
'cpu_shares': (
|
||||
"CPU shares (relative weight)."
|
||||
localize('vscode-docker.dockerComposeKey.cpu_shares', 'CPU shares (relative weight).')
|
||||
),
|
||||
'cpu_quota': (
|
||||
"Limit CPU CFS (Completely Fair Scheduler) quota."
|
||||
localize('vscode-docker.dockerComposeKey.cpu_quota', 'Limit CPU CFS (Completely Fair Scheduler) quota.')
|
||||
),
|
||||
'cpuset': (
|
||||
"CPUs in which to allow execution."
|
||||
localize('vscode-docker.dockerComposeKey.cpuset', 'CPUs in which to allow execution.')
|
||||
),
|
||||
'devices': (
|
||||
"List of device mappings. Uses the same format as the `--device` docker client create option."
|
||||
localize('vscode-docker.dockerComposeKey.devices', 'List of device mappings. Uses the same format as the \`--device\` docker client create option.')
|
||||
),
|
||||
'dns': (
|
||||
"Custom DNS servers. Can be a single value or a list."
|
||||
localize('vscode-docker.dockerComposeKey.dns', 'Custom DNS servers. Can be a single value or a list.')
|
||||
),
|
||||
'dns_search': (
|
||||
"Custom DNS search domains. Can be a single value or a list."
|
||||
localize('vscode-docker.dockerComposeKey.dns_search', 'Custom DNS search domains. Can be a single value or a list.')
|
||||
),
|
||||
'dockerfile': (
|
||||
"Alternate Dockerfile. Compose will use an alternate file to build with. Using `dockerfile` together with `image` is not allowed. Attempting to do so results in an error."
|
||||
localize('vscode-docker.dockerComposeKey.dockerfile', 'Alternate Dockerfile. Compose will use an alternate file to build with. Using \`dockerfile\` together with \`image\` is not allowed. Attempting to do so results in an error.')
|
||||
),
|
||||
'domainname': (
|
||||
"Container domain name."
|
||||
localize('vscode-docker.dockerComposeKey.domainname', 'Container domain name.')
|
||||
),
|
||||
'entrypoint': (
|
||||
"Overwrite the default ENTRYPOINT of the image."
|
||||
localize('vscode-docker.dockerComposeKey.entrypoint', 'Overwrite the default ENTRYPOINT of the image.')
|
||||
),
|
||||
'env_file': (
|
||||
"Add environment variables from a file. Can be a single value or a list.\n\n" +
|
||||
"If you have specified a Compose file with `docker-compose -f FILE`, paths in `env_file` are relative to the directory that file is in.\n\n" +
|
||||
"Environment variables specified in `environment` override these values."
|
||||
localize('vscode-docker.dockerComposeKey.env_file', 'Add environment variables from a file. Can be a single value or a list.\n\nIf you have specified a Compose file with `docker-compose -f FILE`, paths in `env_file` are relative to the directory that file is in.\n\nEnvironment variables specified in `environment` override these values.')
|
||||
),
|
||||
'environment': (
|
||||
"Add environment variables. You can use either an array or a dictionary.\n\n" +
|
||||
"Environment variables with only a key are resolved to their values on the machine Compose is running on, which can be helpful for secret or host-specific values."
|
||||
localize('vscode-docker.dockerComposeKey.environment', 'Add environment variables. You can use either an array or a dictionary.\n\nEnvironment variables with only a key are resolved to their values on the machine Compose is running on, which can be helpful for secret or host-specific values.')
|
||||
),
|
||||
'expose': (
|
||||
"Expose ports without publishing them to the host machine - they'll only be accessible to linked services. \n" +
|
||||
"Only the internal port can be specified."
|
||||
localize('vscode-docker.dockerComposeKey.expose', 'Expose ports without publishing them to the host machine - they\'ll only be accessible to linked services.\nOnly the internal port can be specified.')
|
||||
),
|
||||
'extends': (
|
||||
"Extend another service, in the current file or another, optionally overriding configuration.\nYou can use `extends` on any service together with other configuration keys. " +
|
||||
"The `extends` value must be a dictionary defined with a required `service` and an optional `file` key."
|
||||
localize('vscode-docker.dockerComposeKey.extends', 'Extend another service, in the current file or another, optionally overriding configuration.\nYou can use `extends` on any service together with other configuration keys. The `extends` value must be a dictionary defined with a required `service` and an optional `file` key.')
|
||||
),
|
||||
'external_links': (
|
||||
"Link to containers started outside this `docker-compose.yml` or even outside of Compose, especially for containers that " +
|
||||
"provide shared or common services. `external_links` follow " +
|
||||
"semantics similar to `links` when specifying both the container name and the link alias (`CONTAINER:ALIAS`)."
|
||||
localize('vscode-docker.dockerComposeKey.external_links', 'Link to containers started outside this `docker-compose.yml` or even outside of Compose, especially for containers that provide shared or common services. `external_links` follow semantics similar to `links` when specifying both the container name and the link alias (`CONTAINER:ALIAS`).')
|
||||
),
|
||||
'extra_hosts': (
|
||||
"Add hostname mappings. Use the same values as the docker client `--add-host` parameter."
|
||||
localize('vscode-docker.dockerComposeKey.extra_hosts', 'Add hostname mappings. Use the same values as the docker client `--add-host` parameter.')
|
||||
),
|
||||
'hostname': (
|
||||
"Container host name."
|
||||
localize('vscode-docker.dockerComposeKey.hostname', 'Container host name.')
|
||||
),
|
||||
'image': (
|
||||
"Tag or partial image ID. Can be local or remote - Compose will attempt to pull if it doesn't exist locally."
|
||||
localize('vscode-docker.dockerComposeKey.image', 'Tag or partial image ID. Can be local or remote - Compose will attempt to pull if it doesn\'t exist locally.')
|
||||
),
|
||||
'ipc': (
|
||||
"IPC namespace to use."
|
||||
localize('vscode-docker.dockerComposeKey.ipc', 'IPC namespace to use.')
|
||||
),
|
||||
'labels': (
|
||||
"Add metadata to containers using Docker labels. You can either use an array or a dictionary.\n" +
|
||||
"It's recommended that you use reverse-DNS notation to prevent your labels from conflicting with those used by other software."
|
||||
localize('vscode-docker.dockerComposeKey.labels', 'Add metadata to containers using Docker labels. You can either use an array or a dictionary.\nIt\'s recommended that you use reverse-DNS notation to prevent your labels from conflicting with those used by other software.')
|
||||
),
|
||||
'links': (
|
||||
"Link to containers in another service. Either specify both the service name and the link alias (`CONTAINER:ALIAS`), or " +
|
||||
"just the service name (which will also be used for the alias)."
|
||||
localize('vscode-docker.dockerComposeKey.links', 'Link to containers in another service. Either specify both the service name and the link alias (`CONTAINER:ALIAS`), or just the service name (which will also be used for the alias).')
|
||||
),
|
||||
|
||||
'mac_address': (
|
||||
"Container MAC address (e.g. 92:d0:c6:0a:29:33)."
|
||||
localize('vscode-docker.dockerComposeKey.mac_address', 'Container MAC address (e.g. 92:d0:c6:0a:29:33).')
|
||||
),
|
||||
'mem_limit': (
|
||||
"Memory limit."
|
||||
localize('vscode-docker.dockerComposeKey.mem_limit', 'Memory limit.')
|
||||
),
|
||||
'memswap_limit': (
|
||||
"Swap limit equal to memory plus swap: '-1' to enable unlimited swap."
|
||||
localize('vscode-docker.dockerComposeKey.memswap_limit', 'Swap limit equal to memory plus swap: \'-1\' to enable unlimited swap.')
|
||||
),
|
||||
'mem_swappiness': (
|
||||
"Tune container memory swappiness (0 to 100) (default -1)."
|
||||
localize('vscode-docker.dockerComposeKey.mem_swappiness', 'Tune container memory swappiness (0 to 100) (default -1).')
|
||||
),
|
||||
'pid': (
|
||||
"Sets the PID mode to the host PID mode. This turns on sharing between container and the host operating system the PID address space. " +
|
||||
"Containers launched with this flag will be able to access and manipulate other containers in the bare-metal machine's namespace and vise-versa."
|
||||
localize('vscode-docker.dockerComposeKey.pid', 'Sets the PID mode to the host PID mode. This turns on sharing between container and the host operating system the PID address space. Containers launched with this flag will be able to access and manipulate other containers in the bare-metal machine\'s namespace and vise-versa.')
|
||||
),
|
||||
'ports': (
|
||||
"Expose ports. Either specify both ports (`HOST:CONTAINER`), or just the container port (a random host port will be chosen).\n\n" +
|
||||
"**Note**: When mapping ports in the `HOST:CONTAINER` format, you may experience erroneous results when using a container port " +
|
||||
"lower than 60, because YAML will parse numbers in the format `xx:yy` as sexagesimal (base 60). For this reason, we recommend " +
|
||||
"always explicitly specifying your port mappings as strings."
|
||||
localize('vscode-docker.dockerComposeKey.ports', 'Expose ports. Either specify both ports (`HOST:CONTAINER`), or just the container port (a random host port will be chosen).\n\n**Note**: When mapping ports in the `HOST:CONTAINER` format, you may experience erroneous results when using a container port lower than 60, because YAML will parse numbers in the format `xx:yy` as sexagesimal (base 60). For this reason, we recommend always explicitly specifying your port mappings as strings.')
|
||||
),
|
||||
'privileged': (
|
||||
"Give extended privileges to this container."
|
||||
localize('vscode-docker.dockerComposeKey.privileged', 'Give extended privileges to this container.')
|
||||
),
|
||||
'read_only': (
|
||||
"Mount the container's root filesystem as read only."
|
||||
localize('vscode-docker.dockerComposeKey.read_only', 'Mount the container\'s root filesystem as read only.')
|
||||
),
|
||||
'restart': (
|
||||
"Restart policy to apply when a container exits (default \"no\")."
|
||||
localize('vscode-docker.dockerComposeKey.restart', 'Restart policy to apply when a container exits (default "no").')
|
||||
),
|
||||
'security_opt': (
|
||||
"Override the default labeling scheme for each container."
|
||||
localize('vscode-docker.dockerComposeKey.security_opt', 'Override the default labeling scheme for each container.')
|
||||
),
|
||||
'shm_size': (
|
||||
"Size of /dev/shm, default value is 64MB."
|
||||
localize('vscode-docker.dockerComposeKey.shm_size', 'Size of /dev/shm, default value is 64MB.')
|
||||
),
|
||||
'stdin_open': (
|
||||
"Keep STDIN open even if not attached."
|
||||
localize('vscode-docker.dockerComposeKey.stdin_open', 'Keep STDIN open even if not attached.')
|
||||
),
|
||||
'stop_signal': (
|
||||
"Signal to stop a container, SIGTERM by default."
|
||||
localize('vscode-docker.dockerComposeKey.stop_signal', 'Signal to stop a container, SIGTERM by default.')
|
||||
),
|
||||
'tty': (
|
||||
"Allocate a pseudo-TTY."
|
||||
localize('vscode-docker.dockerComposeKey.tty', 'Allocate a pseudo-TTY.')
|
||||
),
|
||||
'ulimits': (
|
||||
"Override the default ulimits for a container. You can either specify a single limit as an integer or soft/hard limits as a mapping."
|
||||
localize('vscode-docker.dockerComposeKey.ulimits', 'Override the default ulimits for a container. You can either specify a single limit as an integer or soft/hard limits as a mapping.')
|
||||
),
|
||||
'user': (
|
||||
"Username or UID (format: <name|uid>[:<group|gid>])."
|
||||
localize('vscode-docker.dockerComposeKey.user', 'Username or UID (format: <name|uid>[:<group|gid>]).')
|
||||
),
|
||||
'version': (
|
||||
"Specify the compose format that this file conforms to."
|
||||
localize('vscode-docker.dockerComposeKey.version', 'Specify the compose format that this file conforms to.')
|
||||
),
|
||||
'volumes': (
|
||||
"Mount paths as volumes, optionally specifying a path on the host machine (`HOST:CONTAINER`), or an access mode (`HOST:CONTAINER:ro`)."
|
||||
localize('vscode-docker.dockerComposeKey.volumes', 'Mount paths as volumes, optionally specifying a path on the host machine (`HOST:CONTAINER`), or an access mode (`HOST:CONTAINER:ro`).')
|
||||
),
|
||||
'volume_driver': (
|
||||
"If you use a volume name (instead of a volume path), you may also specify a `volume_driver`."
|
||||
localize('vscode-docker.dockerComposeKey.volume_driver', 'If you use a volume name (instead of a volume path), you may also specify a `volume_driver`.')
|
||||
),
|
||||
'volumes_from': (
|
||||
"Mount all of the volumes from another service or container."
|
||||
localize('vscode-docker.dockerComposeKey.volumes_from', 'Mount all of the volumes from another service or container.')
|
||||
),
|
||||
'working_dir': (
|
||||
"Working directory inside the container."
|
||||
localize('vscode-docker.dockerComposeKey.working_dir', 'Working directory inside the container.')
|
||||
)
|
||||
};
|
||||
|
||||
|
@ -172,13 +157,13 @@ const DOCKER_COMPOSE_SHARED_KEY_INFO: KeyInfo = {
|
|||
// https://github.com/docker/compose/blob/master/compose/config/config_schema_v1.json
|
||||
const DOCKER_COMPOSE_V1_KEY_INFO: KeyInfo = {
|
||||
'log_driver': (
|
||||
"Specify a logging driver for the service's containers, as with the `--log-driver` option for docker run. The default value is json-file."
|
||||
localize('vscode-docker.dockerComposeKey1.log_driver', 'Specify a logging driver for the service\'s containers, as with the `--log-driver` option for docker run. The default value is json-file.')
|
||||
),
|
||||
'log_opt': (
|
||||
"Specify logging options with `log_opt` for the logging driver, as with the `--log-opt` option for docker run."
|
||||
localize('vscode-docker.dockerComposeKey1.log_opt', 'Specify logging options with `log_opt` for the logging driver, as with the `--log-opt` option for docker run.')
|
||||
),
|
||||
'net': (
|
||||
"Networking mode. Use the same values as the docker client `--net` parameter."
|
||||
localize('vscode-docker.dockerComposeKey1.net', 'Networking mode. Use the same values as the docker client `--net` parameter.')
|
||||
)
|
||||
};
|
||||
|
||||
|
@ -187,34 +172,35 @@ const DOCKER_COMPOSE_V1_KEY_INFO: KeyInfo = {
|
|||
const DOCKER_COMPOSE_V2_KEY_INFO: KeyInfo = {
|
||||
// Added top-level properties
|
||||
'services': (
|
||||
"Specify the set of services that your app is composed of."
|
||||
localize('vscode-docker.dockerComposeKey2.services', 'Specify the set of services that your app is composed of.')
|
||||
),
|
||||
|
||||
// TODO: There is now a top-level and service-level volumes/networks setting which conflict.
|
||||
// This will be resolved when we add completion that understands file position context.
|
||||
'networks': (
|
||||
"Specifies the networks to be created as part of your app. This is analogous to running `docker network create`."
|
||||
localize('vscode-docker.dockerComposeKey2.networks', 'Specifies the networks to be created as part of your app. This is analogous to running `docker network create`.')
|
||||
),
|
||||
'volumes': (
|
||||
"Specifies the volumes to be created as part of your app. This is analogous to running `docker volume create`."
|
||||
localize('vscode-docker.dockerComposeKey2.volumes', 'Specifies the volumes to be created as part of your app. This is analogous to running `docker volume create`.')
|
||||
),
|
||||
|
||||
// Added service-level properties
|
||||
'depends_on': (
|
||||
"Specifies the names of services that this service depends on."
|
||||
localize('vscode-docker.dockerComposeKey2.depends_on', 'Specifies the names of services that this service depends on.')
|
||||
),
|
||||
'logging': (
|
||||
"Logging configuration for the service."
|
||||
localize('vscode-docker.dockerComposeKey2.logging', 'Logging configuration for the service.')
|
||||
),
|
||||
'network_mode': (
|
||||
"Networking mode. Use the same values as the docker client `--net` parameter."
|
||||
localize('vscode-docker.dockerComposeKey2.network_mode', 'Networking mode. Use the same values as the docker client `--net` parameter.')
|
||||
),
|
||||
'tmpfs': (
|
||||
"Mount a temporary file system inside the container. Can be a single value or a list."
|
||||
localize('vscode-docker.dockerComposeKey2.tmpfs', 'Mount a temporary file system inside the container. Can be a single value or a list.')
|
||||
),
|
||||
|
||||
// Modified service-level properties
|
||||
'build': (
|
||||
"Configuration options that are applied at build time. Can be specified either as a string containing a path to the build context, or an object with the path specified under `context` and optionally `dockerfile` and `args`."
|
||||
localize('vscode-docker.dockerComposeKey2.build', 'Configuration options that are applied at build time. Can be specified either as a string containing a path to the build context, or an object with the path specified under `context` and optionally `dockerfile` and `args`.')
|
||||
),
|
||||
|
||||
// Added service/logging-level properties
|
||||
|
@ -222,66 +208,66 @@ const DOCKER_COMPOSE_V2_KEY_INFO: KeyInfo = {
|
|||
// a network driver, or a network IPAM driver, so we should account for
|
||||
// that when we add context-based completion.
|
||||
'driver': (
|
||||
"Specifies the logging driver to use for the service’s container."
|
||||
localize('vscode-docker.dockerComposeKey2.driver', 'Specifies the logging driver to use for the service’s container.')
|
||||
),
|
||||
'options': (
|
||||
'Options to pass to the specified logging driver, provided as key-value pairs.'
|
||||
localize('vscode-docker.dockerComposeKey2.options', 'Options to pass to the specified logging driver, provided as key-value pairs.')
|
||||
),
|
||||
|
||||
// Added service/build-level properties
|
||||
'args': (
|
||||
"Add build arguments, which are environment variables accessible only during the build process."
|
||||
localize('vscode-docker.dockerComposeKey2.args', 'Add build arguments, which are environment variables accessible only during the build process.')
|
||||
),
|
||||
'context': (
|
||||
"Either a path to a directory containing a Dockerfile, or a url to a git repository. This directory will be used as the build context that is sent to the Docker daemon."
|
||||
localize('vscode-docker.dockerComposeKey2.context', 'Either a path to a directory containing a Dockerfile, or a url to a git repository. This directory will be used as the build context that is sent to the Docker daemon.')
|
||||
),
|
||||
|
||||
// Added service/network-level properties
|
||||
'aliases': (
|
||||
"Alternative hostnames for this service on the network. Other containers on the same network can use either the service name or this alias to connect to one of the service’s containers."
|
||||
localize('vscode-docker.dockerComposeKey2.aliases', 'Alternative hostnames for this service on the network. Other containers on the same network can use either the service name or this alias to connect to one of the service’s containers.')
|
||||
),
|
||||
'ipv4_address': (
|
||||
"Specify a static IPv4 address for containers for this service when joining the network."
|
||||
localize('vscode-docker.dockerComposeKey2.ipv4_address', 'Specify a static IPv4 address for containers for this service when joining the network.')
|
||||
),
|
||||
'ipv6_address': (
|
||||
"Specify a static IPv6 address for containers for this service when joining the network."
|
||||
localize('vscode-docker.dockerComposeKey2.ipv6_address', 'Specify a static IPv6 address for containers for this service when joining the network.')
|
||||
),
|
||||
|
||||
// Network-level properties
|
||||
'driver_opts': (
|
||||
"Specify a list of options as key-value pairs to pass to the driver. Those options are driver-dependent - consult the driver’s documentation for more information."
|
||||
localize('vscode-docker.dockerComposeKey2.driver_opts', 'Specify a list of options as key-value pairs to pass to the driver. Those options are driver-dependent - consult the driver’s documentation for more information.')
|
||||
),
|
||||
'external': (
|
||||
"If set to true, specifies that this network has been created outside of Compose. `docker-compose up` will not attempt to create it, and will raise an error if it doesn’t exist."
|
||||
localize('vscode-docker.dockerComposeKey2.external', 'If set to true, specifies that this network has been created outside of Compose. `docker-compose up` will not attempt to create it, and will raise an error if it doesn’t exist.')
|
||||
),
|
||||
'ipam': (
|
||||
"Specify custom IPAM config"
|
||||
localize('vscode-docker.dockerComposeKey2.ipam', 'Specify custom IPAM config')
|
||||
),
|
||||
|
||||
// Network/external-level properties
|
||||
// TODO: This would also apply to an external volume,
|
||||
// so we should account for that when we add context-based completion.
|
||||
'name': (
|
||||
"Specifies the name of the externally defined network."
|
||||
localize('vscode-docker.dockerComposeKey2.name', 'Specifies the name of the externally defined network.')
|
||||
),
|
||||
|
||||
// Network/ipam-level properties
|
||||
'config': (
|
||||
"A list with zero or more config blocks."
|
||||
localize('vscode-docker.dockerComposeKey2.config', 'A list with zero or more config blocks.')
|
||||
),
|
||||
|
||||
// Network/ipam/config-level properties
|
||||
'aux_addresses': (
|
||||
"Auxiliary IPv4 or IPv6 addresses used by Network driver, as a mapping from hostname to IP."
|
||||
localize('vscode-docker.dockerComposeKey2.aux_addresses', 'Auxiliary IPv4 or IPv6 addresses used by Network driver, as a mapping from hostname to IP.')
|
||||
),
|
||||
'gateway': (
|
||||
"IPv4 or IPv6 gateway for the master subnet."
|
||||
localize('vscode-docker.dockerComposeKey2.gateway', 'IPv4 or IPv6 gateway for the master subnet.')
|
||||
),
|
||||
'ip_range': (
|
||||
"Range of IPs from which to allocate container IPs."
|
||||
localize('vscode-docker.dockerComposeKey2.ip_range', 'Range of IPs from which to allocate container IPs.')
|
||||
),
|
||||
'subnet': (
|
||||
"Subnet in CIDR format that represents a network segment."
|
||||
localize('vscode-docker.dockerComposeKey2.subnet', 'Subnet in CIDR format that represents a network segment.')
|
||||
),
|
||||
|
||||
// Volume-level properties
|
||||
|
@ -295,26 +281,26 @@ const DOCKER_COMPOSE_V2_KEY_INFO: KeyInfo = {
|
|||
const DOCKER_COMPOSE_V2_1_KEY_INFO: KeyInfo = {
|
||||
// Added service-level properties
|
||||
'group_add': (
|
||||
"Specifies additional groups to join"
|
||||
localize('vscode-docker.dockerComposeKey21.group_add', 'Specifies additional groups to join')
|
||||
),
|
||||
'isolation': (
|
||||
"Container isolation technology"
|
||||
localize('vscode-docker.dockerComposeKey21.isolation', 'Container isolation technology')
|
||||
),
|
||||
'oom_score_adj': (
|
||||
"Tune host's OOM preferences (-1000 to 1000)"
|
||||
localize('vscode-docker.dockerComposeKey21.oom_score_adj', 'Tune host\'s OOM preferences (-1000 to 1000)')
|
||||
),
|
||||
|
||||
// Added service/network-level properties
|
||||
'link_local_ips': (
|
||||
"List of IPv4/IPv6 link-local addresses for the container"
|
||||
localize('vscode-docker.dockerComposeKey21.link_local_ips', 'List of IPv4/IPv6 link-local addresses for the container')
|
||||
),
|
||||
|
||||
// Added network-level properties
|
||||
'internal': (
|
||||
"Restrict external access to the network"
|
||||
localize('vscode-docker.dockerComposeKey21.internal', 'Restrict external access to the network')
|
||||
),
|
||||
'enable_ipv6': (
|
||||
"Enable IPv6 networking"
|
||||
localize('vscode-docker.dockerComposeKey21.enable_ipv6', 'Enable IPv6 networking')
|
||||
)
|
||||
|
||||
// Note that in v2.1, networks and volumes can now accept a "labels",
|
||||
|
@ -327,13 +313,13 @@ const DOCKER_COMPOSE_V2_1_KEY_INFO: KeyInfo = {
|
|||
const DOCKER_COMPOSE_V2_2_KEY_INFO: KeyInfo = {
|
||||
// Added service-level properties
|
||||
'cpu_count': (
|
||||
"Number of usable CPUs (Windows only)"
|
||||
localize('vscode-docker.dockerComposeKey22.cpu_count', 'Number of usable CPUs (Windows only)')
|
||||
),
|
||||
'cpu_percent': (
|
||||
"Usable percentage of the available CPUs (Windows only)"
|
||||
localize('vscode-docker.dockerComposeKey22.cpu_percent', 'Usable percentage of the available CPUs (Windows only)')
|
||||
),
|
||||
'cpus': (
|
||||
"CPU quota in number of CPUs"
|
||||
localize('vscode-docker.dockerComposeKey22.cpus', 'CPU quota in number of CPUs')
|
||||
)
|
||||
};
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
'use strict';
|
||||
|
||||
import https = require('https');
|
||||
import { localize } from './localize';
|
||||
import { httpsRequest } from './utils/httpRequest';
|
||||
|
||||
export function tagsForImage(image: IHubSearchResponseResult): string {
|
||||
|
@ -34,16 +35,16 @@ export function searchImageInRegistryHub(imageName: string, cache: boolean): Pro
|
|||
}
|
||||
|
||||
let popular = [
|
||||
{ "is_automated": false, "name": "redis", "is_trusted": false, "is_official": true, "star_count": 1300, "description": "Redis is an open source key-value store that functions as a data structure server." },
|
||||
{ "is_automated": false, "name": "ubuntu", "is_trusted": false, "is_official": true, "star_count": 2600, "description": "Ubuntu is a Debian-based Linux operating system based on free software." },
|
||||
{ "is_automated": false, "name": "wordpress", "is_trusted": false, "is_official": true, "star_count": 582, "description": "The WordPress rich content management system can utilize plugins, widgets, and themes." },
|
||||
{ "is_automated": false, "name": "mysql", "is_trusted": false, "is_official": true, "star_count": 1300, "description": "MySQL is a widely used, open-source relational database management system (RDBMS)." },
|
||||
{ "is_automated": false, "name": "mongo", "is_trusted": false, "is_official": true, "star_count": 1100, "description": "MongoDB document databases provide high availability and easy scalability." },
|
||||
{ "is_automated": false, "name": "centos", "is_trusted": false, "is_official": true, "star_count": 1600, "description": "The official build of CentOS." },
|
||||
{ "is_automated": false, "name": "node", "is_trusted": false, "is_official": true, "star_count": 1200, "description": "Node.js is a JavaScript-based platform for server-side and networking applications." },
|
||||
{ "is_automated": false, "name": "nginx", "is_trusted": false, "is_official": true, "star_count": 1600, "description": "Official build of Nginx." },
|
||||
{ "is_automated": false, "name": "postgres", "is_trusted": false, "is_official": true, "star_count": 1200, "description": "The PostgreSQL object-relational database system provides reliability and data integrity." },
|
||||
{ "is_automated": true, "name": "microsoft/aspnet", "is_trusted": true, "is_official": false, "star_count": 277, "description": "ASP.NET is an open source server-side Web application framework" }
|
||||
{ "is_automated": false, "name": "redis", "is_trusted": false, "is_official": true, "star_count": 1300, "description": localize('vscode-docker.dockerHubSearch.redis', 'Redis is an open source key-value store that functions as a data structure server.') },
|
||||
{ "is_automated": false, "name": "ubuntu", "is_trusted": false, "is_official": true, "star_count": 2600, "description": localize('vscode-docker.dockerHubSearch.ubuntu', 'Ubuntu is a Debian-based Linux operating system based on free software.') },
|
||||
{ "is_automated": false, "name": "wordpress", "is_trusted": false, "is_official": true, "star_count": 582, "description": localize('vscode-docker.dockerHubSearch.wordPress', 'The WordPress rich content management system can utilize plugins, widgets, and themes.') },
|
||||
{ "is_automated": false, "name": "mysql", "is_trusted": false, "is_official": true, "star_count": 1300, "description": localize('vscode-docker.dockerHubSearch.mysql', 'MySQL is a widely used, open-source relational database management system (RDBMS).') },
|
||||
{ "is_automated": false, "name": "mongo", "is_trusted": false, "is_official": true, "star_count": 1100, "description": localize('vscode-docker.dockerHubSearch.mongodb', 'MongoDB document databases provide high availability and easy scalability.') },
|
||||
{ "is_automated": false, "name": "centos", "is_trusted": false, "is_official": true, "star_count": 1600, "description": localize('vscode-docker.dockerHubSearch.centos', 'The official build of CentOS.') },
|
||||
{ "is_automated": false, "name": "node", "is_trusted": false, "is_official": true, "star_count": 1200, "description": localize('vscode-docker.dockerHubSearch.node', 'Node.js is a JavaScript-based platform for server-side and networking applications.') },
|
||||
{ "is_automated": false, "name": "nginx", "is_trusted": false, "is_official": true, "star_count": 1600, "description": localize('vscode-docker.dockerHubSearch.nginx', 'Official build of Nginx.') },
|
||||
{ "is_automated": false, "name": "postgres", "is_trusted": false, "is_official": true, "star_count": 1200, "description": localize('vscode-docker.dockerHubSearch.postgres', 'The PostgreSQL object-relational database system provides reliability and data integrity.') },
|
||||
{ "is_automated": true, "name": "microsoft/aspnet", "is_trusted": true, "is_official": false, "star_count": 277, "description": localize('vscode-docker.dockerHubSearch.aspNet', 'ASP.NET is an open source server-side Web application framework') }
|
||||
];
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/promise-function-async */ // Grandfathered in
|
||||
|
|
|
@ -22,6 +22,7 @@ import composeVersionKeys from './dockerCompose/dockerComposeKeyInfo';
|
|||
import { DockerComposeParser } from './dockerCompose/dockerComposeParser';
|
||||
import { DockerfileCompletionItemProvider } from './dockerfileCompletionItemProvider';
|
||||
import { ext } from './extensionVariables';
|
||||
import { localize } from './localize';
|
||||
import { registerListeners } from './registerListeners';
|
||||
import { registerTaskProviders } from './tasks/TaskHelper';
|
||||
import { registerActiveUseSurvey } from './telemetry/surveys/activeUseSurvey';
|
||||
|
@ -154,8 +155,8 @@ export async function deactivateInternal(ctx: vscode.ExtensionContext): Promise<
|
|||
function validateOldPublisher(activateContext: IActionContext): void {
|
||||
const extension = vscode.extensions.getExtension('PeterJausovec.vscode-docker');
|
||||
if (extension) {
|
||||
let message: string = 'Please reload Visual Studio Code to complete updating the Docker extension.';
|
||||
let reload: vscode.MessageItem = { title: 'Reload Now' };
|
||||
let message: string = localize('vscode-docker.extension.pleaseReload', 'Please reload Visual Studio Code to complete updating the Docker extension.');
|
||||
let reload: vscode.MessageItem = { title: localize('vscode-docker.extension.reloadNow', 'Reload Now') };
|
||||
// Don't wait
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
ext.ui.showWarningMessage(message, reload).then(async result => {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
export const localize: nls.LocalizeFunc = nls.config()();
|
|
@ -6,6 +6,7 @@
|
|||
import * as fse from 'fs-extra';
|
||||
import { Task } from 'vscode';
|
||||
import { DockerPlatform } from '../debugging/DockerPlatformHelper';
|
||||
import { localize } from '../localize';
|
||||
import { cloneObject } from '../utils/cloneObject';
|
||||
import { CommandLineBuilder } from '../utils/commandLineBuilder';
|
||||
import { resolveVariables } from '../utils/resolveVariables';
|
||||
|
@ -70,19 +71,19 @@ export class DockerBuildTaskProvider extends DockerTaskProvider {
|
|||
|
||||
private async validateResolvedDefinition(context: DockerBuildTaskContext, dockerBuild: DockerBuildOptions): Promise<void> {
|
||||
if (!dockerBuild.tag) {
|
||||
throw new Error('No Docker image name was provided or resolved.');
|
||||
throw new Error(localize('vscode-docker.tasks.buildProvider.noDockerImage', 'No Docker image name was provided or resolved.'));
|
||||
}
|
||||
|
||||
if (!dockerBuild.context) {
|
||||
throw new Error('No Docker build context was provided or resolved.');
|
||||
throw new Error(localize('vscode-docker.tasks.buildProvider.noBuildContext', 'No Docker build context was provided or resolved.'));
|
||||
} else if (!await fse.pathExists(resolveVariables(dockerBuild.context, context.folder))) {
|
||||
throw new Error(`The Docker build context \'${dockerBuild.context}\' does not exist or could not be accessed.`);
|
||||
throw new Error(localize('vscode-docker.tasks.buildProvider.invalidBuildContext', 'The Docker build context \'{0}\' does not exist or could not be accessed.', dockerBuild.context));
|
||||
}
|
||||
|
||||
if (!dockerBuild.dockerfile) {
|
||||
throw new Error('No Dockerfile was provided or resolved.');
|
||||
throw new Error(localize('vscode-docker.tasks.buildProvider.noDockerfile', 'No Dockerfile was provided or resolved.'));
|
||||
} else if (!await fse.pathExists(resolveVariables(dockerBuild.dockerfile, context.folder))) {
|
||||
throw new Error(`The Dockerfile \'${dockerBuild.dockerfile}\' does not exist or could not be accessed.`);
|
||||
throw new Error(localize('vscode-docker.tasks.buildProvider.invalidDockerfile', 'The Dockerfile \'{0}\' does not exist or could not be accessed.', dockerBuild.dockerfile));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { Task } from 'vscode';
|
||||
import { DockerPlatform } from '../debugging/DockerPlatformHelper';
|
||||
import { localize } from '../localize';
|
||||
import { cloneObject } from '../utils/cloneObject';
|
||||
import { CommandLineBuilder } from '../utils/commandLineBuilder';
|
||||
import { DockerRunOptions } from './DockerRunTaskDefinitionBase';
|
||||
|
@ -72,7 +73,7 @@ export class DockerRunTaskProvider extends DockerTaskProvider {
|
|||
|
||||
private async validateResolvedDefinition(context: DockerRunTaskContext, dockerRun: DockerRunOptions): Promise<void> {
|
||||
if (!dockerRun.image) {
|
||||
throw new Error('No Docker image name was provided or resolved.');
|
||||
throw new Error(localize('vscode-docker.tasks.runProvider.noDockerImage', 'No Docker image name was provided or resolved.'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { CancellationToken, CustomExecution, ProviderResult, Task, TaskProvider
|
|||
import { callWithTelemetryAndErrorHandling, IActionContext, parseError } from 'vscode-azureextensionui';
|
||||
import { DockerOrchestration } from '../constants';
|
||||
import { DockerPlatform, getPlatform } from '../debugging/DockerPlatformHelper';
|
||||
import { localize } from '../localize';
|
||||
import { DockerBuildTask } from './DockerBuildTaskProvider';
|
||||
import { DockerPseudoterminal } from './DockerPseudoterminal';
|
||||
import { DockerRunTask } from './DockerRunTaskProvider';
|
||||
|
@ -39,7 +40,7 @@ export abstract class DockerTaskProvider implements TaskProvider {
|
|||
actionContext.errorHandling.rethrow = true; // Rethrow to hit the try/catch outside this block.
|
||||
|
||||
if (!context.folder) {
|
||||
throw new Error(`Unable to determine task scope to execute ${this.telemetryName} task '${task.name}'. Please open a workspace folder.`);
|
||||
throw new Error(localize('vscode-docker.tasks.provider.noScope', 'Unable to determine task scope to execute {0} task \'{1}\'. Please open a workspace folder.', this.telemetryName, task.name));
|
||||
}
|
||||
|
||||
context.actionContext = actionContext;
|
||||
|
|
|
@ -9,6 +9,7 @@ import { DebugConfigurationBase } from '../debugging/DockerDebugConfigurationBas
|
|||
import { DockerDebugConfiguration } from '../debugging/DockerDebugConfigurationProvider';
|
||||
import { DockerPlatform } from '../debugging/DockerPlatformHelper';
|
||||
import { ext } from '../extensionVariables';
|
||||
import { localize } from '../localize';
|
||||
import { pathNormalize } from '../utils/pathNormalize';
|
||||
import { resolveVariables } from '../utils/resolveVariables';
|
||||
import { DockerBuildOptions } from './DockerBuildTaskDefinitionBase';
|
||||
|
@ -155,7 +156,7 @@ export async function getOfficialBuildTaskForDockerfile(dockerfile: string, fold
|
|||
return { label: t.name }
|
||||
});
|
||||
|
||||
const item = await ext.ui.showQuickPick(items, { placeHolder: 'Choose the Docker Build definition.' });
|
||||
const item = await ext.ui.showQuickPick(items, { placeHolder: localize('vscode-docker.tasks.helper.chooseBuildDefinition', 'Choose the Docker Build definition.') });
|
||||
return buildTasks.find(t => t.name === item.label);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ import * as os from 'os';
|
|||
import * as path from 'path';
|
||||
import * as process from 'process';
|
||||
import { WorkspaceFolder } from 'vscode';
|
||||
import { parseError } from 'vscode-azureextensionui';
|
||||
import { LocalAspNetCoreSslManager } from '../../debugging/coreclr/LocalAspNetCoreSslManager';
|
||||
import { NetCoreDebugHelper, NetCoreDebugOptions } from '../../debugging/netcore/NetCoreDebugHelper';
|
||||
import { localize } from '../../localize';
|
||||
import { PlatformOS } from '../../utils/platform';
|
||||
import { quickPickProjectFileItem } from '../../utils/quickPickFile';
|
||||
import { resolveVariables, unresolveWorkspaceFolder } from '../../utils/resolveVariables';
|
||||
|
@ -173,8 +175,7 @@ export class NetCoreTaskHelper implements TaskHelper {
|
|||
await updateBlazorManifest(context, runDefinition);
|
||||
}
|
||||
} catch (err) {
|
||||
context.terminal.writeWarningLine('Failed to update Blazor static web assets manifest. Static web assets may not work.');
|
||||
context.terminal.writeWarningLine(`The error was: ${err}`);
|
||||
context.terminal.writeWarningLine(localize('vscode-docker.tasks.netCore.failedBlazorUpdate', 'Failed to update Blazor static web assets manifest. Static web assets may not work.\nThe error was: {0}', parseError(err).message));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -185,7 +186,7 @@ export class NetCoreTaskHelper implements TaskHelper {
|
|||
result = resolveVariables(helperOptions.appProject, folder);
|
||||
} else {
|
||||
// Find a .csproj or .fsproj in the folder
|
||||
const item = await quickPickProjectFileItem(undefined, folder, 'No .NET Core project file (.csproj or .fsproj) could be found.');
|
||||
const item = await quickPickProjectFileItem(undefined, folder, localize('vscode-docker.tasks.netCore.noCsproj', 'No .NET Core project file (.csproj or .fsproj) could be found.'));
|
||||
result = item.absoluteFilePath;
|
||||
}
|
||||
|
||||
|
@ -264,7 +265,7 @@ export class NetCoreTaskHelper implements TaskHelper {
|
|||
programFilesEnvironmentVariable = process.env.ProgramFiles;
|
||||
|
||||
if (programFilesEnvironmentVariable === undefined) {
|
||||
throw new Error('The environment variable \'ProgramFiles\' is not defined. This variable is used to locate the NuGet fallback folder.');
|
||||
throw new Error(localize('vscode-docker.tasks.netCore.programFilesUndefined', 'The environment variable \'ProgramFiles\' is not defined. This variable is used to locate the NuGet fallback folder.'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import { DockerContainerVolume } from '../../debugging/coreclr/CliDockerClient';
|
|||
import LocalOSProvider from "../../debugging/coreclr/LocalOSProvider";
|
||||
import { OSTempFileProvider } from "../../debugging/coreclr/tempFileProvider";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { pathNormalize } from '../../utils/pathNormalize';
|
||||
import { PlatformOS } from '../../utils/platform';
|
||||
import { execAsync } from '../../utils/spawnAsync';
|
||||
|
@ -50,12 +51,12 @@ export async function updateBlazorManifest(context: DockerRunTaskContext, runDef
|
|||
const contents = (await fse.readFile(locationsFile)).toString().split(/\r?\n/ig);
|
||||
|
||||
if (contents.length < 2) {
|
||||
throw new Error('Unable to determine Blazor manifest locations from output file.');
|
||||
throw new Error(localize('vscode-docker.tasks.netCore.noBlazorManifest1', 'Unable to determine Blazor manifest locations from output file.'));
|
||||
}
|
||||
|
||||
await transformBlazorManifest(context, contents[0].trim(), contents[1].trim(), runDefinition.dockerRun.volumes, runDefinition.dockerRun.os);
|
||||
} else {
|
||||
throw new Error('Unable to determine Blazor manifest locations from output file.')
|
||||
throw new Error(localize('vscode-docker.tasks.netCore.noBlazorManifest2', 'Unable to determine Blazor manifest locations from output file.'))
|
||||
}
|
||||
} finally {
|
||||
if (await fse.pathExists(locationsFile)) {
|
||||
|
@ -76,13 +77,13 @@ async function transformBlazorManifest(context: DockerRunTaskContext, inputManif
|
|||
|
||||
os = os || 'Linux';
|
||||
|
||||
context.terminal.writeOutputLine('Attempting to containerize Blazor static web assets manifest...');
|
||||
context.terminal.writeOutputLine(localize('vscode-docker.tasks.netCore.attemptingBlazorContainerize', 'Attempting to containerize Blazor static web assets manifest...'));
|
||||
|
||||
const contents = (await fse.readFile(inputManifest)).toString();
|
||||
const manifest: Manifest = <Manifest>await xml2js.parseStringPromise(contents);
|
||||
|
||||
if (!manifest || !manifest.StaticWebAssets) {
|
||||
throw new Error('Failed to parse Blazor static web assets manifest.');
|
||||
throw new Error(localize('vscode-docker.tasks.netCore.failedBlazorManifest', 'Failed to parse Blazor static web assets manifest.'));
|
||||
}
|
||||
|
||||
for (const contentRoot of manifest.StaticWebAssets.ContentRoot) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import * as os from 'os';
|
|||
import * as path from 'path';
|
||||
import * as vscode from "vscode";
|
||||
import CliDockerClient from '../../debugging/coreclr/CliDockerClient';
|
||||
import { localize } from '../../localize';
|
||||
import { delay } from '../../utils/delay';
|
||||
import { PythonDefaultDebugPort, PythonTarget } from '../../utils/pythonUtils';
|
||||
|
||||
|
@ -24,7 +25,7 @@ export namespace PythonExtensionHelper {
|
|||
return { 'PTVSD_LOG_DIR': '/dbglogs' };
|
||||
}
|
||||
|
||||
export function getDebuggerLogFilePath(folderName: string) : string {
|
||||
export function getDebuggerLogFilePath(folderName: string): string {
|
||||
// The debugger generates the log file with the name in this format: ptvsd-{pid}.log,
|
||||
// So given that we run the debugger as the entry point, then the PID is guaranteed to be 1.
|
||||
return path.join(os.tmpdir(), folderName, 'ptvsd-1.log');
|
||||
|
@ -40,7 +41,7 @@ export namespace PythonExtensionHelper {
|
|||
const containerRunning = await cliDockerClient.inspectObject(containerName, { format: '{{.State.Running}}' });
|
||||
|
||||
if (containerRunning === 'false') {
|
||||
reject('Failed to attach the debugger, please see the terminal output for more details.');
|
||||
reject(localize('vscode-docker.tasks.pythonExt.failedToAttach', 'Failed to attach the debugger, please see the terminal output for more details.'));
|
||||
}
|
||||
|
||||
const maxRetriesCount = 20;
|
||||
|
@ -65,14 +66,15 @@ export namespace PythonExtensionHelper {
|
|||
if (created) {
|
||||
resolve();
|
||||
} else {
|
||||
reject('Failed to attach the debugger within the alotted timeout.');
|
||||
reject(localize('vscode-docker.tasks.pythonExt.attachTimeout', 'Failed to attach the debugger within the alotted timeout.'));
|
||||
}
|
||||
} catch {
|
||||
reject('An unexpected error occurred while attempting to attach the debugger.');
|
||||
reject(localize('vscode-docker.tasks.pythonExt.unexpectedAttachError', 'An unexpected error occurred while attempting to attach the debugger.'));
|
||||
} finally {
|
||||
listener.dispose();
|
||||
}
|
||||
}});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -84,7 +86,7 @@ export namespace PythonExtensionHelper {
|
|||
} else if ('module' in target) {
|
||||
fullTarget = `-m ${target.module}`;
|
||||
} else {
|
||||
throw new Error('One of either module or file must be provided.');
|
||||
throw new Error(localize('vscode-docker.tasks.pythonExt.moduleOrFile', 'One of either module or file must be provided.'));
|
||||
}
|
||||
|
||||
options = options ?? {};
|
||||
|
@ -99,12 +101,12 @@ export namespace PythonExtensionHelper {
|
|||
export async function getLauncherFolderPath(): Promise<string> {
|
||||
const pyExtensionId = 'ms-python.python';
|
||||
const pyExt = vscode.extensions.getExtension(pyExtensionId);
|
||||
const button = localize('vscode-docker.tasks.pythonExt.openExtension', 'Open Extension');
|
||||
|
||||
if (!pyExt) {
|
||||
const response = await vscode.window.showErrorMessage('For debugging Python apps in a container to work, the Python extension must be installed.',
|
||||
"Open extension");
|
||||
const response = await vscode.window.showErrorMessage(localize('vscode-docker.tasks.pythonExt.pythonExtensionNeeded', 'For debugging Python apps in a container to work, the Python extension must be installed.'), button);
|
||||
|
||||
if (response === "Open extension") {
|
||||
if (response === button) {
|
||||
await vscode.commands.executeCommand('extension.open', pyExtensionId);
|
||||
}
|
||||
|
||||
|
@ -125,6 +127,6 @@ export namespace PythonExtensionHelper {
|
|||
return newDebugger;
|
||||
}
|
||||
|
||||
throw new Error('Unable to find the debugger in the Python extension.');
|
||||
throw new Error(localize('vscode-docker.tasks.pythonExt.noDebugger', 'Unable to find the debugger in the Python extension.'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { ext } from 'vscode-azureappservice/out/src/extensionVariables';
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { ITelemetryPublisher } from '../TelemetryPublisher';
|
||||
|
||||
const surveyUrl = 'https://aka.ms/vscodedockeractiveusesurvey';
|
||||
|
@ -35,9 +36,9 @@ function select25Percent(): boolean {
|
|||
}
|
||||
|
||||
async function surveyPrompt(): Promise<boolean> {
|
||||
const prompt = 'We noticed you haven’t used the Docker extension lately, would you take a quick survey?';
|
||||
const yes = { title: 'Yes' };
|
||||
const no = { title: 'No' };
|
||||
const prompt = localize('vscode-docker.survey.active.prompt', 'We noticed you haven’t used the Docker extension lately, would you take a quick survey?');
|
||||
const yes = { title: localize('vscode-docker.survey.active.yes', 'Yes') };
|
||||
const no = { title: localize('vscode-docker.survey.active.no', 'No') };
|
||||
|
||||
const result = (await vscode.window.showInformationMessage(prompt, yes, no)) ?? no;
|
||||
|
||||
|
@ -49,7 +50,7 @@ async function surveyOpen(): Promise<void> {
|
|||
}
|
||||
|
||||
function tryUpdate(state: vscode.Memento, key: string, value: unknown): void {
|
||||
state.update(lastUseDateKey, value).then(() => {}, () => {});
|
||||
state.update(lastUseDateKey, value).then(() => { }, () => { });
|
||||
}
|
||||
|
||||
function sendSurveyTelemetryEvent(eventName: string, properties?: { [key: string]: string }): void {
|
||||
|
|
|
@ -7,6 +7,7 @@ import { ConfigurationChangeEvent, ConfigurationTarget, TreeView, TreeViewVisibi
|
|||
import { AzExtParentTreeItem, AzExtTreeItem, AzureWizard, GenericTreeItem, IActionContext, InvalidTreeItem, registerEvent } from "vscode-azureextensionui";
|
||||
import { configPrefix } from "../constants";
|
||||
import { ext } from "../extensionVariables";
|
||||
import { localize } from "../localize";
|
||||
import { DockerExtensionKind, getVSCodeRemoteInfo, IVSCodeRemoteInfo, RemoteKind } from "../utils/getVSCodeRemoteInfo";
|
||||
import { getThemedIconPath } from "./IconPath";
|
||||
import { LocalGroupTreeItemBase } from "./LocalGroupTreeItemBase";
|
||||
|
@ -113,7 +114,7 @@ export abstract class LocalRootTreeItemBase<TItem extends ILocalItem, TProperty
|
|||
if (this._currentItems.length === 0) {
|
||||
context.telemetry.properties.noItems = 'true';
|
||||
return [new GenericTreeItem(this, {
|
||||
label: "Successfully connected, but no items found.",
|
||||
label: localize('vscode-docker.tree.noItemsFound', 'Successfully connected, but no items found.'),
|
||||
iconPath: getThemedIconPath('info'),
|
||||
contextValue: 'dockerNoItems'
|
||||
})];
|
||||
|
@ -227,31 +228,31 @@ export abstract class LocalRootTreeItemBase<TItem extends ILocalItem, TProperty
|
|||
public getSettingWizardInfoList(): ITreeSettingWizardInfo[] {
|
||||
return [
|
||||
{
|
||||
label: 'Label',
|
||||
label: localize('vscode-docker.tree.config.label.label', 'Label'),
|
||||
setting: labelKey,
|
||||
currentValue: this.labelSetting,
|
||||
description: 'The primary property to display.',
|
||||
description: localize('vscode-docker.tree.config.label.description', 'The primary property to display.'),
|
||||
settingInfo: this.labelSettingInfo
|
||||
},
|
||||
{
|
||||
label: 'Description',
|
||||
label: localize('vscode-docker.tree.config.description.label', 'Description'),
|
||||
setting: descriptionKey,
|
||||
currentValue: this.descriptionSetting,
|
||||
description: 'Any secondary properties to display.',
|
||||
description: localize('vscode-docker.tree.config.description.description', 'Any secondary properties to display.'),
|
||||
settingInfo: this.descriptionSettingInfo
|
||||
},
|
||||
{
|
||||
label: 'Group By',
|
||||
label: localize('vscode-docker.tree.config.groupBy.label', 'Group By'),
|
||||
setting: groupByKey,
|
||||
currentValue: this.groupBySetting,
|
||||
description: 'The property used for grouping.',
|
||||
description: localize('vscode-docker.tree.config.groupBy.description', 'The property used for grouping.'),
|
||||
settingInfo: this.groupBySettingInfo
|
||||
},
|
||||
{
|
||||
label: 'Sort By',
|
||||
label: localize('vscode-docker.tree.config.sortBy.label', 'Sort By'),
|
||||
setting: sortByKey,
|
||||
currentValue: this.sortBySetting,
|
||||
description: 'The property used for sorting.',
|
||||
description: localize('vscode-docker.tree.config.sortBy.description', 'The property used for sorting.'),
|
||||
settingInfo: this.sortBySettingInfo
|
||||
},
|
||||
]
|
||||
|
@ -286,17 +287,17 @@ export abstract class LocalRootTreeItemBase<TItem extends ILocalItem, TProperty
|
|||
}
|
||||
|
||||
private getDockerErrorTreeItems(context: IActionContext, error: unknown): AzExtTreeItem[] {
|
||||
const connectionMessage = 'Failed to connect. Is Docker installed and running?';
|
||||
const connectionMessage = localize('vscode-docker.tree.failedToConnectMessage', 'Failed to connect. Is Docker installed and running?');
|
||||
|
||||
const result: AzExtTreeItem[] = [
|
||||
new InvalidTreeItem(this, error, { label: connectionMessage, contextValue: 'dockerConnectionError', description: '' }),
|
||||
new OpenUrlTreeItem(this, 'Install Docker...', 'https://aka.ms/AA37qtj'),
|
||||
new OpenUrlTreeItem(this, 'Additional Troubleshooting...', 'https://aka.ms/AA37qt2'),
|
||||
new OpenUrlTreeItem(this, localize('vscode-docker.tree.installDocker', 'Install Docker...'), 'https://aka.ms/AA37qtj'),
|
||||
new OpenUrlTreeItem(this, localize('vscode-docker.tree.additionalTroubleshooting', 'Additional Troubleshooting...'), 'https://aka.ms/AA37qt2'),
|
||||
];
|
||||
|
||||
const remoteInfo: IVSCodeRemoteInfo = getVSCodeRemoteInfo(context);
|
||||
if (remoteInfo.extensionKind === DockerExtensionKind.workspace && remoteInfo.remoteKind === RemoteKind.devContainer) {
|
||||
const ti = new OpenUrlTreeItem(this, 'Running Docker in a dev container...', 'https://aka.ms/AA5xva6');
|
||||
const ti = new OpenUrlTreeItem(this, localize('vscode-docker.tree.runningInDevContainer', 'Running Docker in a dev container...'), 'https://aka.ms/AA5xva6');
|
||||
result.push(ti);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { getImagePropertyValue } from "../images/ImageProperties";
|
||||
import { LocalChildGroupType, LocalChildType, LocalRootTreeItemBase } from "../LocalRootTreeItemBase";
|
||||
import { CommonGroupBy, groupByNoneProperty } from "../settings/CommonProperties";
|
||||
|
@ -15,8 +16,8 @@ import { LocalContainerInfo } from "./LocalContainerInfo";
|
|||
|
||||
export class ContainersTreeItem extends LocalRootTreeItemBase<LocalContainerInfo, ContainerProperty> {
|
||||
public treePrefix: string = 'containers';
|
||||
public label: string = 'Containers';
|
||||
public configureExplorerTitle: string = 'Configure containers explorer';
|
||||
public label: string = localize('vscode-docker.tree.containers.label', 'Containers');
|
||||
public configureExplorerTitle: string = localize('vscode-docker.tree.containers.configure', 'Configure containers explorer');
|
||||
|
||||
public childType: LocalChildType<LocalContainerInfo> = ContainerTreeItem;
|
||||
public childGroupType: LocalChildGroupType<LocalContainerInfo, ContainerProperty> = ContainerGroupTreeItem;
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Image } from 'dockerode';
|
|||
import { window } from 'vscode';
|
||||
import { AzExtParentTreeItem, AzExtTreeItem, IActionContext, IParsedError, parseError } from "vscode-azureextensionui";
|
||||
import { ext } from '../../extensionVariables';
|
||||
import { localize } from '../../localize';
|
||||
import { callDockerodeWithErrorHandling } from '../../utils/callDockerodeWithErrorHandling';
|
||||
import { getThemedIconPath, IconPath } from '../IconPath';
|
||||
import { ILocalImageInfo } from './LocalImageInfo';
|
||||
|
@ -72,7 +73,7 @@ export class ImageTreeItem extends AzExtTreeItem {
|
|||
// error code 409 is returned for conflicts like the image is used by a running container or another image.
|
||||
// Such errors are not really an error, it should be treated as warning.
|
||||
if (parsedError.errorType === '409') {
|
||||
ext.outputChannel.appendLog('Warning: ' + parsedError.message);
|
||||
ext.outputChannel.appendLog(localize('vscode-docker.tree.images.warning', 'Warning: {0}', parsedError.message));
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
window.showWarningMessage(parsedError.message);
|
||||
} else {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { ImageInfo } from "dockerode";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { LocalChildGroupType, LocalChildType, LocalRootTreeItemBase } from "../LocalRootTreeItemBase";
|
||||
import { CommonGroupBy, groupByNoneProperty } from "../settings/CommonProperties";
|
||||
import { ITreeArraySettingInfo, ITreeSettingInfo } from "../settings/ITreeSettingInfo";
|
||||
|
@ -15,8 +16,8 @@ import { ILocalImageInfo, LocalImageInfo } from "./LocalImageInfo";
|
|||
|
||||
export class ImagesTreeItem extends LocalRootTreeItemBase<ILocalImageInfo, ImageProperty> {
|
||||
public treePrefix: string = 'images';
|
||||
public label: string = 'Images';
|
||||
public configureExplorerTitle: string = 'Configure images explorer';
|
||||
public label: string = localize('vscode-docker.tree.images.label', 'Images');
|
||||
public configureExplorerTitle: string = localize('vscode-docker.tree.images.configure', 'Configure images explorer');
|
||||
|
||||
public childType: LocalChildType<ILocalImageInfo> = ImageTreeItem;
|
||||
public childGroupType: LocalChildGroupType<ILocalImageInfo, ImageProperty> = ImageGroupTreeItem;
|
||||
|
|
|
@ -7,6 +7,7 @@ import { NetworkInspectInfo } from "dockerode";
|
|||
import { workspace } from "vscode";
|
||||
import { builtInNetworks, configPrefix } from "../../constants";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { LocalChildGroupType, LocalChildType, LocalRootTreeItemBase } from "../LocalRootTreeItemBase";
|
||||
import { CommonGroupBy, getCommonPropertyValue, groupByNoneProperty } from "../settings/CommonProperties";
|
||||
import { ITreeArraySettingInfo, ITreeSettingInfo } from "../settings/ITreeSettingInfo";
|
||||
|
@ -17,8 +18,8 @@ import { NetworkTreeItem } from "./NetworkTreeItem";
|
|||
|
||||
export class NetworksTreeItem extends LocalRootTreeItemBase<LocalNetworkInfo, NetworkProperty> {
|
||||
public treePrefix: string = 'networks';
|
||||
public label: string = 'Networks';
|
||||
public configureExplorerTitle: string = 'Configure networks explorer';
|
||||
public label: string = localize('vscode-docker.tree.networks.label', 'Networks');
|
||||
public configureExplorerTitle: string = localize('vscode-docker.tree.networks.configure', 'Configure networks explorer');
|
||||
public childType: LocalChildType<LocalNetworkInfo> = NetworkTreeItem;
|
||||
public childGroupType: LocalChildGroupType<LocalNetworkInfo, NetworkProperty> = NetworkGroupTreeItem;
|
||||
|
||||
|
|
|
@ -4,12 +4,13 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { AzExtParentTreeItem, AzExtTreeItem, IActionContext } from "vscode-azureextensionui";
|
||||
import { localize } from '../../localize';
|
||||
import { getThemedIconPath, IconPath } from "../IconPath";
|
||||
|
||||
export class ConnectedRegistriesTreeItem extends AzExtParentTreeItem {
|
||||
public contextValue: string = 'connectedRegistries';
|
||||
public childTypeLabel: string = 'registry';
|
||||
public label: string = 'Connected Registries';
|
||||
public label: string = localize('vscode-docker.tree.registries.connectedRegistriesLabel', 'Connected Registries');
|
||||
public children: AzExtTreeItem[] = [];
|
||||
|
||||
public get iconPath(): IconPath {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { AzExtParentTreeItem, AzExtTreeItem, AzureWizard, GenericTreeItem, IActionContext, IAzureQuickPickItem, UserCancelledError } from "vscode-azureextensionui";
|
||||
import { AzExtParentTreeItem, AzExtTreeItem, AzureWizard, GenericTreeItem, IActionContext, IAzureQuickPickItem, parseError, UserCancelledError } from "vscode-azureextensionui";
|
||||
import { ext } from "../../extensionVariables";
|
||||
import { localize } from '../../localize';
|
||||
import { openExternal } from "../../utils/openExternal";
|
||||
import { getThemedIconPath } from "../IconPath";
|
||||
import { getRegistryProviders } from "./all/getRegistryProviders";
|
||||
|
@ -24,7 +25,7 @@ const providersKey = 'docker.registryProviders';
|
|||
export class RegistriesTreeItem extends AzExtParentTreeItem {
|
||||
public static contextValue: string = 'registries';
|
||||
public contextValue: string = RegistriesTreeItem.contextValue;
|
||||
public label: string = 'Registries';
|
||||
public label: string = localize('vscode-docker.tree.registries.registriesLabel', 'Registries');
|
||||
public childTypeLabel: string = 'registry provider';
|
||||
public autoSelectInTreeItemPicker: boolean = true;
|
||||
public _connectedRegistriesTreeItem: ConnectedRegistriesTreeItem;
|
||||
|
@ -40,7 +41,7 @@ export class RegistriesTreeItem extends AzExtParentTreeItem {
|
|||
public async loadMoreChildrenImpl(_clearCache: boolean, context: IActionContext): Promise<AzExtTreeItem[]> {
|
||||
if (this._cachedProviders.length === 0) {
|
||||
return [new GenericTreeItem(this, {
|
||||
label: 'Connect Registry...',
|
||||
label: localize('vscode-docker.tree.registries.connectRegistry', 'Connect Registry...'),
|
||||
contextValue: 'connectRegistry',
|
||||
iconPath: getThemedIconPath('connect'),
|
||||
includeInTreeItemPicker: true,
|
||||
|
@ -54,7 +55,7 @@ export class RegistriesTreeItem extends AzExtParentTreeItem {
|
|||
cachedProvider => {
|
||||
const provider = getRegistryProviders().find(rp => rp.id === cachedProvider.id);
|
||||
if (!provider) {
|
||||
throw new Error(`Failed to find registry provider with id "${cachedProvider.id}".`);
|
||||
throw new Error(localize('vscode-docker.tree.registries.noProvider', 'Failed to find registry provider with id "{0}".', cachedProvider.id));
|
||||
}
|
||||
|
||||
const parent = provider.isSingleRegistry ? this._connectedRegistriesTreeItem : this;
|
||||
|
@ -87,11 +88,11 @@ export class RegistriesTreeItem extends AzExtParentTreeItem {
|
|||
})
|
||||
picks = picks.sort((p1, p2) => p1.label.localeCompare(p2.label));
|
||||
picks.push({
|
||||
label: "$(link-external) Don't see your provider? Learn how to contribute...",
|
||||
label: localize('vscode-docker.tree.registries.contribute', '$(link-external) Don\'t see your provider? Learn how to contribute...'),
|
||||
data: undefined
|
||||
});
|
||||
|
||||
let placeHolder: string = 'Select the provider for your registry';
|
||||
let placeHolder: string = localize('vscode-docker.tree.registries.selectProvider', 'Select the provider for your registry');
|
||||
provider = provider ?? (await ext.ui.showQuickPick(picks, { placeHolder, suppressPersistence: true })).data;
|
||||
if (!provider) {
|
||||
await openExternal('https://aka.ms/AA5g7n7');
|
||||
|
@ -100,7 +101,7 @@ export class RegistriesTreeItem extends AzExtParentTreeItem {
|
|||
} else if (provider.onlyOneAllowed && this._cachedProviders.find(c => c.id === provider.id)) {
|
||||
// Don't wait, no input to wait for anyway
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
ext.ui.showWarningMessage(`The "${provider.label}" registry provider is already connected.`);
|
||||
ext.ui.showWarningMessage(localize('vscode-docker.tree.registries.providerConnected', 'The "{0}" registry provider is already connected.', provider.label));
|
||||
context.telemetry.properties.cancelStep = 'registryProviderAlreadyAdded';
|
||||
throw new UserCancelledError();
|
||||
}
|
||||
|
@ -147,10 +148,10 @@ export class RegistriesTreeItem extends AzExtParentTreeItem {
|
|||
let label: string = (provider && provider.label) || crp.id;
|
||||
let descriptions: string[] = [];
|
||||
if (crp.username) {
|
||||
descriptions.push(`Username: "${crp.username}"`)
|
||||
descriptions.push(localize('vscode-docker.tree.registries.usernameDesc', 'Username: "{0}"', crp.username))
|
||||
}
|
||||
if (crp.url) {
|
||||
descriptions.push(`URL: "${crp.url}"`)
|
||||
descriptions.push(localize('vscode-docker.tree.registries.urlDesc', 'URL: "{0}"', crp.url))
|
||||
}
|
||||
return {
|
||||
label,
|
||||
|
@ -159,7 +160,7 @@ export class RegistriesTreeItem extends AzExtParentTreeItem {
|
|||
data: crp
|
||||
}
|
||||
});
|
||||
const placeHolder: string = 'Select the registry to disconnect';
|
||||
const placeHolder: string = localize('vscode-docker.tree.registries.selectDisconnect', 'Select the registry to disconnect');
|
||||
cachedProvider = (await ext.ui.showQuickPick(picks, { placeHolder, suppressPersistence: true })).data;
|
||||
}
|
||||
|
||||
|
@ -173,7 +174,7 @@ export class RegistriesTreeItem extends AzExtParentTreeItem {
|
|||
} catch (err) {
|
||||
// Don't wait, no input to wait for anyway
|
||||
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
|
||||
ext.ui.showWarningMessage(`The registry password could not be removed from the cache: ${err}`);
|
||||
ext.ui.showWarningMessage(localize('vscode-docker.tree.registries.disconnectError', 'The registry password could not be removed from the cache: {0}', parseError(err).message));
|
||||
}
|
||||
|
||||
const index = this._cachedProviders.findIndex(n => n === cachedProvider);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { ContainerRegistryManagementModels as AcrModels } from "azure-arm-containerregistry";
|
||||
import { AzExtParentTreeItem, AzExtTreeItem, GenericTreeItem, IActionContext } from "vscode-azureextensionui";
|
||||
import { localize } from '../../../localize';
|
||||
import { nonNullValue, nonNullValueAndProp } from "../../../utils/nonNull";
|
||||
import { getThemedIconPath, IconPath } from "../../IconPath";
|
||||
import { AzureRegistryTreeItem } from "./AzureRegistryTreeItem";
|
||||
|
@ -34,7 +35,7 @@ export class AzureTaskTreeItem extends AzExtParentTreeItem {
|
|||
}
|
||||
|
||||
public get label(): string {
|
||||
return this._task ? this.taskName : 'Runs without a task';
|
||||
return this._task ? this.taskName : localize('vscode-docker.tree.registries.azure.runsWithoutTask', 'Runs without a task');
|
||||
}
|
||||
|
||||
public get id(): string | undefined {
|
||||
|
@ -70,7 +71,7 @@ export class AzureTaskTreeItem extends AzExtParentTreeItem {
|
|||
|
||||
if (clearCache && runListResult.length === 0 && this._task) {
|
||||
const ti = new GenericTreeItem(this, {
|
||||
label: 'Run task...',
|
||||
label: localize('vscode-docker.tree.registries.azure.runTask', 'Run task...'),
|
||||
commandId: 'vscode-docker.registries.azure.runTask',
|
||||
contextValue: 'runTask'
|
||||
});
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { ContainerRegistryManagementModels as AcrModels } from "azure-arm-containerregistry";
|
||||
import { AzExtParentTreeItem, AzExtTreeItem, IActionContext } from "vscode-azureextensionui";
|
||||
import { localize } from '../../../localize';
|
||||
import { getThemedIconPath, IconPath } from "../../IconPath";
|
||||
import { OpenUrlTreeItem } from "../../OpenUrlTreeItem";
|
||||
import { AzureRegistryTreeItem } from "./AzureRegistryTreeItem";
|
||||
|
@ -41,7 +42,7 @@ export class AzureTasksTreeItem extends AzExtParentTreeItem {
|
|||
this._nextLink = taskListResult.nextLink;
|
||||
|
||||
if (clearCache && taskListResult.length === 0) {
|
||||
return [new OpenUrlTreeItem(this, 'Learn how to create a build task...', 'https://aka.ms/acr/task')]
|
||||
return [new OpenUrlTreeItem(this, localize('vscode-docker.tree.registries.azure.learnBuildTask', 'Learn how to create a build task...'), 'https://aka.ms/acr/task')]
|
||||
} else {
|
||||
let result: AzExtTreeItem[] = await this.createTreeItemsWithErrorHandling(
|
||||
taskListResult,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { ContainerRegistryManagementClient, ContainerRegistryManagementModels as AcrModels } from 'azure-arm-containerregistry';
|
||||
import { window } from 'vscode';
|
||||
import { AzExtTreeItem, AzureWizard, createAzureClient, IActionContext, ICreateChildImplContext, LocationListStep, ResourceGroupListStep, SubscriptionTreeItemBase } from "vscode-azureextensionui";
|
||||
import { localize } from '../../../localize';
|
||||
import { nonNullProp } from '../../../utils/nonNull';
|
||||
import { ICachedRegistryProvider } from "../ICachedRegistryProvider";
|
||||
import { IRegistryProviderTreeItem } from "../IRegistryProviderTreeItem";
|
||||
|
@ -65,7 +66,7 @@ export class SubscriptionTreeItem extends SubscriptionTreeItemBase implements IR
|
|||
executeSteps: [
|
||||
new AzureRegistryCreateStep()
|
||||
],
|
||||
title: 'Create new Azure Container Registry'
|
||||
title: localize('vscode-docker.tree.registries.azure.createNew', 'Create new Azure Container Registry')
|
||||
});
|
||||
|
||||
await wizard.prompt();
|
||||
|
|
|
@ -7,6 +7,7 @@ import { ContainerRegistryManagementClient } from 'azure-arm-containerregistry';
|
|||
import { Progress } from 'vscode';
|
||||
import { AzureWizardExecuteStep, createAzureClient } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../../extensionVariables';
|
||||
import { localize } from '../../../../localize';
|
||||
import { nonNullProp } from '../../../../utils/nonNull';
|
||||
import { IAzureRegistryWizardContext } from './IAzureRegistryWizardContext';
|
||||
|
||||
|
@ -17,7 +18,7 @@ export class AzureRegistryCreateStep extends AzureWizardExecuteStep<IAzureRegist
|
|||
const newRegistryName = nonNullProp(context, 'newRegistryName');
|
||||
|
||||
const client = createAzureClient(context, ContainerRegistryManagementClient);
|
||||
const creating: string = `Creating registry "${newRegistryName}"...`;
|
||||
const creating: string = localize('vscode-docker.tree.registries.azure.createWizard.creating', 'Creating registry "{0}"...', newRegistryName);
|
||||
ext.outputChannel.appendLine(creating);
|
||||
progress.report({ message: creating });
|
||||
|
||||
|
@ -34,7 +35,7 @@ export class AzureRegistryCreateStep extends AzureWizardExecuteStep<IAzureRegist
|
|||
}
|
||||
);
|
||||
|
||||
const created = `Successfully created registry "${newRegistryName}".`;
|
||||
const created = localize('vscode-docker.tree.registries.azure.createWizard.created', 'Successfully created registry "{0}".', newRegistryName);
|
||||
ext.outputChannel.appendLine(created);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { ContainerRegistryManagementClient } from 'azure-arm-containerregistry';
|
||||
import { AzureNameStep, createAzureClient, ResourceGroupListStep, resourceGroupNamingRules } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../../extensionVariables';
|
||||
import { localize } from '../../../../localize';
|
||||
import { IAzureRegistryWizardContext } from './IAzureRegistryWizardContext';
|
||||
|
||||
export class AzureRegistryNameStep extends AzureNameStep<IAzureRegistryWizardContext> {
|
||||
|
@ -16,8 +17,8 @@ export class AzureRegistryNameStep extends AzureNameStep<IAzureRegistryWizardCon
|
|||
public async prompt(context: IAzureRegistryWizardContext): Promise<void> {
|
||||
const client = createAzureClient(context, ContainerRegistryManagementClient);
|
||||
context.newRegistryName = (await ext.ui.showInputBox({
|
||||
placeHolder: "Registry name",
|
||||
prompt: "Provide a registry name",
|
||||
placeHolder: localize('vscode-docker.tree.registries.azure.createWizard.name', 'Registry name'),
|
||||
prompt: localize('vscode-docker.tree.registries.azure.createWizard.namePrompt', 'Provide a registry name'),
|
||||
/* eslint-disable-next-line @typescript-eslint/promise-function-async */
|
||||
validateInput: (name: string) => validateRegistryName(name, client)
|
||||
})).trim();
|
||||
|
@ -36,9 +37,9 @@ async function validateRegistryName(name: string, client: ContainerRegistryManag
|
|||
const min = 5;
|
||||
const max = 50;
|
||||
if (name.length < min || name.length > max) {
|
||||
return `The name must be between ${min} and ${max} characters.`;
|
||||
return localize('vscode-docker.tree.registries.azure.createWizard.nameLength', 'The name must be between {0} and {1} characters.', min, max);
|
||||
} else if (name.match(/[^a-z0-9]/i)) {
|
||||
return "The name can only contain alphanumeric characters.";
|
||||
return localize('vscode-docker.tree.registries.azure.createWizard.nameAlphanumeric', 'The name can only contain alphanumeric characters.');
|
||||
} else {
|
||||
const nameStatus = await client.registries.checkNameAvailability({ name });
|
||||
return nameStatus.message;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { AzureWizardPromptStep, IAzureQuickPickItem } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../../extensionVariables';
|
||||
import { localize } from '../../../../localize';
|
||||
import { IAzureRegistryWizardContext } from './IAzureRegistryWizardContext';
|
||||
|
||||
export class AzureRegistrySkuStep extends AzureWizardPromptStep<IAzureRegistryWizardContext> {
|
||||
|
@ -12,7 +13,7 @@ export class AzureRegistrySkuStep extends AzureWizardPromptStep<IAzureRegistryWi
|
|||
const skus = ["Basic", "Standard", "Premium"];
|
||||
const picks: IAzureQuickPickItem<string>[] = skus.map(s => { return { label: s, data: s }; });
|
||||
|
||||
const placeHolder: string = 'Select a SKU';
|
||||
const placeHolder: string = localize('vscode-docker.tree.registries.azure.createWizard.selectSku', 'Select a SKU');
|
||||
context.newRegistrySku = (await ext.ui.showQuickPick(picks, { placeHolder })).data;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
|
||||
import { AzureWizardPromptStep } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../extensionVariables';
|
||||
import { localize } from '../../../localize';
|
||||
import { IConnectRegistryWizardContext } from './IConnectRegistryWizardContext';
|
||||
|
||||
export class RegistryPasswordStep extends AzureWizardPromptStep<IConnectRegistryWizardContext> {
|
||||
public async prompt(context: IConnectRegistryWizardContext): Promise<void> {
|
||||
const prompt: string = context.passwordPrompt || "Enter your password";
|
||||
const prompt: string = context.passwordPrompt || localize('vscode-docker.tree.registries.connectWizard.enterPassword', 'Enter your password');
|
||||
context.password = await ext.ui.showInputBox({ prompt, validateInput, password: true });
|
||||
}
|
||||
|
||||
|
@ -20,7 +21,7 @@ export class RegistryPasswordStep extends AzureWizardPromptStep<IConnectRegistry
|
|||
|
||||
function validateInput(value: string | undefined): string | undefined {
|
||||
if (!value) {
|
||||
return "Password cannot be empty."
|
||||
return localize('vscode-docker.tree.registries.connectWizard.passwordEmpty', 'Password cannot be empty.')
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
import { URL } from 'url';
|
||||
import { AzureWizardPromptStep } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../extensionVariables';
|
||||
import { localize } from '../../../localize';
|
||||
import { IConnectRegistryWizardContext } from './IConnectRegistryWizardContext';
|
||||
|
||||
export class RegistryUrlStep extends AzureWizardPromptStep<IConnectRegistryWizardContext> {
|
||||
public async prompt(context: IConnectRegistryWizardContext): Promise<void> {
|
||||
const prompt: string = context.urlPrompt || "Enter the URL for the registry provider";
|
||||
const placeHolder: string = "Example: http://localhost:5000";
|
||||
const prompt: string = context.urlPrompt || localize('vscode-docker.tree.registries.connectWizard.enterUrl', 'Enter the URL for the registry provider');
|
||||
const placeHolder: string = localize('vscode-docker.tree.registries.connectWizard.exampleUrl', 'Example: http://localhost:5000');
|
||||
context.url = (await ext.ui.showInputBox({
|
||||
prompt,
|
||||
placeHolder,
|
||||
|
@ -25,7 +26,7 @@ export class RegistryUrlStep extends AzureWizardPromptStep<IConnectRegistryWizar
|
|||
|
||||
private validateUrl(context: IConnectRegistryWizardContext, value: string): string | undefined {
|
||||
if (!value) {
|
||||
return "URL cannot be empty.";
|
||||
return localize('vscode-docker.tree.registries.connectWizard.urlEmpty', 'URL cannot be empty.');
|
||||
} else {
|
||||
let protocol: string | undefined;
|
||||
let host: string | undefined;
|
||||
|
@ -38,9 +39,9 @@ export class RegistryUrlStep extends AzureWizardPromptStep<IConnectRegistryWizar
|
|||
}
|
||||
|
||||
if (!protocol || !host) {
|
||||
return "Please enter a valid URL";
|
||||
return localize('vscode-docker.tree.registries.connectWizard.validUrl', 'Please enter a valid URL');
|
||||
} else if (context.existingProviders.find(rp => rp.url === value)) {
|
||||
return `URL "${value}" is already connected.`;
|
||||
return localize('vscode-docker.tree.registries.connectWizard.urlConnected', 'URL "{0}" is already connected.', value);
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
import { InputBoxOptions } from 'vscode';
|
||||
import { AzureWizardPromptStep } from 'vscode-azureextensionui';
|
||||
import { ext } from '../../../extensionVariables';
|
||||
import { localize } from '../../../localize';
|
||||
import { IConnectRegistryWizardContext } from './IConnectRegistryWizardContext';
|
||||
|
||||
export class RegistryUsernameStep extends AzureWizardPromptStep<IConnectRegistryWizardContext> {
|
||||
public async prompt(context: IConnectRegistryWizardContext): Promise<void> {
|
||||
let prompt: string = context.usernamePrompt || (context.isUsernameOptional ? "Enter your username, or press 'Enter' for none" : "Enter your username");
|
||||
let prompt: string = context.usernamePrompt || (context.isUsernameOptional ? localize('vscode-docker.tree.registries.connectWizard.enterUsernameOptional', 'Enter your username, or press \'Enter\' for none') : localize('vscode-docker.tree.registries.connectWizard.enterUsernameRequired', 'Enter your username'));
|
||||
const options: InputBoxOptions = {
|
||||
prompt,
|
||||
validateInput: (value: string | undefined) => this.validateInput(context, value)
|
||||
|
@ -29,9 +30,9 @@ export class RegistryUsernameStep extends AzureWizardPromptStep<IConnectRegistry
|
|||
|
||||
private validateInput(context: IConnectRegistryWizardContext, value: string | undefined): string | undefined {
|
||||
if (!context.isUsernameOptional && !value) {
|
||||
return "Username cannot be empty."
|
||||
return localize('vscode-docker.tree.registries.connectWizard.usernameEmpty', 'Username cannot be empty.');
|
||||
} else if (context.existingProviders.find(rp => rp.url === context.url && rp.username === value)) {
|
||||
return `Username "${value}" is already connected.`;
|
||||
return localize('vscode-docker.tree.registries.connectWizard.usernameConnected', 'Username "{0}" is already connected.', value);
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { localize } from '../../../localize';
|
||||
import { RegistryApi } from "../all/RegistryApi";
|
||||
import { IRegistryProvider } from "../IRegistryProvider";
|
||||
import { DockerHubAccountTreeItem } from "./DockerHubAccountTreeItem";
|
||||
|
@ -14,9 +15,9 @@ export const dockerHubRegistryProvider: IRegistryProvider = {
|
|||
id: dockerHubRegistryProviderId,
|
||||
api: RegistryApi.DockerHubV2,
|
||||
connectWizardOptions: {
|
||||
wizardTitle: 'Sign in to Docker Hub',
|
||||
wizardTitle: localize('vscode-docker.tree.registries.dockerHub.signIn', 'Sign in to Docker Hub'),
|
||||
includeUsername: true,
|
||||
usernamePrompt: 'Enter your Docker ID',
|
||||
usernamePrompt: localize('vscode-docker.tree.registries.dockerHub.enterID', 'Enter your Docker ID'),
|
||||
includePassword: true,
|
||||
},
|
||||
treeItemType: DockerHubAccountTreeItem
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { RequestPromiseOptions } from 'request-promise-native';
|
||||
import { localize } from '../../../localize';
|
||||
import { nonNullProp } from '../../../utils/nonNull';
|
||||
import { registryRequest } from '../../../utils/registryRequestUtils';
|
||||
import { RemoteTagTreeItem } from '../RemoteTagTreeItem';
|
||||
|
@ -22,7 +23,7 @@ export class DockerV2TagTreeItem extends RemoteTagTreeItem {
|
|||
const response = await registryRequest(this.parent, 'GET', url, digestOptions);
|
||||
const digest = nonNullProp(response.headers, 'docker-content-digest');
|
||||
if (digest instanceof Array) {
|
||||
throw new Error('docker-content-digest should be a string not an array.');
|
||||
throw new Error(localize('vscode-docker.tree.registries.v2.dockerContentDigestString', 'docker-content-digest should be a string not an array.'));
|
||||
}
|
||||
return digest;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { RequestPromiseOptions } from "request-promise-native";
|
||||
import { AzExtParentTreeItem, AzExtTreeItem, IActionContext, parseError } from "vscode-azureextensionui";
|
||||
import { localize } from '../../../localize';
|
||||
import { nonNullProp } from "../../../utils/nonNull";
|
||||
import { registryRequest } from "../../../utils/registryRequestUtils";
|
||||
import { ICachedRegistryProvider } from "../ICachedRegistryProvider";
|
||||
|
@ -49,7 +50,7 @@ export class GenericDockerV2RegistryTreeItem extends DockerV2RegistryTreeItemBas
|
|||
} catch (error) {
|
||||
const errorType: string = parseError(error).errorType.toLowerCase();
|
||||
if (errorType === "401" || errorType === "unauthorized") {
|
||||
const message = 'Incorrect login credentials, or this registry may not support basic authentication. Please note that OAuth support has not yet been implemented in this preview feature.';
|
||||
const message = localize('vscode-docker.tree.registries.v2.unauthorized', 'Incorrect login credentials, or this registry may not support basic authentication. Please note that OAuth support has not yet been implemented in this preview feature.');
|
||||
return [new RegistryConnectErrorTreeItem(this, new Error(message), this.cachedProvider, this.baseUrl)];
|
||||
} else {
|
||||
throw error;
|
||||
|
|
|
@ -3,21 +3,22 @@
|
|||
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { localize } from '../../../localize';
|
||||
import { RegistryApi } from "../all/RegistryApi";
|
||||
import { IRegistryProvider } from "../IRegistryProvider";
|
||||
import { GenericDockerV2RegistryTreeItem } from "./GenericDockerV2RegistryTreeItem";
|
||||
|
||||
export const genericDockerV2RegistryProvider: IRegistryProvider = {
|
||||
label: "Generic Docker Registry",
|
||||
description: '(Preview)',
|
||||
detail: 'Connect any generic private registry that supports the "Docker V2" api.',
|
||||
label: localize('vscode-docker.tree.registries.v2.label', 'Generic Docker Registry'),
|
||||
description: localize('vscode-docker.tree.registries.v2.description', '(Preview)'),
|
||||
detail: localize('vscode-docker.tree.registries.v2.detail', 'Connect any generic private registry that supports the "Docker V2" api.'),
|
||||
id: 'genericDockerV2',
|
||||
api: RegistryApi.DockerV2,
|
||||
isSingleRegistry: true,
|
||||
connectWizardOptions: {
|
||||
wizardTitle: 'Connect Docker Registry',
|
||||
wizardTitle: localize('vscode-docker.tree.registries.v2.title', 'Connect Docker Registry'),
|
||||
includeUrl: true,
|
||||
urlPrompt: 'Enter the URL for the registry (OAuth not yet supported)',
|
||||
urlPrompt: localize('vscode-docker.tree.registries.v2.urlPrompt', 'Enter the URL for the registry (OAuth not yet supported)'),
|
||||
includeUsername: true,
|
||||
isUsernameOptional: true,
|
||||
includePassword: true,
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче