Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: server/static/rpcexplorer/rpc-service-list.html

Issue 1695893004: RPC Explorer (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@rpcepxlorer-deps
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b982bc2c4244d2725775f211b002a3518ffb06f0
--- /dev/null
+++ b/server/static/rpcexplorer/rpc-service-list.html
@@ -0,0 +1,55 @@
+<!--
+ ~ // 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="/static/common/third_party/polymer/polymer.html">
+
+<link rel="import" href="rpc-call.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]]">
+ <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: {
+ description: Object, // FileDescriptorSet message
+ 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.
+ services: {
+ type: Array, // of objects { name: String, comment: String }
+ 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') {
+ result.push({
+ name: names[i],
+ comments: svc.desc.source_code_info && svc.desc.source_code_info.leading_comments
Bons 2016/02/13 17:18:28 80 chars
nodir 2016/02/17 02:02:13 Done.
+ });
+ }
+ }
+ return result;
+ }
+ });
+ </script>
+</dom-module>

Powered by Google App Engine
This is Rietveld 408576698