Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!-- | |
| 2 Copyright 2016 The LUCI Authors. All rights reserved. | |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | |
| 4 that can be found in the LICENSE file. | |
| 5 --> | |
| 6 | |
| 7 <link rel="import" href="../bower_components/polymer/polymer.html"> | |
| 8 <link rel="import" href="../bower_components/iron-form/iron-form.html"> | |
| 9 <link rel="import" href="../bower_components/paper-input/paper-input.html"> | |
| 10 <link rel="import" href="../bower_components/paper-button/paper-button.html"> | |
| 11 <link rel="import" href="../bower_components/paper-dropdown-menu/paper-dropdown- menu.html"> | |
| 12 <link rel="import" href="../bower_components/paper-listbox/paper-listbox.html"> | |
| 13 <link rel="import" href="../bower_components/paper-item/paper-item.html"> | |
| 14 <link rel="import" href="../logdog-styles/app-theme.html"> | |
| 15 | |
| 16 | |
| 17 <!-- | |
| 18 An element for fetching complete LogDog log streams. | |
| 19 --> | |
| 20 <dom-module id="logdog-query-panel"> | |
| 21 | |
| 22 <style> | |
| 23 paper-button.indigo { | |
| 24 background-color: var(--paper-indigo-500); | |
| 25 color: white; | |
| 26 --paper-button-raised-keyboard-focus: { | |
| 27 background-color: var(--paper-pink-a200) !important; | |
| 28 color: white !important; | |
| 29 }; | |
| 30 } | |
| 31 </style> | |
| 32 | |
| 33 <template> | |
| 34 | |
| 35 <iron-form id="form"> | |
| 36 <paper-input | |
| 37 label="Project" | |
| 38 value="{{project}}" | |
| 39 required | |
| 40 auto-validate | |
| 41 error-message="A project is required."> | |
| 42 </paper-input> | |
| 43 | |
| 44 <paper-input | |
| 45 label="Path Query" | |
| 46 value="{{path}}"> | |
| 47 </paper-input> | |
| 48 | |
| 49 <paper-dropdown-menu label="Stream Type" value="{{streamType}}"> | |
| 50 <paper-listbox class="dropdown-content" selected="0"> | |
| 51 <paper-item>Text</paper-item> | |
| 52 <paper-item>Binary</paper-item> | |
| 53 <paper-item>Datagram</paper-item> | |
| 54 <paper-item>Any</paper-item> | |
| 55 </paper-listbox> | |
| 56 </paper-dropdown-menu> | |
| 57 | |
| 58 <paper-button | |
| 59 id="query" | |
| 60 class="indigo" | |
| 61 disabled$="[[_isQueryDisabled(project)]]" | |
| 62 on-tap="_handleQueryTap" | |
| 63 raised> | |
| 64 Query | |
| 65 </paper-button> | |
| 66 </iron-form> | |
| 67 | |
| 68 </template> | |
| 69 | |
| 70 </dom-module> | |
| 71 | |
| 72 <script> | |
| 73 Polymer({ | |
| 74 is: "logdog-query-panel", | |
| 75 properties: { | |
| 76 | |
| 77 /** The log stream path to query. */ | |
| 78 project: { | |
| 79 type: String, | |
| 80 notify: true, | |
| 81 }, | |
| 82 | |
| 83 /** The log stream path to query. */ | |
| 84 path: { | |
| 85 type: String, | |
| 86 notify: true, | |
| 87 }, | |
| 88 | |
| 89 /** The stream type. */ | |
| 90 streamType: { | |
| 91 type: String, | |
| 92 notify: true, | |
| 93 }, | |
| 94 }, | |
| 95 | |
| 96 _isQueryDisabled(project) { | |
| 97 return (!project); | |
| 98 }, | |
| 99 | |
| 100 _handleQueryTap: function() { | |
| 101 this.dispatchEvent(new CustomEvent('query-selected')); | |
|
Ryan Tseng
2017/08/02 23:34:09
This should activate on pressing enter on any of t
dnj
2017/08/03 00:07:37
Done.
| |
| 102 } | |
| 103 }); | |
| 104 </script> | |
| OLD | NEW |