From 9b120bb6d5b94f288cd1aeb30b599563ae8aaedc Mon Sep 17 00:00:00 2001 From: Joxit Date: Tue, 1 Jan 2019 22:46:23 +0100 Subject: [PATCH 1/5] [feat #56] Update catalog, use material-cards instead of list --- src/style.css | 11 ++++++++++- src/tags/catalog.tag | 15 ++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/style.css b/src/style.css index 64d9880..ff97e3f 100644 --- a/src/style.css +++ b/src/style.css @@ -99,11 +99,12 @@ h2 { list-style: none; } -.list.highlight > li:hover { +.list.highlight:hover { background-color: #eee; cursor: pointer; } +.list > span, .list > li { box-sizing: border-box; line-height: 1; @@ -112,6 +113,7 @@ h2 { overflow: hidden; } +.list > span i.material-icons, .list > li i.material-icons { margin-right: 32px; height: 24px; @@ -121,6 +123,7 @@ h2 { color: #757575; } +.list > span, .list > li > span { height: 100%; text-decoration: none; @@ -133,6 +136,11 @@ h2 { align-items: center; } +material-card.list { + margin-top: 10px; + margin-bottom: 10px; +} + .material-card-title-action { -webkit-align-items: center; -ms-flex-align: center; @@ -345,6 +353,7 @@ select { text-align: center; } +catalog material-card, tag-history material-card { min-height: auto; } diff --git a/src/tags/catalog.tag b/src/tags/catalog.tag index d31e732..4e7a15d 100644 --- a/src/tags/catalog.tag +++ b/src/tags/catalog.tag @@ -26,16 +26,13 @@ along with this program. If not, see .
- - + + + send + { item } + + + diff --git a/src/tags/catalog-element.tag b/src/tags/catalog-element.tag new file mode 100644 index 0000000..97ef654 --- /dev/null +++ b/src/tags/catalog-element.tag @@ -0,0 +1,36 @@ + + + + + + + send + { opts.item } + + + + + diff --git a/src/tags/catalog.tag b/src/tags/catalog.tag index 4e7a15d..29d9be9 100644 --- a/src/tags/catalog.tag +++ b/src/tags/catalog.tag @@ -27,12 +27,7 @@ along with this program. If not, see . - - - send - { item } - - + diff --git a/src/tags/catalog.tag b/src/tags/catalog.tag index 29d9be9..51538a9 100644 --- a/src/tags/catalog.tag +++ b/src/tags/catalog.tag @@ -20,7 +20,7 @@ along with this program. If not, see .

Repositories of { registryUI.name() } -
{ registryUI.catalog.repositories.length } images
+
{ registryUI.catalog.length } images

@@ -38,6 +38,19 @@ along with this program. If not, see . if (this.status == 200) { registryUI.catalog.repositories = JSON.parse(this.responseText).repositories || []; registryUI.catalog.repositories.sort(); + registryUI.catalog.length = registryUI.catalog.repositories.length; registryUI.catalog.repositories = registryUI.catalog.repositories.reduce(function(acc, e) { + const slash = e.indexOf('/'); + if (slash > 0) { + const repoName = e.substring(0, slash) + '/'; + if (acc.length == 0 || acc[acc.length - 1].repo != repoName) { + acc.push({repo: repoName, images: []}); + } + acc[acc.length - 1].images.push(e); + return acc; + } + acc.push(e); + return acc; + }, []); } else if (this.status == 404) { registryUI.snackbar('Server not found', true); } else { From 7e2e4b60100b3377865fb9c9abcb7676d2f9f44b Mon Sep 17 00:00:00 2001 From: Joxit Date: Fri, 4 Jan 2019 22:02:22 +0100 Subject: [PATCH 4/5] [feat #56] Add `expand_more` icon for aggregated images --- src/style.css | 10 ++++++++++ src/tags/catalog-element.tag | 11 ++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/style.css b/src/style.css index 13cbb49..7c31d9c 100644 --- a/src/style.css +++ b/src/style.css @@ -123,6 +123,16 @@ h2 { color: #757575; } +.list > span i.material-icons.right.animated { + transition: all 350ms cubic-bezier(.4,0,.2,1); + margin-right: 10px; + position: absolute; + right: 0; +} +.list > span i.material-icons.right.animated.expanded { + transform: rotate(180deg); +} + .list > span, .list > li > span { height: 100%; diff --git a/src/tags/catalog-element.tag b/src/tags/catalog-element.tag index acc6507..9385c4b 100644 --- a/src/tags/catalog-element.tag +++ b/src/tags/catalog-element.tag @@ -16,14 +16,15 @@ along with this program. If not, see . --> - + send { typeof opts.item === "string" ? opts.item : opts.item.repo } + expand_more - +