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

Unified Diff: web/inc/logdog-query-view/logdog-query-panel.html

Issue 2991253003: [logdog] Replace list view with query view. (Closed)
Patch Set: handle enter for submit Created 3 years, 4 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
« no previous file with comments | « web/inc/logdog-list-view/logdog-list-view.html ('k') | web/inc/logdog-query-view/logdog-query-view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: web/inc/logdog-query-view/logdog-query-panel.html
diff --git a/web/inc/logdog-query-view/logdog-query-panel.html b/web/inc/logdog-query-view/logdog-query-panel.html
new file mode 100644
index 0000000000000000000000000000000000000000..eddedaf3bd3829106aef476dd32c35a8412a50ce
--- /dev/null
+++ b/web/inc/logdog-query-view/logdog-query-panel.html
@@ -0,0 +1,112 @@
+<!--
+ Copyright 2016 The LUCI Authors. All rights reserved.
+ Use of this source code is governed under the Apache License, Version 2.0
+ that can be found in the LICENSE file.
+ -->
+
+<link rel="import" href="../bower_components/polymer/polymer.html">
+<link rel="import" href="../bower_components/iron-form/iron-form.html">
+<link rel="import" href="../bower_components/paper-input/paper-input.html">
+<link rel="import" href="../bower_components/paper-button/paper-button.html">
+<link rel="import" href="../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
+<link rel="import" href="../bower_components/paper-listbox/paper-listbox.html">
+<link rel="import" href="../bower_components/paper-item/paper-item.html">
+<link rel="import" href="../logdog-styles/app-theme.html">
+
+
+<!--
+An element for fetching complete LogDog log streams.
+-->
+<dom-module id="logdog-query-panel">
+
+ <style>
+ paper-button.indigo {
+ background-color: var(--paper-indigo-500);
+ color: white;
+ --paper-button-raised-keyboard-focus: {
+ background-color: var(--paper-pink-a200) !important;
+ color: white !important;
+ };
+ }
+ </style>
+
+ <template>
+
+ <iron-form id="form">
+ <paper-input
+ label="Project"
+ value="{{project}}"
+ on-keydown="_maybeSubmit"
+ required
+ auto-validate
+ error-message="A project is required.">
+ </paper-input>
+
+ <paper-input
+ label="Path Query"
+ value="{{path}}"
+ on-keydown="_maybeSubmit">
+ </paper-input>
+
+ <paper-dropdown-menu label="Stream Type" value="{{streamType}}">
+ <paper-listbox class="dropdown-content" selected="0">
+ <paper-item>Text</paper-item>
+ <paper-item>Binary</paper-item>
+ <paper-item>Datagram</paper-item>
+ <paper-item>Any</paper-item>
+ </paper-listbox>
+ </paper-dropdown-menu>
+
+ <paper-button
+ id="query"
+ class="indigo"
+ disabled$="[[_isQueryDisabled(project)]]"
+ on-tap="_handleQueryTap"
+ raised>
+ Query
+ </paper-button>
+ </iron-form>
+
+ </template>
+
+</dom-module>
+
+<script>
+ Polymer({
+ is: "logdog-query-panel",
+ properties: {
+
+ /** The log stream path to query. */
+ project: {
+ type: String,
+ notify: true,
+ },
+
+ /** The log stream path to query. */
+ path: {
+ type: String,
+ notify: true,
+ },
+
+ /** The stream type. */
+ streamType: {
+ type: String,
+ notify: true,
+ },
+ },
+
+ _isQueryDisabled(project) {
+ return (!project);
+ },
+
+ _handleQueryTap: function() {
+ this.dispatchEvent(new CustomEvent('query-selected'));
+ },
+
+ _maybeSubmit: function(e) {
+ if (e.key === 'Enter' && !this._isQueryDisabled(this.project)) {
+ this._handleQueryTap();
+ }
+ },
+ });
+</script>
« no previous file with comments | « web/inc/logdog-list-view/logdog-list-view.html ('k') | web/inc/logdog-query-view/logdog-query-view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698