@hed-hog/core 0.0.332 → 0.0.338
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/auth/auth.controller.d.ts +17 -3
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.service.d.ts +22 -8
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-user/dashboard-user.controller.d.ts +3 -3
- package/dist/dashboard/dashboard-user/dashboard-user.service.d.ts +3 -3
- package/dist/route/route.service.d.ts.map +1 -1
- package/dist/route/route.service.js +0 -14
- package/dist/route/route.service.js.map +1 -1
- package/dist/session/session.controller.d.ts +1 -1
- package/dist/session/session.service.d.ts +3 -3
- package/dist/user/user.controller.d.ts +17 -3
- package/dist/user/user.controller.d.ts.map +1 -1
- package/dist/user/user.service.d.ts +35 -7
- package/dist/user/user.service.d.ts.map +1 -1
- package/dist/user/user.service.js +5 -0
- package/dist/user/user.service.js.map +1 -1
- package/hedhog/data/menu.yaml +4 -18
- package/hedhog/frontend/app/ai_agent/page.tsx.ejs +6 -1
- package/hedhog/frontend/app/dashboard/[slug]/dashboard-content.tsx.ejs +6 -1
- package/hedhog/frontend/app/dashboard/management/tabs/component-roles-tab.tsx.ejs +6 -1
- package/hedhog/frontend/app/dashboard/management/tabs/components-tab.tsx.ejs +6 -1
- package/hedhog/frontend/app/dashboard/management/tabs/dashboard-roles-tab.tsx.ejs +6 -1
- package/hedhog/frontend/app/dashboard/management/tabs/dashboards-tab.tsx.ejs +6 -1
- package/hedhog/frontend/app/dashboard/management/tabs/items-tab.tsx.ejs +6 -1
- package/hedhog/frontend/app/mail/log/page.tsx.ejs +6 -1
- package/hedhog/frontend/app/roles/menus.tsx.ejs +6 -1
- package/hedhog/frontend/app/roles/routes.tsx.ejs +18 -5
- package/hedhog/frontend/app/roles/users.tsx.ejs +6 -1
- package/hedhog/frontend/app/users/page.tsx.ejs +6 -1
- package/hedhog/frontend/messages/en.json +0 -74
- package/hedhog/frontend/messages/pt.json +0 -74
- package/package.json +5 -5
- package/src/route/route.service.ts +0 -14
- package/src/user/user.service.ts +5 -0
- package/hedhog/frontend/app/routes/page.tsx.ejs +0 -1339
package/hedhog/data/menu.yaml
CHANGED
|
@@ -63,25 +63,11 @@
|
|
|
63
63
|
role:
|
|
64
64
|
- where:
|
|
65
65
|
slug: admin
|
|
66
|
-
- menu_id:
|
|
67
|
-
where:
|
|
68
|
-
slug: /core/management
|
|
69
|
-
url: /core/routes
|
|
70
|
-
order: 2
|
|
71
|
-
icon: route
|
|
72
|
-
name:
|
|
73
|
-
en: Routes
|
|
74
|
-
pt: Rotas
|
|
75
|
-
slug: /core/routes
|
|
76
|
-
relations:
|
|
77
|
-
role:
|
|
78
|
-
- where:
|
|
79
|
-
slug: admin
|
|
80
66
|
- menu_id:
|
|
81
67
|
where:
|
|
82
68
|
slug: /core/management
|
|
83
69
|
url: /core/configurations
|
|
84
|
-
order:
|
|
70
|
+
order: 2
|
|
85
71
|
icon: settings-2
|
|
86
72
|
name:
|
|
87
73
|
en: Configurations
|
|
@@ -95,7 +81,7 @@
|
|
|
95
81
|
where:
|
|
96
82
|
slug: /core/management
|
|
97
83
|
url: /core/mail
|
|
98
|
-
order:
|
|
84
|
+
order: 3
|
|
99
85
|
icon: mail
|
|
100
86
|
name:
|
|
101
87
|
en: Emails
|
|
@@ -157,7 +143,7 @@
|
|
|
157
143
|
where:
|
|
158
144
|
slug: /core/management
|
|
159
145
|
url: /core/ai_agent
|
|
160
|
-
order:
|
|
146
|
+
order: 6
|
|
161
147
|
icon: bot
|
|
162
148
|
name:
|
|
163
149
|
en: AI Agents
|
|
@@ -171,7 +157,7 @@
|
|
|
171
157
|
where:
|
|
172
158
|
slug: /core/management
|
|
173
159
|
url: /core/integrations-webhooks
|
|
174
|
-
order:
|
|
160
|
+
order: 7
|
|
175
161
|
icon: webhook
|
|
176
162
|
name:
|
|
177
163
|
en: Integrations and Webhooks
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
import { Textarea } from '@/components/ui/textarea';
|
|
55
55
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
56
56
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
57
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
57
58
|
import { formatDateTime } from '@/lib/format-date';
|
|
58
59
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
59
60
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
@@ -133,7 +134,11 @@ export default function AiAgentPage() {
|
|
|
133
134
|
instructions: z.string().optional(),
|
|
134
135
|
});
|
|
135
136
|
const [page, setPage] = useState(1);
|
|
136
|
-
const [pageSize, setPageSize] =
|
|
137
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
138
|
+
storageKey: 'pagination:global:pageSize',
|
|
139
|
+
defaultValue: 10,
|
|
140
|
+
allowedValues: [6, 12, 24, 48],
|
|
141
|
+
});
|
|
137
142
|
const [searchQuery, setSearchQuery] = useState('');
|
|
138
143
|
const debouncedSearch = useDebounce(searchQuery, 400);
|
|
139
144
|
|
|
@@ -14,6 +14,7 @@ import { SidebarTrigger } from '@/components/ui/sidebar';
|
|
|
14
14
|
import { Skeleton } from '@/components/ui/skeleton';
|
|
15
15
|
import { useIsMobile } from '@/components/ui/use-mobile';
|
|
16
16
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
17
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
17
18
|
import { useProgress } from '@bprogress/next';
|
|
18
19
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
19
20
|
import { IconDeviceFloppy, IconLoader2 } from '@tabler/icons-react';
|
|
@@ -183,7 +184,11 @@ export const DashboardContent = ({
|
|
|
183
184
|
const [hasChanges, setHasChanges] = useState(false);
|
|
184
185
|
const [isSaving, setIsSaving] = useState(false);
|
|
185
186
|
const [componentsPage, setComponentsPage] = useState(1);
|
|
186
|
-
const [componentsPageSize, setComponentsPageSize] =
|
|
187
|
+
const [componentsPageSize, setComponentsPageSize] = usePersistedPageSize({
|
|
188
|
+
storageKey: 'pagination:global:pageSize',
|
|
189
|
+
defaultValue: 12,
|
|
190
|
+
allowedValues: [6, 12, 24, 48],
|
|
191
|
+
});
|
|
187
192
|
const [componentsSearchQuery, setComponentsSearchQuery] = useState('');
|
|
188
193
|
const [componentsModuleFilter, setComponentsModuleFilter] = useState('all');
|
|
189
194
|
const [headerActionsTarget, setHeaderActionsTarget] =
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
} from '@/components/ui/table';
|
|
47
47
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
48
48
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
49
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
49
50
|
import { formatDateTime } from '@/lib/format-date';
|
|
50
51
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
51
52
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
@@ -146,7 +147,11 @@ export function ComponentRolesTab() {
|
|
|
146
147
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
147
148
|
const [roleToDelete, setRoleToDelete] = useState<number | null>(null);
|
|
148
149
|
const [page, setPage] = useState(1);
|
|
149
|
-
const [pageSize, setPageSize] =
|
|
150
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
151
|
+
storageKey: 'pagination:global:pageSize',
|
|
152
|
+
defaultValue: 10,
|
|
153
|
+
allowedValues: [10, 20, 30, 50],
|
|
154
|
+
});
|
|
150
155
|
const searchQuery = '';
|
|
151
156
|
const debouncedSearch = useDebounce(searchQuery, 500);
|
|
152
157
|
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
TooltipTrigger,
|
|
54
54
|
} from '@/components/ui/tooltip';
|
|
55
55
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
56
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
56
57
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
57
58
|
import * as TablerIcons from '@tabler/icons-react';
|
|
58
59
|
import {
|
|
@@ -132,7 +133,11 @@ export function ComponentsTab() {
|
|
|
132
133
|
useState<Component | null>(null);
|
|
133
134
|
const [selectedRoleIds, setSelectedRoleIds] = useState<number[]>([]);
|
|
134
135
|
const [page, setPage] = useState(1);
|
|
135
|
-
const [pageSize, setPageSize] =
|
|
136
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
137
|
+
storageKey: 'pagination:global:pageSize',
|
|
138
|
+
defaultValue: 10,
|
|
139
|
+
allowedValues: [10, 20, 30, 50],
|
|
140
|
+
});
|
|
136
141
|
const [searchQuery, setSearchQuery] = useState('');
|
|
137
142
|
const [roleSearchQuery, setRoleSearchQuery] = useState('');
|
|
138
143
|
const debouncedSearch = useDebounce(searchQuery, 500);
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
} from '@/components/ui/table';
|
|
47
47
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
48
48
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
49
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
49
50
|
import { formatDateTime } from '@/lib/format-date';
|
|
50
51
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
51
52
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
@@ -145,7 +146,11 @@ export function DashboardRolesTab() {
|
|
|
145
146
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
146
147
|
const [roleToDelete, setRoleToDelete] = useState<number | null>(null);
|
|
147
148
|
const [page, setPage] = useState(1);
|
|
148
|
-
const [pageSize, setPageSize] =
|
|
149
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
150
|
+
storageKey: 'pagination:global:pageSize',
|
|
151
|
+
defaultValue: 10,
|
|
152
|
+
allowedValues: [10, 20, 30, 50],
|
|
153
|
+
});
|
|
149
154
|
const searchQuery = '';
|
|
150
155
|
const debouncedSearch = useDebounce(searchQuery, 500);
|
|
151
156
|
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
TooltipTrigger,
|
|
54
54
|
} from '@/components/ui/tooltip';
|
|
55
55
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
56
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
56
57
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
57
58
|
import {
|
|
58
59
|
IconChevronLeft,
|
|
@@ -119,7 +120,11 @@ export function DashboardsTab() {
|
|
|
119
120
|
useState<Dashboard | null>(null);
|
|
120
121
|
const [selectedRoleIds, setSelectedRoleIds] = useState<number[]>([]);
|
|
121
122
|
const [page, setPage] = useState(1);
|
|
122
|
-
const [pageSize, setPageSize] =
|
|
123
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
124
|
+
storageKey: 'pagination:global:pageSize',
|
|
125
|
+
defaultValue: 10,
|
|
126
|
+
allowedValues: [10, 20, 30, 50],
|
|
127
|
+
});
|
|
123
128
|
const [searchQuery, setSearchQuery] = useState('');
|
|
124
129
|
const [roleSearchQuery, setRoleSearchQuery] = useState('');
|
|
125
130
|
const debouncedSearch = useDebounce(searchQuery, 500);
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
} from '@/components/ui/table';
|
|
47
47
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
48
48
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
49
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
49
50
|
import { formatDateTime } from '@/lib/format-date';
|
|
50
51
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
51
52
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
@@ -143,7 +144,11 @@ export function ItemsTab() {
|
|
|
143
144
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
144
145
|
const [itemToDelete, setItemToDelete] = useState<number | null>(null);
|
|
145
146
|
const [page, setPage] = useState(1);
|
|
146
|
-
const [pageSize, setPageSize] =
|
|
147
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
148
|
+
storageKey: 'pagination:global:pageSize',
|
|
149
|
+
defaultValue: 10,
|
|
150
|
+
allowedValues: [10, 20, 30, 50],
|
|
151
|
+
});
|
|
147
152
|
const searchQuery = '';
|
|
148
153
|
const debouncedSearch = useDebounce(searchQuery, 500);
|
|
149
154
|
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
} from '@/components/ui/table';
|
|
32
32
|
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';
|
|
33
33
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
34
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
34
35
|
import { formatDate } from '@/lib/format-date';
|
|
35
36
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
36
37
|
import {
|
|
@@ -110,7 +111,11 @@ export default function MailLogPage() {
|
|
|
110
111
|
const debouncedSearch = useDebounce(searchTerm);
|
|
111
112
|
const debouncedRecipientEmail = useDebounce(recipientEmail);
|
|
112
113
|
const [page, setPage] = useState(1);
|
|
113
|
-
const [pageSize, setPageSize] =
|
|
114
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
115
|
+
storageKey: 'pagination:global:pageSize',
|
|
116
|
+
defaultValue: 10,
|
|
117
|
+
allowedValues: [10, 20, 30, 40, 50],
|
|
118
|
+
});
|
|
114
119
|
const { request, getSettingValue } = useApp();
|
|
115
120
|
|
|
116
121
|
const {
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
SelectValue,
|
|
18
18
|
} from '@/components/ui/select';
|
|
19
19
|
import { Switch } from '@/components/ui/switch';
|
|
20
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
20
21
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
21
22
|
import * as TablerIcons from '@tabler/icons-react';
|
|
22
23
|
import {
|
|
@@ -62,7 +63,11 @@ export function RoleMenusSection({
|
|
|
62
63
|
const { request, currentLocaleCode } = useApp();
|
|
63
64
|
const [togglingMenuId, setTogglingMenuId] = useState<number | null>(null);
|
|
64
65
|
const [page, setPage] = useState(1);
|
|
65
|
-
const [pageSize, setPageSize] =
|
|
66
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
67
|
+
storageKey: 'pagination:global:pageSize',
|
|
68
|
+
defaultValue: 10,
|
|
69
|
+
allowedValues: [10, 20, 30, 40, 50],
|
|
70
|
+
});
|
|
66
71
|
const [expandedMenus, setExpandedMenus] = useState<string[]>([]);
|
|
67
72
|
|
|
68
73
|
const {
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from '@/components/ui/select';
|
|
15
15
|
import { Switch } from '@/components/ui/switch';
|
|
16
16
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
17
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
17
18
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
18
19
|
import {
|
|
19
20
|
ChevronLeft,
|
|
@@ -31,7 +32,7 @@ import { toast } from 'sonner';
|
|
|
31
32
|
type RouteType = {
|
|
32
33
|
id: number;
|
|
33
34
|
url: string;
|
|
34
|
-
method: string;
|
|
35
|
+
method: string | null;
|
|
35
36
|
description?: string;
|
|
36
37
|
role_route?: Array<{
|
|
37
38
|
route_id: number;
|
|
@@ -46,6 +47,13 @@ type RoleRoutesSectionProps = {
|
|
|
46
47
|
|
|
47
48
|
type SearchType = 'contains' | 'startsWith' | 'endsWith';
|
|
48
49
|
|
|
50
|
+
const UNKNOWN_METHOD_LABEL = '-';
|
|
51
|
+
|
|
52
|
+
const normalizeRouteMethod = (method: string | null) => {
|
|
53
|
+
const normalizedMethod = method?.trim().toUpperCase();
|
|
54
|
+
return normalizedMethod || UNKNOWN_METHOD_LABEL;
|
|
55
|
+
};
|
|
56
|
+
|
|
49
57
|
export function RoleRoutesSection({
|
|
50
58
|
roleId,
|
|
51
59
|
onRouteChange,
|
|
@@ -54,7 +62,11 @@ export function RoleRoutesSection({
|
|
|
54
62
|
const { request } = useApp();
|
|
55
63
|
const [togglingRouteId, setTogglingRouteId] = useState<number | null>(null);
|
|
56
64
|
const [page, setPage] = useState(1);
|
|
57
|
-
const [pageSize, setPageSize] =
|
|
65
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
66
|
+
storageKey: 'pagination:global:pageSize',
|
|
67
|
+
defaultValue: 10,
|
|
68
|
+
allowedValues: [10, 20, 30, 40, 50],
|
|
69
|
+
});
|
|
58
70
|
const [searchTerm, setSearchTerm] = useState('');
|
|
59
71
|
const [searchType, setSearchType] = useState<SearchType>('contains');
|
|
60
72
|
const [methodFilter, setMethodFilter] = useState<string>('all');
|
|
@@ -170,7 +182,7 @@ export function RoleRoutesSection({
|
|
|
170
182
|
return !!(assignedRoute?.role_route && assignedRoute.role_route.length > 0);
|
|
171
183
|
};
|
|
172
184
|
|
|
173
|
-
const getMethodColor = (method: string) => {
|
|
185
|
+
const getMethodColor = (method: string | null) => {
|
|
174
186
|
const colors: Record<string, string> = {
|
|
175
187
|
GET: 'bg-blue-100 text-blue-700',
|
|
176
188
|
POST: 'bg-green-100 text-green-700',
|
|
@@ -178,7 +190,7 @@ export function RoleRoutesSection({
|
|
|
178
190
|
PATCH: 'bg-purple-100 text-purple-700',
|
|
179
191
|
DELETE: 'bg-red-100 text-red-700',
|
|
180
192
|
};
|
|
181
|
-
return colors[method
|
|
193
|
+
return colors[normalizeRouteMethod(method)] || 'bg-gray-100 text-gray-700';
|
|
182
194
|
};
|
|
183
195
|
|
|
184
196
|
if (isLoadingRoutes || isLoadingAssigned) {
|
|
@@ -247,6 +259,7 @@ export function RoleRoutesSection({
|
|
|
247
259
|
routes.map((route) => {
|
|
248
260
|
const isAssigned = isRouteAssigned(route);
|
|
249
261
|
const isToggling = togglingRouteId === route.id;
|
|
262
|
+
const methodLabel = normalizeRouteMethod(route.method);
|
|
250
263
|
|
|
251
264
|
return (
|
|
252
265
|
<Card
|
|
@@ -277,7 +290,7 @@ export function RoleRoutesSection({
|
|
|
277
290
|
route.method
|
|
278
291
|
)}`}
|
|
279
292
|
>
|
|
280
|
-
{
|
|
293
|
+
{methodLabel}
|
|
281
294
|
</span>
|
|
282
295
|
<Label
|
|
283
296
|
htmlFor={`route-${route.id}`}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from '@/components/ui/select';
|
|
16
16
|
import { Switch } from '@/components/ui/switch';
|
|
17
17
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
18
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
18
19
|
import { getPhotoUrl } from '@/lib/get-photo-url';
|
|
19
20
|
import { getUserEmail } from '@/lib/get-user-email';
|
|
20
21
|
import { User } from '@hed-hog/api-types';
|
|
@@ -45,7 +46,11 @@ export function RoleUsersSection({
|
|
|
45
46
|
const { request } = useApp();
|
|
46
47
|
const [togglingUserId, setTogglingUserId] = useState<number | null>(null);
|
|
47
48
|
const [page, setPage] = useState(1);
|
|
48
|
-
const [pageSize, setPageSize] =
|
|
49
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
50
|
+
storageKey: 'pagination:global:pageSize',
|
|
51
|
+
defaultValue: 10,
|
|
52
|
+
allowedValues: [10, 20, 30, 40, 50],
|
|
53
|
+
});
|
|
49
54
|
const [searchTerm, setSearchTerm] = useState('');
|
|
50
55
|
const debouncedSearch = useDebounce(searchTerm);
|
|
51
56
|
|
|
@@ -21,6 +21,7 @@ import { PaginatedResult } from '@/types/pagination-result';
|
|
|
21
21
|
import { User, UserMfa } from '@hed-hog/api-types';
|
|
22
22
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
23
23
|
import { Mail, ShieldCheck, UserPlus, Users } from 'lucide-react';
|
|
24
|
+
import { usePersistedPageSize } from '@/hooks/use-persisted-page-size';
|
|
24
25
|
import { useTranslations } from 'next-intl';
|
|
25
26
|
import { useState } from 'react';
|
|
26
27
|
import { UserSheet } from './user-sheet';
|
|
@@ -43,7 +44,11 @@ export default function UserPage() {
|
|
|
43
44
|
const [selectedUserId, setSelectedUserId] = useState<number | null>(null);
|
|
44
45
|
|
|
45
46
|
const [page, setPage] = useState(1);
|
|
46
|
-
const [pageSize, setPageSize] =
|
|
47
|
+
const [pageSize, setPageSize] = usePersistedPageSize({
|
|
48
|
+
storageKey: 'pagination:global:pageSize',
|
|
49
|
+
defaultValue: 12,
|
|
50
|
+
allowedValues: [6, 12, 24, 48],
|
|
51
|
+
});
|
|
47
52
|
const [statusFilter, setStatusFilter] = useState('all');
|
|
48
53
|
|
|
49
54
|
const {
|
|
@@ -341,80 +341,6 @@
|
|
|
341
341
|
"goToNextPage": "Go to next page",
|
|
342
342
|
"goToLastPage": "Go to last page"
|
|
343
343
|
},
|
|
344
|
-
"RoutePage": {
|
|
345
|
-
"title": "Routes Management",
|
|
346
|
-
"description": "Manage HTTP routes, MCP tools, and their relationships.",
|
|
347
|
-
"routes": "Routes",
|
|
348
|
-
"home": "Home",
|
|
349
|
-
"buttonAddRoute": "Add route",
|
|
350
|
-
"buttonEditRoute": "Edit",
|
|
351
|
-
"buttonDeleteRoute": "Delete route",
|
|
352
|
-
"dialogAddRouteTitle": "Add new route",
|
|
353
|
-
"dialogAddRouteDescription": "Register an HTTP route or MCP tool and then relate roles and screens.",
|
|
354
|
-
"titleEditRoute": "Edit route",
|
|
355
|
-
"searchPlaceholder": "Search by URL, method, name, or tool...",
|
|
356
|
-
"viewMode": "View",
|
|
357
|
-
"viewModeCards": "Cards",
|
|
358
|
-
"viewModeList": "List",
|
|
359
|
-
"selectType": "Type",
|
|
360
|
-
"selectMethod": "HTTP method",
|
|
361
|
-
"allTypes": "All types",
|
|
362
|
-
"allMethods": "All methods",
|
|
363
|
-
"totalRoutes": "Total routes",
|
|
364
|
-
"httpRoutes": "HTTP routes",
|
|
365
|
-
"mcpRoutes": "MCP tools",
|
|
366
|
-
"filteredRoutes": "Results",
|
|
367
|
-
"noRoutesFound": "No routes found",
|
|
368
|
-
"emptyDescription": "Adjust the filters or create the first route to get started.",
|
|
369
|
-
"routeCreatedSuccess": "Route created successfully",
|
|
370
|
-
"routeUpdatedSuccess": "Route updated successfully",
|
|
371
|
-
"routeDeletedSuccess": "Route deleted successfully",
|
|
372
|
-
"serverError": "An error occurred. Please try again later.",
|
|
373
|
-
"tabBasicInfo": "Information",
|
|
374
|
-
"tabRoles": "Roles",
|
|
375
|
-
"tabScreens": "Screens",
|
|
376
|
-
"basicInfoTitle": "Route details",
|
|
377
|
-
"basicInfoDescription": "Define the route type and the data needed to identify it in the system.",
|
|
378
|
-
"formTypeLabel": "Type",
|
|
379
|
-
"formUrlLabel": "URL",
|
|
380
|
-
"formUrlPlaceholder": "/users/:id",
|
|
381
|
-
"formMethodLabel": "Method",
|
|
382
|
-
"formToolNameLabel": "Tool name",
|
|
383
|
-
"formToolNamePlaceholder": "core.users.routes",
|
|
384
|
-
"formNameLabel": "Display name",
|
|
385
|
-
"formNamePlaceholder": "List user routes",
|
|
386
|
-
"formOptionalNameLabel": "Internal name",
|
|
387
|
-
"formOptionalNamePlaceholder": "User read access",
|
|
388
|
-
"errorUrlRequired": "URL is required for HTTP routes",
|
|
389
|
-
"errorMethodRequired": "Method is required for HTTP routes",
|
|
390
|
-
"errorToolNameRequired": "Tool name is required for MCP routes",
|
|
391
|
-
"saveChanges": "Save changes",
|
|
392
|
-
"cancel": "Cancel",
|
|
393
|
-
"rolesTitle": "Linked roles",
|
|
394
|
-
"rolesDescription": "Enable or disable access to this route by role.",
|
|
395
|
-
"loadingRoles": "Loading roles...",
|
|
396
|
-
"searchRoles": "Search roles...",
|
|
397
|
-
"noRolesFound": "No roles found",
|
|
398
|
-
"roleAssigned": "Role linked successfully",
|
|
399
|
-
"roleRemoved": "Role removed successfully",
|
|
400
|
-
"errorAssigningRole": "Error linking role",
|
|
401
|
-
"errorRemovingRole": "Error removing role",
|
|
402
|
-
"screensTitle": "Linked screens",
|
|
403
|
-
"screensDescription": "Define which screens use or represent this route.",
|
|
404
|
-
"loadingScreens": "Loading screens...",
|
|
405
|
-
"searchScreens": "Search screens...",
|
|
406
|
-
"noScreensFound": "No screens found",
|
|
407
|
-
"screenAssigned": "Screen linked successfully",
|
|
408
|
-
"screenRemoved": "Screen removed successfully",
|
|
409
|
-
"errorAssigningScreen": "Error linking screen",
|
|
410
|
-
"errorRemovingScreen": "Error removing screen",
|
|
411
|
-
"rolesCount": "{count} roles",
|
|
412
|
-
"screensCount": "{count} screens",
|
|
413
|
-
"dialogDeleteRouteTitle": "Confirm route deletion",
|
|
414
|
-
"dialogDeleteRouteDescription": "Are you sure you want to delete this route? This action cannot be undone.",
|
|
415
|
-
"deleteRouteCancel": "Cancel",
|
|
416
|
-
"deleteRouteConfirm": "Delete route"
|
|
417
|
-
},
|
|
418
344
|
"MailPage": {
|
|
419
345
|
"breadcrumbHome": "Home",
|
|
420
346
|
"breadcrumbTitle": "Email Templates",
|
|
@@ -341,80 +341,6 @@
|
|
|
341
341
|
"goToNextPage": "Ir para próxima página",
|
|
342
342
|
"goToLastPage": "Ir para última página"
|
|
343
343
|
},
|
|
344
|
-
"RoutePage": {
|
|
345
|
-
"title": "Gerenciamento de Rotas",
|
|
346
|
-
"description": "Gerencie rotas HTTP, ferramentas MCP e seus relacionamentos.",
|
|
347
|
-
"routes": "Rotas",
|
|
348
|
-
"home": "Home",
|
|
349
|
-
"buttonAddRoute": "Adicionar rota",
|
|
350
|
-
"buttonEditRoute": "Editar",
|
|
351
|
-
"buttonDeleteRoute": "Excluir rota",
|
|
352
|
-
"dialogAddRouteTitle": "Adicionar nova rota",
|
|
353
|
-
"dialogAddRouteDescription": "Cadastre uma rota HTTP ou ferramenta MCP e depois relacione cargos e telas.",
|
|
354
|
-
"titleEditRoute": "Editar rota",
|
|
355
|
-
"searchPlaceholder": "Pesquisar por URL, método, nome ou ferramenta...",
|
|
356
|
-
"viewMode": "Visualização",
|
|
357
|
-
"viewModeCards": "Cards",
|
|
358
|
-
"viewModeList": "Lista",
|
|
359
|
-
"selectType": "Tipo",
|
|
360
|
-
"selectMethod": "Método HTTP",
|
|
361
|
-
"allTypes": "Todos os tipos",
|
|
362
|
-
"allMethods": "Todos os métodos",
|
|
363
|
-
"totalRoutes": "Total de rotas",
|
|
364
|
-
"httpRoutes": "Rotas HTTP",
|
|
365
|
-
"mcpRoutes": "Ferramentas MCP",
|
|
366
|
-
"filteredRoutes": "Resultados",
|
|
367
|
-
"noRoutesFound": "Nenhuma rota encontrada",
|
|
368
|
-
"emptyDescription": "Ajuste os filtros ou crie a primeira rota para começar.",
|
|
369
|
-
"routeCreatedSuccess": "Rota criada com sucesso",
|
|
370
|
-
"routeUpdatedSuccess": "Rota atualizada com sucesso",
|
|
371
|
-
"routeDeletedSuccess": "Rota excluída com sucesso",
|
|
372
|
-
"serverError": "Ocorreu um erro. Por favor, tente novamente mais tarde.",
|
|
373
|
-
"tabBasicInfo": "Informações",
|
|
374
|
-
"tabRoles": "Cargos",
|
|
375
|
-
"tabScreens": "Telas",
|
|
376
|
-
"basicInfoTitle": "Dados da rota",
|
|
377
|
-
"basicInfoDescription": "Defina o tipo da rota e as informações necessárias para identificá-la no sistema.",
|
|
378
|
-
"formTypeLabel": "Tipo",
|
|
379
|
-
"formUrlLabel": "URL",
|
|
380
|
-
"formUrlPlaceholder": "/users/:id",
|
|
381
|
-
"formMethodLabel": "Método",
|
|
382
|
-
"formToolNameLabel": "Nome da ferramenta",
|
|
383
|
-
"formToolNamePlaceholder": "core.users.routes",
|
|
384
|
-
"formNameLabel": "Nome de exibição",
|
|
385
|
-
"formNamePlaceholder": "Listar rotas de usuários",
|
|
386
|
-
"formOptionalNameLabel": "Nome interno",
|
|
387
|
-
"formOptionalNamePlaceholder": "Leitura de usuários",
|
|
388
|
-
"errorUrlRequired": "A URL é obrigatória para rotas HTTP",
|
|
389
|
-
"errorMethodRequired": "O método é obrigatório para rotas HTTP",
|
|
390
|
-
"errorToolNameRequired": "O nome da ferramenta é obrigatório para rotas MCP",
|
|
391
|
-
"saveChanges": "Salvar alterações",
|
|
392
|
-
"cancel": "Cancelar",
|
|
393
|
-
"rolesTitle": "Cargos vinculados",
|
|
394
|
-
"rolesDescription": "Ative ou desative o acesso desta rota por cargo.",
|
|
395
|
-
"loadingRoles": "Carregando cargos...",
|
|
396
|
-
"searchRoles": "Buscar cargos...",
|
|
397
|
-
"noRolesFound": "Nenhum cargo encontrado",
|
|
398
|
-
"roleAssigned": "Cargo associado com sucesso",
|
|
399
|
-
"roleRemoved": "Cargo removido com sucesso",
|
|
400
|
-
"errorAssigningRole": "Erro ao associar cargo",
|
|
401
|
-
"errorRemovingRole": "Erro ao remover cargo",
|
|
402
|
-
"screensTitle": "Telas vinculadas",
|
|
403
|
-
"screensDescription": "Defina quais telas utilizam ou representam esta rota.",
|
|
404
|
-
"loadingScreens": "Carregando telas...",
|
|
405
|
-
"searchScreens": "Buscar telas...",
|
|
406
|
-
"noScreensFound": "Nenhuma tela encontrada",
|
|
407
|
-
"screenAssigned": "Tela associada com sucesso",
|
|
408
|
-
"screenRemoved": "Tela removida com sucesso",
|
|
409
|
-
"errorAssigningScreen": "Erro ao associar tela",
|
|
410
|
-
"errorRemovingScreen": "Erro ao remover tela",
|
|
411
|
-
"rolesCount": "{count} cargos",
|
|
412
|
-
"screensCount": "{count} telas",
|
|
413
|
-
"dialogDeleteRouteTitle": "Confirmar exclusão da rota",
|
|
414
|
-
"dialogDeleteRouteDescription": "Tem certeza que deseja excluir esta rota? Esta ação não pode ser desfeita.",
|
|
415
|
-
"deleteRouteCancel": "Cancelar",
|
|
416
|
-
"deleteRouteConfirm": "Excluir rota"
|
|
417
|
-
},
|
|
418
344
|
"MailPage": {
|
|
419
345
|
"breadcrumbHome": "Início",
|
|
420
346
|
"breadcrumbTitle": "Templates de E-mail",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.338",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"speakeasy": "^2.0.0",
|
|
32
32
|
"uuid": "^11.1.0",
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
34
|
-
"@hed-hog/api": "0.0.8",
|
|
35
|
-
"@hed-hog/api-types": "0.0.1",
|
|
36
34
|
"@hed-hog/api-locale": "0.0.14",
|
|
37
|
-
"@hed-hog/api-
|
|
35
|
+
"@hed-hog/api-types": "0.0.1",
|
|
36
|
+
"@hed-hog/api-mail": "0.0.9",
|
|
38
37
|
"@hed-hog/api-pagination": "0.0.7",
|
|
39
|
-
"@hed-hog/api
|
|
38
|
+
"@hed-hog/api": "0.0.8",
|
|
39
|
+
"@hed-hog/api-prisma": "0.0.6"
|
|
40
40
|
},
|
|
41
41
|
"exports": {
|
|
42
42
|
".": {
|
|
@@ -31,20 +31,6 @@ export class RouteService {
|
|
|
31
31
|
where: {
|
|
32
32
|
OR,
|
|
33
33
|
},
|
|
34
|
-
include: {
|
|
35
|
-
role_route: {
|
|
36
|
-
select: {
|
|
37
|
-
route_id: true,
|
|
38
|
-
role_id: true,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
route_screen: {
|
|
42
|
-
select: {
|
|
43
|
-
route_id: true,
|
|
44
|
-
screen_id: true,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
34
|
},
|
|
49
35
|
);
|
|
50
36
|
}
|