@hedhog/admin 0.48.11 → 0.48.13

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.
Files changed (59) hide show
  1. package/dist/admin.module.d.ts.map +1 -1
  2. package/dist/admin.module.js +1 -0
  3. package/dist/admin.module.js.map +1 -1
  4. package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +29 -0
  5. package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts.map +1 -0
  6. package/dist/dashboard/dashboard-core/dashboard-core.controller.js +38 -0
  7. package/dist/dashboard/dashboard-core/dashboard-core.controller.js.map +1 -0
  8. package/dist/dashboard/dashboard-core/dashboard-core.module.d.ts +3 -0
  9. package/dist/dashboard/dashboard-core/dashboard-core.module.d.ts.map +1 -0
  10. package/dist/dashboard/dashboard-core/dashboard-core.module.js +26 -0
  11. package/dist/dashboard/dashboard-core/dashboard-core.module.js.map +1 -0
  12. package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +29 -0
  13. package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts.map +1 -0
  14. package/dist/dashboard/dashboard-core/dashboard-core.service.js +33 -0
  15. package/dist/dashboard/dashboard-core/dashboard-core.service.js.map +1 -0
  16. package/dist/dashboard/dashboard.module.d.ts.map +1 -1
  17. package/dist/dashboard/dashboard.module.js +5 -3
  18. package/dist/dashboard/dashboard.module.js.map +1 -1
  19. package/dist/setting/setting.module.d.ts.map +1 -1
  20. package/dist/setting/setting.module.js +8 -1
  21. package/dist/setting/setting.module.js.map +1 -1
  22. package/hedhog/tables/dashboard.yaml +9 -0
  23. package/hedhog/tables/dashboard_component.yaml +34 -0
  24. package/hedhog/tables/dashboard_component_locale.yaml +24 -0
  25. package/hedhog/tables/dashboard_item.yaml +25 -0
  26. package/hedhog/tables/dashboard_locale.yaml +24 -0
  27. package/hedhog/tables/dashboard_user.yaml +25 -0
  28. package/hedhog/tables/menu.yaml +18 -0
  29. package/hedhog/tables/menu_locale.yaml +19 -0
  30. package/hedhog/tables/menu_screen.yaml +16 -0
  31. package/hedhog/tables/multifactor.yaml +6 -0
  32. package/hedhog/tables/multifactor_locale.yaml +19 -0
  33. package/hedhog/tables/role.yaml +6 -0
  34. package/hedhog/tables/role_locale.yaml +20 -0
  35. package/hedhog/tables/role_menu.yaml +18 -0
  36. package/hedhog/tables/role_route.yaml +18 -0
  37. package/hedhog/tables/role_screen.yaml +18 -0
  38. package/hedhog/tables/role_user.yaml +18 -0
  39. package/hedhog/tables/route.yaml +23 -0
  40. package/hedhog/tables/route_screen.yaml +18 -0
  41. package/hedhog/tables/screen.yaml +8 -0
  42. package/hedhog/tables/screen_locale.yaml +20 -0
  43. package/hedhog/tables/setting.yaml +27 -0
  44. package/hedhog/tables/setting_group.yaml +8 -0
  45. package/hedhog/tables/setting_group_locale.yaml +23 -0
  46. package/hedhog/tables/setting_locale.yaml +24 -0
  47. package/hedhog/tables/setting_user.yaml +21 -0
  48. package/hedhog/tables/translation.yaml +25 -0
  49. package/hedhog/tables/translation_namespace.yaml +6 -0
  50. package/hedhog/tables/user.yaml +18 -0
  51. package/hedhog/tables/user_activity.yaml +14 -0
  52. package/hedhog.yaml +16 -580
  53. package/package.json +1 -1
  54. package/src/admin.module.ts +1 -0
  55. package/src/dashboard/dashboard-core/dashboard-core.controller.ts +12 -0
  56. package/src/dashboard/dashboard-core/dashboard-core.module.ts +14 -0
  57. package/src/dashboard/dashboard-core/dashboard-core.service.ts +16 -0
  58. package/src/dashboard/dashboard.module.ts +5 -3
  59. package/src/setting/setting.module.ts +9 -2
