@hed-hog/core 0.0.169 → 0.0.170
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/dist/dashboard/dashboard/dashboard.controller.d.ts +3 -15
- package/dist/dashboard/dashboard/dashboard.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dashboard.service.d.ts +3 -15
- package/dist/dashboard/dashboard/dashboard.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +6 -78
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.controller.js +8 -6
- package/dist/dashboard/dashboard-component/dashboard-component.controller.js.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +3 -79
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.service.js +55 -13
- package/dist/dashboard/dashboard-component/dashboard-component.service.js.map +1 -1
- package/dist/dashboard/dashboard-component/dto/create.dto.d.ts +0 -4
- package/dist/dashboard/dashboard-component/dto/create.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dto/create.dto.js +0 -19
- package/dist/dashboard/dashboard-component/dto/create.dto.js.map +1 -1
- package/dist/dashboard/dashboard-component/dto/update.dto.d.ts +0 -4
- package/dist/dashboard/dashboard-component/dto/update.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dto/update.dto.js +0 -20
- package/dist/dashboard/dashboard-component/dto/update.dto.js.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +36 -22
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.controller.js +0 -9
- package/dist/dashboard/dashboard-core/dashboard-core.controller.js.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +36 -22
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.service.js +123 -51
- package/dist/dashboard/dashboard-core/dashboard-core.service.js.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +0 -4
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +0 -4
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts.map +1 -1
- package/hedhog/data/dashboard_component.yaml +16 -16
- package/hedhog/data/dashboard_component_role.yaml +48 -0
- package/hedhog/data/dashboard_item.yaml +28 -28
- package/hedhog/data/menu.yaml +3 -3
- package/hedhog/table/dashboard_component_role.yaml +16 -0
- package/package.json +2 -2
- package/src/dashboard/dashboard-component/dashboard-component.controller.ts +9 -5
- package/src/dashboard/dashboard-component/dashboard-component.service.ts +64 -14
- package/src/dashboard/dashboard-component/dto/create.dto.ts +0 -15
- package/src/dashboard/dashboard-component/dto/update.dto.ts +0 -16
- package/src/dashboard/dashboard-core/dashboard-core.controller.ts +0 -5
- package/src/dashboard/dashboard-core/dashboard-core.service.ts +152 -54
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-component.service.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"dashboard-component.service.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,4DAA2E;AAC3E,oDAAoD;AACpD,2CAKwB;AAMjB,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,gBAAgB,CAA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U,CAAC,IAAI;4BACrB,WAAW,EAAE,UAAU,CAAC,WAAW,IAAI,EAAE;yBAC1C;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAU,EAAE,MAAc;QAC9C,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,UAAU,CAAC;YACxE,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,0BAAiB,CACzB,IAAA,0BAAa,EAAC,4BAA4B,EAAE,MAAM,EAAE,+BAA+B,CAAC,CACrF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC;YACnD,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA7NY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kCAAiB,CAAC,CAAC,CAAA;qCADZ,0BAAa;QAET,kCAAiB;GAL5C,yBAAyB,CA6NrC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare class CreateDTO {
|
|
2
2
|
slug: string;
|
|
3
|
-
path: string;
|
|
4
3
|
min_width?: number;
|
|
5
4
|
max_width?: number;
|
|
6
5
|
min_height?: number;
|
|
@@ -8,9 +7,6 @@ export declare class CreateDTO {
|
|
|
8
7
|
width: number;
|
|
9
8
|
height: number;
|
|
10
9
|
is_resizable?: boolean;
|
|
11
|
-
stat_key?: string;
|
|
12
|
-
icon?: string;
|
|
13
|
-
color?: string;
|
|
14
10
|
locale: Record<string, {
|
|
15
11
|
name: string;
|
|
16
12
|
description?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/create.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS;IAEpB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/create.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS;IAEpB,IAAI,EAAE,MAAM,CAAC;IAIb,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,MAAM,CAAC;IAIf,YAAY,CAAC,EAAE,OAAO,CAAC;IASvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE"}
|
|
@@ -19,10 +19,6 @@ __decorate([
|
|
|
19
19
|
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
20
20
|
__metadata("design:type", String)
|
|
21
21
|
], CreateDTO.prototype, "slug", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], CreateDTO.prototype, "path", void 0);
|
|
26
22
|
__decorate([
|
|
27
23
|
(0, class_validator_1.IsOptional)(),
|
|
28
24
|
(0, class_validator_1.IsNumber)({}, { message: (args) => (0, api_locale_1.getLocaleText)('validation.numberRequired', args.value) }),
|
|
@@ -56,21 +52,6 @@ __decorate([
|
|
|
56
52
|
(0, class_validator_1.IsBoolean)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.booleanRequired', args.value) }),
|
|
57
53
|
__metadata("design:type", Boolean)
|
|
58
54
|
], CreateDTO.prototype, "is_resizable", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, class_validator_1.IsOptional)(),
|
|
61
|
-
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], CreateDTO.prototype, "stat_key", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, class_validator_1.IsOptional)(),
|
|
66
|
-
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
67
|
-
__metadata("design:type", String)
|
|
68
|
-
], CreateDTO.prototype, "icon", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
(0, class_validator_1.IsOptional)(),
|
|
71
|
-
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
72
|
-
__metadata("design:type", String)
|
|
73
|
-
], CreateDTO.prototype, "color", void 0);
|
|
74
55
|
__decorate([
|
|
75
56
|
(0, class_validator_1.IsObject)({
|
|
76
57
|
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeMustBeObject', args.value),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,qDAAkG;AAElG,MAAa,SAAS;
|
|
1
|
+
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/create.dto.ts"],"names":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Q,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;yCAC7E;AAIf;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,4BAA4B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;+CACnE;AASvB;IAPC,IAAA,0BAAQ,EAAC;QACR,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,IAAA,0BAAa,EAAC,+BAA+B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC7D,CAAC;IACD,IAAA,4BAAU,EAAC;QACV,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;yCAC6D"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare class UpdateDTO {
|
|
2
2
|
slug?: string;
|
|
3
|
-
path?: string;
|
|
4
3
|
min_width?: number;
|
|
5
4
|
max_width?: number;
|
|
6
5
|
min_height?: number;
|
|
@@ -8,9 +7,6 @@ export declare class UpdateDTO {
|
|
|
8
7
|
width?: number;
|
|
9
8
|
height?: number;
|
|
10
9
|
is_resizable?: boolean;
|
|
11
|
-
stat_key?: string;
|
|
12
|
-
icon?: string;
|
|
13
|
-
color?: string;
|
|
14
10
|
locale?: Record<string, {
|
|
15
11
|
name: string;
|
|
16
12
|
description?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/update.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS;IAGpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,
|
|
1
|
+
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/update.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS;IAGpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,YAAY,CAAC,EAAE,OAAO,CAAC;IAUvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjE"}
|
|
@@ -20,11 +20,6 @@ __decorate([
|
|
|
20
20
|
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
21
21
|
__metadata("design:type", String)
|
|
22
22
|
], UpdateDTO.prototype, "slug", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, class_validator_1.IsOptional)(),
|
|
25
|
-
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], UpdateDTO.prototype, "path", void 0);
|
|
28
23
|
__decorate([
|
|
29
24
|
(0, class_validator_1.IsOptional)(),
|
|
30
25
|
(0, class_validator_1.IsNumber)({}, { message: (args) => (0, api_locale_1.getLocaleText)('validation.numberRequired', args.value) }),
|
|
@@ -60,21 +55,6 @@ __decorate([
|
|
|
60
55
|
(0, class_validator_1.IsBoolean)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.booleanRequired', args.value) }),
|
|
61
56
|
__metadata("design:type", Boolean)
|
|
62
57
|
], UpdateDTO.prototype, "is_resizable", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
(0, class_validator_1.IsOptional)(),
|
|
65
|
-
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
66
|
-
__metadata("design:type", String)
|
|
67
|
-
], UpdateDTO.prototype, "stat_key", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
(0, class_validator_1.IsOptional)(),
|
|
70
|
-
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
71
|
-
__metadata("design:type", String)
|
|
72
|
-
], UpdateDTO.prototype, "icon", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
(0, class_validator_1.IsOptional)(),
|
|
75
|
-
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
76
|
-
__metadata("design:type", String)
|
|
77
|
-
], UpdateDTO.prototype, "color", void 0);
|
|
78
58
|
__decorate([
|
|
79
59
|
(0, class_validator_1.IsOptional)(),
|
|
80
60
|
(0, class_validator_1.IsObject)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,qDAAkG;AAElG,MAAa,SAAS;
|
|
1
|
+
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,qDAAkG;AAElG,MAAa,SAAS;CA0CrB;AA1CD,8BA0CC;AAvCC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;u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2BAAS,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,4BAA4B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;+CACnE;AAUvB;IARC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC;QACR,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,IAAA,0BAAa,EAAC,+BAA+B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC7D,CAAC;IACD,IAAA,4BAAU,EAAC;QACV,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;yCAC8D"}
|
|
@@ -7,28 +7,24 @@ export declare class DashboardCoreController {
|
|
|
7
7
|
dashboard_component_locale: {
|
|
8
8
|
name: string;
|
|
9
9
|
id: number;
|
|
10
|
-
description: string
|
|
10
|
+
description: string;
|
|
11
11
|
created_at: Date;
|
|
12
12
|
updated_at: Date;
|
|
13
13
|
locale_id: number;
|
|
14
14
|
dashboard_component_id: number;
|
|
15
15
|
}[];
|
|
16
16
|
} & {
|
|
17
|
-
path: string;
|
|
18
17
|
width: number;
|
|
19
18
|
id: number;
|
|
20
19
|
created_at: Date;
|
|
21
20
|
updated_at: Date;
|
|
22
21
|
slug: string;
|
|
23
|
-
icon: string | null;
|
|
24
|
-
color: string | null;
|
|
25
22
|
min_width: number;
|
|
26
23
|
max_width: number | null;
|
|
27
24
|
min_height: number;
|
|
28
25
|
max_height: number | null;
|
|
29
26
|
height: number;
|
|
30
27
|
is_resizable: boolean;
|
|
31
|
-
stat_key: string | null;
|
|
32
28
|
};
|
|
33
29
|
dashboard_user: {
|
|
34
30
|
width: number;
|
|
@@ -53,20 +49,42 @@ export declare class DashboardCoreController {
|
|
|
53
49
|
y_axis: number;
|
|
54
50
|
})[]>;
|
|
55
51
|
getStatistics(): Promise<{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
cards: {
|
|
53
|
+
sessionsToday: {
|
|
54
|
+
value: number;
|
|
55
|
+
change: number;
|
|
56
|
+
};
|
|
57
|
+
activeUsers: {
|
|
58
|
+
value: number;
|
|
59
|
+
change: number;
|
|
60
|
+
};
|
|
61
|
+
emailsSent: {
|
|
62
|
+
value: number;
|
|
63
|
+
change: number;
|
|
64
|
+
};
|
|
65
|
+
roles: {
|
|
66
|
+
value: number;
|
|
67
|
+
change: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
charts: {
|
|
71
|
+
emailsPerWeek: {
|
|
72
|
+
day: string;
|
|
73
|
+
sent: number;
|
|
74
|
+
}[];
|
|
75
|
+
permissionDistribution: {
|
|
76
|
+
name: string;
|
|
77
|
+
value: number;
|
|
78
|
+
color: string;
|
|
79
|
+
}[];
|
|
80
|
+
sessionActivity: any[];
|
|
81
|
+
userGrowth: {
|
|
82
|
+
month: string;
|
|
83
|
+
users: number;
|
|
84
|
+
sessions: number;
|
|
85
|
+
}[];
|
|
86
|
+
};
|
|
65
87
|
}>;
|
|
66
|
-
getUserGrowth(): Promise<{
|
|
67
|
-
date: Date;
|
|
68
|
-
count: number;
|
|
69
|
-
}[]>;
|
|
70
88
|
getUserLayout(user: any, slug: string, locale: string): Promise<{
|
|
71
89
|
i: string;
|
|
72
90
|
component_id: number;
|
|
@@ -106,10 +124,6 @@ export declare class DashboardCoreController {
|
|
|
106
124
|
slug: string;
|
|
107
125
|
name: any;
|
|
108
126
|
description: any;
|
|
109
|
-
path: string;
|
|
110
|
-
icon: any;
|
|
111
|
-
stat_key: any;
|
|
112
|
-
color: any;
|
|
113
127
|
x: number;
|
|
114
128
|
y: number;
|
|
115
129
|
w: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-core.controller.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,qBAEa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,oBAAoB;IAGvE,QAAQ,CAAgB,IAAI,EAAE,MAAM,EAAY,MAAM,KAAA
|
|
1
|
+
{"version":3,"file":"dashboard-core.controller.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,qBAEa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,oBAAoB;IAGvE,QAAQ,CAAgB,IAAI,EAAE,MAAM,EAAY,MAAM,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKtD,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKb,aAAa,CAAS,IAAI,KAAA,EAAiB,IAAI,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;IAKjF,cAAc,CACJ,IAAI,KAAA,EACG,IAAI,EAAE,MAAM,EACnB,IAAI,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;;;IAM5F,SAAS,CACC,IAAI,KAAA,EACG,IAAI,EAAE,MAAM,EACnB,IAAI,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,EAC7B,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;IAW1B,YAAY,CACF,IAAI,KAAA,EACG,IAAI,EAAE,MAAM,EACR,QAAQ,EAAE,MAAM;;;CAQtC"}
|
|
@@ -27,9 +27,6 @@ let DashboardCoreController = class DashboardCoreController {
|
|
|
27
27
|
getStatistics() {
|
|
28
28
|
return this.dashboardCoreService.getStatistics();
|
|
29
29
|
}
|
|
30
|
-
getUserGrowth() {
|
|
31
|
-
return this.dashboardCoreService.getUserGrowth();
|
|
32
|
-
}
|
|
33
30
|
getUserLayout(user, slug, locale) {
|
|
34
31
|
return this.dashboardCoreService.getUserLayout(user.id, slug, locale);
|
|
35
32
|
}
|
|
@@ -58,12 +55,6 @@ __decorate([
|
|
|
58
55
|
__metadata("design:paramtypes", []),
|
|
59
56
|
__metadata("design:returntype", void 0)
|
|
60
57
|
], DashboardCoreController.prototype, "getStatistics", null);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, common_1.Get)('stats/user-growth'),
|
|
63
|
-
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", []),
|
|
65
|
-
__metadata("design:returntype", void 0)
|
|
66
|
-
], DashboardCoreController.prototype, "getUserGrowth", null);
|
|
67
58
|
__decorate([
|
|
68
59
|
(0, common_1.Get)('layout/:slug'),
|
|
69
60
|
__param(0, (0, api_1.User)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-core.controller.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA0C;AAC1C,oDAA6C;AAC7C,2CAA4E;AAC5E,qEAAgE;AAIzD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAG3E,QAAQ,CAAgB,IAAY,EAAY,MAAM;QACpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAGD,aAAa;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE,CAAC;IACnD,CAAC;IAGD,aAAa
|
|
1
|
+
{"version":3,"file":"dashboard-core.controller.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA0C;AAC1C,oDAA6C;AAC7C,2CAA4E;AAC5E,qEAAgE;AAIzD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAG3E,QAAQ,CAAgB,IAAY,EAAY,MAAM;QACpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAGD,aAAa;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE,CAAC;IACnD,CAAC;IAGD,aAAa,CAAS,IAAI,EAAiB,IAAY,EAAY,MAAc;QAC/E,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAGD,cAAc,CACJ,IAAI,EACG,IAAY,EACnB,IAAkF;QAE1F,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9E,CAAC;IAGD,SAAS,CACC,IAAI,EACG,IAAY,EACnB,IAA+B,EAC7B,MAAc;QAExB,OAAO,IAAI,CAAC,oBAAoB,CAAC,wBAAwB,CACvD,IAAI,CAAC,EAAE,EACP,IAAI,EACJ,IAAI,CAAC,aAAa,EAClB,MAAM,CACP,CAAC;IACJ,CAAC;IAGD,YAAY,CACF,IAAI,EACG,IAAY,EACR,QAAgB;QAEnC,OAAO,IAAI,CAAC,oBAAoB,CAA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{
|
|
8
8
|
name: string;
|
|
9
9
|
id: number;
|
|
10
|
-
description: string
|
|
10
|
+
description: string;
|
|
11
11
|
created_at: Date;
|
|
12
12
|
updated_at: Date;
|
|
13
13
|
locale_id: number;
|
|
14
14
|
dashboard_component_id: number;
|
|
15
15
|
}[];
|
|
16
16
|
} & {
|
|
17
|
-
path: string;
|
|
18
17
|
width: number;
|
|
19
18
|
id: number;
|
|
20
19
|
created_at: Date;
|
|
21
20
|
updated_at: Date;
|
|
22
21
|
slug: string;
|
|
23
|
-
icon: string | null;
|
|
24
|
-
color: string | null;
|
|
25
22
|
min_width: number;
|
|
26
23
|
max_width: number | null;
|
|
27
24
|
min_height: number;
|
|
28
25
|
max_height: number | null;
|
|
29
26
|
height: number;
|
|
30
27
|
is_resizable: boolean;
|
|
31
|
-
stat_key: string | null;
|
|
32
28
|
};
|
|
33
29
|
dashboard_user: {
|
|
34
30
|
width: number;
|
|
@@ -53,20 +49,42 @@ export declare class DashboardCoreService {
|
|
|
53
49
|
y_axis: number;
|
|
54
50
|
})[]>;
|
|
55
51
|
getStatistics(): Promise<{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
cards: {
|
|
53
|
+
sessionsToday: {
|
|
54
|
+
value: number;
|
|
55
|
+
change: number;
|
|
56
|
+
};
|
|
57
|
+
activeUsers: {
|
|
58
|
+
value: number;
|
|
59
|
+
change: number;
|
|
60
|
+
};
|
|
61
|
+
emailsSent: {
|
|
62
|
+
value: number;
|
|
63
|
+
change: number;
|
|
64
|
+
};
|
|
65
|
+
roles: {
|
|
66
|
+
value: number;
|
|
67
|
+
change: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
charts: {
|
|
71
|
+
emailsPerWeek: {
|
|
72
|
+
day: string;
|
|
73
|
+
sent: number;
|
|
74
|
+
}[];
|
|
75
|
+
permissionDistribution: {
|
|
76
|
+
name: string;
|
|
77
|
+
value: number;
|
|
78
|
+
color: string;
|
|
79
|
+
}[];
|
|
80
|
+
sessionActivity: any[];
|
|
81
|
+
userGrowth: {
|
|
82
|
+
month: string;
|
|
83
|
+
users: number;
|
|
84
|
+
sessions: number;
|
|
85
|
+
}[];
|
|
86
|
+
};
|
|
65
87
|
}>;
|
|
66
|
-
getUserGrowth(): Promise<{
|
|
67
|
-
date: Date;
|
|
68
|
-
count: number;
|
|
69
|
-
}[]>;
|
|
70
88
|
getUserLayout(userId: number, slug: string, localeCode: string): Promise<{
|
|
71
89
|
i: string;
|
|
72
90
|
component_id: number;
|
|
@@ -102,10 +120,6 @@ export declare class DashboardCoreService {
|
|
|
102
120
|
slug: string;
|
|
103
121
|
name: any;
|
|
104
122
|
description: any;
|
|
105
|
-
path: string;
|
|
106
|
-
icon: any;
|
|
107
|
-
stat_key: any;
|
|
108
|
-
color: any;
|
|
109
123
|
x: number;
|
|
110
124
|
y: number;
|
|
111
125
|
w: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-core.service.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAEnD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"dashboard-core.service.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAEnD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoBnC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoKb,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;IA6D9D,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,KAAK,CAAC;QACZ,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;;;IA4DE,wBAAwB,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;IA6Gd,6BAA6B,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM;;;CAYnB"}
|
|
@@ -37,60 +37,136 @@ let DashboardCoreService = class DashboardCoreService {
|
|
|
37
37
|
}
|
|
38
38
|
async getStatistics() {
|
|
39
39
|
const now = new Date();
|
|
40
|
+
const todayStart = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
40
41
|
const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
where: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
totalUsers,
|
|
65
|
-
recentUsers,
|
|
66
|
-
activeUsers,
|
|
67
|
-
totalRoles,
|
|
68
|
-
totalMenus,
|
|
69
|
-
totalRoutes,
|
|
70
|
-
totalModules,
|
|
71
|
-
totalSettings,
|
|
72
|
-
totalContacts,
|
|
42
|
+
const twelveMonthsAgo = new Date(now.getFullYear() - 1, now.getMonth(), 1);
|
|
43
|
+
const currentMonthStart = new Date(now.getFullYear(), now.getMonth(), 1);
|
|
44
|
+
const lastMonthStart = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
|
45
|
+
const lastMonthEnd = new Date(now.getFullYear(), now.getMonth(), 0, 23, 59, 59);
|
|
46
|
+
const [sessionsTodayCount, activeUsersCount, emailsSentCount, rolesCount, sessionsCurrentMonth, usersCurrentMonth, emailsCurrentMonth, rolesCurrentMonth, sessionsLastMonth, usersLastMonth, emailsLastMonth, rolesLastMonth,] = await Promise.all([
|
|
47
|
+
this.prismaService.user_session.count({ where: { created_at: { gte: todayStart } } }),
|
|
48
|
+
this.prismaService.user.count(),
|
|
49
|
+
this.prismaService.mail_sent.count(),
|
|
50
|
+
this.prismaService.role.count(),
|
|
51
|
+
this.prismaService.user_session.count({ where: { created_at: { gte: currentMonthStart } } }),
|
|
52
|
+
this.prismaService.user.count({ where: { created_at: { gte: currentMonthStart } } }),
|
|
53
|
+
this.prismaService.mail_sent.count({ where: { created_at: { gte: currentMonthStart } } }),
|
|
54
|
+
this.prismaService.role.count({ where: { created_at: { gte: currentMonthStart } } }),
|
|
55
|
+
this.prismaService.user_session.count({ where: { created_at: { gte: lastMonthStart, lte: lastMonthEnd } } }),
|
|
56
|
+
this.prismaService.user.count({ where: { created_at: { gte: lastMonthStart, lte: lastMonthEnd } } }),
|
|
57
|
+
this.prismaService.mail_sent.count({ where: { created_at: { gte: lastMonthStart, lte: lastMonthEnd } } }),
|
|
58
|
+
this.prismaService.role.count({ where: { created_at: { gte: lastMonthStart, lte: lastMonthEnd } } }),
|
|
59
|
+
]);
|
|
60
|
+
const calculateChange = (current, previous) => {
|
|
61
|
+
if (previous === 0) {
|
|
62
|
+
return current === 0 ? 0 : 100;
|
|
63
|
+
}
|
|
64
|
+
return Number((((current - previous) / previous) * 100).toFixed(1));
|
|
73
65
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
SELECT
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
const sessionsChange = calculateChange(sessionsCurrentMonth, sessionsLastMonth);
|
|
67
|
+
const usersChange = calculateChange(usersCurrentMonth, usersLastMonth);
|
|
68
|
+
const emailsChange = calculateChange(emailsCurrentMonth, emailsLastMonth);
|
|
69
|
+
const rolesChange = calculateChange(rolesCurrentMonth, rolesLastMonth);
|
|
70
|
+
const emailsPerWeek = await this.prismaService.$queryRaw `
|
|
71
|
+
SELECT
|
|
72
|
+
DATE("created_at") as day,
|
|
73
|
+
COUNT(*) as sent
|
|
74
|
+
FROM "mail_sent"
|
|
75
|
+
WHERE "created_at" >= ${sevenDaysAgo}
|
|
82
76
|
GROUP BY DATE("created_at")
|
|
83
|
-
ORDER BY
|
|
77
|
+
ORDER BY day ASC
|
|
78
|
+
`;
|
|
79
|
+
const weekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
80
|
+
const emailWeekData = emailsPerWeek.map((item) => {
|
|
81
|
+
const dayOfWeek = new Date(item.day).getDay();
|
|
82
|
+
return {
|
|
83
|
+
day: weekDays[dayOfWeek],
|
|
84
|
+
sent: Number(item.sent),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
const permissionDistribution = await this.prismaService.$queryRaw `
|
|
88
|
+
SELECT
|
|
89
|
+
r.slug as name,
|
|
90
|
+
COUNT(ru.user_id) as value
|
|
91
|
+
FROM "role" r
|
|
92
|
+
LEFT JOIN "role_user" ru ON r.id = ru.role_id
|
|
93
|
+
GROUP BY r.id, r.slug
|
|
94
|
+
ORDER BY value DESC
|
|
84
95
|
`;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
const colors = ['#6366f1', '#10b981', '#f59e0b', '#8b5cf6', '#ec4899', '#14b8a6'];
|
|
97
|
+
const permissionsData = permissionDistribution.map((item, index) => ({
|
|
98
|
+
name: item.name,
|
|
99
|
+
value: Number(item.value),
|
|
100
|
+
color: colors[index % colors.length],
|
|
88
101
|
}));
|
|
102
|
+
const sessionActivity = await this.prismaService.$queryRaw `
|
|
103
|
+
SELECT
|
|
104
|
+
FLOOR(EXTRACT(HOUR FROM "created_at" AT TIME ZONE 'America/Sao_Paulo') / 2) * 2 as hour,
|
|
105
|
+
COUNT(CASE WHEN "expires_at" > NOW() THEN 1 END) as active,
|
|
106
|
+
COUNT(CASE WHEN "expires_at" <= NOW() THEN 1 END) as expired
|
|
107
|
+
FROM "user_session"
|
|
108
|
+
WHERE "created_at" >= ${todayStart}
|
|
109
|
+
GROUP BY FLOOR(EXTRACT(HOUR FROM "created_at" AT TIME ZONE 'America/Sao_Paulo') / 2)
|
|
110
|
+
ORDER BY hour ASC
|
|
111
|
+
`;
|
|
112
|
+
const sessionActivityData = [];
|
|
113
|
+
for (let h = 0; h < 24; h += 2) {
|
|
114
|
+
const found = sessionActivity.find((s) => Number(s.hour) === h);
|
|
115
|
+
sessionActivityData.push({
|
|
116
|
+
hour: `${h.toString().padStart(2, '0')}h`,
|
|
117
|
+
active: found ? Number(found.active) : 0,
|
|
118
|
+
expired: found ? Number(found.expired) : 0,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const userGrowth = await this.prismaService.$queryRaw `
|
|
122
|
+
SELECT
|
|
123
|
+
DATE_TRUNC('month', u."created_at") as month,
|
|
124
|
+
COUNT(DISTINCT u.id) as users,
|
|
125
|
+
COUNT(s.id) as sessions
|
|
126
|
+
FROM "user" u
|
|
127
|
+
LEFT JOIN "user_session" s ON u.id = s.user_id AND DATE_TRUNC('month', u."created_at") = DATE_TRUNC('month', s."created_at")
|
|
128
|
+
WHERE u."created_at" >= ${twelveMonthsAgo}
|
|
129
|
+
GROUP BY DATE_TRUNC('month', u."created_at")
|
|
130
|
+
ORDER BY month ASC
|
|
131
|
+
`;
|
|
132
|
+
const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
133
|
+
const userGrowthData = userGrowth.map((item) => {
|
|
134
|
+
const monthIndex = new Date(item.month).getMonth() + 1;
|
|
135
|
+
return {
|
|
136
|
+
month: monthNames[monthIndex],
|
|
137
|
+
users: Number(item.users),
|
|
138
|
+
sessions: Number(item.sessions),
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
return {
|
|
142
|
+
cards: {
|
|
143
|
+
sessionsToday: {
|
|
144
|
+
value: sessionsTodayCount,
|
|
145
|
+
change: sessionsChange,
|
|
146
|
+
},
|
|
147
|
+
activeUsers: {
|
|
148
|
+
value: activeUsersCount,
|
|
149
|
+
change: usersChange,
|
|
150
|
+
},
|
|
151
|
+
emailsSent: {
|
|
152
|
+
value: emailsSentCount,
|
|
153
|
+
change: emailsChange,
|
|
154
|
+
},
|
|
155
|
+
roles: {
|
|
156
|
+
value: rolesCount,
|
|
157
|
+
change: rolesChange,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
charts: {
|
|
161
|
+
emailsPerWeek: emailWeekData,
|
|
162
|
+
permissionDistribution: permissionsData,
|
|
163
|
+
sessionActivity: sessionActivityData,
|
|
164
|
+
userGrowth: userGrowthData,
|
|
165
|
+
},
|
|
166
|
+
};
|
|
89
167
|
}
|
|
90
168
|
async getUserLayout(userId, slug, localeCode) {
|
|
91
|
-
const dashboard = await this.prismaService.dashboard.findFirst({
|
|
92
|
-
where: { slug },
|
|
93
|
-
});
|
|
169
|
+
const dashboard = await this.prismaService.dashboard.findFirst({ where: { slug } });
|
|
94
170
|
if (!dashboard) {
|
|
95
171
|
return [];
|
|
96
172
|
}
|
|
@@ -283,10 +359,6 @@ let DashboardCoreService = class DashboardCoreService {
|
|
|
283
359
|
slug: component.slug,
|
|
284
360
|
name: (locale === null || locale === void 0 ? void 0 : locale.name) || component.slug,
|
|
285
361
|
description: (locale === null || locale === void 0 ? void 0 : locale.description) || '',
|
|
286
|
-
path: component.path,
|
|
287
|
-
icon: component.icon || null,
|
|
288
|
-
stat_key: component.stat_key || null,
|
|
289
|
-
color: component.color || null,
|
|
290
362
|
x: userLayout.x_axis,
|
|
291
363
|
y: userLayout.y_axis,
|
|
292
364
|
w: userLayout.width,
|