From cec833ffc43a1fc4af753f50e536d5bf2e59e928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 19 Jun 2021 17:57:09 +0200 Subject: [PATCH] sort attributes by types, type icons --- ui/src/lib/types.ts | 15 +++++++ ui/src/types/base.ts | 4 -- ui/src/views/Inspect.vue | 96 +++++++++++++++++++++++++++------------- 3 files changed, 81 insertions(+), 34 deletions(-) create mode 100644 ui/src/lib/types.ts diff --git a/ui/src/lib/types.ts b/ui/src/lib/types.ts new file mode 100644 index 0000000..7277e80 --- /dev/null +++ b/ui/src/lib/types.ts @@ -0,0 +1,15 @@ + +export class UpType { + name: string | null = null; + attributes: string[] = []; + + public getIcon(): string | undefined { + return this.name ? TYPE_ICONS[this.name] : undefined; + } +} + +const TYPE_ICONS: { [key: string]: string } = { + "BLOB": "box", + "FS_FILE": "file-earmark", + "FS_DIR": "folder" +} \ No newline at end of file diff --git a/ui/src/types/base.ts b/ui/src/types/base.ts index 3e45a9d..e5bfc56 100644 --- a/ui/src/types/base.ts +++ b/ui/src/types/base.ts @@ -28,8 +28,4 @@ export interface IFile { export interface VaultInfo { name: string | null; location: string; -} - -export interface IType { - name?: string; } \ No newline at end of file diff --git a/ui/src/views/Inspect.vue b/ui/src/views/Inspect.vue index 105d210..4a69f9f 100644 --- a/ui/src/views/Inspect.vue +++ b/ui/src/views/Inspect.vue @@ -8,21 +8,23 @@
-