Certificates into their own section

This commit is contained in:
Jamie Curnow
2018-08-07 20:27:20 +10:00
parent 1c57ccdc87
commit c749a22b52
41 changed files with 599 additions and 385 deletions

View File

@ -7,12 +7,28 @@ const model = Backbone.Model.extend({
defaults: function () {
return {
id: 0,
created_on: null,
modified_on: null,
id: 0,
created_on: null,
modified_on: null,
provider: '',
nice_name: '',
domain_names: [],
expires_on: null,
meta: {},
// The following are expansions:
owner: null
owner: null,
proxy_hosts: [],
redirection_hosts: [],
dead_hosts: []
};
},
/**
* @returns {Boolean}
*/
hasSslFiles: function () {
let meta = this.get('meta');
return typeof meta['certificate'] !== 'undefined' && meta['certificate'] && typeof meta['certificate_key'] !== 'undefined' && meta['certificate_key'];
}
});

View File

@ -7,16 +7,16 @@ const model = Backbone.Model.extend({
defaults: function () {
return {
id: 0,
created_on: null,
modified_on: null,
domain_names: [],
ssl_enabled: false,
ssl_provider: false,
ssl_forced: false,
meta: {},
id: 0,
created_on: null,
modified_on: null,
domain_names: [],
certificate_id: 0,
ssl_forced: false,
meta: {},
// The following are expansions:
owner: null
owner: null,
certificate: null
};
}
});

View File

@ -14,25 +14,16 @@ const model = Backbone.Model.extend({
forward_ip: '',
forward_port: null,
access_list_id: 0,
ssl_enabled: false,
ssl_provider: false,
certificate_id: 0,
ssl_forced: false,
caching_enabled: false,
block_exploits: false,
meta: {},
// The following are expansions:
owner: null,
access_list: null
access_list: null,
certificate: null
};
},
/**
* @param {String} type 'letsencrypt' or 'other'
* @returns {Boolean}
*/
hasSslFiles: function (type) {
let meta = this.get('meta');
return typeof meta[type + '_certificate'] !== 'undefined' && meta[type + '_certificate'] && typeof meta[type + '_certificate_key'] !== 'undefined' && meta[type + '_certificate_key'];
}
});

View File

@ -13,13 +13,13 @@ const model = Backbone.Model.extend({
domain_names: [],
forward_domain_name: '',
preserve_path: true,
ssl_enabled: false,
ssl_provider: false,
certificate_id: 0,
ssl_forced: false,
block_exploits: false,
meta: {},
// The following are expansions:
owner: null
owner: null,
certificate: null
};
}
});

View File

@ -10,13 +10,14 @@ const model = Backbone.Model.extend({
id: 0,
created_on: null,
modified_on: null,
owner: null,
incoming_port: null,
forward_ip: null,
forwarding_port: null,
tcp_forwarding: true,
udp_forwarding: false,
meta: {}
meta: {},
// The following are expansions:
owner: null
};
}
});