Assign version to backend
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		
							
								
								
									
										2
									
								
								central_backend/Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								central_backend/Cargo.lock
									
									
									
										generated
									
									
									
								
							@@ -656,7 +656,7 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "central_backend"
 | 
					name = "central_backend"
 | 
				
			||||||
version = "0.1.0"
 | 
					version = "1.0.2"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "actix",
 | 
					 "actix",
 | 
				
			||||||
 "actix-cors",
 | 
					 "actix-cors",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
[package]
 | 
					[package]
 | 
				
			||||||
name = "central_backend"
 | 
					name = "central_backend"
 | 
				
			||||||
version = "0.1.0"
 | 
					version = "1.0.2"
 | 
				
			||||||
edition = "2021"
 | 
					edition = "2021"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[dependencies]
 | 
					[dependencies]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@ struct ServerConfig {
 | 
				
			|||||||
    auth_disabled: bool,
 | 
					    auth_disabled: bool,
 | 
				
			||||||
    constraints: StaticConstraints,
 | 
					    constraints: StaticConstraints,
 | 
				
			||||||
    unsecure_origin: String,
 | 
					    unsecure_origin: String,
 | 
				
			||||||
 | 
					    backend_version: &'static str,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
impl Default for ServerConfig {
 | 
					impl Default for ServerConfig {
 | 
				
			||||||
@@ -21,6 +22,7 @@ impl Default for ServerConfig {
 | 
				
			|||||||
            auth_disabled: AppConfig::get().unsecure_disable_login,
 | 
					            auth_disabled: AppConfig::get().unsecure_disable_login,
 | 
				
			||||||
            constraints: Default::default(),
 | 
					            constraints: Default::default(),
 | 
				
			||||||
            unsecure_origin: AppConfig::get().unsecure_origin(),
 | 
					            unsecure_origin: AppConfig::get().unsecure_origin(),
 | 
				
			||||||
 | 
					            backend_version: env!("CARGO_PKG_VERSION"),
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ export interface ServerConfig {
 | 
				
			|||||||
  auth_disabled: boolean;
 | 
					  auth_disabled: boolean;
 | 
				
			||||||
  constraints: ServerConstraint;
 | 
					  constraints: ServerConstraint;
 | 
				
			||||||
  unsecure_origin: string;
 | 
					  unsecure_origin: string;
 | 
				
			||||||
 | 
					  backend_version: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface ServerConstraint {
 | 
					export interface ServerConstraint {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,9 +12,11 @@ import {
 | 
				
			|||||||
  ListItemButton,
 | 
					  ListItemButton,
 | 
				
			||||||
  ListItemIcon,
 | 
					  ListItemIcon,
 | 
				
			||||||
  ListItemText,
 | 
					  ListItemText,
 | 
				
			||||||
 | 
					  Typography,
 | 
				
			||||||
} from "@mui/material";
 | 
					} from "@mui/material";
 | 
				
			||||||
import { useLocation } from "react-router-dom";
 | 
					import { useLocation } from "react-router-dom";
 | 
				
			||||||
import { RouterLink } from "./RouterLink";
 | 
					import { RouterLink } from "./RouterLink";
 | 
				
			||||||
 | 
					import { ServerApi } from "../api/ServerApi";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function SolarEnergyNavList(): React.ReactElement {
 | 
					export function SolarEnergyNavList(): React.ReactElement {
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
@@ -52,6 +54,13 @@ export function SolarEnergyNavList(): React.ReactElement {
 | 
				
			|||||||
        uri="/logs"
 | 
					        uri="/logs"
 | 
				
			||||||
        icon={<Icon path={mdiNotebookMultiple} size={1} />}
 | 
					        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>
 | 
					    </List>
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user