2018-08-02 05:48:47 -04:00
|
|
|
const Backbone = require('backbone');
|
|
|
|
|
|
|
|
const model = Backbone.Model.extend({
|
|
|
|
idAttribute: 'id',
|
|
|
|
|
|
|
|
defaults: function () {
|
|
|
|
return {
|
2018-08-15 23:08:56 -04:00
|
|
|
id: undefined,
|
2018-08-07 06:27:20 -04:00
|
|
|
created_on: null,
|
|
|
|
modified_on: null,
|
|
|
|
provider: '',
|
|
|
|
nice_name: '',
|
|
|
|
domain_names: [],
|
|
|
|
expires_on: null,
|
|
|
|
meta: {},
|
2018-08-02 05:48:47 -04:00
|
|
|
// The following are expansions:
|
2018-08-07 06:27:20 -04:00
|
|
|
owner: null,
|
|
|
|
proxy_hosts: [],
|
|
|
|
redirection_hosts: [],
|
|
|
|
dead_hosts: []
|
2018-08-02 05:48:47 -04:00
|
|
|
};
|
2018-08-07 06:27:20 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns {Boolean}
|
|
|
|
*/
|
|
|
|
hasSslFiles: function () {
|
|
|
|
let meta = this.get('meta');
|
|
|
|
return typeof meta['certificate'] !== 'undefined' && meta['certificate'] && typeof meta['certificate_key'] !== 'undefined' && meta['certificate_key'];
|
2018-08-02 05:48:47 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
Model: model,
|
|
|
|
Collection: Backbone.Collection.extend({
|
|
|
|
model: model
|
|
|
|
})
|
|
|
|
};
|