feat: Enhance background job settings UI and functionality
Some checks failed
build.yaml / feat: Enhance background job settings UI and functionality (push) Failing after 0s
Some checks failed
build.yaml / feat: Enhance background job settings UI and functionality (push) Failing after 0s
- Updated BackgroundJob.vue to improve the display of background job statuses, including missing cross-references and current job mode. - Added auto-refresh functionality for background job status. - Introduced success toast notifications for successful status refreshes. - Modified the XML serialization process in DatasetXmlSerializer for better caching and performance. - Implemented a new RuleProvider for managing custom validation rules. - Improved error handling in routes for loading background job settings. - Enhanced ClamScan configuration with socket support for virus scanning. - Refactored dayjs utility to streamline locale management.
This commit is contained in:
parent
6757bdb77c
commit
b5bbe26ec2
27 changed files with 1221 additions and 603 deletions
|
|
@ -127,15 +127,33 @@ router
|
|||
.group(() => {
|
||||
router
|
||||
.get('/settings', async ({ inertia }: HttpContext) => {
|
||||
const updatedConfigValue = await db
|
||||
.from('appconfigs')
|
||||
.select('configvalue')
|
||||
.where('appid', 'backgroundjob')
|
||||
.where('configkey', 'lastjob')
|
||||
.first();
|
||||
return inertia.render('Admin/Settings', {
|
||||
lastCron: updatedConfigValue?.configvalue || '',
|
||||
});
|
||||
try {
|
||||
const [lastJobConfig, missingCrossReferencesConfig] = await Promise.all([
|
||||
db.from('appconfigs').select('configvalue').where('appid', 'backgroundjob').where('configkey', 'lastjob').first(),
|
||||
db
|
||||
.from('appconfigs')
|
||||
.select('configvalue')
|
||||
.where('appid', 'commands')
|
||||
.where('configkey', 'missing_cross_references_count')
|
||||
.first(),
|
||||
]);
|
||||
|
||||
return inertia.render('Admin/Settings', {
|
||||
lastCron: lastJobConfig?.configvalue || 0,
|
||||
missingCrossReferencesCount: parseInt(missingCrossReferencesConfig?.configvalue || '0'),
|
||||
// Add timestamp for cache busting
|
||||
lastUpdated: Date.now(),
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Failed to load background job settings:', error);
|
||||
return inertia.render('Admin/Settings', {
|
||||
lastCron: 0,
|
||||
cronMaxAge: 0,
|
||||
backgroundJobsMode: 'cron',
|
||||
missingCrossReferencesCount: 0,
|
||||
error: 'Failed to load background job settings',
|
||||
});
|
||||
}
|
||||
})
|
||||
.as('overview');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue