mirror of
https://github.com/redstrate/Kawari.git
synced 2025-05-07 05:07:44 +00:00
Add Bootstrap styling to most web pages
I haven't changed any of the content yet, only included the Boostrap CSS and unified their base template.
This commit is contained in:
parent
91ebe38de1
commit
f2c009b9a7
15 changed files with 155 additions and 55 deletions
67
Cargo.lock
generated
67
Cargo.lock
generated
|
@ -427,6 +427,12 @@ version = "0.3.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
|
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-sink"
|
||||||
|
version = "0.3.31"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-task"
|
name = "futures-task"
|
||||||
version = "0.3.31"
|
version = "0.3.31"
|
||||||
|
@ -514,6 +520,12 @@ dependencies = [
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http-range-header"
|
||||||
|
version = "0.4.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "httparse"
|
name = "httparse"
|
||||||
version = "1.10.1"
|
version = "1.10.1"
|
||||||
|
@ -757,6 +769,7 @@ dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_yaml_ng",
|
"serde_yaml_ng",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
"tower-http",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"zip",
|
"zip",
|
||||||
|
@ -887,6 +900,16 @@ version = "0.3.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mime_guess"
|
||||||
|
version = "2.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
|
||||||
|
dependencies = [
|
||||||
|
"mime",
|
||||||
|
"unicase",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "minijinja"
|
name = "minijinja"
|
||||||
version = "2.9.0"
|
version = "2.9.0"
|
||||||
|
@ -1457,6 +1480,19 @@ dependencies = [
|
||||||
"syn 2.0.100",
|
"syn 2.0.100",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tokio-util"
|
||||||
|
version = "0.7.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"futures-core",
|
||||||
|
"futures-sink",
|
||||||
|
"pin-project-lite",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tower"
|
name = "tower"
|
||||||
version = "0.5.2"
|
version = "0.5.2"
|
||||||
|
@ -1472,6 +1508,31 @@ dependencies = [
|
||||||
"tower-service",
|
"tower-service",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tower-http"
|
||||||
|
version = "0.6.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.9.0",
|
||||||
|
"bytes",
|
||||||
|
"futures-util",
|
||||||
|
"http",
|
||||||
|
"http-body",
|
||||||
|
"http-body-util",
|
||||||
|
"http-range-header",
|
||||||
|
"httpdate",
|
||||||
|
"mime",
|
||||||
|
"mime_guess",
|
||||||
|
"percent-encoding",
|
||||||
|
"pin-project-lite",
|
||||||
|
"tokio",
|
||||||
|
"tokio-util",
|
||||||
|
"tower-layer",
|
||||||
|
"tower-service",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tower-layer"
|
name = "tower-layer"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
|
@ -1526,6 +1587,12 @@ version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c"
|
checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicase"
|
||||||
|
version = "2.8.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.18"
|
version = "1.0.18"
|
||||||
|
|
|
@ -71,7 +71,7 @@ tracing-subscriber = { version = "0.3", features = ["fmt"], default-features = f
|
||||||
fastrand = { version = "2.3", features = ["std"], default-features = false }
|
fastrand = { version = "2.3", features = ["std"], default-features = false }
|
||||||
|
|
||||||
# HTML templates used in the web servers
|
# HTML templates used in the web servers
|
||||||
minijinja = { version = "2.9", features = ["serde", "loader"], default-features = false }
|
minijinja = { version = "2.9", features = ["serde", "loader", "multi_template"], default-features = false }
|
||||||
|
|
||||||
# Serialization of packets
|
# Serialization of packets
|
||||||
binrw = { version = "0.14", features = ["std"], default-features = false }
|
binrw = { version = "0.14", features = ["std"], default-features = false }
|
||||||
|
@ -100,3 +100,6 @@ reqwest = { version = "0.12", default-features = false }
|
||||||
|
|
||||||
# For RCON
|
# For RCON
|
||||||
rkon = { version = "0.1" }
|
rkon = { version = "0.1" }
|
||||||
|
|
||||||
|
# For serving static files on the website
|
||||||
|
tower-http = { version = "0.6", features = ["fs"] }
|
||||||
|
|
6
resources/static/bootstrap.min.css
vendored
Normal file
6
resources/static/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,8 @@
|
||||||
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
|
{% block title %}Manage Account{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
<p>Managing account {{ username }}</p>
|
<p>Managing account {{ username }}</p>
|
||||||
<a href="/account/app/svc/logout">Logout</a>
|
<a href="/account/app/svc/logout">Logout</a>
|
||||||
<a href="/account/app/svc/mbrPasswd">Change Password</a>
|
<a href="/account/app/svc/mbrPasswd">Change Password</a>
|
||||||
|
@ -9,3 +14,4 @@
|
||||||
<input type="file" id="charbak" name="charbak" accept="application/zip" />
|
<input type="file" id="charbak" name="charbak" accept="application/zip" />
|
||||||
<button type='submit'>Upload</button>
|
<button type='submit'>Upload</button>
|
||||||
</form>
|
</form>
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
|
{% block title %}Kawari Admin Panel{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
<p>Gate open:{{ worlds_open }}</p>
|
<p>Gate open:{{ worlds_open }}</p>
|
||||||
<p>Gate open:{{ login_open }}</p>
|
<p>Gate open:{{ login_open }}</p>
|
||||||
<p>Boot patch location:{{ boot_patch_location }}</p>
|
<p>Boot patch location:{{ boot_patch_location }}</p>
|
||||||
|
@ -15,4 +20,5 @@
|
||||||
<input type='text' id='boot_patch_location' name='boot_patch_location'/>
|
<input type='text' id='boot_patch_location' name='boot_patch_location'/>
|
||||||
</label>
|
</label>
|
||||||
<button type='submit'>Apply</button>
|
<button type='submit'>Apply</button>
|
||||||
</form>
|
</form>
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
<!DOCTYPE html>
|
{% extends "layout.html" %}
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Kawari - Change Password</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
{% block title %}Kawari - Change Password{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
<form method='post'>
|
<form method='post'>
|
||||||
<label for="old_password">Old Password:</label><br>
|
<label for="old_password">Old Password:</label><br>
|
||||||
<input type='text' id='old_password' name='old_password'/><br>
|
<input type='text' id='old_password' name='old_password'/><br>
|
||||||
|
@ -13,6 +10,4 @@
|
||||||
<input type='text' id='new_ppassword' name='new_password'/><br>
|
<input type='text' id='new_ppassword' name='new_password'/><br>
|
||||||
<button type='submit'>Submit</button>
|
<button type='submit'>Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
{% endblock %}
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
10
resources/templates/layout.html
Normal file
10
resources/templates/layout.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>{% block title %}some website{% endblock %}</title>
|
||||||
|
<link href="/static/bootstrap.min.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>{% block body %}{% endblock %}</body>
|
||||||
|
</html>
|
|
@ -1,11 +1,8 @@
|
||||||
<!DOCTYPE html>
|
{% extends "layout.html" %}
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Kawari - Login</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
{% block title %}Kawari - Login{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
<form method='post'>
|
<form method='post'>
|
||||||
<label for="username">Username:</label><br>
|
<label for="username">Username:</label><br>
|
||||||
<input type='text' id='username' name='username'/><br>
|
<input type='text' id='username' name='username'/><br>
|
||||||
|
@ -14,5 +11,4 @@
|
||||||
<button type='submit'>Login</button>
|
<button type='submit'>Login</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</body>
|
{% endblock %}
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
<!DOCTYPE html>
|
{% extends "layout.html" %}
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Kawari -Register</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
{% block title %}Kawari - Register{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
<form action='/oauth/oa/registlist' method='post'>
|
<form action='/oauth/oa/registlist' method='post'>
|
||||||
<label for="username">Username:</label><br>
|
<label for="username">Username:</label><br>
|
||||||
<input type='text' id='username' name='username'/><br>
|
<input type='text' id='username' name='username'/><br>
|
||||||
|
@ -13,6 +10,4 @@
|
||||||
<input type='text' id='password' name='password'/><br>
|
<input type='text' id='password' name='password'/><br>
|
||||||
<button type='submit'>Register</button>
|
<button type='submit'>Register</button>
|
||||||
</form>
|
</form>
|
||||||
|
{% endblock %}
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
<!DOCTYPE html>
|
{% extends "layout.html" %}
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Kawari</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
{% block title %}Kawari{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
<p>Welcome to Kawari!</p>
|
<p>Welcome to Kawari!</p>
|
||||||
|
|
||||||
<a href="http://{{ login_server }}/oauth/oa/oauthlogin">Login</a>
|
<a href="http://{{ login_server }}/oauth/oa/oauthlogin">Login</a>
|
||||||
<a href="http://{{ login_server }}/oauth/oa/registligt">Signup</a>
|
<a href="http://{{ login_server }}/oauth/oa/registligt">Signup</a>
|
||||||
<a href="/worldstatus">World Status</a>
|
<a href="/worldstatus">World Status</a>
|
||||||
|
{% endblock %}
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
<!DOCTYPE html>
|
{% extends "layout.html" %}
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Kawari - World Status</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
{% block title %}Kawari - World Status{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
<p>Worlds open: {{ worlds_open }}</p>
|
<p>Worlds open: {{ worlds_open }}</p>
|
||||||
<p>Login open: {{ login_open }}</p>
|
<p>Login open: {{ login_open }}</p>
|
||||||
|
{% endblock %}
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -5,9 +5,16 @@ use kawari::config::get_config;
|
||||||
use minijinja::Environment;
|
use minijinja::Environment;
|
||||||
use minijinja::context;
|
use minijinja::context;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use tower_http::services::ServeDir;
|
||||||
|
|
||||||
fn setup_default_environment() -> Environment<'static> {
|
fn setup_default_environment() -> Environment<'static> {
|
||||||
let mut env = Environment::new();
|
let mut env = Environment::new();
|
||||||
|
env.add_template_owned(
|
||||||
|
"layout.html",
|
||||||
|
std::fs::read_to_string("resources/templates/layout.html")
|
||||||
|
.expect("Failed to find template!"),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
env.add_template_owned(
|
env.add_template_owned(
|
||||||
"admin.html",
|
"admin.html",
|
||||||
std::fs::read_to_string("resources/templates/admin.html")
|
std::fs::read_to_string("resources/templates/admin.html")
|
||||||
|
@ -74,7 +81,8 @@ async fn main() {
|
||||||
|
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/", get(root))
|
.route("/", get(root))
|
||||||
.route("/apply", post(apply));
|
.route("/apply", post(apply))
|
||||||
|
.nest_service("/static", ServeDir::new("resources/static"));
|
||||||
|
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ use axum::{
|
||||||
use kawari::config::get_config;
|
use kawari::config::get_config;
|
||||||
use reqwest::{StatusCode, header};
|
use reqwest::{StatusCode, header};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use tower_http::services::ServeDir;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
struct GateStatus {
|
struct GateStatus {
|
||||||
|
@ -153,7 +154,8 @@ async fn main() {
|
||||||
"/frontier-api/ffxivsupport/information/get_headline_all",
|
"/frontier-api/ffxivsupport/information/get_headline_all",
|
||||||
get(get_headline_all),
|
get(get_headline_all),
|
||||||
)
|
)
|
||||||
.fallback(fallback);
|
.fallback(fallback)
|
||||||
|
.nest_service("/static", ServeDir::new("resources/static"));
|
||||||
|
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,16 @@ use kawari::lobby::send_custom_world_packet;
|
||||||
use kawari::login::{LoginDatabase, LoginError};
|
use kawari::login::{LoginDatabase, LoginError};
|
||||||
use minijinja::{Environment, context};
|
use minijinja::{Environment, context};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
use tower_http::services::ServeDir;
|
||||||
|
|
||||||
fn setup_default_environment() -> Environment<'static> {
|
fn setup_default_environment() -> Environment<'static> {
|
||||||
let mut env = Environment::new();
|
let mut env = Environment::new();
|
||||||
|
env.add_template_owned(
|
||||||
|
"layout.html",
|
||||||
|
std::fs::read_to_string("resources/templates/layout.html")
|
||||||
|
.expect("Failed to find template!"),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
env.add_template_owned(
|
env.add_template_owned(
|
||||||
"login.html",
|
"login.html",
|
||||||
std::fs::read_to_string("resources/templates/login.html")
|
std::fs::read_to_string("resources/templates/login.html")
|
||||||
|
@ -283,7 +290,8 @@ async fn main() {
|
||||||
.route("/account/app/svc/logout", get(logout))
|
.route("/account/app/svc/logout", get(logout))
|
||||||
.route("/account/app/svc/mbrPasswd", get(change_password))
|
.route("/account/app/svc/mbrPasswd", get(change_password))
|
||||||
.route("/account/app/svc/mbrCancel", get(cancel_account))
|
.route("/account/app/svc/mbrCancel", get(cancel_account))
|
||||||
.with_state(state);
|
.with_state(state)
|
||||||
|
.nest_service("/static", ServeDir::new("resources/static"));
|
||||||
|
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,16 @@ use kawari::config::get_config;
|
||||||
use minijinja::Environment;
|
use minijinja::Environment;
|
||||||
use minijinja::context;
|
use minijinja::context;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use tower_http::services::ServeDir;
|
||||||
|
|
||||||
fn setup_default_environment() -> Environment<'static> {
|
fn setup_default_environment() -> Environment<'static> {
|
||||||
let mut env = Environment::new();
|
let mut env = Environment::new();
|
||||||
|
env.add_template_owned(
|
||||||
|
"layout.html",
|
||||||
|
std::fs::read_to_string("resources/templates/layout.html")
|
||||||
|
.expect("Failed to find template!"),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
env.add_template_owned(
|
env.add_template_owned(
|
||||||
"web.html",
|
"web.html",
|
||||||
std::fs::read_to_string("resources/templates/web.html").expect("Failed to find template!"),
|
std::fs::read_to_string("resources/templates/web.html").expect("Failed to find template!"),
|
||||||
|
@ -63,7 +70,8 @@ async fn main() {
|
||||||
|
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/", get(root))
|
.route("/", get(root))
|
||||||
.route("/worldstatus", get(world_status));
|
.route("/worldstatus", get(world_status))
|
||||||
|
.nest_service("/static", ServeDir::new("resources/static"));
|
||||||
|
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue