From 32a8b08c3ab41873273ecbbb909985177da01f64 Mon Sep 17 00:00:00 2001 From: Ivan Gromov Date: Thu, 2 Apr 2020 01:47:18 +0500 Subject: [PATCH] Removed do regions request, re-added run and status --- app/server.py | 14 -------- app/static/command-preview.vue | 42 ++++++++++++++++++++++++ app/static/index.html | 47 ++++++++++++++++++++++----- app/static/provider-do.vue | 11 +++---- app/static/provider-setup.vue | 10 ++++-- app/static/status-running.vue | 59 ++++++++++++++++++++++++++++++++++ app/static/vpn-setup.vue | 6 ++-- 7 files changed, 154 insertions(+), 35 deletions(-) create mode 100644 app/static/command-preview.vue create mode 100644 app/static/status-running.vue 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 @@ + + + + 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 @@