From f1fbc2d917a7fd1a40c22271263263b772713659 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Fri, 12 May 2023 09:27:47 +0200 Subject: [PATCH] - add md5 checksum to dataset-detail.component.vue --- src/models/dataset.ts | 41 ++++++++++++------- .../dataset-detail.component.vue | 16 ++++---- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/models/dataset.ts b/src/models/dataset.ts index dfd6bfa..841d2c4 100644 --- a/src/models/dataset.ts +++ b/src/models/dataset.ts @@ -370,18 +370,31 @@ export interface Project { updated_at: string; } -export interface DbFile { - id: number; - document_id: number; - path_name: string; - label: string; - comment?: string; - mime_type: string; - language?: string; - file_size: bigint; - visible_in_frontdoor: boolean; - visible_in_oai: boolean; - sort_order: Int16Array; - created_at: string; - updated_at: string; +export class DbFile { + constructor( + public id: number, + public document_id: number, + public path_name: string, + public label: string, + public mime_type: string, + public file_size: number, + public visible_in_frontdoor: boolean, + public visible_in_oai: boolean, + public sort_order: Int16Array, + public created_at: string, + public updated_at: string, + public hashvalues: Array, + public comment?: string, + public language?: string, + ) {} + + public get HashValue(): Nullable { + return this.hashvalues.find((e) => e.type === "md5"); + } +} + +export interface HashValue { + file_id: number; + type: string; + value: string; } diff --git a/src/views/dataset-detail.component/dataset-detail.component.vue b/src/views/dataset-detail.component/dataset-detail.component.vue index b2b55b8..8ac0c45 100644 --- a/src/views/dataset-detail.component/dataset-detail.component.vue +++ b/src/views/dataset-detail.component/dataset-detail.component.vue @@ -68,10 +68,10 @@
Title/
title:
-

{{ dataset.MainTitle.value }}

+

{{ dataset.MainTitle?.value }}


- {{ dataset.TranslatedTitle.value }} + {{ dataset.TranslatedTitle?.value }}

@@ -81,10 +81,10 @@ abstract:
-

{{ dataset.MainAbstract.value }}

+

{{ dataset.MainAbstract?.value }}


- {{ dataset.TranslatedAbstract.value }} + {{ dataset.TranslatedAbstract?.value }}

@@ -102,7 +102,7 @@
Methodik/
method:
- {{ dataset.MethodsAbstract.value }} + {{ dataset.MethodsAbstract?.value }}
-
@@ -114,7 +114,7 @@ Path Name - File Extension + File Ext. File Size @@ -122,12 +122,14 @@ {{ file.label }} +
+ md5: {{ file.hashvalues.find((e) => e.type === "md5")?.value }} {{ getExtension(file.path_name) }} - {{ formatSize(file.file_size, 2) }} + {{ formatSize(file.file_size) }}