diff --git a/app/server.py b/app/server.py index 25a4fde..76b0651 100644 --- a/app/server.py +++ b/app/server.py @@ -100,20 +100,6 @@ async def post_config(request): return web.json_response({'ok': True}) -@routes.post('/do/regions') -async def get_do_regions(request): - data = await request.json() - async with aiohttp.ClientSession() as session: - url = 'https://api.digitalocean.com/v2/regions' - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer {0}'.format(data['token']), - } - async with session.get(url, headers=headers) as r: - json_body = await r.json() - return web.json_response(json_body) - - app = web.Application() app.router.add_routes(routes) web.run_app(app, port=9000) diff --git a/app/static/command-preview.vue b/app/static/command-preview.vue new file mode 100644 index 0000000..2177bbd --- /dev/null +++ b/app/static/command-preview.vue @@ -0,0 +1,42 @@ + + + + < + ๐ง Review and Start! + + + + {{cli_preview}} + + Run! + + + + + + diff --git a/app/static/index.html b/app/static/index.html index 2de60d1..fbd2e54 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -28,16 +28,28 @@ + v-on:submit="step = 'provider'"> + v-on:submit="step = 'command'" + v-on:back="step = 'setup'"> + + + + + + + + \ No newline at end of file + diff --git a/app/static/provider-setup.vue b/app/static/provider-setup.vue index 22f6856..cde0450 100644 --- a/app/static/provider-setup.vue +++ b/app/static/provider-setup.vue @@ -1,5 +1,5 @@ - + < {{ provider.name }} Setup @@ -12,7 +12,7 @@ v-bind:key="item.alias"> {{item.name}} @@ -49,12 +49,16 @@ module.exports = { ] } }, + // Warning: Mutable Object to edit parent props + props: ['extra_args'], methods: { set_provider(provider) { this.provider = provider; + this.extra_args.provider = provider.alias; }, on_provider_submit(extra_args) { - this.$emit('submit', Object.assign({provider: this.provider.alias}, extra_args)); + Object.assign(this.extra_args, extra_args); + this.$emit('submit'); } }, components: { diff --git a/app/static/status-running.vue b/app/static/status-running.vue new file mode 100644 index 0000000..2c90599 --- /dev/null +++ b/app/static/status-running.vue @@ -0,0 +1,59 @@ + + + ๐Please be patient + + VPN set up usually takes 5-15 minutes + You can close tab and open it again + You can try to STOP setup and run it again + Donโt close terminal! + + + + + + diff --git a/app/static/vpn-setup.vue b/app/static/vpn-setup.vue index 70c3d37..d8b27cb 100644 --- a/app/static/vpn-setup.vue +++ b/app/static/vpn-setup.vue @@ -103,9 +103,7 @@
+ {{cli_preview}} +
VPN set up usually takes 5-15 minutes
You can close tab and open it again
You can try to STOP setup and run it again
Donโt close terminal!