Assign version to backend
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2024-10-19 15:32:38 +02:00
parent 445c1b014e
commit b7720df305
5 changed files with 14 additions and 2 deletions

View File

@ -656,7 +656,7 @@ dependencies = [
[[package]]
name = "central_backend"
version = "0.1.0"
version = "1.0.2"
dependencies = [
"actix",
"actix-cors",

View File

@ -1,6 +1,6 @@
[package]
name = "central_backend"
version = "0.1.0"
version = "1.0.2"
edition = "2021"
[dependencies]

View File

@ -13,6 +13,7 @@ struct ServerConfig {
auth_disabled: bool,
constraints: StaticConstraints,
unsecure_origin: String,
backend_version: &'static str,
}
impl Default for ServerConfig {
@ -21,6 +22,7 @@ impl Default for ServerConfig {
auth_disabled: AppConfig::get().unsecure_disable_login,
constraints: Default::default(),
unsecure_origin: AppConfig::get().unsecure_origin(),
backend_version: env!("CARGO_PKG_VERSION"),
}
}
}

View File

@ -4,6 +4,7 @@ export interface ServerConfig {
auth_disabled: boolean;
constraints: ServerConstraint;
unsecure_origin: string;
backend_version: string;
}
export interface ServerConstraint {

View File

@ -12,9 +12,11 @@ import {
ListItemButton,
ListItemIcon,
ListItemText,
Typography,
} from "@mui/material";
import { useLocation } from "react-router-dom";
import { RouterLink } from "./RouterLink";
import { ServerApi } from "../api/ServerApi";
export function SolarEnergyNavList(): React.ReactElement {
return (
@ -52,6 +54,13 @@ export function SolarEnergyNavList(): React.ReactElement {
uri="/logs"
icon={<Icon path={mdiNotebookMultiple} size={1} />}
/>
<Typography
variant="caption"
component="div"
style={{ textAlign: "center", width: "100%", marginTop: "30px" }}
>
Version {ServerApi.Config.backend_version}
</Typography>
</List>
);
}