Skip to content

Commit 21d2e56

Browse files
committed
Merge branch 'next' of github.com:devforth/adminforth into next
2 parents df027a5 + 2e7f440 commit 21d2e56

File tree

10 files changed

+367
-394
lines changed

10 files changed

+367
-394
lines changed

adminforth/documentation/blog/2025-11-04-k3s-ec2-deployment/index.md

Lines changed: 334 additions & 375 deletions
Large diffs are not rendered by default.

adminforth/documentation/blog/tags.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,8 @@ helm:
6262
label: Helm
6363
permalink: /helm
6464
description: The package manager for Kubernetes
65+
66+
ansible:
67+
label: Ansible
68+
permalink: /ansible
69+
description: Ansible is an open-source automation tool used for configuration management, application deployment, and task automation.

adminforth/documentation/docs/tutorial/07-Plugins/02-TwoFactorsAuth.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ options: {
242242
name: 'Auto submit',
243243
icon: 'flowbite:play-solid',
244244
allowed: () => true,
245-
action: async ({ recordId, adminUser, adminforth, extra, cookies }) => {
245+
action: async ({ recordId, adminUser, adminforth, extra }) => {
246246
//diff-add
247247
const verificationResult = extra?.verificationResult
248248
//diff-add
@@ -260,7 +260,7 @@ options: {
260260
//diff-add
261261
userPk: adminUser.pk,
262262
//diff-add
263-
cookies: cookies
263+
cookies: extra.cookies
264264
//diff-add
265265
});
266266

adminforth/modules/restApi.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,15 +1481,10 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
14811481
}
14821482
})
14831483

1484-
// setup endpoints for all plugins
1485-
this.adminforth.activatedPlugins.forEach((plugin) => {
1486-
plugin.setupEndpoints(server);
1487-
});
1488-
14891484
server.endpoint({
14901485
method: 'POST',
14911486
path: '/start_custom_action',
1492-
handler: async ({ body, adminUser, tr }) => {
1487+
handler: async ({ body, adminUser, tr, cookies }) => {
14931488
const { resourceId, actionId, recordId, extra } = body;
14941489
const resource = this.adminforth.config.resources.find((res) => res.resourceId == resourceId);
14951490
if (!resource) {
@@ -1521,7 +1516,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
15211516
redirectUrl: action.url
15221517
}
15231518
}
1524-
const response = await action.action({ recordId, adminUser, resource, tr, adminforth: this.adminforth, extra });
1519+
const response = await action.action({ recordId, adminUser, resource, tr, adminforth: this.adminforth, extra: {...extra, cookies: cookies} });
15251520

15261521
return {
15271522
actionId,
@@ -1531,5 +1526,11 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
15311526
}
15321527
}
15331528
});
1529+
1530+
// setup endpoints for all plugins
1531+
this.adminforth.activatedPlugins.forEach((plugin) => {
1532+
plugin.setupEndpoints(server);
1533+
});
1534+
15341535
}
15351536
}

adminforth/spa/src/components/ResourceListTable.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
:row="row"
195195
:resource="resource"
196196
:adminUser="adminUser"
197-
@callAction="(payload? : Object) => startCustomAction(action.id, payload ?? row)"
197+
@callAction="(payload? : Object) => startCustomAction(action.id, row, payload)"
198198
>
199199
<button
200200
type="button"
@@ -561,7 +561,7 @@ async function deleteRecord(row: any) {
561561
562562
const actionLoadingStates = ref<Record<string | number, boolean>>({});
563563
564-
async function startCustomAction(actionId: string, row: any) {
564+
async function startCustomAction(actionId: string, row: any, extraData: Record<string, any> = {}) {
565565
console.log('Starting custom action', actionId, row);
566566
actionLoadingStates.value[actionId] = true;
567567
@@ -571,7 +571,8 @@ async function startCustomAction(actionId: string, row: any) {
571571
body: {
572572
resourceId: props.resource?.resourceId,
573573
actionId: actionId,
574-
recordId: row._primaryKeyValue
574+
recordId: row._primaryKeyValue,
575+
extra: extraData,
575576
}
576577
});
577578

adminforth/spa/src/components/ResourceListTableVirtual.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
:row="row"
209209
:resource="resource"
210210
:adminUser="adminUser"
211-
@callAction="(payload? : Object) => startCustomAction(action.id, payload ?? row)"
211+
@callAction="(payload? : Object) => startCustomAction(action.id, row, payload )"
212212
>
213213
<button
214214
type="button"
@@ -586,7 +586,7 @@ async function deleteRecord(row: any) {
586586
587587
const actionLoadingStates = ref<Record<string | number, boolean>>({});
588588
589-
async function startCustomAction(actionId: string, row: any) {
589+
async function startCustomAction(actionId: string, row: any, extraData: Record<string, any> = {}) {
590590
actionLoadingStates.value[actionId] = true;
591591
592592
const data = await callAdminForthApi({
@@ -595,7 +595,8 @@ async function startCustomAction(actionId: string, row: any) {
595595
body: {
596596
resourceId: props.resource?.resourceId,
597597
actionId: actionId,
598-
recordId: row._primaryKeyValue
598+
recordId: row._primaryKeyValue,
599+
extra: extraData
599600
}
600601
});
601602

adminforth/types/Back.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,9 +1066,15 @@ export interface AdminForthInputConfig {
10661066
* If rememberMeDuration is set, then users who check "Remember Me" will be staying logged in for this amount of time.
10671067
* Format: "1s" (seconds), "1m" (minutes), "1h" (hours), or "1d" (days).
10681068
* Example: "30d" for 30 days, "7d" for 7 days, "24h" for 24 hours.
1069-
*/
1069+
*/
10701070
rememberMeDuration?: string,
10711071

1072+
/**
1073+
* Old variable for remember me duration. Use rememberMeDuration instead.
1074+
* @deprecated Use rememberMeDuration instead.
1075+
*/
1076+
rememberMeDays?: number,
1077+
10721078

10731079
/**
10741080
* Can be used to limit user access when subscribing from frontend to websocket topics.

live-demo/app/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ new AdminForth({
4040
// brandLogo: '@@/logo.svg',
4141
// favicon: '@@/favicon.png',
4242
announcementBadge: (adminUser: AdminUser) => {
43-
return {
43+
return {
4444
html: `
4545
<svg xmlns="http://www.w3.org/2000/svg" style="display:inline; margin-top: -4px" width="16" height="16" viewBox="0 0 24 24"><path d="M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"/></svg>
4646
<a href="https://github.com/devforth/adminforth" style="font-weight: bold; text-decoration: underline" target="_blank">Star us on GitHub</a> to support a project!`,

live-demo/app/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

live-demo/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@adminforth/audit-log": "^1.7.3",
2020
"@adminforth/bulk-ai-flow": "^1.17.4",
2121
"@adminforth/chat-gpt": "^1.0.20",
22-
"@adminforth/clone-row": "^1.1.1",
22+
"@adminforth/clone-row": "^1.1.2",
2323
"@adminforth/completion-adapter-open-ai-chat-gpt": "^1.0.2",
2424
"@adminforth/email-password-reset": "^1.3.5",
2525
"@adminforth/foreign-inline-list": "^1.9.2",

0 commit comments

Comments
 (0)