implement nav
This commit is contained in:
parent
f89b05a084
commit
84b5d3b7cc
|
@ -0,0 +1,47 @@
|
|||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body > * {
|
||||
box-sizing: border-box;
|
||||
float: left;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
#main {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 192px;
|
||||
width: calc(100% - 192px);
|
||||
}
|
||||
|
||||
#nav {
|
||||
width: 192px;
|
||||
background-color: #cccccc;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
padding: 0px 4px 0px 4px;
|
||||
margin: 2px;
|
||||
background-color: #800000;
|
||||
color: #ddd;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-item:hover {
|
||||
background-color: #ffffff;
|
||||
color: #800000;
|
||||
}
|
||||
|
||||
.nav {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 576px) {
|
||||
#main, #nav {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
154
src/main.rs
154
src/main.rs
|
@ -71,40 +71,57 @@ fn generate_servershtml(config: &ListgenConfig) -> String {
|
|||
<html>
|
||||
<head>
|
||||
<title>"e3team Servers"</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<link rel="stylesheet" href="nav.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>"e3team-owned servers"</h1>
|
||||
<p>"e3team owns and controls several servers around the globe. Following is a list of them all:"</p>
|
||||
<table style="border: 1px solid;">
|
||||
<tr>
|
||||
<th style="border: 1px solid;">"Hostname"</th>
|
||||
<th style="border: 1px solid;">"Public?"</th>
|
||||
<th style="border: 1px solid;">"Public IP"</th>
|
||||
<th style="border: 1px solid;">"Edge?"</th>
|
||||
<th style="border: 1px solid;">"Domain Name"</th>
|
||||
<th style="border: 1px solid;">"Ownership"</th>
|
||||
<th style="border: 1px solid;">"Country"</th>
|
||||
<th style="border: 1px solid;">"Region"</th>
|
||||
<th style="border: 1px solid;">"Primary Admin(s)"</th>
|
||||
</tr>
|
||||
{ config.servers.iter().map(|u| {
|
||||
html! (
|
||||
<tr>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.hostname) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if u.public { "Yes" } else { "No" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if let Some(ips) = &u.public_ips { ips.iter().map(|u| u.to_string()).collect::<Vec<_>>().join(", ") } else { "N/A".into() } ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if u.edge { "Yes" } else { "No" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if let Some(domain) = &u.domain { domain.as_str() } else { "N/A" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if matches!(u.ownership, ListgenConfigServerOwnership::Rented) { "Rented" } else { "Owned" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.country ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.region ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.admins.join(", ")) }</td>
|
||||
</tr>
|
||||
)
|
||||
})}
|
||||
</table>
|
||||
<p>"Generated automatically by e3t-listgen from "<a href="listing.yaml">"listing.yaml"</a>"."</p>
|
||||
<a href="services.html">"View our services list"</a>
|
||||
<div id="nav">
|
||||
<div class="nav-section">
|
||||
<span>"Navigation"</span>
|
||||
<a class="nav-item" href="/">"About"</a>
|
||||
<a class="nav-item" href="services.html">"Services"</a>
|
||||
<a class="nav-item" href="servers.html">"Machines"</a>
|
||||
</div>
|
||||
<div class="nav-section">
|
||||
<span>"another entry"</span>
|
||||
<a class="nav-item" href="example">"example"</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>"e3team-owned servers"</h1>
|
||||
<p>"e3team owns and controls several servers around the globe. Following is a list of them all:"</p>
|
||||
<table style="border: 1px solid;">
|
||||
<tr>
|
||||
<th style="border: 1px solid;">"Hostname"</th>
|
||||
<th style="border: 1px solid;">"Public?"</th>
|
||||
<th style="border: 1px solid;">"Public IP"</th>
|
||||
<th style="border: 1px solid;">"Edge?"</th>
|
||||
<th style="border: 1px solid;">"Domain Name"</th>
|
||||
<th style="border: 1px solid;">"Ownership"</th>
|
||||
<th style="border: 1px solid;">"Country"</th>
|
||||
<th style="border: 1px solid;">"Region"</th>
|
||||
<th style="border: 1px solid;">"Primary Admin(s)"</th>
|
||||
</tr>
|
||||
{ config.servers.iter().map(|u| {
|
||||
html! (
|
||||
<tr>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.hostname) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if u.public { "Yes" } else { "No" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if let Some(ips) = &u.public_ips { ips.iter().map(|u| u.to_string()).collect::<Vec<_>>().join(", ") } else { "N/A".into() } ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if u.edge { "Yes" } else { "No" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if let Some(domain) = &u.domain { domain.as_str() } else { "N/A" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if matches!(u.ownership, ListgenConfigServerOwnership::Rented) { "Rented" } else { "Owned" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.country ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.region ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.admins.join(", ")) }</td>
|
||||
</tr>
|
||||
)
|
||||
})}
|
||||
</table>
|
||||
<p>"Generated automatically by e3t-listgen from "<a href="listing.yaml">"listing.yaml"</a>"."</p>
|
||||
<a href="services.html">"View our services list"</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
@ -116,36 +133,53 @@ fn generate_serviceslist(config: &ListgenConfig) -> String {
|
|||
<html>
|
||||
<head>
|
||||
<title>"e3team Services"</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<link rel="stylesheet" href="nav.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>"e3team-hosted servers"</h1>
|
||||
<p>"e3team hosts many services on it's servers around the globe. Many are public. Following is a list of them all:"</p>
|
||||
<table style="border: 1px solid;">
|
||||
<tr>
|
||||
<th style="border: 1px solid;">"Name"</th>
|
||||
<th style="border: 1px solid;">"Software"</th>
|
||||
<th style="border: 1px solid;">"Public?"</th>
|
||||
<th style="border: 1px solid;">"Public URL"</th>
|
||||
<th style="border: 1px solid;">"Hosted On"</th>
|
||||
<th style="border: 1px solid;">"Backed Up"</th>
|
||||
<th style="border: 1px solid;">"Primary Admin(s)"</th>
|
||||
</tr>
|
||||
{ config.services.iter().map(|u| {
|
||||
html! (
|
||||
<tr>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.name) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.software) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if u.public { "Yes" } else { "No" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.url ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.host) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.backups ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.admins.join(", ")) }</td>
|
||||
</tr>
|
||||
)
|
||||
})}
|
||||
</table>
|
||||
<p>"Generated automatically by e3t-listgen from "<a href="listing.yaml">"listing.yaml"</a>"."</p>
|
||||
<a href="servers.html">"View our server list"</a>
|
||||
<div id="nav">
|
||||
<div class="nav-section">
|
||||
<span>"Navigation"</span>
|
||||
<a class="nav-item" href="/">"About"</a>
|
||||
<a class="nav-item" href="services.html">"Services"</a>
|
||||
<a class="nav-item" href="servers.html">"Machines"</a>
|
||||
</div>
|
||||
<div class="nav-section">
|
||||
<span>"another entry"</span>
|
||||
<a class="nav-item" href="example">"example"</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>"e3team-hosted servers"</h1>
|
||||
<p>"e3team hosts many services on it's servers around the globe. Many are public. Following is a list of them all:"</p>
|
||||
<table style="border: 1px solid;">
|
||||
<tr>
|
||||
<th style="border: 1px solid;">"Name"</th>
|
||||
<th style="border: 1px solid;">"Software"</th>
|
||||
<th style="border: 1px solid;">"Public?"</th>
|
||||
<th style="border: 1px solid;">"Public URL"</th>
|
||||
<th style="border: 1px solid;">"Hosted On"</th>
|
||||
<th style="border: 1px solid;">"Backed Up"</th>
|
||||
<th style="border: 1px solid;">"Primary Admin(s)"</th>
|
||||
</tr>
|
||||
{ config.services.iter().map(|u| {
|
||||
html! (
|
||||
<tr>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.name) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.software) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", if u.public { "Yes" } else { "No" }) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.url ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.host) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.backups ) }</td>
|
||||
<td style="border: 1px solid;">{ text!("{}", u.admins.join(", ")) }</td>
|
||||
</tr>
|
||||
)
|
||||
})}
|
||||
</table>
|
||||
<p>"Generated automatically by e3t-listgen from "<a href="listing.yaml">"listing.yaml"</a>"."</p>
|
||||
<a href="servers.html">"View our server list"</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue