OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright 2016 The LUCI Authors. All rights reserved. | 2 Copyright 2016 The LUCI Authors. All rights reserved. |
3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
5 --> | 5 --> |
6 | 6 |
7 <link rel="import" href="../bower_components/app-router/app-router.html"> | 7 <link rel="import" href="../bower_components/app-router/app-router.html"> |
8 <link rel="import" href="../bower_components/polymer/polymer.html"> | 8 <link rel="import" href="../bower_components/polymer/polymer.html"> |
9 <link rel="import" | 9 <link rel="import" |
10 href="../bower_components/html5-history-anchor/html5-history-anchor.html"> | 10 href="../bower_components/html5-history-anchor/html5-history-anchor.html"> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 data-toggle="collapse" | 57 data-toggle="collapse" |
58 aria-expanded="false"> | 58 aria-expanded="false"> |
59 <span class="sr-only">Toggle navigation</span> | 59 <span class="sr-only">Toggle navigation</span> |
60 <span class="icon-bar"></span> | 60 <span class="icon-bar"></span> |
61 <span class="icon-bar"></span> | 61 <span class="icon-bar"></span> |
62 <span class="icon-bar"></span> | 62 <span class="icon-bar"></span> |
63 </button> | 63 </button> |
64 <span class="navbar-brand"> | 64 <span class="navbar-brand"> |
65 <span id="progress-spinner" class="not-spinning"> | 65 <span id="progress-spinner" class="not-spinning"> |
66 <a is="html5-history-anchor" pushstate popstate | 66 <a is="html5-history-anchor" pushstate popstate |
67 href="[[rootPath]]">RPC Explorer</a> | 67 href="[[explorerRootPath]]">RPC Explorer</a> |
68 </span> | 68 </span> |
69 </span> | 69 </span> |
70 </div> | 70 </div> |
71 | 71 |
72 <div class="navbar-collapse collapse"> | 72 <div class="navbar-collapse collapse"> |
73 <div class="nav navbar-nav navbar-right"> | 73 <div class="nav navbar-nav navbar-right"> |
74 <div id="signinContainer"> | 74 <div id="signinContainer"> |
75 <auth-signin client-id="[[clientId]]"></auth-signin> | 75 <auth-signin client-id="[[clientId]]"></auth-signin> |
76 </div> | 76 </div> |
77 </div> | 77 </div> |
78 </div> | 78 </div> |
79 | 79 |
80 </div> | 80 </div> |
81 | 81 |
82 <ol class="breadcrumb"> | 82 <ol class="breadcrumb"> |
83 <li> | 83 <li> |
84 <a is="html5-history-anchor" pushstate popstate | 84 <a is="html5-history-anchor" pushstate popstate |
85 href="[[rootPath]]/services/">Home</a> | 85 href="[[explorerRootPath]]/services/">Home</a> |
86 </li> | 86 </li> |
87 <li hidden="[[!service]]"> | 87 <li hidden="[[!service]]"> |
88 <a is="html5-history-anchor" pushstate popstate | 88 <a is="html5-history-anchor" pushstate popstate |
89 href="[[rootPath]]/services/[[service]]/">[[service]]</a> | 89 href="[[explorerRootPath]]/services/[[service]]/">[[service]]</a> |
90 </li> | 90 </li> |
91 <li hidden="[[!method]]"> | 91 <li hidden="[[!method]]"> |
92 <a is="html5-history-anchor" pushstate popstate | 92 <a is="html5-history-anchor" pushstate popstate |
93 href="[[rootPath]]/services/[[service]]/[[method]]"> | 93 href="[[explorerRootPath]]/services/[[service]]/[[method]]"> |
94 [[method]] | 94 [[method]] |
95 </a> | 95 </a> |
96 </li> | 96 </li> |
97 </ol> | 97 </ol> |
98 | 98 |
99 <template is="dom-if" if="[[loadingDescription]]"> | 99 <template is="dom-if" if="[[loadingDescription]]"> |
100 <div id="loadingContainer"> | 100 <div id="loadingContainer"> |
101 <paper-spinner alt="Loading description" active></paper-spinner> | 101 <paper-spinner alt="Loading description" active></paper-spinner> |
102 </div> | 102 </div> |
103 </template> | 103 </template> |
(...skipping 16 matching lines...) Expand all Loading... |
120 </app-router> | 120 </app-router> |
121 </template> | 121 </template> |
122 | 122 |
123 <script> | 123 <script> |
124 'use strict'; | 124 'use strict'; |
125 | 125 |
126 Polymer({ | 126 Polymer({ |
127 is: 'rpc-explorer', | 127 is: 'rpc-explorer', |
128 | 128 |
129 properties: { | 129 properties: { |
130 rootPath: { | 130 explorerRootPath: { |
131 type: String, | 131 type: String, |
132 value: '', | 132 value: '', |
133 observer: '_onRootPathChanged' | 133 observer: '_onExplorerRootPathChanged' |
134 }, | 134 }, |
135 | 135 |
136 clientId: String, | 136 clientId: String, |
137 | 137 |
138 service: String, | 138 service: String, |
139 | 139 |
140 method: String, | 140 method: String, |
141 | 141 |
142 /** @type {DescribeResponse} */ | 142 /** @type {DescribeResponse} */ |
143 serverDescription: { | 143 serverDescription: { |
144 type: Object, | 144 type: Object, |
145 observer: '_onServerDescriptionChanged' | 145 observer: '_onServerDescriptionChanged' |
146 } | 146 } |
147 }, | 147 }, |
148 | 148 |
149 _onRootPathChanged: function (newVal) { | 149 _onExplorerRootPathChanged: function (newVal) { |
150 // The app-router element does not like data-binding in its attributes | 150 // The app-router element does not like data-binding in its attributes |
151 // so we update their values manually. | 151 // so we update their values manually. |
152 var rootPath = newVal || '', | 152 var explorerRootPath = newVal || '', |
153 servicesPath = rootPath + '/services/', | 153 servicesPath = explorerRootPath + '/services/', |
154 servicePath = servicesPath + ':service/', | 154 servicePath = servicesPath + ':service/', |
155 methodPath = servicePath + ':method'; | 155 methodPath = servicePath + ':method'; |
156 this.$.servicesRoute.setAttribute('path', servicesPath); | 156 this.$.servicesRoute.setAttribute('path', servicesPath); |
157 this.$.serviceRoute.setAttribute('path', servicePath); | 157 this.$.serviceRoute.setAttribute('path', servicePath); |
158 this.$.methodRoute.setAttribute('path', methodPath); | 158 this.$.methodRoute.setAttribute('path', methodPath); |
159 this.$.catchAllRoute.setAttribute('redirect', servicesPath); | 159 this.$.catchAllRoute.setAttribute('redirect', servicesPath); |
160 }, | 160 }, |
161 | 161 |
162 _onRouteBinding: function(e) { | 162 _onRouteBinding: function(e) { |
163 if (this.serverDescription) { | 163 if (this.serverDescription) { |
(...skipping 11 matching lines...) Expand all Loading... |
175 }, | 175 }, |
176 | 176 |
177 _onRouted: function(e) { | 177 _onRouted: function(e) { |
178 var model = e.detail.model || {}; | 178 var model = e.detail.model || {}; |
179 this.service = model.service || ''; | 179 this.service = model.service || ''; |
180 this.method = model.method || ''; | 180 this.method = model.method || ''; |
181 } | 181 } |
182 }); | 182 }); |
183 </script> | 183 </script> |
184 </dom-module> | 184 </dom-module> |
OLD | NEW |