@hed-hog/core 0.0.275 → 0.0.278
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/ai/ai.service.d.ts.map +1 -1
- package/dist/ai/ai.service.js +7 -8
- package/dist/ai/ai.service.js.map +1 -1
- package/dist/auth/auth.controller.d.ts +8 -1
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +7 -7
- package/dist/auth/auth.controller.js.map +1 -1
- package/dist/auth/auth.service.d.ts +10 -1
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +34 -8
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/profile/profile.service.js +1 -1
- package/dist/profile/profile.service.js.map +1 -1
- package/dist/role/guards/role.guard.d.ts +1 -0
- package/dist/role/guards/role.guard.d.ts.map +1 -1
- package/dist/role/guards/role.guard.js +18 -0
- package/dist/role/guards/role.guard.js.map +1 -1
- package/dist/session/session.service.js +1 -1
- package/dist/session/session.service.js.map +1 -1
- package/dist/task/task.service.d.ts.map +1 -1
- package/dist/task/task.service.js +1 -2
- package/dist/task/task.service.js.map +1 -1
- package/dist/user/dto/reset-password.dto.d.ts +4 -0
- package/dist/user/dto/reset-password.dto.d.ts.map +1 -0
- package/dist/user/dto/reset-password.dto.js +26 -0
- package/dist/user/dto/reset-password.dto.js.map +1 -0
- package/dist/user/user.controller.d.ts +5 -0
- package/dist/user/user.controller.d.ts.map +1 -1
- package/dist/user/user.controller.js +13 -0
- package/dist/user/user.controller.js.map +1 -1
- package/dist/user/user.service.d.ts +6 -0
- package/dist/user/user.service.d.ts.map +1 -1
- package/dist/user/user.service.js +65 -0
- package/dist/user/user.service.js.map +1 -1
- package/hedhog/data/dashboard_component.yaml +77 -33
- package/hedhog/data/dashboard_component_role.yaml +132 -66
- package/hedhog/data/dashboard_item.yaml +100 -100
- package/hedhog/data/dashboard_role.yaml +18 -12
- package/hedhog/data/menu.yaml +6 -0
- package/hedhog/data/route.yaml +57 -1
- package/hedhog/frontend/app/account/components/change-password-form.tsx.ejs +2 -1
- package/hedhog/frontend/app/dashboard/[slug]/dashboard-content.tsx.ejs +10 -10
- package/hedhog/frontend/app/dashboard/components/draggable-grid.tsx.ejs +20 -20
- package/hedhog/frontend/app/dashboard/components/widget-wrapper.tsx.ejs +6 -6
- package/hedhog/frontend/app/dashboard/components/widgets/account-security.tsx.ejs +24 -24
- package/hedhog/frontend/app/dashboard/components/widgets/activity-timeline.tsx.ejs +4 -4
- package/hedhog/frontend/app/dashboard/components/widgets/email-notifications.tsx.ejs +23 -19
- package/hedhog/frontend/app/dashboard/components/widgets/login-history-chart.tsx.ejs +15 -14
- package/hedhog/frontend/app/dashboard/components/widgets/permissions-chart.tsx.ejs +62 -58
- package/hedhog/frontend/app/dashboard/components/widgets/stat-access-level.tsx.ejs +18 -18
- package/hedhog/frontend/app/dashboard/components/widgets/stat-actions-today.tsx.ejs +18 -18
- package/hedhog/frontend/app/dashboard/components/widgets/stat-consecutive-days.tsx.ejs +18 -18
- package/hedhog/frontend/app/dashboard/components/widgets/stat-online-time.tsx.ejs +18 -18
- package/hedhog/frontend/app/dashboard/components/widgets/user-roles.tsx.ejs +3 -3
- package/hedhog/frontend/app/dashboard/components/widgets/user-sessions.tsx.ejs +34 -33
- package/hedhog/frontend/app/dashboard/dashboard.css.ejs +92 -92
- package/hedhog/frontend/app/dashboard/page.tsx.ejs +29 -14
- package/hedhog/frontend/app/users/page.tsx.ejs +322 -1
- package/hedhog/frontend/messages/en.json +19 -1
- package/hedhog/frontend/messages/pt.json +19 -1
- package/hedhog/table/mail.yaml +15 -15
- package/hedhog/table/mail_sent.yaml +21 -21
- package/hedhog/table/mail_var.yaml +12 -12
- package/package.json +4 -4
- package/src/ai/ai.service.ts +3 -4
- package/src/auth/auth.controller.ts +21 -20
- package/src/auth/auth.service.ts +63 -15
- package/src/profile/profile.service.ts +1 -1
- package/src/role/guards/role.guard.ts +36 -7
- package/src/session/session.service.ts +2 -2
- package/src/setting/setting.service.ts +5 -5
- package/src/task/task.service.ts +5 -6
- package/src/user/dto/reset-password.dto.ts +11 -0
- package/src/user/user.controller.ts +24 -14
- package/src/user/user.service.ts +84 -0
|
@@ -89,106 +89,106 @@
|
|
|
89
89
|
height: 2
|
|
90
90
|
x_axis: 0
|
|
91
91
|
y_axis: 0
|
|
92
|
-
- component_id:
|
|
93
|
-
where:
|
|
94
|
-
slug: stat-online-time
|
|
95
|
-
dashboard_id:
|
|
96
|
-
where:
|
|
97
|
-
slug: user
|
|
98
|
-
width: 3
|
|
99
|
-
height:
|
|
100
|
-
x_axis: 0
|
|
101
|
-
y_axis: 2
|
|
102
|
-
- component_id:
|
|
103
|
-
where:
|
|
104
|
-
slug: stat-actions-today
|
|
105
|
-
dashboard_id:
|
|
106
|
-
where:
|
|
107
|
-
slug: user
|
|
108
|
-
width: 3
|
|
109
|
-
height:
|
|
110
|
-
x_axis: 3
|
|
111
|
-
y_axis: 2
|
|
112
|
-
- component_id:
|
|
113
|
-
where:
|
|
114
|
-
slug: stat-consecutive-days
|
|
115
|
-
dashboard_id:
|
|
116
|
-
where:
|
|
117
|
-
slug: user
|
|
118
|
-
width: 3
|
|
119
|
-
height:
|
|
120
|
-
x_axis: 6
|
|
121
|
-
y_axis: 2
|
|
122
|
-
- component_id:
|
|
123
|
-
where:
|
|
124
|
-
slug: stat-access-level
|
|
125
|
-
dashboard_id:
|
|
126
|
-
where:
|
|
127
|
-
slug: user
|
|
128
|
-
width: 3
|
|
129
|
-
height:
|
|
130
|
-
x_axis: 9
|
|
131
|
-
y_axis: 2
|
|
132
|
-
- component_id:
|
|
133
|
-
where:
|
|
134
|
-
slug: account-security
|
|
135
|
-
dashboard_id:
|
|
136
|
-
where:
|
|
137
|
-
slug: user
|
|
138
|
-
width: 5
|
|
139
|
-
height:
|
|
140
|
-
x_axis: 0
|
|
141
|
-
y_axis:
|
|
142
|
-
- component_id:
|
|
143
|
-
where:
|
|
144
|
-
slug: login-history-chart
|
|
145
|
-
dashboard_id:
|
|
146
|
-
where:
|
|
147
|
-
slug: user
|
|
148
|
-
width:
|
|
149
|
-
height: 4
|
|
150
|
-
x_axis: 0
|
|
151
|
-
y_axis:
|
|
152
|
-
- component_id:
|
|
153
|
-
where:
|
|
154
|
-
slug: email-notifications
|
|
155
|
-
dashboard_id:
|
|
156
|
-
where:
|
|
157
|
-
slug: user
|
|
158
|
-
width: 7
|
|
159
|
-
height:
|
|
160
|
-
x_axis: 5
|
|
161
|
-
y_axis:
|
|
162
|
-
- component_id:
|
|
163
|
-
where:
|
|
164
|
-
slug: activity-timeline
|
|
165
|
-
dashboard_id:
|
|
166
|
-
where:
|
|
167
|
-
slug: user
|
|
168
|
-
width: 5
|
|
169
|
-
height:
|
|
170
|
-
x_axis: 7
|
|
171
|
-
y_axis: 12
|
|
172
|
-
- component_id:
|
|
173
|
-
where:
|
|
174
|
-
slug: user-sessions
|
|
175
|
-
dashboard_id:
|
|
176
|
-
where:
|
|
177
|
-
slug: user
|
|
178
|
-
width:
|
|
179
|
-
height: 4
|
|
180
|
-
x_axis:
|
|
181
|
-
y_axis:
|
|
182
|
-
- component_id:
|
|
183
|
-
where:
|
|
184
|
-
slug: user-roles
|
|
185
|
-
dashboard_id:
|
|
186
|
-
where:
|
|
187
|
-
slug: user
|
|
188
|
-
width:
|
|
189
|
-
height:
|
|
190
|
-
x_axis: 0
|
|
191
|
-
y_axis: 12
|
|
92
|
+
- component_id:
|
|
93
|
+
where:
|
|
94
|
+
slug: stat-online-time
|
|
95
|
+
dashboard_id:
|
|
96
|
+
where:
|
|
97
|
+
slug: user
|
|
98
|
+
width: 3
|
|
99
|
+
height: 1
|
|
100
|
+
x_axis: 0
|
|
101
|
+
y_axis: 2
|
|
102
|
+
- component_id:
|
|
103
|
+
where:
|
|
104
|
+
slug: stat-actions-today
|
|
105
|
+
dashboard_id:
|
|
106
|
+
where:
|
|
107
|
+
slug: user
|
|
108
|
+
width: 3
|
|
109
|
+
height: 1
|
|
110
|
+
x_axis: 3
|
|
111
|
+
y_axis: 2
|
|
112
|
+
- component_id:
|
|
113
|
+
where:
|
|
114
|
+
slug: stat-consecutive-days
|
|
115
|
+
dashboard_id:
|
|
116
|
+
where:
|
|
117
|
+
slug: user
|
|
118
|
+
width: 3
|
|
119
|
+
height: 1
|
|
120
|
+
x_axis: 6
|
|
121
|
+
y_axis: 2
|
|
122
|
+
- component_id:
|
|
123
|
+
where:
|
|
124
|
+
slug: stat-access-level
|
|
125
|
+
dashboard_id:
|
|
126
|
+
where:
|
|
127
|
+
slug: user
|
|
128
|
+
width: 3
|
|
129
|
+
height: 1
|
|
130
|
+
x_axis: 9
|
|
131
|
+
y_axis: 2
|
|
132
|
+
- component_id:
|
|
133
|
+
where:
|
|
134
|
+
slug: account-security
|
|
135
|
+
dashboard_id:
|
|
136
|
+
where:
|
|
137
|
+
slug: user
|
|
138
|
+
width: 5
|
|
139
|
+
height: 5
|
|
140
|
+
x_axis: 0
|
|
141
|
+
y_axis: 7
|
|
142
|
+
- component_id:
|
|
143
|
+
where:
|
|
144
|
+
slug: login-history-chart
|
|
145
|
+
dashboard_id:
|
|
146
|
+
where:
|
|
147
|
+
slug: user
|
|
148
|
+
width: 7
|
|
149
|
+
height: 4
|
|
150
|
+
x_axis: 0
|
|
151
|
+
y_axis: 3
|
|
152
|
+
- component_id:
|
|
153
|
+
where:
|
|
154
|
+
slug: email-notifications
|
|
155
|
+
dashboard_id:
|
|
156
|
+
where:
|
|
157
|
+
slug: user
|
|
158
|
+
width: 7
|
|
159
|
+
height: 5
|
|
160
|
+
x_axis: 5
|
|
161
|
+
y_axis: 7
|
|
162
|
+
- component_id:
|
|
163
|
+
where:
|
|
164
|
+
slug: activity-timeline
|
|
165
|
+
dashboard_id:
|
|
166
|
+
where:
|
|
167
|
+
slug: user
|
|
168
|
+
width: 5
|
|
169
|
+
height: 3
|
|
170
|
+
x_axis: 7
|
|
171
|
+
y_axis: 12
|
|
172
|
+
- component_id:
|
|
173
|
+
where:
|
|
174
|
+
slug: user-sessions
|
|
175
|
+
dashboard_id:
|
|
176
|
+
where:
|
|
177
|
+
slug: user
|
|
178
|
+
width: 5
|
|
179
|
+
height: 4
|
|
180
|
+
x_axis: 7
|
|
181
|
+
y_axis: 3
|
|
182
|
+
- component_id:
|
|
183
|
+
where:
|
|
184
|
+
slug: user-roles
|
|
185
|
+
dashboard_id:
|
|
186
|
+
where:
|
|
187
|
+
slug: user
|
|
188
|
+
width: 7
|
|
189
|
+
height: 3
|
|
190
|
+
x_axis: 0
|
|
191
|
+
y_axis: 12
|
|
192
192
|
|
|
193
193
|
- component_id:
|
|
194
194
|
where:
|
|
@@ -4,15 +4,21 @@
|
|
|
4
4
|
role_id:
|
|
5
5
|
where:
|
|
6
6
|
slug: admin-access
|
|
7
|
-
- dashboard_id:
|
|
8
|
-
where:
|
|
9
|
-
slug: user
|
|
10
|
-
role_id:
|
|
11
|
-
where:
|
|
12
|
-
slug: user
|
|
13
|
-
- dashboard_id:
|
|
14
|
-
where:
|
|
15
|
-
slug:
|
|
16
|
-
role_id:
|
|
17
|
-
where:
|
|
18
|
-
slug: admin
|
|
7
|
+
- dashboard_id:
|
|
8
|
+
where:
|
|
9
|
+
slug: user
|
|
10
|
+
role_id:
|
|
11
|
+
where:
|
|
12
|
+
slug: user
|
|
13
|
+
- dashboard_id:
|
|
14
|
+
where:
|
|
15
|
+
slug: user
|
|
16
|
+
role_id:
|
|
17
|
+
where:
|
|
18
|
+
slug: admin-access
|
|
19
|
+
- dashboard_id:
|
|
20
|
+
where:
|
|
21
|
+
slug: config
|
|
22
|
+
role_id:
|
|
23
|
+
where:
|
|
24
|
+
slug: admin
|
package/hedhog/data/menu.yaml
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
role:
|
|
20
20
|
- where:
|
|
21
21
|
slug: admin
|
|
22
|
+
- where:
|
|
23
|
+
slug: admin-mail
|
|
22
24
|
- menu_id:
|
|
23
25
|
where:
|
|
24
26
|
slug: /core/management
|
|
@@ -89,6 +91,8 @@
|
|
|
89
91
|
role:
|
|
90
92
|
- where:
|
|
91
93
|
slug: admin
|
|
94
|
+
- where:
|
|
95
|
+
slug: admin-mail
|
|
92
96
|
- menu_id:
|
|
93
97
|
where:
|
|
94
98
|
slug: /core/management
|
|
@@ -128,3 +132,5 @@
|
|
|
128
132
|
role:
|
|
129
133
|
- where:
|
|
130
134
|
slug: admin
|
|
135
|
+
- where:
|
|
136
|
+
slug: admin-user
|
package/hedhog/data/route.yaml
CHANGED
|
@@ -28,6 +28,22 @@
|
|
|
28
28
|
slug: admin
|
|
29
29
|
- where:
|
|
30
30
|
slug: admin-access
|
|
31
|
+
- url: /auth/refresh
|
|
32
|
+
method: POST
|
|
33
|
+
relations:
|
|
34
|
+
role:
|
|
35
|
+
- where:
|
|
36
|
+
slug: admin
|
|
37
|
+
- where:
|
|
38
|
+
slug: admin-access
|
|
39
|
+
- url: /auth/logout
|
|
40
|
+
method: POST
|
|
41
|
+
relations:
|
|
42
|
+
role:
|
|
43
|
+
- where:
|
|
44
|
+
slug: admin
|
|
45
|
+
- where:
|
|
46
|
+
slug: admin-access
|
|
31
47
|
- url: /sessions/revoke-all
|
|
32
48
|
method: DELETE
|
|
33
49
|
relations:
|
|
@@ -344,60 +360,86 @@
|
|
|
344
360
|
role:
|
|
345
361
|
- where:
|
|
346
362
|
slug: admin
|
|
363
|
+
- where:
|
|
364
|
+
slug: admin-user
|
|
347
365
|
- url: /user/:userId/role
|
|
348
366
|
method: GET
|
|
349
367
|
relations:
|
|
350
368
|
role:
|
|
351
369
|
- where:
|
|
352
370
|
slug: admin
|
|
371
|
+
- where:
|
|
372
|
+
slug: admin-user
|
|
353
373
|
- url: /user/:userId/role
|
|
354
374
|
method: PATCH
|
|
355
375
|
relations:
|
|
356
376
|
role:
|
|
357
377
|
- where:
|
|
358
378
|
slug: admin
|
|
379
|
+
- where:
|
|
380
|
+
slug: admin-user
|
|
359
381
|
- url: /user/:userId/role/:roleId
|
|
360
382
|
method: DELETE
|
|
361
383
|
relations:
|
|
362
384
|
role:
|
|
363
385
|
- where:
|
|
364
386
|
slug: admin
|
|
387
|
+
- where:
|
|
388
|
+
slug: admin-user
|
|
365
389
|
- url: /user/:userId/role/:roleId
|
|
366
390
|
method: POST
|
|
367
391
|
relations:
|
|
368
392
|
role:
|
|
369
393
|
- where:
|
|
370
394
|
slug: admin
|
|
395
|
+
- where:
|
|
396
|
+
slug: admin-user
|
|
371
397
|
- url: /user/:userId
|
|
372
398
|
method: GET
|
|
373
399
|
relations:
|
|
374
400
|
role:
|
|
375
401
|
- where:
|
|
376
402
|
slug: admin
|
|
403
|
+
- where:
|
|
404
|
+
slug: admin-user
|
|
377
405
|
- url: /user
|
|
378
406
|
method: POST
|
|
379
407
|
relations:
|
|
380
408
|
role:
|
|
381
409
|
- where:
|
|
382
410
|
slug: admin
|
|
411
|
+
- where:
|
|
412
|
+
slug: admin-user
|
|
383
413
|
- url: /user/:userId/avatar
|
|
384
414
|
method: POST
|
|
385
415
|
relations:
|
|
386
416
|
role:
|
|
387
417
|
- where:
|
|
388
418
|
slug: admin
|
|
419
|
+
- where:
|
|
420
|
+
slug: admin-user
|
|
389
421
|
- url: /user/:userId
|
|
390
422
|
method: PATCH
|
|
391
423
|
relations:
|
|
392
424
|
role:
|
|
393
425
|
- where:
|
|
394
426
|
slug: admin
|
|
427
|
+
- url: /user/:userId/reset-password
|
|
428
|
+
method: PATCH
|
|
429
|
+
relations:
|
|
430
|
+
role:
|
|
431
|
+
- where:
|
|
432
|
+
slug: admin
|
|
433
|
+
- where:
|
|
434
|
+
slug: admin-user
|
|
395
435
|
- url: /user
|
|
396
436
|
method: DELETE
|
|
397
437
|
relations:
|
|
398
438
|
role:
|
|
399
439
|
- where:
|
|
400
440
|
slug: admin
|
|
441
|
+
- where:
|
|
442
|
+
slug: admin-user
|
|
401
443
|
- url: /locale
|
|
402
444
|
method: GET
|
|
403
445
|
relations:
|
|
@@ -652,12 +694,16 @@
|
|
|
652
694
|
role:
|
|
653
695
|
- where:
|
|
654
696
|
slug: admin
|
|
697
|
+
- where:
|
|
698
|
+
slug: admin-access
|
|
655
699
|
- url: /dashboard-core/user-dashboards
|
|
656
700
|
method: GET
|
|
657
701
|
relations:
|
|
658
702
|
role:
|
|
659
703
|
- where:
|
|
660
704
|
slug: admin
|
|
705
|
+
- where:
|
|
706
|
+
slug: admin-access
|
|
661
707
|
- url: /dashboard-core/stats/overview/users
|
|
662
708
|
method: GET
|
|
663
709
|
relations:
|
|
@@ -676,12 +722,16 @@
|
|
|
676
722
|
role:
|
|
677
723
|
- where:
|
|
678
724
|
slug: admin
|
|
725
|
+
- where:
|
|
726
|
+
slug: admin-access
|
|
679
727
|
- url: /dashboard-core/layout/:slug
|
|
680
728
|
method: POST
|
|
681
729
|
relations:
|
|
682
730
|
role:
|
|
683
731
|
- where:
|
|
684
732
|
slug: admin
|
|
733
|
+
- where:
|
|
734
|
+
slug: admin-access
|
|
685
735
|
- url: /dashboard-core/widgets/me
|
|
686
736
|
method: GET
|
|
687
737
|
relations:
|
|
@@ -694,12 +744,16 @@
|
|
|
694
744
|
role:
|
|
695
745
|
- where:
|
|
696
746
|
slug: admin
|
|
747
|
+
- where:
|
|
748
|
+
slug: admin-access
|
|
697
749
|
- url: /dashboard-core/widget/:slug/:widgetId
|
|
698
750
|
method: DELETE
|
|
699
751
|
relations:
|
|
700
752
|
role:
|
|
701
753
|
- where:
|
|
702
754
|
slug: admin
|
|
755
|
+
- where:
|
|
756
|
+
slug: admin-access
|
|
703
757
|
- url: /dashboard
|
|
704
758
|
method: GET
|
|
705
759
|
relations:
|
|
@@ -742,6 +796,8 @@
|
|
|
742
796
|
role:
|
|
743
797
|
- where:
|
|
744
798
|
slug: admin
|
|
799
|
+
- where:
|
|
800
|
+
slug: admin-access
|
|
745
801
|
- url: /dashboard-component
|
|
746
802
|
method: POST
|
|
747
803
|
relations:
|
|
@@ -1325,4 +1381,4 @@
|
|
|
1325
1381
|
- where:
|
|
1326
1382
|
slug: admin
|
|
1327
1383
|
- where:
|
|
1328
|
-
slug: admin-access
|
|
1384
|
+
slug: admin-access
|
|
@@ -25,7 +25,7 @@ import { useForm } from 'react-hook-form';
|
|
|
25
25
|
import { z } from 'zod';
|
|
26
26
|
|
|
27
27
|
export function ChangePasswordForm() {
|
|
28
|
-
const { request, showToastHandler, getSettingValue } = useApp();
|
|
28
|
+
const { request, showToastHandler, getSettingValue, refetchUser } = useApp();
|
|
29
29
|
const t = useTranslations('core.ChangePasswordForm');
|
|
30
30
|
const minPasswordLength = getSettingValue('password-min-length') || 6;
|
|
31
31
|
const minPasswordSymbols = getSettingValue('password-min-symbols') || 0;
|
|
@@ -105,6 +105,7 @@ export function ChangePasswordForm() {
|
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
showToastHandler('success', t('updateSuccess'));
|
|
108
|
+
await refetchUser();
|
|
108
109
|
|
|
109
110
|
form.reset();
|
|
110
111
|
} catch (error) {
|
|
@@ -322,16 +322,16 @@ export const DashboardContent = ({ dashboardSlug }: DashboardContentProps) => {
|
|
|
322
322
|
<div className="flex flex-1 flex-col gap-4 overflow-auto p-4 pt-0">
|
|
323
323
|
{widgets.length > 0 ? (
|
|
324
324
|
<div className="min-h-[600px]">
|
|
325
|
-
<DraggableGrid
|
|
326
|
-
className="dashboard-grid"
|
|
327
|
-
layout={layout}
|
|
328
|
-
onLayoutChange={handleLayoutChange}
|
|
329
|
-
cols={12}
|
|
330
|
-
rowHeight={80}
|
|
331
|
-
isDraggable={true}
|
|
332
|
-
isResizable={true}
|
|
333
|
-
resizeHandles={['se']}
|
|
334
|
-
>
|
|
325
|
+
<DraggableGrid
|
|
326
|
+
className="dashboard-grid"
|
|
327
|
+
layout={layout}
|
|
328
|
+
onLayoutChange={handleLayoutChange}
|
|
329
|
+
cols={12}
|
|
330
|
+
rowHeight={80}
|
|
331
|
+
isDraggable={true}
|
|
332
|
+
isResizable={true}
|
|
333
|
+
resizeHandles={['se']}
|
|
334
|
+
>
|
|
335
335
|
{widgets.map((widget) => (
|
|
336
336
|
<div key={widget.i}>{renderWidget(widget)}</div>
|
|
337
337
|
))}
|
|
@@ -20,21 +20,21 @@ export interface LayoutItem {
|
|
|
20
20
|
|
|
21
21
|
export type Layout = LayoutItem[];
|
|
22
22
|
|
|
23
|
-
interface DraggableGridProps {
|
|
24
|
-
layout: Layout;
|
|
25
|
-
onLayoutChange: (layout: Layout) => void;
|
|
26
|
-
children: ReactNode;
|
|
23
|
+
interface DraggableGridProps {
|
|
24
|
+
layout: Layout;
|
|
25
|
+
onLayoutChange: (layout: Layout) => void;
|
|
26
|
+
children: ReactNode;
|
|
27
27
|
className?: string;
|
|
28
28
|
cols?: number;
|
|
29
29
|
rowHeight?: number;
|
|
30
30
|
isDraggable?: boolean;
|
|
31
31
|
isResizable?: boolean;
|
|
32
|
-
compactType?: 'vertical' | 'horizontal' | null;
|
|
33
|
-
preventCollision?: boolean;
|
|
34
|
-
margin?: [number, number];
|
|
35
|
-
containerPadding?: [number, number];
|
|
36
|
-
resizeHandles?: Array<'s' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne'>;
|
|
37
|
-
}
|
|
32
|
+
compactType?: 'vertical' | 'horizontal' | null;
|
|
33
|
+
preventCollision?: boolean;
|
|
34
|
+
margin?: [number, number];
|
|
35
|
+
containerPadding?: [number, number];
|
|
36
|
+
resizeHandles?: Array<'s' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne'>;
|
|
37
|
+
}
|
|
38
38
|
|
|
39
39
|
// Simple compaction function for grid layout
|
|
40
40
|
const compactLayout = (
|
|
@@ -63,12 +63,12 @@ export function DraggableGrid({
|
|
|
63
63
|
rowHeight = 100,
|
|
64
64
|
isDraggable = true,
|
|
65
65
|
isResizable = true,
|
|
66
|
-
compactType = 'vertical',
|
|
67
|
-
preventCollision = false,
|
|
68
|
-
margin = [16, 16],
|
|
69
|
-
containerPadding = [0, 0],
|
|
70
|
-
resizeHandles = ['se'],
|
|
71
|
-
}: DraggableGridProps) {
|
|
66
|
+
compactType = 'vertical',
|
|
67
|
+
preventCollision = false,
|
|
68
|
+
margin = [16, 16],
|
|
69
|
+
containerPadding = [0, 0],
|
|
70
|
+
resizeHandles = ['se'],
|
|
71
|
+
}: DraggableGridProps) {
|
|
72
72
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
73
73
|
const [containerWidth, setContainerWidth] = useState(1200);
|
|
74
74
|
|
|
@@ -124,10 +124,10 @@ export function DraggableGrid({
|
|
|
124
124
|
cancel: 'button,.no-drag',
|
|
125
125
|
}}
|
|
126
126
|
width={containerWidth}
|
|
127
|
-
resizeConfig={{
|
|
128
|
-
enabled: isResizable,
|
|
129
|
-
handles: resizeHandles,
|
|
130
|
-
}}
|
|
127
|
+
resizeConfig={{
|
|
128
|
+
enabled: isResizable,
|
|
129
|
+
handles: resizeHandles,
|
|
130
|
+
}}
|
|
131
131
|
compactor={{
|
|
132
132
|
type: compactType,
|
|
133
133
|
allowOverlap: !preventCollision,
|
|
@@ -122,12 +122,12 @@ export function WidgetWrapper({
|
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
return (
|
|
126
|
-
<div className="dashboard-widget group relative h-full w-full">
|
|
127
|
-
<div
|
|
128
|
-
className="drag-handle absolute left-3 top-3 z-20"
|
|
129
|
-
style={{ cursor: 'grab' }}
|
|
130
|
-
>
|
|
125
|
+
return (
|
|
126
|
+
<div className="dashboard-widget group relative h-full w-full">
|
|
127
|
+
<div
|
|
128
|
+
className="drag-handle absolute left-3 top-3 z-20"
|
|
129
|
+
style={{ cursor: 'grab' }}
|
|
130
|
+
>
|
|
131
131
|
<IconGripVertical className="size-4 shrink-0 text-muted-foreground/30 opacity-0 transition-opacity group-hover:opacity-100" />
|
|
132
132
|
</div>
|
|
133
133
|
{onRemove && (
|
|
@@ -59,7 +59,7 @@ function AccountSecurityContent({ data }: { data: AccountSecurityData }) {
|
|
|
59
59
|
: 'hsl(0, 84%, 60%)';
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
|
-
<Card className="flex h-full flex-col">
|
|
62
|
+
<Card className="flex h-full min-h-0 flex-col overflow-hidden">
|
|
63
63
|
<CardHeader className="shrink-0 pb-3">
|
|
64
64
|
<div className="flex items-center gap-2">
|
|
65
65
|
<ShieldCheck className="h-5 w-5 text-emerald-600 dark:text-emerald-400" />
|
|
@@ -71,8 +71,8 @@ function AccountSecurityContent({ data }: { data: AccountSecurityData }) {
|
|
|
71
71
|
</div>
|
|
72
72
|
</div>
|
|
73
73
|
</CardHeader>
|
|
74
|
-
<CardContent className="flex-1 overflow-auto pt-0">
|
|
75
|
-
<div className="mb-5 flex flex-col items-center gap-3 rounded-xl bg-muted/50 p-5">
|
|
74
|
+
<CardContent className="flex min-h-0 flex-1 overflow-auto pt-0">
|
|
75
|
+
<div className="mb-5 flex flex-col items-center gap-3 rounded-xl bg-muted/50 p-4 sm:p-5">
|
|
76
76
|
<div className="flex items-baseline gap-1">
|
|
77
77
|
<span className={`text-5xl font-bold tracking-tight ${scoreColor}`}>
|
|
78
78
|
{score}
|
|
@@ -97,10 +97,10 @@ function AccountSecurityContent({ data }: { data: AccountSecurityData }) {
|
|
|
97
97
|
{data.checks.map((item) => {
|
|
98
98
|
const Icon = ICON_MAP[item.id] ?? ShieldCheck;
|
|
99
99
|
return (
|
|
100
|
-
<div
|
|
101
|
-
key={item.id}
|
|
102
|
-
className="group flex items-center gap-3 rounded-lg p-3 transition-colors hover:bg-muted/50"
|
|
103
|
-
>
|
|
100
|
+
<div
|
|
101
|
+
key={item.id}
|
|
102
|
+
className="group flex flex-wrap items-center gap-3 rounded-lg p-3 transition-colors hover:bg-muted/50"
|
|
103
|
+
>
|
|
104
104
|
<div
|
|
105
105
|
className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg ${
|
|
106
106
|
item.enabled
|
|
@@ -116,29 +116,29 @@ function AccountSecurityContent({ data }: { data: AccountSecurityData }) {
|
|
|
116
116
|
}`}
|
|
117
117
|
/>
|
|
118
118
|
</div>
|
|
119
|
-
<div className="flex min-w-0 flex-1 flex-col">
|
|
120
|
-
<div className="flex items-center gap-2">
|
|
121
|
-
<span className="text-sm font-medium text-foreground">
|
|
122
|
-
{t(`labels.${item.labelKey}` as any) || item.labelKey}
|
|
123
|
-
</span>
|
|
119
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
120
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
121
|
+
<span className="break-words text-sm font-medium text-foreground">
|
|
122
|
+
{t(`labels.${item.labelKey}` as any) || item.labelKey}
|
|
123
|
+
</span>
|
|
124
124
|
{item.enabled ? (
|
|
125
125
|
<CheckCircle2 className="h-3.5 w-3.5 text-emerald-500" />
|
|
126
126
|
) : (
|
|
127
127
|
<AlertTriangle className="h-3.5 w-3.5 text-amber-500" />
|
|
128
128
|
)}
|
|
129
129
|
</div>
|
|
130
|
-
<span className="text-xs text-muted-foreground">
|
|
131
|
-
{t(`descriptions.${item.descriptionKey}` as any) ||
|
|
132
|
-
item.descriptionKey}
|
|
133
|
-
</span>
|
|
134
|
-
</div>
|
|
135
|
-
{!item.enabled && (
|
|
136
|
-
<Button
|
|
137
|
-
variant="ghost"
|
|
138
|
-
size="sm"
|
|
139
|
-
onClick={() => router.push('/core/account/2fa')}
|
|
140
|
-
className="shrink-0 gap-1 text-xs"
|
|
141
|
-
>
|
|
130
|
+
<span className="text-xs text-muted-foreground">
|
|
131
|
+
{t(`descriptions.${item.descriptionKey}` as any) ||
|
|
132
|
+
item.descriptionKey}
|
|
133
|
+
</span>
|
|
134
|
+
</div>
|
|
135
|
+
{!item.enabled && (
|
|
136
|
+
<Button
|
|
137
|
+
variant="ghost"
|
|
138
|
+
size="sm"
|
|
139
|
+
onClick={() => router.push('/core/account/2fa')}
|
|
140
|
+
className="mt-2 w-full shrink-0 gap-1 text-xs sm:mt-0 sm:w-auto"
|
|
141
|
+
>
|
|
142
142
|
{t('activate')}
|
|
143
143
|
<ChevronRight className="h-3 w-3" />
|
|
144
144
|
</Button>
|
|
@@ -119,7 +119,7 @@ function TimelineContent({ events }: { events: ActivityEvent[] }) {
|
|
|
119
119
|
let lastDate = '';
|
|
120
120
|
|
|
121
121
|
return (
|
|
122
|
-
<Card className="flex h-full flex-col">
|
|
122
|
+
<Card className="flex h-full min-h-0 flex-col overflow-hidden">
|
|
123
123
|
<CardHeader className="shrink-0 pb-3">
|
|
124
124
|
<div className="flex items-center justify-between">
|
|
125
125
|
<div>
|
|
@@ -168,9 +168,9 @@ function TimelineContent({ events }: { events: ActivityEvent[] }) {
|
|
|
168
168
|
</div>
|
|
169
169
|
<div className="flex min-w-0 flex-1 flex-col gap-0.5 rounded-lg px-2 py-1.5 transition-colors group-hover:bg-muted/40">
|
|
170
170
|
<div className="flex items-center justify-between gap-2">
|
|
171
|
-
<span className="text-sm font-medium leading-snug text-foreground">
|
|
172
|
-
{event.action}
|
|
173
|
-
</span>
|
|
171
|
+
<span className="min-w-0 break-words text-sm font-medium leading-snug text-foreground">
|
|
172
|
+
{event.action}
|
|
173
|
+
</span>
|
|
174
174
|
<span className="shrink-0 text-[11px] tabular-nums text-muted-foreground">
|
|
175
175
|
{formatTime(event.created_at)}
|
|
176
176
|
</span>
|