package/hedhog.yaml CHANGED
@@ -808,589 +808,25 @@ data:
808
808
  code: pt
809
809
  name: pt
810
810
  value: Português
811
- tables:
812
- setting_group:
813
- columns:
814
- - type: pk
815
- - name: icon
816
- length: 31
817
- - type: slug
818
- - type: created_at
819
- - type: updated_at
820
- ifNotExists: true
821
- setting_group_locale:
822
- columns:
823
- - name: locale_id
824
- type: fk
825
- isPrimary: true
826
- references:
827
- table: locale
828
- column: id
829
- onDelete: CASCADE
830
- - name: group_id
831
- type: fk
832
- isPrimary: true
833
- references:
834
- table: setting_group
835
- column: id
836
- onDelete: CASCADE
837
- - name: name
838
- length: 63
839
- - name: description
840
- length: 255
841
- isNullable: true
842
- - type: created_at
843
- - type: updated_at
844
- ifNotExists: true
845
- setting:
846
- columns:
847
- - type: pk
848
- - name: group_id
849
- type: fk
850
- references:
851
- table: setting_group
852
- column: id
853
- onDelete: CASCADE
854
- - type: slug
855
- - name: type
856
- type: enum
857
- enum:
858
- - string
859
- - array
860
- - number
861
- - boolean
862
- - json
863
- default: string
864
- - name: value
865
- length: 1023
866
- isNullable: true
867
- - name: user_override
868
- type: boolean
869
- default: false
870
- - type: created_at
871
- - type: updated_at
872
- ifNotExists: true
873
- setting_locale:
874
- columns:
875
- - name: locale_id
876
- type: fk
877
- isPrimary: true
878
- references:
879
- table: locale
880
- column: id
881
- onDelete: CASCADE
882
- - name: setting_id
883
- type: fk
884
- isPrimary: true
885
- references:
886
- table: setting
887
- column: id
888
- onDelete: CASCADE
889
- - name: description
890
- length: 255
891
- isNullable: true
892
- - name: name
893
- length: 63
894
- isNullable: true
895
- - type: created_at
896
- - type: updated_at
897
- ifNotExists: true
898
- setting_user:
899
- columns:
900
- - name: user_id
901
- type: fk
902
- isPrimary: true
903
- references:
904
- table: user
905
- column: id
906
- onDelete: CASCADE
907
- - name: setting_id
908
- type: fk
909
- isPrimary: true
910
- references:
911
- table: setting
912
- column: id
913
- onDelete: CASCADE
914
- - name: value
915
- length: 1023
916
- isNullable: true
917
- - type: created_at
918
- - type: updated_at
919
- ifNotExists: true
920
- translation_namespace:
921
- columns:
922
- - type: pk
923
- - name: name
924
- - type: created_at
925
- - type: updated_at
926
- ifNotExists: true
927
- translation:
928
- columns:
929
- - type: pk
930
- - name: locale_id
931
- type: fk
932
- references:
933
- table: locale
934
- column: id
935
- onDelete: CASCADE
936
- - name: namespace_id
937
- type: fk
938
- references:
939
- table: translation_namespace
940
- column: id
941
- onDelete: CASCADE
942
- - name: name
943
- - name: value
944
- - type: created_at
945
- - type: updated_at
946
- indices:
947
- - columns:
948
- - locale_id
949
- - namespace_id
950
- - name
951
- isUnique: true
952
- ifNotExists: true
953
- multifactor:
954
- columns:
955
- - type: pk
956
- - type: slug
957
- - type: created_at
958
- - type: updated_at
959
- ifNotExists: true
960
- multifactor_locale:
961
- columns:
962
- - name: multifactor_id
963
- type: fk
964
- isPrimary: true
965
- references:
966
- table: multifactor
967
- column: id
968
- onDelete: CASCADE
969
- - name: locale_id
970
- type: fk
971
- isPrimary: true
972
- references:
973
- table: locale
974
- column: id
975
- onDelete: CASCADE
976
- - name: name
977
- - type: created_at
978
- - type: updated_at
979
- ifNotExists: true
980
- user_activity:
981
- columns:
982
- - type: pk
983
- - name: user_id
984
- type: fk
985
- references:
986
- table: user
987
- column: id
988
- onDelete: CASCADE
989
- - name: ip
990
- - name: user_agent
991
- - name: message
992
- - type: created_at
993
- - type: updated_at
994
- ifNotExists: true
995
- user:
996
- columns:
997
- - type: pk
998
- - name: multifactor_id
999
- type: fk
1000
- isNullable: true
1001
- references:
1002
- table: multifactor
1003
- column: id
1004
- onDelete: SET NULL
1005
- - name: name
1006
- - name: email
1007
- isUnique: true
1008
- - name: password
1009
- - name: code
1010
- isNullable: true
1011
- - type: created_at
1012
- - type: updated_at
1013
- ifNotExists: true
1014
- screen:
1015
- columns:
1016
- - type: pk
1017
- - type: slug
1018
- - name: icon
1019
- isNullable: true
1020
- - type: created_at
1021
- - type: updated_at
1022
- ifNotExists: true
1023
- screen_locale:
1024
- columns:
1025
- - name: screen_id
1026
- type: fk
1027
- isPrimary: true
1028
- references:
1029
- table: screen
1030
- column: id
1031
- onDelete: CASCADE
1032
- - name: locale_id
1033
- type: fk
1034
- isPrimary: true
1035
- references:
1036
- table: locale
1037
- column: id
1038
- onDelete: CASCADE
1039
- - name: name
1040
- - name: description
1041
- - type: created_at
1042
- - type: updated_at
1043
- ifNotExists: true
1044
- menu:
1045
- columns:
1046
- - type: pk
1047
- - name: menu_id
1048
- type: fk
1049
- isNullable: true
1050
- references:
1051
- table: menu
1052
- column: id
1053
- onDelete: CASCADE
1054
- - type: slug
1055
- - name: url
1056
- isNullable: true
1057
- - type: order
1058
- - name: icon
1059
- isNullable: true
1060
- - type: created_at
1061
- - type: updated_at
1062
- ifNotExists: true
1063
- menu_locale:
1064
- columns:
1065
- - name: menu_id
1066
- type: fk
1067
- isPrimary: true
1068
- references:
1069
- table: menu
1070
- column: id
1071
- onDelete: CASCADE
1072
- - name: locale_id
1073
- type: fk
1074
- isPrimary: true
1075
- references:
1076
- table: locale
1077
- column: id
1078
- onDelete: CASCADE
1079
- - name: name
1080
- - type: created_at
1081
- - type: updated_at
1082
- ifNotExists: true
1083
- menu_screen:
1084
- columns:
1085
- - name: menu_id
1086
- type: fk
1087
- isPrimary: true
1088
- references:
1089
- table: menu
1090
- column: id
1091
- onDelete: CASCADE
1092
- - name: screen_id
1093
- type: fk
1094
- isPrimary: true
1095
- references:
1096
- table: screen
1097
- column: id
1098
- onDelete: CASCADE
1099
- ifNotExists: true
1100
- route:
1101
- columns:
1102
- - type: pk
1103
- - name: url
1104
- - name: method
1105
- type: enum
1106
- enum:
1107
- - GET
1108
- - POST
1109
- - PATCH
1110
- - DELETE
1111
- - PUT
1112
- - OPTIONS
1113
- - HEAD
1114
- - name: description
1115
- isNullable: true
1116
- - type: created_at
1117
- - type: updated_at
1118
- indices:
1119
- - columns:
1120
- - url
1121
- - method
1122
- isUnique: true
1123
- ifNotExists: true
1124
- role:
1125
- columns:
1126
- - type: pk
1127
- - type: slug
1128
- - type: created_at
1129
- - type: updated_at
1130
- ifNotExists: true
1131
- role_locale:
1132
- columns:
1133
- - name: role_id
1134
- type: fk
1135
- isPrimary: true
1136
- references:
1137
- table: role
1138
- column: id
1139
- onDelete: CASCADE
1140
- - name: locale_id
1141
- type: fk
1142
- isPrimary: true
1143
- references:
1144
- table: locale
1145
- column: id
1146
- onDelete: CASCADE
1147
- - name: name
1148
- - name: description
1149
- - type: created_at
1150
- - type: updated_at
1151
- ifNotExists: true
1152
- role_menu:
1153
- columns:
1154
- - name: role_id
1155
- type: fk
1156
- isPrimary: true
1157
- references:
1158
- table: role
1159
- column: id
1160
- onDelete: CASCADE
1161
- - name: menu_id
1162
- type: fk
1163
- isPrimary: true
1164
- references:
1165
- table: menu
1166
- column: id
1167
- onDelete: CASCADE
1168
- - type: created_at
1169
- - type: updated_at
1170
- ifNotExists: true
1171
- route_screen:
1172
- columns:
1173
- - name: route_id
1174
- type: fk
1175
- isPrimary: true
1176
- references:
1177
- table: route
1178
- column: id
1179
- onDelete: CASCADE
1180
- - name: screen_id
1181
- type: fk
1182
- isPrimary: true
1183
- references:
1184
- table: screen
1185
- column: id
1186
- onDelete: CASCADE
1187
- - type: created_at
1188
- - type: updated_at
1189
- ifNotExists: true
1190
- role_screen:
1191
- columns:
1192
- - name: role_id
1193
- type: fk
1194
- isPrimary: true
1195
- references:
1196
- table: role
1197
- column: id
1198
- onDelete: CASCADE
1199
- - name: screen_id
1200
- type: fk
1201
- isPrimary: true
1202
- references:
1203
- table: screen
1204
- column: id
1205
- onDelete: CASCADE
1206
- - type: created_at
1207
- - type: updated_at
1208
- ifNotExists: true
1209
- role_user:
1210
- columns:
1211
- - name: role_id
1212
- type: fk
1213
- isPrimary: true
1214
- references:
1215
- table: role
1216
- column: id
1217
- onDelete: CASCADE
1218
- - name: user_id
1219
- type: fk
1220
- isPrimary: true
1221
- references:
1222
- table: user
1223
- column: id
1224
- onDelete: CASCADE
1225
- - type: created_at
1226
- - type: updated_at
1227
- ifNotExists: true
1228
- role_route:
1229
- columns:
1230
- - name: role_id
1231
- type: fk
1232
- isPrimary: true
1233
- references:
1234
- table: role
1235
- column: id
1236
- onDelete: CASCADE
1237
- - name: route_id
1238
- type: fk
1239
- isPrimary: true
1240
- references:
1241
- table: route
1242
- column: id
1243
- onDelete: CASCADE
1244
- - type: created_at
1245
- - type: updated_at
1246
- ifNotExists: true
1247
811
  dashboard:
