forked from geolba/tethys.backend
- HomeController.ts: addes api method for showing number of publications per month for given year
- adapted command ValidateChecksum.ts: on published files are checked. better information logging - better LineChart.vue component: showing real statistics - start/routes/apu.ts: added Route.get('/statistic/:year', 'HomeController.findPublicationsPerMonth');
This commit is contained in:
parent
8cef7390d7
commit
68928b5e07
10 changed files with 260 additions and 74 deletions
|
@ -36,8 +36,12 @@ export default class ValidateChecksum extends BaseCommand {
|
|||
const { default: File } = await import('App/Models/File');
|
||||
// const { default: HashValue } = await (await (import ('App/Models/HashValue')));
|
||||
|
||||
// query all files from database:
|
||||
const files = await File.query().preload('hashvalues');
|
||||
// query all published files from database:
|
||||
const files = await File.query()
|
||||
.whereHas('dataset', (dQuery) => {
|
||||
dQuery.where('server_state', 'published');
|
||||
})
|
||||
.preload('hashvalues');
|
||||
|
||||
// const logLevel = Config.get('app.logger.level', 'info');
|
||||
// console.log(this.logger.)
|
||||
|
@ -56,7 +60,7 @@ export default class ValidateChecksum extends BaseCommand {
|
|||
}
|
||||
|
||||
if (hashValue['md5'] === calculatedMd5FileHash) {
|
||||
Logger.info(`File id ${file.id}: stored md5 checksum: ${calculatedMd5FileHash}, control md5 checksum: ${hashValue['md5']}`);
|
||||
Logger.info(`File id ${file.id} OK: stored md5 checksum: ${calculatedMd5FileHash}, same control md5 checksum: ${hashValue['md5']}`);
|
||||
} else {
|
||||
Logger.error(
|
||||
`File id ${file.id}: stored md5 checksum: ${calculatedMd5FileHash}, control md5 checksum: ${hashValue['md5']}`,
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue