Commit b546bc474ac022210948c56133028521ce680379
1 parent
275b17e4fb
Exists in
master
and in
1 other branch
Show functionality of course attendance while parent login
Showing
3 changed files
with
40 additions
and
6 deletions
Show diff stats
src/api/menu.js
1 | const adminMenu = [ | 1 | const adminMenu = [ |
2 | // { header: 'Apps' }, | 2 | // { header: 'Apps' }, |
3 | { | 3 | { |
4 | title: 'Dashboard', | 4 | title: 'Dashboard', |
5 | // group: 'apps', | 5 | // group: 'apps', |
6 | name: 'Dashboard', | 6 | name: 'Dashboard', |
7 | icon: '/static/icon/dashboard.png', | 7 | icon: '/static/icon/dashboard.png', |
8 | }, | 8 | }, |
9 | { | 9 | { |
10 | title: 'Class', | 10 | title: 'Class', |
11 | // group: 'apps', | 11 | // group: 'apps', |
12 | name: 'Class', | 12 | name: 'Class', |
13 | icon: '/static/icon/class.png', | 13 | icon: '/static/icon/class.png', |
14 | }, | 14 | }, |
15 | { | 15 | { |
16 | title: 'Course', | 16 | title: 'Course', |
17 | group: 'AdminCourse', | 17 | group: 'AdminCourse', |
18 | component: 'AdminCourse', | 18 | component: 'AdminCourse', |
19 | icon: '/static/icon/attendence.png', | 19 | icon: '/static/icon/attendence.png', |
20 | items: [ | 20 | items: [ |
21 | { name: 'AssignTeachers', title: 'Assign Teachers', component: 'AssignTeachers', action: '', }, | 21 | { name: 'AssignTeachers', title: 'Assign Teachers', component: 'AssignTeachers', action: '', }, |
22 | 22 | ||
23 | ] | 23 | ] |
24 | }, | 24 | }, |
25 | { | 25 | { |
26 | title: 'Section', | 26 | title: 'Section', |
27 | // group: 'apps', | 27 | // group: 'apps', |
28 | name: 'Section', | 28 | name: 'Section', |
29 | icon: '/static/icon/section.png', | 29 | icon: '/static/icon/section.png', |
30 | }, | 30 | }, |
31 | // { | 31 | // { |
32 | // title: 'Subjects', | 32 | // title: 'Subjects', |
33 | // name: 'Subject', | 33 | // name: 'Subject', |
34 | // icon: '/static/icon/subject.png', | 34 | // icon: '/static/icon/subject.png', |
35 | // }, | 35 | // }, |
36 | { | 36 | { |
37 | title: 'Parents', | 37 | title: 'Parents', |
38 | // group: 'apps', | 38 | // group: 'apps', |
39 | name: 'Parents', | 39 | name: 'Parents', |
40 | icon: '/static/icon/parents.png', | 40 | icon: '/static/icon/parents.png', |
41 | }, | 41 | }, |
42 | { | 42 | { |
43 | title: 'Teachers', | 43 | title: 'Teachers', |
44 | // group: '', | 44 | // group: '', |
45 | name: 'Teachers', | 45 | name: 'Teachers', |
46 | icon: '/static/icon/teacher.png', | 46 | icon: '/static/icon/teacher.png', |
47 | }, | 47 | }, |
48 | { | 48 | { |
49 | title: 'Students', | 49 | title: 'Students', |
50 | // group: 'apps', | 50 | // group: 'apps', |
51 | name: 'Students', | 51 | name: 'Students', |
52 | icon: '/static/icon/student.png', | 52 | icon: '/static/icon/student.png', |
53 | }, | 53 | }, |
54 | { | 54 | { |
55 | title: 'User', | 55 | title: 'User', |
56 | name: 'User', | 56 | name: 'User', |
57 | icon: '/static/icon/users.png', | 57 | icon: '/static/icon/users.png', |
58 | }, | 58 | }, |
59 | { | 59 | { |
60 | title: 'Attendance', | 60 | title: 'Attendance', |
61 | group: 'Attendance', | 61 | group: 'Attendance', |
62 | component: 'Attendance', | 62 | component: 'Attendance', |
63 | icon: '/static/icon/attendence.png', | 63 | icon: '/static/icon/attendence.png', |
64 | items: [ | 64 | items: [ |
65 | { name: 'StudentAttendence', title: 'Student Attendance', component: 'Student Attendence', action: '', }, | 65 | { name: 'StudentAttendence', title: 'Student Attendance', component: 'Student Attendence', action: '', }, |
66 | { name: 'TeacherAttendence', title: 'Teacher Attendance', component: 'Teacher Attendence', action: '', }, | 66 | { name: 'TeacherAttendence', title: 'Teacher Attendance', component: 'Teacher Attendence', action: '', }, |
67 | { name: 'courseAttendance', title: 'Course Attendance', component: 'Course Attendance', action: '', }, | 67 | { name: 'courseAttendance', title: 'Course Attendance', component: 'Course Attendance', action: '', }, |
68 | // { name: 'userAttendence', title: 'User Attendance', component: 'User Attendence', action: '', }, | 68 | // { name: 'userAttendence', title: 'User Attendance', component: 'User Attendence', action: '', }, |
69 | ] | 69 | ] |
70 | }, | 70 | }, |
71 | { | 71 | { |
72 | title: 'Exam', | 72 | title: 'Exam', |
73 | group: 'Exam', | 73 | group: 'Exam', |
74 | component: 'Exam', | 74 | component: 'Exam', |
75 | icon: '/static/icon/exam.png', | 75 | icon: '/static/icon/exam.png', |
76 | items: [ | 76 | items: [ |
77 | { name: 'Exam', title: 'Exam', component: 'Exam', action: '', }, | 77 | { name: 'Exam', title: 'Exam', component: 'Exam', action: '', }, |
78 | { name: 'ExamSchedule', title: 'Exam Schedule', component: 'Exam Schedule', action: '', }, | 78 | { name: 'ExamSchedule', title: 'Exam Schedule', component: 'Exam Schedule', action: '', }, |
79 | { name: 'Grade', title: 'Grade', component: 'Grade', action: '', }, | 79 | { name: 'Grade', title: 'Grade', component: 'Grade', action: '', }, |
80 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, | 80 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, |
81 | ] | 81 | ] |
82 | }, | 82 | }, |
83 | { | 83 | { |
84 | title: 'Marks', | 84 | title: 'Marks', |
85 | group: 'Mark', | 85 | group: 'Mark', |
86 | component: 'Mark', | 86 | component: 'Mark', |
87 | icon: '/static/icon/marks.png', | 87 | icon: '/static/icon/marks.png', |
88 | items: [ | 88 | items: [ |
89 | { name: 'Mark', title: 'Mark', component: 'Mark', action: '', }, | 89 | { name: 'Mark', title: 'Mark', component: 'Mark', action: '', }, |
90 | { name: 'MarkDistribution', title: 'Mark Distribution', component: 'Mark Distribution', action: '', }, | 90 | { name: 'MarkDistribution', title: 'Mark Distribution', component: 'Mark Distribution', action: '', }, |
91 | // { name: 'Promotion', title: 'promotion', component: 'Promotion', action: '', }, | 91 | // { name: 'Promotion', title: 'promotion', component: 'Promotion', action: '', }, |
92 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, | 92 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, |
93 | ] | 93 | ] |
94 | }, | 94 | }, |
95 | { | 95 | { |
96 | title: 'Academic', | 96 | title: 'Academic', |
97 | group: 'Academic', | 97 | group: 'Academic', |
98 | component: 'Academic', | 98 | component: 'Academic', |
99 | icon: '/static/icon/school.png', | 99 | icon: '/static/icon/school.png', |
100 | items: [ | 100 | items: [ |
101 | { name: 'Subject', title: 'Subject', component: 'Subject', action: '', }, | 101 | { name: 'Subject', title: 'Subject', component: 'Subject', action: '', }, |
102 | { name: 'Syllabus', title: 'Syllabus', component: 'Syllabus', action: '', }, | 102 | { name: 'Syllabus', title: 'Syllabus', component: 'Syllabus', action: '', }, |
103 | { name: 'Assignment', title: 'Assignment', component: 'Assignment', action: '', }, | 103 | { name: 'Assignment', title: 'Assignment', component: 'Assignment', action: '', }, |
104 | { name: 'Routine', title: 'Routine', component: 'Routine', action: '', }, | 104 | { name: 'Routine', title: 'Routine', component: 'Routine', action: '', }, |
105 | ] | 105 | ] |
106 | }, | 106 | }, |
107 | { | 107 | { |
108 | title: 'Administrator', | 108 | title: 'Administrator', |
109 | group: 'Administrator', | 109 | group: 'Administrator', |
110 | component: 'Administrator', | 110 | component: 'Administrator', |
111 | icon: '/static/icon/adminstrator.png', | 111 | icon: '/static/icon/adminstrator.png', |
112 | items: [ | 112 | items: [ |
113 | { name: 'AcademicYear', title: 'Academic Year', component: 'Academic Year', action: '', }, | 113 | { name: 'AcademicYear', title: 'Academic Year', component: 'Academic Year', action: '', }, |
114 | // { name: 'systemAdmin', title: 'System Admin', component: 'systemAdmin', action: '', }, | 114 | // { name: 'systemAdmin', title: 'System Admin', component: 'systemAdmin', action: '', }, |
115 | { name: 'resetPassword', title: 'Change Password', component: 'Change Password', action: '', }, | 115 | { name: 'resetPassword', title: 'Change Password', component: 'Change Password', action: '', }, |
116 | { name: 'Role', title: 'Role', component: 'Role', action: '', }, | 116 | { name: 'Role', title: 'Role', component: 'Role', action: '', }, |
117 | { name: 'BulkImport', title: 'Bulk Import', component: 'Bulk Import', action: '', }, | 117 | { name: 'BulkImport', title: 'Bulk Import', component: 'Bulk Import', action: '', }, |
118 | 118 | ||
119 | ] | 119 | ] |
120 | }, | 120 | }, |
121 | { | 121 | { |
122 | title: 'Payroll', | 122 | title: 'Payroll', |
123 | group: 'Payroll', | 123 | group: 'Payroll', |
124 | component: 'Payroll', | 124 | component: 'Payroll', |
125 | icon: '/static/icon/dollar.png', | 125 | icon: '/static/icon/dollar.png', |
126 | items: [ | 126 | items: [ |
127 | { name: 'salaryTemplate', title: 'Salary Template', component: 'Salary Template', action: '', }, | 127 | { name: 'salaryTemplate', title: 'Salary Template', component: 'Salary Template', action: '', }, |
128 | { name: 'hourlyTemplate', title: 'Hourly Template', component: 'Hourly Template', action: '', }, | 128 | { name: 'hourlyTemplate', title: 'Hourly Template', component: 'Hourly Template', action: '', }, |
129 | { name: 'manageSalary', title: 'Manage Salary', component: 'Manage Salary', action: '', }, | 129 | { name: 'manageSalary', title: 'Manage Salary', component: 'Manage Salary', action: '', }, |
130 | // { name: 'makePayment', title: 'Make Payment', component: 'Make Payment', action: '', }, | 130 | // { name: 'makePayment', title: 'Make Payment', component: 'Make Payment', action: '', }, |
131 | ] | 131 | ] |
132 | }, | 132 | }, |
133 | { | 133 | { |
134 | title: 'Notice Board', | 134 | title: 'Notice Board', |
135 | name: 'Notice Board', | 135 | name: 'Notice Board', |
136 | icon: '/static/icon/notice board.png', | 136 | icon: '/static/icon/notice board.png', |
137 | }, | 137 | }, |
138 | { | 138 | { |
139 | title: 'News', | 139 | title: 'News', |
140 | name: 'News', | 140 | name: 'News', |
141 | icon: '/static/icon/news.png', | 141 | icon: '/static/icon/news.png', |
142 | }, | 142 | }, |
143 | // { | 143 | // { |
144 | // title: 'Reminder', | 144 | // title: 'Reminder', |
145 | // name: 'reminder', | 145 | // name: 'reminder', |
146 | // icon: 'alarm_add', | 146 | // icon: 'alarm_add', |
147 | // }, | 147 | // }, |
148 | { | 148 | { |
149 | title: 'Time Table', | 149 | title: 'Time Table', |
150 | name: 'Time Table', | 150 | name: 'Time Table', |
151 | icon: '/static/icon/time table.png', | 151 | icon: '/static/icon/time table.png', |
152 | }, | 152 | }, |
153 | { | 153 | { |
154 | title: 'Library', | 154 | title: 'Library', |
155 | group: 'Library', | 155 | group: 'Library', |
156 | component: 'Library', | 156 | component: 'Library', |
157 | icon: '/static/icon/library.png', | 157 | icon: '/static/icon/library.png', |
158 | items: [ | 158 | items: [ |
159 | { name: 'LibraryMember', title: ' Library Member', component: 'Library Member', action: '', }, | 159 | { name: 'LibraryMember', title: ' Library Member', component: 'Library Member', action: '', }, |
160 | { name: 'Books', title: 'Books', component: 'Books', action: '', }, | 160 | { name: 'Books', title: 'Books', component: 'Books', action: '', }, |
161 | { name: 'Issue', title: ' Issue', component: 'Issue', action: '', }, | 161 | { name: 'Issue', title: ' Issue', component: 'Issue', action: '', }, |
162 | { name: 'E-Books', title: 'E-Books', component: 'E-Books', action: '', } | 162 | { name: 'E-Books', title: 'E-Books', component: 'E-Books', action: '', } |
163 | 163 | ||
164 | ] | 164 | ] |
165 | }, | 165 | }, |
166 | { | 166 | { |
167 | title: 'Report', | 167 | title: 'Report', |
168 | group: 'Report', | 168 | group: 'Report', |
169 | component: 'Report', | 169 | component: 'Report', |
170 | icon: '/static/icon/reports.png', | 170 | icon: '/static/icon/reports.png', |
171 | items: [ | 171 | items: [ |
172 | { name: 'studentReport', title: 'Student Report', component: 'Student Report', action: '', }, | 172 | { name: 'studentReport', title: 'Student Report', component: 'Student Report', action: '', }, |
173 | { name: 'ProgressCardReport', title: 'Progress Card Report', component: 'Progress Card Report', action: '', }, | 173 | { name: 'ProgressCardReport', title: 'Progress Card Report', component: 'Progress Card Report', action: '', }, |
174 | { name: 'idCard', title: 'Id Card Report', component: 'Id Card Report', action: '', }, | 174 | { name: 'idCard', title: 'Id Card Report', component: 'Id Card Report', action: '', }, |
175 | { name: 'admitCard', title: 'Admit Card Report', component: 'Admit Card Report', action: '', } | 175 | { name: 'admitCard', title: 'Admit Card Report', component: 'Admit Card Report', action: '', } |
176 | ] | 176 | ] |
177 | }, | 177 | }, |
178 | { | 178 | { |
179 | title: 'Notification', | 179 | title: 'Notification', |
180 | name: 'Notification', | 180 | name: 'Notification', |
181 | icon: '/static/icon/notification.png', | 181 | icon: '/static/icon/notification.png', |
182 | }, | 182 | }, |
183 | { | 183 | { |
184 | title: 'Social Media', | 184 | title: 'Social Media', |
185 | name: 'Social Media', | 185 | name: 'Social Media', |
186 | icon: '/static/icon/events.png', | 186 | icon: '/static/icon/events.png', |
187 | }, | 187 | }, |
188 | { | 188 | { |
189 | title: 'Gallery', | 189 | title: 'Gallery', |
190 | name: 'Gallery', | 190 | name: 'Gallery', |
191 | icon: '/static/icon/gallery.png', | 191 | icon: '/static/icon/gallery.png', |
192 | }, | 192 | }, |
193 | { | 193 | { |
194 | title: 'Event', | 194 | title: 'Event', |
195 | name: 'Event', | 195 | name: 'Event', |
196 | icon: '/static/icon/events.png', | 196 | icon: '/static/icon/events.png', |
197 | }, | 197 | }, |
198 | { | 198 | { |
199 | title: 'Account', | 199 | title: 'Account', |
200 | group: 'Account', | 200 | group: 'Account', |
201 | component: 'Account', | 201 | component: 'Account', |
202 | icon: '/static/icon/accounts.png', | 202 | icon: '/static/icon/accounts.png', |
203 | items: [ | 203 | items: [ |
204 | { name: 'feeTypes', title: 'Fee Types', component: 'Fee Types', action: '', }, | 204 | { name: 'feeTypes', title: 'Fee Types', component: 'Fee Types', action: '', }, |
205 | { name: 'Invoice', title: 'Invoice', component: 'Invoice', action: '', }, | 205 | { name: 'Invoice', title: 'Invoice', component: 'Invoice', action: '', }, |
206 | { name: 'PaymentHistory', title: 'Payment History', component: 'Payment History', action: '', }, | 206 | { name: 'PaymentHistory', title: 'Payment History', component: 'Payment History', action: '', }, |
207 | { name: 'Expense', title: 'Expense', component: 'Expense', action: '', }, | 207 | { name: 'Expense', title: 'Expense', component: 'Expense', action: '', }, |
208 | { name: 'Income', title: 'Income', component: 'Income', action: '', }, | 208 | { name: 'Income', title: 'Income', component: 'Income', action: '', }, |
209 | { name: 'GlobalPayment', title: 'Global Payment', component: 'Global Payment', action: '', } | 209 | { name: 'GlobalPayment', title: 'Global Payment', component: 'Global Payment', action: '', } |
210 | ] | 210 | ] |
211 | }, | 211 | }, |
212 | { | 212 | { |
213 | title: 'Holiday', | 213 | title: 'Holiday', |
214 | name: 'Holiday', | 214 | name: 'Holiday', |
215 | icon: '/static/icon/holiday.png', | 215 | icon: '/static/icon/holiday.png', |
216 | }, | 216 | }, |
217 | { | 217 | { |
218 | title: 'General Setting', | 218 | title: 'General Setting', |
219 | name: 'General Setting', | 219 | name: 'General Setting', |
220 | icon: '/static/icon/settings.png', | 220 | icon: '/static/icon/settings.png', |
221 | } | 221 | } |
222 | ]; | 222 | ]; |
223 | 223 | ||
224 | const libraryMenu = [{ | 224 | const libraryMenu = [{ |
225 | title: 'Dashboard', | 225 | title: 'Dashboard', |
226 | name: 'Dashboard', | 226 | name: 'Dashboard', |
227 | icon: '/static/icon/dashboard.png', | 227 | icon: '/static/icon/dashboard.png', |
228 | }, | 228 | }, |
229 | { | 229 | { |
230 | title: 'Library', | 230 | title: 'Library', |
231 | group: 'Library', | 231 | group: 'Library', |
232 | component: 'Library', | 232 | component: 'Library', |
233 | icon: '/static/icon/library.png', | 233 | icon: '/static/icon/library.png', |
234 | items: [ | 234 | items: [ |
235 | { name: 'LibraryMember', title: ' Library Member', component: 'Library Member', action: '', }, | 235 | { name: 'LibraryMember', title: ' Library Member', component: 'Library Member', action: '', }, |
236 | { name: 'Books', title: 'Books', component: 'Books', action: '', }, | 236 | { name: 'Books', title: 'Books', component: 'Books', action: '', }, |
237 | { name: 'Issue', title: ' Issue', component: 'Issue', action: '', }, | 237 | { name: 'Issue', title: ' Issue', component: 'Issue', action: '', }, |
238 | { name: 'E-Books', title: 'E-Books', component: 'E-Books', action: '', } | 238 | { name: 'E-Books', title: 'E-Books', component: 'E-Books', action: '', } |
239 | 239 | ||
240 | ] | 240 | ] |
241 | }, | 241 | }, |
242 | ]; | 242 | ]; |
243 | 243 | ||
244 | const accountMenu = [{ | 244 | const accountMenu = [{ |
245 | title: 'Dashboard', | 245 | title: 'Dashboard', |
246 | name: 'Dashboard', | 246 | name: 'Dashboard', |
247 | icon: '/static/icon/dashboard.png', | 247 | icon: '/static/icon/dashboard.png', |
248 | }, | 248 | }, |
249 | 249 | ||
250 | { | 250 | { |
251 | title: 'Account', | 251 | title: 'Account', |
252 | group: 'Account', | 252 | group: 'Account', |
253 | component: 'Account', | 253 | component: 'Account', |
254 | icon: '/static/icon/accounts.png', | 254 | icon: '/static/icon/accounts.png', |
255 | items: [ | 255 | items: [ |
256 | { name: 'feeTypes', title: 'Fee Types', component: 'Fee Types', action: '', }, | 256 | { name: 'feeTypes', title: 'Fee Types', component: 'Fee Types', action: '', }, |
257 | { name: 'Invoice', title: 'Invoice', component: 'Invoice', action: '', }, | 257 | { name: 'Invoice', title: 'Invoice', component: 'Invoice', action: '', }, |
258 | { name: 'PaymentHistory', title: 'Payment History', component: 'Payment History', action: '', }, | 258 | { name: 'PaymentHistory', title: 'Payment History', component: 'Payment History', action: '', }, |
259 | { name: 'Expense', title: 'Expense', component: 'Expense', action: '', }, | 259 | { name: 'Expense', title: 'Expense', component: 'Expense', action: '', }, |
260 | { name: 'Income', title: 'Income', component: 'Income', action: '', }, | 260 | { name: 'Income', title: 'Income', component: 'Income', action: '', }, |
261 | { name: 'GlobalPayment', title: 'Global Payment', component: 'Global Payment', action: '', } | 261 | { name: 'GlobalPayment', title: 'Global Payment', component: 'Global Payment', action: '', } |
262 | ] | 262 | ] |
263 | }, | 263 | }, |
264 | ]; | 264 | ]; |
265 | 265 | ||
266 | const schoolMenu = [ | 266 | const schoolMenu = [ |
267 | // { header: 'Apps' }, | 267 | // { header: 'Apps' }, |
268 | { | 268 | { |
269 | title: 'Dashboard', | 269 | title: 'Dashboard', |
270 | // group: 'apps', | 270 | // group: 'apps', |
271 | name: 'View School Dashboard', | 271 | name: 'View School Dashboard', |
272 | icon: '/static/icon/dashboard.png', | 272 | icon: '/static/icon/dashboard.png', |
273 | }, | 273 | }, |
274 | { | 274 | { |
275 | title: 'School', | 275 | title: 'School', |
276 | // group: 'apps', | 276 | // group: 'apps', |
277 | name: 'School', | 277 | name: 'School', |
278 | icon: '/static/icon/school.png', | 278 | icon: '/static/icon/school.png', |
279 | }, | 279 | }, |
280 | { | 280 | { |
281 | title: 'App Version', | 281 | title: 'App Version', |
282 | name: 'App Version', | 282 | name: 'App Version', |
283 | icon: '/static/icon/phone.png', | 283 | icon: '/static/icon/phone.png', |
284 | } | 284 | } |
285 | ]; | 285 | ]; |
286 | 286 | ||
287 | const teacherMenu = [{ | 287 | const teacherMenu = [{ |
288 | title: 'Dashboard', | 288 | title: 'Dashboard', |
289 | name: 'Dashboard', | 289 | name: 'Dashboard', |
290 | icon: '/static/icon/dashboard.png', | 290 | icon: '/static/icon/dashboard.png', |
291 | }, | 291 | }, |
292 | { | 292 | { |
293 | title: 'Parents', | 293 | title: 'Parents', |
294 | // group: 'apps', | 294 | // group: 'apps', |
295 | name: 'Parents', | 295 | name: 'Parents', |
296 | icon: '/static/icon/parents.png', | 296 | icon: '/static/icon/parents.png', |
297 | }, | 297 | }, |
298 | { | 298 | { |
299 | title: 'Teachers', | 299 | title: 'Teachers', |
300 | // group: '', | 300 | // group: '', |
301 | name: 'Teachers', | 301 | name: 'Teachers', |
302 | icon: '/static/icon/teacher.png', | 302 | icon: '/static/icon/teacher.png', |
303 | }, | 303 | }, |
304 | { | 304 | { |
305 | title: 'Students', | 305 | title: 'Students', |
306 | // group: 'apps', | 306 | // group: 'apps', |
307 | name: 'Students', | 307 | name: 'Students', |
308 | icon: '/static/icon/student.png', | 308 | icon: '/static/icon/student.png', |
309 | }, | 309 | }, |
310 | { | 310 | { |
311 | title: 'Academic', | 311 | title: 'Academic', |
312 | group: 'Academic', | 312 | group: 'Academic', |
313 | component: 'Academic', | 313 | component: 'Academic', |
314 | icon: '/static/icon/school.png', | 314 | icon: '/static/icon/school.png', |
315 | items: [ | 315 | items: [ |
316 | { name: 'Subject', title: 'Subject', component: 'Subject', action: '', }, | 316 | { name: 'Subject', title: 'Subject', component: 'Subject', action: '', }, |
317 | { name: 'Syllabus', title: 'Syllabus', component: 'Syllabus', action: '', }, | 317 | { name: 'Syllabus', title: 'Syllabus', component: 'Syllabus', action: '', }, |
318 | { name: 'Assignment', title: 'Assignment', component: 'Assignment', action: '', }, | 318 | { name: 'Assignment', title: 'Assignment', component: 'Assignment', action: '', }, |
319 | { name: 'Routine', title: 'Routine', component: 'Routine', action: '', }, | 319 | { name: 'Routine', title: 'Routine', component: 'Routine', action: '', }, |
320 | ] | 320 | ] |
321 | }, | 321 | }, |
322 | { | 322 | { |
323 | title: 'Course', | 323 | title: 'Course', |
324 | group: 'Course', | 324 | group: 'Course', |
325 | component: 'Course', | 325 | component: 'Course', |
326 | icon: '/static/icon/school.png', | 326 | icon: '/static/icon/school.png', |
327 | items: [ | 327 | items: [ |
328 | { name: 'Course', title: 'Course', component: 'Course', action: '', }, | 328 | { name: 'Course', title: 'Course', component: 'Course', action: '', }, |
329 | { name: 'Enroll Students', title: 'Enroll Students', component: 'Enroll Students', action: '', }, | 329 | { name: 'Enroll Students', title: 'Enroll Students', component: 'Enroll Students', action: '', }, |
330 | { name: 'Course Detail', title: 'Course Detail', component: 'Course Detail', action: '', }, | 330 | { name: 'Course Detail', title: 'Course Detail', component: 'Course Detail', action: '', }, |
331 | { name: 'Course Discussion', title: 'Course Discussion', component: 'Course Discussion', action: '', }, | 331 | { name: 'Course Discussion', title: 'Course Discussion', component: 'Course Discussion', action: '', }, |
332 | ] | 332 | ] |
333 | }, | 333 | }, |
334 | { | 334 | { |
335 | title: 'Annoucement', | 335 | title: 'Annoucement', |
336 | // group: 'apps', | 336 | // group: 'apps', |
337 | name: 'Annoucement', | 337 | name: 'Annoucement', |
338 | icon: '/static/icon/student.png', | 338 | icon: '/static/icon/student.png', |
339 | }, | 339 | }, |
340 | { | 340 | { |
341 | title: 'Meeting Event', | 341 | title: 'Meeting Event', |
342 | // group: 'apps', | 342 | // group: 'apps', |
343 | name: 'Meeting Event', | 343 | name: 'Meeting Event', |
344 | icon: '/static/icon/student.png', | 344 | icon: '/static/icon/student.png', |
345 | }, | 345 | }, |
346 | { | 346 | { |
347 | title: 'Attendance', | 347 | title: 'Attendance', |
348 | group: 'Attendance', | 348 | group: 'Attendance', |
349 | component: 'Attendance', | 349 | component: 'Attendance', |
350 | icon: '/static/icon/attendence.png', | 350 | icon: '/static/icon/attendence.png', |
351 | items: [ | 351 | items: [ |
352 | { name: 'StudentAttendence', title: 'Student Attendance', component: 'Student Attendence', action: '', }, | 352 | { name: 'StudentAttendence', title: 'Student Attendance', component: 'Student Attendence', action: '', }, |
353 | { name: 'TeacherAttendence', title: 'Teacher Attendance', component: 'Teacher Attendence', action: '', }, | 353 | { name: 'TeacherAttendence', title: 'Teacher Attendance', component: 'Teacher Attendence', action: '', }, |
354 | { name: 'courseAttendance', title: 'Course Attendance', component: 'Course Attendance', action: '', }, | 354 | { name: 'courseAttendance', title: 'Course Attendance', component: 'Course Attendance', action: '', }, |
355 | // { name: 'userAttendence', title: 'User Attendance', component: 'User Attendence', action: '', }, | 355 | // { name: 'userAttendence', title: 'User Attendance', component: 'User Attendence', action: '', }, |
356 | ] | 356 | ] |
357 | }, | 357 | }, |
358 | { | 358 | { |
359 | title: 'Exam', | 359 | title: 'Exam', |
360 | group: 'Exam', | 360 | group: 'Exam', |
361 | component: 'Exam', | 361 | component: 'Exam', |
362 | icon: '/static/icon/exam.png', | 362 | icon: '/static/icon/exam.png', |
363 | items: [ | 363 | items: [ |
364 | { name: 'ExamSchedule', title: 'Exam Schedule', component: 'Exam Schedule', action: '', }, | 364 | { name: 'ExamSchedule', title: 'Exam Schedule', component: 'Exam Schedule', action: '', }, |
365 | { name: 'ExamAttendence', title: 'Exam Attendence', component: 'Exam Attendence', action: '', } | 365 | { name: 'ExamAttendence', title: 'Exam Attendence', component: 'Exam Attendence', action: '', } |
366 | ] | 366 | ] |
367 | }, | 367 | }, |
368 | { | 368 | { |
369 | title: 'Marks', | 369 | title: 'Marks', |
370 | group: 'Mark', | 370 | group: 'Mark', |
371 | component: 'Mark', | 371 | component: 'Mark', |
372 | icon: '/static/icon/marks.png', | 372 | icon: '/static/icon/marks.png', |
373 | items: [ | 373 | items: [ |
374 | { name: 'Mark', title: 'Mark', component: 'Mark', action: '', } | 374 | { name: 'Mark', title: 'Mark', component: 'Mark', action: '', } |
375 | ] | 375 | ] |
376 | }, | 376 | }, |
377 | { | 377 | { |
378 | title: 'Report', | 378 | title: 'Report', |
379 | group: 'Report', | 379 | group: 'Report', |
380 | component: 'Report', | 380 | component: 'Report', |
381 | icon: '/static/icon/reports.png', | 381 | icon: '/static/icon/reports.png', |
382 | items: [ | 382 | items: [ |
383 | { name: 'studentReport', title: 'Student Report', component: 'Student Report', action: '', }, | 383 | { name: 'studentReport', title: 'Student Report', component: 'Student Report', action: '', }, |
384 | { name: 'ProgressCardReport', title: 'Progress Card Report', component: 'Progress Card Report', action: '', }, | 384 | { name: 'ProgressCardReport', title: 'Progress Card Report', component: 'Progress Card Report', action: '', }, |
385 | { name: 'idCard', title: 'Id Card Report', component: 'Id Card Report', action: '', }, | 385 | { name: 'idCard', title: 'Id Card Report', component: 'Id Card Report', action: '', }, |
386 | { name: 'admitCard', title: 'Admit Card Report', component: 'Admit Card Report', action: '', } | 386 | { name: 'admitCard', title: 'Admit Card Report', component: 'Admit Card Report', action: '', } |
387 | ] | 387 | ] |
388 | }, | 388 | }, |
389 | { | 389 | { |
390 | title: 'Library', | 390 | title: 'Library', |
391 | group: 'Library', | 391 | group: 'Library', |
392 | component: 'Library', | 392 | component: 'Library', |
393 | icon: '/static/icon/library.png', | 393 | icon: '/static/icon/library.png', |
394 | items: [ | 394 | items: [ |
395 | { name: 'Books', title: 'Books', component: 'Books', action: '', }, | 395 | { name: 'Books', title: 'Books', component: 'Books', action: '', }, |
396 | { name: 'E-Books', title: 'E-Books', component: 'E-Books', action: '', } | 396 | { name: 'E-Books', title: 'E-Books', component: 'E-Books', action: '', } |
397 | 397 | ||
398 | ] | 398 | ] |
399 | }, | 399 | }, |
400 | // { | 400 | // { |
401 | // title: 'Meet', | 401 | // title: 'Meet', |
402 | // name: 'Meet', | 402 | // name: 'Meet', |
403 | // icon: '/static/icon/meet_icon_navigation.png', | 403 | // icon: '/static/icon/meet_icon_navigation.png', |
404 | // } | 404 | // } |
405 | ]; | 405 | ]; |
406 | 406 | ||
407 | const parentMenu = [{ | 407 | const parentMenu = [{ |
408 | title: 'Dashboard', | 408 | title: 'Dashboard', |
409 | name: 'Dashboard', | 409 | name: 'Dashboard', |
410 | icon: '/static/icon/dashboard.png', | 410 | icon: '/static/icon/dashboard.png', |
411 | }, | 411 | }, |
412 | { | 412 | { |
413 | title: "Change Student", | 413 | title: "Change Student", |
414 | name: 'Change Students', | 414 | name: 'Change Students', |
415 | Vicon: "face", | 415 | Vicon: "face", |
416 | click: e => { | 416 | click: e => { |
417 | // console.log(e); | 417 | // console.log(e); |
418 | } | 418 | } |
419 | }]; | 419 | }, |
420 | { | ||
421 | title: 'Attendance', | ||
422 | group: 'Attendance', | ||
423 | component: 'Attendance', | ||
424 | icon: '/static/icon/attendence.png', | ||
425 | items: [ | ||
426 | { name: 'courseAttendance', title: 'View Course Attendance', component: 'View Course Attendance', action: '', }, | ||
427 | ] | ||
428 | }, | ||
429 | // { | ||
430 | // path: '/CourseAttendance/:id', | ||
431 | // meta: {}, | ||
432 | // name: 'View Course Attendance', | ||
433 | // props: (route) => ({ | ||
434 | // type: route.query.type | ||
435 | // }), | ||
436 | // component: () => | ||
437 | // import( | ||
438 | // /* webpackChunkName: "routes" */ | ||
439 | // /* webpackMode: "lazy-once" */ | ||
440 | // `@/pages/Attendence/viewCourseAttendance.vue` | ||
441 | // ) | ||
442 | // }, | ||
443 | ]; | ||
420 | // reorder menu | 444 | // reorder menu |
421 | // Menu.forEach((item) => { | 445 | // Menu.forEach((item) => { |
422 | // if (item.items) { | 446 | // if (item.items) { |
423 | // item.items.sort((x, y) => { | 447 | // item.items.sort((x, y) => { |
424 | // let textA = x.title.toUpperCase(); | 448 | // let textA = x.title.toUpperCase(); |
425 | // let textB = y.title.toUpperCase(); | 449 | // let textB = y.title.toUpperCase(); |
426 | // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; | 450 | // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; |
427 | // }); | 451 | // }); |
428 | // } | 452 | // } |
429 | // }); | 453 | // }); |
430 | 454 | ||
431 | export default { adminMenu, schoolMenu, teacherMenu, libraryMenu, accountMenu, parentMenu }; | 455 | export default { adminMenu, schoolMenu, teacherMenu, libraryMenu, accountMenu, parentMenu }; |
src/pages/Attendence/viewCourseAttendance.vue
1 | <template> | 1 | <template> |
2 | <v-container fluid grid-list-md class="body-color"> | 2 | <v-container fluid grid-list-md class="body-color"> |
3 | <v-dialog v-model="viewCourseAttendance" max-width="1000" scrollable persistent> | 3 | <v-dialog v-model="viewCourseAttendance" max-width="1000" scrollable persistent> |
4 | <v-card flat class="pa-3"> | 4 | <v-card flat class="pa-3"> |
5 | <v-layout> | 5 | <v-layout> |
6 | <v-flex xs12> | 6 | <v-flex xs12> |
7 | <label class="title text-xs-center">Course Attendance</label> | 7 | <label class="title text-xs-center">Course Attendance</label> |
8 | <v-icon size="24" class="right" @click="viewCourseAttendance = false">cancel</v-icon> | 8 | <v-icon size="24" class="right" @click="viewCourseAttendance = false">cancel</v-icon> |
9 | </v-flex> | 9 | </v-flex> |
10 | </v-layout> | 10 | </v-layout> |
11 | <v-card-text> | 11 | <v-card-text> |
12 | <v-data-table :headers="headers" :items="courseAttendanceList"> | 12 | <v-data-table :headers="headers" :items="courseAttendanceList"> |
13 | <template slot="items" slot-scope="props"> | 13 | <template slot="items" slot-scope="props"> |
14 | <tr class="tr"> | 14 | <tr class="tr"> |
15 | <td class="td td-row">{{ props.index + 1}}</td> | ||
15 | <td class="text-xs-center td td-row">{{ props.item.courseId.courseName}}</td> | 16 | <td class="text-xs-center td td-row">{{ props.item.courseId.courseName}}</td> |
16 | <td class="text-xs-center td td-row">{{ props.item.startTime}}</td> | 17 | <td class="text-xs-center td td-row">{{ props.item.startTime}}</td> |
17 | <td class="text-xs-center td td-row">{{ props.item.endTime }}</td> | 18 | <td class="text-xs-center td td-row">{{ props.item.endTime }}</td> |
18 | </tr> | 19 | </tr> |
19 | </template> | 20 | </template> |
20 | </v-data-table> | 21 | </v-data-table> |
21 | </v-card-text> | 22 | </v-card-text> |
22 | </v-card> | 23 | </v-card> |
23 | </v-dialog> | 24 | </v-dialog> |
24 | <div> | 25 | <div> |
25 | <v-layout wrap> | 26 | <v-layout wrap> |
26 | <v-flex xs12 sm12 md4> | 27 | <v-flex xs12 sm12 md4> |
27 | <v-card flat> | 28 | <v-card flat> |
28 | <h3 class="py-2 text-xs-center card-style white--text">Profile</h3> | 29 | <h3 class="py-2 text-xs-center card-style white--text">Profile</h3> |
29 | <v-card-text> | 30 | <v-card-text> |
30 | <v-container> | 31 | <v-container> |
31 | <v-layout wrap> | 32 | <v-layout wrap> |
32 | <v-flex xs12> | 33 | <v-flex xs12> |
33 | <v-layout> | 34 | <v-layout> |
34 | <v-flex | 35 | <v-flex |
35 | xs12 | 36 | xs12 |
36 | class="text-xs-center text-sm-center text-md-center text-lg-center" | 37 | class="text-xs-center text-sm-center text-md-center text-lg-center" |
37 | > | 38 | > |
38 | <v-avatar size="80px"> | 39 | <v-avatar size="80px"> |
39 | <img src="/static/icon/user.png" v-if="!studentData.profilePicUrl" /> | 40 | <img src="/static/icon/user.png" v-if="!studentData.profilePicUrl" /> |
40 | <img | 41 | <img |
41 | :src="studentData.profilePicUrl" | 42 | :src="studentData.profilePicUrl" |
42 | v-else-if="studentData.profilePicUrl" | 43 | v-else-if="studentData.profilePicUrl" |
43 | /> | 44 | /> |
44 | </v-avatar> | 45 | </v-avatar> |
45 | </v-flex> | 46 | </v-flex> |
46 | </v-layout> | 47 | </v-layout> |
47 | <v-layout> | 48 | <v-layout> |
48 | <v-flex xs12 sm12> | 49 | <v-flex xs12 sm12> |
49 | <h3 class="text-xs-center"> | 50 | <h3 class="text-xs-center"> |
50 | <b>{{ studentData.name }}</b> | 51 | <b>{{ studentData.name }}</b> |
51 | </h3> | 52 | </h3> |
52 | <p class="text-xs-center grey--text">Student</p> | 53 | <p class="text-xs-center grey--text">Student</p> |
53 | </v-flex> | 54 | </v-flex> |
54 | </v-layout> | 55 | </v-layout> |
55 | <v-layout style="border: 1px solid lightgrey;"> | 56 | <v-layout style="border: 1px solid lightgrey;"> |
56 | <v-flex xs6 sm6 class="pa-0"> | 57 | <v-flex xs6 sm6 class="pa-0"> |
57 | <h4 class="right"> | 58 | <h4 class="right"> |
58 | <b>Roll No :</b> | 59 | <b>Roll No :</b> |
59 | </h4> | 60 | </h4> |
60 | </v-flex> | 61 | </v-flex> |
61 | <v-flex sm6 xs6 class="pa-0"> | 62 | <v-flex sm6 xs6 class="pa-0"> |
62 | <h4>{{ studentData.rollNo }}</h4> | 63 | <h4>{{ studentData.rollNo }}</h4> |
63 | </v-flex> | 64 | </v-flex> |
64 | </v-layout> | 65 | </v-layout> |
65 | <v-layout style="border: 1px solid lightgrey;"> | 66 | <v-layout style="border: 1px solid lightgrey;"> |
66 | <v-flex xs6 sm6 class="pa-0"> | 67 | <v-flex xs6 sm6 class="pa-0"> |
67 | <h4 class="right"> | 68 | <h4 class="right"> |
68 | <b>Class :</b> | 69 | <b>Class :</b> |
69 | </h4> | 70 | </h4> |
70 | </v-flex> | 71 | </v-flex> |
71 | <v-flex sm6 xs6 class="right pa-0"> | 72 | <v-flex sm6 xs6 class="right pa-0"> |
72 | <h4>{{ studentData.classId.classNum }}</h4> | 73 | <h4>{{ studentData.classId.classNum }}</h4> |
73 | </v-flex> | 74 | </v-flex> |
74 | </v-layout> | 75 | </v-layout> |
75 | <v-layout style="border: 1px solid lightgrey;"> | 76 | <v-layout style="border: 1px solid lightgrey;"> |
76 | <v-flex xs6 sm6 class="right pa-0"> | 77 | <v-flex xs6 sm6 class="right pa-0"> |
77 | <h4 class="right"> | 78 | <h4 class="right"> |
78 | <b>Section :</b> | 79 | <b>Section :</b> |
79 | </h4> | 80 | </h4> |
80 | </v-flex> | 81 | </v-flex> |
81 | <v-flex sm6 xs6 class="right pa-0"> | 82 | <v-flex sm6 xs6 class="right pa-0"> |
82 | <h4>{{ studentData.sectionId.name}}</h4> | 83 | <h4>{{ studentData.sectionId.name}}</h4> |
83 | </v-flex> | 84 | </v-flex> |
84 | </v-layout> | 85 | </v-layout> |
85 | </v-flex> | 86 | </v-flex> |
86 | </v-layout> | 87 | </v-layout> |
87 | </v-container> | 88 | </v-container> |
88 | </v-card-text> | 89 | </v-card-text> |
89 | </v-card> | 90 | </v-card> |
90 | </v-flex> | 91 | </v-flex> |
91 | <v-flex xs12 sm12 md8> | 92 | <v-flex xs12 sm12 md8> |
92 | <v-card flat> | 93 | <v-card flat> |
93 | <h3 class="py-2 text-xs-center card-style white--text">Attendence</h3> | 94 | <h3 class="py-2 text-xs-center card-style white--text">Attendence</h3> |
94 | <YearCalendar | 95 | <YearCalendar |
95 | v-model="year" | 96 | v-model="year" |
96 | :activeDates="activeDates" | 97 | :activeDates="activeDates" |
97 | prefixClass="your_customized_wrapper_class" | 98 | prefixClass="your_customized_wrapper_class" |
98 | :activeClass="activeClass" | 99 | :activeClass="activeClass" |
99 | @toggleDate="toggleDate" | 100 | @toggleDate="toggleDate" |
100 | ></YearCalendar> | 101 | ></YearCalendar> |
101 | </v-card> | 102 | </v-card> |
102 | </v-flex> | 103 | </v-flex> |
103 | </v-layout> | 104 | </v-layout> |
104 | </div> | 105 | </div> |
105 | <img :src="output" v-show="false" /> | 106 | <img :src="output" v-show="false" /> |
106 | <div class="loader" v-if="showLoader"> | 107 | <div class="loader" v-if="showLoader"> |
107 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 108 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
108 | </div> | 109 | </div> |
109 | </v-container> | 110 | </v-container> |
110 | </template> | 111 | </template> |
111 | 112 | ||
112 | <script lang="js"> | 113 | <script lang="js"> |
113 | import moment from "moment"; | 114 | import moment from "moment"; |
114 | import http from "@/Services/http.js"; | 115 | import http from "@/Services/http.js"; |
115 | import YearCalendar from "vue-material-year-calendar"; | 116 | import YearCalendar from "vue-material-year-calendar"; |
116 | import jsPDF from 'jspdf'; | 117 | import jsPDF from 'jspdf'; |
117 | // eslint-disable-next-line | 118 | // eslint-disable-next-line |
118 | import autoTable from 'jspdf-autotable'; | 119 | import autoTable from 'jspdf-autotable'; |
119 | 120 | ||
120 | export default { | 121 | export default { |
121 | components: { YearCalendar }, | 122 | components: { YearCalendar }, |
122 | data() { | 123 | data() { |
123 | return { | 124 | return { |
124 | output:null, | 125 | output:null, |
125 | showLoader: false, | 126 | showLoader: false, |
126 | token: "", | 127 | token: "", |
127 | year: new Date().getFullYear(), | 128 | year: new Date().getFullYear(), |
128 | activeDates: [], | 129 | activeDates: [], |
129 | activeClass: "", | 130 | activeClass: "", |
130 | studentData: { | 131 | studentData: { |
131 | classId: { | 132 | classId: { |
132 | classNum: "" | 133 | classNum: "" |
133 | }, | 134 | }, |
134 | sectionId: { | 135 | sectionId: { |
135 | name: "" | 136 | name: "" |
136 | }, | 137 | }, |
137 | }, | 138 | }, |
138 | courseAttendanceData:{}, | 139 | courseAttendanceData:{}, |
139 | courseAttendanceList: [], | 140 | courseAttendanceList: [], |
140 | viewCourseAttendance: false, | 141 | viewCourseAttendance: false, |
141 | headers: [ | 142 | headers: [ |
143 | { | ||
144 | text: "No", | ||
145 | align: "", | ||
146 | sortable: false, | ||
147 | value: "index", | ||
148 | }, | ||
142 | { text: "Course Name", value: "courseName", sortable: false, align: "center" }, | 149 | { text: "Course Name", value: "courseName", sortable: false, align: "center" }, |
143 | { | 150 | { |
144 | text: "Start Time", | 151 | text: "Start Time", |
145 | value: "startTime", | 152 | value: "startTime", |
146 | sortable: false, | 153 | sortable: false, |
147 | align: "center", | 154 | align: "center", |
148 | }, | 155 | }, |
149 | { text: "End Time", value: "endTime", sortable: false, align: "center" }, | 156 | { text: "End Time", value: "endTime", sortable: false, align: "center" }, |
150 | ], | 157 | ], |
151 | selectedDates: [], | 158 | selectedDates: [], |
152 | }; | 159 | }; |
153 | }, | 160 | }, |
154 | mounted() { | 161 | mounted() { |
155 | this.token = this.$store.state.token; | 162 | this.token = this.$store.state.token; |
156 | this.getStudentAttendence(); | 163 | this.getStudentAttendence(); |
157 | this.getStudentData(); | 164 | this.getStudentData(); |
158 | }, | 165 | }, |
159 | methods: { | 166 | methods: { |
160 | toggleDate (dateInfo) { | 167 | toggleDate (dateInfo) { |
161 | if (this.selectedDates.includes(dateInfo.date)) { | 168 | if (this.selectedDates.includes(dateInfo.date)) { |
162 | this.viewCourseAttendance = true; | 169 | this.viewCourseAttendance = true; |
163 | } | 170 | } |
164 | }, | 171 | }, |
165 | dates: function(date) { | 172 | dates: function(date) { |
166 | return moment(date).format("MMMM DD, YYYY"); | 173 | return moment(date).format("MMMM DD, YYYY"); |
167 | }, | 174 | }, |
168 | getStudentAttendence() { | 175 | getStudentAttendence() { |
169 | this.showLoader = true; | 176 | this.showLoader = true; |
177 | var studentId = localStorage.getItem("parentStudentId"); | ||
170 | http() | 178 | http() |
171 | .get( | 179 | .get( |
172 | "/studentAttendance", | 180 | "/studentAttendance", |
173 | { params: { studentId: this.$route.params.id } }, | 181 | { params: { studentId: studentId } }, |
174 | { | 182 | { |
175 | headers: { Authorization: "Bearer " + this.token } | 183 | headers: { Authorization: "Bearer " + this.token } |
176 | } | 184 | } |
177 | ) | 185 | ) |
178 | .then(response => { | 186 | .then(response => { |
179 | this.showLoader = false; | 187 | this.showLoader = false; |
180 | }) | 188 | }) |
181 | .catch(error => { | 189 | .catch(error => { |
182 | this.showLoader = false; | 190 | this.showLoader = false; |
183 | if (error.response.status === 401) { | 191 | if (error.response.status === 401) { |
184 | this.$router.replace({ path: "/" }); | 192 | this.$router.replace({ path: "/" }); |
185 | this.$store.dispatch("setToken", null); | 193 | this.$store.dispatch("setToken", null); |
186 | this.$store.dispatch("Id", null); | 194 | this.$store.dispatch("Id", null); |
187 | this.$store.dispatch("Role", null); | 195 | this.$store.dispatch("Role", null); |
188 | } | 196 | } |
189 | }); | 197 | }); |
190 | }, | 198 | }, |
191 | getStudentData() { | 199 | getStudentData() { |
200 | var particularStudentId = localStorage.getItem("parentStudentId"); | ||
192 | http() | 201 | http() |
193 | .get( | 202 | .get( |
194 | "/getParticularStudentDetail", | 203 | "/getParticularStudentDetail", |
195 | { params: { studentId: this.$route.params.id } }, | 204 | { params: { studentId: particularStudentId } }, |
196 | { | 205 | { |
197 | headers: { Authorization: "Bearer " + this.token } | 206 | headers: { Authorization: "Bearer " + this.token } |
198 | } | 207 | } |
199 | ) | 208 | ) |
200 | .then(response => { | 209 | .then(response => { |
201 | this.studentData = response.data.data; | 210 | this.studentData = response.data.data; |
202 | this.getCourseAttendance(response.data.data.classId._id); | 211 | this.getCourseAttendance(response.data.data.classId._id); |
203 | }) | 212 | }) |
204 | .catch(err => { | 213 | .catch(err => { |
205 | // console.log("err====>", err); | 214 | // console.log("err====>", err); |
206 | this.snackbar = true; | 215 | this.snackbar = true; |
207 | this.color = "error"; | 216 | this.color = "error"; |
208 | this.text = error.response.data.message; | 217 | this.text = error.response.data.message; |
209 | // this.$router.replace({ path: '/' }); | 218 | // this.$router.replace({ path: '/' }); |
210 | }); | 219 | }); |
211 | }, | 220 | }, |
212 | getCourseAttendance(classId) { | 221 | getCourseAttendance(classId) { |
222 | var particularCourseStudentId = localStorage.getItem("parentStudentId"); | ||
213 | http() | 223 | http() |
214 | .get( | 224 | .get( |
215 | "/getStudentCourseAttendance", | 225 | "/getStudentCourseAttendance", |
216 | { params: { studentId: this.$route.params.id, | 226 | { params: { studentId: particularCourseStudentId, |
217 | classId: classId } | 227 | classId: classId } |
218 | }, | 228 | }, |
219 | { | 229 | { |
220 | headers: { Authorization: "Bearer " + this.token } | 230 | headers: { Authorization: "Bearer " + this.token } |
221 | } | 231 | } |
222 | ) | 232 | ) |
223 | .then(response => { | 233 | .then(response => { |
224 | this.courseAttendanceData = response.data.data; | 234 | this.courseAttendanceData = response.data.data; |
225 | this.courseAttendanceList = response.data.data[0].studentAttendance; | 235 | this.courseAttendanceList = response.data.data[0].studentAttendance; |
226 | // console.log("===this.courseAttendanceList===", this.courseAttendanceList) | 236 | // console.log("===this.courseAttendanceList===", this.courseAttendanceList) |
227 | let array = []; | 237 | let array = []; |
228 | for (let i = 0; i < this.courseAttendanceData.length; i++) { | 238 | for (let i = 0; i < this.courseAttendanceData.length; i++) { |
229 | if (this.courseAttendanceData[i].date) { | 239 | if (this.courseAttendanceData[i].date) { |
230 | this.selectedDates.push(this.courseAttendanceData[i].date) | 240 | this.selectedDates.push(this.courseAttendanceData[i].date) |
231 | array.push({ | 241 | array.push({ |
232 | date: this.courseAttendanceData[i].date, | 242 | date: this.courseAttendanceData[i].date, |
233 | className: "green" | 243 | className: "green" |
234 | }); | 244 | }); |
235 | } | 245 | } |
236 | } | 246 | } |
237 | this.activeDates = array; | 247 | this.activeDates = array; |
238 | }) | 248 | }) |
239 | .catch(err => { | 249 | .catch(err => { |
240 | this.snackbar = true; | 250 | this.snackbar = true; |
241 | this.color = "error"; | 251 | this.color = "error"; |
242 | this.text = error.response.data.message; | 252 | this.text = error.response.data.message; |
243 | }); | 253 | }); |
244 | }, | 254 | }, |
245 | profile(item) { | 255 | profile(item) { |
246 | this.viewCourseAttendance = true; | 256 | this.viewCourseAttendance = true; |
247 | }, | 257 | }, |
248 | } | 258 | } |
249 | }; | 259 | }; |
250 | </script> | 260 | </script> |
251 | 261 | ||
252 | <style lang="stylus"> | 262 | <style lang="stylus"> |
253 | .your_customized_wrapper_class { | 263 | .your_customized_wrapper_class { |
254 | background-color: #0aa; | 264 | background-color: #0aa; |
255 | color: white; | 265 | color: white; |
256 | 266 | ||
257 | &.red { | 267 | &.red { |
258 | background-color: red; | 268 | background-color: red; |
259 | color: white; | 269 | color: white; |
260 | 270 | ||
261 | &:after { | 271 | &:after { |
262 | background-size: 100% 100%; | 272 | background-size: 100% 100%; |
263 | } | 273 | } |
264 | } | 274 | } |
265 | 275 | ||
266 | &.blue { | 276 | &.blue { |
267 | background-color: #0000aa; | 277 | background-color: #0000aa; |
268 | color: white; | 278 | color: white; |
269 | } | 279 | } |
270 | 280 | ||
271 | &.your_customized_classname { | 281 | &.your_customized_classname { |
272 | background-color: yellow; | 282 | background-color: yellow; |
273 | color: black; | 283 | color: black; |
274 | } | 284 | } |
275 | } | 285 | } |
276 | </style> | 286 | </style> |
277 | <style scoped> | 287 | <style scoped> |
278 | .card-style { | 288 | .card-style { |
279 | background: #7f62f8 !important; | 289 | background: #7f62f8 !important; |
280 | border-color: #7f62f8 !important; | 290 | border-color: #7f62f8 !important; |
281 | border-radius: 12px; | 291 | border-radius: 12px; |
282 | } | 292 | } |
283 | </style> | 293 | </style> |
src/pages/Dashboard/LiveOnlineClass.vue
1 | <template> | 1 | <template> |
2 | <div class="body-color"> | 2 | <div class="body-color"> |
3 | <!-- LOADER --> | 3 | <!-- LOADER --> |
4 | <div class="loader" v-if="showLoader"> | 4 | <div class="loader" v-if="showLoader"> |
5 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 5 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
6 | </div> | 6 | </div> |
7 | 7 | ||
8 | <!-- SNACKBAR --> | 8 | <!-- SNACKBAR --> |
9 | <v-snackbar | 9 | <v-snackbar |
10 | :timeout="timeout" | 10 | :timeout="timeout" |
11 | :top="y === 'top'" | 11 | :top="y === 'top'" |
12 | :right="x === 'right'" | 12 | :right="x === 'right'" |
13 | :vertical="mode === 'vertical'" | 13 | :vertical="mode === 'vertical'" |
14 | v-model="snackbar" | 14 | v-model="snackbar" |
15 | :color="snackbarColor" | 15 | :color="snackbarColor" |
16 | > | 16 | > |
17 | {{ text }} | 17 | {{ text }} |
18 | <v-spacer></v-spacer> | 18 | <v-spacer></v-spacer> |
19 | <v-btn flat text @click="snackbar = false">X</v-btn> | 19 | <v-btn flat text @click="snackbar = false">X</v-btn> |
20 | </v-snackbar> | 20 | </v-snackbar> |
21 | 21 | ||
22 | <v-container grid-list-xl class="pt-0"> | 22 | <v-container grid-list-xl class="pt-0"> |
23 | <v-layout row wrap class="mt-1"> | 23 | <v-layout row wrap class="mt-1"> |
24 | <!-- if logged in user is parent --> | 24 | <!-- if logged in user is parent --> |
25 | <v-flex xs12 sm12 md9 v-if=" $store.state.role === 'PARENT' "> | 25 | <v-flex xs12 sm12 md9 v-if=" $store.state.role === 'PARENT' "> |
26 | <v-layout column> | 26 | <v-layout column> |
27 | <!-- HEADING --> | 27 | <!-- HEADING --> |
28 | <v-flex> | 28 | <v-flex> |
29 | <div | 29 | <div |
30 | class="title side-bar-color font-weight-bold" | 30 | class="title side-bar-color font-weight-bold" |
31 | >Live Online Classes - {{$route.query.chapterName}}</div> | 31 | >Live Online Classes - {{$route.query.chapterName}}</div> |
32 | <!-- <div class="subheading grey--text lighten-1">{{liveLink}}</div> --> | 32 | <!-- <div class="subheading grey--text lighten-1">{{liveLink}}</div> --> |
33 | <!-- <div | 33 | <!-- <div |
34 | class="subheading grey--text lighten-1" | 34 | class="subheading grey--text lighten-1" |
35 | >The session started at 1:00 there is 1 moderator</div>--> | 35 | >The session started at 1:00 there is 1 moderator</div>--> |
36 | </v-flex> | 36 | </v-flex> |
37 | 37 | ||
38 | <!-- JOIN OR END SESSION --> | 38 | <!-- JOIN OR END SESSION --> |
39 | <v-flex v-if="showJoinSessionButton"> | 39 | <v-flex v-if="showJoinSessionButton"> |
40 | <div> | 40 | <div> |
41 | <v-btn | 41 | <v-btn |
42 | round | 42 | round |
43 | class="open-dialog-button" | 43 | class="open-dialog-button" |
44 | dark | 44 | dark |
45 | v-if="studentBtn" | 45 | v-if="studentBtn" |
46 | @click="showLoader = true;startChat();" | 46 | @click="showLoader = true;startChat();" |
47 | >{{studentBtn}}</v-btn> | 47 | >{{studentBtn}}</v-btn> |
48 | <span class="subheading grey--twxt lighten-1" v-else>Session hasn't started yet</span> | 48 | <span class="subheading grey--twxt lighten-1" v-else>Session hasn't started yet</span> |
49 | </div> | 49 | </div> |
50 | </v-flex> | 50 | </v-flex> |
51 | <v-flex id="studentClone"> | 51 | <v-flex id="studentClone"> |
52 | <div id="jitsi-container"></div> | 52 | <div id="jitsi-container"></div> |
53 | </v-flex> | 53 | </v-flex> |
54 | </v-layout> | 54 | </v-layout> |
55 | </v-flex> | 55 | </v-flex> |
56 | 56 | ||
57 | <!-- if logged in user is teacher --> | 57 | <!-- if logged in user is teacher --> |
58 | <v-flex xs12 sm12 md12 v-else> | 58 | <v-flex xs12 sm12 md12 v-else> |
59 | <v-layout column> | 59 | <v-layout column> |
60 | <!-- HEADING --> | 60 | <!-- HEADING --> |
61 | <v-flex> | 61 | <v-flex> |
62 | <div | 62 | <div |
63 | class="title side-bar-color font-weight-bold" | 63 | class="title side-bar-color font-weight-bold" |
64 | >Live Online Classes - {{$route.query.chapterName}}</div> | 64 | >Live Online Classes - {{$route.query.chapterName}}</div> |
65 | <!-- <div class="subheading grey--text lighten-1"></div> --> | 65 | <!-- <div class="subheading grey--text lighten-1"></div> --> |
66 | <!-- <div | 66 | <!-- <div |
67 | class="subheading grey--text lighten-1" | 67 | class="subheading grey--text lighten-1" |
68 | >The session started at 1:00 there is 1 moderator</div>--> | 68 | >The session started at 1:00 there is 1 moderator</div>--> |
69 | </v-flex> | 69 | </v-flex> |
70 | 70 | ||
71 | <!-- JOIN OR END SESSION --> | 71 | <!-- JOIN OR END SESSION --> |
72 | <v-flex v-if="showStartSessionButton"> | 72 | <v-flex v-if="showStartSessionButton"> |
73 | <div> | 73 | <div> |
74 | <v-btn | 74 | <v-btn |
75 | round | 75 | round |
76 | class="open-dialog-button" | 76 | class="open-dialog-button" |
77 | dark | 77 | dark |
78 | @click="showLoader = true;startChat()" | 78 | @click="showLoader = true;startChat()" |
79 | >Start Session</v-btn> | 79 | >Start Session</v-btn> |
80 | </div> | 80 | </div> |
81 | </v-flex> | 81 | </v-flex> |
82 | <v-flex id="teacherClone"> | 82 | <v-flex id="teacherClone"> |
83 | <div id="jitsi-container"></div> | 83 | <div id="jitsi-container"></div> |
84 | </v-flex> | 84 | </v-flex> |
85 | </v-layout> | 85 | </v-layout> |
86 | </v-flex> | 86 | </v-flex> |
87 | 87 | ||
88 | <v-spacer></v-spacer> | 88 | <v-spacer></v-spacer> |
89 | 89 | ||
90 | <!-- COURSES SIDE BAR- positioned to the right of the page --> | 90 | <!-- COURSES SIDE BAR- positioned to the right of the page --> |
91 | <!-- <v-flex xs3> | 91 | <!-- <v-flex xs3> |
92 | <v-card class="elevation-0 card-border" height="100%"> | 92 | <v-card class="elevation-0 card-border" height="100%"> |
93 | <CoursesSideBar></CoursesSideBar> | 93 | <CoursesSideBar></CoursesSideBar> |
94 | </v-card> | 94 | </v-card> |
95 | </v-flex>--> | 95 | </v-flex>--> |
96 | </v-layout> | 96 | </v-layout> |
97 | </v-container> | 97 | </v-container> |
98 | </div> | 98 | </div> |
99 | </template> | 99 | </template> |
100 | <script> | 100 | <script> |
101 | import AllApiCalls from "@/Services/AllApiCalls.js"; | 101 | import AllApiCalls from "@/Services/AllApiCalls.js"; |
102 | import http from "@/Services/http.js"; | 102 | import http from "@/Services/http.js"; |
103 | import moment from "moment"; | 103 | import moment from "moment"; |
104 | import Meet from "@/pages/Meet/meet.vue"; | 104 | import Meet from "@/pages/Meet/meet.vue"; |
105 | import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue"; | 105 | import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue"; |
106 | export default { | 106 | export default { |
107 | mixins: [AllApiCalls], | 107 | mixins: [AllApiCalls], |
108 | components: { | 108 | components: { |
109 | CoursesSideBar, | 109 | CoursesSideBar, |
110 | }, | 110 | }, |
111 | data() { | 111 | data() { |
112 | return { | 112 | return { |
113 | startLiveSession: "", | 113 | startLiveSession: "", |
114 | studentBtn: "", | 114 | studentBtn: "", |
115 | 115 | ||
116 | // DATA TABLE | 116 | // DATA TABLE |
117 | search: "", | 117 | search: "", |
118 | pagination: { | 118 | pagination: { |
119 | rowsPerPage: 10, | 119 | rowsPerPage: 10, |
120 | }, | 120 | }, |
121 | liveOnlineHeaders: [ | 121 | liveOnlineHeaders: [ |
122 | { | 122 | { |
123 | text: "Playback", | 123 | text: "Playback", |
124 | value: "attachementUrl", | 124 | value: "attachementUrl", |
125 | sortable: false, | 125 | sortable: false, |
126 | align: "center", | 126 | align: "center", |
127 | }, | 127 | }, |
128 | { | 128 | { |
129 | text: "Meeting", | 129 | text: "Meeting", |
130 | align: "center", | 130 | align: "center", |
131 | sortable: false, | 131 | sortable: false, |
132 | value: "", | 132 | value: "", |
133 | }, | 133 | }, |
134 | { | 134 | { |
135 | text: "Recording", | 135 | text: "Recording", |
136 | value: "", | 136 | value: "", |
137 | sortable: false, | 137 | sortable: false, |
138 | align: "center", | 138 | align: "center", |
139 | }, | 139 | }, |
140 | { | 140 | { |
141 | text: "Description Preview", | 141 | text: "Description Preview", |
142 | value: "", | 142 | value: "", |
143 | sortable: false, | 143 | sortable: false, |
144 | align: "center", | 144 | align: "center", |
145 | }, | 145 | }, |
146 | { text: "Date", value: "", sortable: false, align: "center" }, | 146 | { text: "Date", value: "", sortable: false, align: "center" }, |
147 | { text: "Duration", value: "", sortable: false, align: "center" }, | 147 | { text: "Duration", value: "", sortable: false, align: "center" }, |
148 | { text: "Toolbar", value: "", sortable: false, align: "center" }, | 148 | { text: "Toolbar", value: "", sortable: false, align: "center" }, |
149 | ], | 149 | ], |
150 | liveOnlineItems: [], | 150 | liveOnlineItems: [], |
151 | 151 | ||
152 | // JITSI CONTAINER | 152 | // JITSI CONTAINER |
153 | liveLink: "", | 153 | liveLink: "", |
154 | token: "", | 154 | token: "", |
155 | selectStudents: {}, | 155 | selectStudents: {}, |
156 | classRules: [(v) => !!v || " Class Name is required"], | 156 | classRules: [(v) => !!v || " Class Name is required"], |
157 | sectionRules: [(v) => !!v || " Section Name is required"], | 157 | sectionRules: [(v) => !!v || " Section Name is required"], |
158 | addclass: [], | 158 | addclass: [], |
159 | addSection: [], | 159 | addSection: [], |
160 | loading: false, | 160 | loading: false, |
161 | room: "", | 161 | room: "", |
162 | username: "", | 162 | username: "", |
163 | roomPassword: "", | 163 | roomPassword: "", |
164 | // counter: 0, | 164 | // counter: 0, |
165 | appLink: "", | 165 | appLink: "", |
166 | showStartSessionButton: true, | 166 | showStartSessionButton: true, |
167 | showJoinSessionButton: true, | 167 | showJoinSessionButton: true, |
168 | courseAttendanceId: {}, | 168 | courseAttendanceId: {}, |
169 | }; | 169 | }; |
170 | }, | 170 | }, |
171 | methods: { | 171 | methods: { |
172 | async startChat() { | 172 | async startChat() { |
173 | if (this.$store.state.role === "PARENT") { | 173 | if (this.$store.state.role === "PARENT") { |
174 | // if (this.counter == 0) { | 174 | // if (this.counter == 0) { |
175 | // console.log("enter start chat"); | 175 | // console.log("enter start chat"); |
176 | const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); | 176 | const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); |
177 | if (isMobile) { | 177 | if (isMobile) { |
178 | window.open(this.appLink); | 178 | window.open(this.appLink); |
179 | this.showLoader = false; | 179 | this.showLoader = false; |
180 | } else { | 180 | } else { |
181 | this.startConference(); | 181 | this.startConference(); |
182 | this.createAttendence(); | 182 | this.createAttendence(); |
183 | // this.counter += 1; | 183 | // this.counter += 1; |
184 | this.showJoinSessionButton = false; | 184 | this.showJoinSessionButton = false; |
185 | } | 185 | } |
186 | // } | 186 | // } |
187 | } | 187 | } |
188 | if (this.$store.state.role === "TEACHER") { | 188 | if (this.$store.state.role === "TEACHER") { |
189 | // if (this.counter == 0) { | 189 | // if (this.counter == 0) { |
190 | this.createRoom(); | 190 | this.createRoom(); |
191 | // this.counter += 1; | 191 | // this.counter += 1; |
192 | // } | 192 | // } |
193 | } | 193 | } |
194 | }, | 194 | }, |
195 | // JITSI CONTAINER | 195 | // JITSI CONTAINER |
196 | startConference() { | 196 | startConference() { |
197 | // console.log("yes session started"); | 197 | // console.log("yes session started"); |
198 | var _this = this; | 198 | var _this = this; |
199 | try { | 199 | try { |
200 | const domain = "meet.intrack.in"; | 200 | const domain = "meet.intrack.in"; |
201 | const options = { | 201 | const options = { |
202 | audioInput: "<deviceLabel>", | 202 | audioInput: "<deviceLabel>", |
203 | audioOutput: "<deviceLabel>", | 203 | audioOutput: "<deviceLabel>", |
204 | videoInput: "<deviceLabel>", | 204 | videoInput: "<deviceLabel>", |
205 | prejoinPageEnabled: false, | 205 | prejoinPageEnabled: false, |
206 | roomName: this.room, | 206 | roomName: this.room, |
207 | height: 500, | 207 | height: 500, |
208 | parentNode: document.getElementById("jitsi-container"), | 208 | parentNode: document.getElementById("jitsi-container"), |
209 | interfaceConfigOverwrite: { | 209 | interfaceConfigOverwrite: { |
210 | filmStripOnly: false, | 210 | filmStripOnly: false, |
211 | SHOW_PROMOTIONAL_CLOSE_PAGE: false, | 211 | SHOW_PROMOTIONAL_CLOSE_PAGE: false, |
212 | SHOW_POWERED_BY: false, | 212 | SHOW_POWERED_BY: false, |
213 | SHOW_JITSI_WATERMARK: false, | 213 | SHOW_JITSI_WATERMARK: false, |
214 | TOOLBAR_BUTTONS: [ | 214 | TOOLBAR_BUTTONS: [ |
215 | "microphone", | 215 | "microphone", |
216 | "camera", | 216 | "camera", |
217 | "closedcaptions", | 217 | "closedcaptions", |
218 | "desktop", | 218 | "desktop", |
219 | "fullscreen", | 219 | "fullscreen", |
220 | "fodeviceselection", | 220 | "fodeviceselection", |
221 | "hangup", | 221 | "hangup", |
222 | "profile", | 222 | "profile", |
223 | "info", | 223 | "info", |
224 | "chat", | 224 | "chat", |
225 | "recording", | 225 | "recording", |
226 | "livestreaming", | 226 | "livestreaming", |
227 | "etherpad", | 227 | "etherpad", |
228 | "sharedvideo", | 228 | "sharedvideo", |
229 | "settings", | 229 | "settings", |
230 | "raisehand", | 230 | "raisehand", |
231 | "videoquality", | 231 | "videoquality", |
232 | "filmstrip", | 232 | "filmstrip", |
233 | "invite", | 233 | "invite", |
234 | "feedback", | 234 | "feedback", |
235 | "stats", | 235 | "stats", |
236 | "shortcuts", | 236 | "shortcuts", |
237 | "tileview", | 237 | "tileview", |
238 | ], | 238 | ], |
239 | }, | 239 | }, |
240 | configOverwrite: { | 240 | configOverwrite: { |
241 | disableSimulcast: false, | 241 | disableSimulcast: false, |
242 | }, | 242 | }, |
243 | teacherName: "", | 243 | teacherName: "", |
244 | room: "", | 244 | room: "", |
245 | }; | 245 | }; |
246 | _this.api = new JitsiMeetExternalAPI(domain, options); | 246 | _this.api = new JitsiMeetExternalAPI(domain, options); |
247 | // console.log("this.api ", this.api); | 247 | // console.log("this.api ", this.api); |
248 | _this.api.addEventListener("videoConferenceJoined", () => { | 248 | _this.api.addEventListener("videoConferenceJoined", () => { |
249 | this.showLoader = false; | 249 | this.showLoader = false; |
250 | setTimeout(() => { | 250 | setTimeout(() => { |
251 | _this.api.executeCommand("displayName", _this.username); | 251 | _this.api.executeCommand("displayName", _this.username); |
252 | _this.api.executeCommand("password", _this.roomPassword); | 252 | _this.api.executeCommand("password", _this.roomPassword); |
253 | }, 1000); | 253 | }, 1000); |
254 | }); | 254 | }); |
255 | 255 | ||
256 | _this.api.on("passwordRequired", () => { | 256 | _this.api.on("passwordRequired", () => { |
257 | _this.api.executeCommand("password", _this.roomPassword); | 257 | _this.api.executeCommand("password", _this.roomPassword); |
258 | }); | 258 | }); |
259 | 259 | ||
260 | _this.api.on("readyToClose", () => { | 260 | _this.api.on("readyToClose", () => { |
261 | // this.$router.push({ name: "Refresh" }); | 261 | // this.$router.push({ name: "Refresh" }); |
262 | let jitsi = document.getElementById("jitsi-container"); | 262 | let jitsi = document.getElementById("jitsi-container"); |
263 | jitsi.innerHTML = ""; | 263 | jitsi.innerHTML = ""; |
264 | this.showStartSessionButton = true; | 264 | this.showStartSessionButton = true; |
265 | this.showJoinSessionButton = true; | 265 | this.showJoinSessionButton = true; |
266 | this.updateCourseAttendance(); | ||
266 | if (this.$store.state.role === "TEACHER") { | 267 | if (this.$store.state.role === "TEACHER") { |
267 | this.updateLiveClass(); | 268 | this.updateLiveClass(); |
268 | } | 269 | } |
269 | }); | 270 | }); |
270 | } catch (error) { | 271 | } catch (error) { |
271 | // console.error("Failed to load Jitsi API", error); | 272 | // console.error("Failed to load Jitsi API", error); |
272 | } | 273 | } |
273 | }, | 274 | }, |
274 | openRoom() { | 275 | openRoom() { |
275 | // verify the JitsiMeetExternalAPI constructor is added to the global.. | 276 | // verify the JitsiMeetExternalAPI constructor is added to the global.. |
276 | // if (this.teacherName != "" || this.room != "") { | 277 | // if (this.teacherName != "" || this.room != "") { |
277 | // if (window.JitsiMeetExternalAPI) { | 278 | // if (window.JitsiMeetExternalAPI) { |
278 | // // var person = prompt("Please enter your name:", "Rabie"); | 279 | // // var person = prompt("Please enter your name:", "Rabie"); |
279 | // if (person != null || person != "") this.username = this.teacherName; | 280 | // if (person != null || person != "") this.username = this.teacherName; |
280 | // var room = prompt("Please enter your room:", "Test Room"); | 281 | // var room = prompt("Please enter your room:", "Test Room"); |
281 | // if (room != null || room != "") this.room = this.room; | 282 | // if (room != null || room != "") this.room = this.room; |
282 | // this.startConference(); | 283 | // this.startConference(); |
283 | // } else alert("Jitsi Meet API script not loaded"); | 284 | // } else alert("Jitsi Meet API script not loaded"); |
284 | // } | 285 | // } |
285 | }, | 286 | }, |
286 | 287 | ||
287 | createRoom(classId) { | 288 | createRoom(classId) { |
288 | // this.showLoader = true; | 289 | // this.showLoader = true; |
289 | var classId = { | 290 | var classId = { |
290 | classId: classId, | 291 | classId: classId, |
291 | }; | 292 | }; |
292 | http() | 293 | http() |
293 | .post("/createLiveClasses", { | 294 | .post("/createLiveClasses", { |
294 | classId: this.$route.query.classId, | 295 | classId: this.$route.query.classId, |
295 | courseId: this.$route.query.courseId, | 296 | courseId: this.$route.query.courseId, |
296 | chapterId: this.$route.query.chapterId, | 297 | chapterId: this.$route.query.chapterId, |
297 | }) | 298 | }) |
298 | .then((response) => { | 299 | .then((response) => { |
299 | // this.addSection = response.data.data; | 300 | // this.addSection = response.data.data; |
300 | // console.log("CREATE___ROOOM", response.data); | 301 | // console.log("CREATE___ROOOM", response.data); |
301 | var room = response.data.data.roomName; | 302 | var room = response.data.data.roomName; |
302 | var username = localStorage.getItem("teacherName"); | 303 | var username = localStorage.getItem("teacherName"); |
303 | var roomPassword = response.data.data.password; | 304 | var roomPassword = response.data.data.password; |
304 | this.appLink = response.data.data.appLink; | 305 | this.appLink = response.data.data.appLink; |
305 | this.liveClassId = response.data.data._id; | 306 | this.liveClassId = response.data.data._id; |
306 | // console.log( | 307 | // console.log( |
307 | // "room", | 308 | // "room", |
308 | // room, | 309 | // room, |
309 | // "username", | 310 | // "username", |
310 | // username, | 311 | // username, |
311 | // "roomPassword", | 312 | // "roomPassword", |
312 | // roomPassword | 313 | // roomPassword |
313 | // ); | 314 | // ); |
314 | var this_ = this; | 315 | var this_ = this; |
315 | if (username != "" || room != "") { | 316 | if (username != "" || room != "") { |
316 | const isMobile = /iPhone|iPad|iPod|Android/i.test( | 317 | const isMobile = /iPhone|iPad|iPod|Android/i.test( |
317 | navigator.userAgent | 318 | navigator.userAgent |
318 | ); | 319 | ); |
319 | if (isMobile) { | 320 | if (isMobile) { |
320 | // console.log("==TEACHER=appLink==", this.appLink); | 321 | // console.log("==TEACHER=appLink==", this.appLink); |
321 | window.open(this.appLink); | 322 | window.open(this.appLink); |
322 | this.showLoader = false; | 323 | this.showLoader = false; |
323 | this.showStartSessionButton = false; | 324 | this.showStartSessionButton = false; |
324 | } else { | 325 | } else { |
325 | if (window.JitsiMeetExternalAPI) { | 326 | if (window.JitsiMeetExternalAPI) { |
326 | // var person = prompt("Please enter your name:", "Rabie"); | 327 | // var person = prompt("Please enter your name:", "Rabie"); |
327 | if (username != null || username != "") { | 328 | if (username != null || username != "") { |
328 | this_.username = username; | 329 | this_.username = username; |
329 | } | 330 | } |
330 | // var room = prompt("Please enter your room:", "Test Room"); | 331 | // var room = prompt("Please enter your room:", "Test Room"); |
331 | if (room != null || room != "") { | 332 | if (room != null || room != "") { |
332 | this_.room = room; | 333 | this_.room = room; |
333 | } | 334 | } |
334 | if (roomPassword != null || roomPassword != "") { | 335 | if (roomPassword != null || roomPassword != "") { |
335 | this_.roomPassword = roomPassword; | 336 | this_.roomPassword = roomPassword; |
336 | } | 337 | } |
337 | } else alert("Jitsi Meet API script not loaded"); | 338 | } else alert("Jitsi Meet API script not loaded"); |
338 | this_.startConference(); | 339 | this_.startConference(); |
339 | this.showStartSessionButton = false; | 340 | this.showStartSessionButton = false; |
340 | } | 341 | } |
341 | } | 342 | } |
342 | }) | 343 | }) |
343 | .catch((err) => { | 344 | .catch((err) => { |
344 | this.showLoader = false; | 345 | this.showLoader = false; |
345 | }); | 346 | }); |
346 | }, | 347 | }, |
347 | formatAMPM(date) { | 348 | formatAMPM(date) { |
348 | var hours = date.getHours(); | 349 | var hours = date.getHours(); |
349 | var minutes = date.getMinutes(); | 350 | var minutes = date.getMinutes(); |
350 | var ampm = hours >= 12 ? "pm" : "am"; | 351 | var ampm = hours >= 12 ? "pm" : "am"; |
351 | hours = hours % 12; | 352 | hours = hours % 12; |
352 | hours = hours ? hours : 12; // the hour '0' should be '12' | 353 | hours = hours ? hours : 12; // the hour '0' should be '12' |
353 | minutes = minutes < 10 ? "0" + minutes : minutes; | 354 | minutes = minutes < 10 ? "0" + minutes : minutes; |
354 | var strTime = hours + ":" + minutes + " " + ampm; | 355 | var strTime = hours + ":" + minutes + " " + ampm; |
355 | return strTime; | 356 | return strTime; |
356 | }, | 357 | }, |
357 | createAttendence() { | 358 | createAttendence() { |
358 | let studentId = localStorage.getItem("parentStudentId"); | 359 | let studentId = localStorage.getItem("parentStudentId"); |
359 | let todayDate = new Date(); | 360 | let todayDate = new Date(); |
360 | var attendenceData = { | 361 | var attendenceData = { |
361 | classId: this.$route.query.classId, | 362 | classId: this.$route.query.classId, |
362 | studentId: studentId, | 363 | studentId: studentId, |
363 | date: new Date().toISOString().substr(0, 10), | 364 | date: new Date().toISOString().substr(0, 10), |
364 | studentAttendance: [ | 365 | studentAttendance: [ |
365 | { | 366 | { |
366 | courseId: this.$route.query.courseId, | 367 | courseId: this.$route.query.courseId, |
367 | chapterId: this.$route.query.chapterId, | 368 | chapterId: this.$route.query.chapterId, |
368 | liveClassId: this.attendenceLiveClassId, | 369 | liveClassId: this.attendenceLiveClassId, |
369 | startTime: this.formatAMPM(new Date()), | 370 | startTime: this.formatAMPM(new Date()), |
370 | }, | 371 | }, |
371 | ], | 372 | ], |
372 | }; | 373 | }; |
373 | this.loading = true; | 374 | this.loading = true; |
374 | http() | 375 | http() |
375 | .post("/createCourseAttendance", attendenceData) | 376 | .post("/createCourseAttendance", attendenceData) |
376 | .then((response) => { | 377 | .then((response) => { |
377 | this.courseAttendanceId = response.data.data._id; | 378 | this.courseAttendanceId = response.data.data._id; |
378 | this.updateCourseAttendance(); | ||
379 | this.loading = false; | 379 | this.loading = false; |
380 | // this.snackbar = true; | 380 | // this.snackbar = true; |
381 | // this.color = "green"; | 381 | // this.color = "green"; |
382 | }) | 382 | }) |
383 | .catch((err) => { | 383 | .catch((err) => { |
384 | this.loading = false; | 384 | this.loading = false; |
385 | this.snackbar = true; | 385 | this.snackbar = true; |
386 | this.color = "error"; | 386 | this.color = "error"; |
387 | }); | 387 | }); |
388 | }, | 388 | }, |
389 | updateLiveClass() { | 389 | updateLiveClass() { |
390 | this.showLoader = true; | 390 | this.showLoader = true; |
391 | var payloadData = { | 391 | var payloadData = { |
392 | liveClassesId: this.liveClassId, | 392 | liveClassesId: this.liveClassId, |
393 | }; | 393 | }; |
394 | http() | 394 | http() |
395 | .put("/updateLiveClasses", payloadData) | 395 | .put("/updateLiveClasses", payloadData) |
396 | .then((response) => { | 396 | .then((response) => { |
397 | this.showLoader = false; | 397 | this.showLoader = false; |
398 | }) | 398 | }) |
399 | .catch((error) => { | 399 | .catch((error) => { |
400 | this.showLoader = false; | 400 | this.showLoader = false; |
401 | }); | 401 | }); |
402 | }, | 402 | }, |
403 | updateCourseAttendance() { | 403 | updateCourseAttendance() { |
404 | this.showLoader = true; | 404 | this.showLoader = true; |
405 | var payloadData = { | 405 | var payloadData = { |
406 | courseAttendanceId: this.courseAttendanceId, | 406 | courseAttendanceId: this.courseAttendanceId, |
407 | liveClassId: this.attendenceLiveClassId, | 407 | liveClassId: this.attendenceLiveClassId, |
408 | endTime: this.formatAMPM(new Date()), | 408 | endTime: this.formatAMPM(new Date()), |
409 | }; | 409 | }; |
410 | http() | 410 | http() |
411 | .put("/updateCourseAttendance", payloadData) | 411 | .put("/updateCourseAttendance", payloadData) |
412 | .then((response) => { | 412 | .then((response) => { |
413 | this.showLoader = false; | 413 | this.showLoader = false; |
414 | }) | 414 | }) |
415 | .catch((error) => { | 415 | .catch((error) => { |
416 | this.showLoader = false; | 416 | this.showLoader = false; |
417 | }); | 417 | }); |
418 | }, | 418 | }, |
419 | async studentClasses() { | 419 | async studentClasses() { |
420 | this.liveLink = ""; | 420 | this.liveLink = ""; |
421 | this.room = ""; | 421 | this.room = ""; |
422 | this.username = ""; | 422 | this.username = ""; |
423 | this.roomPassword = ""; | 423 | this.roomPassword = ""; |
424 | /* getLiveClassesesList - To up date line under heading*/ | 424 | /* getLiveClassesesList - To up date line under heading*/ |
425 | let response = await this.getLiveClassesesList({ | 425 | let response = await this.getLiveClassesesList({ |
426 | classId: this.$route.query.classId, | 426 | classId: this.$route.query.classId, |
427 | courseId: this.$route.query.courseId, | 427 | courseId: this.$route.query.courseId, |
428 | chapterId: this.$route.query.chapterId, | 428 | chapterId: this.$route.query.chapterId, |
429 | }); | 429 | }); |
430 | // console.log("response getLiveClassesesList- ", response); | 430 | // console.log("response getLiveClassesesList- ", response); |
431 | this.attendenceLiveClassId = response.data.data[0]._id; | 431 | this.attendenceLiveClassId = response.data.data[0]._id; |
432 | 432 | ||
433 | /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */ | 433 | /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */ |
434 | if (response.data.data[0].sessionStatus == "ENDED") { | 434 | if (response.data.data[0].sessionStatus == "ENDED") { |
435 | // this.startLiveSession = "Start Session"; | 435 | // this.startLiveSession = "Start Session"; |
436 | this.studentBtn = ""; | 436 | this.studentBtn = ""; |
437 | } | 437 | } |
438 | if (response.data.data[0].sessionStatus == "STARTED") { | 438 | if (response.data.data[0].sessionStatus == "STARTED") { |
439 | // this.startLiveSession = "Join Session"; | 439 | // this.startLiveSession = "Join Session"; |
440 | this.studentBtn = "Join Session"; | 440 | this.studentBtn = "Join Session"; |
441 | } | 441 | } |
442 | if (response.data.data.length == 0) { | 442 | if (response.data.data.length == 0) { |
443 | this.startLiveSession = "Start Session"; | 443 | this.startLiveSession = "Start Session"; |
444 | this.studentBtn = ""; | 444 | this.studentBtn = ""; |
445 | } else { | 445 | } else { |
446 | this.liveLink = response.data.data[0].link; | 446 | this.liveLink = response.data.data[0].link; |
447 | this.appLink = response.data.data[0].appLink; | 447 | this.appLink = response.data.data[0].appLink; |
448 | var room = response.data.data[0].roomName; | 448 | var room = response.data.data[0].roomName; |
449 | var username = this.currentUser; | 449 | var username = this.currentUser; |
450 | var roomPassword = response.data.data[0].password; | 450 | var roomPassword = response.data.data[0].password; |
451 | var this_ = this; | 451 | var this_ = this; |
452 | // console.log(this.room, this.roomPassword, this.username); | 452 | // console.log(this.room, this.roomPassword, this.username); |
453 | 453 | ||
454 | if (username != "" || room != "") { | 454 | if (username != "" || room != "") { |
455 | if (window.JitsiMeetExternalAPI) { | 455 | if (window.JitsiMeetExternalAPI) { |
456 | // var person = prompt("Please enter your name:", "Rabie"); | 456 | // var person = prompt("Please enter your name:", "Rabie"); |
457 | if (username != null || username != "") { | 457 | if (username != null || username != "") { |
458 | this_.username = username; | 458 | this_.username = username; |
459 | } | 459 | } |
460 | if (roomPassword != null || roomPassword != "") { | 460 | if (roomPassword != null || roomPassword != "") { |
461 | this_.roomPassword = roomPassword; | 461 | this_.roomPassword = roomPassword; |
462 | } | 462 | } |
463 | // var room = prompt("Please enter your room:", "Test Room"); | 463 | // var room = prompt("Please enter your room:", "Test Room"); |
464 | if (room != null || room != "") { | 464 | if (room != null || room != "") { |
465 | this_.room = room; | 465 | this_.room = room; |
466 | } | 466 | } |
467 | // this.startConference(); | 467 | // this.startConference(); |
468 | } | 468 | } |
469 | } | 469 | } |
470 | } | 470 | } |
471 | }, | 471 | }, |
472 | }, | 472 | }, |
473 | 473 | ||
474 | async created() { | 474 | async created() { |
475 | // console.log( | 475 | // console.log( |
476 | // "this.$store.state.studentsData", | 476 | // "this.$store.state.studentsData", |
477 | // this.$store.state.studentsData[0].name | 477 | // this.$store.state.studentsData[0].name |
478 | // ); | 478 | // ); |
479 | this.currentUser = localStorage.getItem("studentName"); | 479 | this.currentUser = localStorage.getItem("studentName"); |
480 | this.token = this.$store.state.token; | 480 | this.token = this.$store.state.token; |
481 | if (this.$store.state.role === "PARENT") { | 481 | if (this.$store.state.role === "PARENT") { |
482 | await this.studentClasses(); | 482 | await this.studentClasses(); |
483 | } | 483 | } |
484 | 484 | ||
485 | /* getStudentCourses - to get courseData - defined in GetApis.js*/ | 485 | /* getStudentCourses - to get courseData - defined in GetApis.js*/ |
486 | if (this.$store.state.role === "PARENT") { | 486 | if (this.$store.state.role === "PARENT") { |
487 | await this.getStudentCourses({ | 487 | await this.getStudentCourses({ |
488 | classId: localStorage.getItem("parentClassId"), | 488 | classId: localStorage.getItem("parentClassId"), |
489 | studentId: localStorage.getItem("parentStudentId"), | 489 | studentId: localStorage.getItem("parentStudentId"), |
490 | }); | 490 | }); |
491 | } | 491 | } |
492 | }, | 492 | }, |
493 | }; | 493 | }; |
494 | </script> | 494 | </script> |
495 | <style scoped> | 495 | <style scoped> |
496 | .side-bar-color { | 496 | .side-bar-color { |
497 | color: #827bfa !important; | 497 | color: #827bfa !important; |
498 | /* border-top-right-radius: 74px !important; */ | 498 | /* border-top-right-radius: 74px !important; */ |
499 | } | 499 | } |
500 | .card-border { | 500 | .card-border { |
501 | border: 1px #bdbdbd solid; | 501 | border: 1px #bdbdbd solid; |
502 | border-radius: 3px; | 502 | border-radius: 3px; |
503 | } | 503 | } |
504 | .reply-desc { | 504 | .reply-desc { |
505 | border: 1px solid #f2f2f2; | 505 | border: 1px solid #f2f2f2; |
506 | } | 506 | } |
507 | .open-dialog-button { | 507 | .open-dialog-button { |
508 | background: #827bfa !important; | 508 | background: #827bfa !important; |
509 | border-color: #827bfa !important; | 509 | border-color: #827bfa !important; |
510 | text-transform: none !important; | 510 | text-transform: none !important; |
511 | } | 511 | } |
512 | 512 | ||
513 | .reply-btn { | 513 | .reply-btn { |
514 | background: #feb83c !important; | 514 | background: #feb83c !important; |
515 | border-color: #feb83c !important; | 515 | border-color: #feb83c !important; |
516 | text-transform: none !important; | 516 | text-transform: none !important; |
517 | -webkit-box-shadow: none !important; | 517 | -webkit-box-shadow: none !important; |
518 | box-shadow: none !important; | 518 | box-shadow: none !important; |
519 | } | 519 | } |
520 | #jitsi-container { | 520 | #jitsi-container { |
521 | height: 100vh; | 521 | height: 100vh; |
522 | } | 522 | } |