- mail_settings_controller for setting smtp settings - added view ror rjecting dataset for editor - added new model AppConfig for stroing appwide config values - better validate_chesum.ts command with process chunking - added vue3 apps 'BasicSettings' like email, profile settings - started with 2 multilingual capabilities - npm updates
This commit is contained in:
parent
010bead723
commit
b06ccae603
67 changed files with 7820 additions and 1463 deletions
16
start/env.ts
16
start/env.ts
|
@ -19,7 +19,7 @@ export default await Env.create(new URL("../", import.meta.url), {
|
|||
APP_KEY: Env.schema.string(),
|
||||
APP_NAME: Env.schema.string(),
|
||||
CACHE_VIEWS: Env.schema.boolean(),
|
||||
SESSION_DRIVER: Env.schema.enum(["cookie" ,"memory"] as const),
|
||||
SESSION_DRIVER: Env.schema.enum(["cookie", "memory"] as const),
|
||||
|
||||
DRIVE_DISK: Env.schema.enum(['local'] as const),
|
||||
NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
|
||||
|
@ -32,8 +32,18 @@ export default await Env.create(new URL("../", import.meta.url), {
|
|||
|
||||
REDIS_HOST: Env.schema.string({ format: 'host' }),
|
||||
REDIS_PORT: Env.schema.number(),
|
||||
|
||||
|
||||
HASH_DRIVER: Env.schema.enum(["scrypt", "argon", "bcrypt", "laravel", undefined] as const),
|
||||
OAI_LIST_SIZE: Env.schema.number()
|
||||
OAI_LIST_SIZE: Env.schema.number(),
|
||||
|
||||
/*
|
||||
|----------------------------------------------------------
|
||||
| Variables for configuring the mail package
|
||||
|----------------------------------------------------------
|
||||
*/
|
||||
SMTP_HOST: Env.schema.string.optional(),
|
||||
SMTP_PORT: Env.schema.string.optional(),
|
||||
RESEND_API_KEY: Env.schema.string.optional()
|
||||
|
||||
})
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import AdminuserController from '#controllers/Http/Admin/AdminuserController';
|
|||
import RoleController from '#controllers/Http/Admin/RoleController';
|
||||
import LicenseController from '#controllers/Http/Admin/LicenseController';
|
||||
import MimetypeController from '#controllers/Http/Admin/MimetypeController';
|
||||
import MailSettingsController from '#controllers/Http/Admin/mailsettings_controller';
|
||||
|
||||
import DatasetController from '#app/Controllers/Http/Submitter/DatasetController';
|
||||
import PersonController from '#app/Controllers/Http/Submitter/PersonController';
|
||||
|
@ -42,7 +43,7 @@ import ReviewerDatasetController from '#app/Controllers/Http/Reviewer/DatasetCo
|
|||
|
||||
import './routes/api.js';
|
||||
import { middleware } from './kernel.js'
|
||||
|
||||
import db from '@adonisjs/lucid/services/db'; // Import the DB service
|
||||
|
||||
// router.get('health', async ({ response }) => {
|
||||
// const report = await HealthCheck.getReport();
|
||||
|
@ -129,9 +130,31 @@ router.post('/signout', [AuthController, 'logout']).as('logout');
|
|||
// administrator
|
||||
router.group(() => {
|
||||
router.get('/settings', async ({ inertia }: HttpContext) => {
|
||||
return inertia.render('Admin/Settings');
|
||||
const updatedConfigValue = await db.from('appconfigs')
|
||||
.select('configvalue')
|
||||
.where('appid', 'backgroundjob')
|
||||
.where('configkey', 'lastjob')
|
||||
.first();
|
||||
|
||||
// return inertia.render('Admin/Settings', {
|
||||
// lastCron: updatedConfigValue.configvalue,
|
||||
// });
|
||||
if (updatedConfigValue != null) {
|
||||
return inertia.render('Admin/Settings', {
|
||||
lastCron: updatedConfigValue.configvalue,
|
||||
});
|
||||
} else {
|
||||
// Handle the case where the config value is null
|
||||
// For example, you can return a default value or render an error view
|
||||
return inertia.render('Admin/Settings', {
|
||||
lastCron: '', // Provide a default value if necessary
|
||||
// error: 'Configuration not found', // Optional: provide an error message
|
||||
});
|
||||
}
|
||||
})
|
||||
.as('overview');
|
||||
router.post('/mail/store', [MailSettingsController, 'setMailSettings']).as('mail.store').use(middleware.can(['user-create']));
|
||||
router.post('/mail/send', [MailSettingsController, 'sendTestMail']).as('mail.send').use(middleware.can(['user-create']));
|
||||
|
||||
// user routes
|
||||
router.get('/user', [AdminuserController, 'index']).as('user.index').use(middleware.can(['user-list']));
|
||||
|
@ -254,6 +277,15 @@ router.group(() => {
|
|||
.where('id', router.matchers.number())
|
||||
.use([middleware.auth(), middleware.can(['dataset-approve'])]);
|
||||
|
||||
router.get('dataset/:id/reject', [EditorDatasetController, 'reject'])
|
||||
.as('editor.dataset.reject')
|
||||
.where('id', router.matchers.number())
|
||||
.use([middleware.auth(), middleware.can(['dataset-editor-reject'])]);
|
||||
router.put('dataset/:id/reject', [EditorDatasetController, 'rejectUpdate'])
|
||||
.as('editor.dataset.rejectUpdate')
|
||||
.where('id', router.matchers.number())
|
||||
.use([middleware.auth(), middleware.can(['dataset-editor-reject'])]);
|
||||
|
||||
router.get('dataset/:id/publish', [EditorDatasetController, 'publish'])
|
||||
.as('editor.dataset.publish')
|
||||
.where('id', router.matchers.number())
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue