Feature/custom locations (#74)
* New feature: custom locations * Custom locations: exteding config generator * Custom locations: refactoring * Fixing proxy_host table on small screens * Custom locations: translations * Custom locations bugfix * Custom locations bugfix * PR #74 fixes
This commit is contained in:
37
src/frontend/js/models/proxy-host-location.js
Normal file
37
src/frontend/js/models/proxy-host-location.js
Normal file
@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
const Backbone = require('backbone');
|
||||
|
||||
const model = Backbone.Model.extend({
|
||||
idAttribute: 'id',
|
||||
|
||||
defaults: function() {
|
||||
return {
|
||||
opened: false,
|
||||
path: '',
|
||||
advanced_config: '',
|
||||
forward_scheme: 'http',
|
||||
forward_host: '',
|
||||
forward_port: '80'
|
||||
}
|
||||
},
|
||||
|
||||
toJSON() {
|
||||
const r = Object.assign({}, this.attributes);
|
||||
delete r.opened;
|
||||
return r;
|
||||
},
|
||||
|
||||
toggleVisibility: function () {
|
||||
this.save({
|
||||
opened: !this.get('opened')
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
Model: model,
|
||||
Collection: Backbone.Collection.extend({
|
||||
model
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user