diff --git a/model/domain.go b/model/domain.go index 00c49ff..44bbfde 100644 --- a/model/domain.go +++ b/model/domain.go @@ -50,6 +50,9 @@ type Domain struct { // DomainName is the FQDN of the managed Domain. DomainName string `json:"domain"` + // Group is a hint string aims to group domains. + Group string `json:"group"` + // ZoneHistory are the identifiers to the Zone attached to the current // Domain. ZoneHistory []int64 `json:"zone_history"` diff --git a/ui/src/components/hDomaingroupList.vue b/ui/src/components/hDomaingroupList.vue new file mode 100644 index 0000000..dc9c2a9 --- /dev/null +++ b/ui/src/components/hDomaingroupList.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index bc531d2..32a7316 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -114,6 +114,11 @@ "placeholder-new-sub": "new.subdomain", "form-new-subdomain": "Add a new subdomain under {0}:" }, + "domaingroups": { + "manage": "Manage your domain's groups", + "no-group": "Ungroupped", + "title": "Your groups" + }, "email": { "address": "Email address", "instruction": { diff --git a/ui/src/views/home.vue b/ui/src/views/home.vue index 827ae5e..cbae7c4 100644 --- a/ui/src/views/home.vue +++ b/ui/src/views/home.vue @@ -112,6 +112,31 @@ @provider-selected="filteredProvider = $event" /> + + + + + @@ -123,6 +148,7 @@ import { mapGetters } from 'vuex' export default { components: { + hDomaingroupList: () => import('@/components/hDomaingroupList'), hListGroupInputNewDomain: () => import('@/components/hListGroupInputNewDomain'), hProviderListDomains: () => import('@/components/hProviderListDomains'), hProviderList: () => import('@/components/providerList'), @@ -132,15 +158,15 @@ export default { data: function () { return { noDomainsList: true, - filteredGroup: null, + filteredGroup: '', filteredProvider: null } }, computed: { filteredDomains () { - if (this.sortedDomains && this.filteredProvider) { - return this.sortedDomains.filter(d => d.id_provider === this.filteredProvider._id) + if (this.sortedDomains && (this.filteredProvider || this.filteredGroup)) { + return this.sortedDomains.filter(d => (!this.filteredProvider || d.id_provider === this.filteredProvider._id) && (this.filteredGroup === '' || d.group === this.filteredGroup || (this.filteredGroup === 'undefined' && d.group === undefined))) } else { return this.sortedDomains }