@hed-hog/core 0.0.279 → 0.0.285
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 +3 -3
- package/dist/auth/auth.service.d.ts +8 -8
- package/dist/file/file.controller.d.ts +2 -2
- package/dist/file/file.service.d.ts +4 -4
- package/dist/role/guards/role.guard.d.ts.map +1 -1
- package/dist/role/guards/role.guard.js +1 -1
- package/dist/role/guards/role.guard.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 +2 -2
- package/dist/user/user.service.d.ts +6 -6
- package/hedhog/frontend/app/ai_agent/page.tsx.ejs +72 -65
- package/hedhog/frontend/app/mail/log/page.tsx.ejs +37 -42
- package/hedhog/frontend/app/mail/template/page.tsx.ejs +176 -126
- package/hedhog/frontend/app/menu/page.tsx.ejs +45 -39
- package/hedhog/frontend/app/roles/page.tsx.ejs +45 -46
- package/hedhog/frontend/app/users/page.tsx.ejs +61 -64
- package/hedhog/frontend/messages/en.json +5 -0
- package/hedhog/frontend/messages/pt.json +5 -0
- package/package.json +3 -3
- package/src/role/guards/role.guard.ts +9 -8
|
@@ -45,8 +45,8 @@ export declare class AuthController {
|
|
|
45
45
|
created_at: Date;
|
|
46
46
|
updated_at: Date;
|
|
47
47
|
user_id: number;
|
|
48
|
-
revoked_at: Date | null;
|
|
49
48
|
expires_at: Date | null;
|
|
49
|
+
revoked_at: Date | null;
|
|
50
50
|
requires_reset: boolean;
|
|
51
51
|
}[];
|
|
52
52
|
user_identifier: {
|
|
@@ -66,8 +66,8 @@ export declare class AuthController {
|
|
|
66
66
|
updated_at: Date;
|
|
67
67
|
ip_address: string;
|
|
68
68
|
user_id: number;
|
|
69
|
-
revoked_at: Date | null;
|
|
70
69
|
expires_at: Date;
|
|
70
|
+
revoked_at: Date | null;
|
|
71
71
|
user_agent: string;
|
|
72
72
|
}[];
|
|
73
73
|
name: string;
|
|
@@ -181,8 +181,8 @@ export declare class AuthController {
|
|
|
181
181
|
updated_at: Date;
|
|
182
182
|
ip_address: string;
|
|
183
183
|
user_id: number;
|
|
184
|
-
revoked_at: Date | null;
|
|
185
184
|
expires_at: Date;
|
|
185
|
+
revoked_at: Date | null;
|
|
186
186
|
user_agent: string;
|
|
187
187
|
};
|
|
188
188
|
}>;
|
|
@@ -28,8 +28,8 @@ export declare class AuthService {
|
|
|
28
28
|
updated_at: Date;
|
|
29
29
|
ip_address: string;
|
|
30
30
|
user_id: number;
|
|
31
|
-
revoked_at: Date | null;
|
|
32
31
|
expires_at: Date;
|
|
32
|
+
revoked_at: Date | null;
|
|
33
33
|
user_agent: string;
|
|
34
34
|
};
|
|
35
35
|
}>;
|
|
@@ -107,8 +107,8 @@ export declare class AuthService {
|
|
|
107
107
|
created_at: Date;
|
|
108
108
|
updated_at: Date;
|
|
109
109
|
user_id: number;
|
|
110
|
-
revoked_at: Date | null;
|
|
111
110
|
expires_at: Date | null;
|
|
111
|
+
revoked_at: Date | null;
|
|
112
112
|
requires_reset: boolean;
|
|
113
113
|
}[];
|
|
114
114
|
user_identifier: {
|
|
@@ -128,8 +128,8 @@ export declare class AuthService {
|
|
|
128
128
|
updated_at: Date;
|
|
129
129
|
ip_address: string;
|
|
130
130
|
user_id: number;
|
|
131
|
-
revoked_at: Date | null;
|
|
132
131
|
expires_at: Date;
|
|
132
|
+
revoked_at: Date | null;
|
|
133
133
|
user_agent: string;
|
|
134
134
|
}[];
|
|
135
135
|
name: string;
|
|
@@ -152,8 +152,8 @@ export declare class AuthService {
|
|
|
152
152
|
updated_at: Date;
|
|
153
153
|
ip_address: string;
|
|
154
154
|
user_id: number;
|
|
155
|
-
revoked_at: Date | null;
|
|
156
155
|
expires_at: Date;
|
|
156
|
+
revoked_at: Date | null;
|
|
157
157
|
user_agent: string;
|
|
158
158
|
};
|
|
159
159
|
}>;
|
|
@@ -173,8 +173,8 @@ export declare class AuthService {
|
|
|
173
173
|
updated_at: Date;
|
|
174
174
|
ip_address: string;
|
|
175
175
|
user_id: number;
|
|
176
|
-
revoked_at: Date | null;
|
|
177
176
|
expires_at: Date;
|
|
177
|
+
revoked_at: Date | null;
|
|
178
178
|
user_agent: string;
|
|
179
179
|
};
|
|
180
180
|
}>;
|
|
@@ -188,8 +188,8 @@ export declare class AuthService {
|
|
|
188
188
|
updated_at: Date;
|
|
189
189
|
ip_address: string;
|
|
190
190
|
user_id: number;
|
|
191
|
-
revoked_at: Date | null;
|
|
192
191
|
expires_at: Date;
|
|
192
|
+
revoked_at: Date | null;
|
|
193
193
|
user_agent: string;
|
|
194
194
|
};
|
|
195
195
|
requiresPasswordReset: boolean;
|
|
@@ -204,8 +204,8 @@ export declare class AuthService {
|
|
|
204
204
|
updated_at: Date;
|
|
205
205
|
ip_address: string;
|
|
206
206
|
user_id: number;
|
|
207
|
-
revoked_at: Date | null;
|
|
208
207
|
expires_at: Date;
|
|
208
|
+
revoked_at: Date | null;
|
|
209
209
|
user_agent: string;
|
|
210
210
|
};
|
|
211
211
|
requiresPasswordReset: boolean;
|
|
@@ -225,8 +225,8 @@ export declare class AuthService {
|
|
|
225
225
|
updated_at: Date;
|
|
226
226
|
ip_address: string;
|
|
227
227
|
user_id: number;
|
|
228
|
-
revoked_at: Date | null;
|
|
229
228
|
expires_at: Date;
|
|
229
|
+
revoked_at: Date | null;
|
|
230
230
|
user_agent: string;
|
|
231
231
|
};
|
|
232
232
|
requiresPasswordReset: boolean;
|
|
@@ -21,8 +21,8 @@ export declare class FileController {
|
|
|
21
21
|
filename: string;
|
|
22
22
|
created_at: Date;
|
|
23
23
|
updated_at: Date;
|
|
24
|
-
location: string;
|
|
25
24
|
provider_id: number;
|
|
25
|
+
location: string;
|
|
26
26
|
mimetype_id: number;
|
|
27
27
|
}>;
|
|
28
28
|
getTempOpenURL(id: number): Promise<{
|
|
@@ -40,8 +40,8 @@ export declare class FileController {
|
|
|
40
40
|
filename: string;
|
|
41
41
|
created_at: Date;
|
|
42
42
|
updated_at: Date;
|
|
43
|
-
location: string;
|
|
44
43
|
provider_id: number;
|
|
44
|
+
location: string;
|
|
45
45
|
mimetype_id: number;
|
|
46
46
|
}>;
|
|
47
47
|
delete(data: DeleteDTO, locale: string): Promise<number[]>;
|
|
@@ -27,8 +27,8 @@ export declare class FileService implements OnModuleInit {
|
|
|
27
27
|
filename: string;
|
|
28
28
|
created_at: Date;
|
|
29
29
|
updated_at: Date;
|
|
30
|
-
location: string;
|
|
31
30
|
provider_id: number;
|
|
31
|
+
location: string;
|
|
32
32
|
mimetype_id: number;
|
|
33
33
|
}>;
|
|
34
34
|
getStorage(): Promise<any>;
|
|
@@ -47,8 +47,8 @@ export declare class FileService implements OnModuleInit {
|
|
|
47
47
|
filename: string;
|
|
48
48
|
created_at: Date;
|
|
49
49
|
updated_at: Date;
|
|
50
|
-
location: string;
|
|
51
50
|
provider_id: number;
|
|
51
|
+
location: string;
|
|
52
52
|
mimetype_id: number;
|
|
53
53
|
};
|
|
54
54
|
buffer: Buffer<any>;
|
|
@@ -61,8 +61,8 @@ export declare class FileService implements OnModuleInit {
|
|
|
61
61
|
filename: string;
|
|
62
62
|
created_at: Date;
|
|
63
63
|
updated_at: Date;
|
|
64
|
-
location: string;
|
|
65
64
|
provider_id: number;
|
|
65
|
+
location: string;
|
|
66
66
|
mimetype_id: number;
|
|
67
67
|
}>;
|
|
68
68
|
delete(locale: string, { ids }: DeleteDTO): Promise<number[]>;
|
|
@@ -82,8 +82,8 @@ export declare class FileService implements OnModuleInit {
|
|
|
82
82
|
filename: string;
|
|
83
83
|
created_at: Date;
|
|
84
84
|
updated_at: Date;
|
|
85
|
-
location: string;
|
|
86
85
|
provider_id: number;
|
|
86
|
+
location: string;
|
|
87
87
|
mimetype_id: number;
|
|
88
88
|
}>;
|
|
89
89
|
readStream(filepath: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.guard.d.ts","sourceRoot":"","sources":["../../../src/role/guards/role.guard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"role.guard.d.ts","sourceRoot":"","sources":["../../../src/role/guards/role.guard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,WAAW,EACX,gBAAgB,EAOjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,qBACa,SAAU,YAAW,WAAW;IAOzC,OAAO,CAAC,SAAS;IAEjB,OAAO,CAAC,QAAQ,CAAC,MAAM;IARzB,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAG7C;gBAGO,SAAS,EAAE,SAAS,EAEX,MAAM,EAAE,aAAa;IAGlC,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAqI9D,OAAO,CAAC,sBAAsB;CAI/B"}
|
|
@@ -109,7 +109,7 @@ let RoleGuard = class RoleGuard {
|
|
|
109
109
|
const message = (0, api_locale_1.getLocaleText)('accessDenied', locale, 'Access denied. User does not have permission to access {{method}} {{path}}')
|
|
110
110
|
.replace('{{method}}', httpMethod)
|
|
111
111
|
.replace('{{path}}', fullPath);
|
|
112
|
-
throw new common_1.
|
|
112
|
+
throw new common_1.ForbiddenException(message);
|
|
113
113
|
}
|
|
114
114
|
const hasPendingPasswordReset = await this.prisma.user_credential.findFirst({
|
|
115
115
|
where: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.guard.js","sourceRoot":"","sources":["../../../src/role/guards/role.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAwD;AACxD,oDAAoD;AACpD,oDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"role.guard.js","sourceRoot":"","sources":["../../../src/role/guards/role.guard.ts"],"names":[],"mappings":";;;;;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C,IAAI,IAAI,CAAC;YACzC,MAAM,IAAI,8BAAqB,CAC7B,IAAA,0BAAa,EACX,iCAAiC,EACjC,MAAM,EACN,0DAA0D,CAC3D,CACF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,sBAAsB,CAAC,OAAgB;;QAC7C,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,MAAA,MAAA,OAAO,CAAC,OAAO,CAAC,aAAa,0CAAE,KAAK,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC;QACtE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/C,CAAC;CACF,CAAA;AArJY,8BAAS;oBAAT,SAAS;IADrB,IAAA,mBAAU,GAAE;IASR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAA;qCADrB,gBAAS;QAEH,0BAAa;GAT7B,SAAS,CAqJrB"}
|
|
@@ -23,8 +23,8 @@ export declare class SessionService {
|
|
|
23
23
|
updated_at: Date;
|
|
24
24
|
ip_address: string;
|
|
25
25
|
user_id: number;
|
|
26
|
-
revoked_at: Date | null;
|
|
27
26
|
expires_at: Date;
|
|
27
|
+
revoked_at: Date | null;
|
|
28
28
|
user_agent: string;
|
|
29
29
|
};
|
|
30
30
|
}>;
|
|
@@ -37,8 +37,8 @@ export declare class SessionService {
|
|
|
37
37
|
updated_at: Date;
|
|
38
38
|
ip_address: string;
|
|
39
39
|
user_id: number;
|
|
40
|
-
revoked_at: Date | null;
|
|
41
40
|
expires_at: Date;
|
|
41
|
+
revoked_at: Date | null;
|
|
42
42
|
user_agent: string;
|
|
43
43
|
};
|
|
44
44
|
}>;
|
|
@@ -68,8 +68,8 @@ export declare class SessionService {
|
|
|
68
68
|
updated_at: Date;
|
|
69
69
|
ip_address: string;
|
|
70
70
|
user_id: number;
|
|
71
|
-
revoked_at: Date | null;
|
|
72
71
|
expires_at: Date;
|
|
72
|
+
revoked_at: Date | null;
|
|
73
73
|
user_agent: string;
|
|
74
74
|
}>;
|
|
75
75
|
/**
|
|
@@ -47,8 +47,8 @@ export declare class UserController {
|
|
|
47
47
|
created_at: Date;
|
|
48
48
|
updated_at: Date;
|
|
49
49
|
user_id: number;
|
|
50
|
-
revoked_at: Date | null;
|
|
51
50
|
expires_at: Date | null;
|
|
51
|
+
revoked_at: Date | null;
|
|
52
52
|
requires_reset: boolean;
|
|
53
53
|
}[];
|
|
54
54
|
user_identifier: {
|
|
@@ -68,8 +68,8 @@ export declare class UserController {
|
|
|
68
68
|
updated_at: Date;
|
|
69
69
|
ip_address: string;
|
|
70
70
|
user_id: number;
|
|
71
|
-
revoked_at: Date | null;
|
|
72
71
|
expires_at: Date;
|
|
72
|
+
revoked_at: Date | null;
|
|
73
73
|
user_agent: string;
|
|
74
74
|
}[];
|
|
75
75
|
} & {
|
|
@@ -68,8 +68,8 @@ export declare class UserService {
|
|
|
68
68
|
created_at: Date;
|
|
69
69
|
updated_at: Date;
|
|
70
70
|
user_id: number;
|
|
71
|
-
revoked_at: Date | null;
|
|
72
71
|
expires_at: Date | null;
|
|
72
|
+
revoked_at: Date | null;
|
|
73
73
|
requires_reset: boolean;
|
|
74
74
|
}[];
|
|
75
75
|
user_identifier: {
|
|
@@ -89,8 +89,8 @@ export declare class UserService {
|
|
|
89
89
|
updated_at: Date;
|
|
90
90
|
ip_address: string;
|
|
91
91
|
user_id: number;
|
|
92
|
-
revoked_at: Date | null;
|
|
93
92
|
expires_at: Date;
|
|
93
|
+
revoked_at: Date | null;
|
|
94
94
|
user_agent: string;
|
|
95
95
|
}[];
|
|
96
96
|
} & {
|
|
@@ -168,8 +168,8 @@ export declare class UserService {
|
|
|
168
168
|
created_at: Date;
|
|
169
169
|
updated_at: Date;
|
|
170
170
|
user_id: number;
|
|
171
|
-
revoked_at: Date | null;
|
|
172
171
|
expires_at: Date | null;
|
|
172
|
+
revoked_at: Date | null;
|
|
173
173
|
requires_reset: boolean;
|
|
174
174
|
}[];
|
|
175
175
|
user_identifier: {
|
|
@@ -189,8 +189,8 @@ export declare class UserService {
|
|
|
189
189
|
updated_at: Date;
|
|
190
190
|
ip_address: string;
|
|
191
191
|
user_id: number;
|
|
192
|
-
revoked_at: Date | null;
|
|
193
192
|
expires_at: Date;
|
|
193
|
+
revoked_at: Date | null;
|
|
194
194
|
user_agent: string;
|
|
195
195
|
}[];
|
|
196
196
|
} & {
|
|
@@ -212,8 +212,8 @@ export declare class UserService {
|
|
|
212
212
|
created_at: Date;
|
|
213
213
|
updated_at: Date;
|
|
214
214
|
user_id: number;
|
|
215
|
-
revoked_at: Date | null;
|
|
216
215
|
expires_at: Date | null;
|
|
216
|
+
revoked_at: Date | null;
|
|
217
217
|
requires_reset: boolean;
|
|
218
218
|
}[];
|
|
219
219
|
user_identifier: {
|
|
@@ -233,8 +233,8 @@ export declare class UserService {
|
|
|
233
233
|
updated_at: Date;
|
|
234
234
|
ip_address: string;
|
|
235
235
|
user_id: number;
|
|
236
|
-
revoked_at: Date | null;
|
|
237
236
|
expires_at: Date;
|
|
237
|
+
revoked_at: Date | null;
|
|
238
238
|
user_agent: string;
|
|
239
239
|
}[];
|
|
240
240
|
} & {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
EmptyState,
|
|
4
5
|
Page,
|
|
5
6
|
PageHeader,
|
|
6
7
|
PaginationFooter,
|
|
@@ -115,7 +116,7 @@ export default function AiAgentPage() {
|
|
|
115
116
|
},
|
|
116
117
|
});
|
|
117
118
|
|
|
118
|
-
const { data, isLoading, refetch } = useQuery<PaginatedResponse<Agent>>({
|
|
119
|
+
const { data, isLoading, refetch } = useQuery<PaginatedResponse<Agent>>({
|
|
119
120
|
queryKey: ['ai-agents', page, pageSize, debouncedSearch],
|
|
120
121
|
queryFn: async () => {
|
|
121
122
|
const params = new URLSearchParams();
|
|
@@ -130,14 +131,14 @@ export default function AiAgentPage() {
|
|
|
130
131
|
|
|
131
132
|
return response.data;
|
|
132
133
|
},
|
|
133
|
-
});
|
|
134
|
-
const agentList = data ?? {
|
|
135
|
-
data: [],
|
|
136
|
-
total: 0,
|
|
137
|
-
page: 1,
|
|
138
|
-
pageSize: 10,
|
|
139
|
-
totalPages: 1,
|
|
140
|
-
};
|
|
134
|
+
});
|
|
135
|
+
const agentList = data ?? {
|
|
136
|
+
data: [],
|
|
137
|
+
total: 0,
|
|
138
|
+
page: 1,
|
|
139
|
+
pageSize: 10,
|
|
140
|
+
totalPages: 1,
|
|
141
|
+
};
|
|
141
142
|
|
|
142
143
|
useEffect(() => {
|
|
143
144
|
if (editingAgent) {
|
|
@@ -261,69 +262,75 @@ export default function AiAgentPage() {
|
|
|
261
262
|
placeholder={t('searchPlaceholder')}
|
|
262
263
|
/>
|
|
263
264
|
|
|
264
|
-
|
|
265
|
-
<
|
|
266
|
-
<
|
|
267
|
-
<
|
|
268
|
-
<
|
|
269
|
-
<TableHead>Slug</TableHead>
|
|
270
|
-
<TableHead>{t('columnProvider')}</TableHead>
|
|
271
|
-
<TableHead>{t('columnModel')}</TableHead>
|
|
272
|
-
<TableHead>{t('columnExternalId')}</TableHead>
|
|
273
|
-
<TableHead className="text-right">
|
|
274
|
-
{t('columnActions')}
|
|
275
|
-
</TableHead>
|
|
276
|
-
</TableRow>
|
|
277
|
-
</TableHeader>
|
|
278
|
-
<TableBody>
|
|
279
|
-
{isLoading ? (
|
|
265
|
+
{isLoading || agentList.data.length > 0 ? (
|
|
266
|
+
<Card>
|
|
267
|
+
<CardContent className="p-0">
|
|
268
|
+
<Table>
|
|
269
|
+
<TableHeader>
|
|
280
270
|
<TableRow>
|
|
281
|
-
<
|
|
271
|
+
<TableHead>Slug</TableHead>
|
|
272
|
+
<TableHead>{t('columnProvider')}</TableHead>
|
|
273
|
+
<TableHead>{t('columnModel')}</TableHead>
|
|
274
|
+
<TableHead>{t('columnExternalId')}</TableHead>
|
|
275
|
+
<TableHead className="text-right">
|
|
276
|
+
{t('columnActions')}
|
|
277
|
+
</TableHead>
|
|
282
278
|
</TableRow>
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
agentList.data.map((agent) => (
|
|
289
|
-
<TableRow key={agent.id}>
|
|
290
|
-
<TableCell>{agent.slug}</TableCell>
|
|
291
|
-
<TableCell className="uppercase">
|
|
292
|
-
{agent.provider}
|
|
293
|
-
</TableCell>
|
|
294
|
-
<TableCell>{agent.model || '-'}</TableCell>
|
|
295
|
-
<TableCell>{agent.external_agent_id || '-'}</TableCell>
|
|
296
|
-
<TableCell className="text-right">
|
|
297
|
-
<div className="flex items-center justify-end gap-2">
|
|
298
|
-
<Button
|
|
299
|
-
variant="outline"
|
|
300
|
-
size="icon"
|
|
301
|
-
onClick={() => handleOpenEdit(agent)}
|
|
302
|
-
>
|
|
303
|
-
<Pencil className="h-4 w-4" />
|
|
304
|
-
</Button>
|
|
305
|
-
<Button
|
|
306
|
-
variant="destructive"
|
|
307
|
-
size="icon"
|
|
308
|
-
onClick={() => setAgentToDelete(agent)}
|
|
309
|
-
>
|
|
310
|
-
<Trash2 className="h-4 w-4" />
|
|
311
|
-
</Button>
|
|
312
|
-
</div>
|
|
313
|
-
</TableCell>
|
|
279
|
+
</TableHeader>
|
|
280
|
+
<TableBody>
|
|
281
|
+
{isLoading ? (
|
|
282
|
+
<TableRow>
|
|
283
|
+
<TableCell colSpan={5}>{t('loading')}</TableCell>
|
|
314
284
|
</TableRow>
|
|
315
|
-
)
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
285
|
+
) : (
|
|
286
|
+
agentList.data.map((agent) => (
|
|
287
|
+
<TableRow key={agent.id}>
|
|
288
|
+
<TableCell>{agent.slug}</TableCell>
|
|
289
|
+
<TableCell className="uppercase">
|
|
290
|
+
{agent.provider}
|
|
291
|
+
</TableCell>
|
|
292
|
+
<TableCell>{agent.model || '-'}</TableCell>
|
|
293
|
+
<TableCell>{agent.external_agent_id || '-'}</TableCell>
|
|
294
|
+
<TableCell className="text-right">
|
|
295
|
+
<div className="flex items-center justify-end gap-2">
|
|
296
|
+
<Button
|
|
297
|
+
variant="outline"
|
|
298
|
+
size="icon"
|
|
299
|
+
onClick={() => handleOpenEdit(agent)}
|
|
300
|
+
>
|
|
301
|
+
<Pencil className="h-4 w-4" />
|
|
302
|
+
</Button>
|
|
303
|
+
<Button
|
|
304
|
+
variant="destructive"
|
|
305
|
+
size="icon"
|
|
306
|
+
onClick={() => setAgentToDelete(agent)}
|
|
307
|
+
>
|
|
308
|
+
<Trash2 className="h-4 w-4" />
|
|
309
|
+
</Button>
|
|
310
|
+
</div>
|
|
311
|
+
</TableCell>
|
|
312
|
+
</TableRow>
|
|
313
|
+
))
|
|
314
|
+
)}
|
|
315
|
+
</TableBody>
|
|
316
|
+
</Table>
|
|
317
|
+
</CardContent>
|
|
318
|
+
</Card>
|
|
319
|
+
) : (
|
|
320
|
+
<EmptyState
|
|
321
|
+
icon={<Bot className="h-12 w-12" />}
|
|
322
|
+
title={t('empty')}
|
|
323
|
+
description={t('description')}
|
|
324
|
+
actionLabel={t('newAgent')}
|
|
325
|
+
onAction={handleOpenCreate}
|
|
326
|
+
/>
|
|
327
|
+
)}
|
|
321
328
|
|
|
322
329
|
<PaginationFooter
|
|
323
330
|
currentPage={page}
|
|
324
331
|
pageSize={pageSize}
|
|
325
|
-
totalItems={agentList.total}
|
|
326
|
-
onPageChange={setPage}
|
|
332
|
+
totalItems={agentList.total}
|
|
333
|
+
onPageChange={setPage}
|
|
327
334
|
onPageSizeChange={(value) => {
|
|
328
335
|
setPageSize(value);
|
|
329
336
|
setPage(1);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
EmptyState,
|
|
5
|
+
Page,
|
|
6
|
+
PageHeader,
|
|
7
|
+
PaginationFooter,
|
|
8
|
+
SearchBar,
|
|
9
|
+
} from '@/components/entity-list';
|
|
4
10
|
import { Badge } from '@/components/ui/badge';
|
|
5
11
|
import { Button } from '@/components/ui/button';
|
|
6
12
|
import { Card, CardContent } from '@/components/ui/card';
|
|
@@ -11,14 +17,13 @@ import {
|
|
|
11
17
|
DialogHeader,
|
|
12
18
|
DialogTitle,
|
|
13
19
|
} from '@/components/ui/dialog';
|
|
14
|
-
import { Input } from '@/components/ui/input';
|
|
15
20
|
import { ScrollArea } from '@/components/ui/scroll-area';
|
|
16
21
|
import { useDebounce } from '@/hooks/use-debounce';
|
|
17
22
|
import { formatDate } from '@/lib/format-date';
|
|
18
23
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
19
|
-
import { Clock, Mail,
|
|
24
|
+
import { Clock, Mail, User } from 'lucide-react';
|
|
20
25
|
import { useTranslations } from 'next-intl';
|
|
21
|
-
import {
|
|
26
|
+
import { useState } from 'react';
|
|
22
27
|
|
|
23
28
|
type PaginationResult<T> = {
|
|
24
29
|
data: T[];
|
|
@@ -42,7 +47,6 @@ type MailSent = {
|
|
|
42
47
|
|
|
43
48
|
export default function MailLogPage() {
|
|
44
49
|
const t = useTranslations('core.MailLog');
|
|
45
|
-
const [logs, setLogs] = useState<MailSent[]>([]);
|
|
46
50
|
const [selectedLog, setSelectedLog] = useState<MailSent | null>(null);
|
|
47
51
|
const [isDetailDialogOpen, setIsDetailDialogOpen] = useState(false);
|
|
48
52
|
const [searchTerm, setSearchTerm] = useState('');
|
|
@@ -51,9 +55,9 @@ export default function MailLogPage() {
|
|
|
51
55
|
const [pageSize, setPageSize] = useState(10);
|
|
52
56
|
const { request, getSettingValue } = useApp();
|
|
53
57
|
|
|
54
|
-
const { data: logsResult, refetch: refetchLogs } = useQuery<
|
|
55
|
-
PaginationResult<MailSent>
|
|
56
|
-
>({
|
|
58
|
+
const { data: logsResult, refetch: refetchLogs } = useQuery<
|
|
59
|
+
PaginationResult<MailSent>
|
|
60
|
+
>({
|
|
57
61
|
queryKey: ['mail-sent', debouncedSearch, page, pageSize],
|
|
58
62
|
queryFn: async () => {
|
|
59
63
|
const response = await request({
|
|
@@ -66,14 +70,8 @@ export default function MailLogPage() {
|
|
|
66
70
|
});
|
|
67
71
|
return response.data as PaginationResult<MailSent>;
|
|
68
72
|
},
|
|
69
|
-
});
|
|
70
|
-
const { data = [], total = 0 } = logsResult ?? {};
|
|
71
|
-
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
if (data) {
|
|
74
|
-
setLogs(data);
|
|
75
|
-
}
|
|
76
|
-
}, [data]);
|
|
73
|
+
});
|
|
74
|
+
const { data: logs = [], total = 0 } = logsResult ?? {};
|
|
77
75
|
|
|
78
76
|
const handleViewDetails = (log: MailSent): void => {
|
|
79
77
|
setSelectedLog(log);
|
|
@@ -92,12 +90,8 @@ export default function MailLogPage() {
|
|
|
92
90
|
: text;
|
|
93
91
|
};
|
|
94
92
|
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
refetchLogs();
|
|
97
|
-
}, [debouncedSearch, page, pageSize]);
|
|
98
|
-
|
|
99
93
|
return (
|
|
100
|
-
<
|
|
94
|
+
<Page>
|
|
101
95
|
<PageHeader
|
|
102
96
|
breadcrumbs={[
|
|
103
97
|
{ label: t('breadcrumbHome'), href: '/' },
|
|
@@ -141,29 +135,30 @@ export default function MailLogPage() {
|
|
|
141
135
|
</Card>
|
|
142
136
|
</div>
|
|
143
137
|
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
className="pl-10"
|
|
151
|
-
/>
|
|
152
|
-
</div>
|
|
138
|
+
<SearchBar
|
|
139
|
+
searchQuery={searchTerm}
|
|
140
|
+
onSearchChange={handleSearchChange}
|
|
141
|
+
onSearch={() => setPage(1)}
|
|
142
|
+
placeholder={t('searchPlaceholder')}
|
|
143
|
+
/>
|
|
153
144
|
|
|
154
145
|
<div className="space-y-3 mb-4">
|
|
155
146
|
{logs.length === 0 ? (
|
|
156
|
-
<
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
147
|
+
<EmptyState
|
|
148
|
+
icon={<Mail className="h-12 w-12" />}
|
|
149
|
+
title={t('noLogsFound')}
|
|
150
|
+
description={searchTerm ? t('adjustSearch') : t('noEmailsSent')}
|
|
151
|
+
actionLabel={searchTerm ? t('clearSearch') : t('refreshList')}
|
|
152
|
+
onAction={() => {
|
|
153
|
+
if (searchTerm) {
|
|
154
|
+
setSearchTerm('');
|
|
155
|
+
setPage(1);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
refetchLogs();
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
167
162
|
) : (
|
|
168
163
|
logs.map((log) => (
|
|
169
164
|
<Card
|
|
@@ -301,6 +296,6 @@ export default function MailLogPage() {
|
|
|
301
296
|
</DialogContent>
|
|
302
297
|
</Dialog>
|
|
303
298
|
)}
|
|
304
|
-
</
|
|
299
|
+
</Page>
|
|
305
300
|
);
|
|
306
301
|
}
|