1248
- columns:
1249
- - type: pk
1250
- - type: slug
1251
- locale:
1252
- en: Slug
1253
- pt: Slug
1254
- - type: created_at
1255
- - type: updated_at
1256
- ifNotExists: true
812
+ - slug: default
1257
813
  dashboard_component:
1258
- columns:
1259
- - type: pk
1260
- - type: slug
1261
- locale:
1262
- en: Slug
1263
- pt: Slug
1264
- - name: path
1265
- type: varchar
1266
- length: 500
1267
- locale:
1268
- en: Path
1269
- pt: Caminho
1270
- - name: min_width
1271
- type: int
1272
- default: 1
1273
- - name: max_width
1274
- type: int
1275
- isNullable: true
1276
- - name: min_height
1277
- type: int
1278
- default: 1
1279
- - name: max_height
1280
- type: int
1281
- isNullable: true
1282
- - name: width
1283
- type: int
1284
- - name: height
1285
- type: int
1286
- - name: is_resizable
1287
- type: boolean
1288
- default: true
1289
- - type: created_at
1290
- - type: updated_at
1291
- ifNotExists: true
1292
- dashboard_component_locale:
1293
- columns:
1294
- - name: component_id
1295
- type: fk
1296
- isPrimary: true
1297
- references:
1298
- table: dashboard_component
1299
- column: id
1300
- onDelete: CASCADE
1301
- - name: locale_id
1302
- type: fk
1303
- isPrimary: true
1304
- references:
1305
- table: locale
1306
- column: id
1307
- onDelete: CASCADE
1308
- - name: name
1309
- type: varchar
1310
- length: 255
1311
- locale:
1312
- en: Name
1313
- pt: Nome
1314
- - type: created_at
1315
- - type: updated_at
1316
- ifNotExists: true
1317
- dashboard_locale:
1318
- columns:
1319
- - name: dashboard_id
1320
- type: fk
1321
- isPrimary: true
1322
- references:
1323
- table: dashboard
1324
- column: id
1325
- onDelete: CASCADE
1326
- - name: locale_id
1327
- type: fk
1328
- isPrimary: true
1329
- references:
1330
- table: locale
1331
- column: id
1332
- onDelete: CASCADE
1333
- - name: name
1334
- type: varchar
1335
- length: 255
1336
- locale:
1337
- en: Name
1338
- pt: Nome
1339
- - type: created_at
1340
- - type: updated_at
1341
- ifNotExists: true
814
+ - slug: system-info
815
+ path: '@/components/dashboard/SystemInfo'
816
+ width: 1
817
+ height: 1
1342
818
  dashboard_item:
