trad Logs
continuous-integration/drone/push Build is passing Details

pull/32/head
lebeaulato 3 months ago
parent 226af6cb8f
commit 5597617c48

@ -35,7 +35,7 @@ namespace WF_WebAdmin.Pages
private void RandomDailyquote()
{
//fonction a compléter
LoggerSaveStub.Log(Logger, LogLevel.Information, "Changement aléatoire de la quote du jour");
LoggerSaveStub.Log(Logger, LogLevel.Information, "Random change of quote of the day");
}
}
}

@ -45,7 +45,7 @@ namespace WF_WebAdmin.Pages
id++;
// Create a new quiz and add it using the quiz service.
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Création de la question {QuizModel.Question}");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Creation of the {QuizModel.Question} question");
await quizService.addQuiz(new Quiz(
id, // New quiz ID
validateInformation(QuizModel.Question), // Validated question

@ -125,7 +125,7 @@ namespace WF_WebAdmin.Pages
if (userToDelete != null)
{
// Remove the selected user from the system using the user service
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Supretion de l utilisateur : {userToDelete.Name}");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Delete user {userToDelete.Name}");
await userService.removeUser(userToDelete);
// Close the confirmation popup after the deletion
@ -148,7 +148,7 @@ namespace WF_WebAdmin.Pages
private async Task ModifyUser()
{
// Update the selected user's information using the user service
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Modification de l utilisateur : {selectedUser.Name}");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Modification of user {selectedUser.Name}");
await userService.updateUser(selectedUser);
// Close the modification popup after the update is complete
@ -199,7 +199,7 @@ namespace WF_WebAdmin.Pages
if (!userToAdmin.IsAdmin)
{
// Promote the user to admin
LoggerSaveStub.Log(Logger, LogLevel.Information, $"L utilisateur {userToAdmin.Name} a ete mis en administrateur");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"User {userToAdmin.Name} is now administrator");
userToAdmin.IsAdmin = true;
await userService.updateUser(userToAdmin); // Update the user status in the service
ClosePopup(); // Close the confirmation popup
@ -207,7 +207,7 @@ namespace WF_WebAdmin.Pages
else
{
// Demote the user from admin to normal user
LoggerSaveStub.Log(Logger, LogLevel.Information, $"L utilisateur {userToAdmin.Name} n'est plus administrateur");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"User {userToAdmin.Name} is no longer an administator");
userToAdmin.IsAdmin = false;
await userService.updateUser(userToAdmin); // Update the user status in the service
ClosePopup(); // Close the confirmation popup

@ -65,7 +65,7 @@ namespace WF_WebAdmin.Pages
protected async void HandleValidSubmit()
{
// Update the properties of the selected quote (`q`) with the data from `quoteModel`.
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Modification de la quote {q.Content}");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Editing the quote {q.Content}");
q.Content = quoteModel.Content;
q.Langue = quoteModel.Langue;
q.TitleSrc = quoteModel.TitleSrc;

@ -1,24 +1,21 @@
@page "/logs"
<h3>Logs</h3>
<h3>@Localizer["LogTitle"]</h3>
@if (logs is null)
{
<p>Aucun Logs</p>
<p>@Localizer["NotLog"]</p>
}
@* else if (quotes.Count == 0)
{
<p>Aucune citation en attente de validation.</p>
} *@
else
{
<p>Citations en attente de validation :</p>
<p>@Localizer["Log"]</p>
<table>
<thead>
<tr>
<th>LogLevel :</th>
<th>Message :</th>
<th>@Localizer["LogLvl"]</th>
<th>@Localizer["LogContent"]</th>
</tr>
</thead>
<tbody>

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using WF_WebAdmin.Model;
namespace WF_WebAdmin.Pages
@ -13,6 +14,9 @@ namespace WF_WebAdmin.Pages
[Inject]
public NavigationManager NavigationManager { get; set; }
[Inject]
public IStringLocalizer<LogsPage> Localizer { get; set; }
protected override async Task OnInitializedAsync()
{
logs = await Http.GetFromJsonAsync<Logs[]>($"{NavigationManager.BaseUri}fake_data_logs.json");

@ -107,7 +107,7 @@ namespace WF_WebAdmin.Pages
private async Task EditQuiz()
{
// Update the quiz in the service
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Modification de la question {selectedQuiz.Question}");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Editing the question {selectedQuiz.Question}");
await QuizService.updateQuiz(selectedQuiz);
// Clear the selected quiz after successful update
@ -144,7 +144,7 @@ namespace WF_WebAdmin.Pages
if (selectedQuiz != null)
{
// Remove the selected quiz from the service by its ID
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Supretion de la question {selectedQuiz.Question}");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Delete the question {selectedQuiz.Question}");
await QuizService.removeQuiz(selectedQuiz.Id);
// Clear the selected quiz after successful removal

@ -117,7 +117,7 @@ namespace WF_WebAdmin.Pages
if (selectedQuote != null)
{
// Remove the selected quote using the QuoteService
LoggerSaveStub.Log(Logger, LogLevel.Information, $"La quote {selectedQuote.Content} a ete suprimer");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"The quote {selectedQuote.Content} has been deleted");
await QuoteService.removeQuote(selectedQuote);
// Clear the selected quote after removal

@ -89,7 +89,7 @@ namespace WF_WebAdmin.Pages
private void RejectQuiz(Quiz quiz)
{
// Log the rejection action to the console
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Quiz {quiz.Id} rejected!");
LoggerSaveStub.Log(Logger, LogLevel.Information, $"Quiz {quiz.Id} rejected");
Console.WriteLine($"Quiz {quiz.Id} rejected!");

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Log" xml:space="preserve">
<value>Current Logs</value>
</data>
<data name="LogContent" xml:space="preserve">
<value>Content</value>
</data>
<data name="LogLvl" xml:space="preserve">
<value>Type of Logs :</value>
</data>
<data name="LogTitle" xml:space="preserve">
<value>Logs</value>
</data>
<data name="NotLog" xml:space="preserve">
<value>No Log</value>
</data>
</root>

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Log" xml:space="preserve">
<value>Logs actuels</value>
</data>
<data name="LogContent" xml:space="preserve">
<value>Contenu</value>
</data>
<data name="LogLvl" xml:space="preserve">
<value>Type de Logs :</value>
</data>
<data name="LogTitle" xml:space="preserve">
<value>Logs</value>
</data>
<data name="NotLog" xml:space="preserve">
<value>Aucun Log</value>
</data>
</root>

@ -25,7 +25,7 @@
},
{
"Id": 3,
"Content": "C\u0027est le choix qui fait l\u0027homme, non le destin.",
"Content": "C\u0027est le choix qui fait l\u0027homme, non le destin",
"Like": 90,
"Langue": "fr",
"Charac": "test",

@ -5,62 +5,22 @@
},
{
"LogLevel": 2,
"Message": "Demande de supretion de l utilisateur : admin"
"Message": "User testeur1 is no longer an administator"
},
{
"LogLevel": 2,
"Message": "Demande de supretion de l utilisateur : testeur"
"Message": "User dev is now administrator"
},
{
"LogLevel": 2,
"Message": "Demande de supretion de l utilisateur : dev"
"Message": "Modification of user testeur"
},
{
"LogLevel": 2,
"Message": "Changement al\u00E9atoire de la quote du jour"
"Message": "Delete user jane_smith"
},
{
"LogLevel": 2,
"Message": "Quiz 11 validated!"
},
{
"LogLevel": 2,
"Message": "Quiz 12 rejected!"
},
{
"LogLevel": 2,
"Message": "Modification de l utilisateur : testeur1"
},
{
"LogLevel": 2,
"Message": "L utilisateur testeur1 n\u0027est plus administrateur"
},
{
"LogLevel": 2,
"Message": "L utilisateur testeur1 a ete mis en administrateur"
},
{
"LogLevel": 2,
"Message": "Supretion de l utilisateur : dev"
},
{
"LogLevel": 2,
"Message": "Modification de la quote Que la force soit avec toi."
},
{
"LogLevel": 2,
"Message": "La quote Que la force soit avec toi a ete suprimer"
},
{
"LogLevel": 2,
"Message": "Cr\u00E9ation de la question coucou"
},
{
"LogLevel": 2,
"Message": "Modification de la question coucou."
},
{
"LogLevel": 2,
"Message": "Supretion de la question coucou."
"Message": "Editing the quote C\u0027est le choix qui fait l\u0027homme, non le destin."
}
]

@ -2,10 +2,10 @@
{
"Id": 3,
"Image": "https://tse4.mm.bing.net/th/id/OIP.XNQPKwc1OUfvnSO9MsxDYgHaE7?w=202\u0026h=180\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7",
"Name": "testeur1",
"Name": "testeur",
"Email": "testeur@gmail.com",
"DateCreation": "2024-08-02T00:00:00",
"IsAdmin": true,
"IsAdmin": false,
"Comments": [
{
"Text": "Premier test effectu\u00E9, tout semble OK.",
@ -19,7 +19,7 @@
"Name": "dev",
"Email": "dev@gmail.com",
"DateCreation": "2024-10-10T00:00:00",
"IsAdmin": false,
"IsAdmin": true,
"Comments": null
},
{
@ -36,15 +36,6 @@
}
]
},
{
"Id": 6,
"Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7",
"Name": "jane_smith",
"Email": "jane.smith@gmail.com",
"DateCreation": "2024-07-15T00:00:00",
"IsAdmin": false,
"Comments": null
},
{
"Id": 7,
"Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7",

Loading…
Cancel
Save