http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/180534b1/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 new file mode 100644 index 0000000..3516247 --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs @@ -0,0 +1,355 @@ +<!DOCTYPE html> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<html> + <head> + <title>{{info.title}}-{{info.version}}</title> + <script type="text/javascript" src="../nifi/js/jquery/jquery-2.1.1.min.js"></script> + <script type="text/javascript"> + if (typeof window.jQuery === 'undefined') { + document.write(unescape('%3Cscript src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript" %3E%3C/script%3E')); + } + </script> + <style> + @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic|Noto+Serif:400,400italic,700,700italic|Droid+Sans+Mono:400"; + + html, html a { + -webkit-font-smoothing: antialiased; + text-shadow: 1px 1px 1px rgba(0,0,0,0.004); + } + + body { + width: 62.5em; + margin: 0 auto; + display: block; + font-family: "Open Sans", "DejaVu Sans", sans-serif; + } + + div.overview { + margin-bottom: 10px; + } + + div.endpoint { + margin-bottom: 10px; + } + + /* get */ + + div.endpoint.get { + border: 1px solid #174961; + } + + div.get div.operation-handle { + background-color: rgba(23, 73, 97, .15); + } + + div.get div.method { + background-color: #174961; + } + + div.get div.operation { + border-top: 1px solid #174961; + } + + /* post */ + + div.endpoint.post { + border: 1px solid #7298AC; + } + + div.post div.operation-handle { + background-color: rgba(114, 152, 172, .15); + } + + div.post div.method { + background-color: #7298AC; + } + + div.post div.operation { + border-top: 1px solid #7298AC; + } + + /* put */ + + div.endpoint.put { + border: 1px solid #063046; + } + + div.put div.operation-handle { + background-color: rgba(6, 48, 70, .15); + } + + div.put div.method { + background-color: #063046; + } + + div.put div.operation { + border-top: 1px solid #063046; + } + + /* delete */ + + div.endpoint.delete { + border: 1px solid #47758E; + } + + div.delete div.operation-handle { + background-color: rgba(71, 117, 142, .15); + } + + div.delete div.method { + background-color: #47758E; + } + + div.delete div.operation { + border-top: 1px solid #47758E; + } + + /* operations */ + + div.operation-handle { + cursor: pointer; + padding-right: 5px; + height: 22px; + } + + div.method { + float: left; + width: 75px; + color: #fff; + text-align: center; + background-color: #7098ad; + margin-right: 10px; + font-weight: bold; + } + + div.endpoint div.path { + float: left; + line-height: 22px; + } + + div.summary { + float: right; + font-size: 12px; + line-height: 22px; + } + + div.operation { + padding: 5px; + font-size: 12px; + } + + div.operation > div.title { + font-weight: bold; + color: #000; + } + + div.operation div.details { + margin-left: 5px; + margin-bottom: 5px; + color: #333; + } + + div.operation div.description { + margin-bottom: 10px; + } + + div.mediatype { + line-height: 16px; + } + + div.mediatype > div.title { + float: left; + width: 70px; + } + + div.mediatype div.title { + float: left; + } + + div.type { + position: fixed; + width: 800px; + height: 500px; + left: 50%; + top: 50%; + margin-left: -400px; + margin-top: -250px; + border: 3px solid #365C6A; + box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.9); + padding: 10px; + background-color: #eee; + font-size: 12px; + overflow-y: scroll; + } + + /* tables */ + + table { + background-color: #fefefe; + border: 1px solid #ccc; + border-left: 6px solid #ccc; + color: #555; + display: block; + margin-bottom: 12px; + padding: 5px 8px; + } + + table th { + font-weight: bold; + vertical-align:top; + text-align:left; + padding: 4px 15px; + border-width: 0; + white-space: nowrap; + } + + table td { + vertical-align:top; + text-align:left; + padding: 2px 15px; + border-width: 0; + white-space: nowrap; + } + + table td:last-child { + width: 99%; + white-space: normal; + } + + code.example { + background-color: #fefefe; + border: 1px solid #ccc; + border-left: 6px solid #ccc; + color: #555; + margin-bottom: 10px; + padding: 5px 8px; + white-space: pre; + display: block; + tab-size: 4; + -moz-tab-size: 4; + -o-tab-size: 4; + line-height: 20px + } + + span.nested.collapsed { + cursor: pointer; + border: 1px solid #7298AC; + background-color: rgba(114, 152, 172, .15); + padding: 1px; + } + + /* general */ + + .mono { + font-family: monospace; + } + + div.clear { + clear: both; + } + + .hidden { + display: none; + } + + a { + cursor: pointer; + color: #1e373f; + font-weight: normal; + } + + a:hover { + color: #264c58; + text-decoration: underline; + } + </style> + <script type="text/javascript"> + $(document).ready(function () { + // hide any open type dialogs + $('html').on('click', function() { + $('div.type').hide(); + }); + + // populate all paths - this is necessary because the @key + // doesn't seem to reset after iterating through a nested + // array or object + $('span.path').each(function() { + var path = $(this); + var endpoint = path.parent(); + endpoint.find('div.path').text(path.text()); + }); + + // toggles the visibility of a given operation + $('div.operation-handle').on('click', function () { + $(this).next('div.operation').toggle(); + }); + + // add support for clicking to view the definition of a type + $('a.type-link').on('click', function(e) { + // hide any previously shown dialogs + $('div.type').hide(); + + // show the type selected + var link = $(this); + var typeId = link.text(); + $('#' + typeId).show(); + e.stopPropagation(); + }); + + // prevent hiding when clicking on the type dialog + $('div.type').on('click', function(e) { + e.stopPropagation(); + }); + + // populate nested examples + $('code.example').on('click', 'span.nested', function(e) { + var nested = $(this).removeClass('collapsed'); + var nestedId = nested.find('span.nested-id'); + var nestedExample = nested.find('span.nested-example'); + + // get the id of the nested example + var typeId = nestedId.text(); + var example = $('#' + typeId + ' code.example').html(); + var depth = nestedId.parents('span.nested').length; + + // tab over as appropriate + example = example.replace(/(\r\n|\r|\n)/g, function(match) { + var tab = '\t'; + for (var i = 0; i < depth - 1; i++) { + tab += '\t'; + } + return match + tab; + }); + + // copy over the example + nestedExample.html(example); + e.stopPropagation(); + }); + }); + </script> + </head> + <body> + <div class="overview"> + <div class="title">{{info.title}}-{{info.version}}</div> + </div> + {{#each paths}} + {{> endpoint}} + {{/each}} + {{#each definitions}} + {{> type}} + {{/each}} + </body> +</html> \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/180534b1/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/operation.hbs ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/operation.hbs b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/operation.hbs new file mode 100644 index 0000000..8c626bb --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/operation.hbs @@ -0,0 +1,112 @@ +{{!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--}} +<div class="operation hidden"> + {{#if description}} + <div class="description"> + {{description}} + </div> + {{/if}} + <div class="title">Request</div> + <div class="mediatypes details"> + {{#if consumes}} + <div class="mediatype"><div class="title">consumes:</div><div class="mono">{{join consumes ", "}}</div><div class="clear"></div></div> + {{/if}} + </div> + {{#if parameters}} + <table> + <thead> + <tr> + <th>Name</th> + <th>Location</th> + <th>Required</th> + <th>Type</th> + <th>Description</th> + </tr> + </thead> + <tbody> + {{/if}} + {{#each parameters}} + <tr> + <td>{{#ifeq in "body"}}{{else}}{{name}}{{/ifeq}}</td> + <td>{{in}}</td> + <td> + {{#ifeq in "body"}} + yes + {{else}} + {{#if required}}yes{{else}}no{{/if}} + {{/ifeq}} + </td> + {{#ifeq in "body"}} + <td> + {{#ifeq schema.type "array"}}Array[<a class="type-link" href="javascript:void(0);">{{basename schema.items.$ref}}</a>]{{/ifeq}} + {{#schema.$ref}}<a class="type-link" href="javascript:void(0);">{{basename schema.$ref}}</a> {{/schema.$ref}} + </td> + {{else}} + {{#ifeq type "array"}} + <td>Array[{{items.type}}] ({{collectionFormat}})</td> + {{else}} + {{#ifeq type "ref"}} + <td>string</td> + {{else}} + <td>{{type}} {{#format}}({{format}}){{/format}}</td> + {{/ifeq}} + {{/ifeq}} + {{/ifeq}} + <td>{{description}}</td> + </tr> + {{/each}} + {{#if parameters}} + </tbody> + </table> + {{/if}} + <div class="title">Response</div> + <div class="mediatypes details"> + {{#if produces}} + <div class="mediatype"><div class="title">produces:</div><div class="mono">{{join produces ", "}}</div><div class="clear"></div></div> + {{/if}} + </div> + <table> + <thead> + <tr> + <th>Status Code</th> + <th>Type</th> + <th>Description</th> + </tr> + </thead> + <tbody> + {{#each responses}} + <tr> + <td>{{@key}}</td> + <td> + {{#if schema}} + {{#schema.$ref}}<a class="type-link" href="javascript:void(0);">{{basename schema.$ref}}</a>{{/schema.$ref}} + {{else}} + string + {{/if}} + </td> + <td>{{description}}</td> + </tr> + {{/each}} + </tbody> + </table> + <div class="title">Authorization</div> + <div class="authorization details"> + {{#security}} + {{#each this}} + <div>{{@key}}</div> + {{/each}} + {{/security}} + </div> +</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/180534b1/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 new file mode 100644 index 0000000..08f7a02 --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs @@ -0,0 +1,51 @@ +{{!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--}} +<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}} + <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</h4> + <code class="example">{{{> example}}}</code> +</div> \ No newline at end of file
