mirror of
https://github.com/trailofbits/algo.git
synced 2025-07-24 14:33:02 +02:00
112 lines
3.6 KiB
HTML
112 lines
3.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="step = 'provider'"></vpn-setup>
|
|
</div>
|
|
</transition>
|
|
<transition name="fade">
|
|
<provider-setup v-if="step == 'provider'"
|
|
v-bind:extra_args="extra_args"
|
|
v-on:submit="step = 'command'"
|
|
v-on:back="step = 'setup'">
|
|
</provider-setup>
|
|
</transition>
|
|
<transition name="fade">
|
|
<command-preview v-if="step == 'command'"
|
|
v-bind:extra_args="extra_args"
|
|
v-on:submit="start(); step = 'running';"
|
|
v-on:back="step = 'provider'">
|
|
</command-preview>
|
|
</transition>
|
|
<transition name="fade">
|
|
<status-running v-if="step == 'running'"
|
|
v-on:submit="stop(); step = 'setup';">
|
|
</status-running>
|
|
</transition>
|
|
</div>
|
|
|
|
<script>
|
|
new window.Vue({
|
|
el: '#algo',
|
|
data: {
|
|
playbook: {},
|
|
step: 'setup',
|
|
extra_args: {
|
|
server_name: 'algo2',
|
|
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'),
|
|
'command-preview': window.httpVueLoader('/static/command-preview.vue'),
|
|
'status-running': window.httpVueLoader('/static/status-running.vue'),
|
|
},
|
|
created() {
|
|
fetch("/playbook")
|
|
.then(r => r.json())
|
|
.then(data => {
|
|
if (data.status === 'running') {
|
|
this.step = 'running';
|
|
}
|
|
});
|
|
},
|
|
methods: {
|
|
start: function() {
|
|
fetch("/playbook", {
|
|
method: "POST",
|
|
body: JSON.stringify(this.extra_args),
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
}
|
|
});
|
|
},
|
|
stop() {
|
|
fetch("/playbook", {
|
|
method: "DELETE"
|
|
});
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|