@hed-hog/core 0.0.167 → 0.0.169

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.
@@ -1,28 +1,74 @@
1
- - slug: system-info
2
- path: system-info
1
+ - slug: active-users-card
3
2
  width: 4
4
3
  height: 14
5
4
  name:
6
- en: System Info
7
- pt: Informações do Sistema
8
- - slug: module-installed
9
- path: module-installed
5
+ en: Active Users
6
+ pt: Usuários Ativos
7
+ description:
8
+ en: Shows the number of active users.
9
+ pt: Mostra o número de usuários ativos.
10
+ - slug: mail-sent-card
10
11
  width: 4
11
12
  height: 14
12
13
  name:
13
- en: Modules Installed
14
- pt: Módulos Instalados
15
- - slug: user-summary
16
- path: user-summary
14
+ en: Mail Sent Card
15
+ pt: Card de E-mails Enviados
16
+ description:
17
+ en: Shows the number of mails sent.
18
+ pt: Mostra o número de e-mails enviados.
19
+ - slug: mail-sent-chart
17
20
  width: 4
18
21
  height: 14
19
22
  name:
20
- en: Users Summary
21
- pt: Resumo de Usuários
22
- - slug: database-stats
23
- path: database-stats
23
+ en: Mail Sent Chart
24
+ pt: Gráfico de E-mails Enviados
25
+ description:
26
+ en: Shows a chart of mails sent over time.
27
+ pt: Mostra um gráfico de e-mails enviados ao longo do tempo.
28
+ - slug: permissions-card
24
29
  width: 12
25
30
  height: 4
26
31
  name:
27
- en: Database Stats
28
- pt: Estatísticas do Banco de Dados
32
+ en: Permissions Card
33
+ pt: Card de Permissões
34
+ description:
35
+ en: Shows the permissions of the current user.
36
+ pt: Mostra as permissões do usuário atual.
37
+ - slug: permissions-chart
38
+ width: 12
39
+ height: 4
40
+ name:
41
+ en: Permissions Chart
42
+ pt: Gráfico de Permissões
43
+ description:
44
+ en: Shows a chart of the permissions of the current user.
45
+ pt: Mostra um gráfico das permissões do usuário atual.
46
+ - slug: session-activity-chart
47
+ width: 12
48
+ height: 4
49
+ name:
50
+ en: Session Activity Chart
51
+ pt: Gráfico de Atividade de Sessão
52
+ description:
53
+ en: Shows a chart of the session activity of the current user.
54
+ pt: Mostra um gráfico da atividade de sessão do usuário atual.
55
+ - slug: sessions-today-card
56
+ width: 12
57
+ height: 4
58
+ name:
59
+ en: Sessions Today Card
60
+ pt: Card de Sessões Hoje
61
+ description:
62
+ en: Shows a card of the sessions today.
63
+ pt: Mostra um card das sessões de hoje.
64
+ - slug: user-growth-chart
65
+ width: 12
66
+ height: 4
67
+ name:
68
+ en: User Growth Chart
69
+ pt: Gráfico de Crescimento de Usuários
70
+ description:
71
+ en: Shows a chart of the user growth over time.
72
+ pt: Mostra um gráfico do crescimento de usuários ao longo do tempo.
73
+
74
+
@@ -1,6 +1,6 @@
1
1
  - component_id:
2
2
  where:
3
- slug: system-info
3
+ slug: active-users-card
4
4
  dashboard_id:
5
5
  where:
6
6
  slug: default
@@ -10,7 +10,7 @@
10
10
  y_axis: 0
11
11
  - component_id:
12
12
  where:
13
- slug: module-installed
13
+ slug: mail-sent-card
14
14
  dashboard_id:
15
15
  where:
16
16
  slug: default
@@ -20,7 +20,7 @@
20
20
  y_axis: 0
21
21
  - component_id:
22
22
  where:
23
- slug: user-summary
23
+ slug: mail-sent-chart
24
24
  dashboard_id:
25
25
  where:
26
26
  slug: default
@@ -30,7 +30,47 @@
30
30
  y_axis: 0
