From 60fb7bba5f647a32b429c9ef884d2ce69b754db0 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 13 Nov 2023 02:25:14 +0100 Subject: [PATCH] [media UI] Added support for generic media providers. --- .../webapp/src/components/File/Browser.vue | 33 +------ .../src/components/panels/Media/Browser.vue | 88 +++++++++++-------- .../src/components/panels/Media/Item.vue | 12 +++ .../panels/Media/Providers/File.vue | 32 +++++++ .../panels/Media/Providers/Mixin.vue | 20 +++++ .../components/panels/Media/Providers/Nav.vue | 55 ++++++++++++ .../panels/Media/Providers/meta.json | 17 ++++ .../src/components/panels/Media/style.scss | 31 +++++++ .../http/webapp/src/style/components.scss | 32 +++++++ 9 files changed, 253 insertions(+), 67 deletions(-) create mode 100644 platypush/backend/http/webapp/src/components/panels/Media/Providers/File.vue create mode 100644 platypush/backend/http/webapp/src/components/panels/Media/Providers/Mixin.vue create mode 100644 platypush/backend/http/webapp/src/components/panels/Media/Providers/Nav.vue create mode 100644 platypush/backend/http/webapp/src/components/panels/Media/Providers/meta.json create mode 100644 platypush/backend/http/webapp/src/components/panels/Media/style.scss diff --git a/platypush/backend/http/webapp/src/components/File/Browser.vue b/platypush/backend/http/webapp/src/components/File/Browser.vue index 437eaef38..538065e2b 100644 --- a/platypush/backend/http/webapp/src/components/File/Browser.vue +++ b/platypush/backend/http/webapp/src/components/File/Browser.vue @@ -1,5 +1,5 @@ @@ -35,9 +39,11 @@ import Dropdown from "@/components/elements/Dropdown"; import DropdownItem from "@/components/elements/DropdownItem"; import Icons from "./icons.json"; import MediaImage from "./MediaImage"; +import Utils from "@/Utils"; export default { components: {Dropdown, DropdownItem, MediaImage}, + mixins: [Utils], emits: ['play', 'select', 'view', 'download'], props: { item: { @@ -189,5 +195,11 @@ export default { border-radius: 50%; margin-right: .5em; } + + .creation-date { + font-size: .85em; + color: $default-fg-2; + flex: 1; + } } diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/File.vue b/platypush/backend/http/webapp/src/components/panels/Media/Providers/File.vue new file mode 100644 index 000000000..f9c99cf42 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/File.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/Mixin.vue b/platypush/backend/http/webapp/src/components/panels/Media/Providers/Mixin.vue new file mode 100644 index 000000000..8de115bc2 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/Mixin.vue @@ -0,0 +1,20 @@ + diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/Nav.vue b/platypush/backend/http/webapp/src/components/panels/Media/Providers/Nav.vue new file mode 100644 index 000000000..b475082f9 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/Nav.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/meta.json b/platypush/backend/http/webapp/src/components/panels/Media/Providers/meta.json new file mode 100644 index 000000000..5b7901cbe --- /dev/null +++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/meta.json @@ -0,0 +1,17 @@ +{ + "File": { + "name": "Files", + "icon": { + "class": "fas fa-folder", + "color": "#888888" + } + }, + + "YouTube": { + "name": "YouTube", + "icon": { + "class": "fab fa-youtube", + "color": "#FF0000" + } + } +} diff --git a/platypush/backend/http/webapp/src/components/panels/Media/style.scss b/platypush/backend/http/webapp/src/components/panels/Media/style.scss new file mode 100644 index 000000000..9a77bfe31 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/panels/Media/style.scss @@ -0,0 +1,31 @@ +.grid { + :deep(.item) { + height: 100px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + border: $default-border-2; + cursor: pointer; + + &:hover { + background: $hover-bg; + } + + .icon { + height: 60%; + display: inline-flex; + justify-content: center; + + i { + font-size: 40px; + } + } + } +} + +$media-nav-height: 2.5em; + +:deep(.nav) { + height: $media-nav-height; +} diff --git a/platypush/backend/http/webapp/src/style/components.scss b/platypush/backend/http/webapp/src/style/components.scss index 0ca65f3b8..322e9c0e8 100644 --- a/platypush/backend/http/webapp/src/style/components.scss +++ b/platypush/backend/http/webapp/src/style/components.scss @@ -71,3 +71,35 @@ body { scrollbar-color: $scrollbar-thumb-bg $scrollbar-track-bg; } +// Browser navigator layout +$nav-height: 2.5em; + +.browser { + :deep(.nav) { + width: 100%; + height: $nav-height; + padding: 0.5em 1em; + background: $tab-bg; + box-shadow: $border-shadow-bottom; + white-space: nowrap; + overflow: hidden; + + .path { + cursor: pointer; + + .token { + &:hover { + color: $default-hover-fg; + text-decoration: underline; + } + } + + .separator { + font-size: 1em; + width: 1.2em; + padding: 0 1em; + } + } + } +} +