mirror of
https://github.com/trailofbits/algo.git
synced 2025-09-09 13:33:00 +02:00
Added full-page steps with transitions
This commit is contained in:
parent
34211a0362
commit
992b2d60bb
3 changed files with 41 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html class="h-100">
|
<html class="h-100" lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>Algo VPN</title>
|
<title>Algo VPN</title>
|
||||||
|
@ -10,19 +10,34 @@
|
||||||
integrity="sha256-NSuqgY2hCZJUN6hDMFfdxvkexI7+iLxXQbL540RQ/c4=" crossorigin="anonymous"></script>
|
integrity="sha256-NSuqgY2hCZJUN6hDMFfdxvkexI7+iLxXQbL540RQ/c4=" crossorigin="anonymous"></script>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css"
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css"
|
||||||
integrity="sha256-L/W5Wfqfa0sdBNIKN9cG6QA5F2qx4qICmU2VgLruv9Y=" crossorigin="anonymous">
|
integrity="sha256-L/W5Wfqfa0sdBNIKN9cG6QA5F2qx4qICmU2VgLruv9Y=" crossorigin="anonymous">
|
||||||
|
<style>
|
||||||
|
.fade-enter-active, .fade-leave-active {
|
||||||
|
transition: opacity 300ms ease-in-out;
|
||||||
|
}
|
||||||
|
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="d-flex flex-column h-100">
|
<body class="d-flex flex-column h-100">
|
||||||
<div class="container" id="algo">
|
<div class="container" id="algo">
|
||||||
<h1 class="mb-5 text-center">{{ title }}</h1>
|
<h1 class="mb-5 text-center">{{ title }}</h1>
|
||||||
<div class="row">
|
<transition name="fade">
|
||||||
|
<div class="row" v-if="step == 'setup'">
|
||||||
<user-config class="col-md-4 order-md-2 mb-4"></user-config>
|
<user-config class="col-md-4 order-md-2 mb-4"></user-config>
|
||||||
<vpn-setup class="col-md-8 order-md-1"
|
<vpn-setup class="col-md-8 order-md-1"
|
||||||
v-bind:extra_args="extra_args"
|
v-bind:extra_args="extra_args"
|
||||||
v-on:submit="on_setup_submit"></vpn-setup>
|
v-on:submit="set_step('provider'); update_extra_args"></vpn-setup>
|
||||||
</div>
|
</div>
|
||||||
<provider-setup v-bind:extra_args="extra_args" v-on:submit="on_provider_submit">
|
</transition>
|
||||||
|
<transition name="fade">
|
||||||
|
<provider-setup v-if="step == 'provider'"
|
||||||
|
v-bind:extra_args="extra_args"
|
||||||
|
v-on:submit="update_extra_args"
|
||||||
|
v-on:back="set_step('setup')">
|
||||||
</provider-setup>
|
</provider-setup>
|
||||||
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -30,6 +45,7 @@
|
||||||
el: '#algo',
|
el: '#algo',
|
||||||
data: {
|
data: {
|
||||||
playbook: {},
|
playbook: {},
|
||||||
|
step: 'setup',
|
||||||
extra_args: {
|
extra_args: {
|
||||||
server_name: "algo",
|
server_name: "algo",
|
||||||
ondemand_cellular: false,
|
ondemand_cellular: false,
|
||||||
|
@ -51,13 +67,11 @@
|
||||||
'provider-setup': window.httpVueLoader('/static/provider-setup.vue'),
|
'provider-setup': window.httpVueLoader('/static/provider-setup.vue'),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
on_setup_submit: function(extra_args) {
|
set_step: function(step) {
|
||||||
Object.assign(this.extra_args, extra_args);
|
this.step = step;
|
||||||
debugger;
|
|
||||||
},
|
},
|
||||||
on_provider_submit: function(extra_args) {
|
update_extra_args: function(extra_args) {
|
||||||
Object.assign(this.extra_args, extra_args);
|
Object.assign(this.extra_args, extra_args);
|
||||||
debugger;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="row" id="prodiver_id">
|
<div class="row" id="prodiver_id">
|
||||||
<h2 class="col-12">
|
<h2 class="col-12">
|
||||||
|
<button type="button" class="btn btn-secondary back-button" v-on:click="$emit('back')"><</button>
|
||||||
<span v-if="provider">{{ provider.name }} Setup</span>
|
<span v-if="provider">{{ provider.name }} Setup</span>
|
||||||
<span v-else>Select cloud provider</span>
|
<span v-else>Select cloud provider</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
@ -13,7 +14,7 @@
|
||||||
class="nav-link"
|
class="nav-link"
|
||||||
href="#prodiver_id"
|
href="#prodiver_id"
|
||||||
v-bind:class="{ active: item.alias === (provider && provider.alias) }"
|
v-bind:class="{ active: item.alias === (provider && provider.alias) }"
|
||||||
@click="set_provider(item)"
|
v-on:click="set_provider(item)"
|
||||||
>{{item.name}}</a>
|
>{{item.name}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -61,3 +62,10 @@ module.exports = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.back-button {
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 50%;
|
||||||
|
left: -2em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
Each user will have their own account for SSH tunneling
|
Each user will have their own account for SSH tunneling
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<button @click="$emit('submit')" class="btn btn-primary" type="button">Select Cloud Provider</button>
|
<button v-on:click="$emit('submit')" class="btn btn-primary" type="button">Select Cloud Provider</button>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Add table
Reference in a new issue