mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
const Backbone = require('backbone');
|
|
|
|
const model = Backbone.Model.extend({
|
|
idAttribute: 'id',
|
|
|
|
defaults: function () {
|
|
return {
|
|
id: 0,
|
|
created_on: null,
|
|
modified_on: null,
|
|
domain_names: [],
|
|
forward_ip: '',
|
|
forward_port: null,
|
|
access_list_id: null,
|
|
ssl_enabled: false,
|
|
ssl_provider: false,
|
|
ssl_forced: false,
|
|
caching_enabled: false,
|
|
block_exploits: false,
|
|
meta: {},
|
|
// The following are expansions:
|
|
owner: null,
|
|
access_list: 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'];
|
|
}
|
|
});
|
|
|
|
module.exports = {
|
|
Model: model,
|
|
Collection: Backbone.Collection.extend({
|
|
model: model
|
|
})
|
|
};
|