Changeset 8dffe02
- Timestamp:
- 01/22/23 16:51:43 (2 years ago)
- Branches:
- main
- Parents:
- 9bf1f8d
- Files:
-
- 12 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/src/Components/OpinionTree.js
r9bf1f8d r8dffe02 46 46 47 47 useEffect(() => { 48 const url = `http://192.168.1. 254:8080/secure/currentUser`;48 const url = `http://192.168.1.108:8080/secure/currentUser`; 49 49 50 50 const fetchUser = async () => { … … 72 72 ) { 73 73 const response = await axios( 74 `http://192.168.1. 254:8080/secure/upvoteOpinion/${post.postId}`,74 `http://192.168.1.108:8080/secure/upvoteOpinion/${post.postId}`, 75 75 { 76 76 method: "get", … … 95 95 ) { 96 96 const response = await axios( 97 `http://192.168.1. 254:8080/secure/downvoteOpinion/${post.postId}`,97 `http://192.168.1.108:8080/secure/downvoteOpinion/${post.postId}`, 98 98 { 99 99 method: "get", … … 150 150 if (!replyContent.length < 1) { 151 151 const response = await axios( 152 `http://192.168.1. 254:8080/secure/professor/${professor.professorId}/replyToOpinion/${postId}`,152 `http://192.168.1.108:8080/secure/professor/${professor.professorId}/replyToOpinion/${postId}`, 153 153 { 154 154 method: "post", … … 171 171 if (!reportContent.length < 1) { 172 172 const response = await axios( 173 `http://192.168.1. 254:8080/secure/reportOpinion/${postId}`,173 `http://192.168.1.108:8080/secure/reportOpinion/${postId}`, 174 174 { 175 175 method: "post", -
reactapp/src/Components/Search.js
r9bf1f8d r8dffe02 18 18 const fetchData = async () => { 19 19 try { 20 Promise.all([fetch(`http://192.168.1. 254:8080/public/professors/nameContains/${transliterate(query)}`),21 fetch(`http://192.168.1. 254:8080/public/subjects/nameContains/${transliterate(query)}`)])20 Promise.all([fetch(`http://192.168.1.108:8080/public/professors/nameContains/${transliterate(query)}`), 21 fetch(`http://192.168.1.108:8080/public/subjects/nameContains/${transliterate(query)}`)]) 22 22 .then(([resProfessors, resSubjects]) => Promise.all([resProfessors.json(), resSubjects.json()])) 23 23 .then(([dataProfessors, dataSubjects]) => { -
reactapp/src/Components/Styled/Search.style.js
r9bf1f8d r8dffe02 3 3 4 4 export const SearchBox = styled.input` 5 width: 450px;5 width: 350px; 6 6 box-sizing: border-box; 7 7 border: 2px solid #ccc; … … 23 23 padding: 12px 16px; 24 24 z-index: 1; 25 width: 450px;25 width: 350px; 26 26 padding: 0; 27 27 `; -
reactapp/src/Components/SubjectsAccordion.js
r9bf1f8d r8dffe02 23 23 setOpacity(1); 24 24 try { 25 Promise.all([fetch(`http://192.168.1. 254:8080/public/subjects?studyProgrammeId=${props.title.studyProgrammeId}`),26 fetch(`http://192.168.1. 254:8080/public/study_programme/${props.title.studyProgrammeId}/threadCountForEachSubject`)])25 Promise.all([fetch(`http://192.168.1.108:8080/public/subjects?studyProgrammeId=${props.title.studyProgrammeId}`), 26 fetch(`http://192.168.1.108:8080/public/study_programme/${props.title.studyProgrammeId}/threadCountForEachSubject`)]) 27 27 .then(([resSubjects, counts]) => Promise.all([resSubjects.json(), counts.json()])) 28 28 .then(([dataSubjects, dataCounts]) => { -
reactapp/src/Components/UserHeader.js
r9bf1f8d r8dffe02 11 11 12 12 useEffect(() => { 13 const url = `http://192.168.1. 254:8080/secure/currentUser`;13 const url = `http://192.168.1.108:8080/secure/currentUser`; 14 14 15 15 const fetchUser = async () => { -
reactapp/src/Pages/Faculty.js
r9bf1f8d r8dffe02 34 34 const fetchProfessors = async () => { 35 35 try { 36 const response = await fetch(`http://192.168.1. 254:8080/public/professors?facultyId=${params.facultyId}`);36 const response = await fetch(`http://192.168.1.108:8080/public/professors?facultyId=${params.facultyId}`); 37 37 let cyclicGraph = await response.json(); 38 38 let jsogStructure = JSOG.encode(cyclicGraph); … … 47 47 const fetchStudyProgrammes = async () => { 48 48 try { 49 const response2 = await fetch(`http://192.168.1. 254:8080/public/study_programmes?facultyId=${params.facultyId}`);49 const response2 = await fetch(`http://192.168.1.108:8080/public/study_programmes?facultyId=${params.facultyId}`); 50 50 let cyclicGraph2 = await response2.json(); 51 51 let jsogStructure2 = JSOG.encode(cyclicGraph2); … … 60 60 const fetchProfessorOpinionCount = async () => { 61 61 try { 62 const response3 = await fetch(`http://192.168.1. 254:8080/public/faculty/${params.facultyId}/opinionCountForEachProfessor`);62 const response3 = await fetch(`http://192.168.1.108:8080/public/faculty/${params.facultyId}/opinionCountForEachProfessor`); 63 63 let cyclicGraph3 = await response3.json(); 64 64 let jsogStructure3 = JSOG.encode(cyclicGraph3); -
reactapp/src/Pages/Home.js
r9bf1f8d r8dffe02 14 14 15 15 useEffect(() => { 16 Promise.all([fetch(`http://192.168.1. 254:8080/public/latest10opinions`),17 fetch(`http://192.168.1. 254:8080/public/latest10threads`)])16 Promise.all([fetch(`http://192.168.1.108:8080/public/latest10opinions`), 17 fetch(`http://192.168.1.108:8080/public/latest10threads`)]) 18 18 .then(([resOpinions, resThreads]) => Promise.all([resOpinions.json(), resThreads.json()])) 19 19 .then(([dataOpinions, dataThreads]) => { -
reactapp/src/Pages/Professor.js
r9bf1f8d r8dffe02 42 42 43 43 useEffect(() => { 44 Promise.all([fetch(`http://192.168.1. 254:8080/public/professor/${params.professorId}`),45 fetch(`http://192.168.1. 254:8080/public/professor/${params.professorId}/relatedOpinions`)])44 Promise.all([fetch(`http://192.168.1.108:8080/public/professor/${params.professorId}`), 45 fetch(`http://192.168.1.108:8080/public/professor/${params.professorId}/relatedOpinions`)]) 46 46 .then(([resProfessor, resRelatedOpinions]) => Promise.all([resProfessor.json(), resRelatedOpinions.json()])) 47 47 .then(([dataProfessor, dataRelatedOpinions]) => { … … 80 80 if (!postContent.length < 1) { 81 81 const response = await axios( 82 `http://192.168.1. 254:8080/secure/professor/${params.professorId}/addOpinion`,82 `http://192.168.1.108:8080/secure/professor/${params.professorId}/addOpinion`, 83 83 { 84 84 method: "post", -
reactapp/src/Pages/PublicUserProfile.js
r9bf1f8d r8dffe02 13 13 useEffect(() => { 14 14 const fetchPublicProfile = async () => { 15 const resp = await fetch(`http://192.168.1. 254:8080/public/user/${params.userId}`)15 const resp = await fetch(`http://192.168.1.108:8080/public/user/${params.userId}`) 16 16 let cyclicGraph = await resp.json(); 17 17 let jsogStructure = JSOG.encode(cyclicGraph); -
reactapp/src/Pages/Subject.js
r9bf1f8d r8dffe02 50 50 51 51 useEffect(() => { 52 Promise.all([fetch(`http://192.168.1. 254:8080/public/subject/${params.subjectId}`),53 fetch(`http://192.168.1. 254:8080/public/subject/${params.subjectId}/threads`)])52 Promise.all([fetch(`http://192.168.1.108:8080/public/subject/${params.subjectId}`), 53 fetch(`http://192.168.1.108:8080/public/subject/${params.subjectId}/threads`)]) 54 54 .then(([resSubject, resThreads]) => Promise.all([resSubject.json(), resThreads.json()])) 55 55 .then(([dataSubject, dataThreads]) => { … … 88 88 if (!topicTitle.length < 1 && !topicContent.length < 1) { 89 89 const response = await axios( 90 `http://192.168.1. 254:8080/secure/subject/${params.subjectId}/addThread`,90 `http://192.168.1.108:8080/secure/subject/${params.subjectId}/addThread`, 91 91 { 92 92 method: "post", … … 214 214 <EntityUl key={topic.postId}> 215 215 <EntityLi bgcolor="cornsilk"> 216 <a href={"/topic/" + topic.postId}>{topic.title.length >= 99 ? topic.title.slice(0,98) + "..." : topic.title}</a>216 <a href={"/topic/" + topic.postId}>{topic.title.length >= 65 ? topic.title.slice(0,65) + "..." : topic.title}</a> 217 217 <EntityParam right="30px"> 218 218 <span style={{ fontWeight: "normal" }}> -
reactapp/src/Pages/Topic.js
r9bf1f8d r8dffe02 55 55 56 56 useEffect(() => { 57 const url1 = `http://192.168.1. 254:8080/public/thread/${params.topicId}`;58 const url2 = `http://192.168.1. 254:8080/secure/currentUser`;57 const url1 = `http://192.168.1.108:8080/public/thread/${params.topicId}`; 58 const url2 = `http://192.168.1.108:8080/secure/currentUser`; 59 59 60 60 const fetchTopic = async () => { … … 121 121 if (!replyContent.length < 1) { 122 122 const response = await axios( 123 `http://192.168.1. 254:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`,123 `http://192.168.1.108:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`, 124 124 { 125 125 method: "post", … … 142 142 if (!reportContent.length < 1) { 143 143 const response = await axios( 144 `http://192.168.1. 254:8080/secure/reportThread/${postId}`,144 `http://192.168.1.108:8080/secure/reportThread/${postId}`, 145 145 { 146 146 method: "post", … … 171 171 if (!postContent.length < 1) { 172 172 const response = await axios( 173 `http://192.168.1. 254:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`,173 `http://192.168.1.108:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`, 174 174 { 175 175 method: "post", … … 204 204 ) { 205 205 const response = await axios( 206 `http://192.168.1. 254:8080/secure/upvoteThread/${post.postId}`,206 `http://192.168.1.108:8080/secure/upvoteThread/${post.postId}`, 207 207 { 208 208 method: "get", … … 227 227 ) { 228 228 const response = await axios( 229 `http://192.168.1. 254:8080/secure/downvoteThread/${post.postId}`,229 `http://192.168.1.108:8080/secure/downvoteThread/${post.postId}`, 230 230 { 231 231 method: "get", -
reactapp/src/Pages/University.js
r9bf1f8d r8dffe02 28 28 29 29 useEffect(() => { 30 Promise.all([fetch(`http://192.168.1. 254:8080/public/faculties?universityId=${params.universityId}`),31 fetch(`http://192.168.1. 254:8080/public/university/${params.universityId}/sectionAndPostCount`)])30 Promise.all([fetch(`http://192.168.1.108:8080/public/faculties?universityId=${params.universityId}`), 31 fetch(`http://192.168.1.108:8080/public/university/${params.universityId}/sectionAndPostCount`)]) 32 32 .then(([resFaculties, counts]) => Promise.all([resFaculties.json(), counts.json()])) 33 33 .then(([dataFaculties, dataCounts]) => { -
reactapp/src/Pages/UserDashboard.js
r9bf1f8d r8dffe02 95 95 if (newOpinionTargetProfessorId!=="") { 96 96 try { 97 Promise.all([fetch(`http://192.168.1. 254:8080/public/professor/${newOpinionTargetProfessorId}`),98 fetch(`http://192.168.1. 254:8080/public/professor/${newOpinionTargetProfessorId}/relatedOpinions`)])97 Promise.all([fetch(`http://192.168.1.108:8080/public/professor/${newOpinionTargetProfessorId}`), 98 fetch(`http://192.168.1.108:8080/public/professor/${newOpinionTargetProfessorId}/relatedOpinions`)]) 99 99 .then(([resNewOpinionTargetProfessor, resNewProfessorRelatedOpinions]) => Promise.all([resNewOpinionTargetProfessor.json(), resNewProfessorRelatedOpinions.json()])) 100 100 .then(([dataNewOpinionTargetProfessor, dataNewProfessorRelatedOpinions]) => { … … 130 130 if (newTargetSubjectId!=="") { 131 131 try { 132 Promise.all([fetch(`http://192.168.1. 254:8080/public/subject/${newTargetSubjectId}`),133 fetch(`http://192.168.1. 254:8080/public/subject/${newTargetSubjectId}/threads`)])132 Promise.all([fetch(`http://192.168.1.108:8080/public/subject/${newTargetSubjectId}`), 133 fetch(`http://192.168.1.108:8080/public/subject/${newTargetSubjectId}/threads`)]) 134 134 .then(([resNewTargetSubject, resNewTargetSubjectThreads]) => Promise.all([resNewTargetSubject.json(), resNewTargetSubjectThreads.json()])) 135 135 .then(([dataNewTargetSubject, dataNewTargetSubjectThreads]) => { … … 158 158 try { 159 159 if(!loadedUser) { 160 Promise.all([axios.get(`http://192.168.1. 254:8080/secure/currentUser`, {withCredentials:true}),161 axios.get(`http://192.168.1. 254:8080/secure/currentUser/posts`, {withCredentials:true})])160 Promise.all([axios.get(`http://192.168.1.108:8080/secure/currentUser`, {withCredentials:true}), 161 axios.get(`http://192.168.1.108:8080/secure/currentUser/posts`, {withCredentials:true})]) 162 162 .then(([resUser, resAuthoredPosts]) => Promise.all([resUser.data, resAuthoredPosts.data])) 163 163 .then(([dataUser, dataAuthoredPosts]) => { … … 183 183 const fetchPostReports = async () => { 184 184 try { 185 const response = await axios.get(`http://192.168.1. 254:8080/secure/getAllPostReports`, {withCredentials: true});185 const response = await axios.get(`http://192.168.1.108:8080/secure/getAllPostReports`, {withCredentials: true}); 186 186 var cyclicGraph = await response.data; 187 187 var jsogStructure = JSOG.encode(cyclicGraph); … … 202 202 try { 203 203 if(reportForModal.post !== null && reportForModal.post.targetProfessor !== undefined) { 204 await axios(`http://192.168.1. 254:8080/secure/updateOpinion/${reportForModal.post.postId}`,204 await axios(`http://192.168.1.108:8080/secure/updateOpinion/${reportForModal.post.postId}`, 205 205 { 206 206 method: "put", … … 212 212 withCredentials: true, 213 213 }) 214 await axios(`http://192.168.1. 254:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{214 await axios(`http://192.168.1.108:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{ 215 215 method: "get", 216 216 withCredentials: true 217 217 }) 218 218 } else if(reportForModal.post !== null && reportForModal.post.targetProfessor === undefined) { 219 await axios(`http://192.168.1. 254:8080/secure/updateThread/${reportForModal.post.postId}`,219 await axios(`http://192.168.1.108:8080/secure/updateThread/${reportForModal.post.postId}`, 220 220 { 221 221 method: "put", … … 229 229 }) 230 230 } 231 await axios(`http://192.168.1. 254:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{231 await axios(`http://192.168.1.108:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{ 232 232 method: "get", 233 233 withCredentials: true … … 243 243 try { 244 244 if(reportForModal.post !== null && reportForModal.post.targetProfessor !== undefined) { 245 var response = await axios(`http://192.168.1. 254:8080/secure/updateOpinion/${reportForModal.post.postId}`,245 var response = await axios(`http://192.168.1.108:8080/secure/updateOpinion/${reportForModal.post.postId}`, 246 246 { 247 247 method: "put", … … 253 253 withCredentials: true, 254 254 }) 255 await axios(`http://192.168.1. 254:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{255 await axios(`http://192.168.1.108:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{ 256 256 method: "get", 257 257 withCredentials: true 258 258 }) 259 259 } else if(reportForModal.post !== null && reportForModal.post.targetProfessor === undefined) { 260 var response = await axios(`http://192.168.1. 254:8080/secure/updateThread/${reportForModal.post.postId}`,260 var response = await axios(`http://192.168.1.108:8080/secure/updateThread/${reportForModal.post.postId}`, 261 261 { 262 262 method: "put", … … 270 270 }) 271 271 } 272 await axios(`http://192.168.1. 254:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{272 await axios(`http://192.168.1.108:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{ 273 273 method: "get", 274 274 withCredentials: true … … 285 285 try { 286 286 if(reportForModal.post !== null && reportForModal.post.targetProfessor !== undefined) { 287 await axios(`http://192.168.1. 254:8080/secure/deleteOpinion/${reportForModal.post.postId}`,287 await axios(`http://192.168.1.108:8080/secure/deleteOpinion/${reportForModal.post.postId}`, 288 288 { 289 289 method: "delete", … … 292 292 window.location.reload(); 293 293 } else if(reportForModal.post !== null && reportForModal.post.targetProfessor === undefined) { 294 await axios(`http://192.168.1. 254:8080/secure/deleteThread/${reportForModal.post.postId}`,294 await axios(`http://192.168.1.108:8080/secure/deleteThread/${reportForModal.post.postId}`, 295 295 { 296 296 method: "delete", -
reactapp/src/api/axios.js
r9bf1f8d r8dffe02 2 2 3 3 export default axios.create({ 4 baseURL: "http://192.168.1. 254:8080",4 baseURL: "http://192.168.1.108:8080", 5 5 }); -
springapp/src/main/java/mk/profesori/springapp/Controller/PublicController.java
r9bf1f8d r8dffe02 13 13 @RestController 14 14 @RequestMapping("/public") 15 @CrossOrigin(origins = { "http://192.168.1. 254:3000", "http://192.168.0.28:3000" })15 @CrossOrigin(origins = { "http://192.168.1.108:3000", "http://192.168.0.28:3000" }) 16 16 public class PublicController { 17 17 -
springapp/src/main/java/mk/profesori/springapp/Controller/SecureController.java
r9bf1f8d r8dffe02 22 22 @RestController 23 23 @RequestMapping("/secure") 24 @CrossOrigin(origins = { "http://192.168.1. 254:3000", "http://192.168.0.28:3000" })24 @CrossOrigin(origins = { "http://192.168.1.108:3000", "http://192.168.0.28:3000" }) 25 25 public class SecureController { 26 26 -
springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java
r9bf1f8d r8dffe02 37 37 @Override 38 38 public void addCorsMappings(CorsRegistry registry) { 39 registry.addMapping("/**").allowedOrigins("http://192.168.1. 254:3000", "http://192.168.0.28:3000")39 registry.addMapping("/**").allowedOrigins("http://192.168.1.108:3000", "http://192.168.0.28:3000") 40 40 .allowCredentials(true); 41 41 } -
springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java
r9bf1f8d r8dffe02 45 45 String tokenToResend = customUserDetailsService 46 46 .createToken(userRepository.findByEmail(request.getEmail()).get()); 47 String link = "http://192.168.1. 254:8080/registration/confirm?token=" + tokenToResend;47 String link = "http://192.168.1.108:8080/registration/confirm?token=" + tokenToResend; 48 48 emailSender.send(request.getEmail(), emailSender.buildEmail(request.getUsername(), link)); 49 49 return tokenToResend; … … 66 66 UserRole.REGULAR)); 67 67 68 String link = "http://192.168.1. 254:8080/registration/confirm?token=" + token;68 String link = "http://192.168.1.108:8080/registration/confirm?token=" + token; 69 69 70 70 emailSender.send(request.getEmail(), emailSender.buildEmail(request.getUsername(), link)); -
springapp/src/main/resources/application.properties
r9bf1f8d r8dffe02 1 1 spring.datasource.url=jdbc:postgresql://localhost:5432/profesorimk 2 2 spring.datasource.username=postgres 3 spring.datasource.password= baz@2283 spring.datasource.password=postgres 4 4 spring.jpa.hibernate.ddl-auto=update 5 5 spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect 6 6 spring.jpa.show-sql=false 7 7 spring.jpa.properties.hibernate.format_sql=true 8 server.address=192.168.1. 2549 spring.mail.host=192.168.1. 2548 server.address=192.168.1.108 9 spring.mail.host=192.168.1.108 10 10 spring.mail.username=mailuser 11 11 spring.mail.password=mailpass
Note:
See TracChangeset
for help on using the changeset viewer.