Skip to content

Commit

Permalink
Merge pull request #866 from PAVANA809/607_admin_logs_page
Browse files Browse the repository at this point in the history
admin logs page
  • Loading branch information
erinz2020 authored Nov 20, 2024
2 parents af56a8a + 8006299 commit d9eb0e4
Show file tree
Hide file tree
Showing 15 changed files with 233 additions and 22 deletions.
Binary file added frontend/public/images/List_of_Logs_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/src/AuthenticatedSwitch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import useGetMe from "./models/auth/users/useGetMe";
import AlertBanner from "./components/AlertBanner";
import EncounterSearch from "./pages/EncounterSearch";
import Citation from "./pages/Citation";
import AdminLogs from "./pages/AdminLogs";
import ReportEncounter from "./pages/ReportsAndManagamentPages/ReportEncounter";
import ReportConfirm from "./pages/ReportsAndManagamentPages/ReportConfirm";

export default function AuthenticatedSwitch({ showAlert, setShowAlert, showclassicsubmit }) {
const { data } = useGetMe();
const username = data?.username;
// eslint-disable-next-line no-undef
const avatar =
data?.imageURL || `${process.env.PUBLIC_URL}/images/Avatar.png`;
const [header, setHeader] = React.useState(true);
Expand Down Expand Up @@ -57,6 +59,7 @@ export default function AuthenticatedSwitch({ showAlert, setShowAlert, showclass
<Route path="/report" element={<ReportEncounter />} />
<Route path="/reportConfirm" element={<ReportConfirm />} />
<Route path="/encounter-search" element={<EncounterSearch />} />
<Route path="/admin/logs" element={<AdminLogs />} />
<Route path="/login" element={<Login />} />
<Route path="/" element={<Home />} />
<Route path="*" element={<NotFound setHeader={setHeader} />} />
Expand Down
50 changes: 32 additions & 18 deletions frontend/src/components/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,49 @@ export default function Card({
content = "",
buttonText = "",
link = "",
color = "black",
}) {
const themeColor = useContext(ThemeColorContext);
return (
<div
className="d-flex flex-column align-items-center justify-content-center p-4 m-4 "
className="d-flex flex-column align-items-center bg-white p-3 m-3 fw-semibold"
onClick={() => (window.location.href = link)}
style={{
minWidth: "15rem",
maxWidth: "20rem",
borderRadius: "25px",
height: "170px",
width: "170px",
borderRadius: "20px",
boxShadow: "0 4px 8px 0 rgba(0,0,0,0.2)",
color: color,
cursor: "pointer",
}}
>
{icon}
<div className="d-flex flex-column align-items-center justify-content-center ">
<h5>{title}</h5>
<p>{content}</p>
{title && (
<span
className="text-center"
style={{
overflow: "hidden",
textOverflow: "ellipsis",
maxWidth: "100%",
}}
title={title}
>
{title}
</span>
)}
{content && <p>{content}</p>}
{buttonText && (
<div>
{buttonText && (
<MainButton
link={link}
color="white"
backgroundColor={themeColor?.wildMeColors?.cyan700}
borderColor="#007bff"
>
{buttonText}
</MainButton>
)}
<MainButton
link={link}
color="white"
backgroundColor={themeColor?.wildMeColors?.cyan700}
borderColor="#007bff"
>
{buttonText}
</MainButton>
</div>
</div>
)}
</div>
);
}
33 changes: 33 additions & 0 deletions frontend/src/components/svg/DeleteSweep.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";

export default function DeleteSweep() {
return (
<div className="mb-3">
<svg
width="68"
height="68"
viewBox="0 0 68 68"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="68" height="68" rx="34" fill="#00A5CE" fillOpacity="0.2" />
<mask
id="mask0_2074_4"
maskUnits="userSpaceOnUse"
x="12"
y="12"
width="44"
height="44"
>
<rect x="12" y="12" width="44" height="44" fill="#D9D9D9" />
</mask>
<g mask="url(#mask0_2074_4">
<path
d="M21.8367 45.9167C20.9106 45.9167 20.1267 45.5958 19.485 44.9542C18.8434 44.3125 18.5225 43.5286 18.5225 42.6025V26.6667H18.1701C17.7805 26.6667 17.4539 26.5348 17.1902 26.2711C16.9268 26.0074 16.7951 25.6808 16.7951 25.2912C16.7951 24.9013 16.9268 24.5748 17.1902 24.3117C17.4539 24.0484 17.7805 23.9167 18.1701 23.9167H23.7755V23.3525C23.7755 22.9036 23.9336 22.5212 24.2499 22.2052C24.5661 21.889 24.9487 21.7309 25.3975 21.7309H28.1475C28.5964 21.7309 28.979 21.889 29.2952 22.2052C29.6112 22.5212 29.7691 22.9036 29.7691 23.3525V23.9167H35.375C35.7646 23.9167 36.0911 24.0485 36.3545 24.3122C36.6182 24.5759 36.75 24.9025 36.75 25.2921C36.75 25.682 36.6182 26.0085 36.3545 26.2716C36.0911 26.535 35.7646 26.6667 35.375 26.6667H35.0225V42.6025C35.0225 43.5286 34.7017 44.3125 34.06 44.9542C33.4184 45.5958 32.6345 45.9167 31.7083 45.9167H21.8367ZM40.7691 44.5417C40.3795 44.5417 40.0531 44.4098 39.7897 44.1461C39.526 43.8824 39.3941 43.5558 39.3941 43.1662C39.3941 42.7763 39.526 42.4498 39.7897 42.1867C40.0531 41.9234 40.3795 41.7917 40.7691 41.7917H44.4358C44.8254 41.7917 45.152 41.9235 45.4157 42.1872C45.6791 42.4509 45.8108 42.7775 45.8108 43.1671C45.8108 43.557 45.6791 43.8835 45.4157 44.1466C45.152 44.41 44.8254 44.5417 44.4358 44.5417H40.7691ZM40.7691 37.2083C40.3795 37.2083 40.0531 37.0765 39.7897 36.8128C39.526 36.5491 39.3941 36.2225 39.3941 35.8329C39.3941 35.443 39.526 35.1165 39.7897 34.8534C40.0531 34.59 40.3795 34.4583 40.7691 34.4583H48.1025C48.492 34.4583 48.8187 34.5902 49.0824 34.8539C49.3458 35.1176 49.4775 35.4442 49.4775 35.8338C49.4775 36.2237 49.3458 36.5502 49.0824 36.8132C48.8187 37.0766 48.492 37.2083 48.1025 37.2083H40.7691ZM40.7691 29.875C40.3795 29.875 40.0531 29.7432 39.7897 29.4795C39.526 29.2158 39.3941 28.8891 39.3941 28.4995C39.3941 28.1097 39.526 27.7832 39.7897 27.5201C40.0531 27.2567 40.3795 27.125 40.7691 27.125H49.9358C50.3254 27.125 50.652 27.2568 50.9157 27.5205C51.1791 27.7842 51.3108 28.1109 51.3108 28.5005C51.3108 28.8903 51.1791 29.2168 50.9157 29.4799C50.652 29.7433 50.3254 29.875 49.9358 29.875H40.7691ZM21.2725 26.6667V42.6025C21.2725 42.7436 21.3312 42.8729 21.4485 42.9902C21.5662 43.1078 21.6956 43.1667 21.8367 43.1667H31.7083C31.8492 43.1667 31.9784 43.1078 32.0961 42.9902C32.2137 42.8729 32.2725 42.7436 32.2725 42.6025V26.6667H21.2725Z"
fill="#004B66"
/>
</g>
</svg>
</div>
);
}
33 changes: 33 additions & 0 deletions frontend/src/components/svg/GalleryThumbnail.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";

export default function GalleryThumbnail() {
return (
<div className="mb-3">
<svg
width="68"
height="68"
viewBox="0 0 68 68"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="68" height="68" rx="34" fill="#00A5CE" fillOpacity="0.2" />
<mask
id="mask0_2076_15"
maskUnits="userSpaceOnUse"
x="12"
y="12"
width="44"
height="44"
>
<rect x="12" y="12" width="44" height="44" fill="#D9D9D9" />
</mask>
<g mask="url(#mask0_2076_15)">
<path
d="M18.5225 45.9167C17.6111 45.9167 16.8308 45.5922 16.1818 44.9432C15.5328 44.2942 15.2083 43.5139 15.2083 42.6025V25.3975C15.2083 24.4861 15.5328 23.7058 16.1818 23.0568C16.8308 22.4078 17.6111 22.0833 18.5225 22.0833H35.7275C36.6389 22.0833 37.4192 22.4078 38.0682 23.0568C38.7172 23.7058 39.0417 24.4861 39.0417 25.3975V42.6025C39.0417 43.5139 38.7172 44.2942 38.0682 44.9432C37.4192 45.5922 36.6389 45.9167 35.7275 45.9167H18.5225ZM44.3739 32.1667C43.8957 32.1667 43.4986 32.0085 43.1827 31.6923C42.8665 31.3763 42.7083 30.9793 42.7083 30.5011V23.7494C42.7083 23.2709 42.8665 22.8737 43.1827 22.5577C43.4986 22.2415 43.8957 22.0833 44.3739 22.0833H51.1256C51.6041 22.0833 52.0013 22.2415 52.3173 22.5577C52.6335 22.8737 52.7917 23.2709 52.7917 23.7494V30.5011C52.7917 30.9793 52.6335 31.3763 52.3173 31.6923C52.0013 32.0085 51.6041 32.1667 51.1256 32.1667H44.3739ZM45.4583 29.4167H50.0417V24.8333H45.4583V29.4167ZM18.5225 43.1667H35.7275C35.8922 43.1667 36.0274 43.1138 36.1331 43.0081C36.2388 42.9024 36.2917 42.7672 36.2917 42.6025V25.3975C36.2917 25.2328 36.2388 25.0976 36.1331 24.9919C36.0274 24.8862 35.8922 24.8333 35.7275 24.8333H18.5225C18.3578 24.8333 18.2226 24.8862 18.1169 24.9919C18.0112 25.0976 17.9583 25.2328 17.9583 25.3975V42.6025C17.9583 42.7672 18.0112 42.9024 18.1169 43.0081C18.2226 43.1138 18.3578 43.1667 18.5225 43.1667ZM21.625 39.412H32.625C32.9504 39.412 33.1946 39.2615 33.3574 38.9605C33.5203 38.6596 33.4971 38.3681 33.2877 38.086L30.3086 34.0985C30.1372 33.8776 29.9162 33.7672 29.6458 33.7672C29.3754 33.7672 29.1545 33.8776 28.9831 34.0985L26.2083 37.8078L24.3502 35.336C24.1788 35.1151 23.9579 35.0047 23.6875 35.0047C23.4171 35.0047 23.1962 35.1151 23.0247 35.336L20.9622 38.086C20.7529 38.3681 20.7297 38.6596 20.8926 38.9605C21.0554 39.2615 21.2996 39.412 21.625 39.412ZM44.3739 45.9167C43.8957 45.9167 43.4986 45.7585 43.1827 45.4423C42.8665 45.1263 42.7083 44.7291 42.7083 44.2506V37.4989C42.7083 37.0207 42.8665 36.6237 43.1827 36.3077C43.4986 35.9915 43.8957 35.8333 44.3739 35.8333H51.1256C51.6041 35.8333 52.0013 35.9915 52.3173 36.3077C52.6335 36.6237 52.7917 37.0207 52.7917 37.4989V44.2506C52.7917 44.7291 52.6335 45.1263 52.3173 45.4423C52.0013 45.7585 51.6041 45.9167 51.1256 45.9167H44.3739ZM45.4583 43.1667H50.0417V38.5833H45.4583V43.1667Z"
fill="#004B66"
/>
</g>
</svg>
</div>
);
}
33 changes: 33 additions & 0 deletions frontend/src/components/svg/StackedEmail.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";

export default function StackedEmail() {
return (
<div className="mb-3">
<svg
width="68"
height="68"
viewBox="0 0 68 68"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="68" height="68" rx="34" fill="#00A5CE" fillOpacity="0.2" />
<mask
id="mask0_2074_20"
maskUnits="userSpaceOnUse"
x="12"
y="12"
width="44"
height="44"
>
<rect x="12" y="12" width="44" height="44" fill="#D9D9D9" />
</mask>
<g mask="url(#mask0_2074_20)">
<path
d="M24.4809 42.9549C23.5547 42.9549 22.7708 42.6341 22.1292 41.9924C21.4875 41.3507 21.1667 40.567 21.1667 39.6412V21.5191C21.1667 20.5933 21.4875 19.8095 22.1292 19.1679C22.7708 18.5262 23.5547 18.2054 24.4809 18.2054H49.9358C50.8619 18.2054 51.6458 18.5262 52.2875 19.1679C52.9292 19.8095 53.25 20.5933 53.25 21.5191V39.6412C53.25 40.567 52.9292 41.3507 52.2875 41.9924C51.6458 42.6341 50.8619 42.9549 49.9358 42.9549H24.4809ZM36.2422 33.1466L23.9167 24.2549V39.6412C23.9167 39.8056 23.9695 39.9406 24.0752 40.0463C24.181 40.1524 24.3162 40.2054 24.4809 40.2054H49.9358C50.1005 40.2054 50.2357 40.1524 50.3414 40.0463C50.4471 39.9406 50.5 39.8056 50.5 39.6412V24.2549L38.1745 33.1466C37.8735 33.3675 37.5515 33.478 37.2083 33.478C36.8652 33.478 36.5431 33.3675 36.2422 33.1466ZM37.2083 30.4814L50.3235 21.0608C50.2884 21.0257 50.2502 20.9992 50.209 20.9815C50.168 20.9638 50.1123 20.9549 50.0417 20.9549H24.375C24.3163 20.9549 24.2575 20.9697 24.1985 20.9994C24.1399 21.0287 24.093 21.0609 24.0578 21.0961L37.2083 30.4814ZM18.0642 49.3716C17.1381 49.3716 16.3542 49.0508 15.7125 48.4091C15.0708 47.7674 14.75 46.9837 14.75 46.0578V27.2662C14.75 26.876 14.8817 26.5493 15.1451 26.2863C15.4082 26.0229 15.7348 25.8912 16.125 25.8912C16.5152 25.8912 16.8418 26.0229 17.1049 26.2863C17.3683 26.5493 17.5 26.876 17.5 27.2662V46.0578C17.5 46.2222 17.5529 46.3573 17.6586 46.463C17.7643 46.5687 17.8995 46.6216 18.0642 46.6216H45.3525C45.7427 46.6216 46.0694 46.7533 46.3328 47.0167C46.5959 47.2797 46.7275 47.6064 46.7275 47.9966C46.7275 48.3868 46.5959 48.7136 46.3328 48.977C46.0694 49.24 45.7427 49.3716 45.3525 49.3716H18.0642ZM50.5 24.1706C50.5 23.5735 50.4794 23.0464 50.4381 22.5893C50.3972 22.1322 50.359 21.6227 50.3235 21.0608C50.2884 21.0257 50.2502 20.9992 50.209 20.9815C50.168 20.9638 50.1123 20.9549 50.0417 20.9549H24.375C24.3163 20.9549 24.2575 20.9697 24.1985 20.9994C24.1399 21.0287 24.093 21.0609 24.0578 21.0961C24.0224 21.658 23.99 22.1645 23.9607 22.6155C23.9313 23.0668 23.9167 23.5851 23.9167 24.1706V20.9549H50.5V24.1706Z"
fill="#004B66"
/>
</g>
</svg>
</div>
);
}
3 changes: 2 additions & 1 deletion frontend/src/constants/navMenu.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
import React from "react";
import { FormattedMessage } from "react-intl";

Expand Down Expand Up @@ -244,7 +245,7 @@ const authenticatedMenu = (username, showclassicsubmit) => [
name: (
<FormattedMessage id="MENU_ADMINISTER_LOGS" defaultMessage="Logs" />
),
href: "/appadmin/logs.jsp",
href: "/react/admin/logs",
},
{
name: (
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@
"CITATION_CITATION_DETAILS_2": "J. Levenson, S. Gero, J. Van Oast und J. Holmberg. 2015. Flukebook: cloudbasierte Foto-Identifikationsanalysetools für die Meeresforschung. Erreichbar unter: https://www.flukebook.org",
"CITATION_FORWARD": "Um die Zitierung jeder Publikation / jedes Berichts, der / das die von Wild Me bereitgestellten Daten / Werkzeuge verwendet hat, zur Aufnahme in unsere Referenzliste an [email protected] weiterzuleiten.",
"CITATION_DISCLAIMER": "Wild Me oder die ursprünglichen Datenanbieter nicht für Fehler in den Daten verantwortlich machen. Obwohl wir alle Anstrengungen unternommen haben, um die Qualität der Datenbank zu gewährleisten, können wir die Genauigkeit dieser Datensätze nicht garantieren.",
"USER_ACCESS_LOG": "Benutzerzugriffsprotokoll",
"ENCOUNTER_SUBMISSION_LOG": "Begegnungseinreichungsprotokoll",
"DELETED_ENCOUNTERS_LOG": "Protokoll gelöschter Begegnungen",
"EMAIL_LOG": "E-Mail-Protokoll",
"MAP_IS_LOADING": "Karte wird geladen",
"SESSION_WARNING_CONTENT": "Ihre Sitzung läuft bald ab.",
"SESSION_WARNING_TITLE": "Sitzungszeit-Warnung",
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@
"CITATION_CITATION_DETAILS_2": "J. Levenson, S. Gero, J. Van Oast, and J. Holmberg. 2015. Flukebook: a cloud-based photo-identification analysis tools for marine mammal research. Accessible at: https://www.flukebook.org",
"CITATION_FORWARD": "To forward the citation of any publication / report that made use of the data / tools provided by Wild Me for inclusion in our list of references by submitting to [email protected].",
"CITATION_DISCLAIMER": "Not to hold Wild Me or the original data providers liable for errors in the data. While we have made every effort to ensure the quality of the database, we cannot guarantee the accuracy of these datasets.",
"USER_ACCESS_LOG": "User Access Log",
"ENCOUNTER_SUBMISSION_LOG": "Encounter Submission Log",
"DELETED_ENCOUNTERS_LOG": "Deleted Encounters Log",
"EMAIL_LOG": "Email Log",
"MAP_IS_LOADING": "Map is loading",
"SESSION_WARNING_CONTENT": "Your session is about to expire. ",
"SESSION_WARNING_TITLE": "Session Timeout Warning",
Expand Down Expand Up @@ -314,5 +318,4 @@
"BEERROR_INVALID" : "Could not submit; field format was invalid: ",
"BEERROR_UNKNOWN" : "Could not submit due to unknown error.",
"ANON_UPLOAD_IMAGE_WARNING": "Images cannot be uploaded until captcha is complete."

}
4 changes: 4 additions & 0 deletions frontend/src/locale/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@
"SESSION_LOGIN": "Iniciar sesión",
"SESSION_CLOSE": "Cerrar",
"LOADING": "Cargando",
"USER_ACCESS_LOG": "Registro de acceso de usuario",
"ENCOUNTER_SUBMISSION_LOG": "Registro de envío de encuentros",
"DELETED_ENCOUNTERS_LOG": "Registro de encuentros eliminados",
"EMAIL_LOG": "Registro de correos electrónicos",
"REPORT_PAGE_TITLE": "Página para informar de un encuentro",
"REPORT_PAGE_DESCRIPTION": "Háblenos del animal que vio y sea lo más específico posible. Al enviar datos e imágenes, usted autoriza el uso ilimitado de estos materiales únicamente con fines de investigación y conservación.",
"SIGNIN_REMINDER_BANNER": "Para asociar el encuentro con tu cuenta, por favor inicia sesión. Si deseas continuar de forma anónima, completa el captcha.",
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@
"CITATION_CITATION_DETAILS_2": "J. Levenson, S. Gero, J. Van Oast et J. Holmberg. 2015. Flukebook : outils d'analyse d'identification photographique basés sur le cloud pour la recherche sur les mammifères marins. Accessible sur : https://www.flukebook.org",
"CITATION_FORWARD": "Transmettre la citation de toute publication / rapport qui a utilisé les données / outils fournis par Wild Me pour inclusion dans notre liste de références en l'envoyant à [email protected].",
"CITATION_DISCLAIMER": "Ne pas tenir Wild Me ou les fournisseurs de données originaux responsables des erreurs dans les données. Bien que nous ayons fait tout notre possible pour garantir la qualité de la base de données, nous ne pouvons garantir l'exactitude de ces ensembles de données.",
"USER_ACCESS_LOG": "Journal d'accès utilisateur",
"ENCOUNTER_SUBMISSION_LOG": "Journal des soumissions de rencontres",
"DELETED_ENCOUNTERS_LOG": "Journal des rencontres supprimées",
"EMAIL_LOG": "Journal des e-mails",
"MAP_IS_LOADING": "La carte est en cours de chargement",
"SESSION_WARNING_CONTENT": "Votre session est sur le point d'expirer.",
"SESSION_WARNING_TITLE": "Avertissement de fin de session",
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/locale/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@
"CITATION_CITATION_DETAILS_2": "J. Levenson, S. Gero, J. Van Oast e J. Holmberg. 2015. Flukebook: strumenti di analisi basati su cloud per l'identificazione fotografica per la ricerca sui mammiferi marini. Accessibile su: https://www.flukebook.org",
"CITATION_FORWARD": "Trasmettere la citazione di qualsiasi pubblicazione / rapporto che ha utilizzato i dati / strumenti forniti da Wild Me per l'inclusione nel nostro elenco di riferimenti inviandola a [email protected].",
"CITATION_DISCLAIMER": "Non ritenere Wild Me o i fornitori di dati originali responsabili per errori nei dati. Sebbene abbiamo fatto tutto il possibile per garantire la qualità del database, non possiamo garantire l'accuratezza di questi dataset.",
"USER_ACCESS_LOG": "Registro accessi utente",
"ENCOUNTER_SUBMISSION_LOG": "Registro delle invii incontri",
"DELETED_ENCOUNTERS_LOG": "Registro incontri eliminati",
"EMAIL_LOG": "Registro e-mail",
"MAP_IS_LOADING": "Mappa in caricamento",
"SESSION_WARNING_CONTENT": "La tua sessione sta per scadere.",
"SESSION_WARNING_TITLE": "Avviso di scadenza sessione",
Expand Down
Loading

0 comments on commit d9eb0e4

Please sign in to comment.