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

Side by Side Diff: appengine/config_service/ui/src/config-ui/front-page.html

Issue 2936423002: config_service: add routing for config-set page. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 Copyright 2017 The LUCI Authors. All rights reserved. 2 Copyright 2017 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-layout/app-layout.html"> 7 <link rel="import" href="../../bower_components/app-layout/app-layout.html">
8 <link rel="import" href="config-card.html">
9 <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html"> 8 <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
10 <link rel="import" href="../../bower_components/paper-button/paper-button.html"> 9 <link rel="import" href="../../bower_components/paper-button/paper-button.html">
11 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht ml"> 10 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht ml">
12 <link rel="import" href="../../bower_components/polymer/polymer.html"> 11 <link rel="import" href="../../bower_components/polymer/polymer.html">
13 12
13 <link rel="import" href="config-set-card.html">
14
14 <dom-module id="front-page"> 15 <dom-module id="front-page">
15 <template> 16 <template>
16 <style> 17 <style>
17 app-toolbar {
18 background-color: #efefef;
19 color: #232323;
20 }
21
22 app-header {
23 @apply --layout-fixed-top;
24 }
25
26 .center { 18 .center {
27 width: 50%; 19 width: 50%;
28 margin: auto; 20 margin: auto;
29 text-align: center; 21 text-align: center;
30 } 22 }
31 23
32 .logo {
33 height: 100%;
34 }
35
36 .title {
37 padding-left: 1%;
38 font-size: 150%;
39 font-family: sans-serif;
40 }
41
42 .search-bar { 24 .search-bar {
43 padding-top: 7%; 25 padding-top: 7%;
44 padding-bottom: 2%; 26 padding-bottom: 2%;
45 } 27 }
46 28
47 paper-search-bar { 29 paper-search-bar {
48 border-style: solid; 30 border-style: solid;
49 border-width: 2px; 31 border-width: 2px;
50 width: 40%; 32 width: 40%;
51 height: 100%; 33 height: 100%;
52 margin: auto; 34 margin: auto;
53 } 35 }
54 </style> 36 </style>
55 37
56 <app-header reveals>
57 <app-toolbar>
58 <image class="logo" src="/static/images/chromium.png"/>
59 <div class="title" main-title>Configuration Service (not fully implement ed)</div>
60 </app-toolbar>
61 </app-header>
62
63 <iron-ajax 38 <iron-ajax
64 auto 39 auto
65 id="requestConfigs" 40 id="requestConfigs"
66 url="/_ah/api/config/v1/config-sets" 41 url="https://luci-config.appspot.com/_ah/api/config/v1/config-sets"
Ryan Tseng 2017/06/15 18:55:56 In general, don't use full URLs. Use relative URL
ayanaadylova 2017/06/15 21:26:01 Done.
67 handle-as="json" 42 handle-as="json"
68 on-response="_onGotConfigSets"> 43 on-response="_onGotConfigSets">
69 </iron-ajax> 44 </iron-ajax>
70 45
71 <div class="search-bar"> 46 <div class="search-bar">
72 <paper-search-bar query="{{query}}"></paper-search-bar> 47 <paper-search-bar query="{{query}}"></paper-search-bar>
73 </div> 48 </div>
74 49
75 <div class="config-list"> 50 <div class="config-list">
76 <template is="dom-if" if="[[isLoading]]"> 51 <template is="dom-if" if="[[isLoading]]">
77 <div class="center">Fetching config sets...</div> 52 <div class="center">Fetching config sets...</div>
78 </template> 53 </template>
79 <template is="dom-if" if="[[_not(isLoading)]]"> 54 <template is="dom-if" if="[[_not(isLoading)]]">
80 <template is="dom-if" if="[[_isEmpty(searchResults)]]"> 55 <template is="dom-if" if="[[_isEmpty(searchResults)]]">
81 <div class="center">No config sets found.</div> 56 <div class="center">No config sets found.</div>
82 </template> 57 </template>
83 <template is="dom-if" if="[[_not(_isEmpty(searchResults))]]"> 58 <template is="dom-if" if="[[_not(_isEmpty(searchResults))]]">
84 <template is="dom-repeat" items="[[searchResults]]" as="config"> 59 <template is="dom-repeat" items="[[searchResults]]" as="config">
85 <config-card name="[[config.config_set]]"></config-card> 60 <div on-click="_handleClick">
seanmccullough1 2017/06/15 19:50:01 do you need this on-click handler on the wrapper d
ayanaadylova 2017/06/15 21:26:01 Done.
61 <config-set-card name="[[config.config_set]]"></config-set-card>
62 </div>
86 </template> 63 </template>
87 </template> 64 </template>
88 </template> 65 </template>
89 </div> 66 </div>
90 </template> 67 </template>
91 68
92 <script> 69 <script>
93 Polymer({ 70 Polymer({
94 is: 'front-page', 71 is: 'front-page',
95 72
(...skipping 28 matching lines...) Expand all
124 this._updateSearchResults(); 101 this._updateSearchResults();
125 this.isLoading = false; 102 this.isLoading = false;
126 }, 103 },
127 104
128 _not: function(b) { 105 _not: function(b) {
129 return !b; 106 return !b;
130 }, 107 },
131 108
132 _updateSearchResults: function() { 109 _updateSearchResults: function() {
133 this.searchResults = this.configSetList.filter(e => e.config_set.include s(this.query)); 110 this.searchResults = this.configSetList.filter(e => e.config_set.include s(this.query));
134 } 111 },
112
113 _handleClick: function(event) {
114 window.location = window.location.href + event.model.config.config_set;
115 },
116
135 }); 117 });
136 </script> 118 </script>
137 </dom-module> 119 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698