Changeset 8dffe02 for reactapp/src/Pages
- Timestamp:
- 01/22/23 16:51:43 (2 years ago)
- Branches:
- main
- Parents:
- 9bf1f8d
- Location:
- reactapp/src/Pages
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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",
Note:
See TracChangeset
for help on using the changeset viewer.