Chromium Code Reviews| Index: server/static/rpcexplorer/rpc-service-list.html |
| diff --git a/server/static/rpcexplorer/rpc-service-list.html b/server/static/rpcexplorer/rpc-service-list.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2ddf18e9d8331d341065f3eb4f3a336d7064b74a |
| --- /dev/null |
| +++ b/server/static/rpcexplorer/rpc-service-list.html |
| @@ -0,0 +1,60 @@ |
| +<!-- |
| + Copyright 2016 The Chromium Authors. All rights reserved. |
| + Use of this source code is governed by a BSD-style license that can be |
| + found in the LICENSE file. |
| + --> |
| + |
| +<link rel="import" href="../bower_components/polymer/polymer.html"> |
| + |
| +<link rel="import" href="rpc-descriptor-util.html"> |
| + |
| +<!-- The `rpc-service-list` is a service list page --> |
| +<dom-module id="rpc-service-list"> |
| + <template> |
| + <p>Services:</p> |
| + <ul> |
| + <template is="dom-repeat" items="[[services]]"> |
|
Bons
2016/02/23 15:52:29
to make more explicit use as="service" so that you
nodir
2016/02/23 18:32:26
Done
|
| + <li> |
| + <a href="#/services/[[item.name]]">[[item.name]]</a> |
| + <span class="text-muted comment">[[item.comments]]</span> |
| + </li> |
| + </template> |
| + </ul> |
| + </template> |
| + <script> |
| + 'use strict'; |
| + |
| + Polymer({ |
| + is: 'rpc-service-list', |
| + |
| + properties: { |
| + /** @type {FileDescriptorSet} |
| + description: Object, |
| + |
| + /** @type {Array.<string>} */ |
| + serviceNames: Array, |
| + |
| + /** @type {Array.<{name: string, comment: string}>} */ |
| + services: { |
| + type: Array, |
| + computed: '_resolveServices(description, serviceNames)' |
| + } |
| + }, |
| + |
| + _resolveServices: function(desc, names) { |
| + var result = []; |
| + for (var i = 0; i < names.length; i++) { |
| + var svc = rpcExplorer.descUtil.resolve(desc, names[i]); |
| + if (svc && svc.type === 'service') { |
| + var info = svc.desc.source_code_info; |
| + result.push({ |
| + name: names[i], |
| + comments: info && info.leading_comments |
| + }); |
| + } |
| + } |
| + return result; |
| + } |
| + }); |
| + </script> |
| +</dom-module> |