mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-24 13:59:27 +08:00
33 lines
683 B
JavaScript
33 lines
683 B
JavaScript
var Settings = require('../settings/settings')
|
|
, Setting = require('../settings/settings')
|
|
, Model = require('../../model')
|
|
;
|
|
|
|
var models = module.exports.models = {};
|
|
var refresh = module.exports.refresh = function() {
|
|
Settings
|
|
.spawn()
|
|
.find({plugin: 'models'})
|
|
.notify(function(model) {
|
|
var m = models[model.name] = Model.spawn();
|
|
m.description = model.description;
|
|
m.allowed = model.allowed;
|
|
m.collection = model.collection;
|
|
m.plugin = model.plugin;
|
|
})
|
|
.fetch()
|
|
;
|
|
}
|
|
|
|
// initial refresh
|
|
refresh();
|
|
|
|
// create or update general graph settings
|
|
Setting
|
|
.spawn()
|
|
.set({plugin: 'models', name: 'models'})
|
|
.save()
|
|
;
|
|
|
|
|