Chromium Code Reviews| 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 | |
| 8 <link rel="import" href="/static/common/third_party/polymer/polymer.html"> | |
| 9 | |
| 10 <link rel="import" href="rpc-call.html"> | |
| 11 <link rel="import" href="rpc-descriptor-util.html"> | |
| 12 | |
| 13 <!-- The `rpc-service-list` is a service list page --> | |
| 14 <dom-module id="rpc-service-list"> | |
| 15 <template> | |
| 16 <p>Services:</p> | |
| 17 <ul> | |
| 18 <template is="dom-repeat" items="[[services]]"> | |
| 19 <li> | |
| 20 <a href="#/services/[[item.name]]">[[item.name]]</a> | |
| 21 <span class="text-muted comment">[[item.comments]]</span> | |
| 22 </li> | |
| 23 </template> | |
| 24 </ul> | |
| 25 </template> | |
| 26 <script> | |
| 27 'use strict'; | |
| 28 | |
| 29 Polymer({ | |
| 30 is: 'rpc-service-list', | |
| 31 properties: { | |
| 32 description: Object, // FileDescriptorSet message | |
| 33 serviceNames: Array, // of strings, | |
|
Bons
2016/02/13 17:18:28
if you're looking to be more clear what the types
nodir
2016/02/17 02:02:13
Done.
| |
| 34 services: { | |
| 35 type: Array, // of objects { name: String, comment: String } | |
| 36 computed: '_resolveServices(description, serviceNames)' | |
| 37 } | |
| 38 }, | |
| 39 | |
| 40 _resolveServices: function(desc, names) { | |
| 41 var result = []; | |
| 42 for (var i = 0; i < names.length; i++) { | |
| 43 var svc = rpcExplorer.descUtil.resolve(desc, names[i]); | |
| 44 if (svc && svc.type == 'service') { | |
| 45 result.push({ | |
| 46 name: names[i], | |
| 47 comments: svc.desc.source_code_info && svc.desc.source_code_info.l eading_comments | |
|
Bons
2016/02/13 17:18:28
80 chars
nodir
2016/02/17 02:02:13
Done.
| |
| 48 }); | |
| 49 } | |
| 50 } | |
| 51 return result; | |
| 52 } | |
| 53 }); | |
| 54 </script> | |
| 55 </dom-module> | |
| OLD | NEW |