principal-dashboard-lib-v2 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -177,7 +177,9 @@
177
177
  for (var i = 0; i < usermetadataMatrixUpdated.length; i++) {
178
178
  // const randomNumber = document.createElement('span');
179
179
  // randomNumber.innerHTML = i.toString();
180
- usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName + " " + i;
180
+ //usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName + " --- " + i;
181
+ //satyajit 28 aug 2024 removed count from userName
182
+ usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName;
181
183
  usersMetadataMatrix.push(usermetadataMatrixUpdated[i]); //adding same name users in usermetadataMatrix with some random charators
182
184
  this.usersMetaData = usersMetadataMatrix;
183
185
  }
@@ -365,12 +367,13 @@
365
367
  if (this.userConsoleData) {
366
368
  if (this.userConsoleData.length > 0) {
367
369
  for (var i = 0; i < this.userConsoleData.length; i++) {
368
- console.log("chartDataUserWise-->>", this.userConsoleData[i].userName);
370
+ console.log("chartDataUserWiseNew-->>", this.userConsoleData[i].userName);
369
371
  if (this.userConsoleData[i].userName === undefined) {
370
372
  this.userConsoleData[i].userName = "-";
371
373
  }
372
374
  var userData = [this.userConsoleData[i].userName, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
373
375
  dataTableforChart.push(userData);
376
+ //console.log("chartDataUserWiseNewNew-->>",userData)
374
377
  }
375
378
  }
376
379
  }
@@ -381,12 +384,13 @@
381
384
  dataTableforChart = [];
382
385
  if (this.userConsoleData) {
383
386
  for (var i = 0; i < this.userConsoleData.length; i++) {
384
- console.log('bbb-->', this.userConsoleData[i].terminalLocation);
387
+ //console.log('bbb-->',this.userConsoleData[i].terminalLocation)
385
388
  var roomName = this.userConsoleData[i].terminalLocation;
386
389
  if (roomName === "") {
387
- roomName = "No Name";
390
+ //roomName = "No Name"
388
391
  }
389
392
  var location = roomName + " - " + this.userConsoleData[i].terminalIP;
393
+ console.log('bbblocation-->', location);
390
394
  var userData = [location, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
391
395
  dataTableforChart.push(userData);
392
396
  }
@@ -394,6 +398,26 @@
394
398
  console.log("this.classRoomWiseChartData", dataTableforChart);
395
399
  return dataTableforChart;
396
400
  };
401
+ PrincipalDashboardLibV2Service.prototype.newGetCurrentClassroomData = function () {
402
+ var dataTableforChart = new Array();
403
+ dataTableforChart = [];
404
+ if (this.userConsoleData) {
405
+ for (var i = 0; i < this.userConsoleData.length; i++) {
406
+ //console.log('bbb-->',this.userConsoleData[i].terminalLocation)
407
+ var roomName = this.userConsoleData[i].terminalLocation;
408
+ var location = roomName + " - " + this.userConsoleData[i].terminalIP;
409
+ console.log('bbblocation-->', location);
410
+ //let userData = [location];
411
+ dataTableforChart.push(location);
412
+ }
413
+ }
414
+ console.log("this.classRoomWiseChartData", dataTableforChart);
415
+ dataTableforChart = this.uniq(dataTableforChart);
416
+ return dataTableforChart;
417
+ };
418
+ PrincipalDashboardLibV2Service.prototype.uniq = function (a) {
419
+ return Array.from(new Set(a));
420
+ };
397
421
  PrincipalDashboardLibV2Service.prototype.allUserChartData = function () {
398
422
  var dataTableforChart = new Array();
399
423
  dataTableforChart = [];
@@ -483,13 +507,16 @@
483
507
  roomName = "No Name";
484
508
  }
485
509
  var location = roomName + " - " + roomIP;
510
+ console.log('bbbbRoom', location);
486
511
  // let userData = [this.userConsoleData[i].terminalIP,this.userConsoleData[i].startTime,this.userConsoleData[i].endTime];
487
512
  var userData = [location, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
488
513
  dataTableforChart.push(userData);
489
514
  }
515
+ var inactiveRoonName = void 0;
490
516
  for (var i = 0; i < this.schoolTerminalData.length; i++) {
491
517
  console.log("schoolTerminalData", this.schoolTerminalData);
492
- inActiveClassRoom = this.schoolTerminalData[i].terminalKey;
518
+ inActiveClassRoom = this.schoolTerminalData[i].location + ' - ' + this.schoolTerminalData[i].terminalKey;
519
+ //inactiveRoonName = this.schoolTerminalData[i].location;
493
520
  myChartRowData = {
494
521
  userId: "",
495
522
  userName: "",
@@ -576,10 +603,13 @@
576
603
  chapter = resourceMetadataMatrix[i_4].chapter;
577
604
  teachingpoint = resourceMetadataMatrix[i_4].teachingpoint;
578
605
  if (resourceMetadataMatrix[i_4].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i_4].title.toLowerCase() === 'question') {
579
- AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
606
+ //AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
607
+ AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
608
+ //convertSeconds
580
609
  }
581
610
  else {
582
- AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + " : " + resourceMetadataMatrix[i_4].title + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
611
+ //AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
612
+ AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + " : " + resourceMetadataMatrix[i_4].title + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
583
613
  }
584
614
  //AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k];
585
615
  resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingpoint, AssestDetail];
@@ -658,10 +688,13 @@
658
688
  chapter = resourceMetadataMatrix[i].chapter;
659
689
  teachingpoint = resourceMetadataMatrix[i].teachingpoint;
660
690
  if (resourceMetadataMatrix[i].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i].title.toLowerCase() === 'question') {
661
- AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataIDsduration[k] + ' sec';
691
+ //AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataIDsduration[k] + ' sec';
692
+ AssestDetail = resourceMetadataMatrix[i].type + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
693
+ //convertSeconds
662
694
  }
663
695
  else {
664
- AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + resourceMetadataIDsduration[k] + ' sec';
696
+ //AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + resourceMetadataIDsduration[k] + ' sec';
697
+ AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
665
698
  }
666
699
  resourceArrayForTableChart = [subject, grade, chapter, teachingpoint, AssestDetail];
667
700
  detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
@@ -739,6 +772,11 @@
739
772
  });
