Skip to content

Commit

Permalink
Open a "Getting Started" page after install/upgrade (microsoft#2441)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored and Dmarch28 committed Mar 4, 2021
1 parent b77c3aa commit 1000721
Show file tree
Hide file tree
Showing 25 changed files with 524 additions and 66 deletions.
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "relative",
"files.associations": {
"*.template": "plaintext"
}
"*.template": "plaintext",
"*.html.template": "html"
},
"html.format.wrapLineLength": 0
}
1 change: 1 addition & 0 deletions extension.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export { DockerNetwork } from './src/docker/Networks';
export { DockerVolume } from './src/docker/Volumes';
export { CommandTemplate, selectCommandTemplate, defaultCommandTemplates } from './src/commands/selectCommandTemplate';
export { NonComposeGroupName } from './src/tree/containers/ContainersTreeItem';
export { isHigherMinorVersion } from './src/commands/startPage/openStartPage';
export { DockerContainerInfo } from './src/tree/containers/ContainersTreeItem';

export * from 'vscode-azureextensionui';
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
"onCommand:vscode-docker.containers.composeGroup.restart",
"onCommand:vscode-docker.containers.composeGroup.down",
"onCommand:vscode-docker.debugging.initializeForDebugging",
"onCommand:vscode-docker.help",
"onCommand:vscode-docker.help.reportIssue",
"onCommand:vscode-docker.help.openStartPage",
"onCommand:vscode-docker.images.build",
"onCommand:vscode-docker.images.configureExplorer",
"onCommand:vscode-docker.images.inspect",
Expand Down Expand Up @@ -2027,6 +2029,11 @@
"docker.scaffolding.templatePath": {
"type": "string",
"description": "%vscode-docker.config.docker.scaffolding.templatePath%"
},
"docker.showStartPage": {
"type": "boolean",
"default": true,
"description": "%vscode-docker.config.docker.showStartPage%"
}
}
},
Expand Down Expand Up @@ -2162,11 +2169,6 @@
"title": "%vscode-docker.commands.debugging.initializeForDebugging%",
"category": "%vscode-docker.commands.category.docker%"
},
{
"command": "vscode-docker.help.reportIssue",
"title": "%vscode-docker.commands.help.reportIssue%",
"category": "%vscode-docker.commands.category.docker%"
},
{
"command": "vscode-docker.images.build",
"title": "%vscode-docker.commands.images.build%",
Expand Down Expand Up @@ -2479,6 +2481,16 @@
"category": "%vscode-docker.commands.category.docker%",
"icon": "$(question)"
},
{
"command": "vscode-docker.help.reportIssue",
"title": "%vscode-docker.commands.help.reportIssue%",
"category": "%vscode-docker.commands.category.docker%"
},
{
"command": "vscode-docker.help.openStartPage",
"title": "%vscode-docker.commands.help.openStartPage%",
"category": "%vscode-docker.commands.category.docker%"
},
{
"command": "vscode-docker.contexts.use",
"title": "%vscode-docker.commands.contexts.use%",
Expand Down Expand Up @@ -2628,6 +2640,7 @@
"umd-compat-loader": "^2.1.2",
"vsce": "^1.81.1",
"vscode-azureextensiondev": "^0.5.0",
"vscode-codicons": "0.0.12",
"vscode-nls-dev": "^3.3.2",
"vscode-test": "^1.4.0",
"webpack": "^4.44.2",
Expand Down
4 changes: 3 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
"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.config.docker.scaffolding.templatePath": "The path to use for scaffolding templates.",
"vscode-docker.config.docker.showStartPage": "Show the Docker extension Start Page when a new update is released.",
"vscode-docker.config.deprecated": "This setting has been deprecated and will be removed in a future release.",
"vscode-docker.commands.compose.down": "Compose Down",
"vscode-docker.commands.compose.restart": "Compose Restart",
Expand All @@ -193,7 +194,9 @@
"vscode-docker.commands.containers.composeGroup.restart": "Compose Restart",
"vscode-docker.commands.containers.composeGroup.down": "Compose Down",
"vscode-docker.commands.debugging.initializeForDebugging": "Initialize for Docker debugging",
"vscode-docker.commands.help": "Docker Help",
"vscode-docker.commands.help.reportIssue": "Report Issue",
"vscode-docker.commands.help.openStartPage": "Open Start Page",
"vscode-docker.commands.images.build": "Build Image...",
"vscode-docker.commands.images.configureExplorer": "Configure Explorer...",
"vscode-docker.commands.images.inspect": "Inspect",
Expand Down Expand Up @@ -252,7 +255,6 @@
"vscode-docker.commands.contexts.refresh": "Refresh",
"vscode-docker.commands.contexts.help": "Docker Context Help",
"vscode-docker.commands.contexts.create.aci": "Create Azure Container Instances Context...",
"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",
Expand Down
Binary file added resources/docker_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
193 changes: 193 additions & 0 deletions resources/startPage.html.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src {{ cspSource }} file:; script-src 'nonce-{{ nonce }}'; font-src {{ codiconsFontUri }}; style-src {{ cspSource }} {{ codiconsStyleUri }} 'nonce-{{ nonce }}';" />
<link href="{{ codiconsStyleUri }}" rel="stylesheet" />
<title>Docker - Get Started</title>

<style nonce="{{ nonce }}">
#titleBar {
align-items: center;
}

