diff --git a/src/nginxconfig/scss/style.scss b/src/nginxconfig/scss/style.scss index 9df1f76..7003ec7 100644 --- a/src/nginxconfig/scss/style.scss +++ b/src/nginxconfig/scss/style.scss @@ -49,6 +49,26 @@ $highlight: #f2c94c; color: $dark-blue; } } + + a { + i { + font-size: .75em; + + &.fa-plus { + margin: 0 .35rem 0 0; + } + + &.fa-times { + margin: 0 0 0 .35rem; + transition: color $transition; + + &:hover, + &:focus { + color: $primary; + } + } + } + } } } } diff --git a/src/nginxconfig/templates/app.vue b/src/nginxconfig/templates/app.vue index 1f6088f..7f04e09 100644 --- a/src/nginxconfig/templates/app.vue +++ b/src/nginxconfig/templates/app.vue @@ -29,16 +29,22 @@ limitations under the License.
-
@@ -67,11 +73,15 @@ limitations under the License. i18n, domains: [ clone(Domain.delegated), - clone(Domain.delegated), ], active: 0, }; }, + computed: { + activeDomains() { + return this.$data.domains.map((domain, index) => [domain, index]).filter(d => d[0] !== null); + }, + }, methods: { changes(index) { const data = this.$data.domains[index]; @@ -83,6 +93,14 @@ limitations under the License. if (changes) return ` (${changes.toLocaleString()})`; return ''; }, + add() { + this.$data.domains.push(clone(Domain.delegated)); + this.$data.active = this.$data.domains.length - 1; + }, + remove(index) { + this.$set(this.$data.domains, index, null); + if (this.$data.active === index) this.$data.active = 0; + }, }, };