algo/app/static/index.html
2021-07-06 22:53:25 +03:00

81 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html class="h-100" lang="en">
<head>
<title>Algo VPN</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://cdn.jsdelivr.net/npm/http-vue-loader@1.4.2/src/httpVueLoader.js"
integrity="sha256-aOeVxnlZDaiJOHsqNWVOMNsKdiGxgT8kbLp1p1Rv2sc=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.js"
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"
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>
<body class="d-flex flex-column h-100">
<div class="container" id="algo">
<h1 class="mb-5 text-center">{{ title }}</h1>
<transition name="fade">
<div class="row" v-if="step == 'setup'">
<user-config class="col-md-4 order-md-2 mb-4"></user-config>
<vpn-setup class="col-md-8 order-md-1"
v-bind:extra_args="extra_args"
v-on:submit="set_step('provider'); update_extra_args"></vpn-setup>
</div>
</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>
</transition>
</div>
<script>
new window.Vue({
el: '#algo',
data: {
playbook: {},
step: 'setup',
extra_args: {
server_name: "algo",
ondemand_cellular: false,
ondemand_wifi: false,
dns_adblocking: false,
ssh_tunneling: false,
store_pki: false,
ondemand_wifi_exclude: []
}
},
computed: {
title() {
return 'Algo VPN Setup';
}
},
components: {
'user-config': window.httpVueLoader('/static/user-config.vue'),
'vpn-setup': window.httpVueLoader('/static/vpn-setup.vue'),
'provider-setup': window.httpVueLoader('/static/provider-setup.vue'),
},
methods: {
set_step: function(step) {
this.step = step;
},
update_extra_args: function(extra_args) {
Object.assign(this.extra_args, extra_args);
}
}
})
</script>
</body>
</html>