Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "npx vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
Expand Down
Binary file added frontend/public/controller/Info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/controller/Search Contacts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { DisasterInformationAdder } from './pages/controller/DisasterInformation
import { DisasterMap } from './pages/controller/DisasterMap';
import SearchResults from './components/Controller/SearchResult';
import PrivateRoute from './authanticate/PrivateRoutes';
import { DonationsPage } from './pages/controller/DonationsPage';
import { InformationPage } from './pages/controller/InformationPage';

const isAuthenticated = () => {
// Check if the user is logged in (e.g., check if token exists in localStorage)
Expand Down Expand Up @@ -44,6 +46,8 @@ function App() {
<Route path="/controller/volunteering" element = {<PrivateRoute isAuthenticated={isAuthenticated} element={VolunteeringPage}/>} />
<Route path="/controller/map" element = {<PrivateRoute isAuthenticated={isAuthenticated} element={DisasterMap}/>}/>
<Route path='/search' element = {<PrivateRoute isAuthenticated={isAuthenticated} element={SearchResults}/>}/>
<Route path='/controller/donations' element = {<PrivateRoute isAuthenticated={isAuthenticated} element={DonationsPage}/>}/>
<Route path='/controller/information' element = {<PrivateRoute isAuthenticated={isAuthenticated} element={InformationPage}/>}/>
</Routes>
</BrowserRouter>

Expand Down
7 changes: 4 additions & 3 deletions frontend/src/Windows/RequestWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const WindowComponent = ({
otherNeeds,
verification,
image,
locationLatLan,
province,
locationLatLan
}) => {
const [clickButton,setclickButton] = useState();
const lat = parseFloat(locationLatLan[0]);
Expand Down Expand Up @@ -48,7 +49,7 @@ export const WindowComponent = ({
</h1>
<h2 className=" text-center font-bold m-5 text-2xl">
<span className="w-full px-3 py-2 m-5 h-full font-bold rounded-3xl bg-ControllerSec text-black shadow-md text-xl md:2xl">
{verification}
{verification? "Verified": "Unverified"}
</span>
</h2>

Expand Down Expand Up @@ -101,7 +102,7 @@ export const WindowComponent = ({
id="No_of_people_effected"
className="block p-2.5 text-sm w-full text-gray-600 bg-gray-50 rounded-lg border border-b-4 border-gray-400"
>
{affectedCount}
{affectedCount}{province}
</text>
</div>
<div className="flex items-center relative flex-row justify-start px-1">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/axiosConfig.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios from "axios";

axios.defaults.baseURL =
process.env.NODE_ENV != 'production'? 'http://localhost:5000' : 'https://dms-server-dgtg.onrender.com';
process.env.NODE_ENV != 'production'? 'http://localhost:5000' : 'https://dms-server-goil.onrender.com';
10 changes: 5 additions & 5 deletions frontend/src/components/Controller/Home/Menues.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export const Menues = () => {
const service = [
{
id: 1,
title: "Family Emergency Plans",
description: "Tool to create plans during the Emergency.",
image: "/controller/Full Family.png",
title: "Disaster Information",
description: "Aware about various kinds of disasters in Sri Lanka",
image: "/controller/Info.png",
url: "/controller/information"
},
{
Expand All @@ -22,7 +22,7 @@ export const Menues = () => {
title: "Emergency Contacts",
description:
"Discover essential contact info for any disaster. Be ready, stay vigilant.",
image: "/controller/Light On.png",
image: "/controller/Search Contacts.png",
url: "/controller/ContactInfoAdder"
},
{
Expand All @@ -31,7 +31,7 @@ export const Menues = () => {
description:
"Contribute today to support disaster relief efforts, helping communities rebuild and thrive. ",
image: "/controller/Donation.png",
url: "/controller/news"
url: "/controller/donations"
},
{
id: 5,
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/components/Controller/LanguageBar.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import { LanguageButtons } from "./LanguageButtons"
import { Button } from '@mui/material'
import { useNavigate } from 'react-router-dom'

Expand All @@ -12,12 +11,11 @@ export const LanguageBar = () => {
}

return (
<div className="flex items-start justify-between px-[10px] py-[2px] h-[35px] relative self-stretch w-full flex-[0_0_auto] bg-[#6d6969]">
<LanguageButtons />
<div className="relative self-stretch w-[150px] mt-[-1.00px] [font-family:'Roboto',Helvetica] font-bold text-[#fcfffe] text-[16px] tracking-[0.15px] leading-[24px] whitespace-nowrap">
<div className="flex items-center justify-between px-[20px] py-[2px] h-[35px] relative self-stretch w-full flex-[0_0_auto] bg-[#6d6969]">
<div className="flex relative items-center self-stretch w-[150px] mt-[-1.00px] [font-family:'Roboto',Helvetica] font-bold text-[#fcfffe] text-[16px] tracking-[0.15px] leading-[24px] whitespace-nowrap">
<h3>Call center 1717</h3>
</div>
<Button variant="contained" onClick={logOut}>
<Button variant="contained" className='flex text-sm justify-center items-center w-28 h-6 p-1' onClick={logOut}>
Log Out
</Button>
</div>
Expand Down
19 changes: 0 additions & 19 deletions frontend/src/components/Controller/LanguageButtons.jsx

This file was deleted.

8 changes: 4 additions & 4 deletions frontend/src/components/Controller/News/NewsPreview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const NewsPreview = () =>{
<h1 className="text-primary font-bold md:text-3xl text-lg">
{selectedNews.heading}
</h1>
<p className="my-3 text-base">{selectedNews.author}</p>
<p className="my-3 text-base">by {selectedNews.author}</p>
<div className="w-1/4 flex justify-between text-xs text-gray-500">
<p>{selectedNews.createdTime.split(' ')[0]} </p>
<p>{selectedNews.createdDate}</p>
Expand Down Expand Up @@ -224,10 +224,10 @@ export const NewsPreview = () =>{
</h1>
{/* News item */}
<div className={ (showMoreItems ? "h-[600px] overflow-auto" : "h-[320px] overflow-hidden")}>

{Array.isArray(newsItems) && newsItems.map((news, i) => (
<React.Fragment key={i}>
<div className="focus:bg-opacity-50 border mb-1" onClick={() => handleCardClick(news)}>
<div className="focus:bg-opacity-50 border mb-1 " onClick={() => handleCardClick(news)}>
<div className="flex items-center justify-start gap-2 bg-grey-200 h-20 my-2">
<div className=" w-full py-0 h-full">
{news.image && (
Expand All @@ -245,7 +245,7 @@ export const NewsPreview = () =>{
</h1>

<div className=" mt-3 flex justify-between text-xs">
<p className="text-black">{news.author}</p>
<p className="text-black">by {news.author}</p>
<p className="text-gray-900">{news.createdDate}</p>
<p> Display :<span className="text-gray-800">{(news.show).toString()}</span> </p>
</div>
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/components/Controller/Requests/BarSlideShow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import { Fa2 } from 'react-icons/fa6';
const [currentMonth, setCurrentMonth] = useState(0); // Index of current month dataset
//const dataset =[];
const [dataset, setDataset] = useState([]);
const months = [ "March","April", "May"];
const provinces =["Colombo", "Rathnapura","Galle","Kottawa"];
// const provinces =["Western Province", "Southern Province", "Sabaragamuwa Province"];
const months = [ "March","April", "May", "June"];
// const provinces =["Colombo", "Rathnapura","Galle","Kottawa"];
const provinces =["Western Province", "Southern Province", "Sabaragamuwa Province"];
const disasters = ["flood", "tsunami", "fire", "wind", "landslide"];
const newDataset = [];


Expand All @@ -29,7 +30,7 @@ import { Fa2 } from 'react-icons/fa6';
const provinceDataset = [];
for(let k=0;k<provinces.length;k++){

const provReq = monthlyReq.filter(request => (request.disasterLocation) === provinces[k]);
const provReq = monthlyReq.filter(request => (request.requestProvince) === provinces[k]);

// const provReq = monthlyReq.filter(async(request) => {await getProvince(request.disasterLocation) === provinces[k]});
// const provReq = await Promise.all(monthlyReq.map(async (request) => {
Expand All @@ -46,6 +47,7 @@ import { Fa2 } from 'react-icons/fa6';
landslide:provReq.filter(request => request.disasterType.toLowerCase().includes("landslide") ).length,
wind:provReq.filter(request => request.disasterType.toLowerCase().includes("wind") ).length,
fire:provReq.filter(request => request.disasterType.toLowerCase().includes("fire") ).length,
other:provReq.filter(request =>!disasters.some(disasters =>request.disasterType.toLowerCase().includes(disasters))).length,
};
provinceDataset.push(provinceData);
}
Expand Down Expand Up @@ -74,7 +76,7 @@ import { Fa2 } from 'react-icons/fa6';
<Bar dataKey="landslide" fill='MediumSpringGreen'/>
<Bar dataKey="wind" fill='Azure' />
<Bar dataKey="fire" fill='MediumOrchid'/>

<Bar dataKey="other" fill='Blue'/>
</ReBarChart>
</ResponsiveContainer>
);
Expand Down
10 changes: 3 additions & 7 deletions frontend/src/components/Controller/Requests/RequestsDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ export const RequestsDetails = ({flood,tsunami,fire,wind,other,today, monthly})
},
]}
width={300}
height={200}

height={200}
/>
</div>
</div>
Expand Down Expand Up @@ -303,18 +302,15 @@ export const RequestsDetails = ({flood,tsunami,fire,wind,other,today, monthly})
{ id: 0, value:monthlyAccepted.length, label: `${monthlyAccepted.length}`},
{ id: 1, value:monthlyNotAccepted.length},
],

outerRadius: 50,
innerRadius:40,
paddingAngle: 1,
cornerRadius: 5,
startAngle: 0,
endAngle: 360,
cx: 45,
cy: 45,

},

cy: 45,
},
]}
width={100}
height={100}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Controller/TitleBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { SearchBar } from "./SearchBar"
export const TitleBar = () => {
return(
<div className=" grid md:grid-cols-1 md:m-4 sm:m-4 lg:m-0 md:justify-center sm:justify-center lg:grid-cols-2 sm:grid-cols-1 grid-cols-1 flex-wrap h-full items-center px-[5px] relative self-stretch w-full">

<div className={`flex relative w-full flex-wrap md:w-[100%] md:justify-center sm:justify-center lg:w-[100%] sm:w-[100%] items-center justify-center [font-family:'Inter',Helvetica] font-semibold text-primary text-[20px] whitespace-nowrap `}>
Disaster Management Center
<img className="flex items-center w-[23px] h-[23px] relative left-[10px] " src="/controller/logo_main.png" alt='logo_main'/>
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/pages/controller/ControllerHomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export const ControllerHomePage = () => {
<Weather/>
</div>
<Footer/>


</div>

)
Expand Down
17 changes: 17 additions & 0 deletions frontend/src/pages/controller/DonationsPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import { LanguageBar } from "../../components/Controller/LanguageBar";
import { HeaderBar } from "../../components/Controller/HeaderBar";
import { Footer } from "../../components/Controller/Footer"

export const DonationsPage = () =>{
return (
<div>
<LanguageBar/>
<HeaderBar/>
<div className=" h-60 w-full">
<p className="flex text-[2rem] items-center justify-center">Donation Page</p>
</div>
<Footer />
</div>
);
}
17 changes: 17 additions & 0 deletions frontend/src/pages/controller/InformationPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import { LanguageBar } from "../../components/Controller/LanguageBar";
import { HeaderBar } from "../../components/Controller/HeaderBar";
import { Footer } from "../../components/Controller/Footer"

export const InformationPage = () =>{
return (
<div>
<LanguageBar/>
<HeaderBar/>
<div className=" h-60 w-full">
<p className="flex text-[2rem] items-center justify-center">Disaster Information Page</p>
</div>
<Footer />
</div>
);
}
Loading