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

- 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:
Kaimbacher 2025-10-14 12:19:09 +02:00
commit b5bbe26ec2
27 changed files with 1221 additions and 603 deletions

View file

@ -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');

View file

@ -43,10 +43,14 @@ async function scanFileForViruses(filePath: string | undefined, options: Options
scanRecursively: true, // If true, deep scan folders recursively
clamdscan: {
active: true, // If true, this module will consider using the clamdscan binary
host: options.host,
port: options.port,
host: options.host, // IP of host to connect to TCP interface,
port: options.port, // Port of host to use when connecting to TCP interface
socket: '/var/run/clamav/clamd.socket', // Socket file for connecting via socket
localFallback: false, // Use local clamscan binary if socket/tcp fails
// port: options.port,
multiscan: true, // Scan using all available cores! Yay!
},
preference: 'clamdscan', // If clamdscan is found and active, it will be used by default over clamscan
};
const clamscan = await new ClamScan().init(opts);