From b9c23dee6909c68c40c20c10e20ffa4519cb614b Mon Sep 17 00:00:00 2001 From: John Cowen Date: Thu, 24 May 2018 12:47:48 +0100 Subject: [PATCH 01/37] Enable searching by port in the Node > [Service] listing --- ui-v2/app/controllers/dc/nodes/show.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui-v2/app/controllers/dc/nodes/show.js b/ui-v2/app/controllers/dc/nodes/show.js index 0f48b5515..06c5c4004 100644 --- a/ui-v2/app/controllers/dc/nodes/show.js +++ b/ui-v2/app/controllers/dc/nodes/show.js @@ -14,10 +14,15 @@ export default Controller.extend(WithFiltering, { set(this, 'selectedTab', 'health-checks'); }, filter: function(item, { s = '' }) { + const term = s.toLowerCase(); return ( get(item, 'Service') .toLowerCase() - .indexOf(s.toLowerCase()) !== -1 + .indexOf(term) !== -1 || + get(item, 'Port') + .toString() + .toLowerCase() + .indexOf(term) !== -1 ); }, actions: { From fddc36f02f0348480f4bf9b6ca5e290581def478 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Thu, 24 May 2018 13:08:08 +0100 Subject: [PATCH 02/37] Change KV inputs to textareas, also JSON > CODE As the input field was used for KV's it looked like you couldn't save multiline KV's. Changed to textarea so you can see the multilines. Also, JSON is slightly misleading as clicking the toggle doesn't necessarily mean 'I'm going to edit some JSON' it means I want the code editor with syntax highlighting, so renamed the toggle to say 'Code' --- ui-v2/app/styles/components/form-elements.scss | 10 +++++++--- ui-v2/app/styles/core/typography.scss | 1 + ui-v2/app/templates/dc/kv/-form.hbs | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ui-v2/app/styles/components/form-elements.scss b/ui-v2/app/styles/components/form-elements.scss index 683678c07..fa2eae5e0 100644 --- a/ui-v2/app/styles/components/form-elements.scss +++ b/ui-v2/app/styles/components/form-elements.scss @@ -14,8 +14,10 @@ display: block; max-width: 100%; min-width: 100%; - padding: 0.625em; + min-height: 70px; + padding: 0.625em 15px; resize: vertical; + line-height: 1.5; } %form-element [type='text'], %form-element [type='password'] { @@ -37,14 +39,16 @@ box-shadow: none; border-radius: $radius-small; } -.has-error > input { +.has-error > input, +.has-error > textarea { border: 1px solid; } %form-element > span { color: $text-gray; } %form-element [type='text'], -%form-element [type='password'] { +%form-element [type='password'], +%form-element textarea { color: $user-text-gray; } %form-element [type='text'], diff --git a/ui-v2/app/styles/core/typography.scss b/ui-v2/app/styles/core/typography.scss index 43ccd83c3..9527d094f 100644 --- a/ui-v2/app/styles/core/typography.scss +++ b/ui-v2/app/styles/core/typography.scss @@ -63,6 +63,7 @@ h2, body, pre code, input, +textarea, td { font-size: $size-6; } diff --git a/ui-v2/app/templates/dc/kv/-form.hbs b/ui-v2/app/templates/dc/kv/-form.hbs index a001faeae..16d7f41bc 100644 --- a/ui-v2/app/templates/dc/kv/-form.hbs +++ b/ui-v2/app/templates/dc/kv/-form.hbs @@ -11,14 +11,14 @@
From 9c434983543b99ad8440f3a2b39e5b73c6ff3b98 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Thu, 24 May 2018 15:41:11 +0100 Subject: [PATCH 03/37] Auto calculate the height of the tables depending on the space left Additionally make the footer lookup more unique seeing as we are in js here --- ui-v2/app/components/tabular-collection.js | 17 ++++++++++------- .../templates/components/hashicorp-consul.hbs | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ui-v2/app/components/tabular-collection.js b/ui-v2/app/components/tabular-collection.js index c86081f10..11830f086 100644 --- a/ui-v2/app/components/tabular-collection.js +++ b/ui-v2/app/components/tabular-collection.js @@ -62,7 +62,7 @@ export default Component.extend(SlotsMixin, { this._super(...arguments); this.change = change.bind(this); this.confirming = []; - // TODO: This should auto calculate properly from the CSS + // TODO: The row height should auto calculate properly from the CSS this['cell-layout'] = new ZIndexedGrid(get(this, 'width'), 50); this.handler = () => { this.resize(createSizeEvent()); @@ -86,12 +86,15 @@ export default Component.extend(SlotsMixin, { window.removeEventListener('resize', this.handler); }, resize: function(e) { - const $footer = [...$$('#wrapper > footer')][0]; - const $thead = [...$$('main > div')][0]; - if ($thead) { - // TODO: This should auto calculate properly from the CSS - this.set('height', Math.max(0, new Number(e.detail.height - ($footer.clientHeight + 218)))); - this['cell-layout'] = new ZIndexedGrid($thead.clientWidth, 50); + const $tbody = this.$('tbody').get(0); + if ($tbody) { + const rect = $tbody.getBoundingClientRect(); + const $footer = [...$$('footer[role="contentinfo"]')][0]; + const space = rect.top + $footer.clientHeight; + const height = new Number(e.detail.height - space); + this.set('height', Math.max(0, height)); + // TODO: The row height should auto calculate properly from the CSS + this['cell-layout'] = new ZIndexedGrid($tbody.clientWidth, 50); this.updateItems(); this.updateScrollPosition(); } diff --git a/ui-v2/app/templates/components/hashicorp-consul.hbs b/ui-v2/app/templates/components/hashicorp-consul.hbs index cecae95c7..f3396a455 100644 --- a/ui-v2/app/templates/components/hashicorp-consul.hbs +++ b/ui-v2/app/templates/components/hashicorp-consul.hbs @@ -51,7 +51,7 @@
{{yield}}
-