File tree Expand file tree Collapse file tree 3 files changed +83
-0
lines changed
Expand file tree Collapse file tree 3 files changed +83
-0
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" pt-2 flex justify-end" >
3+ <a :href =" linkHref" class =" text-lightPrimary hover:underline dark:text-darkPrimary break-all " >
4+ <IconClockSolid class =" inline w-4 h-4 me-1 mb-0.5" />
5+ Edits History</a >
6+ </div >
7+ </template >
8+ <script setup lang="ts">
9+ import { computed } from ' vue' ;
10+ import { IconClockSolid } from ' @iconify-prerendered/vue-flowbite' ;
11+
12+ const props = defineProps <{
13+ column: any ;
14+ record: any ;
15+ meta: any ;
16+ resource: any ;
17+ adminUser: any ;
18+ }>();
19+
20+ const linkHref = computed (() => {
21+ try {
22+ const resourceIdCol = props .meta .resourceColumns .resourceIdColumnName ;
23+ const recordIdCol = props .meta .resourceColumns .resourceRecordIdColumnName ;
24+
25+ const recordId = props .record [recordIdCol ];
26+ const resourceId = props .record [resourceIdCol ];
27+
28+ const params = new URLSearchParams ();
29+ params .set (' sort' , ` ${props .meta .resourceColumns .resourceCreatedColumnName }__desc ` );
30+ if (recordId ) params .set (` filter__${recordIdCol }__ilike ` , JSON .stringify (String (recordId )));
31+ if (resourceId ) params .set (` filter__${resourceIdCol }__eq ` , JSON .stringify (String (resourceId )));
32+
33+ const base = typeof window !== ' undefined' ? window .location .origin : ' ' ;
34+ return ` ${base }/resource/${props .resource .resourceId }?${params .toString ()} ` ;
35+ } catch (e ) {
36+ return ' #' ;
37+ }
38+ });
39+ </script >
40+
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "baseUrl" : " ." , // This should point to your project root
4+ "paths" : {
5+ "@/*" : [
6+ // "node_modules/adminforth/dist/spa/src/*"
7+ " ../../../adminforth/spa/src/*"
8+ ],
9+ "*" : [
10+ // "node_modules/adminforth/dist/spa/node_modules/*"
11+ " ../../../adminforth/spa/node_modules/*"
12+ ],
13+ "@@/*" : [
14+ // "node_modules/adminforth/dist/spa/src/*"
15+ " ."
16+ ]
17+ }
18+ },
19+ "include" : [
20+ " ./**/*.ts" ,
21+ " ./**/*.tsx" ,
22+ " ./**/*.vue" ,
23+ " ../**/*.ts" ,
24+ " ../**/*.tsx" ,
25+ " ../**/*.vue" ,
26+ " ../*.vue" ,
27+ " ../*.ts" ,
28+ " ../*.tsx"
29+ ]
30+ }
Original file line number Diff line number Diff line change @@ -189,6 +189,19 @@ export default class AuditLogPlugin extends AdminForthPlugin {
189189 columnName : this . options . resourceColumns . resourceCreatedColumnName ,
190190 direction : AdminForthSortDirections . desc
191191 }
192+
193+ resource . options = resource . options || { } as any ;
194+ resource . options . pageInjections = resource . options . pageInjections || { } as any ;
195+ resource . options . pageInjections . show = resource . options . pageInjections . show || { } as any ;
196+ if ( ! resource . options . pageInjections . show . bottom ) {
197+ resource . options . pageInjections . show . bottom = [ ] as any [ ] ;
198+ } else if ( ! Array . isArray ( resource . options . pageInjections . show . bottom ) ) {
199+ resource . options . pageInjections . show . bottom = [ resource . options . pageInjections . show . bottom ] as any [ ] ;
200+ }
201+ const bottom = resource . options . pageInjections . show . bottom as any [ ] ;
202+ const compDecl = { file : this . componentPath ( 'RelatedLogsLink.vue' ) , meta : { ...this . options , pluginInstanceId : this . pluginInstanceId } } as any ;
203+ const already = bottom . some ( ( d : any ) => d ?. file === compDecl . file ) ;
204+ if ( ! already ) bottom . push ( compDecl ) ;
192205 return ;
193206 } ;
194207
You can’t perform that action at this time.
0 commit comments