31
31
  - component_id:
32
32
  where:
33
- slug: database-stats
33
+ slug: permissions-card
34
+ dashboard_id:
35
+ where:
36
+ slug: default
37
+ width: 12
38
+ height: 4
39
+ x_axis: 0
40
+ y_axis: 14
41
+ - component_id:
42
+ where:
43
+ slug: permissions-chart
44
+ dashboard_id:
45
+ where:
46
+ slug: default
47
+ width: 12
48
+ height: 4
49
+ x_axis: 0
50
+ y_axis: 14
51
+ - component_id:
52
+ where:
53
+ slug: session-activity-chart
54
+ dashboard_id:
55
+ where:
56
+ slug: default
57
+ width: 12
58
+ height: 4
59
+ x_axis: 0
60
+ y_axis: 14
61
+ - component_id:
62
+ where:
63
+ slug: sessions-today-card
64
+ dashboard_id:
65
+ where:
66
+ slug: default
67
+ width: 12
68
+ height: 4
69
+ x_axis: 0
70
+ y_axis: 14
71
+ - component_id:
72
+ where:
73
+ slug: user-growth-chart
34
74
  dashboard_id:
35
75
  where:
36
76
  slug: default
@@ -4,12 +4,6 @@ columns:
4
4
  locale:
5
5
  en: Slug
6
6
  pt: Slug
7
- - name: path
8
- type: varchar
9
- length: 500
10
- locale:
11
- en: Path
12
- pt: Caminho
13
7
  - name: min_width
14
8
  type: int
15
9
  default: 1
@@ -35,5 +29,11 @@ columns:
35
29
  locale:
36
30
  en: Name
37
31
  pt: Nome
32
+ - name: description
33
+ type: locale_varchar
34
+ length: 512
35
+ locale:
36
+ en: Description
37
+ pt: Descrição
38
38
  - type: created_at
39
39
  - type: updated_at
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/core",
3
- "version": "0.0.167",
3
+ "version": "0.0.169",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -31,8 +31,8 @@
31
31
  "uuid": "^11.1.0",
32
32
  "@hed-hog/api-prisma": "0.0.4",
33
33
  "@hed-hog/api-locale": "0.0.11",
34
- "@hed-hog/api": "0.0.3",
35
34
  "@hed-hog/api-mail": "0.0.7",
35
+ "@hed-hog/api": "0.0.3",
36
36
  "@hed-hog/types": "0.0.1",
37
37
  "@hed-hog/api-pagination": "0.0.5"
38
38
  },