#titleBar h1 {
margin-block-start: .2em;
margin-block-end: .2em;
}

#titleBar img {
width: 100px;
}

hr {
border-color: var(--vscode-titleBar-inactiveForeground);
}

h2 {
margin-block-start: .2em;
margin-block-end: .2em;
}

.row {
display: flex;
flex-direction: row;
align-items: flex-start;
}

.row>* {
margin: 10px;
}

.icon {
min-width: 90px;
padding: 5px;
text-align: right;
flex-basis: 90px;
}

.icon .codicon {
font-size: 32px;
}

ul {
margin-block-start: .5em;
margin-block-end: .5em;
}

#dockerIcon {
width: 32px;
}

#dockerIcon path {
fill: var(--vscode-editor-foreground);
}

.footer {
margin-left: 120px;
}
</style>
</head>

<body>
<div class="container">
<div class="row" id="titleBar">
<div>
<img src="{{ dockerIconUri }}" alt="Docker logo" />
</div>
<div>
<h1>Docker Extension</h1>
<span>by Microsoft</span>
</div>
</div>
<hr />
<div class="row">
<div class="icon">
<i class="codicon codicon-new-file" aria-label="Add Docker files"></i>
</div>
<div>
<div>
<h2>Get Started with Docker Containers</h2>
</div>
<div>
<ul>
<li>After opening a workspace, run <a href="command:vscode-docker.configure?%7B%22commandReason%22%3A%22startPage%22%7D">Docker: Add Docker Files to Workspace</a> in the command palette ({{#if isMac}}<kbd>⇧</kbd><kbd>⌘</kbd><kbd>P</kbd>{{else}}<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>{{/if}})</li>
<li>Use the extension to help with editing <a href="https://docs.docker.com/engine/reference/builder/">Dockerfiles</a> and <a href="https://docs.docker.com/compose/compose-file/">Compose files</a></li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="icon">
<i class="codicon codicon-play" aria-label="Run an image"></i>
</div>
<div>
<div>
<h2>Build and Run Docker Containers</h2>
</div>
<div>
<ul>
<li>Building Docker images is easy! Run <a href="command:vscode-docker.images.build?%7B%22commandReason%22%3A%22startPage%22%7D">Docker Images: Build Image</a></li>
<li>To start a container from your image, run <a href="command:vscode-docker.images.run?%7B%22commandReason%22%3A%22startPage%22%7D">Docker Images: Run</a></li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="icon">
<!-- This is copied from resources/docker.svg, but inlining it allows us to make it follow the theme -->
<svg id="dockerIcon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<title>Use Docker Explorer</title>
<path d="M23.5718 10.42C23.5074 10.369 22.9116 9.91576 21.6328 9.91576C21.2971 9.91718 20.9622 9.94574 20.6311 10.0012C20.3853 8.32269 18.9942 7.5048 18.9282 7.46866L18.5866 7.27322L18.3622 7.6017C18.082 8.03172 17.8772 8.50598 17.7566 9.00426C17.6391 9.44617 17.614 9.90735 17.6826 10.3593C17.7513 10.8113 17.9125 11.2444 18.1559 11.632C17.5651 11.9605 16.6229 12.0442 16.4266 12.0475H0.7501C0.553133 12.0466 0.363814 12.1233 0.223458 12.2609C0.0831023 12.3984 0.00310694 12.5856 0.000930063 12.7817C-0.0167015 14.149 0.216488 15.5081 0.689044 16.7923C1.2303 18.2014 2.03392 19.2393 3.07847 19.8766C4.25008 20.591 6.15765 20.9999 8.31275 20.9999C9.28745 21.0033 10.2604 20.9158 11.2187 20.7388C12.5518 20.4955 13.8346 20.032 15.014 19.3675C15.9873 18.8097 16.8634 18.0986 17.6081 17.2619C18.8506 15.8627 19.5883 14.3057 20.141 12.918H20.3606C21.7203 12.918 22.5569 12.3776 23.0189 11.9227C23.3226 11.6323 23.5597 11.2799 23.7137 10.8897L23.811 10.6055L23.5718 10.42Z" />
<path d="M4.30126 9.36063H2.19896C2.0978 9.36063 2.01579 9.44224 2.01579 9.54293V11.407C2.01579 11.5077 2.0978 11.5893 2.19896 11.5893H4.30126C4.40241 11.5893 4.48443 11.5077 4.48443 11.407V9.54293C4.48443 9.44224 4.40241 9.36063 4.30126 9.36063Z" />
<path d="M7.19729 9.36063H5.095C4.99383 9.36063 4.91183 9.44224 4.91183 9.54293V11.407C4.91183 11.5077 4.99383 11.5893 5.095 11.5893H7.19729C7.29845 11.5893 7.38046 11.5077 7.38046 11.407V9.54293C7.38046 9.44224 7.29845 9.36063 7.19729 9.36063Z" />
<path d="M10.1362 9.36063H8.03389C7.93273 9.36063 7.85072 9.44224 7.85072 9.54293V11.407C7.85072 11.5077 7.93273 11.5893 8.03389 11.5893H10.1362C10.2373 11.5893 10.3194 11.5077 10.3194 11.407V9.54293C10.3194 9.44224 10.2373 9.36063 10.1362 9.36063Z" />
<path d="M13.0421 9.36063H10.9398C10.8386 9.36063 10.7566 9.44224 10.7566 9.54293V11.407C10.7566 11.5077 10.8386 11.5893 10.9398 11.5893H13.0421C13.1432 11.5893 13.2253 11.5077 13.2253 11.407V9.54293C13.2253 9.44224 13.1432 9.36063 13.0421 9.36063Z" />
<path d="M7.19729 6.6803H5.095C4.99383 6.6803 4.91183 6.76192 4.91183 6.8626V8.72666C4.91183 8.82735 4.99383 8.90896 5.095 8.90896H7.19729C7.29845 8.90896 7.38046 8.82735 7.38046 8.72666V6.8626C7.38046 6.76192 7.29845 6.6803 7.19729 6.6803Z" />
<path d="M10.1362 6.6803H8.03389C7.93273 6.6803 7.85072 6.76192 7.85072 6.8626V8.72666C7.85072 8.82735 7.93273 8.90896 8.03389 8.90896H10.1362C10.2373 8.90896 10.3194 8.82735 10.3194 8.72666V6.8626C10.3194 6.76192 10.2373 6.6803 10.1362 6.6803Z" />
<path d="M13.0421 6.6803H10.9398C10.8386 6.6803 10.7566 6.76192 10.7566 6.8626V8.72666C10.7566 8.82735 10.8386 8.90896 10.9398 8.90896H13.0421C13.1432 8.90896 13.2253 8.82735 13.2253 8.72666V6.8626C13.2253 6.76192 13.1432 6.6803 13.0421 6.6803Z" />
<path d="M13.0421 4H10.9398C10.8386 4 10.7566 4.08162 10.7566 4.1823V6.04636C10.7566 6.14704 10.8386 6.22866 10.9398 6.22866H13.0421C13.1432 6.22866 13.2253 6.14704 13.2253 6.04636V4.1823C13.2253 4.08162 13.1432 4 13.0421 4Z" />
<path d="M15.9728 9.36063H13.8705C13.7693 9.36063 13.6873 9.44224 13.6873 9.54293V11.407C13.6873 11.5077 13.7693 11.5893 13.8705 11.5893H15.9728C16.0739 11.5893 16.156 11.5077 16.156 11.407V9.54293C16.156 9.44224 16.0739 9.36063 15.9728 9.36063Z" />
</svg>
</div>
<div>
<div>
<h2>Use the Docker Explorer</h2>
</div>
<div>
<ul>
<li>Open the <a href="command:workbench.view.extension.dockerView">Docker Explorer</a> to view and manage Docker resources</li>
<li>View files in running containers with the <a href="command:dockerContainers.focus">Docker Explorer: Containers</a> panel</li>
<li>You can easily view container logs by right-clicking the container in the <a href="command:dockerContainers.focus">Docker Explorer: Containers</a> panel and choosing "View Logs"</li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="icon">
<i class="codicon codicon-cloud-upload" aria-label="Publish to the Cloud"></i>
</div>
<div>
<div>
<h2>Publish to the Cloud</h2>
</div>
<div>
<ul>
<li>Connect and view a container registry in the <a href="command:dockerRegistries.focus">Docker Explorer</a> using <a href="command:vscode-docker.registries.connectRegistry?%7B%22commandReason%22%3A%22startPage%22%7D">Docker Registries: Connect Registry</a></li>
<li>Publish images with <a href="command:vscode-docker.images.push?%7B%22commandReason%22%3A%22startPage%22%7D">Docker Images: Push</a></li>
{{#if showAzure}}<li>Deploy to <a href="command:vscode-docker.registries.deployImageToAzure?%7B%22commandReason%22%3A%22startPage%22%7D">Azure App Service</a> or to <a href="command:vscode-docker.registries.deployImageToAci?%7B%22commandReason%22%3A%22startPage%22%7D">Azure Container Instances</a></li>{{/if}}
</ul>
</div>
</div>
</div>
<div class="row footer">
<div>
Visit the extension's <a href="https://github.com/microsoft/vscode-docker">GitHub repository</a>,
read <a href="https://github.com/microsoft/vscode-docker/releases">release notes</a> and <a href="https://code.visualstudio.com/docs/containers/overview">documentation</a>,
or <a href="https://github.com/microsoft/vscode-docker/issues/new">create an issue</a>
</div>
</div>
<div class="row footer">
<div>
<input type="checkbox" id="showStartPage" {{ showStartPageChecked }} />
<label for="showStartPage">Show this page when a new update to the Docker extension is released</label>
</div>
</div>
</div>
</body>

<script nonce="{{ nonce }}">
const vscode = acquireVsCodeApi();
const showStartPageCheckbox = document.getElementById('showStartPage');

showStartPageCheckbox.addEventListener('click', function () {
vscode.postMessage({
command: 'showStartPageClicked',
showStartPage: showStartPageCheckbox.checked
});
});
</script>

</html>
4 changes: 2 additions & 2 deletions src/commands/context/DockerContextsViewCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as vscode from "vscode";
import { IActionContext } from "vscode-azureextensionui";
import { ext } from "../../extensionVariables";
import { openExternal } from "../../utils/openExternal";

export async function configureDockerContextsExplorer(context: IActionContext): Promise<void> {
await ext.contextsRoot.configureExplorer(context);
}

export async function dockerContextsHelp(_context: IActionContext): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
openExternal('https://aka.ms/helpicon_dockercontext');
vscode.env.openExternal(vscode.Uri.parse('https://aka.ms/helpicon_dockercontext'));
}
3 changes: 1 addition & 2 deletions src/commands/dockerInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { localize } from '../localize';
import { dockerInstallStatusProvider } from '../utils/DockerInstallStatusProvider';
import { executeAsTask } from '../utils/executeAsTask';
import { streamToFile } from '../utils/httpRequest';
import { openExternal } from '../utils/openExternal';
import { getTempFileName, isLinux } from '../utils/osUtils';
import { execAsync } from '../utils/spawnAsync';

Expand Down Expand Up @@ -74,7 +73,7 @@ export abstract class DockerInstallerBase {

private handleError(context: IActionContext, message: string, title: string, url: string): void {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
vscode.window.showErrorMessage(message, { title: title }).then(response => { if (response) { openExternal(url); } });
vscode.window.showErrorMessage(message, { title: title }).then(response => { if (response) { vscode.env.openExternal(vscode.Uri.parse(url)); } });
context.errorHandling.suppressReportIssue = true;
context.errorHandling.suppressDisplay = true;
}
Expand Down
5 changes: 2 additions & 3 deletions src/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ 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 {
handler(): Promise<void>,
Expand All @@ -32,12 +31,12 @@ export async function help(context: IActionContext): Promise<void> {

async function getStarted(): Promise<void> {
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
openExternal("https://code.visualstudio.com/docs/containers/overview");
vscode.env.openExternal(vscode.Uri.parse('https://code.visualstudio.com/docs/containers/overview'));
}

async function reviewIssues(): Promise<void> {
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
openExternal("https://github.com/microsoft/vscode-docker/issues");
vscode.env.openExternal(vscode.Uri.parse('https://github.com/microsoft/vscode-docker/issues'));
}

async function reportIssue(): Promise<void> {
Expand Down
Loading

0 comments on commit 1000721

Please sign in to comment.