Add dead_hosts and redirection_hosts

This commit is contained in:
Julian Gassner
2025-01-09 22:47:08 +00:00
parent 6bbe7d4cc4
commit 50f7bfc726
5 changed files with 45 additions and 15 deletions

View File

@@ -48,20 +48,21 @@ module.exports = Mn.View.extend({
return {
canManage: App.Cache.User.canManage('certificates'),
isExpired: function () {
console.log(this);
return moment(this.expires_on).isBefore(moment());
},
dns_providers: dns_providers,
proxy_hosts: this.getProxyHosts()
active_domain_names: function () {
const { proxy_hosts = [], redirect_hosts = [], dead_hosts = [] } = this;
console.log(proxy_hosts)
return [...proxy_hosts, ...redirect_hosts, ...dead_hosts].reduce((acc, host) => {
acc.push(...(host.domain_names || []));
return acc;
}, []);
}
};
},
getProxyHosts: function () {
const hosts = this.model.attributes.proxy_hosts || [];
return hosts.reduce((acc, host) => {
acc.push(...(host.domain_names || []));
return acc;
}, []);
},
initialize: function () {
this.listenTo(this.model, 'change', this.render);