OLD | NEW |
---|---|
(Empty) | |
1 <!-- | |
2 Copyright 2016 The Chromium Authors. All rights reserved. | |
3 Use of this source code is governed by a BSD-style license that can be | |
4 found in the LICENSE file. | |
5 --> | |
6 | |
7 <link rel="import" href="../bower_components/polymer/polymer.html"> | |
8 | |
9 <link rel="import" href="rpc-descriptor-util.html"> | |
10 | |
11 <!-- The `rpc-service-list` is a service list page --> | |
12 <dom-module id="rpc-service-list"> | |
13 <template> | |
14 <p>Services:</p> | |
15 <ul> | |
16 <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
| |
17 <li> | |
18 <a href="#/services/[[item.name]]">[[item.name]]</a> | |
19 <span class="text-muted comment">[[item.comments]]</span> | |
20 </li> | |
21 </template> | |
22 </ul> | |
23 </template> | |
24 <script> | |
25 'use strict'; | |
26 | |
27 Polymer({ | |
28 is: 'rpc-service-list', | |
29 | |
30 properties: { | |
31 /** @type {FileDescriptorSet} | |
32 description: Object, | |
33 | |
34 /** @type {Array.<string>} */ | |
35 serviceNames: Array, | |
36 | |
37 /** @type {Array.<{name: string, comment: string}>} */ | |
38 services: { | |
39 type: Array, | |
40 computed: '_resolveServices(description, serviceNames)' | |
41 } | |
42 }, | |
43 | |
44 _resolveServices: function(desc, names) { | |
45 var result = []; | |
46 for (var i = 0; i < names.length; i++) { | |
47 var svc = rpcExplorer.descUtil.resolve(desc, names[i]); | |
48 if (svc && svc.type === 'service') { | |
49 var info = svc.desc.source_code_info; | |
50 result.push({ | |
51 name: names[i], | |
52 comments: info && info.leading_comments | |
53 }); | |
54 } | |
55 } | |
56 return result; | |
57 } | |
58 }); | |
59 </script> | |
60 </dom-module> | |
OLD | NEW |