diff --git a/csharp/App/Backend/Controller.cs b/csharp/App/Backend/Controller.cs index 67cce6e07..62df917c0 100644 --- a/csharp/App/Backend/Controller.cs +++ b/csharp/App/Backend/Controller.cs @@ -100,6 +100,23 @@ public class Controller : ControllerBase .Where(error => error.InstallationId == id) .ToList(); } + + [HttpGet(nameof(GetAllWarningsForInstallation))] + public ActionResult> GetAllWarningsForInstallation(Int64 id, Token authToken) + { + var user = Db.GetSession(authToken)?.User; + if (user == null) + return Unauthorized(); + + var installation = Db.GetInstallationById(id); + + if (installation is null || !user.HasAccessTo(installation)) + return Unauthorized(); + + return Db.Warnings + .Where(error => error.InstallationId == id) + .ToList(); + } [HttpGet(nameof(GetUserById))] public ActionResult GetUserById(Int64 id, Token authToken) diff --git a/csharp/App/Backend/DataTypes/Error.cs b/csharp/App/Backend/DataTypes/Error.cs index 1d10bf2ff..da655498a 100644 --- a/csharp/App/Backend/DataTypes/Error.cs +++ b/csharp/App/Backend/DataTypes/Error.cs @@ -2,13 +2,22 @@ using SQLite; namespace InnovEnergy.App.Backend.DataTypes; -public class Error +public abstract class LogEntry { [PrimaryKey, AutoIncrement] public Int64 Id { get; set; } public Int64 InstallationId { get; set; } - public String ErrorDescription { get; set; } = null!; + public String Description { get; set; } = null!; public DateTime CreatedAt { get; set; } - public String DeviceCreatedTheError { get; set; } = null!; + public String DeviceCreatedTheMessage { get; set; } = null!; public Boolean Seen { get; set; } +} + +// Derived class for errors +public class Error : LogEntry +{ +} + +public class Warning : LogEntry +{ } \ No newline at end of file diff --git a/csharp/App/Backend/DataTypes/Methods/ExoCmd.cs b/csharp/App/Backend/DataTypes/Methods/ExoCmd.cs index 8f2836cd5..9ab2ecf54 100644 --- a/csharp/App/Backend/DataTypes/Methods/ExoCmd.cs +++ b/csharp/App/Backend/DataTypes/Methods/ExoCmd.cs @@ -13,11 +13,8 @@ namespace InnovEnergy.App.Backend.DataTypes.Methods; public static class ExoCmd { - private const String Key = "EXOea18f5a82bd358896154c783"; - private const String Secret = "lYtzU7R5e0L6XKOgBaLVPFr41nEBDxDdXU47zBAEI6M"; - [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "")] - public static readonly S3Credentials? S3Creds = JsonSerializer.Deserialize(File.OpenRead("./Resources/exoscaleS3.json")); + public static readonly S3Credentials S3Credentials = JsonSerializer.Deserialize(File.OpenRead("./Resources/exoscaleS3.json"))!; private static Byte[] HmacSha256Digest(String message, String secret) { @@ -47,7 +44,7 @@ public static class ExoCmd //Console.WriteLine("Message to sign:\n" + messageToSign); - var hmac = HmacSha256Digest(messageToSign, Secret); + var hmac = HmacSha256Digest(messageToSign, S3Credentials.Secret); return Convert.ToBase64String(hmac); } @@ -76,7 +73,7 @@ public static class ExoCmd var unixtime = DateTimeOffset.UtcNow.ToUnixTimeSeconds()+60; - var authheader = "credential="+Key+",signed-query-args="+",expires="+unixtime+",signature="+BuildSignature("GET", method, unixtime); + var authheader = "credential="+S3Credentials.Key+",signed-query-args="+",expires="+unixtime+",signature="+BuildSignature("GET", method, unixtime); var client = new HttpClient(); @@ -92,10 +89,12 @@ public static class ExoCmd { var url = "https://api-ch-dk-2.exoscale.com/v2/api-key"; var method = "api-key"; - var contentString = $$"""{"role-id": "{{roleName}}", "name":"{{installation.BucketName()}}v2"}"""; + var contentString = $$"""{"role-id": "{{roleName}}", "name":"{{installation.BucketName()}}"}"""; var unixtime = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + 60; - var authheader = "credential=" + Key + ",expires=" + unixtime + ",signature=" + + + + var authheader = "credential=" + S3Credentials.Key + ",expires=" + unixtime + ",signature=" + BuildSignature("POST", method, contentString, unixtime); var client = new HttpClient(); @@ -143,7 +142,7 @@ public static class ExoCmd var unixtime = DateTimeOffset.UtcNow.ToUnixTimeSeconds()+60; - var authheader = "credential="+Key+",signed-query-args="+",expires="+unixtime+",signature="+BuildSignature("POST", method, contentString, unixtime); + var authheader = "credential="+S3Credentials.Key+",signed-query-args="+",expires="+unixtime+",signature="+BuildSignature("POST", method, contentString, unixtime); var client = new HttpClient(); @@ -171,7 +170,7 @@ public static class ExoCmd var unixtime = DateTimeOffset.UtcNow.ToUnixTimeSeconds()+60; - var authheader = "credential="+Key+",expires="+unixtime+",signature="+BuildSignature("DELETE", method, unixtime); + var authheader = "credential="+S3Credentials.Key+",expires="+unixtime+",signature="+BuildSignature("DELETE", method, unixtime); var client = new HttpClient(); @@ -220,7 +219,7 @@ public static class ExoCmd var unixtime = DateTimeOffset.UtcNow.ToUnixTimeSeconds()+60; - var authheader = "credential="+Key+",signed-query-args="+",expires="+unixtime+",signature="+BuildSignature("POST", method, contentString, unixtime); + var authheader = "credential="+S3Credentials.Key+",signed-query-args="+",expires="+unixtime+",signature="+BuildSignature("POST", method, contentString, unixtime); var client = new HttpClient(); @@ -245,7 +244,7 @@ public static class ExoCmd public static async Task CreateBucket(this Installation installation) { - var s3Region = new S3Region($"https://{installation.S3Region}.{installation.S3Provider}", S3Creds!); + var s3Region = new S3Region($"https://{installation.S3Region}.{installation.S3Provider}", S3Credentials!); return await s3Region.PutBucket(installation.BucketName()) != null; } @@ -272,7 +271,7 @@ public static class ExoCmd // return result.ExitCode == 200; - var s3Region = new S3Region($"https://{installation.S3Region}.{installation.S3Provider}", S3Creds!); + var s3Region = new S3Region($"https://{installation.S3Region}.{installation.S3Provider}", S3Credentials!); var url = s3Region.Bucket(installation.BucketName()).Path("config.json"); return await url.PutObject(config); diff --git a/csharp/App/Backend/DataTypes/Methods/Installation.cs b/csharp/App/Backend/DataTypes/Methods/Installation.cs index 93ecee76e..d71d52c79 100644 --- a/csharp/App/Backend/DataTypes/Methods/Installation.cs +++ b/csharp/App/Backend/DataTypes/Methods/Installation.cs @@ -23,7 +23,8 @@ public static class InstallationMethods public static async Task RenewS3Credentials(this Installation installation) { - if(installation.S3Key != "") await installation.RevokeReadKey(); + if(!installation.S3Key.IsNullOrEmpty()) + await installation.RevokeReadKey(); var (key,secret) = await installation.CreateReadKey(); diff --git a/csharp/App/Backend/Database/Create.cs b/csharp/App/Backend/Database/Create.cs index 924e1c4aa..72638f096 100644 --- a/csharp/App/Backend/Database/Create.cs +++ b/csharp/App/Backend/Database/Create.cs @@ -25,6 +25,11 @@ public static partial class Db return Insert(error); } + public static Boolean Create(Warning warning) + { + return Insert(warning); + } + public static Boolean Create(Folder folder) { return Insert(folder); @@ -80,4 +85,30 @@ public static partial class Db Create(newError); } } + + public static void HandleWarning(Warning newWarning,int installationId) + { + //Find the total number of warnings for this installation + var totalWarnings = Warnings.Count(warning => warning.InstallationId == installationId); + + //If there are 100 warnings, remove the one with the oldest timestamp + if (totalWarnings == 100) + { + var oldestWarning = + Warnings.Where(warning => warning.InstallationId == installationId) + .OrderBy(warning => warning.CreatedAt) + .FirstOrDefault(); + + //Remove the old error + Delete(oldestWarning); + + //Add the new error + Create(newWarning); + } + else + { + Console.WriteLine("---------------Added the new Error to the database-----------------"); + Create(newWarning); + } + } } \ No newline at end of file diff --git a/csharp/App/Backend/Database/Db.cs b/csharp/App/Backend/Database/Db.cs index f4255a677..91f765f5d 100644 --- a/csharp/App/Backend/Database/Db.cs +++ b/csharp/App/Backend/Database/Db.cs @@ -12,21 +12,20 @@ using SQLiteConnection = SQLite.SQLiteConnection; namespace InnovEnergy.App.Backend.Database; - -public static partial class Db +public static partial class Db { private static SQLiteConnection Connection { get; } = InitConnection(); private static SQLiteConnection InitConnection() { var latestDb = new DirectoryInfo("DbBackups") - .GetFiles() - .OrderBy(f => f.LastWriteTime) - .Last().Name; + .GetFiles() + .OrderBy(f => f.LastWriteTime) + .Last().Name; //This is the file connection from the DbBackups folder var fileConnection = new SQLiteConnection("DbBackups/" + latestDb); - + //Create a table if it does not exist fileConnection.CreateTable(); fileConnection.CreateTable(); @@ -36,14 +35,15 @@ public static partial class Db fileConnection.CreateTable(); fileConnection.CreateTable(); fileConnection.CreateTable(); - + fileConnection.CreateTable(); + return CopyDbToMemory(fileConnection); } private static SQLiteConnection CopyDbToMemory(SQLiteConnection fileConnection) { var memoryConnection = new SQLiteConnection(":memory:"); - + //Create a table if it does not exist in main memory memoryConnection.CreateTable(); memoryConnection.CreateTable(); @@ -53,7 +53,8 @@ public static partial class Db memoryConnection.CreateTable(); memoryConnection.CreateTable(); memoryConnection.CreateTable(); - + memoryConnection.CreateTable(); + //Copy all the existing tables from the disk to main memory fileConnection.Table().ForEach(memoryConnection.Insert); fileConnection.Table().ForEach(memoryConnection.Insert); @@ -63,7 +64,8 @@ public static partial class Db fileConnection.Table().ForEach(memoryConnection.Insert); fileConnection.Table().ForEach(memoryConnection.Insert); fileConnection.Table().ForEach(memoryConnection.Insert); - + fileConnection.Table().ForEach(memoryConnection.Insert); + return memoryConnection; } @@ -72,21 +74,23 @@ public static partial class Db var filename = "db-" + DateTimeOffset.UtcNow.ToUnixTimeSeconds() + ".sqlite"; Connection.Backup("DbBackups/" + filename); } + + public static TableQuery Sessions => Connection.Table(); + public static TableQuery Folders => Connection.Table(); + public static TableQuery Installations => Connection.Table(); + public static TableQuery Users => Connection.Table(); + public static TableQuery FolderAccess => Connection.Table(); + public static TableQuery InstallationAccess => Connection.Table(); + public static TableQuery OrderNumber2Installation => Connection.Table(); + public static TableQuery Errors => Connection.Table(); + public static TableQuery Warnings => Connection.Table(); - public static TableQuery Sessions => Connection.Table(); - public static TableQuery Folders => Connection.Table(); - public static TableQuery Installations => Connection.Table(); - public static TableQuery Users => Connection.Table(); - public static TableQuery FolderAccess => Connection.Table(); - public static TableQuery InstallationAccess => Connection.Table(); - public static TableQuery OrderNumber2Installation => Connection.Table(); - public static TableQuery Errors => Connection.Table(); - - public static void Init(){ + public static void Init() + { // used to force static constructor //Since this class is static, we call Init method from the Program.cs to initialize all the fields of the class } - + //This is the constructor of the class static Db() { @@ -100,23 +104,53 @@ public static partial class Db Connection.CreateTable(); Connection.CreateTable(); Connection.CreateTable(); + Connection.CreateTable(); }); + + UpdateKeys().SupressAwaitWarning(); + CleanupSessions().SupressAwaitWarning(); + } + + private static async Task CleanupSessions() + { + while (true) + { + try + { + DeleteStaleSessions(); + } + catch(Exception e) + { + Console.WriteLine("An error has occured when cleaning stale sessions, exception is:\n"+e); + } - Observable.Interval(TimeSpan.FromHours(0.5)) - .StartWith(0) // Do it right away (on startup) - .ObserveOn(TaskPoolScheduler.Default) - .SubscribeOn(TaskPoolScheduler.Default) - .SelectMany(Cleanup) - .Subscribe(); + await Task.Delay(TimeSpan.FromHours(0.5)); + } } - - + private static async Task UpdateKeys() + { + while (true) + { + try + { + await UpdateS3Urls(); + } + catch(Exception e) + { + Console.WriteLine("An error has occured when updating S3 keys, exception is:\n"+e); + } + + await Task.Delay(TimeSpan.FromHours(24)); + } + } + + private static Boolean RunTransaction(Func func) { var savepoint = Connection.SaveTransactionPoint(); var success = false; - + try { success = func(); @@ -131,40 +165,33 @@ public static partial class Db return success; } - - - private static async Task Cleanup(Int64 _) - { - await UpdateS3Urls(); - DeleteStaleSessions(); - return true; - } + private static void DeleteStaleSessions() { - var deadline = DateTime.Now.AddDays((-1)*Session.MaxAge.Days); + var deadline = DateTime.Now.AddDays((-1) * Session.MaxAge.Days); Sessions.Delete(s => s.LastSeen < deadline); } private static async Task UpdateS3Urls() { var regions = Installations - .Select(i => i.S3Region) - .Distinct() - .ToList(); - + .Select(i => i.S3Region) + .Distinct() + .ToList(); + const String provider = "exo.io"; - + foreach (var region in regions) { - var s3Region = new S3Region($"https://{region}.{provider}", ExoCmd.S3Creds!); + var s3Region = new S3Region($"https://{region}.{provider}", ExoCmd.S3Credentials!); var bucketList = await s3Region.ListAllBuckets(); - var installations = from bucket in bucketList.Buckets - from installation in Installations - where installation.BucketName() == bucket.BucketName - select installation; - + var installations = from bucket in bucketList.Buckets + from installation in Installations + where installation.BucketName() == bucket.BucketName + select installation; + foreach (var installation in installations) { await installation.RenewS3Credentials(); @@ -179,12 +206,12 @@ public static partial class Db await user.SendPasswordResetEmail(sessionToken); return true; } - catch + catch { return false; } } - + public static async Task SendNewUserEmail(User user) { try @@ -192,7 +219,7 @@ public static partial class Db await user.SendNewUserWelcomeMessage(); return true; } - catch + catch { return false; } diff --git a/csharp/App/Backend/Database/Delete.cs b/csharp/App/Backend/Database/Delete.cs index abefabadd..ca1da79de 100644 --- a/csharp/App/Backend/Database/Delete.cs +++ b/csharp/App/Backend/Database/Delete.cs @@ -48,6 +48,20 @@ public static partial class Db return Errors.Delete(error => error.Id == errorToDelete.Id) >0; } } + + public static Boolean Delete(Warning warningToDelete) + { + var deleteSuccess = RunTransaction(DeleteWarning); + if (deleteSuccess) + BackupDatabase(); + return deleteSuccess; + + + Boolean DeleteWarning() + { + return Warnings.Delete(error => error.Id == warningToDelete.Id) >0; + } + } public static Boolean Delete(Installation installation) { diff --git a/csharp/App/Backend/Websockets/StatusMessage.cs b/csharp/App/Backend/Websockets/StatusMessage.cs index 244f123be..3fb6b90ec 100644 --- a/csharp/App/Backend/Websockets/StatusMessage.cs +++ b/csharp/App/Backend/Websockets/StatusMessage.cs @@ -4,6 +4,6 @@ public class StatusMessage public required int InstallationId { get; init; } public required int Status { get; init; } public DateTime CreatedAt { get; set; } - public String Error { get; init; } = null!; - public String DeviceCreatedTheError { get; init; } = null!; + public String Description { get; init; } = null!; + public String CreatedBy { get; init; } = null!; } \ No newline at end of file diff --git a/csharp/App/Backend/Websockets/WebsockerManager.cs b/csharp/App/Backend/Websockets/WebsockerManager.cs index 989441e08..069e5cbd6 100644 --- a/csharp/App/Backend/Websockets/WebsockerManager.cs +++ b/csharp/App/Backend/Websockets/WebsockerManager.cs @@ -99,15 +99,30 @@ public static class WebsocketManager Error newError = new Error { InstallationId = receivedStatusMessage.InstallationId, - ErrorDescription = receivedStatusMessage.Error, + Description = receivedStatusMessage.Description, CreatedAt = receivedStatusMessage.CreatedAt, - DeviceCreatedTheError = receivedStatusMessage.DeviceCreatedTheError, + DeviceCreatedTheMessage = receivedStatusMessage.CreatedBy, Seen = false }; //Create a new error and add it to the database Db.HandleError(newError,receivedStatusMessage.InstallationId); - } + else if (receivedStatusMessage.Status==1) + { + Console.WriteLine("-----------------------New warning-----------------------"); + + Warning newWarning = new Warning + { + InstallationId = receivedStatusMessage.InstallationId, + Description = receivedStatusMessage.Description, + CreatedAt = receivedStatusMessage.CreatedAt, + DeviceCreatedTheMessage = receivedStatusMessage.CreatedBy, + Seen = false + }; + //Create a new error and add it to the database + Db.HandleWarning(newWarning,receivedStatusMessage.InstallationId); + } + if (!InstallationConnections.ContainsKey(installationId)) { diff --git a/csharp/App/SaliMax/src/MiddlewareClasses/StatusMessage.cs b/csharp/App/SaliMax/src/MiddlewareClasses/StatusMessage.cs index 1faf68d8e..4d4df09b5 100644 --- a/csharp/App/SaliMax/src/MiddlewareClasses/StatusMessage.cs +++ b/csharp/App/SaliMax/src/MiddlewareClasses/StatusMessage.cs @@ -4,9 +4,9 @@ namespace InnovEnergy.App.SaliMax.MiddlewareClasses; public class StatusMessage { - public required int InstallationId { get; init; } - public required int Status { get; init; } + public required int InstallationId { get; set; } + public required int Status { get; set; } public DateTime CreatedAt { get; set; } - public String Error { get; set; } = null!; - public String DeviceCreatedTheError { get; set; } = null!; + public String Description { get; set; } = null!; + public String CreatedBy { get; set; } = null!; } \ No newline at end of file diff --git a/csharp/App/SaliMax/src/Program.cs b/csharp/App/SaliMax/src/Program.cs index c9135ab20..f6463e40e 100644 --- a/csharp/App/SaliMax/src/Program.cs +++ b/csharp/App/SaliMax/src/Program.cs @@ -357,8 +357,14 @@ internal static class Program if (status == 2) { jsonObject.CreatedAt = DateTime.Now; - jsonObject.Error = "Battery Temperature High"; - jsonObject.DeviceCreatedTheError = "Battery/1"; + jsonObject.Description = "Battery Temperature High"; + jsonObject.CreatedBy = "Battery/1"; + } + else if (status == 1) + { + jsonObject.CreatedAt = DateTime.Now; + jsonObject.Description = "Temp warning message"; + jsonObject.CreatedBy = "Battery/4"; } var message = JsonSerializer.Serialize(jsonObject); diff --git a/typescript/frontend-marios2/src/Resources/axiosConfig.tsx b/typescript/frontend-marios2/src/Resources/axiosConfig.tsx index 6069ad19f..0d4606588 100644 --- a/typescript/frontend-marios2/src/Resources/axiosConfig.tsx +++ b/typescript/frontend-marios2/src/Resources/axiosConfig.tsx @@ -1,13 +1,13 @@ import axios from 'axios'; export const axiosConfigWithoutToken = axios.create({ - //baseURL: 'https://monitor.innov.energy/api' - baseURL: 'http://127.0.0.1:7087/api' + baseURL: 'https://monitor.innov.energy/api' + //baseURL: 'http://127.0.0.1:7087/api' }); const axiosConfig = axios.create({ - //baseURL: 'https://monitor.innov.energy/api' - baseURL: 'http://127.0.0.1:7087/api' + baseURL: 'https://monitor.innov.energy/api' + //baseURL: 'http://127.0.0.1:7087/api' }); axiosConfig.defaults.params = {}; diff --git a/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx b/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx index 2e3a06f35..3dc656ced 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx @@ -17,12 +17,14 @@ import { import Typography from '@mui/material/Typography'; import { FormattedMessage } from 'react-intl'; import ErrorIcon from '@mui/icons-material/Error'; +import WarningIcon from '@mui/icons-material/Warning'; import axiosConfig from '../../../Resources/axiosConfig'; import { AxiosError, AxiosResponse } from 'axios/index'; import routes from '../../../Resources/routes.json'; import { useNavigate } from 'react-router-dom'; import { TokenContext } from '../../../contexts/tokenContext'; import { ErrorMessage } from '../../../interfaces/S3Types'; +import Button from '@mui/material/Button'; interface LogProps { errorLoadingS3Data: boolean; @@ -31,8 +33,11 @@ interface LogProps { function Log(props: LogProps) { const theme = useTheme(); - //const [warnings, setWarnings] = useState([]); + const [warnings, setWarnings] = useState([]); const [errors, setErrors] = useState([]); + const [errorButtonPressed, setErrorButtonPressed] = useState(false); + const [warningButtonPressed, setWarningButtonPressed] = useState(false); + const navigate = useNavigate(); const tokencontext = useContext(TokenContext); const { removeToken } = tokencontext; @@ -49,14 +54,41 @@ function Log(props: LogProps) { navigate(routes.login); } }); + + axiosConfig + .get(`/GetAllWarningsForInstallation?id=${props.id}`) + .then((res: AxiosResponse) => { + setWarnings(res.data); + }) + .catch((err: AxiosError) => { + if (err.response && err.response.status == 401) { + removeToken(); + navigate(routes.login); + } + }); }, []); + const handleErrorButtonPressed = () => { + setErrorButtonPressed(!errorButtonPressed); + }; + + const handleWarningButtonPressed = () => { + setWarningButtonPressed(!warningButtonPressed); + }; + return ( - {/* IT SHOULD BE {(errors.length > 0 || props.warnings.length > 0) && (*/} - {errors.length > 0 && ( + + + {errorButtonPressed && errors.length > 0 && ( @@ -66,7 +98,6 @@ function Log(props: LogProps) { - - {errors.map((error, index) => { + {errors.map((error, index) => ( + + + + + + + {error.description} + + + + + {error.deviceCreatedTheMessage} + + + + + {error.createdAt} + + + + + {error.seen == false ? 'No' : 'Yes'} + + + + ))} + + + + + )} + + {!props.errorLoadingS3Data && + errorButtonPressed && + errors.length == 0 && ( + + + + + )} + + + + + + {warningButtonPressed && warnings.length > 0 && ( + + + + + + + + + + + + + + + + + + + + + + + + + {warnings.map((warning, index) => { return ( - - {error.errorDescription} + {warning.description} @@ -120,7 +284,7 @@ function Log(props: LogProps) { noWrap sx={{ marginTop: '5px' }} > - {error.deviceCreatedTheError} + {warning.deviceCreatedTheMessage} @@ -130,9 +294,9 @@ function Log(props: LogProps) { color="text.primary" gutterBottom noWrap - sx={{ marginTop: '5px', marginLeft: '-40px' }} + sx={{ marginTop: '5px', verticalAlign: 'middle' }} > - {error.createdAt} + {warning.createdAt} @@ -142,106 +306,43 @@ function Log(props: LogProps) { color="text.primary" gutterBottom noWrap - sx={{ marginTop: '5px', marginLeft: '10px' }} + sx={{ marginTop: '5px', verticalAlign: 'middle' }} > - {error.seen == false ? 'No' : 'Yes'} + {warning.seen == false ? 'No' : 'Yes'} ); })} - - {/*{props.warnings.map((warning, index) => {*/} - {/* return (*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/* {warning.device}*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* {warning.description}*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* {warning.date}*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* {warning.time}*/} - {/* */} - {/* */} - {/* */} - {/* );*/} - {/*})}*/}
)} - {!props.errorLoadingS3Data && errors.length == 0 && ( - - - - - )} + {!props.errorLoadingS3Data && + warningButtonPressed && + warnings.length == 0 && ( + + + + + )}
@@ -265,28 +366,6 @@ function Log(props: LogProps) { > )} - - {/*{!props.errorLoadingS3Data && props.warnings.length == 0 && (*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/*)}*/}
diff --git a/typescript/frontend-marios2/src/interfaces/S3Types.tsx b/typescript/frontend-marios2/src/interfaces/S3Types.tsx index b68ddc4b9..b5860df23 100644 --- a/typescript/frontend-marios2/src/interfaces/S3Types.tsx +++ b/typescript/frontend-marios2/src/interfaces/S3Types.tsx @@ -8,8 +8,8 @@ export interface I_S3Credentials { export interface ErrorMessage { installationId: number; + description: string; createdAt: Date; - errorDescription: string; - deviceCreatedTheError: string; + deviceCreatedTheMessage: string; seen: boolean; }