mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-13 21:06:16 +08:00
Renamed "events" array to "eventNames"
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
### Breaking Changes
|
||||
- All configuration properties on the `Resource` class have been moved to the prototype: `external`, `events`, `label`, `defaultPath`, `basicDashboard`, and `dashboard`.
|
||||
- The configuration option `Resource.events` has been renamed `Resource.eventNames`.
|
||||
|
||||
|
||||
### Major Bugfixes
|
||||
@@ -110,7 +110,7 @@ Resource.prototype.parse = function (url) {
|
||||
|
||||
Resource.prototype.load = function (fn) {
|
||||
var resource = this
|
||||
, eventNames = this.constructor && this.constructor.events
|
||||
, eventNames = this.eventNames
|
||||
, remaining = eventNames && eventNames.length
|
||||
, configPath = this.options && this.options.configPath
|
||||
, events = this.events = {};
|
||||
|
||||
@@ -35,7 +35,7 @@ util.inherits(Collection, Resource);
|
||||
Collection.prototype.external = {};
|
||||
Collection.prototype.clientGeneration = true;
|
||||
|
||||
Collection.events = ['Get', 'Validate', 'Post', 'Put', 'Delete'];
|
||||
Collection.prototype.eventNames = ['Get', 'Validate', 'Post', 'Put', 'Delete'];
|
||||
Collection.dashboard = {
|
||||
path: path.join(__dirname, 'dashboard')
|
||||
, pages: ['Properties', 'Data', 'Events', 'API']
|
||||
|
||||
@@ -134,7 +134,7 @@ Dashboard.prototype.loadPage = function(ctx, fn) {
|
||||
options.resourceId = resourceId;
|
||||
resourceType = resource.constructor;
|
||||
options.resourceType = resourceType.id;
|
||||
options.events = resourceType.events;
|
||||
options.events = resource.eventNames;
|
||||
options.scripts = [];
|
||||
|
||||
var page = parts[1];
|
||||
|
||||
@@ -66,7 +66,7 @@ InternalResources.prototype.handle = function(ctx, next) {
|
||||
var c = types[key]
|
||||
, pages = c.dashboard && c.dashboard.pages;
|
||||
|
||||
if (!pages && c.events) {
|
||||
if (!pages && c.eventNames) {
|
||||
pages = ['Config', 'Events'];
|
||||
}
|
||||
result[key] = {
|
||||
|
||||
@@ -38,7 +38,6 @@ function UserCollection(name, options) {
|
||||
util.inherits(UserCollection, Collection);
|
||||
|
||||
UserCollection.dashboard = Collection.dashboard;
|
||||
UserCollection.events = Collection.events;
|
||||
|
||||
/**
|
||||
* Handle an incoming http `req` and `res` and execute
|
||||
|
||||
Reference in New Issue
Block a user