mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-13 21:06:16 +08:00
Fixed rare case where a resource's dashboard would not load
This commit is contained in:
@@ -80,7 +80,7 @@ Dashboard.prototype.route = function(ctx) {
|
||||
|
||||
if (parts.length) {
|
||||
resourceId = parts[0];
|
||||
resource = ctx.server.resources.filter(function(r) { return r.path === '/' + resourceId.toLowerCase() })[0];
|
||||
resource = ctx.server.resources.filter(function(r) { return r.name === resourceId.toLowerCase() })[0];
|
||||
|
||||
if (resource) {
|
||||
|
||||
@@ -103,7 +103,12 @@ Dashboard.prototype.route = function(ctx) {
|
||||
render(ctx, options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
resourceType = resource.constructor;
|
||||
|
||||
debug("Editing resource %s of type %s", resourceId, resourceType.name);
|
||||
|
||||
if (resourceType.dashboard) {
|
||||
|
||||
if (resourceType.dashboard.pages) {
|
||||
|
||||
Reference in New Issue
Block a user