1343
- columns:
1344
- - type: pk
1345
- - name: component_id
1346
- type: fk
1347
- references:
1348
- table: dashboard_component
1349
- column: id
1350
- onDelete: CASCADE
1351
- - name: dashboard_id
1352
- type: fk
1353
- references:
1354
- table: dashboard
1355
- column: id
1356
- onDelete: CASCADE
1357
- - name: width
1358
- type: int
1359
- - name: height
1360
- type: int
1361
- - name: x_axis
1362
- type: int
1363
- - name: y_axis
1364
- type: int
1365
- - type: created_at
1366
- - type: updated_at
1367
- ifNotExists: true
1368
- dashboard_user:
1369
- columns:
1370
- - type: pk
1371
- - name: item_id
1372
- type: fk
1373
- references:
1374
- table: dashboard_item
1375
- column: id
1376
- onDelete: CASCADE
1377
- - name: user_id
1378
- type: fk
1379
- references:
1380
- table: user
1381
- column: id
1382
- onDelete: CASCADE
1383
- - name: width
1384
- type: int
1385
- - name: height
1386
- type: int
1387
- - name: x_axis
1388
- type: int
1389
- - name: y_axis
1390
- type: int
1391
- - type: created_at
1392
- - type: updated_at
1393
- ifNotExists: true
819
+ - component_id:
820
+ where:
821
+ slug: system-info
822
+ dashboard_id:
823
+ where:
824
+ slug: default
825
+ width: 2
826
+ height: 5
827
+ x_axis: 0
828
+ y_axis: 0
829
+
1394
830
  screens:
