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

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

Issue 2962703003: config_service: Add authentication to the UI. (Closed)
Patch Set: Added the modified file. Changes can be seen by clicking on Delta from patch set 2. Created 3 years, 5 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="config-file-card.html"> 7 <link rel="import" href="config-file-card.html">
8 <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html"> 8 <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
9 <link rel="import" href="../../bower_components/paper-item/paper-item.html"> 9 <link rel="import" href="../../bower_components/paper-item/paper-item.html">
10 <link rel="import" href="../../bower_components/polymer/polymer.html"> 10 <link rel="import" href="../../bower_components/polymer/polymer.html">
(...skipping 16 matching lines...) Expand all
27 font-size: 200%; 27 font-size: 200%;
28 font-family: sans-serif; 28 font-family: sans-serif;
29 } 29 }
30 30
31 .title { 31 .title {
32 padding-bottom: 1%; 32 padding-bottom: 1%;
33 padding-top: 5%; 33 padding-top: 5%;
34 } 34 }
35 </style> 35 </style>
36 36
37 <iron-ajax 37 <template is="dom-if" if="[[!hidden]]">
38 auto 38 <iron-ajax
39 id="requestConfigs" 39 auto
40 url="/_ah/api/config/v1/config-sets?config_set=[[category]]%2F[[name]]&i nclude_files=true" 40 id="requestConfigs"
41 handle-as="json" 41 url="/_ah/api/config/v1/config-sets?config_set=[[category]]/[[name]][[ route.path]]&include_files=true"
42 on-response="_onGotConfigFiles"> 42 handle-as="json"
43 </iron-ajax> 43 on-response="_onGotConfigFiles"
44 headers="{{auth_headers}}">
45 </iron-ajax>
46 </template>
44 47
45 <div class="center title"> 48 <div class="center title">
46 <div class="name">[[name]][[route.path]]</div> 49 <div class="name">[[name]][[route.path]]</div>
47 <div class="category">[[_formatCategory(category)]]</div> 50 <div class="category">[[_formatCategory(category)]]</div>
48 </div> 51 </div>
49 52
50 <template is="dom-if" if="[[isLoading]]"> 53 <template is="dom-if" if="[[isLoading]]">
51 <div class="center">Fetching config files...</div> 54 <div class="center">Fetching config files...</div>
52 </template> 55 </template>
53 <template is="dom-if" if="[[_not(isLoading)]]"> 56 <template is="dom-if" if="[[!isLoading]]">
54 <template is="dom-repeat" items="[[files]]" as="file"> 57 <template is="dom-repeat" items="[[files]]" as="file">
55 <config-file-card 58 <config-file-card
56 name="[[file.path]]" link="[[location]]/[[file.path]]"> 59 name="[[file.path]]" link="[[location]]/[[file.path]]">
57 </config-file-card> 60 </config-file-card>
58 </template> 61 </template>
59 </template> 62 </template>
60 </template> 63 </template>
61 <script> 64 <script>
62 Polymer({ 65 Polymer({
63 is: "config-set", 66 is: "config-set",
(...skipping 19 matching lines...) Expand all
83 name: { 86 name: {
84 type: String 87 type: String
85 } 88 }
86 }, 89 },
87 90
88 _formatCategory: function(category) { 91 _formatCategory: function(category) {
89 if (category === "projects") return "Project"; 92 if (category === "projects") return "Project";
90 if (category === "services") return "Service"; 93 if (category === "services") return "Service";
91 }, 94 },
92 95
93 _not: function(b) {
94 return !b;
95 },
96
97 _onGotConfigFiles: function(event) { 96 _onGotConfigFiles: function(event) {
98 this.files = event.detail.response.config_sets[0].files; 97 this.files = event.detail.response.config_sets[0].files;
99 this.location = event.detail.response.config_sets[0].location; 98 this.location = event.detail.response.config_sets[0].location;
100 this.isLoading = false; 99 this.isLoading = false;
101 } 100 }
102 }); 101 });
103 </script> 102 </script>
104 </dom-module> 103 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698