General refactor

This commit is contained in:
2025-06-09 08:53:29 +02:00
parent 1e5cd0790b
commit 0c76b852eb
14 changed files with 38 additions and 64 deletions
+5
View File
@@ -14,6 +14,7 @@ function errorPageRenderer(res, emoji, message) {
res.render("error", {
page_title: app_conf.name,
program: app_conf.program,
app_url: app_conf.app_url,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
js_path: path.join(app_conf.paths.js.web, "error.js"),
error_emoji: emoji,
@@ -182,6 +183,7 @@ router.get("/add", async (req, res) => {
res.render("add", {
page_title: app_conf.name,
program: app_conf.program,
app_url: app_conf.app_url,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
js_path: path.join(app_conf.paths.js.web, "add.js"),
column_options: JSON.stringify(column_options),
@@ -249,6 +251,7 @@ router.get("/edit", async (req, res) => {
res.render("edit", {
page_title: app_conf.name,
program: app_conf.program,
app_url: app_conf.app_url,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
js_path: path.join(app_conf.paths.js.web, "edit.js"),
column_options: JSON.stringify(column_options),
@@ -297,6 +300,7 @@ router.get("/", async (req, res) => {
res.render("index", {
page_title: app_conf.name,
program: app_conf.program,
app_url: app_conf.app_url,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
js_path: path.join(app_conf.paths.js.web, "index.js"),
table_header: table_header,
@@ -315,6 +319,7 @@ router.get("/about", (req, res) => {
res.render("about", {
page_title: app_conf.name,
program: app_conf.program,
app_url: app_conf.app_url,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
version: app_conf.version
});
+1 -7
View File
@@ -11,13 +11,7 @@ router.use(app_conf.paths.js.web, express.static(path.join(path.dirname(require.
* Main endpoint - might implement authentication step here...
*/
router.get("/", (req, res) => {
res.render("auth", {
page_title: app_conf.name,
css_path: path.join(app_conf.paths.css.web, "stylesheet.css"),
protocol: app_conf.protocol,
host: app_conf.host,
port: app_conf.port
});
res.redirect(`${app_conf.protocol}://${app_conf.host}:${app_conf.port}${app_conf.app_url}`);
});
module.exports = router;
+1 -1
View File
@@ -30,7 +30,7 @@
style="font-size: 150%;">GitHub</a>
</center>
<br>
<a href="/app"><span>&#129152; </span>Return</a>
<a href="<%= app_url %>"><span>&#129152; </span>Return</a>
</div>
</body>
+3 -2
View File
@@ -16,6 +16,7 @@
<script src="<%= js_path %>" defer></script>
<script defer>
var column_options = '<%- column_options %>';
var app_url = '<%= app_url %>';
</script>
</head>
@@ -35,12 +36,12 @@
<%- table_data %>
</table>
<div style="display: flex; flex-direction: row; justify-content: space-between;">
<a href="/app"><span>&#129152; </span>Return</a>
<a href="<%= app_url %>"><span>&#129152; </span>Return</a>
<label id="commit" style="cursor: pointer;"><span>&#9989; </span>Commit</label>
</div>
</div>
<div class="about_div">
<center><a href="/app/about">About</label></center>
<center><a href="<%= app_url %>/about">About</label></center>
</div>
</body>
-33
View File
@@ -1,33 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>
<%= page_title %>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="<%= css_path %>">
</head>
<body>
<div class="control_div">
<label
style='font-family: "Ubuntu", sans-serif; font-weight: 500; font-style: normal; font-size: 200%;'>Centaurus
Racing Team</label>
</div>
<div class="main_div"
style="display: flex; flex-direction: column; justify-content: space-between; font-size: 150%; margin-top: 15px; margin-bottom: 15px;">
<div style="display: flex; flex-direction: row; justify-content: space-evenly;">
<label>CRTelemetry SQLite3</label>
<a href="<%= protocol %>://<%= host %>:<%= port %>/app">Enter</a>
</div>
</div>
</body>
</html>
+3 -2
View File
@@ -16,6 +16,7 @@
<script src="<%= js_path %>" defer></script>
<script defer>
var column_options = '<%- column_options %>';
var app_url = '<%= app_url %>';
</script>
</head>
@@ -38,12 +39,12 @@
<%- table_data %>
</table>
<div style="display: flex; flex-direction: row; justify-content: space-between;">
<a href="/app"><span>&#129152; </span>Return</a>
<a href="<%= app_url %>"><span>&#129152; </span>Return</a>
<label id="commit" style="cursor: pointer;"><span>&#9989; </span>Commit</label>
</div>
</div>
<div class="about_div">
<center><a href="/app/about">About</label></center>
<center><a href="<%= app_url %>/about">About</label></center>
</div>
</body>
+4 -1
View File
@@ -14,6 +14,9 @@
rel="stylesheet">
<link rel="stylesheet" href="<%= css_path %>">
<script src="<%= js_path %>" defer></script>
<script defer>
var app_url = '<%= app_url %>';
</script>
</head>
<body>
@@ -39,7 +42,7 @@
<%= error_message %>
</label>
<br>
<a href="/app"><span>&#129152; </span>Return</a>
<a href="<%= app_url %>"><span>&#129152; </span>Return</a>
</div>
</body>
+4 -1
View File
@@ -14,6 +14,9 @@
rel="stylesheet">
<link rel="stylesheet" href="<%= css_path %>">
<script src="<%= js_path %>" defer></script>
<script defer>
var app_url = '<%= app_url %>';
</script>
</head>
<body>
@@ -42,7 +45,7 @@
</table>
</div>
<div class="about_div">
<center><a href="/app/about">About</label></center>
<center><a href="<%= app_url %>/about">About</label></center>
</div>
</body>