Implement GCP and AWS set up instructions UI (#212)

This commit is contained in:
alalamav 2018-08-02 13:56:09 -04:00 • committed by trevj
parent bdcd63c8f8
commit 0ebb73487d
24 changed files with 636 additions and 149 deletions

View file

@ -19,6 +19,7 @@
"font-roboto": "PolymerElements/font-roboto-local#^1.1.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^2.1.1",
"iron-icons": "PolymerElements/iron-icons#^2.0.1",
"iron-collapse": "PolymerElements/iron-collapse#^2.2.1",
"iron-fit-behavior": "PolymerElements/iron-fit-behavior#^2.1.0",
"iron-pages": "PolymerElements/iron-pages#^2.0.1",
"paper-button": "PolymerElements/paper-button#^2.0.0",

View file

@ -27,6 +27,8 @@ const shell = electron.shell;
const debugMode = process.env.OUTLINE_DEBUG === 'true';
const IMAGES_URL = `file://${path.join(__dirname, 'server_manager', 'web_app')}`;
interface IpcEvent {
returnValue: {};
}
@ -183,6 +185,15 @@ function main() {
mainWindow.focus();
});
ipcMain.on('open-image', (event: IpcEvent, args: string[]) => {
if (!args || args.length === 0) {
console.error('open-image event received no image path.');
return;
}
const imagePath = args[0];
shell.openExternal(path.join(IMAGES_URL, imagePath));
});
app.on('activate', () => {
if (!mainWindow) {
mainWindow = createMainWindow();

View file

@ -21,7 +21,8 @@ const ipcRenderer = electron.ipcRenderer;
interface ElectronGlobal extends NodeJS.Global {
whitelistCertificate: (fingerprint: string) => void;
onElectronEvent: (event: string, listener: () => void) => void;
sendElectronEvent: (event: string) => void;
// tslint:disable-next-line:no-any
sendElectronEvent: (event: string, ...args: any[]) => void;
runDigitalOceanOauth: () => digitalocean_oauth.OauthSession;
}
@ -33,8 +34,9 @@ process.once('loaded', () => {
electronGlobal.onElectronEvent = (event: string, listener: () => void) => {
ipcRenderer.on(event, listener);
};
electronGlobal.sendElectronEvent = (event: string) => {
ipcRenderer.send(event);
// tslint:disable-next-line:no-any
electronGlobal.sendElectronEvent = (event: string, ...args: any[]) => {
ipcRenderer.send(event, args);
};
electronGlobal.runDigitalOceanOauth = digitalocean_oauth.runOauth;
});

View file

@ -0,0 +1 @@
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300.7 179.8" width="28" height="28"><style>.st0{fill:#252f3e}.st1{fill:#f90}</style><path class="st0" d="M84.7 65.3c0 3.7.4 6.7 1.1 8.9.8 2.2 1.8 4.6 3.2 7.2.5.8.7 1.6.7 2.3 0 1-.6 2-1.9 3l-6.3 4.2c-.9.6-1.8.9-2.6.9-1 0-2-.5-3-1.4-1.4-1.5-2.6-3.1-3.6-4.7-1-1.7-2-3.6-3.1-5.9-7.8 9.2-17.6 13.8-29.4 13.8-8.4 0-15.1-2.4-20-7.2-4.9-4.8-7.4-11.2-7.4-19.2 0-8.5 3-15.4 9.1-20.6s14.2-7.8 24.5-7.8c3.4 0 6.9.3 10.6.8s7.5 1.3 11.5 2.2v-7.3c0-7.6-1.6-12.9-4.7-16-3.2-3.1-8.6-4.6-16.3-4.6-3.5 0-7.1.4-10.8 1.3-3.7.9-7.3 2-10.8 3.4-1.6.7-2.8 1.1-3.5 1.3-.7.2-1.2.3-1.6.3-1.4 0-2.1-1-2.1-3.1v-4.9c0-1.6.2-2.8.7-3.5s1.4-1.4 2.8-2.1c3.5-1.8 7.7-3.3 12.6-4.5C39.3.8 44.5.2 50 .2c11.9 0 20.6 2.7 26.2 8.1 5.5 5.4 8.3 13.6 8.3 24.6v32.4h.2zM44.1 80.5c3.3 0 6.7-.6 10.3-1.8 3.6-1.2 6.8-3.4 9.5-6.4 1.6-1.9 2.8-4 3.4-6.4s1-5.3 1-8.7V53c-2.9-.7-6-1.3-9.2-1.7s-6.3-.6-9.4-.6c-6.7 0-11.6 1.3-14.9 4-3.3 2.7-4.9 6.5-4.9 11.5 0 4.7 1.2 8.2 3.7 10.6 2.4 2.5 5.9 3.7 10.5 3.7zm80.3 10.8c-1.8 0-3-.3-3.8-1-.8-.6-1.5-2-2.1-3.9L95 9.1c-.6-2-.9-3.3-.9-4 0-1.6.8-2.5 2.4-2.5h9.8c1.9 0 3.2.3 3.9 1 .8.6 1.4 2 2 3.9L129 73.7l15.6-66.2c.5-2 1.1-3.3 1.9-3.9.8-.6 2.2-1 4-1h8c1.9 0 3.2.3 4 1 .8.6 1.5 2 1.9 3.9l15.8 67 17.3-67c.6-2 1.3-3.3 2-3.9.8-.6 2.1-1 3.9-1h9.3c1.6 0 2.5.8 2.5 2.5 0 .5-.1 1-.2 1.6-.1.6-.3 1.4-.7 2.5l-24.1 77.3c-.6 2-1.3 3.3-2.1 3.9s-2.1 1-3.8 1h-8.6c-1.9 0-3.2-.3-4-1s-1.5-2-1.9-4l-15.5-64.5-15.4 64.4c-.5 2-1.1 3.3-1.9 4-.8.7-2.2 1-4 1h-8.6zM252.9 94c-5.2 0-10.4-.6-15.4-1.8-5-1.2-8.9-2.5-11.5-4-1.6-.9-2.7-1.9-3.1-2.8-.4-.9-.6-1.9-.6-2.8v-5.1c0-2.1.8-3.1 2.3-3.1.6 0 1.2.1 1.8.3.6.2 1.5.6 2.5 1 3.4 1.5 7.1 2.7 11 3.5 4 .8 7.9 1.2 11.9 1.2 6.3 0 11.2-1.1 14.6-3.3 3.4-2.2 5.2-5.4 5.2-9.5 0-2.8-.9-5.1-2.7-7-1.8-1.9-5.2-3.6-10.1-5.2l-14.5-4.5c-7.3-2.3-12.7-5.7-16-10.2-3.3-4.4-5-9.3-5-14.5 0-4.2.9-7.9 2.7-11.1s4.2-6 7.2-8.2c3-2.3 6.4-4 10.4-5.2S251.8 0 256.2 0c2.2 0 4.5.1 6.7.4 2.3.3 4.4.7 6.5 1.1 2 .5 3.9 1 5.7 1.6 1.8.6 3.2 1.2 4.2 1.8 1.4.8 2.4 1.6 3 2.5.6.8.9 1.9.9 3.3v4.7c0 2.1-.8 3.2-2.3 3.2-.8 0-2.1-.4-3.8-1.2-5.7-2.6-12.1-3.9-19.2-3.9-5.7 0-10.2.9-13.3 2.8s-4.7 4.8-4.7 8.9c0 2.8 1 5.2 3 7.1 2 1.9 5.7 3.8 11 5.5l14.2 4.5c7.2 2.3 12.4 5.5 15.5 9.6s4.6 8.8 4.6 14c0 4.3-.9 8.2-2.6 11.6-1.8 3.4-4.2 6.4-7.3 8.8-3.1 2.5-6.8 4.3-11.1 5.6-4.5 1.4-9.2 2.1-14.3 2.1z"/><path class="st1" d="M271.8 142.6c-32.9 24.3-80.7 37.2-121.8 37.2-57.6 0-109.5-21.3-148.7-56.7-3.1-2.8-.3-6.6 3.4-4.4 42.4 24.6 94.7 39.5 148.8 39.5 36.5 0 76.6-7.6 113.5-23.2 5.5-2.5 10.2 3.6 4.8 7.6z"/><path class="st1" d="M285.5 127c-4.2-5.4-27.8-2.6-38.5-1.3-3.2.4-3.7-2.4-.8-4.5 18.8-13.2 49.7-9.4 53.3-5 3.6 4.5-1 35.4-18.6 50.2-2.7 2.3-5.3 1.1-4.1-1.9 4-9.9 12.9-32.2 8.7-37.5z"/></svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

View file

@ -2,7 +2,7 @@
<svg width="12px" height="10px" viewBox="0 0 12 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop" transform="translate(-534.000000, -1020.000000)" fill="#1637FF">
<g id="Desktop" transform="translate(-534.000000, -1020.000000)" fill="#4285F4">
<g id="check-copy-2" transform="translate(531.000000, 1016.000000)">
<rect id="Rectangle" fill-opacity="0" x="0" y="0" width="18" height="18"></rect>
<polygon id="Path-8-Copy-10" fill-rule="nonzero" points="5.04574404 7.68776621 3.58652645 9.05549572 7.54659883 13.2804593 14.4134736 5.95425596 12.954256 4.58652645 7.54659883 10.3559044"></polygon>

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 814 B

Before After
Before After

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="10px" viewBox="0 0 12 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop" transform="translate(-534.000000, -1020.000000)" fill="#FF9900">
<g id="check-copy-2" transform="translate(531.000000, 1016.000000)">
<rect id="Rectangle" fill-opacity="0" x="0" y="0" width="18" height="18"></rect>
<polygon id="Path-8-Copy-10" fill-rule="nonzero" points="5.04574404 7.68776621 3.58652645 9.05549572 7.54659883 13.2804593 14.4134736 5.95425596 12.954256 4.58652645 7.54659883 10.3559044"></polygon>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 815 B

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="10px" viewBox="0 0 12 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop" transform="translate(-534.000000, -1020.000000)" fill="#FF9900">
<g id="check-copy-2" transform="translate(531.000000, 1016.000000)">
<rect id="Rectangle" fill-opacity="0" x="0" y="0" width="18" height="18"></rect>
<polygon id="Path-8-Copy-10" fill-rule="nonzero" points="5.04574404 7.68776621 3.58652645 9.05549572 7.54659883 13.2804593 14.4134736 5.95425596 12.954256 4.58652645 7.54659883 10.3559044"></polygon>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 815 B

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="10px" viewBox="0 0 12 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop" transform="translate(-534.000000, -1020.000000)" fill="#ffffff">
<g id="check-copy-2" transform="translate(531.000000, 1016.000000)">
<rect id="Rectangle" fill-opacity="0" x="0" y="0" width="18" height="18"></rect>
<polygon id="Path-8-Copy-10" fill-rule="nonzero" points="5.04574404 7.68776621 3.58652645 9.05549572 7.54659883 13.2804593 14.4134736 5.95425596 12.954256 4.58652645 7.54659883 10.3559044"></polygon>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 815 B

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 47 (45396) - http://www.bohemiancoding.com/sketch -->
<title>DO_Logo_icon_white</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="ManualMode-001" transform="translate(-81.000000, -425.000000)" fill="#FFFFFE">
<g id="DO_Logo_icon_white" transform="translate(81.000000, 425.000000)">
<g id="Group-3">
<path d="M11.959322,23.9288071 L11.959322,19.291519 C16.8677966,19.291519 20.6779661,14.4237224 18.7932203,9.25762071 C18.1016949,7.3457563 16.5694915,5.81355291 14.6576271,5.12202748 C9.49152542,3.25084104 4.62372881,7.04745121 4.62372881,11.9559258 L0,11.9559258 C0,4.13219698 7.56610169,-1.96949794 15.7694915,0.593213925 C19.3491525,1.71863765 22.2101695,4.56609528 23.3220339,8.1457563 C25.8847458,16.3627055 19.7966102,23.9288071 11.959322,23.9288071" id="Fill-1"></path>
</g>
<polygon id="Fill-4" points="7 19 12 19 12 14 7 14"></polygon>
<polygon id="Fill-5" points="4 22 7 22 7 19 4 19"></polygon>
<polygon id="Fill-6" points="1 19 4 19 4 16 1 16"></polygon>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="19px" viewBox="0 0 24 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 51.1 (57501) - http://www.bohemiancoding.com/sketch -->
<title>logo/google_cloud copy 4</title>
<desc>Created with Sketch.</desc>
<defs>
<rect id="path-1" x="0" y="0" width="24" height="24"></rect>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="DOSetup-001" transform="translate(-538.000000, -284.000000)">
<g id="logo/google_cloud" transform="translate(538.000000, 282.000000)">
<g id="logo_google_cloud_192px_clr">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="SVGID_1_"></g>
<g id="Group" mask="url(#mask-2)" fill-rule="nonzero">
<g transform="translate(0.500000, 2.375000)" id="Shape">
<path d="M14.63875,5.23375 L15.375,5.2475 L17.37625,3.24625 L17.47375,2.39875 C15.88375,0.98375 13.79125,0.1225 11.5,0.1225 C7.35125,0.1225 3.8525,2.94375 2.815,6.76875 C3.03375,6.6175 3.5,6.73 3.5,6.73 L7.5,6.0725 C7.5,6.0725 7.7075,5.7325 7.80875,5.75375 C8.72375,4.7525 10.04,4.1225 11.5,4.1225 C12.6875,4.1225 13.78,4.54 14.63875,5.23375 Z" fill="#EA4335"></path>
<path d="M20.1875,6.77375 C19.72375,5.05875 18.76375,3.54625 17.4725,2.3975 L14.6375,5.2325 C15.7725,6.15 16.5,7.5525 16.5,9.1225 L16.5,9.6225 C17.87875,9.6225 19,10.74375 19,12.1225 C19,13.50125 17.87875,14.6225 16.5,14.6225 L11.5,14.6225 L11,15.125 L11,18.125 L11.5,18.6225 L16.5,18.6225 C20.08375,18.6225 23,15.70625 23,12.1225 C23,9.90625 21.885,7.9475 20.1875,6.77375 Z" fill="#4285F4"></path>
<path d="M6.5,18.6225 L11.49625,18.6225 L11.49625,14.6225 L6.5,14.6225 C6.1325,14.6225 5.785,14.54125 5.47,14.3975 L4.75,14.61875 L2.7475,16.62125 L2.5725,17.2975 C3.66375,18.1275 5.025,18.6225 6.5,18.6225 Z" fill="#34A853"></path>
<path d="M6.5,5.6225 C2.91625,5.6225 0,8.53875 0,12.1225 C0,14.2325 1.01125,16.11125 2.575,17.29875 L5.47375,14.4 C4.60625,14.0075 4,13.135 4,12.1225 C4,10.74375 5.12125,9.6225 6.5,9.6225 C7.5125,9.6225 8.385,10.22875 8.7775,11.09625 L11.67625,8.1975 C10.48875,6.63375 8.61,5.6225 6.5,5.6225 Z" fill="#FBBC05"></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="18px" viewBox="0 0 20 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 47 (45396) - http://www.bohemiancoding.com/sketch -->
<title>terminal</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="ManualMode-005b" transform="translate(-74.000000, -305.000000)">
<g id="terminal" transform="translate(72.000000, 302.000000)">
<g id="Group-2" transform="translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) translate(3.000000, 2.000000)"></g>
<rect id="Rectangle-3" fill-opacity="0" fill="#FFFFFF" x="0" y="0" width="24" height="24"></rect>
<path d="M5,2 L19,2 C20.1045695,2 21,2.8954305 21,4 L21,20 C21,21.1045695 20.1045695,22 19,22 L5,22 C3.8954305,22 3,21.1045695 3,20 L3,4 L3,4 C3,2.8954305 3.8954305,2 5,2 L5,2 Z M5,4 L5,20 L19,20 L19,4 L5,4 Z" id="Combined-Shape" fill="#141414" transform="translate(12.000000, 12.000000) rotate(-270.000000) translate(-12.000000, -12.000000) "></path>
<rect id="Rectangle-2" fill="#000000" x="10" y="12" width="5" height="2"></rect>
<path d="M4.03553391,11.0355339 L4.03553391,7.03553391 L6.03553391,7.03553391 L6.03553391,10.0355339 L9.03553391,10.0355339 L9.03553391,12.0355339 L4.03553391,12.0355339 L4.03553391,11.0355339 Z" id="Combined-Shape" fill="#000000" transform="translate(6.535534, 9.535534) rotate(-135.000000) translate(-6.535534, -9.535534) "></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -221,7 +221,9 @@
listeners: {
'RegionSelected': 'handleRegionSelected',
'MetricsChoiceSelected': 'handleMetricsChoiceSelected',
'OpenManualServerEntry': 'handleManualServerSelected',
'SetUpGenericCloudProviderRequested': 'handleSetUpGenericCloudProviderRequested',
'SetUpAwsRequested': 'handleSetUpAwsRequested',
'SetUpGcpRequested': 'handleSetUpGcpRequested',
'ManualServerEntryCancelled': 'handleManualCancelled'
},
showIntro: function () {
@ -268,8 +270,18 @@
regionId: this.$.regionPicker.getSelectedRegionId()
});
},
handleManualServerSelected: function() {
handleSetUpGenericCloudProviderRequested: function () {
this.handleManualServerSelected('generic');
},
handleSetUpAwsRequested: function() {
this.handleManualServerSelected('aws');
},
handleSetUpGcpRequested: function() {
this.handleManualServerSelected('gcp');
},
handleManualServerSelected: function(cloudProvider) {
this.$.manualEntry.clear();
this.$.manualEntry.cloudProvider = cloudProvider;
this.currentPage = 'manualEntry';
},
handleManualCancelled: function() {

View file

@ -0,0 +1,104 @@
<!--
Copyright 2018 The Outline Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<link rel='import' href='../bower_components/polymer/polymer.html'>
<link rel="import" href="../bower_components/iron-icons/iron-icons.html">
<link rel='import' href='../bower_components/paper-button/paper-button.html'>
<dom-module id="outline-cloud-instructions-view">
<template>
<style include="cloud-install-styles">
:host {
}
.container {
border: 1px solid rgba(0,0,0,0.12);
padding-bottom: 12px;
}
.header {
display: flex;
justify-content: space-between;
padding: 15px 24px;
line-height: 30px;
}
.showme:hover {
cursor: pointer;
}
.showme iron-icon {
width: 16px;
height: 16px;
margin-left: 8px;
}
.title {
font-size: 16px;
color: rgba(0,0,0,0.87);
}
.thumbnail {
width: 502px;
height: 298px;
margin-bottom: 24px;
}
.overlay {
position: absolute;
background: rgb(38,50,56);
opacity: 0;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
.overlay iron-icon {
color: #fff;
width: 24px;
height: 24px;
}
.overlay:hover {
opacity: 0.57;
}
.instructions {
font-size: 16px;
color: rgba(0,0,0,0.87);
line-height: 24px;
}
</style>
<div class="container">
<div class="header">
<div class="title">[[title]]</div>
<div class="showme" on-tap="_openImage">Show me where<iron-icon icon="open-in-new"></iron-icon></div>
</div>
<div class="thumbnail overlay" on-tap="_openImage">
<iron-icon icon="open-in-new"></iron-icon>
</div>
<img class="thumbnail" src$="[[thumbnailPath]]"></img>
<div class="instructions">
<slot></slot>
</div>
</div>
</template>
<script>
Polymer({
is: 'outline-cloud-instructions-view',
properties: {
title: String,
imagePath: String,
thumbnailPath: String,
instructions: Array
},
_openImage: function() {
this.fire('OpenImageRequested', {imagePath: this.imagePath});
}
});
</script>
</dom-module>

View file

@ -25,154 +25,247 @@
<style>
:host {
text-align: center;
--do-blue: #1637FF;
--manual-server-green: #00BFA5;
--aws-orange: #FF9900;
--gcp-blue: #4285F4;
}
a {
cursor: pointer;
.container {
display: flex;
flex-flow: row wrap;
padding: 12px;
}
.card {
padding: 12px 0 24px 0;
margin: 24px;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12px 0 0;
margin: 6px;
height: 324px;
width: 47.5%;
text-align: left;
color: rgba(0,0,0,0.87);
font-weight: normal;
box-shadow: 0 0 2px 0 rgba(0,0,0,0.14), 0 2px 2px 0 rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20);
border-radius: 2px;
/* For shadows and hover/click colours. */
transition: 135ms;
/* Whole card is clickable. */
cursor: pointer;
}
.card paper-button {
width: 100%;
margin: 24px 0 0 0;
letter-spacing: 0.75px;
}
.card#digitalOcean paper-button {
color: #FFF;
background-color: var(--do-blue);
.card#digital-ocean {
color: rgba(255, 255, 255, 0.87);
}
.card#digitalOcean .difficultyLevel {
color: var(--do-blue);
/* Card shadows (common to all cards).` */
.card {
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.02), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
.card#manualServer paper-button {
color: #000;
background-color: var(--manual-server-green);
.card:hover {
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.20), 0 4px 5px 0 rgba(0, 0, 0, 0.10), 0 1px 10px 0 rgba(0, 0, 0, 0.20);
}
.card#manualServer .difficultyLevel {
color: var(--manual-server-green);
.card:active {
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.20), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
}
.card .cardHeader {
/* DigitalOcean card background colours (gets brighter, inactive -> active). */
.card#digital-ocean {
background: rgba(22, 55, 255, 100);
}
.card#digital-ocean:hover {
background: rgba(22, 55, 255, 0.92);
}
.card#digital-ocean:active {
background: rgba(22, 55, 255, 0.84);
}
/* Non-DigitalOcean card background colours (get darker, inactive -> active). */
.card:hover {
background: rgba(38, 50, 56, 0.08);
}
.card:active {
background: rgba(38, 50, 56, 0.16);
}
.card .card-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 24px 12px;
border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.card .cardBody {
.card .card-body {
padding: 0 24px;
flex: 7; /* for spacing */
}
.card .difficultyLevel {
.card .tag {
font-weight: 500;
letter-spacing: .05em;
font-size: 10px;
color: rgba(255, 255, 255, 0.54);
}
.card .cardLeftColumn {
display: inline-block;
vertical-align: top;
width: 200px;
.card#digital-ocean .tag {
color: rgba(255,255,255,0.87);
}
.card .cardLeftColumn .title {
.card#manual-server .tag {
color: var(--manual-server-green);
}
.card#aws .tag {
color: var(--aws-orange);
}
.card#gcp .tag {
color: var(--gcp-blue);
}
.card-title {
font-size: 20px;
margin-top: 22px;
margin: 0 24px;
line-height: 32px;
flex: 2; /* for spacing */
}
.card .cardLeftColumn img {
.card img {
margin-top: 11px;
}
.card .cardLeftColumn .description {
color: rgba(0,0,0,0.54);
line-height: 22px;
margin-top: 16px;
#digital-ocean img {
height: 22px;
width: 22px;
}
.card p {
margin: 16px 0 0 0;
color: rgba(255, 255, 255, 0.54);
}
.card .cardRightColumn {
display: inline-block;
vertical-align: top;
width: 190px;
line-height: 32px;
.card .description {
color: rgba(0,0,0,0.87);
letter-spacing: 0;
line-height: 32px;
margin: 24px 0px 0px 50px;
line-height: 24px;
}
.card .cardRightColumn ul {
.card .description ul {
margin-top: 0px;
padding-left: 16px;
}
#digitalOcean .cardRightColumn ul {
.card .description ul li {
margin-bottom: 8px;
}
.card-footer {
height: 54px;
border-top: 1px solid rgba(0,0,0,0.12);
}
.card-footer paper-button {
width: 100%;
height: 100%;
margin: 0;
letter-spacing: 0.75px;
background-color: inherit;
color: rgba(0,0,0,0.87);
}
#digital-ocean .card-footer {
border-top: 1px solid rgba(255,255,255,0.12);
}
#digital-ocean .card-footer paper-button {
color: rgba(255,255,255,0.87);
}
#digital-ocean .description ul {
/* NOTE: this URL must be relative to the ui_components sub dir,
unlike our <img src="..."> attributes */
list-style-image: url('../images/check_blue.svg');
list-style-image: url('../images/check_white.svg');
color: rgba(255,255,255,0.87);
}
#manualServer .cardRightColumn ul {
#manual-server .description ul {
list-style-image: url('../images/check_green.svg');
}
#aws .description ul {
list-style-image: url('../images/check_orange.svg');
}
#gcp .description ul {
list-style-image: url('../images/check_blue.svg');
}
.dimmed {
color: rgba(255, 255, 255, 0.54);
}
</style>
<outline-step-view>
<span slot="step-title">Choose a server, set up Outline.</span>
<span slot="step-title">Choose a cloud service, set up Outline.</span>
<span slot="step-description">Don't have a server? Create an account<br/> with DigitalOcean.</span>
<div id='digitalOcean' class='card'>
<div class="cardHeader">
<div class='difficultyLevel'>RECOMMENDED</div>
<img src="images/digital_ocean_logo.svg">
</div>
<div class="cardBody">
<div class='cardLeftColumn'>
<div class='title'>Set up Outline on DigitalOcean</div>
<div class="container">
<div id="digital-ocean" class="card" on-tap="connectToDigitalOceanTapped">
<div class="card-header">
<div class="tag">RECOMMENDED</div>
<img src="images/do_white_logo.svg">
</div>
<div class='cardRightColumn'>
<ul>
<li>Easiest setup process</li>
<li>Only $5 a month</li>
<li>1 TB of data transfer</li>
<li>Cancel at anytime</li>
</ul>
<div class="card-title">DigitalOcean</div>
<div class="card-body">
<div class="description">
<ul>
<li>Easiest setup process</li>
<li>Only $5 a month</li>
<li>1 TB of data transfer</li>
<li>Cancel at anytime</li>
</ul>
</div>
</div>
<div class="card-footer">
<paper-button on-tap="connectToDigitalOceanTapped" class="primary">Get started</paper-button>
</div>
<paper-button on-tap="connectToDigitalOceanTapped" class="primary">Connect with DigitalOcean</paper-button>
</div>
</div> <!-- end of #digitalOcean -->
<div id='manualServer' class='card'>
<div class="cardHeader">
<div class='difficultyLevel'>ADVANCED</div>
<img src="images/cloud.svg">
</div>
<div class="cardBody">
<div class='cardLeftColumn'>
<div class='title'>Set up Outline anywhere</div>
<div class='description'>Outline can run on all major cloud providers. You can also deploy it on your own infrastructure.</div>
<div id="gcp" class="card" on-tap="setUpGcpTapped">
<div class="card-header">
<div class="tag">ADVANCED</div>
<img src="images/gcp-logo.svg">
</div>
<div class='cardRightColumn'>
<div>Tested on:</div>
<ul>
<li>Amazon EC2</li>
<li>Google Compute Engine</li>
<li>Vultr</li>
<li>Linode</li>
<li>Liquid Web</li>
</ul>
<div class="card-title">Google Cloud Platform</div>
<div class="card-body">
<div class="description">
<ul>
<li>Step-by-step set-up guide</li>
<li>Firewall instructions</li>
<li>Simple install commands</li>
</ul>
</div>
</div>
<div class="card-footer">
<paper-button on-tap="setUpGcpTapped" class="primary">Get started</paper-button>
</div>
<paper-button on-tap='manualServerTapped'>Get started</paper-button>
</div>
</div> <!-- end of #manualServer -->
<div id="aws" class="card" on-tap="setUpAwsTapped">
<div class="card-header">
<div class="tag">ADVANCED</div>
<img src="images/aws-logo.svg">
</div>
<div class="card-title">Amazon Web Services</div>
<div class="card-body">
<div class="description">
<ul>
<li>Step-by-step set-up guide</li>
<li>EC2 firewall instructions</li>
<li>Simple install commands</li>
</ul>
</div>
</div>
<div class="card-footer">
<paper-button on-tap="setUpAwsTapped" class="primary">Get started</paper-button>
</div>
</div>
<div id="manual-server" class="card" on-tap="setUpGenericCloudProviderTapped">
<div class="card-header">
<div class="tag">ADVANCED</div>
<img src="images/cloud.svg">
</div>
<div class="card-title">Set up Outline anywhere</div>
<div class="card-body">
<div class='description'>
<ul>
<li>Tested on VULTR, Linode, and Liquid Web</li>
<li>Simple install commands</li>
</ul>
</div>
</div>
<div class="card-footer">
<paper-button on-tap="setUpGenericCloudProviderTapped">Get started</paper-button>
</div>
</div>
</div>
</outline-step-view>
</template>
@ -182,8 +275,14 @@
connectToDigitalOceanTapped: function() {
this.fire('ConnectToDigitalOcean');
},
manualServerTapped: function() {
this.fire('OpenManualServerEntry');
setUpGenericCloudProviderTapped: function() {
this.fire('SetUpGenericCloudProviderRequested');
},
setUpAwsTapped: function() {
this.fire('SetUpAwsRequested');
},
setUpGcpTapped: function() {
this.fire('SetUpGcpRequested');
}
});
</script>

View file

@ -14,12 +14,14 @@
limitations under the License.
-->
<link rel='import' href='../bower_components/polymer/polymer.html'>
<link rel='import' href='../bower_components/iron-collapse/iron-collapse.html'>
<link rel='import' href='../bower_components/iron-icon/iron-icon.html'>
<link rel='import' href='../bower_components/iron-icons/iron-icons.html'>
<link rel='import' href='../bower_components/paper-button/paper-button.html'>
<link rel='import' href='../bower_components/paper-dialog/paper-dialog.html'>
<link rel='import' href='../bower_components/paper-progress/paper-progress.html'>
<link rel="import" href="./cloud-install-styles.html">
<link rel="import" href="./outline-cloud-instructions-view.html">
<link rel="import" href="./outline-step-view.html">
<link rel="import" href="./style.css">
@ -36,18 +38,75 @@
border-radius: 2px;
margin: 24px;
text-align: left;
padding: 24px;
}
.card-section {
padding: 24px 12px;
}
.card-section:not(:first-child) {
border-top: 1px solid rgba(0,0,0,0.12);;
}
.section-header {
padding: 0 6px 0;
display: flex;
}
.instructions {
color: black;
font-size: 16px;
color: rgba(0,0,0,0.87);
line-height: 26px;
margin-left: 16px;
flex: 2;
}
.stepcircle {
height: 26px;
width: 26px;
font-size: 14px;
background-color: rgba(0, 0, 0, 0.34);
border-radius: 50%;
float: left;
vertical-align: middle;
color: #fff;
background-color: #141414;
margin: auto;
text-align: center;
line-height: 26px;
}
.drop-down > * {
vertical-align: middle;
}
.drop-down span {
margin: 0 6px;
}
.drop-down:hover {
cursor: pointer;
}
.section-content {
margin: 24px 12px 0 48px;
}
.section-content-instructions {
margin: 24px 12px;
}
.section-content-instructions li {
margin-bottom: 24px;
}
.section-content-instructions a {
color: #00BFA5;
}
.section-content-instructions iron-icon {
color: #00BFA5;
width: 16px;
height: 16px;
margin-left: 4px;
vertical-align: middle;
}
.code {
background-color: #ECEFF1;
color: black;
color: rgba(0,0,0,0.87);
font-size: 14px;
font-family: RobotoMono-Regular, monospace;
margin: 20px 0 40px 0;
padding: 14px;
line-height: 24px;
border-radius: 4px;
border-bottom: 2px solid #263238;
padding: 24px;
word-break: break-all;
}
textarea {
@ -55,26 +114,19 @@
border: none;
outline: none;
box-sizing: border-box;
border-bottom: 2px solid #263238;
}
iron-icon {
display: inline-block;
vertical-align: top;
color: black;
}
.stepContent {
display: inline-block;
vertical-align: top;
width: 442px;
margin-left: 20px;
}
#buttonRow {
width: 100%;
#button-row {
display: flex;
justify-content: space-between;
padding: 0 24px 24px 60px;
}
paper-button {
width: 45%;
margin: 0;
}
paper-progress {
margin: 0;
@ -88,36 +140,119 @@
box-shadow: 0 0 2px 0 rgba(0,0,0,0.14), 0 2px 2px 0 rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20);
border-radius: 2px;
width: 45%;
background-color: #1DE9B6;
color: rgba(0,0,0,0.87);
}
#terminalIcon {
width: 20px;
#aws-logo {
vertical-align: top;
}
</style>
<outline-step-view>
<span slot="step-title">Set up Outline on your server.</span>
<span slot="step-description">Follow these instructions to install Outline with a<br/> cloud provider or on your own infrastructure.</span>
<span slot="step-title">Follow the instructions below</span>
<span slot="step-description">These steps will help you install Outline<br/> on [[cloudProviderName]].</span>
<paper-progress hidden$='[[!showConnection]]' indeterminate class="slow"></paper-progress>
<div class='card'>
<div>
<iron-icon src="images/terminal.svg" id="terminalIcon"></iron-icon>
<div class='stepContent'>
<div class='instructions'>First, log into your server, and run the following command:</div>
<div id='command' class='code'>bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)"</div>
<div class="card">
<!-- GCP -->
<div class="card-section" hidden$="[[!isCloudProviderGcp]]">
<div class="section-header">
<span class="stepcircle">1</span>
<div class="instructions">Configure your firewall</div>
<div class="drop-down" on-tap="_toggleGcpDropDown">
<img src="images/gcp-logo.svg" />
<span>Instructions</span>
<iron-icon id="gcpDropDownIcon" icon="arrow-drop-down"></iron-icon>
</div>
</div>
<iron-collapse id="gcpDropDown">
<div class="section-content-instructions">
<outline-cloud-instructions-view title="Create a firewall rule" thumbnail-path="images/gcp-thumbnail-1.png" image-path="images/gcp-screenshot-1.png">
<ol>
<li><a href="https://console.cloud.google.com/networking/firewalls/add">Add a new firewall rule<iron-icon icon="open-in-new"></iron-icon></a> to your Compute Engine project.</li>
<li>Type 'outline' in the 'Name' field.</li>
<li>Type 'outline' in the 'Target tags' field.</li>
<li>Type '0.0.0.0/0' in the 'Source IP ranges' field.</li>
<li>Select 'Allow all' under 'Protocols and ports'.</li>
<li>Click 'Create'.</li>
</ol>
</outline-cloud-instructions-view>
</div>
<div class="section-content-instructions">
<outline-cloud-instructions-view title="Assign firewall rule" thumbnail-path="images/gcp-thumbnail-2.png" image-path="images/gcp-screenshot-2.png"">
<ol>
<li>Navigate to the <a href="https://console.cloud.google.com/compute/instances">VM instances screen<iron-icon icon="open-in-new"></iron-icon></a>.</li>
<li>Click on the instance where you want to host Outline.</li>
<li>Click 'EDIT' at the top of the VM Instance details screen.</li>
<li>Type 'outline' in the 'Network tags' field.</li>
<li>Click 'SAVE'.</li>
</ol>
</outline-cloud-instructions-view>
</div>
</iron-collapse>
</div>
<!-- AWS -->
<div class="card-section" hidden$="[[!isCloudProviderAws]]">
<div class="section-header">
<span class="stepcircle">1</span>
<div class="instructions">Configure your firewall</div>
<div class="drop-down" on-tap="_toggleAwsDropDown">
<img id="aws-logo" src="images/aws-logo.svg" />
<span>Instructions</span>
<iron-icon id="awsDropDownIcon" icon="arrow-drop-down"></iron-icon>
</div>
</div>
<iron-collapse id="awsDropDown">
<div class="section-content-instructions">
<outline-cloud-instructions-view title="Create a Security Group" thumbnail-path="images/aws-thumbnail-1.png" image-path="images/aws-screenshot-1.png">
<ol>
<li>Once you've created your EC2 instance, open the <a href="https://console.aws.amazon.com/ec2/v2/home">EC2 Management Console<iron-icon icon="open-in-new"></iron-icon></a>.</li>
<li>Under 'Network & Security', select 'Security Groups'.</li>
<li>Click on 'Create Security Group'.</li>
<li>Type 'outline' in the 'Security group name' and 'Description' fields.</li>
<li>Click 'Add Rule'.</li>
<li>Select 'All traffic' under 'Type', and 'Anywhere' under 'Source'.</li>
</ol>
</outline-cloud-instructions-view>
</div>
<div class="section-content-instructions">
<outline-cloud-instructions-view title="Assign Security Group" thumbnail-path="images/aws-thumbnail-2.png" image-path="images/aws-screenshot-2.png">
<ol>
<li>Navigate to <a href="https://console.aws.amazon.com/ec2/v2/home#Instances:sort=instanceId">Instances<iron-icon icon="open-in-new"></iron-icon></a>.</li>
<li>Click 'Actions' > 'Networking' > 'Change Security Groups' at the top of the 'Instances' screen.</li>
<li>Select the 'outline' Security Group, unselect other security groups.</li>
<li>Click 'Assign Security Groups'.</li>
</ol>
</outline-cloud-instructions-view>
</div>
</iron-collapse>
</div>
<!-- Install command -->
<div class="card-section">
<div class="section-header">
<span class="stepcircle" hidden$="[[!isGenericCloudProvider]]">1</span>
<span class="stepcircle" hidden$="[[isGenericCloudProvider]]">2</span>
<div class="instructions">Log into your server, and run this command.</div>
</div>
<div class="section-content">
<div id="command" class="code">bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)"</div>
</div>
</div>
<div>
<iron-icon icon="content-paste"></iron-icon>
<div class='stepContent'>
<div class='instructions'>Second, paste the output from the installation process here and click 'Done'.</div>
<textarea id='serverConfig' type='text' placeholder$='[[placeholderText]]' class='code' rows='4'></textarea>
<!-- Paste input -->
<div class="card-section">
<div class="section-header">
<span class="stepcircle" hidden$="[[!isGenericCloudProvider]]">2</span>
<span class="stepcircle" hidden$="[[isGenericCloudProvider]]">3</span>
<div class="instructions">Paste your installation output here.</div>
</div>
<div class="section-content">
<textarea id="serverConfig" type="text" placeholder$="[[placeholderText]]" class="code" rows="3"></textarea>
</div>
</div>
<div id='buttonRow'>
<paper-button id='cancelButton' on-tap="cancelTapped" class="secondary">CANCEL</paper-button>
<paper-button id='doneButton' on-tap="doneTapped" class="primary">DONE</paper-button>
<div id="button-row">
<paper-button id="cancelButton" on-tap="cancelTapped" class="secondary">CANCEL</paper-button>
<paper-button id="doneButton" on-tap="doneTapped" class="primary">DONE</paper-button>
</div>
</div> <!-- end of .card -->
</div>
</outline-step-view>
<paper-dialog id='errorDialog' modal>
@ -136,10 +271,30 @@
errorText: String,
placeholderText: {
type: String,
value: '{"apiUrl":"https://xxx.xxx.xxx.xxx:xxxxx/xxxxxxxxxxxxxxxxxxxxxx","certSha256":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}'
value: '{"apiUrl":"https://xxx.xxx.xxx.xxx:xxxxx/xxxxxxxxxxxxxxxxxxxxxx","certSha256":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}'
},
showConnection: Boolean
showConnection: Boolean,
cloudProvider: {
type: String,
value: 'generic'
},
cloudProviderName: {
type: String,
computed: '_computeCloudProviderName(cloudProvider)'
},
isCloudProviderAws: {
type: Boolean,
computed: '_computeIsCloudProviderAws(cloudProvider)'
},
isCloudProviderGcp: {
type: Boolean,
computed: '_computeIsCloudProviderGcp(cloudProvider)'
},
isGenericCloudProvider: {
type: Boolean,
computed: '_computeIsGenericCloudProvider(cloudProvider)'
}
},
showError: function(errorTitle, errorMessage) {
this.showConnection = false;
@ -174,6 +329,34 @@
this.clearError();
this.showConnection = false;
this.$.errorDialog.close();
this.$.awsDropDown.hide();
this.$.gcpDropDown.hide();
},
_computeCloudProviderName: function(cloudProvider) {
switch(cloudProvider) {
case 'aws': return 'Amazon Web Services';
case 'gcp': return 'Google Cloud Platform';
default: return 'your server';
}
},
_computeIsCloudProviderAws: function(cloudProvider) {
return cloudProvider === 'aws'
},
_computeIsCloudProviderGcp: function(cloudProvider) {
return cloudProvider === 'gcp'
},
_computeIsGenericCloudProvider: function(cloudProvider) {
return cloudProvider === 'generic';
},
_toggleAwsDropDown: function() {
this._toggleDropDown(this.$.awsDropDown, this.$.awsDropDownIcon)
},
_toggleGcpDropDown: function() {
this._toggleDropDown(this.$.gcpDropDown, this.$.gcpDropDownIcon);
},
_toggleDropDown: function(dropDown, icon) {
dropDown.toggle();
icon.icon = dropDown.opened ? 'arrow-drop-up' : 'arrow-drop-down';
}
});
</script>

View file

@ -37,7 +37,8 @@ const DIGITALOCEAN_REFERRAL_CODE = '5ddb4219b716';
// These functions are defined in electron_app/preload.ts.
declare function onElectronEvent(event: string, listener: () => void): void;
declare function sendElectronEvent(event: string): void;
// tslint:disable-next-line:no-any
declare function sendElectronEvent(event: string, ...args: any[]): void;
interface OauthSession {
result: Promise<string>;
isCancelled(): boolean;
@ -185,6 +186,10 @@ export class App {
this.cancelServerCreation(this.selectedServer);
});
appRoot.addEventListener('OpenImageRequested', (event: PolymerEvent) => {
sendElectronEvent('open-image', event.detail.imagePath, event.detail.windowTitle);
});
onElectronEvent('update-downloaded', this.displayAppUpdateNotification.bind(this));
sendElectronEvent('app-ui-ready');
}