1395
831
  dashboard:
1396
832
  title:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.48.11",
3
+ "version": "0.48.13",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -40,6 +40,7 @@ import { UserModule } from './user/user.module';
40
40
  MenuModule,
41
41
  ScreenModule,
42
42
  LocaleModule,
43
+ SettingModule,
43
44
  ],
44
45
  })
45
46
  export class AdminModule {}
@@ -0,0 +1,12 @@
1
+ import { Controller, Get, Param } from '@nestjs/common';
2
+ import { DashboardCoreService } from './dashboard-core.service';
3
+
4
+ @Controller('dashboard-core')
5
+ export class DashboardCoreController {
6
+ constructor(private readonly dashboardCoreService: DashboardCoreService) {}
7
+
8
+ @Get(':slug')
9
+ fromSlug(@Param('slug') slug: string) {
10
+ return this.dashboardCoreService.fromSlug(slug);
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ import { forwardRef, Module } from '@nestjs/common';
2
+
3
+ import { LocaleModule } from '@hedhog/locale';
4
+ import { PrismaModule } from '@hedhog/prisma';
5
+ import { DashboardCoreController } from './dashboard-core.controller';
6
+ import { DashboardCoreService } from './dashboard-core.service';
7
+
8
+ @Module({
9
+ imports: [forwardRef(() => LocaleModule), forwardRef(() => PrismaModule)],
10
+ controllers: [DashboardCoreController],
11
+ providers: [DashboardCoreService],
12
+ exports: [DashboardCoreService],
13
+ })
14
+ export class DashboardCoreModule {}
@@ -0,0 +1,16 @@
1
+ import { PrismaService } from '@hedhog/prisma';
2
+ import { Injectable } from '@nestjs/common';
3
+
4
+ @Injectable()
5
+ export class DashboardCoreService {
6
+ constructor(private readonly prismaService: PrismaService) {}
7
+
8
+ async fromSlug(slug: string) {
9
+ return this.prismaService.dashboard_item.findMany({
10
+ where: { dashboard: { slug } },
11
+ include: {
12
+ dashboard_user: true,
13
+ },
14
+ });
15
+ }
16
+ }
@@ -1,9 +1,10 @@
1
- import { DashboardComponentModule } from './dashboard-component/dashboard-component.module';
2
- import { DashboardUserModule } from './dashboard-user/dashboard-user.module';
3
- import { DashboardItemModule } from './dashboard-item/dashboard-item.module';
4
1
  import { LocaleModule } from '@hedhog/locale';
5
2
  import { PrismaModule } from '@hedhog/prisma';
6
3
  import { forwardRef, Module } from '@nestjs/common';
4
+ import { DashboardComponentModule } from './dashboard-component/dashboard-component.module';
5
+ import { DashboardCoreModule } from './dashboard-core/dashboard-core.module';
6
+ import { DashboardItemModule } from './dashboard-item/dashboard-item.module';
7
+ import { DashboardUserModule } from './dashboard-user/dashboard-user.module';
7
8
  import { DashboardModule2 } from './dashboard/dashboard.module';
8
9
 
9
10
  @Module({
@@ -14,6 +15,7 @@ import { DashboardModule2 } from './dashboard/dashboard.module';
14
15
  forwardRef(() => DashboardComponentModule),
15
16
  forwardRef(() => DashboardItemModule),
16
17
  forwardRef(() => DashboardUserModule),
18
+ forwardRef(() => DashboardCoreModule),
17
19
  ],
18
20
  controllers: [],
19
21
  providers: [],
@@ -1,9 +1,16 @@
1
- import { Module } from '@nestjs/common';
1
+ import { PaginationModule } from '@hedhog/pagination';
2
+ import { PrismaModule } from '@hedhog/prisma';
3
+ import { Module, forwardRef } from '@nestjs/common';
4
+ import { AuthModule } from '../auth/auth.module';
2
5
  import { SettingsController } from './setting.controller';
3
6
  import { SettingService } from './setting.service';
4
7
 
5
8
  @Module({
6
- imports: [],
9
+ imports: [
10
+ forwardRef(() => AuthModule),
11
+ forwardRef(() => PrismaModule),
12
+ forwardRef(() => PaginationModule),
13
+ ],
7
14
  controllers: [SettingsController],
8
15
  providers: [SettingService],
9
16
  exports: [SettingService],