removing js and cleaning up html

master
lalanza808 4 years ago
parent 49eb97894a
commit bc466aa82c

@ -22,13 +22,13 @@ pub fn home() -> Template {
whoami.trim_end(),
hostname.trim_end()
);
let context: JsonValue = json!({
"show_config": show_config.trim_end(),
"uptime": uptime.trim_end(),
"netstat_info": netstat_info,
"shell_ps1": shell_ps1,
});
Template::render("home", context)
}
@ -36,7 +36,7 @@ pub fn home() -> Template {
pub fn add_peer() -> Template {
let new_key = wg_cmd("genkey".to_string());
let state = WireGuardOptions { ..Default::default() };
let full_config = format!("[Interface]
let peer_config = format!("[Interface]
PrivateKey = {}
Address = 10.66.66.2/32
DNS = {}
@ -54,12 +54,13 @@ PersistentKeepalive = 21",
state.port
);
let qr_code: String = qrcode_generator::to_svg_to_string(
&full_config, QrCodeEcc::Low, 256, None
&peer_config, QrCodeEcc::Low, 256, None
).unwrap();
let qr_code: String = base64::encode(qr_code);
let context: JsonValue = json!({
"qr_code": qr_code,
"full_config": full_config
"peer_config": peer_config
});
Template::render("add_peer", context)
}

@ -8,7 +8,7 @@
<h2>Add A Peer</h2>
</header>
<p>The following configuration has been generated by the server. Refresh for new keys.</br>The keys and peer info will not be configured on the interface until you confirm with the buttons below.</p>
<div class="code">{{ full_config }}</div>
<div class="code">{{ peer_config }}</div>
<img src="data:image/svg+xml;base64,{{ qr_code }}" width=200 class="center">
<hr>
<button type="submit">Configure (wip)</button>

@ -28,8 +28,8 @@
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="/" id="top-link"><span class="icon solid fa-home">Home</span></a></li>
<li><a href="/add-peer" id="about-link"><span class="icon solid fa-user">Add A Peer</span></a></li>
<li><a href="/"><span class="icon solid fa-home">Home</span></a></li>
<li><a href="/add-peer"><span class="icon solid fa-user">Add A Peer</span></a></li>
<!-- <li><a href="#portfolio" id="portfolio-link"><span class="icon solid fa-th">wip</span></a></li>
<li><a href="#contact" id="contact-link"><span class="icon solid fa-envelope">wip</span></a></li> -->
</ul>
@ -72,11 +72,11 @@
<!-- </div> -->
<!-- Scripts -->
<script src="/static/js/jquery.min.js"></script>
<!-- <script src="/static/js/jquery.min.js"></script> -->
<!-- <script src="/static/js/browser.min.js"></script> -->
<script src="/static/js/breakpoints.min.js"></script>
<script src="/static/js/util.js"></script>
<script src="/static/js/main.js"></script>
<!-- <script src="/static/js/breakpoints.min.js"></script> -->
<!-- <script src="/static/js/util.js"></script> -->
<!-- <script src="/static/js/main.js"></script> -->
</body>
</html>

@ -2,6 +2,7 @@
{% block content %}
<meta http-equiv="refresh" content="5">
<section id="top" class="">
<div class="container">
<header>
@ -12,11 +13,11 @@
{{ shell_ps1 }} <strong>uptime</strong>
{{ uptime }}
{{ shell_ps1 }} <strong>netstat -tan | grep "ESTABLISHED\|CLOSE_WAIT"</strong>
{{ netstat_info }}
{{ shell_ps1 }} <strong>wg show</strong>
{% if show_config %}{{ show_config }}{% else %}It doesn't look like the tunnel interface is up yet.{% endif %}
{{ shell_ps1 }} <strong>netstat -tan | grep "ESTABLISHED\|CLOSE_WAIT"</strong>
{{ netstat_info }}
</div>
</div>
</section>

Loading…
Cancel
Save