| OLD | NEW |
| 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 19 matching lines...) Expand all Loading... |
| 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 <iron-ajax |
| 38 auto | 38 auto |
| 39 id="requestConfigs" | 39 id="requestConfigs" |
| 40 url="/_ah/api/config/v1/config-sets?config_set=[[category]]%2F[[name]]&i
nclude_files=true" | 40 url="/_ah/api/config/v1/config-sets?config_set=[[category]]/[[name]][[ro
ute.path]]&include_files=true" |
| 41 handle-as="json" | 41 handle-as="json" |
| 42 on-response="_onGotConfigFiles"> | 42 on-response="_onGotConfigFiles" |
| 43 headers="[[auth_headers]]"> |
| 43 </iron-ajax> | 44 </iron-ajax> |
| 44 | 45 |
| 45 <div class="center title"> | 46 <div class="center title"> |
| 46 <div class="name">[[name]][[route.path]]</div> | 47 <div class="name">[[name]][[route.path]]</div> |
| 47 <div class="category">[[_formatCategory(category)]]</div> | 48 <div class="category">[[_formatCategory(category)]]</div> |
| 48 </div> | 49 </div> |
| 49 | 50 |
| 50 <template is="dom-if" if="[[isLoading]]"> | 51 <template is="dom-if" if="[[isLoading]]"> |
| 51 <div class="center">Fetching config files...</div> | 52 <div class="center">Fetching config files...</div> |
| 52 </template> | 53 </template> |
| 53 <template is="dom-if" if="[[_not(isLoading)]]"> | 54 <template is="dom-if" if="[[!isLoading]]"> |
| 54 <template is="dom-repeat" items="[[files]]" as="file"> | 55 <template is="dom-repeat" items="[[files]]" as="file"> |
| 55 <config-file-card | 56 <config-file-card |
| 56 name="[[file.path]]" link="[[location]]/[[file.path]]"> | 57 name="[[file.path]]" link="[[location]]/[[file.path]]"> |
| 57 </config-file-card> | 58 </config-file-card> |
| 58 </template> | 59 </template> |
| 59 </template> | 60 </template> |
| 60 </template> | 61 </template> |
| 61 <script> | 62 <script> |
| 62 Polymer({ | 63 Polymer({ |
| 63 is: "config-set", | 64 is: "config-set", |
| (...skipping 19 matching lines...) Expand all Loading... |
| 83 name: { | 84 name: { |
| 84 type: String | 85 type: String |
| 85 } | 86 } |
| 86 }, | 87 }, |
| 87 | 88 |
| 88 _formatCategory: function(category) { | 89 _formatCategory: function(category) { |
| 89 if (category === "projects") return "Project"; | 90 if (category === "projects") return "Project"; |
| 90 if (category === "services") return "Service"; | 91 if (category === "services") return "Service"; |
| 91 }, | 92 }, |
| 92 | 93 |
| 93 _not: function(b) { | |
| 94 return !b; | |
| 95 }, | |
| 96 | |
| 97 _onGotConfigFiles: function(event) { | 94 _onGotConfigFiles: function(event) { |
| 98 this.files = event.detail.response.config_sets[0].files; | 95 this.files = event.detail.response.config_sets[0].files; |
| 99 this.location = event.detail.response.config_sets[0].location; | 96 this.location = event.detail.response.config_sets[0].location; |
| 100 this.isLoading = false; | 97 this.isLoading = false; |
| 101 } | 98 } |
| 102 }); | 99 }); |
| 103 </script> | 100 </script> |
| 104 </dom-module> | 101 </dom-module> |
| OLD | NEW |