principal-dashboard-lib-v2 0.0.5 → 0.0.9
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.
- package/bundles/principal-dashboard-lib-v2.umd.js +519 -425
- package/bundles/principal-dashboard-lib-v2.umd.js.map +1 -1
- package/bundles/principal-dashboard-lib-v2.umd.min.js +1 -1
- package/bundles/principal-dashboard-lib-v2.umd.min.js.map +1 -1
- package/esm2015/lib/chartheader/chartheader.component.js +2 -2
- package/esm2015/lib/chartview/chartview.component.js +41 -22
- package/esm2015/lib/detailedview/detailedview.component.js +10 -3
- package/esm2015/lib/exceldata.service.js +78 -45
- package/esm2015/lib/header/header.component.js +18 -9
- package/esm2015/lib/principal-dashboard-lib-v2.component.js +14 -5
- package/esm2015/lib/principal-dashboard-lib-v2.service.js +352 -344
- package/esm2015/lib/tableview/tableview.component.js +7 -5
- package/fesm2015/principal-dashboard-lib-v2.js +513 -426
- package/fesm2015/principal-dashboard-lib-v2.js.map +1 -1
- package/lib/exceldata.service.d.ts +7 -0
- package/lib/principal-dashboard-lib-v2.component.d.ts +3 -0
- package/lib/principal-dashboard-lib-v2.service.d.ts +13 -11
- package/package.json +1 -1
- package/principal-dashboard-lib-v2.metadata.json +1 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('principal-dashboard-lib-v2', ['exports', '@angular/core', 'rxjs', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['principal-dashboard-lib-v2'] = {}, global.ng.core, global.rxjs, global.
|
|
5
|
-
}(this, (function (exports, i0, rxjs, FileSaver, XLSX,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('angular-google-charts'), require('file-saver'), require('xlsx'), require('@angular/common'), require('ng2-datepicker')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('principal-dashboard-lib-v2', ['exports', '@angular/core', 'rxjs', 'angular-google-charts', 'file-saver', 'xlsx', '@angular/common', 'ng2-datepicker'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['principal-dashboard-lib-v2'] = {}, global.ng.core, global.rxjs, global.angularGoogleCharts, global.FileSaver, global.XLSX, global.ng.common, global.ng2Datepicker));
|
|
5
|
+
}(this, (function (exports, i0, rxjs, angularGoogleCharts, FileSaver, XLSX, common, ng2Datepicker) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
|
|
8
|
-
var EXCEL_EXTENSION = '.xlsx';
|
|
9
7
|
var PrincipalDashboardLibV2Service = /** @class */ (function () {
|
|
10
8
|
function PrincipalDashboardLibV2Service() {
|
|
9
|
+
this.isResoureMetaDataReady = new rxjs.ReplaySubject();
|
|
10
|
+
this.isResoureMetaDataReady$ = this.isResoureMetaDataReady.asObservable();
|
|
11
|
+
this.isUserReqiuredDataReady = new rxjs.ReplaySubject();
|
|
12
|
+
this.isUserReqiuredDataReady$ = this.isUserReqiuredDataReady.asObservable();
|
|
11
13
|
this.mychartType = '';
|
|
12
14
|
this.dataType = '';
|
|
13
15
|
this.userAllData = '';
|
|
@@ -27,407 +29,415 @@
|
|
|
27
29
|
//for get details of selected user
|
|
28
30
|
this.detailedviewData = new rxjs.BehaviorSubject(this.userMetadata);
|
|
29
31
|
this.detailedviewData$ = this.detailedviewData.asObservable();
|
|
30
|
-
this.tabName = [{ "name": "School" }, { "name": "UserSummary" }, { "name": "TerminalSummary" }, { "name": "DeatilUsage" }];
|
|
31
32
|
}
|
|
32
|
-
PrincipalDashboardLibV2Service.prototype.exportAsExcelFile = function (json, excelFileName) {
|
|
33
|
-
var excelBuffer;
|
|
34
|
-
var myobj = { Sheets: {}, SheetNames: [] };
|
|
35
|
-
for (var i = 0; i < json.length; i++) {
|
|
36
|
-
var worksheet = XLSX.utils.json_to_sheet(json[i]);
|
|
37
|
-
myobj.Sheets[this.tabName[i].name] = worksheet;
|
|
38
|
-
myobj.SheetNames.push(this.tabName[i].name);
|
|
39
|
-
}
|
|
40
|
-
var workbook = myobj;
|
|
41
|
-
excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
|
42
|
-
this.saveAsExcelFile(excelBuffer, excelFileName);
|
|
43
|
-
};
|
|
44
|
-
PrincipalDashboardLibV2Service.prototype.saveAsExcelFile = function (buffer, fileName) {
|
|
45
|
-
var data = new Blob([buffer], {
|
|
46
|
-
type: EXCEL_TYPE
|
|
47
|
-
});
|
|
48
|
-
FileSaver.saveAs(data, fileName + EXCEL_EXTENSION);
|
|
49
|
-
};
|
|
50
|
-
//_____FOR EXCEL CONVERTOR END
|
|
51
33
|
PrincipalDashboardLibV2Service.prototype.genarateResourseReqiuredData = function (data) {
|
|
52
|
-
|
|
53
|
-
var title;
|
|
54
|
-
var subject;
|
|
55
|
-
var grade;
|
|
56
|
-
var chapter;
|
|
57
|
-
var teachingpoint;
|
|
58
|
-
var type;
|
|
34
|
+
this.isResoureMetaDataReady.next(false);
|
|
59
35
|
var resourceMetadataMatrix = new Array();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
36
|
+
if (data && data !== null) {
|
|
37
|
+
var resouseID = void 0;
|
|
38
|
+
var title = void 0;
|
|
39
|
+
var subject = void 0;
|
|
40
|
+
var grade = void 0;
|
|
41
|
+
var chapter = void 0;
|
|
42
|
+
var teachingpoint = void 0;
|
|
43
|
+
var type = void 0;
|
|
44
|
+
var resourceMetadata = data.resourcesMetadata.resourceMetadata;
|
|
45
|
+
if (resourceMetadata != undefined && resourceMetadata.length > 0) {
|
|
46
|
+
for (var i = 0; i < resourceMetadata.length; i++) {
|
|
47
|
+
//----------//resouseID
|
|
48
|
+
resouseID = resourceMetadata[i].resourceId;
|
|
49
|
+
//----------//subject
|
|
50
|
+
if (resourceMetadata[i].subject != undefined) {
|
|
51
|
+
if (resourceMetadata[i].subject.title != undefined) {
|
|
52
|
+
subject = resourceMetadata[i].subject.title;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
subject = '';
|
|
56
|
+
}
|
|
69
57
|
}
|
|
70
58
|
else {
|
|
71
59
|
subject = '';
|
|
72
60
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
61
|
+
//----------//grade
|
|
62
|
+
if (resourceMetadata[i].grade != undefined) {
|
|
63
|
+
if (resourceMetadata[i].grade.title != undefined) {
|
|
64
|
+
grade = resourceMetadata[i].grade.title;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
grade = '';
|
|
68
|
+
}
|
|
81
69
|
}
|
|
82
70
|
else {
|
|
83
71
|
grade = '';
|
|
84
72
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
73
|
+
//----------//chapter
|
|
74
|
+
if (resourceMetadata[i].chapter != undefined) {
|
|
75
|
+
if (resourceMetadata[i].chapter.title != undefined) {
|
|
76
|
+
chapter = resourceMetadata[i].chapter.title;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
chapter = '';
|
|
80
|
+
}
|
|
93
81
|
}
|
|
94
82
|
else {
|
|
95
83
|
chapter = '';
|
|
96
84
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
//----------//teachingpoint
|
|
86
|
+
if (resourceMetadata[i].teachingpoint != undefined) {
|
|
87
|
+
if (resourceMetadata[i].teachingpoint.title != undefined) {
|
|
88
|
+
teachingpoint = resourceMetadata[i].teachingpoint.title;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
teachingpoint = '';
|
|
92
|
+
}
|
|
105
93
|
}
|
|
106
94
|
else {
|
|
107
95
|
teachingpoint = '';
|
|
108
96
|
}
|
|
97
|
+
//----------//type
|
|
98
|
+
if (resourceMetadata[i].type != undefined) {
|
|
99
|
+
type = resourceMetadata[i].type;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
type = '';
|
|
103
|
+
}
|
|
104
|
+
//----------//title
|
|
105
|
+
if (resourceMetadata[i].title != undefined) {
|
|
106
|
+
title = resourceMetadata[i].title;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
title = '';
|
|
110
|
+
}
|
|
111
|
+
var resourceMetauserConsoleData = {
|
|
112
|
+
resouseID: resouseID,
|
|
113
|
+
subject: subject,
|
|
114
|
+
grade: grade,
|
|
115
|
+
chapter: chapter,
|
|
116
|
+
teachingpoint: teachingpoint,
|
|
117
|
+
type: type,
|
|
118
|
+
title: title
|
|
119
|
+
};
|
|
120
|
+
resourceMetadataMatrix.push(resourceMetauserConsoleData);
|
|
121
|
+
this.resoureMetaData = resourceMetadataMatrix;
|
|
122
|
+
this.isResoureMetaDataReady.next(true);
|
|
109
123
|
}
|
|
110
|
-
else {
|
|
111
|
-
teachingpoint = '';
|
|
112
|
-
}
|
|
113
|
-
//----------//type
|
|
114
|
-
if (resourceMetadata[i].type != undefined) {
|
|
115
|
-
type = resourceMetadata[i].type;
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
type = '';
|
|
119
|
-
}
|
|
120
|
-
//----------//title
|
|
121
|
-
if (resourceMetadata[i].title != undefined) {
|
|
122
|
-
title = resourceMetadata[i].title;
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
title = '';
|
|
126
|
-
}
|
|
127
|
-
var resourceMetauserConsoleData = {
|
|
128
|
-
resouseID: resouseID,
|
|
129
|
-
subject: subject,
|
|
130
|
-
grade: grade,
|
|
131
|
-
chapter: chapter,
|
|
132
|
-
teachingpoint: teachingpoint,
|
|
133
|
-
type: type,
|
|
134
|
-
title: title
|
|
135
|
-
};
|
|
136
|
-
resourceMetadataMatrix.push(resourceMetauserConsoleData);
|
|
137
124
|
}
|
|
138
125
|
}
|
|
126
|
+
// this.resoureMetaData = resourceMetadataMatrix;
|
|
139
127
|
return resourceMetadataMatrix;
|
|
140
128
|
};
|
|
141
129
|
PrincipalDashboardLibV2Service.prototype.genarateUserReqiuredData = function (data) {
|
|
142
|
-
|
|
143
|
-
var usersMetadata = data.usersMetadata.userMetadata;
|
|
144
|
-
var schoolTerminal = data.schoolTerminals.schoolTerminal;
|
|
130
|
+
this.isUserReqiuredDataReady.next(false);
|
|
145
131
|
var usersMetadataMatrix = new Array();
|
|
146
132
|
var usermetadataMatrixUpdated = new Array();
|
|
147
133
|
var schoolTerminalMatrix = new Array();
|
|
148
134
|
var userConsoleMatrix = new Array();
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
135
|
+
if (data && data !== null) {
|
|
136
|
+
var userConsole = data.usersConsole.userConsole;
|
|
137
|
+
var usersMetadata = data.usersMetadata.userMetadata;
|
|
138
|
+
var schoolTerminal = data.schoolTerminals.schoolTerminal;
|
|
139
|
+
if (usersMetadata != null && usersMetadata.length > 0) {
|
|
140
|
+
for (var i_1 = 0; i_1 < usersMetadata.length; i_1++) {
|
|
141
|
+
var userId = void 0;
|
|
142
|
+
var userName = void 0;
|
|
143
|
+
var userSubjects = void 0;
|
|
144
|
+
var listOfUser = {};
|
|
145
|
+
if (usersMetadata[i_1].userId != "") {
|
|
146
|
+
userId = usersMetadata[i_1].userId;
|
|
147
|
+
if (usersMetadata[i_1].fullName !== undefined) {
|
|
148
|
+
userName = usersMetadata[i_1].fullName; // get name of user w.r.t. ID
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
userName = '';
|
|
152
|
+
}
|
|
153
|
+
if (usersMetadata[i_1].userSubjects !== undefined) {
|
|
154
|
+
userSubjects = usersMetadata[i_1].userSubjects; // get name of user w.r.t. ID
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
userSubjects = '';
|
|
158
|
+
}
|
|
159
|
+
listOfUser = {
|
|
160
|
+
userId: userId,
|
|
161
|
+
userName: userName,
|
|
162
|
+
userSubjects: userSubjects
|
|
163
|
+
};
|
|
164
|
+
usersMetadataMatrix.push(listOfUser); // array of all users
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
for (var i = 0; i < usersMetadataMatrix.length; i++) {
|
|
169
|
+
usersMetadataMatrix.forEach(function (element) {
|
|
170
|
+
if (usersMetadataMatrix[i].userName === element.userName) {
|
|
171
|
+
usermetadataMatrixUpdated.push(usersMetadataMatrix[i]); //array of same name users
|
|
172
|
+
usersMetadataMatrix.splice(i, 1); //delete the same name users from usermetadataMatrix
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
for (var i = 0; i < usermetadataMatrixUpdated.length; i++) {
|
|
177
|
+
// const randomNumber = document.createElement('span');
|
|
178
|
+
// randomNumber.innerHTML = i.toString();
|
|
179
|
+
usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName + " " + i;
|
|
180
|
+
usersMetadataMatrix.push(usermetadataMatrixUpdated[i]); //adding same name users in usermetadataMatrix with some random charators
|
|
181
|
+
this.usersMetaData = usersMetadataMatrix;
|
|
182
|
+
}
|
|
183
|
+
if (schoolTerminal != null && schoolTerminal.length > 0) {
|
|
184
|
+
for (var i = 0; i < schoolTerminal.length; i++) {
|
|
185
|
+
var schoolId = void 0;
|
|
186
|
+
var terminalKey = void 0;
|
|
187
|
+
var terminalType = void 0;
|
|
188
|
+
var location = void 0;
|
|
189
|
+
var schoolTerminalData = {};
|
|
190
|
+
//----------//schoolId
|
|
191
|
+
if (schoolTerminal[i].schoolId !== undefined) {
|
|
192
|
+
schoolId = schoolTerminal[i].schoolId; // get name of user w.r.t. ID
|
|
159
193
|
}
|
|
160
194
|
else {
|
|
161
|
-
|
|
195
|
+
schoolId = '';
|
|
162
196
|
}
|
|
163
|
-
|
|
164
|
-
|
|
197
|
+
//----------//terminalKey
|
|
198
|
+
if (schoolTerminal[i].terminalKey !== undefined) {
|
|
199
|
+
terminalKey = schoolTerminal[i].terminalKey; // get name of user w.r.t. ID
|
|
165
200
|
}
|
|
166
201
|
else {
|
|
167
|
-
|
|
202
|
+
terminalKey = '';
|
|
168
203
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
204
|
+
//----------//terminalType
|
|
205
|
+
if (schoolTerminal[i].terminalType !== undefined) {
|
|
206
|
+
terminalType = schoolTerminal[i].terminalType; // get name of user w.r.t. ID
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
terminalType = '';
|
|
210
|
+
}
|
|
211
|
+
//----------//location
|
|
212
|
+
if (schoolTerminal[i].metadata !== undefined) {
|
|
213
|
+
location = schoolTerminal[i].metadata; // get name of user w.r.t. ID
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
location = '';
|
|
217
|
+
}
|
|
218
|
+
schoolTerminalData = {
|
|
219
|
+
schoolId: schoolId,
|
|
220
|
+
terminalKey: terminalKey,
|
|
221
|
+
terminalType: terminalType,
|
|
222
|
+
location: location
|
|
173
223
|
};
|
|
174
|
-
|
|
224
|
+
schoolTerminalMatrix.push(schoolTerminalData);
|
|
225
|
+
this.schoolTerminalData = schoolTerminalMatrix;
|
|
175
226
|
}
|
|
176
227
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
var schoolId = void 0;
|
|
195
|
-
var terminalKey = void 0;
|
|
196
|
-
var terminalType = void 0;
|
|
197
|
-
var location = void 0;
|
|
198
|
-
var schoolTerminalData = {};
|
|
199
|
-
//----------//schoolId
|
|
200
|
-
if (schoolTerminal[i].schoolId !== undefined) {
|
|
201
|
-
schoolId = schoolTerminal[i].schoolId; // get name of user w.r.t. ID
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
schoolId = '';
|
|
205
|
-
}
|
|
206
|
-
//----------//terminalKey
|
|
207
|
-
if (schoolTerminal[i].terminalKey !== undefined) {
|
|
208
|
-
terminalKey = schoolTerminal[i].terminalKey; // get name of user w.r.t. ID
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
terminalKey = '';
|
|
212
|
-
}
|
|
213
|
-
//----------//terminalType
|
|
214
|
-
if (schoolTerminal[i].terminalType !== undefined) {
|
|
215
|
-
terminalType = schoolTerminal[i].terminalType; // get name of user w.r.t. ID
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
terminalType = '';
|
|
219
|
-
}
|
|
220
|
-
//----------//location
|
|
221
|
-
if (schoolTerminal[i].metadata !== undefined) {
|
|
222
|
-
location = schoolTerminal[i].metadata; // get name of user w.r.t. ID
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
location = '';
|
|
226
|
-
}
|
|
227
|
-
schoolTerminalData = {
|
|
228
|
-
schoolId: schoolId,
|
|
229
|
-
terminalKey: terminalKey,
|
|
230
|
-
terminalType: terminalType,
|
|
231
|
-
location: location
|
|
232
|
-
};
|
|
233
|
-
schoolTerminalMatrix.push(schoolTerminalData);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
if (userConsole != null && userConsole.length > 0) {
|
|
237
|
-
for (var index = 0; index < userConsole.length; index++) {
|
|
238
|
-
var userId = void 0;
|
|
239
|
-
var startTime = void 0;
|
|
240
|
-
var endTime = void 0;
|
|
241
|
-
var duration = void 0;
|
|
242
|
-
var selectedDate = void 0;
|
|
243
|
-
var terminalIP = void 0;
|
|
244
|
-
var userConsoleResources = void 0;
|
|
245
|
-
var resourceMetadataIDS = void 0;
|
|
246
|
-
var resourceMetauserConsoleData = new Array();
|
|
247
|
-
var userName = void 0;
|
|
248
|
-
var userSubjects = void 0;
|
|
249
|
-
var terminalLocation = void 0;
|
|
250
|
-
//----------//user iD
|
|
251
|
-
if (userConsole[index].userId !== undefined) {
|
|
252
|
-
userId = userConsole[index].userId; // get name of user w.r.t. ID
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
userId = '';
|
|
256
|
-
}
|
|
257
|
-
//----------// startTime
|
|
258
|
-
if (userConsole[index].startTime !== undefined) {
|
|
259
|
-
startTime = userConsole[index].startTime; // get name of user w.r.t. ID
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
startTime = '';
|
|
263
|
-
}
|
|
264
|
-
//----------// endTime
|
|
265
|
-
if (userConsole[index].endTime !== undefined) {
|
|
266
|
-
endTime = userConsole[index].endTime; // get name of user w.r.t. ID
|
|
267
|
-
this.myEndTime = endTime;
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
endTime = '';
|
|
271
|
-
}
|
|
272
|
-
//----------// Date
|
|
273
|
-
if (userConsole[index].selectedDate !== undefined) {
|
|
274
|
-
selectedDate = userConsole[index].selectedDate; // get name of user w.r.t. ID
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
selectedDate = '';
|
|
278
|
-
}
|
|
279
|
-
//----------// Duration
|
|
280
|
-
if (userConsole[index].duration !== undefined) {
|
|
281
|
-
duration = userConsole[index].duration; // get name of user w.r.t. ID
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
duration = '';
|
|
285
|
-
}
|
|
286
|
-
//----------// terminalIP
|
|
287
|
-
if (userConsole[index].terminalIP !== undefined) {
|
|
288
|
-
terminalIP = userConsole[index].terminalIP; // get name of user w.r.t. ID
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
terminalIP = '';
|
|
292
|
-
}
|
|
293
|
-
//----------// userConsoleResources
|
|
294
|
-
if (userConsole[index].userConsoleResources !== undefined) {
|
|
295
|
-
userConsoleResources = userConsole[index].userConsoleResources; // get name of user w.r.t. ID
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
userConsoleResources = null;
|
|
299
|
-
}
|
|
300
|
-
if (userConsoleResources != null) {
|
|
301
|
-
if (userConsoleResources.userConsoleResource !== undefined) {
|
|
302
|
-
resourceMetauserConsoleData = userConsoleResources.userConsoleResource; // get name of user w.r.t. ID
|
|
228
|
+
if (userConsole != null && userConsole.length > 0) {
|
|
229
|
+
for (var index = 0; index < userConsole.length; index++) {
|
|
230
|
+
var userId = void 0;
|
|
231
|
+
var startTime = void 0;
|
|
232
|
+
var endTime = void 0;
|
|
233
|
+
var duration = void 0;
|
|
234
|
+
var selectedDate = void 0;
|
|
235
|
+
var terminalIP = void 0;
|
|
236
|
+
var userConsoleResources = void 0;
|
|
237
|
+
var resourceMetadataIDS = void 0;
|
|
238
|
+
var resourceMetauserConsoleData = new Array();
|
|
239
|
+
var userName = void 0;
|
|
240
|
+
var userSubjects = void 0;
|
|
241
|
+
var terminalLocation = void 0;
|
|
242
|
+
//----------//user iD
|
|
243
|
+
if (userConsole[index].userId !== undefined) {
|
|
244
|
+
userId = userConsole[index].userId; // get name of user w.r.t. ID
|
|
303
245
|
}
|
|
304
246
|
else {
|
|
305
|
-
|
|
247
|
+
userId = '';
|
|
306
248
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
if (userId === usersMetadataMatrix[i_2].userId) {
|
|
311
|
-
userName = usersMetadataMatrix[i_2].userName;
|
|
312
|
-
userSubjects = usersMetadataMatrix[i_2].userSubjects;
|
|
249
|
+
//----------// startTime
|
|
250
|
+
if (userConsole[index].startTime !== undefined) {
|
|
251
|
+
startTime = userConsole[index].startTime; // get name of user w.r.t. ID
|
|
313
252
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
253
|
+
else {
|
|
254
|
+
startTime = '';
|
|
255
|
+
}
|
|
256
|
+
//----------// endTime
|
|
257
|
+
if (userConsole[index].endTime !== undefined) {
|
|
258
|
+
endTime = userConsole[index].endTime; // get name of user w.r.t. ID
|
|
259
|
+
this.myEndTime = endTime;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
endTime = '';
|
|
263
|
+
}
|
|
264
|
+
//----------// Date
|
|
265
|
+
if (userConsole[index].selectedDate !== undefined) {
|
|
266
|
+
selectedDate = userConsole[index].selectedDate; // get name of user w.r.t. ID
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
selectedDate = '';
|
|
270
|
+
}
|
|
271
|
+
//----------// Duration
|
|
272
|
+
if (userConsole[index].duration !== undefined) {
|
|
273
|
+
duration = userConsole[index].duration; // get name of user w.r.t. ID
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
duration = '';
|
|
319
277
|
}
|
|
278
|
+
//----------// terminalIP
|
|
279
|
+
if (userConsole[index].terminalIP !== undefined) {
|
|
280
|
+
terminalIP = userConsole[index].terminalIP; // get name of user w.r.t. ID
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
terminalIP = '';
|
|
284
|
+
}
|
|
285
|
+
//----------// userConsoleResources
|
|
286
|
+
if (userConsole[index].userConsoleResources !== undefined) {
|
|
287
|
+
userConsoleResources = userConsole[index].userConsoleResources; // get name of user w.r.t. ID
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
userConsoleResources = null;
|
|
291
|
+
}
|
|
292
|
+
if (userConsoleResources != null) {
|
|
293
|
+
if (userConsoleResources.userConsoleResource !== undefined) {
|
|
294
|
+
resourceMetauserConsoleData = userConsoleResources.userConsoleResource; // get name of user w.r.t. ID
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
resourceMetauserConsoleData = [];
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
//----------// userName and userSubjects
|
|
301
|
+
for (var i_2 = 0; i_2 < usersMetadataMatrix.length; i_2++) {
|
|
302
|
+
if (userId === usersMetadataMatrix[i_2].userId) {
|
|
303
|
+
userName = usersMetadataMatrix[i_2].userName;
|
|
304
|
+
userSubjects = usersMetadataMatrix[i_2].userSubjects;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
//----------// terminalIP and terminalLocation
|
|
308
|
+
for (var i_3 = 0; i_3 < schoolTerminalMatrix.length; i_3++) {
|
|
309
|
+
if (terminalIP === schoolTerminalMatrix[i_3].terminalKey) {
|
|
310
|
+
terminalLocation = schoolTerminalMatrix[i_3].location;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
var userData = {
|
|
314
|
+
userId: userId,
|
|
315
|
+
userName: userName,
|
|
316
|
+
startTime: new Date(startTime),
|
|
317
|
+
endTime: new Date(endTime),
|
|
318
|
+
terminalIP: terminalIP,
|
|
319
|
+
resourceMetauserConsoleData: resourceMetauserConsoleData,
|
|
320
|
+
duration: duration,
|
|
321
|
+
terminalLocation: terminalLocation,
|
|
322
|
+
userSubjects: userSubjects
|
|
323
|
+
};
|
|
324
|
+
userConsoleMatrix.push(userData);
|
|
325
|
+
this.userConsoleData = userConsoleMatrix;
|
|
326
|
+
this.isUserReqiuredDataReady.next(true);
|
|
320
327
|
}
|
|
321
|
-
var userData = {
|
|
322
|
-
userId: userId,
|
|
323
|
-
userName: userName,
|
|
324
|
-
startTime: new Date(startTime),
|
|
325
|
-
endTime: new Date(endTime),
|
|
326
|
-
terminalIP: terminalIP,
|
|
327
|
-
resourceMetauserConsoleData: resourceMetauserConsoleData,
|
|
328
|
-
duration: duration,
|
|
329
|
-
terminalLocation: terminalLocation,
|
|
330
|
-
userSubjects: userSubjects
|
|
331
|
-
};
|
|
332
|
-
userConsoleMatrix.push(userData);
|
|
333
328
|
}
|
|
334
329
|
}
|
|
335
|
-
|
|
330
|
+
// console.log(usersMetadataMatrix,schoolTerminalMatrix,userConsoleMatrix);
|
|
331
|
+
return {
|
|
332
|
+
usersMetadata: usersMetadataMatrix,
|
|
333
|
+
schoolTerminalData: schoolTerminalMatrix,
|
|
334
|
+
userConsoleData: userConsoleMatrix
|
|
335
|
+
};
|
|
336
336
|
};
|
|
337
|
-
PrincipalDashboardLibV2Service.prototype.userWiseChartData = function (
|
|
337
|
+
PrincipalDashboardLibV2Service.prototype.userWiseChartData = function () {
|
|
338
338
|
var dataTableforChart = new Array();
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
339
|
+
dataTableforChart = [];
|
|
340
|
+
if (this.userConsoleData) {
|
|
341
|
+
if (this.userConsoleData.length > 0) {
|
|
342
|
+
for (var i = 0; i < this.userConsoleData.length; i++) {
|
|
343
|
+
var userData = [this.userConsoleData[i].userName, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
|
|
344
|
+
dataTableforChart.push(userData);
|
|
345
|
+
}
|
|
343
346
|
}
|
|
344
347
|
}
|
|
345
348
|
return dataTableforChart;
|
|
346
349
|
};
|
|
347
|
-
PrincipalDashboardLibV2Service.prototype.classRoomWiseChartData = function (
|
|
350
|
+
PrincipalDashboardLibV2Service.prototype.classRoomWiseChartData = function () {
|
|
348
351
|
var dataTableforChart = new Array();
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
+
dataTableforChart = [];
|
|
353
|
+
if (this.userConsoleData) {
|
|
354
|
+
for (var i = 0; i < this.userConsoleData.length; i++) {
|
|
355
|
+
var userData = [this.userConsoleData[i].terminalLocation, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
|
|
356
|
+
dataTableforChart.push(userData);
|
|
357
|
+
}
|
|
352
358
|
}
|
|
353
359
|
return dataTableforChart;
|
|
354
360
|
};
|
|
355
|
-
PrincipalDashboardLibV2Service.prototype.allUserChartData = function (
|
|
361
|
+
PrincipalDashboardLibV2Service.prototype.allUserChartData = function () {
|
|
356
362
|
var dataTableforChart = new Array();
|
|
357
|
-
|
|
358
|
-
var userSubjects;
|
|
359
|
-
var myID;
|
|
360
|
-
var AlluserDetails = new Array();
|
|
363
|
+
dataTableforChart = [];
|
|
361
364
|
var AlluserDetailsForTableChart = new Array();
|
|
362
365
|
AlluserDetailsForTableChart = [];
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
366
|
+
if (this.userConsoleData && this.usersMetaData) {
|
|
367
|
+
var inActiveuserName = void 0;
|
|
368
|
+
var userSubjects = void 0;
|
|
369
|
+
var myID = void 0;
|
|
370
|
+
var AlluserDetails = new Array();
|
|
371
|
+
for (var index = 0; index < this.userConsoleData.length; index++) {
|
|
372
|
+
AlluserDetails.push(this.userConsoleData[index]);
|
|
373
|
+
AlluserDetailsForTableChart.push(this.userConsoleData[index]);
|
|
374
|
+
}
|
|
375
|
+
for (var i = 0; i < this.usersMetaData.length; i++) {
|
|
376
|
+
myID = this.usersMetaData[i].userId;
|
|
377
|
+
inActiveuserName = this.usersMetaData[i].userName;
|
|
378
|
+
userSubjects = this.usersMetaData[i].userSubjects;
|
|
379
|
+
var myChartRowuserConsoleData = {
|
|
380
|
+
userId: myID,
|
|
381
|
+
userName: inActiveuserName,
|
|
382
|
+
startTime: new Date(this.myEndTime),
|
|
383
|
+
endTime: new Date(this.myEndTime),
|
|
384
|
+
terminalIP: "",
|
|
385
|
+
resourceMetauserConsoleData: [],
|
|
386
|
+
duration: "0",
|
|
387
|
+
terminalLocation: "",
|
|
388
|
+
userSubjects: userSubjects
|
|
389
|
+
};
|
|
390
|
+
AlluserDetails.push(myChartRowuserConsoleData);
|
|
391
|
+
var myTableRowuserConsoleData = {
|
|
392
|
+
userId: myID,
|
|
393
|
+
userName: inActiveuserName,
|
|
394
|
+
startTime: "",
|
|
395
|
+
endTime: "",
|
|
396
|
+
terminalIP: "",
|
|
397
|
+
resourceMetauserConsoleData: [],
|
|
398
|
+
duration: 0,
|
|
399
|
+
terminalLocation: "",
|
|
400
|
+
userSubjects: userSubjects
|
|
401
|
+
};
|
|
402
|
+
AlluserDetailsForTableChart.push(myTableRowuserConsoleData);
|
|
403
|
+
}
|
|
404
|
+
for (var i = 0; i < AlluserDetails.length; i++) {
|
|
405
|
+
var userData = [AlluserDetails[i].userName, AlluserDetails[i].startTime, AlluserDetails[i].endTime];
|
|
406
|
+
dataTableforChart.push(userData);
|
|
407
|
+
}
|
|
399
408
|
}
|
|
400
409
|
return { forChartData: dataTableforChart, fordurationTable: AlluserDetailsForTableChart };
|
|
401
410
|
};
|
|
402
|
-
PrincipalDashboardLibV2Service.prototype.allRoomsData = function (
|
|
411
|
+
PrincipalDashboardLibV2Service.prototype.allRoomsData = function () {
|
|
403
412
|
var dataTableforChart = new Array();
|
|
404
|
-
|
|
405
|
-
var inActiveClassRoom;
|
|
406
|
-
var endTime;
|
|
413
|
+
dataTableforChart = [];
|
|
407
414
|
var allRoomsDetails = new Array();
|
|
408
415
|
allRoomsDetails = [];
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
var
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
416
|
+
if (this.userConsoleData && this.schoolTerminalData) {
|
|
417
|
+
var myChartRowData = {};
|
|
418
|
+
var inActiveClassRoom = void 0;
|
|
419
|
+
for (var i = 0; i < this.userConsoleData.length; i++) {
|
|
420
|
+
allRoomsDetails.push(this.userConsoleData[i]);
|
|
421
|
+
var userData = [this.userConsoleData[i].terminalLocation, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
|
|
422
|
+
dataTableforChart.push(userData);
|
|
423
|
+
}
|
|
424
|
+
for (var i = 0; i < this.schoolTerminalData.length; i++) {
|
|
425
|
+
inActiveClassRoom = this.schoolTerminalData[i].location;
|
|
426
|
+
myChartRowData = {
|
|
427
|
+
userId: "",
|
|
428
|
+
userName: "",
|
|
429
|
+
startTime: new Date(this.myEndTime),
|
|
430
|
+
endTime: new Date(this.myEndTime),
|
|
431
|
+
terminalIP: "",
|
|
432
|
+
resourceMetauserConsoleData: [],
|
|
433
|
+
duration: 0,
|
|
434
|
+
terminalLocation: inActiveClassRoom,
|
|
435
|
+
userSubjects: ""
|
|
436
|
+
};
|
|
437
|
+
allRoomsDetails.push(myChartRowData);
|
|
438
|
+
var myChartRowuserConsoleData = [inActiveClassRoom, new Date(this.myEndTime), new Date(this.myEndTime)];
|
|
439
|
+
dataTableforChart.push(myChartRowuserConsoleData);
|
|
440
|
+
}
|
|
431
441
|
}
|
|
432
442
|
return { forChartData: dataTableforChart, fordurationTable: allRoomsDetails };
|
|
433
443
|
};
|
|
@@ -555,8 +565,8 @@
|
|
|
555
565
|
chapter = undefined;
|
|
556
566
|
teachingpoint = undefined;
|
|
557
567
|
AssestDetail = undefined;
|
|
558
|
-
resourceArrayForTableChart = [subject,
|
|
559
|
-
detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
|
|
568
|
+
// resourceArrayForTableChart = [subject,grade,chapter,teachingpoint,AssestDetail];
|
|
569
|
+
// detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
|
|
560
570
|
}
|
|
561
571
|
else {
|
|
562
572
|
//resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingpoint,type,title]
|
|
@@ -589,12 +599,24 @@
|
|
|
589
599
|
var PrincipalDashboardLibV2Component = /** @class */ (function () {
|
|
590
600
|
function PrincipalDashboardLibV2Component() {
|
|
591
601
|
this.userSelectedDate = new i0.EventEmitter();
|
|
602
|
+
this.messageForUser = "Loding...";
|
|
592
603
|
}
|
|
604
|
+
Object.defineProperty(PrincipalDashboardLibV2Component.prototype, "responseStatus", {
|
|
605
|
+
set: function (res) {
|
|
606
|
+
this.setMessageForUser(res);
|
|
607
|
+
// console.log(" @Input() set responseStatus(res: any) >>>>>>>>>>>>.",res);
|
|
608
|
+
},
|
|
609
|
+
enumerable: false,
|
|
610
|
+
configurable: true
|
|
611
|
+
});
|
|
593
612
|
PrincipalDashboardLibV2Component.prototype.ngOnInit = function () {
|
|
594
|
-
console.log(" IN --> 7 data",
|
|
613
|
+
// console.log(" IN --> 7 data",this.data);
|
|
614
|
+
};
|
|
615
|
+
PrincipalDashboardLibV2Component.prototype.setMessageForUser = function (res) {
|
|
616
|
+
this.messageForUser = res;
|
|
595
617
|
};
|
|
596
618
|
PrincipalDashboardLibV2Component.prototype.onUserSelectDate = function (e) {
|
|
597
|
-
console.log(" IN --> 1");
|
|
619
|
+
// console.log(" IN --> 1");
|
|
598
620
|
this.data = null;
|
|
599
621
|
this.userSelectedDate.emit(e);
|
|
600
622
|
};
|
|
@@ -603,13 +625,14 @@
|
|
|
603
625
|
PrincipalDashboardLibV2Component.decorators = [
|
|
604
626
|
{ type: i0.Component, args: [{
|
|
605
627
|
selector: 'lib-principal-dashboard-lib-v2',
|
|
606
|
-
template: "<div id=\"reprtModule\">\r\n <div id=\"pd-mainDiv\" class=\"pd-mainContainer\">\r\n <lib-header [data]=\"data\" (userSelectedDate)=\"onUserSelectDate($event)\">\r\n </lib-header>\r\n <lib-chartheader></lib-chartheader>\r\n \r\n <div id=\"pd-preloader\" class=\"pd-preloaderDiv\" *ngIf=\"!data\">\r\n
|
|
607
|
-
styles: [".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;top:
|
|
628
|
+
template: "<div id=\"reprtModule\">\r\n <div id=\"pd-mainDiv\" class=\"pd-mainContainer\">\r\n <lib-header [data]=\"data\" (userSelectedDate)=\"onUserSelectDate($event)\">\r\n </lib-header>\r\n <lib-chartheader></lib-chartheader>\r\n \r\n <div id=\"pd-preloader\" class=\"pd-preloaderDiv\" *ngIf=\"responseStatus !== 'true' && !data\">\r\n {{messageForUser}}\r\n </div>\r\n <lib-chartview *ngIf=\"data\" [data]=\"data\"></lib-chartview>\r\n <lib-tableview *ngIf=\"data\" [data]=\"data\"></lib-tableview>\r\n <lib-detailedview *ngIf=\"data\" [data]=\"data\"></lib-detailedview>\r\n \r\n </div>\r\n</div>\r\n ",
|
|
629
|
+
styles: [".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;top:33px;z-index:2}.bs-datepicker-head{background-color:#000!important}"]
|
|
608
630
|
},] }
|
|
609
631
|
];
|
|
610
632
|
PrincipalDashboardLibV2Component.ctorParameters = function () { return []; };
|
|
611
633
|
PrincipalDashboardLibV2Component.propDecorators = {
|
|
612
634
|
data: [{ type: i0.Input }],
|
|
635
|
+
responseStatus: [{ type: i0.Input }],
|
|
613
636
|
userSelectedDate: [{ type: i0.Output }]
|
|
614
637
|
};
|
|
615
638
|
|
|
@@ -623,7 +646,7 @@
|
|
|
623
646
|
this.isChartView = true;
|
|
624
647
|
}
|
|
625
648
|
ChartheaderComponent.prototype.ngOnInit = function () {
|
|
626
|
-
this.libVersion = "0.0.
|
|
649
|
+
this.libVersion = "0.0.18";
|
|
627
650
|
// this.myIcon = document.getElementById('myIconImg');
|
|
628
651
|
// this.changeChatType()
|
|
629
652
|
};
|
|
@@ -995,10 +1018,10 @@
|
|
|
995
1018
|
this.totalChartDataMatrix = new Array();
|
|
996
1019
|
}
|
|
997
1020
|
Object.defineProperty(ChartviewComponent.prototype, "data", {
|
|
998
|
-
// @HostListener('window:resize', ['$event'])
|
|
999
1021
|
set: function (res) {
|
|
1000
|
-
|
|
1001
|
-
|
|
1022
|
+
if (res !== null) {
|
|
1023
|
+
this.loadChart(res);
|
|
1024
|
+
}
|
|
1002
1025
|
},
|
|
1003
1026
|
enumerable: false,
|
|
1004
1027
|
configurable: true
|
|
@@ -1006,7 +1029,7 @@
|
|
|
1006
1029
|
ChartviewComponent.prototype.ngOnInit = function () { };
|
|
1007
1030
|
ChartviewComponent.prototype.loadChart = function (response) {
|
|
1008
1031
|
var _this = this;
|
|
1009
|
-
console.log(' IN --> 8 loadChart');
|
|
1032
|
+
// console.log(' IN --> 8 loadChart');
|
|
1010
1033
|
this.totalUsers = 0;
|
|
1011
1034
|
this.eligibleUsers = 0;
|
|
1012
1035
|
this.currentUsers = 0;
|
|
@@ -1027,7 +1050,7 @@
|
|
|
1027
1050
|
}
|
|
1028
1051
|
if (this.myXmlData) {
|
|
1029
1052
|
this.currentdataList = this.pdService.genarateUserReqiuredData(this.myXmlData);
|
|
1030
|
-
this.alluserList = this.pdService.allUserChartData(
|
|
1053
|
+
this.alluserList = this.pdService.allUserChartData();
|
|
1031
1054
|
this.resourceDataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
|
|
1032
1055
|
this.totalUsers = this.currentdataList.usersMetadata.length;
|
|
1033
1056
|
this.findCurrentUserCount();
|
|
@@ -1048,7 +1071,7 @@
|
|
|
1048
1071
|
ChartviewComponent.prototype.myChartReady = function () {
|
|
1049
1072
|
this.createDivforTotalDurartion();
|
|
1050
1073
|
this.setHeightofDivforTotalDurartion();
|
|
1051
|
-
this.removeBlankEntryBar();
|
|
1074
|
+
// this.removeBlankEntryBar();
|
|
1052
1075
|
};
|
|
1053
1076
|
ChartviewComponent.prototype.updateChartType = function (dataType) {
|
|
1054
1077
|
if (this.chartview != null && this.chartview != undefined) {
|
|
@@ -1157,7 +1180,7 @@
|
|
|
1157
1180
|
}
|
|
1158
1181
|
};
|
|
1159
1182
|
ChartviewComponent.prototype.timeConvert = function (n) {
|
|
1160
|
-
var num = n;
|
|
1183
|
+
var num = Math.floor(n);
|
|
1161
1184
|
var hours = num / 60;
|
|
1162
1185
|
var rhours = Math.floor(hours);
|
|
1163
1186
|
var minutes = (hours - rhours) * 60;
|
|
@@ -1238,8 +1261,10 @@
|
|
|
1238
1261
|
else {
|
|
1239
1262
|
this.selectedUserData = this.pdService.dataForDetailedView(this.currentdataList.userConsoleData, this.resourceDataList, row);
|
|
1240
1263
|
}
|
|
1264
|
+
// console.log("this.selectedUserData",this.selectedUserData);
|
|
1241
1265
|
this.pdService.detailedviewData.next(this.selectedUserData);
|
|
1242
1266
|
this.updateChart();
|
|
1267
|
+
// alluserList
|
|
1243
1268
|
};
|
|
1244
1269
|
ChartviewComponent.prototype.showAllUser = function () {
|
|
1245
1270
|
this.pdService.isAllUsers.next(true);
|
|
@@ -1262,31 +1287,48 @@
|
|
|
1262
1287
|
}
|
|
1263
1288
|
};
|
|
1264
1289
|
ChartviewComponent.prototype.userWiseCurrentData = function () {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1290
|
+
var chartDataUserWise = this.pdService.userWiseChartData();
|
|
1291
|
+
if (chartDataUserWise.length > 0) {
|
|
1292
|
+
this.myChartDataMatrix = chartDataUserWise;
|
|
1293
|
+
this.updateChart();
|
|
1294
|
+
if (this.currentdataList.userConsoleData.length > 0) {
|
|
1295
|
+
this.calulateTotalDuration(this.currentdataList.userConsoleData);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1268
1298
|
};
|
|
1269
1299
|
ChartviewComponent.prototype.userWiseAllData = function () {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1300
|
+
var chartDataUserWise = this.alluserList.forChartData;
|
|
1301
|
+
if (chartDataUserWise.length > 0) {
|
|
1302
|
+
this.myChartDataMatrix = chartDataUserWise;
|
|
1303
|
+
this.updateChart();
|
|
1304
|
+
this.calulateTotalDuration(this.alluserList.fordurationTable);
|
|
1305
|
+
}
|
|
1273
1306
|
};
|
|
1274
1307
|
ChartviewComponent.prototype.classRoomWiseCurrentData = function () {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1308
|
+
var classRoomdata = this.pdService.classRoomWiseChartData();
|
|
1309
|
+
if (classRoomdata && classRoomdata.length > 0) {
|
|
1310
|
+
this.myChartDataMatrix = classRoomdata;
|
|
1311
|
+
this.updateChart();
|
|
1312
|
+
if (this.currentdataList.userConsoleData.length > 0) {
|
|
1313
|
+
this.calulateTotalDuration(this.currentdataList.userConsoleData);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1278
1316
|
};
|
|
1279
1317
|
ChartviewComponent.prototype.classRoomWiseAllData = function () {
|
|
1280
|
-
var allclassRoomList = this.pdService.allRoomsData(
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1318
|
+
var allclassRoomList = this.pdService.allRoomsData();
|
|
1319
|
+
if (allclassRoomList.forChartData && allclassRoomList.forChartData.length > 0) {
|
|
1320
|
+
this.myChartDataMatrix = allclassRoomList.forChartData;
|
|
1321
|
+
this.updateChart();
|
|
1322
|
+
}
|
|
1323
|
+
if (allclassRoomList.fordurationTable && allclassRoomList.fordurationTable.length > 0) {
|
|
1324
|
+
this.calulateTotalDuration(allclassRoomList.fordurationTable);
|
|
1325
|
+
}
|
|
1284
1326
|
};
|
|
1285
1327
|
ChartviewComponent.prototype.findCurrentUserCount = function () {
|
|
1286
1328
|
var userConsoleData = this.currentdataList.userConsoleData;
|
|
1287
1329
|
var userNameArray = new Array();
|
|
1288
1330
|
for (var index = 0; index < userConsoleData.length; index++) {
|
|
1289
|
-
var element = userConsoleData[index]
|
|
1331
|
+
var element = userConsoleData[index].userName;
|
|
1290
1332
|
userNameArray.push(element);
|
|
1291
1333
|
}
|
|
1292
1334
|
var uniqueUserName = __spread(new Set(userNameArray));
|
|
@@ -1335,8 +1377,15 @@
|
|
|
1335
1377
|
this.deatilViewTable = document.getElementById('pd-deatilViewTable');
|
|
1336
1378
|
this.closeButton = document.getElementById('pd-closeButton');
|
|
1337
1379
|
this.pdService.detailedviewData.subscribe(function (data) {
|
|
1338
|
-
|
|
1339
|
-
|
|
1380
|
+
if (data) {
|
|
1381
|
+
if (data.userDetails.length > 0) {
|
|
1382
|
+
_this.createTable(data.userDetails);
|
|
1383
|
+
}
|
|
1384
|
+
if (data.resourceDetails.length > 0) {
|
|
1385
|
+
// console.log("data.resourceDetails",data.resourceDetails);
|
|
1386
|
+
_this.createResourcesTable(data.resourceDetails);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1340
1389
|
});
|
|
1341
1390
|
this.deatilViewContainer.style.display = 'none';
|
|
1342
1391
|
};
|
|
@@ -1452,9 +1501,32 @@
|
|
|
1452
1501
|
{ type: PrincipalDashboardLibV2Service }
|
|
1453
1502
|
]; };
|
|
1454
1503
|
|
|
1504
|
+
var EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
|
|
1505
|
+
var EXCEL_EXTENSION = '.xlsx';
|
|
1455
1506
|
var ExceldataService = /** @class */ (function () {
|
|
1456
1507
|
function ExceldataService() {
|
|
1508
|
+
this.resourceTypes = new Array();
|
|
1509
|
+
this.tabName = [{ "name": "School" }, { "name": "User Summary" }, { "name": "Terminal Summary" }, { "name": "Usage Details" }];
|
|
1457
1510
|
}
|
|
1511
|
+
ExceldataService.prototype.exportAsExcelFile = function (json, excelFileName) {
|
|
1512
|
+
var excelBuffer;
|
|
1513
|
+
var myobj = { Sheets: {}, SheetNames: [] };
|
|
1514
|
+
for (var i = 0; i < json.length; i++) {
|
|
1515
|
+
var worksheet = XLSX.utils.json_to_sheet(json[i]);
|
|
1516
|
+
myobj.Sheets[this.tabName[i].name] = worksheet;
|
|
1517
|
+
myobj.SheetNames.push(this.tabName[i].name);
|
|
1518
|
+
}
|
|
1519
|
+
var workbook = myobj;
|
|
1520
|
+
excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
|
1521
|
+
this.saveAsExcelFile(excelBuffer, excelFileName);
|
|
1522
|
+
};
|
|
1523
|
+
ExceldataService.prototype.saveAsExcelFile = function (buffer, fileName) {
|
|
1524
|
+
var data = new Blob([buffer], {
|
|
1525
|
+
type: EXCEL_TYPE
|
|
1526
|
+
});
|
|
1527
|
+
FileSaver.saveAs(data, fileName + EXCEL_EXTENSION);
|
|
1528
|
+
};
|
|
1529
|
+
//_____FOR EXCEL CONVERTOR END
|
|
1458
1530
|
ExceldataService.prototype.genarateResourseReqiuredData_Excel = function (data) {
|
|
1459
1531
|
var resouseID;
|
|
1460
1532
|
var title;
|
|
@@ -1541,8 +1613,10 @@
|
|
|
1541
1613
|
title: title
|
|
1542
1614
|
};
|
|
1543
1615
|
resourceMetadataMatrix.push(resourceMetauserConsoleData);
|
|
1616
|
+
this.resourceTypes.push(type);
|
|
1544
1617
|
}
|
|
1545
1618
|
}
|
|
1619
|
+
this.resourceTypes = __spread(new Set(this.resourceTypes));
|
|
1546
1620
|
return resourceMetadataMatrix;
|
|
1547
1621
|
};
|
|
1548
1622
|
ExceldataService.prototype.genarateUserReqiuredData_Excel = function (data) {
|
|
@@ -1740,6 +1814,7 @@
|
|
|
1740
1814
|
return { usersMetadata: usersMetadataMatrix, schoolTerminalData: schoolTerminalMatrix, userConsoleData: userConsoleMatrix };
|
|
1741
1815
|
};
|
|
1742
1816
|
ExceldataService.prototype.deatilData_Excel = function (userConsoleMatrix, resourceMetadataMatrix) {
|
|
1817
|
+
// console.log("resourceMetadataMatrix",resourceMetadataMatrix);
|
|
1743
1818
|
var currentDate;
|
|
1744
1819
|
var resourceMatrixForExcel = new Array();
|
|
1745
1820
|
resourceMatrixForExcel = [];
|
|
@@ -1780,12 +1855,12 @@
|
|
|
1780
1855
|
var terminalIPAddress = terminalIP;
|
|
1781
1856
|
resourceMetadataIDs = userConsoleMatrix[i].resourceMetauserConsoleData;
|
|
1782
1857
|
if (resourceMetadataIDs.length == 0) {
|
|
1783
|
-
subject =
|
|
1784
|
-
grade =
|
|
1785
|
-
chapter =
|
|
1786
|
-
teachingpoint =
|
|
1787
|
-
resourceTitle =
|
|
1788
|
-
resourceType =
|
|
1858
|
+
subject = '';
|
|
1859
|
+
grade = '';
|
|
1860
|
+
chapter = '';
|
|
1861
|
+
teachingpoint = '';
|
|
1862
|
+
resourceTitle = '';
|
|
1863
|
+
resourceType = '';
|
|
1789
1864
|
resourceArrayForExcel = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, locationName, terminalIPAddress, subject, grade, chapter, teachingpoint, resourceTitle, resourceType, userID];
|
|
1790
1865
|
resourceMatrixForExcel.push(resourceArrayForExcel);
|
|
1791
1866
|
}
|
|
@@ -1809,26 +1884,22 @@
|
|
|
1809
1884
|
// FOR EXCEL
|
|
1810
1885
|
resourceArrayForExcel = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, locationName, terminalIPAddress, subject, grade, chapter, teachingpoint, resourceTitle, resourceType, userID];
|
|
1811
1886
|
resourceMatrixForExcel.push(resourceArrayForExcel);
|
|
1812
|
-
teacherName = undefined;
|
|
1813
|
-
teacherSubject = undefined;
|
|
1814
|
-
currentDate = undefined;
|
|
1815
|
-
startTime = undefined;
|
|
1816
|
-
endTime = undefined;
|
|
1817
|
-
duration = 0;
|
|
1818
|
-
roomDetail = undefined;
|
|
1819
1887
|
}
|
|
1820
1888
|
}
|
|
1821
1889
|
}
|
|
1822
1890
|
}
|
|
1823
1891
|
}
|
|
1824
1892
|
// console.log("resourceMatrixForExcel",[...new Set(resourceMatrixForExcel)]);
|
|
1893
|
+
// console.log("resourceMatrixForExcel",resourceMatrixForExcel);
|
|
1825
1894
|
return resourceMatrixForExcel;
|
|
1826
1895
|
};
|
|
1827
1896
|
ExceldataService.prototype.deatilUsage_Excel = function (resourceMatrixForExcel) {
|
|
1828
1897
|
var userList = [];
|
|
1898
|
+
// console.log("resourceMatrixForExcel>>>>>>>>>>>>>>>>>>>",resourceMatrixForExcel);
|
|
1829
1899
|
if (resourceMatrixForExcel.length > 0) {
|
|
1830
1900
|
for (var i = 0; i < resourceMatrixForExcel.length; i++) {
|
|
1831
1901
|
var data = {
|
|
1902
|
+
// Sr_No: i+1,
|
|
1832
1903
|
Name: resourceMatrixForExcel[i][0],
|
|
1833
1904
|
Subjects: resourceMatrixForExcel[i][1],
|
|
1834
1905
|
Date: resourceMatrixForExcel[i][2],
|
|
@@ -1847,19 +1918,24 @@
|
|
|
1847
1918
|
userList.push(data);
|
|
1848
1919
|
}
|
|
1849
1920
|
}
|
|
1921
|
+
// console.log("userList",userList);
|
|
1850
1922
|
return userList;
|
|
1851
1923
|
};
|
|
1852
1924
|
ExceldataService.prototype.userSummary_Excel = function (data, resourceMatrixForExcel) {
|
|
1925
|
+
// console.log("resourceMatrixForExcel",resourceMatrixForExcel)
|
|
1853
1926
|
var userMetadataList = data.usersMetadata.userMetadata;
|
|
1854
1927
|
var resourcelist = new Array();
|
|
1928
|
+
var resourceTypeList = new Array();
|
|
1855
1929
|
var userObjectList = new Array();
|
|
1856
1930
|
var classRooms = new Array();
|
|
1857
1931
|
var datesAccess = new Array();
|
|
1858
1932
|
var grades = new Array();
|
|
1859
1933
|
var subjectTought = new Array();
|
|
1934
|
+
// let unique_resourceTypeList = [];
|
|
1860
1935
|
var duration = 0;
|
|
1861
1936
|
for (var i = 0; i < userMetadataList.length; i++) {
|
|
1862
1937
|
resourcelist = [];
|
|
1938
|
+
resourceTypeList = [];
|
|
1863
1939
|
classRooms = [];
|
|
1864
1940
|
datesAccess = [];
|
|
1865
1941
|
grades = [];
|
|
@@ -1867,7 +1943,12 @@
|
|
|
1867
1943
|
duration = 0;
|
|
1868
1944
|
for (var j = 0; j < resourceMatrixForExcel.length; j++) {
|
|
1869
1945
|
if (userMetadataList[i].userId === resourceMatrixForExcel[j][14]) {
|
|
1870
|
-
|
|
1946
|
+
if (resourceMatrixForExcel[j][12] != '') {
|
|
1947
|
+
resourcelist.push(resourceMatrixForExcel[j][12]);
|
|
1948
|
+
}
|
|
1949
|
+
if (resourceMatrixForExcel[j][13] != '') {
|
|
1950
|
+
resourceTypeList.push(resourceMatrixForExcel[j][13]);
|
|
1951
|
+
}
|
|
1871
1952
|
duration = duration + resourceMatrixForExcel[j][5];
|
|
1872
1953
|
classRooms.push(resourceMatrixForExcel[j][6]);
|
|
1873
1954
|
datesAccess.push(resourceMatrixForExcel[j][2]);
|
|
@@ -1910,6 +1991,10 @@
|
|
|
1910
1991
|
else {
|
|
1911
1992
|
SubjectTought = '';
|
|
1912
1993
|
}
|
|
1994
|
+
// if(resourceTypeList.length>0){
|
|
1995
|
+
// unique_resourceTypeList = [...new Set(resourceTypeList)];
|
|
1996
|
+
// }
|
|
1997
|
+
// console.log("this.resourceTypes",this.resourceTypes)
|
|
1913
1998
|
var user = {
|
|
1914
1999
|
Name: userMetadataList[i].fullName,
|
|
1915
2000
|
Subjects: userMetadataList[i].userSubjects,
|
|
@@ -1919,35 +2004,31 @@
|
|
|
1919
2004
|
DayAccess: dayAccess,
|
|
1920
2005
|
Grades: Grades,
|
|
1921
2006
|
SubjectTought: SubjectTought,
|
|
1922
|
-
AseestUsed: resourcelist
|
|
2007
|
+
AseestUsed: resourcelist,
|
|
2008
|
+
AssetType: resourceTypeList
|
|
1923
2009
|
};
|
|
1924
2010
|
userObjectList.push(user);
|
|
1925
2011
|
}
|
|
1926
|
-
|
|
1927
|
-
var questionList = new Array();
|
|
1928
|
-
var whiteBoardList = new Array();
|
|
1929
|
-
var asset_printList = new Array();
|
|
2012
|
+
// console.log("userObjectList",userObjectList)
|
|
1930
2013
|
var userSummaryList = new Array();
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
questionList.push(userObjectList[i].AseestUsed[j]);
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
2014
|
+
var _loop_1 = function (i) {
|
|
2015
|
+
var Assetcounts = [];
|
|
2016
|
+
//find count of present asset type
|
|
2017
|
+
var presentAsset = userObjectList[i].AssetType;
|
|
2018
|
+
presentAsset = __spread(new Set(presentAsset));
|
|
2019
|
+
// console.log("presentAsset",presentAsset)
|
|
2020
|
+
//find count of present asset count
|
|
2021
|
+
var sampleArray = userObjectList[i].AssetType;
|
|
2022
|
+
sampleArray.forEach(function (x) { Assetcounts[x] = (Assetcounts[x] || 0) + 1; });
|
|
2023
|
+
// find missing assets
|
|
2024
|
+
var missingAssets = this_1.resourceTypes.filter(function (n) { return !presentAsset.includes(n); });
|
|
2025
|
+
// adding missing asset with count 0 in list
|
|
2026
|
+
missingAssets.forEach(function (element) {
|
|
2027
|
+
Assetcounts[element] = 0;
|
|
2028
|
+
});
|
|
2029
|
+
// console.log(Assetcounts);
|
|
1950
2030
|
var asset_media = {
|
|
2031
|
+
// Sr_No: i+1,
|
|
1951
2032
|
Name: userObjectList[i].Name,
|
|
1952
2033
|
Subjects_taught: userObjectList[i].Subjects,
|
|
1953
2034
|
Duration: userObjectList[i].duration,
|
|
@@ -1955,14 +2036,16 @@
|
|
|
1955
2036
|
DaysAccsessed: userObjectList[i].DayAccess,
|
|
1956
2037
|
DatesAccess: userObjectList[i].DatesAccess,
|
|
1957
2038
|
Grades: userObjectList[i].Grades,
|
|
1958
|
-
Subjects: userObjectList[i].SubjectTought
|
|
1959
|
-
asset_media_usage: asset_mediaList.length,
|
|
1960
|
-
asset_print_usage: asset_printList.length,
|
|
1961
|
-
whiteBoard_usage: whiteBoardList.length,
|
|
1962
|
-
question_usage: questionList.length
|
|
2039
|
+
Subjects: userObjectList[i].SubjectTought
|
|
1963
2040
|
};
|
|
1964
|
-
|
|
2041
|
+
var returnedTarget = Object.assign(asset_media, Assetcounts);
|
|
2042
|
+
userSummaryList.push(returnedTarget);
|
|
2043
|
+
};
|
|
2044
|
+
var this_1 = this;
|
|
2045
|
+
for (var i = 0; i < userObjectList.length; i++) {
|
|
2046
|
+
_loop_1(i);
|
|
1965
2047
|
}
|
|
2048
|
+
// console.log("userSummaryList",userSummaryList);
|
|
1966
2049
|
return userSummaryList;
|
|
1967
2050
|
};
|
|
1968
2051
|
return ExceldataService;
|
|
@@ -1994,7 +2077,9 @@
|
|
|
1994
2077
|
}
|
|
1995
2078
|
Object.defineProperty(HeaderComponent.prototype, "data", {
|
|
1996
2079
|
set: function (res) {
|
|
1997
|
-
|
|
2080
|
+
if (res !== null) {
|
|
2081
|
+
this.loadData(res);
|
|
2082
|
+
}
|
|
1998
2083
|
},
|
|
1999
2084
|
enumerable: false,
|
|
2000
2085
|
configurable: true
|
|
@@ -2006,6 +2091,7 @@
|
|
|
2006
2091
|
HeaderComponent.prototype.getDefaultDate = function () {
|
|
2007
2092
|
var date = new Date();
|
|
2008
2093
|
this.getDateFormat(date);
|
|
2094
|
+
this.todayDate = this.calenderCurrentDate;
|
|
2009
2095
|
};
|
|
2010
2096
|
HeaderComponent.prototype.dateSelected = function (e) {
|
|
2011
2097
|
this.getDateFormat(e);
|
|
@@ -2032,7 +2118,6 @@
|
|
|
2032
2118
|
}
|
|
2033
2119
|
var today = year + "-" + m + "-" + d;
|
|
2034
2120
|
this.currentDate = today;
|
|
2035
|
-
this.todayDate = today.split("-").reverse().join("-");
|
|
2036
2121
|
this.calenderCurrentDate = today.split("-").reverse().join("-");
|
|
2037
2122
|
};
|
|
2038
2123
|
// selectDate(e: any) {
|
|
@@ -2050,7 +2135,9 @@
|
|
|
2050
2135
|
HeaderComponent.prototype.refreshChart = function () {
|
|
2051
2136
|
this.stopTimer();
|
|
2052
2137
|
this.refreshTimer = 0;
|
|
2053
|
-
this.
|
|
2138
|
+
if (this.calenderCurrentDate === this.todayDate) {
|
|
2139
|
+
this.countDown();
|
|
2140
|
+
}
|
|
2054
2141
|
this.userSelectedDate.emit(this.calenderCurrentDate);
|
|
2055
2142
|
};
|
|
2056
2143
|
HeaderComponent.prototype.startTimer = function () {
|
|
@@ -2066,6 +2153,7 @@
|
|
|
2066
2153
|
};
|
|
2067
2154
|
HeaderComponent.prototype.countDown = function () {
|
|
2068
2155
|
var _this = this;
|
|
2156
|
+
console.log("countDown");
|
|
2069
2157
|
this.clearTimer();
|
|
2070
2158
|
this.intervalId = window.setInterval(function () {
|
|
2071
2159
|
_this.refreshTimer -= 1;
|
|
@@ -2106,6 +2194,10 @@
|
|
|
2106
2194
|
var schoolDetails = this.mydata.schoolMetadata.school;
|
|
2107
2195
|
var userDetails = userDetails_data;
|
|
2108
2196
|
var terminalDetails = this.mydata.schoolTerminals.schoolTerminal;
|
|
2197
|
+
// console.log("schoolDetails",schoolDetails);
|
|
2198
|
+
// console.log("UserSummary",UserSummary);
|
|
2199
|
+
// console.log("terminalDetails",terminalDetails);
|
|
2200
|
+
// console.log("userDetails",userDetails);
|
|
2109
2201
|
this.dataList = [
|
|
2110
2202
|
[schoolDetails],
|
|
2111
2203
|
UserSummary,
|
|
@@ -2117,7 +2209,7 @@
|
|
|
2117
2209
|
};
|
|
2118
2210
|
HeaderComponent.prototype.exportReport = function () {
|
|
2119
2211
|
if (this.mydata) {
|
|
2120
|
-
this.
|
|
2212
|
+
this.excelService.exportAsExcelFile(this.dataList, 'UsageReport-' + this.calenderCurrentDate);
|
|
2121
2213
|
}
|
|
2122
2214
|
};
|
|
2123
2215
|
HeaderComponent.prototype.ngOnDestroy = function () {
|
|
@@ -2128,7 +2220,7 @@
|
|
|
2128
2220
|
HeaderComponent.decorators = [
|
|
2129
2221
|
{ type: i0.Component, args: [{
|
|
2130
2222
|
selector: 'lib-header',
|
|
2131
|
-
template: "<div id=\"pd_header\" class=\"pd_header\">\r\n \r\n <div *ngIf=\"message && (this.todayDate === this.calenderCurrentDate)\" id=\"pd_refeshView\" class=\"pd_refesh_bar\">\r\n <div class=\"timer_msg\"> This page will be refreshed in</div>\r\n <div class=\"timer_value\"> {{timeConvert(message)}} min</div>\r\n <div id=\"pd_refeshBtn\" (click)=\"refreshChart()\"> Refresh </div>\r\n </div>\r\n\r\n <div id=\"pd_exportBtn\" class=\"pd_exportButton\"\r\n [ngClass]=\"{'pd_exportButton_shiftRight': this.todayDate != this.calenderCurrentDate}\" (click)=\"exportReport()\"> \r\n <span class=\"pd_exportButton_text\">Export usage report</span>\r\n <div class=\"pd_download_icon\"></div>\r\n </div>\r\n \r\n <div class=\"pd_header_calendar\">\r\n <!-- <input type=\"Date\" [max]=\"currentDate\" [value]=\"currentDate\" id=\"myCalendar\" (input)=\"selectDate($event)\" /> -->\r\n <ngx-datepicker [(ngModel)]=\"date\" [options]=\"options\" (ngModelChange)=\"dateSelected($event)\"></ngx-datepicker>\r\n </div>\r\n <div class=\"pd_header_content\" >Realtime usage data</div>\r\n</div>\r\n",
|
|
2223
|
+
template: "<div id=\"pd_header\" class=\"pd_header\">\r\n \r\n <div *ngIf=\"message && mydata && (this.todayDate === this.calenderCurrentDate)\" id=\"pd_refeshView\" class=\"pd_refesh_bar\">\r\n <div class=\"timer_msg\"> This page will be refreshed in</div>\r\n <div class=\"timer_value\"> {{timeConvert(message)}} min</div>\r\n <div id=\"pd_refeshBtn\" (click)=\"refreshChart()\"> Refresh </div>\r\n </div>\r\n\r\n <div id=\"pd_exportBtn\" class=\"pd_exportButton\" *ngIf=\"mydata\"\r\n [ngClass]=\"{'pd_exportButton_shiftRight': this.todayDate != this.calenderCurrentDate}\" (click)=\"exportReport()\"> \r\n <span class=\"pd_exportButton_text\">Export usage report</span>\r\n <div class=\"pd_download_icon\"></div>\r\n </div>\r\n \r\n <div class=\"pd_header_calendar\">\r\n <!-- <input type=\"Date\" [max]=\"currentDate\" [value]=\"currentDate\" id=\"myCalendar\" (input)=\"selectDate($event)\" /> -->\r\n <ngx-datepicker [(ngModel)]=\"date\" [options]=\"options\" (ngModelChange)=\"dateSelected($event)\"></ngx-datepicker>\r\n </div>\r\n <div class=\"pd_header_content\" >Realtime usage data</div>\r\n</div>\r\n",
|
|
2132
2224
|
styles: [".pd_header{width:100%;background-color:#e0e0e0;height:50px;border-bottom:2px solid #fff}.pd_header_calendar{position:absolute;width:150px;margin:5px 5px 5px 17px}.pd_header_content{position:relative;width:350px;margin:0 auto;color:#000;text-align:center;font-size:30px;line-height:50px;pointer-events:none}.pd_exportButton{position:absolute;display:inline-block;right:144px;padding:0 16px;cursor:pointer;margin:9px 0 0;height:30px;width:160px;line-height:30px;background-color:#c4c4c4;font-size:10pt;font-weight:400;transition:right .5s}.pd_exportButton_shiftRight{right:10px}.pd_download_icon{position:absolute;width:16px;height:16px;background-size:100% 100%;top:8px;background-repeat:no-repeat;display:inline-block;right:5px;background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAAY0lEQVRIiWNgGOqAkQS1/8nRy0SCBWSBUQtGLRjiFpQzQDIXDKMDZLl6ch2Abgk2TLbhxFhCseH4LKGa4dgsIdpwZhIsOMoAKUEPMjAwNJLktFGADyDXStgyE8Vm07yoGPoAAH1UItbw1O5lAAAAAElFTkSuQmCC\")}.pd_exportButton_text{position:relative;display:inline-block;width:130px}.pd_refesh_bar{position:absolute;color:#000;width:120px;height:78px;right:15px;top:4px;z-index:2;background-color:#fff;float:right;text-align:center;font-size:12px;border-radius:.25rem;border:1px solid #a09898;box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-animation:refreshViewAnimate .6s;animation:refreshViewAnimate .6s}@-webkit-keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}@keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}.timer_msg{position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:14px;top:2px}.timer_value{font-weight:700;font-size:15px}#pd_refeshBtn,.timer_value{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;top:28px}#pd_refeshBtn{background-color:#2172f6;cursor:pointer;width:60px;margin:0 auto;border-radius:3px;color:#fff;height:22px;line-height:20px}#pd_refeshBtn:hover{opacity:.6}::ng-deep.bs-datepicker{margin-left:200px}.bs-datepicker-body table td span.selected,.theme-default .bs-datepicker-body table td.selected span,.theme-default .bs-datepicker-body table td[class*=select-] span:after,.theme-default .bs-datepicker-body table td span[class*=select-]:after{background-color:#000}.bs-datepicker-head{background-color:#000!important}"]
|
|
2133
2225
|
},] }
|
|
2134
2226
|
];
|
|
@@ -2149,7 +2241,9 @@
|
|
|
2149
2241
|
}
|
|
2150
2242
|
Object.defineProperty(TableviewComponent.prototype, "data", {
|
|
2151
2243
|
set: function (res) {
|
|
2152
|
-
|
|
2244
|
+
if (res !== null) {
|
|
2245
|
+
this.loadTable(res);
|
|
2246
|
+
}
|
|
2153
2247
|
},
|
|
2154
2248
|
enumerable: false,
|
|
2155
2249
|
configurable: true
|
|
@@ -2163,11 +2257,11 @@
|
|
|
2163
2257
|
if (response) {
|
|
2164
2258
|
this.myXmlData = JSON.parse(response);
|
|
2165
2259
|
if (this.myXmlData) {
|
|
2166
|
-
//get current data list
|
|
2260
|
+
// get current data list
|
|
2167
2261
|
var genarateUserReqiuredData = this.pdService.genarateUserReqiuredData(this.myXmlData);
|
|
2168
2262
|
this.currentdataList = genarateUserReqiuredData.userConsoleData;
|
|
2169
|
-
//
|
|
2170
|
-
var fetchAlluserList = this.pdService.allUserChartData(
|
|
2263
|
+
// get all user list
|
|
2264
|
+
var fetchAlluserList = this.pdService.allUserChartData();
|
|
2171
2265
|
this.alluserList = fetchAlluserList.fordurationTable;
|
|
2172
2266
|
// resoureMetadata list
|
|
2173
2267
|
this.currentResoursedataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
|