Repository: incubator-nifi Updated Branches: refs/heads/NIFI-292 b281d1216 -> 2783a058a
NIFI-292: - Continuing to template the REST documentation. - Code clean up. Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/2783a058 Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/2783a058 Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/2783a058 Branch: refs/heads/NIFI-292 Commit: 2783a058a6a9bfaa9b0263c02602c1c7ed84aecd Parents: b281d12 Author: Matt Gilman <[email protected]> Authored: Thu Apr 30 18:05:31 2015 -0400 Committer: Matt Gilman <[email protected]> Committed: Thu Apr 30 18:05:31 2015 -0400 ---------------------------------------------------------------------- .../apache/nifi/web/api/UserGroupResource.java | 3 +- .../src/main/resources/templates/index.html.hbs | 32 ++++++++- .../src/main/resources/templates/type.hbs | 68 +++++++++++--------- 3 files changed, 69 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2783a058/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserGroupResource.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserGroupResource.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserGroupResource.java index 3807f9a..087dc9d 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserGroupResource.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserGroupResource.java @@ -176,7 +176,8 @@ public class UserGroupResource extends ApplicationResource { @ApiParam( value = "The user group configuration details.", required = true - ) UserGroupEntity userGroupEntity) { + ) + UserGroupEntity userGroupEntity) { if (userGroupEntity == null || userGroupEntity.getUserGroup() == null) { throw new IllegalArgumentException("User group details must be specified."); http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2783a058/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs index 71d748d..7bd6e71 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs @@ -192,7 +192,28 @@ padding: 10px; background-color: #eee; font-size: 12px; + } + + div.type-container { overflow-y: scroll; + height: 415px; + border-bottom: 1px solid #ccc; + } + + div.close { + border: 1px solid #aaa; + background-color: #ddd; + float: right; + margin-top: 10px; + font-weight: bold; + height: 25px; + line-height: 25px; + padding: 0 10px; + cursor: pointer; + } + + div.close:hover { + background-color: #c8c8c8; } /* tables */ @@ -281,6 +302,10 @@ // hide any open type dialogs $('html').on('click', function() { $('div.type').hide(); + }).on('keydown', function(e) { + if (e.which === 27) { + $('div.type').hide(); + } }); // populate all paths - this is necessary because the @key @@ -294,7 +319,7 @@ // toggles the visibility of a given operation $('div.operation-handle').on('click', function () { - $(this).next('div.operation').toggle(); + $(this).next('div.operation').slideToggle(); }); // add support for clicking to view the definition of a type @@ -342,6 +367,11 @@ nestedExample.html(example); e.stopPropagation(); }); + + // handle close button + $('div.close').on('click', function() { + $(this).closest('div.type').hide(); + }); }); </script> </head> http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2783a058/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs index 3930816..925a8c8 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs @@ -14,38 +14,42 @@ --}} <div id="{{@key}}" class="type hidden"> <h3>{{@key}}</h3> - <table> - <tr> - <th>Name</th> - <th>Type</th> - <th>Required</th> - <th>Description</th> - </tr> - {{#each properties}} + <div class="type-container"> + <table> <tr> - <td>{{@key}}</td> - <td> - {{#ifeq type "array"}} - {{#items.$ref}} - {{type}}[<a class="type-link" href="javascript:void(0);">{{basename items.$ref}}</a>] - {{/items.$ref}} - {{^items.$ref}} - {{type}}[{{items.type}}] - {{/items.$ref}} - {{else}} - {{#$ref}} - <a class="type-link" href="javascript:void(0);">{{basename $ref}}</a> - {{/$ref}} - {{^$ref}} - {{type}}{{#format}} ({{format}}){{/format}} - {{/$ref}} - {{/ifeq}} - </td> - <td>{{#required}}required{{/required}}{{^required}}optional{{/required}}</td> - <td>{{#description}}{{{description}}}{{/description}}</td> + <th>Name</th> + <th>Type</th> + <th>Required</th> + <th>Description</th> </tr> - {{/each}} - </table> - <h4>Example</h4> - <code class="example"><span class="open-object">{{{> example}}}</span></code> + {{#each properties}} + <tr> + <td>{{@key}}</td> + <td> + {{#ifeq type "array"}} + {{#items.$ref}} + {{type}}[<a class="type-link" href="javascript:void(0);">{{basename items.$ref}}</a>] + {{/items.$ref}} + {{^items.$ref}} + {{type}}[{{items.type}}] + {{/items.$ref}} + {{else}} + {{#$ref}} + <a class="type-link" href="javascript:void(0);">{{basename $ref}}</a> + {{/$ref}} + {{^$ref}} + {{type}}{{#format}} ({{format}}){{/format}} + {{/$ref}} + {{/ifeq}} + </td> + <td>{{#required}}required{{/required}}{{^required}}optional{{/required}}</td> + <td>{{#description}}{{{description}}}{{/description}}</td> + </tr> + {{/each}} + </table> + <h4>Example JSON</h4> + <code class="example"><span class="open-object">{{{> example}}}</span></code> + </div> + <div class="close">Close</div> + <div class="clear"></div> </div> \ No newline at end of file