@@ -1,99 +0,0 @@
1
- -- Add description field to dashboard_component_locale table
2
- ALTER TABLE "dashboard_component_locale"
3
- ADD COLUMN IF NOT EXISTS "description" VARCHAR(512);
4
-
5
- -- Add default descriptions for existing dashboard components
6
- DO $$
7
- DECLARE
8
- v_locale_en_id INT;
9
- v_locale_pt_id INT;
10
- v_component_id INT;
11
- BEGIN
12
- SELECT id INTO v_locale_en_id FROM locale WHERE code = 'en' LIMIT 1;
13
- SELECT id INTO v_locale_pt_id FROM locale WHERE code = 'pt' LIMIT 1;
14
-
15
- -- Total Users component
16
- SELECT id INTO v_component_id FROM dashboard_component WHERE slug = 'total-users';
17
- IF v_component_id IS NOT NULL THEN
18
- UPDATE dashboard_component_locale
19
- SET description = 'Displays the total number of registered users in the system'
20
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_en_id;
21
-
22
- IF v_locale_pt_id IS NOT NULL THEN
23
- UPDATE dashboard_component_locale
24
- SET description = 'Exibe o total de usuários registrados no sistema'
25
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_pt_id;
26
- END IF;
27
- END IF;
28
-
29
- -- Recent Users component
30
- SELECT id INTO v_component_id FROM dashboard_component WHERE slug = 'recent-users';
31
- IF v_component_id IS NOT NULL THEN
32
- UPDATE dashboard_component_locale
33
- SET description = 'Shows the number of users registered in the last 30 days'
34
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_en_id;
35
-
36
- IF v_locale_pt_id IS NOT NULL THEN
37
- UPDATE dashboard_component_locale
38
- SET description = 'Mostra o número de usuários registrados nos últimos 30 dias'
39
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_pt_id;
40
- END IF;
41
- END IF;
42
-
43
- -- Active Users component
44
- SELECT id INTO v_component_id FROM dashboard_component WHERE slug = 'active-users';
45
- IF v_component_id IS NOT NULL THEN
46
- UPDATE dashboard_component_locale
47
- SET description = 'Number of users who have logged in recently and are active'
48
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_en_id;
49
-
50
- IF v_locale_pt_id IS NOT NULL THEN
51
- UPDATE dashboard_component_locale
52
- SET description = 'Número de usuários que fizeram login recentemente e estão ativos'
53
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_pt_id;
54
- END IF;
55
- END IF;
56
-
57
- -- Total Roles component
58
- SELECT id INTO v_component_id FROM dashboard_component WHERE slug = 'total-roles';
59
- IF v_component_id IS NOT NULL THEN
60
- UPDATE dashboard_component_locale
61
- SET description = 'Shows the total number of roles configured in the system'
62
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_en_id;
63
-
64
- IF v_locale_pt_id IS NOT NULL THEN
65
- UPDATE dashboard_component_locale
66
- SET description = 'Mostra o total de perfis configurados no sistema'
67
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_pt_id;
68
- END IF;
69
- END IF;
70
-
71
- -- Total Menus component
72
- SELECT id INTO v_component_id FROM dashboard_component WHERE slug = 'total-menus';
73
- IF v_component_id IS NOT NULL THEN
74
- UPDATE dashboard_component_locale
75
- SET description = 'Displays the total number of menu items available to users'
76
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_en_id;
77
-
78
- IF v_locale_pt_id IS NOT NULL THEN
79
- UPDATE dashboard_component_locale
80
- SET description = 'Exibe o total de itens de menu disponíveis para os usuários'
81
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_pt_id;
82
- END IF;
83
- END IF;
84
-
85
- -- Total Routes component
86
- SELECT id INTO v_component_id FROM dashboard_component WHERE slug = 'total-routes';
87
- IF v_component_id IS NOT NULL THEN
88
- UPDATE dashboard_component_locale
89
- SET description = 'Shows the total number of routes registered in the application'
90
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_en_id;
91
-
92
- IF v_locale_pt_id IS NOT NULL THEN
93
- UPDATE dashboard_component_locale
94
- SET description = 'Mostra o total de rotas registradas na aplicação'
95
- WHERE dashboard_component_id = v_component_id AND locale_id = v_locale_pt_id;
96
- END IF;
97
- END IF;
98
-
99
- END $$;
@@ -1,21 +0,0 @@
1
- -- Migration to add metadata fields to dashboard_component table
2
- -- Run this SQL in your database
3
-
4
- -- Add metadata columns to dashboard_component table
5
- ALTER TABLE dashboard_component ADD COLUMN IF NOT EXISTS icon VARCHAR(255);
6
- ALTER TABLE dashboard_component ADD COLUMN IF NOT EXISTS stat_key VARCHAR(255);
7
- ALTER TABLE dashboard_component ADD COLUMN IF NOT EXISTS color VARCHAR(50);
8
-
9
- -- Update existing widgets with metadata
10
- UPDATE dashboard_component SET icon = 'IconUsers', stat_key = 'totalUsers' WHERE slug = 'total-users';
11
- UPDATE dashboard_component SET icon = 'IconUserPlus', stat_key = 'recentUsers' WHERE slug = 'recent-users';
12
- UPDATE dashboard_component SET icon = 'IconUserCheck', stat_key = 'activeUsers' WHERE slug = 'active-users';
13
- UPDATE dashboard_component SET icon = 'IconShield', stat_key = 'totalRoles' WHERE slug = 'total-roles';
14
- UPDATE dashboard_component SET icon = 'IconMenu2', stat_key = 'totalMenus' WHERE slug = 'total-menus';
15
- UPDATE dashboard_component SET icon = 'IconRoute', stat_key = 'totalRoutes' WHERE slug = 'total-routes';
16
- UPDATE dashboard_component SET icon = ' IconInfoCircle', stat_key = NULL WHERE slug = 'system-info';
17
- UPDATE dashboard_component SET icon = 'IconPackage', stat_key = 'totalModules' WHERE slug = 'module-installed';
18
-
19
- -- Optional: Add more widget examples
20
- -- UPDATE dashboard_component SET icon = 'IconSettings', stat_key = 'totalSettings', color = 'primary' WHERE slug = 'total-settings';
21
- -- UPDATE dashboard_component SET icon = 'IconAddressBook', stat_key = 'totalContacts', color = 'secondary' WHERE slug = 'total-contacts';
@@ -1,131 +0,0 @@
1
- -- Dashboard Seed Script (Versão Simplificada)
2
- -- Este script cria os dados iniciais para o sistema de dashboard
3
-
4
- -- Primeiro, criar o dashboard principal
5
- INSERT INTO dashboard (slug, created_at, updated_at)
6
- VALUES ('admin-dashboard', NOW(), NOW())
7
- ON CONFLICT (slug) DO NOTHING;
8
-
9
- -- Criar locales do dashboard
10
- DO $$
11
- DECLARE
12
- v_dashboard_id INT;
13
- v_locale_en_id INT;
14
- v_locale_pt_id INT;
15
- BEGIN
16
- SELECT id INTO v_dashboard_id FROM dashboard WHERE slug = 'admin-dashboard';
17
- SELECT id INTO v_locale_en_id FROM locale WHERE code = 'en' LIMIT 1;
18
- SELECT id INTO v_locale_pt_id FROM locale WHERE code = 'pt' LIMIT 1;
19
-
20
- IF NOT EXISTS (SELECT 1 FROM dashboard_locale WHERE dashboard_id = v_dashboard_id AND locale_id = v_locale_en_id) THEN
21
- INSERT INTO dashboard_locale (locale_id, dashboard_id, name, created_at, updated_at)
22
- VALUES (v_locale_en_id, v_dashboard_id, 'Admin Dashboard', NOW(), NOW());
23
- END IF;
24
-
25
- IF v_locale_pt_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM dashboard_locale WHERE dashboard_id = v_dashboard_id AND locale_id = v_locale_pt_id) THEN
26
- INSERT INTO dashboard_locale (locale_id, dashboard_id, name, created_at, updated_at)
27
- VALUES (v_locale_pt_id, v_dashboard_id, 'Dashboard Admin', NOW(), NOW());
28
- END IF;
29
- END $$;
30
-
31
- -- Criar componentes de dashboard
32
- DO $$
33
- DECLARE
34
- v_locale_en_id INT;
35
- v_locale_pt_id INT;
36
- v_component_id INT;
37
- BEGIN
38
- SELECT id INTO v_locale_en_id FROM locale WHERE code = 'en' LIMIT 1;
39
- SELECT id INTO v_locale_pt_id FROM locale WHERE code = 'pt' LIMIT 1;
40
-
41
- -- Componente: Total de Usuários
42
- INSERT INTO dashboard_component (slug, path, min_width, max_width, min_height, max_height, width, height, is_resizable, created_at, updated_at)
43
- VALUES ('total-users', '/widgets/total-users', 2, 6, 1, 2, 3, 2, true, NOW(), NOW())
44
- ON CONFLICT (slug) DO UPDATE SET updated_at = NOW()
45
- RETURNING id INTO v_component_id;
46
-
47
- IF NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_en_id AND dashboard_component_id = v_component_id) THEN
48
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
49
- VALUES (v_locale_en_id, v_component_id, 'Total Users', NOW(), NOW());
50
- END IF;
51
- IF v_locale_pt_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_pt_id AND dashboard_component_id = v_component_id) THEN
52
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
53
- VALUES (v_locale_pt_id, v_component_id, 'Total de Usuários', NOW(), NOW());
54
- END IF;
55
-
56
- -- Componente: Usuários Recentes
57
- INSERT INTO dashboard_component (slug, path, min_width, max_width, min_height, max_height, width, height, is_resizable, created_at, updated_at)
58
- VALUES ('recent-users', '/widgets/recent-users', 2, 6, 1, 2, 3, 2, true, NOW(), NOW())
59
- ON CONFLICT (slug) DO UPDATE SET updated_at = NOW()
60
- RETURNING id INTO v_component_id;
61
-
62
- IF NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_en_id AND dashboard_component_id = v_component_id) THEN
63
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
64
- VALUES (v_locale_en_id, v_component_id, 'Recent Users', NOW(), NOW());
65
- END IF;
66
- IF v_locale_pt_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_pt_id AND dashboard_component_id = v_component_id) THEN
67
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
68
- VALUES (v_locale_pt_id, v_component_id, 'Usuários Recentes', NOW(), NOW());
69
- END IF;
70
-
71
- -- Componente: Usuários Ativos
72
- INSERT INTO dashboard_component (slug, path, min_width, max_width, min_height, max_height, width, height, is_resizable, created_at, updated_at)
73
- VALUES ('active-users', '/widgets/active-users', 2, 6, 1, 2, 3, 2, true, NOW(), NOW())
74
- ON CONFLICT (slug) DO UPDATE SET updated_at = NOW()
75
- RETURNING id INTO v_component_id;
76
-
77
- IF NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_en_id AND dashboard_component_id = v_component_id) THEN
78
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
79
- VALUES (v_locale_en_id, v_component_id, 'Active Users', NOW(), NOW());
80
- END IF;
81
- IF v_locale_pt_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_pt_id AND dashboard_component_id = v_component_id) THEN
82
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
83
- VALUES (v_locale_pt_id, v_component_id, 'Usuários Ativos', NOW(), NOW());
84
- END IF;
85
-
86
- -- Componente: Total de Roles
87
- INSERT INTO dashboard_component (slug, path, min_width, max_width, min_height, max_height, width, height, is_resizable, created_at, updated_at)
88
- VALUES ('total-roles', '/widgets/total-roles', 2, 6, 1, 2, 3, 2, true, NOW(), NOW())
89
- ON CONFLICT (slug) DO UPDATE SET updated_at = NOW()
90
- RETURNING id INTO v_component_id;
91
-
92
- IF NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_en_id AND dashboard_component_id = v_component_id) THEN
93
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
94
- VALUES (v_locale_en_id, v_component_id, 'Total Roles', NOW(), NOW());
95
- END IF;
96
- IF v_locale_pt_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_pt_id AND dashboard_component_id = v_component_id) THEN
97
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
98
- VALUES (v_locale_pt_id, v_component_id, 'Total de Perfis', NOW(), NOW());
99
- END IF;
100
-
101
- -- Componente: Total de Menus
102
- INSERT INTO dashboard_component (slug, path, min_width, max_width, min_height, max_height, width, height, is_resizable, created_at, updated_at)
103
- VALUES ('total-menus', '/widgets/total-menus', 2, 6, 1, 2, 3, 2, true, NOW(), NOW())
104
- ON CONFLICT (slug) DO UPDATE SET updated_at = NOW()
105
- RETURNING id INTO v_component_id;
106
-
107
- IF NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_en_id AND dashboard_component_id = v_component_id) THEN
108
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
109
- VALUES (v_locale_en_id, v_component_id, 'Total Menus', NOW(), NOW());
110
- END IF;
111
- IF v_locale_pt_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_pt_id AND dashboard_component_id = v_component_id) THEN
112
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
113
- VALUES (v_locale_pt_id, v_component_id, 'Total de Menus', NOW(), NOW());
114
- END IF;
115
-
116
- -- Componente: Total de Rotas
117
- INSERT INTO dashboard_component (slug, path, min_width, max_width, min_height, max_height, width, height, is_resizable, created_at, updated_at)
118
- VALUES ('total-routes', '/widgets/total-routes', 2, 6, 1, 2, 3, 2, true, NOW(), NOW())
119
- ON CONFLICT (slug) DO UPDATE SET updated_at = NOW()
120
- RETURNING id INTO v_component_id;
121
-
122
- IF NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_en_id AND dashboard_component_id = v_component_id) THEN
123
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
124
- VALUES (v_locale_en_id, v_component_id, 'Total Routes', NOW(), NOW());
125
- END IF;
126
- IF v_locale_pt_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM dashboard_component_locale WHERE locale_id = v_locale_pt_id AND dashboard_component_id = v_component_id) THEN
127
- INSERT INTO dashboard_component_locale (locale_id, dashboard_component_id, name, created_at, updated_at)
128
- VALUES (v_locale_pt_id, v_component_id, 'Total de Rotas', NOW(), NOW());
129
- END IF;
130
-
131
- END $$;
@@ -1,82 +0,0 @@
1
- -- Fix: Add stat_key, icon and color columns to dashboard_component table
2
- -- This ensures all widgets have proper stat_key to display values
3
-
4
- -- Step 1: Add columns if they don't exist
5
- ALTER TABLE dashboard_component
6
- ADD COLUMN IF NOT EXISTS stat_key VARCHAR(255),
7
- ADD COLUMN IF NOT EXISTS icon VARCHAR(255),
8
- ADD COLUMN IF NOT EXISTS color VARCHAR(50);
9
-
10
- -- Step 2: Update existing widgets with proper values
11
-
12
- -- Total Users Widget
13
- UPDATE dashboard_component
14
- SET
15
- stat_key = 'totalUsers',
16
- icon = COALESCE(icon, 'IconUsers'),
17
- color = COALESCE(color, '#3b82f6')
18
- WHERE slug = 'total-users';
19
-
20
- -- Recent Users Widget
21
- UPDATE dashboard_component
22
- SET
23
- stat_key = 'recentUsers',
24
- icon = COALESCE(icon, 'IconUserPlus'),
25
- color = COALESCE(color, '#10b981')
26
- WHERE slug = 'recent-users';
27
-
28
- -- Active Users Widget
29
- UPDATE dashboard_component
30
- SET
31
- stat_key = 'activeUsers',
32
- icon = COALESCE(icon, 'IconUserCheck'),
33
- color = COALESCE(color, '#8b5cf6')
34
- WHERE slug = 'active-users';
35
-
36
- -- Total Roles Widget
37
- UPDATE dashboard_component
38
- SET
39
- stat_key = 'totalRoles',
40
- icon = COALESCE(icon, 'IconShield'),
41
- color = COALESCE(color, '#f59e0b')
42
- WHERE slug = 'total-roles';
43
-
44
- -- Total Menus Widget
45
- UPDATE dashboard_component
46
- SET
47
- stat_key = 'totalMenus',
48
- icon = COALESCE(icon, 'IconMenu2'),
49
- color = COALESCE(color, '#ec4899')
50
- WHERE slug = 'total-menus';
51
-
52
- -- Total Routes Widget
53
- UPDATE dashboard_component
54
- SET
55
- stat_key = 'totalRoutes',
56
- icon = COALESCE(icon, 'IconRoute'),
57
- color = COALESCE(color, '#06b6d4')
58
- WHERE slug = 'total-routes';
59
-
60
- -- System Info / Modules Widget
61
- UPDATE dashboard_component
62
- SET
63
- stat_key = 'totalModules',
64
- icon = COALESCE(icon, 'IconPackage'),
65
- color = COALESCE(color, '#6366f1')
66
- WHERE slug = 'system-info';
67
-
68
- -- Module Installed / Settings Widget
69
- UPDATE dashboard_component
70
- SET
71
- stat_key = 'totalSettings',
72
- icon = COALESCE(icon, 'IconSettings'),
73
- color = COALESCE(color, '#64748b')
74
- WHERE slug = 'module-installed';
75
-
76
- -- Contacts Widget (if exists)
77
- UPDATE dashboard_component
78
- SET
79
- stat_key = 'totalContacts',
80
- icon = COALESCE(icon, 'IconAddressBook'),
81
- color = COALESCE(color, '#f97316')
82
- WHERE slug = 'total-contacts';