740
773
  return displayValue;
741
774
  };
775
+ PrincipalDashboardLibV2Service.prototype.convertSeconds = function (seconds) {
776
+ var minutes = Math.floor(seconds / 60);
777
+ var remainingSeconds = seconds % 60;
778
+ return minutes + "m " + remainingSeconds + "s";
779
+ };
742
780
  return PrincipalDashboardLibV2Service;
743
781
  }());
744
782
  PrincipalDashboardLibV2Service.ɵprov = i0.ɵɵdefineInjectable({ factory: function PrincipalDashboardLibV2Service_Factory() { return new PrincipalDashboardLibV2Service(); }, token: PrincipalDashboardLibV2Service, providedIn: "root" });
@@ -799,7 +837,7 @@
799
837
  this.isChartView = true;
800
838
  }
801
839
  ChartheaderComponent.prototype.ngOnInit = function () {
802
- this.libVersion = "0.0.18";
840
+ this.libVersion = "0.0.19";
803
841
  // this.myIcon = document.getElementById('myIconImg');
804
842
  // this.changeChatType()
805
843
  };
@@ -1206,6 +1244,9 @@
1206
1244
  this.alluserList = this.pdService.allUserChartData();
1207
1245
  this.resourceDataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
1208
1246
  this.totalUsers = this.currentdataList.usersMetadata.length;
1247
+ this.eligibleUsers = this.findEligibleUserCount();
1248
+ this.installedClassrooms = this.findInstalledClassrooms();
1249
+ this.currentRooms = this.findCurrentClassrooms();
1209
1250
  this.findCurrentUserCount();
1210
1251
  }
1211
1252
  this.pdService.chartType.subscribe(function (data) {
@@ -1462,9 +1503,10 @@
1462
1503
  };
1463
1504
  ChartviewComponent.prototype.classRoomWiseCurrentData = function () {
1464
1505
  var classRoomdata = this.pdService.classRoomWiseChartData();
1465
- // console.log("classRoomdata",classRoomdata);
1506
+ console.log("classRoomdata", classRoomdata);
1466
1507
  if (classRoomdata && classRoomdata.length > 0) {
1467
1508
  this.myChartDataMatrix = classRoomdata;
1509
+ console.log("myChartDataMatrix", this.myChartDataMatrix);
1468
1510
  this.updateChart();
1469
1511
  if (this.currentdataList.userConsoleData.length > 0) {
1470
1512
  this.calulateTotalDuration(this.currentdataList.userConsoleData);
@@ -1491,6 +1533,30 @@
1491
1533
  var uniqueUserName = __spread(new Set(userNameArray));
1492
1534
  this.currentUsers = uniqueUserName.length;
1493
1535
  };
1536
+ ChartviewComponent.prototype.findCurrentClassrooms = function () {
1537
+ //console.log("findCurrentClassrooms", this.currentdataList.schoolTerminalData)
1538
+ var classRoomdata = this.pdService.newGetCurrentClassroomData();
1539
+ console.log("findCurrentClassrooms", classRoomdata);
1540
+ return classRoomdata.length;
1541
+ };
1542
+ ChartviewComponent.prototype.findInstalledClassrooms = function () {
1543
+ var count = 0;
1544
+ console.log("findInstalledClassrooms", this.currentdataList.schoolTerminalData);
1545
+ return this.currentdataList.schoolTerminalData.length;
1546
+ };
1547
+ ChartviewComponent.prototype.findEligibleUserCount = function () {
1548
+ console.log("findEligibleUserCount", this.currentdataList);
1549
+ var count = 0;
1550
+ var userMetaData = this.currentdataList.usersMetadata;
1551
+ for (var index = 0; index < userMetaData.length; index++) {
1552
+ var element = userMetaData[index].userSubjects;
1553
+ if (element !== "") {
1554
+ // console.log("findEligibleUserCount", element)
1555
+ count = count + 1;
1556
+ }
1557
+ }
1558
+ return count;
1559
+ };
1494
1560
  ChartviewComponent.prototype.ngOnDestroy = function () {
1495
1561
  // console.log('ngOnDestroy >>');
1496
1562
  };