This commit is contained in:
parent
f828ca4491
commit
cb51a4136f
167 changed files with 21485 additions and 21212 deletions
|
@ -1,20 +1,57 @@
|
|||
/**
|
||||
* Feel free to let me know via PR,
|
||||
* if you find something broken in this config file.
|
||||
*/
|
||||
import { defineConfig } from '@adonisjs/inertia';
|
||||
import type { HttpContext } from '@adonisjs/core/http';
|
||||
|
||||
import { InertiaConfig } from '@ioc:EidelLev/Inertia';
|
||||
export default defineConfig({
|
||||
/**
|
||||
* Path to the Edge view that will be used as the root view for Inertia responses
|
||||
*/
|
||||
rootView: 'app',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Inertia-AdonisJS config
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
/**
|
||||
* Data that should be shared with all rendered pages
|
||||
*/
|
||||
sharedData: {
|
||||
errors: (ctx) => ctx.session.flashMessages.get('errors'),
|
||||
|
||||
export const inertia: InertiaConfig = {
|
||||
view: 'app',
|
||||
// ssr: {
|
||||
// enabled: false,
|
||||
// },
|
||||
};
|
||||
user_id: (ctx) => {
|
||||
return ctx.session.flashMessages.get('user_id');
|
||||
},
|
||||
|
||||
flash: (ctx) => {
|
||||
return {
|
||||
message: ctx.session.flashMessages.get('message'),
|
||||
warning: ctx.session.flashMessages.get('warning'),
|
||||
};
|
||||
},
|
||||
|
||||
// params: ({ params }) => params,
|
||||
authUser: async ({ auth }: HttpContext) => {
|
||||
if (auth.user) {
|
||||
await auth.user.load('roles');
|
||||
return auth.user;
|
||||
// {
|
||||
// 'id': auth.user.id,
|
||||
// 'login': auth.user.login,
|
||||
// };
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// import { InertiaConfig } from '@ioc:EidelLev/Inertia';
|
||||
|
||||
// /*
|
||||
// |--------------------------------------------------------------------------
|
||||
// | Inertia-AdonisJS config
|
||||
// |--------------------------------------------------------------------------
|
||||
// |
|
||||
// */
|
||||
|
||||
// export const inertia: InertiaConfig = {
|
||||
// view: 'app',
|
||||
// // ssr: {
|
||||
// // enabled: false,
|
||||
// // },
|
||||
// };
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue